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 <cstdint>
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
71 /// if cloneRelations=false, the relations are not cloned and will be empty
72 MutableReconstructedParticle clone(bool cloneRelations=true) const;
73
74 /// destructor
76
77 /// converting constructor from mutable object
79
81
82public:
83
84 /// Access the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeNames and ReconstructedParticleTypeValues.
85 std::int32_t getType() const;
86
87 /// Access the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent internally.
88 float getEnergy() const;
89
90 /// Access the [GeV] particle momentum. Four momentum state is not kept consistent internally.
91 const edm4hep::Vector3f& getMomentum() const;
92
93 /// Access the [mm] reference, i.e. where the particle has been measured
94 const edm4hep::Vector3f& getReferencePoint() const;
95
96 /// Access the charge of the reconstructed particle.
97 float getCharge() const;
98
99 /// Access the [GeV] mass of the reconstructed particle, set independently from four vector. Four momentum state is not kept consistent internally.
100 float getMass() const;
101
102 /// Access the overall goodness of the PID on a scale of [0;1]
103 float getGoodnessOfPID() const;
104
105 /// Access the covariance matrix of the reconstructed particle 4vector (10 parameters).
106 const edm4eic::Cov4f& getCovMatrix() const;
107
108 /// Access the PDG code for this particle
109 std::int32_t getPDG() const;
110
111
112 /// Access the Start vertex associated to this particle
113 const edm4eic::Vertex getStartVertex() const;
114 /// Access the particle ID used for the kinematics of this particle
115 const edm4hep::ParticleID getParticleIDUsed() const;
116
117 std::size_t clusters_size() const;
118 edm4eic::Cluster getClusters(std::size_t) const;
119 std::vector<edm4eic::Cluster>::const_iterator clusters_begin() const;
120 std::vector<edm4eic::Cluster>::const_iterator clusters_end() const;
121 podio::RelationRange<edm4eic::Cluster> getClusters() const;
122 std::size_t tracks_size() const;
123 edm4eic::Track getTracks(std::size_t) const;
124 std::vector<edm4eic::Track>::const_iterator tracks_begin() const;
125 std::vector<edm4eic::Track>::const_iterator tracks_end() const;
126 podio::RelationRange<edm4eic::Track> getTracks() const;
127 std::size_t particles_size() const;
129 std::vector<edm4eic::ReconstructedParticle>::const_iterator particles_begin() const;
130 std::vector<edm4eic::ReconstructedParticle>::const_iterator particles_end() const;
131 podio::RelationRange<edm4eic::ReconstructedParticle> getParticles() const;
132 std::size_t particleIDs_size() const;
133 edm4hep::ParticleID getParticleIDs(std::size_t) const;
134 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_begin() const;
135 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_end() const;
136 podio::RelationRange<edm4hep::ParticleID> getParticleIDs() const;
137
138 bool isCompound() const {return particles_size() > 0;}
139
140
141 /// check whether the object is actually available
142 bool isAvailable() const;
143 /// disconnect from ReconstructedParticleObj instance
144 void unlink() { m_obj = podio::utils::MaybeSharedPtr<ReconstructedParticleObj>{nullptr}; }
145
146 bool operator==(const ReconstructedParticle& other) const { return m_obj == other.m_obj; }
147 bool operator==(const MutableReconstructedParticle& other) const;
148
149 bool operator!=(const ReconstructedParticle& other) const { return !(*this == other); }
150 bool operator!=(const MutableReconstructedParticle& other) const { return !(*this == other); }
151
152 // less comparison operator, so that objects can be e.g. stored in sets.
153 bool operator<(const ReconstructedParticle& other) const { return m_obj < other.m_obj; }
154
155 podio::ObjectID id() const { return getObjectID(); }
156
157 const podio::ObjectID getObjectID() const;
158
160 using std::swap;
161 swap(a.m_obj, b.m_obj); // swap out the internal pointers
162 }
163
164private:
165 /// constructor from existing ReconstructedParticleObj
166 explicit ReconstructedParticle(podio::utils::MaybeSharedPtr<ReconstructedParticleObj> obj);
168
169 podio::utils::MaybeSharedPtr<ReconstructedParticleObj> m_obj{nullptr};
170};
171
172std::ostream& operator<<(std::ostream& o, const ReconstructedParticle& value);
173
174#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
175void to_json(nlohmann::json& j, const ReconstructedParticle& value);
176#endif
177
178
179} // namespace edm4eic
180
181
182#endif
Definition Cluster.h:38
Definition Cov4f.h:18
Definition MutableReconstructedParticle.h:45
Definition ReconstructedParticleCollectionData.h:34
Definition ReconstructedParticleCollection.h:92
Definition ReconstructedParticleCollection.h:37
Definition ReconstructedParticle.h:47
bool operator!=(const ReconstructedParticle &other) const
Definition ReconstructedParticle.h:149
std::size_t particleIDs_size() const
Definition ReconstructedParticle.cc:246
ReconstructedParticle()
default constructor
Definition ReconstructedParticle.cc:22
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_end() const
Definition ReconstructedParticle.cc:240
ReconstructedParticle & operator=(ReconstructedParticle other)
copy-assignment operator
Definition ReconstructedParticle.cc:38
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:119
std::size_t clusters_size() const
Definition ReconstructedParticle.cc:150
ReconstructedParticle(const ReconstructedParticle &other)=default
copy constructor
std::size_t tracks_size() const
Definition ReconstructedParticle.cc:182
std::vector< edm4eic::Cluster >::const_iterator clusters_begin() const
Definition ReconstructedParticle.cc:138
std::int32_t getType() const
Access the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeN...
Definition ReconstructedParticle.cc:112
float getGoodnessOfPID() const
Access the overall goodness of the PID on a scale of [0;1].
Definition ReconstructedParticle.cc:118
podio::RelationRange< edm4eic::Cluster > getClusters() const
Definition ReconstructedParticle.cc:161
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_begin() const
Definition ReconstructedParticle.cc:234
podio::ObjectID id() const
Definition ReconstructedParticle.h:155
std::vector< edm4eic::Track >::const_iterator tracks_end() const
Definition ReconstructedParticle.cc:176
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:115
std::int32_t getPDG() const
Access the PDG code for this particle.
Definition ReconstructedParticle.cc:120
MutableReconstructedParticle clone(bool cloneRelations=true) const
Definition ReconstructedParticle.cc:43
std::vector< edm4eic::Track >::const_iterator tracks_begin() const
Definition ReconstructedParticle.cc:170
const edm4hep::Vector3f & getMomentum() const
Access the [GeV] particle momentum. Four momentum state is not kept consistent internally.
Definition ReconstructedParticle.cc:114
friend void swap(ReconstructedParticle &a, ReconstructedParticle &b)
Definition ReconstructedParticle.h:159
std::vector< edm4eic::ReconstructedParticle >::const_iterator particles_end() const
Definition ReconstructedParticle.cc:208
bool isCompound() const
Definition ReconstructedParticle.h:138
const edm4eic::Vertex getStartVertex() const
Access the Start vertex associated to this particle.
Definition ReconstructedParticle.cc:122
bool operator==(const ReconstructedParticle &other) const
Definition ReconstructedParticle.h:146
~ReconstructedParticle()=default
destructor
const podio::ObjectID getObjectID() const
Definition ReconstructedParticle.cc:273
bool isAvailable() const
check whether the object is actually available
Definition ReconstructedParticle.cc:269
float getMass() const
Access the [GeV] mass of the reconstructed particle, set independently from four vector....
Definition ReconstructedParticle.cc:117
float getCharge() const
Access the charge of the reconstructed particle.
Definition ReconstructedParticle.cc:116
float getEnergy() const
Access the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent int...
Definition ReconstructedParticle.cc:113
const edm4hep::ParticleID getParticleIDUsed() const
Access the particle ID used for the kinematics of this particle.
Definition ReconstructedParticle.cc:129
podio::RelationRange< edm4eic::Track > getTracks() const
Definition ReconstructedParticle.cc:193
std::vector< edm4eic::Cluster >::const_iterator clusters_end() const
Definition ReconstructedParticle.cc:144
std::size_t particles_size() const
Definition ReconstructedParticle.cc:214
std::vector< edm4eic::ReconstructedParticle >::const_iterator particles_begin() const
Definition ReconstructedParticle.cc:202
static ReconstructedParticle makeEmpty()
Definition ReconstructedParticle.cc:108
bool operator<(const ReconstructedParticle &other) const
Definition ReconstructedParticle.h:153
bool operator!=(const MutableReconstructedParticle &other) const
Definition ReconstructedParticle.h:150
podio::RelationRange< edm4eic::ReconstructedParticle > getParticles() const
Definition ReconstructedParticle.cc:225
void unlink()
disconnect from ReconstructedParticleObj instance
Definition ReconstructedParticle.h:144
podio::RelationRange< edm4hep::ParticleID > getParticleIDs() const
Definition ReconstructedParticle.cc:257
Definition ReconstructedParticleObj.h:28
Definition Track.h:41
Definition Vertex.h:36
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:21