EDM4eic
EIC data model
Loading...
Searching...
No Matches
ReconstructedParticle.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_ReconstructedParticle_H
4#define EDM4EIC_ReconstructedParticle_H
5
7
8#include "edm4eic/Cluster.h"
9#include "edm4eic/Cov4f.h"
10#include "edm4eic/Track.h"
11#include "edm4hep/ParticleID.h"
12#include "edm4hep/Vector3f.h"
13#include "podio/RelationRange.h"
14#include <cstdint>
15#include <vector>
16
17#include "podio/utilities/MaybeSharedPtr.h"
18
19#include <ostream>
20#include <cstddef>
21
22#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
23#include "nlohmann/json_fwd.hpp"
24#endif
25
26// forward declarations
27namespace edm4eic {
28class Vertex;
29class MutableVertex;
30}
31namespace edm4hep {
32class ParticleID;
33class MutableParticleID;
34}
35
36
37namespace edm4eic {
38
39class MutableReconstructedParticle;
40class ReconstructedParticleCollection;
41class ReconstructedParticleCollectionData;
42
43/** @class ReconstructedParticle
44 * EIC Reconstructed Particle
45 * @author: W. Armstrong, S. Joosten, F. Gaede
46 */
48
53
54public:
57
58 /// default constructor
60
61 /// Constructor initializing all members
62 ReconstructedParticle(std::int32_t type, float energy, edm4hep::Vector3f momentum, edm4hep::Vector3f referencePoint, float charge, float mass, float goodnessOfPID, edm4eic::Cov4f covMatrix, std::int32_t PDG);
63
64 /// copy constructor
66
67 /// copy-assignment operator
69
70 /// create a mutable deep-copy of the object with identical relations
72
73 /// destructor
75
76
78
79public:
80
81 /// Access the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeNames and ReconstructedParticleTypeValues.
82 std::int32_t getType() const;
83
84 /// Access the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent internally.
85 float getEnergy() const;
86
87 /// Access the [GeV] particle momentum. Four momentum state is not kept consistent internally.
88 const edm4hep::Vector3f& getMomentum() const;
89
90 /// Access the [mm] reference, i.e. where the particle has been measured
91 const edm4hep::Vector3f& getReferencePoint() const;
92
93 /// Access the charge of the reconstructed particle.
94 float getCharge() const;
95
96 /// Access the [GeV] mass of the reconstructed particle, set independently from four vector. Four momentum state is not kept consistent internally.
97 float getMass() const;
98
99 /// Access the overall goodness of the PID on a scale of [0;1]
100 float getGoodnessOfPID() const;
101
102 /// Access the covariance matrix of the reconstructed particle 4vector (10 parameters).
103 const edm4eic::Cov4f& getCovMatrix() const;
104
105 /// Access the PDG code for this particle
106 std::int32_t getPDG() const;
107
108
109 /// Access the Start vertex associated to this particle
110 const edm4eic::Vertex getStartVertex() const;
111 /// Access the particle ID used for the kinematics of this particle
112 const edm4hep::ParticleID getParticleIDUsed() const;
113
114 std::size_t clusters_size() const;
115 edm4eic::Cluster getClusters(std::size_t) const;
116 std::vector<edm4eic::Cluster>::const_iterator clusters_begin() const;
117 std::vector<edm4eic::Cluster>::const_iterator clusters_end() const;
118 podio::RelationRange<edm4eic::Cluster> getClusters() const;
119 std::size_t tracks_size() const;
120 edm4eic::Track getTracks(std::size_t) const;
121 std::vector<edm4eic::Track>::const_iterator tracks_begin() const;
122 std::vector<edm4eic::Track>::const_iterator tracks_end() const;
123 podio::RelationRange<edm4eic::Track> getTracks() const;
124 std::size_t particles_size() const;
126 std::vector<edm4eic::ReconstructedParticle>::const_iterator particles_begin() const;
127 std::vector<edm4eic::ReconstructedParticle>::const_iterator particles_end() const;
128 podio::RelationRange<edm4eic::ReconstructedParticle> getParticles() const;
129 std::size_t particleIDs_size() const;
130 edm4hep::ParticleID getParticleIDs(std::size_t) const;
131 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_begin() const;
132 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_end() const;
133 podio::RelationRange<edm4hep::ParticleID> getParticleIDs() const;
134
135 bool isCompound() const {return particles_size() > 0;}
136
137
138 /// check whether the object is actually available
139 bool isAvailable() const;
140 /// disconnect from ReconstructedParticleObj instance
141 void unlink() { m_obj = podio::utils::MaybeSharedPtr<ReconstructedParticleObj>{nullptr}; }
142
143 bool operator==(const ReconstructedParticle& other) const { return m_obj == other.m_obj; }
144 bool operator==(const MutableReconstructedParticle& other) const;
145
146 // less comparison operator, so that objects can be e.g. stored in sets.
147 bool operator<(const ReconstructedParticle& other) const { return m_obj < other.m_obj; }
148
149 podio::ObjectID id() const { return getObjectID(); }
150
151 const podio::ObjectID getObjectID() const;
152
154 using std::swap;
155 swap(a.m_obj, b.m_obj); // swap out the internal pointers
156 }
157
158private:
159 /// constructor from existing ReconstructedParticleObj
160 explicit ReconstructedParticle(podio::utils::MaybeSharedPtr<ReconstructedParticleObj> obj);
162
163 podio::utils::MaybeSharedPtr<ReconstructedParticleObj> m_obj{nullptr};
164};
165
166std::ostream& operator<<(std::ostream& o, const ReconstructedParticle& value);
167
168#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
169void to_json(nlohmann::json& j, const ReconstructedParticle& value);
170#endif
171
172
173} // namespace edm4eic
174
175
176#endif
Definition Cluster.h:38
Definition Cov4f.h:18
Definition MutableReconstructedParticle.h:46
Definition ReconstructedParticleCollectionData.h:34
Definition ReconstructedParticleCollection.h:95
Definition ReconstructedParticleCollection.h:40
Definition ReconstructedParticle.h:47
std::size_t particleIDs_size() const
Definition ReconstructedParticle.cc:190
ReconstructedParticle()
default constructor
Definition ReconstructedParticle.cc:23
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_end() const
Definition ReconstructedParticle.cc:184
ReconstructedParticle & operator=(ReconstructedParticle other)
copy-assignment operator
Definition ReconstructedParticle.cc:39
friend class ReconstructedParticleCollection
Definition ReconstructedParticle.h:50
const edm4eic::Cov4f & getCovMatrix() const
Access the covariance matrix of the reconstructed particle 4vector (10 parameters).
Definition ReconstructedParticle.cc:63
std::size_t clusters_size() const
Definition ReconstructedParticle.cc:94
ReconstructedParticle(const ReconstructedParticle &other)=default
copy constructor
std::size_t tracks_size() const
Definition ReconstructedParticle.cc:126
std::vector< edm4eic::Cluster >::const_iterator clusters_begin() const
Definition ReconstructedParticle.cc:82
std::int32_t getType() const
Access the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeN...
Definition ReconstructedParticle.cc:56
float getGoodnessOfPID() const
Access the overall goodness of the PID on a scale of [0;1].
Definition ReconstructedParticle.cc:62
podio::RelationRange< edm4eic::Cluster > getClusters() const
Definition ReconstructedParticle.cc:105
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_begin() const
Definition ReconstructedParticle.cc:178
podio::ObjectID id() const
Definition ReconstructedParticle.h:149
std::vector< edm4eic::Track >::const_iterator tracks_end() const
Definition ReconstructedParticle.cc:120
friend class MutableReconstructedParticle
Definition ReconstructedParticle.h:49
const edm4hep::Vector3f & getReferencePoint() const
Access the [mm] reference, i.e. where the particle has been measured.
Definition ReconstructedParticle.cc:59
std::int32_t getPDG() const
Access the PDG code for this particle.
Definition ReconstructedParticle.cc:64
std::vector< edm4eic::Track >::const_iterator tracks_begin() const
Definition ReconstructedParticle.cc:114
const edm4hep::Vector3f & getMomentum() const
Access the [GeV] particle momentum. Four momentum state is not kept consistent internally.
Definition ReconstructedParticle.cc:58
friend void swap(ReconstructedParticle &a, ReconstructedParticle &b)
Definition ReconstructedParticle.h:153
std::vector< edm4eic::ReconstructedParticle >::const_iterator particles_end() const
Definition ReconstructedParticle.cc:152
bool isCompound() const
Definition ReconstructedParticle.h:135
const edm4eic::Vertex getStartVertex() const
Access the Start vertex associated to this particle.
Definition ReconstructedParticle.cc:66
bool operator==(const ReconstructedParticle &other) const
Definition ReconstructedParticle.h:143
~ReconstructedParticle()=default
destructor
const podio::ObjectID getObjectID() const
Definition ReconstructedParticle.cc:220
bool isAvailable() const
check whether the object is actually available
Definition ReconstructedParticle.cc:213
float getMass() const
Access the [GeV] mass of the reconstructed particle, set independently from four vector....
Definition ReconstructedParticle.cc:61
float getCharge() const
Access the charge of the reconstructed particle.
Definition ReconstructedParticle.cc:60
float getEnergy() const
Access the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent int...
Definition ReconstructedParticle.cc:57
const edm4hep::ParticleID getParticleIDUsed() const
Access the particle ID used for the kinematics of this particle.
Definition ReconstructedParticle.cc:73
podio::RelationRange< edm4eic::Track > getTracks() const
Definition ReconstructedParticle.cc:137
std::vector< edm4eic::Cluster >::const_iterator clusters_end() const
Definition ReconstructedParticle.cc:88
std::size_t particles_size() const
Definition ReconstructedParticle.cc:158
std::vector< edm4eic::ReconstructedParticle >::const_iterator particles_begin() const
Definition ReconstructedParticle.cc:146
static ReconstructedParticle makeEmpty()
Definition ReconstructedParticle.cc:52
bool operator<(const ReconstructedParticle &other) const
Definition ReconstructedParticle.h:147
podio::RelationRange< edm4eic::ReconstructedParticle > getParticles() const
Definition ReconstructedParticle.cc:169
void unlink()
disconnect from ReconstructedParticleObj instance
Definition ReconstructedParticle.h:141
MutableReconstructedParticle clone() const
create a mutable deep-copy of the object with identical relations
Definition ReconstructedParticle.cc:44
podio::RelationRange< edm4hep::ParticleID > getParticleIDs() const
Definition ReconstructedParticle.cc:201
Definition ReconstructedParticleObj.h:28
Definition Track.h:41
Definition Vertex.h:36
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97
Definition CalorimeterHit.h:21