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