EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableCherenkovParticleID.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableCherenkovParticleID_H
4#define EDM4EIC_MutableCherenkovParticleID_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
12#include "podio/RelationRange.h"
13#include <vector>
14
15#include "podio/utilities/MaybeSharedPtr.h"
16
17#include <cstdint>
18
19#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
20#include "nlohmann/json_fwd.hpp"
21#endif
22
23// forward declarations
24namespace edm4eic {
26class TrackSegment;
28}
29
30
31namespace edm4eic {
32
33
34/** @class MutableCherenkovParticleID
35 * Cherenkov detector PID
36 * @author: A. Kiselev, C. Chatterjee, C. Dilks
37 */
39
42 friend class CherenkovParticleID;
43
44public:
47
48 /// default constructor
50
51 /// Constructor initializing all members
52 MutableCherenkovParticleID(const float npe, const float refractiveIndex, const float photonEnergy);
53
54 /// copy constructor
56
57 /// copy-assignment operator
58 MutableCherenkovParticleID& operator=(MutableCherenkovParticleID other) &; // Rebind this to other's internal object
59 MutableCherenkovParticleID& operator=(MutableCherenkovParticleID other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
60
61 /// create a mutable deep-copy of the object with identical relations
62 /// if cloneRelations=false, the relations are not cloned and will be empty
63 MutableCherenkovParticleID clone(bool cloneRelations=true) const;
64
65 /// destructor
67
68
69public:
70
71 /// Access the Overall photoelectron count
72 float getNpe() const;
73
74 /// Access the Average refractive index at the Cherenkov photons' vertices
75 float getRefractiveIndex() const;
76
77 /// Access the Average energy for these Cherenkov photons [GeV]
78 float getPhotonEnergy() const;
79
80
81 /// Access the reconstructed charged particle
83
84 /// Set the Overall photoelectron count
85 void setNpe(const float npe);
86 /// Get mutable reference to Overall photoelectron count
87 float& getNpe();
88 /// Get reference to Overall photoelectron count
89 [[deprecated("use getNpe instead")]]
90 float& npe();
91
92 /// Set the Average refractive index at the Cherenkov photons' vertices
93 void setRefractiveIndex(const float refractiveIndex);
94 /// Get mutable reference to Average refractive index at the Cherenkov photons' vertices
95 float& getRefractiveIndex();
96 /// Get reference to Average refractive index at the Cherenkov photons' vertices
97 [[deprecated("use getRefractiveIndex instead")]]
98 float& refractiveIndex();
99
100 /// Set the Average energy for these Cherenkov photons [GeV]
101 void setPhotonEnergy(const float photonEnergy);
102 /// Get mutable reference to Average energy for these Cherenkov photons [GeV]
103 float& getPhotonEnergy();
104 /// Get reference to Average energy for these Cherenkov photons [GeV]
105 [[deprecated("use getPhotonEnergy instead")]]
106 float& photonEnergy();
107
108
109 /// Set the reconstructed charged particle
110 void setChargedParticle(const edm4eic::TrackSegment& value);
111
113 std::size_t rawHitAssociations_size() const;
115 std::vector<edm4eic::MCRecoTrackerHitAssociation>::const_iterator rawHitAssociations_begin() const;
116 std::vector<edm4eic::MCRecoTrackerHitAssociation>::const_iterator rawHitAssociations_end() const;
117 podio::RelationRange<edm4eic::MCRecoTrackerHitAssociation> getRawHitAssociations() const;
119 std::size_t hypotheses_size() const;
121 std::vector<edm4eic::CherenkovParticleIDHypothesis>::const_iterator hypotheses_begin() const;
122 std::vector<edm4eic::CherenkovParticleIDHypothesis>::const_iterator hypotheses_end() const;
123 podio::RelationRange<edm4eic::CherenkovParticleIDHypothesis> getHypotheses() const;
124 void addToThetaPhiPhotons(const edm4hep::Vector2f&);
125 std::size_t thetaPhiPhotons_size() const;
126 edm4hep::Vector2f getThetaPhiPhotons(std::size_t) const;
127 std::vector<edm4hep::Vector2f>::const_iterator thetaPhiPhotons_begin() const;
128 std::vector<edm4hep::Vector2f>::const_iterator thetaPhiPhotons_end() const;
129 podio::RelationRange<edm4hep::Vector2f> getThetaPhiPhotons() const;
130
131
132
133 /// check whether the object is actually available
134 bool isAvailable() const;
135 /// disconnect from CherenkovParticleIDObj instance
136 void unlink() { m_obj = podio::utils::MaybeSharedPtr<CherenkovParticleIDObj>{nullptr}; }
137
138 bool operator==(const MutableCherenkovParticleID& other) const { return m_obj == other.m_obj; }
139 bool operator==(const CherenkovParticleID& other) const;
140
141 bool operator!=(const MutableCherenkovParticleID& other) const { return !(*this == other); }
142 bool operator!=(const CherenkovParticleID& other) const { return !(*this == other); }
143
144 // less comparison operator, so that objects can be e.g. stored in sets.
146
147 podio::ObjectID id() const { return getObjectID(); }
148
149 const podio::ObjectID getObjectID() const;
150
151 friend std::hash<MutableCherenkovParticleID>;
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 CherenkovParticleIDObj
160 explicit MutableCherenkovParticleID(podio::utils::MaybeSharedPtr<CherenkovParticleIDObj> obj);
161
162 podio::utils::MaybeSharedPtr<CherenkovParticleIDObj> m_obj{nullptr};
163};
164
165#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
166void to_json(nlohmann::json& j, const MutableCherenkovParticleID& value);
167#endif
168
169
170} // namespace edm4eic
171
172
173
174template<>
175struct std::hash<edm4eic::MutableCherenkovParticleID> {
176 std::size_t operator()(const edm4eic::MutableCherenkovParticleID& obj) const {
177 return std::hash<edm4eic::CherenkovParticleIDObj*>{}(obj.m_obj.get());
178 }
179};
180
181
182#endif
Definition CherenkovParticleIDCollection.h:137
Definition CherenkovParticleID.h:46
Definition CherenkovParticleIDHypothesis.h:19
Definition MCRecoTrackerHitAssociation.h:46
Definition MutableCherenkovParticleID.h:38
std::vector< edm4eic::CherenkovParticleIDHypothesis >::const_iterator hypotheses_begin() const
Definition MutableCherenkovParticleID.cc:121
bool operator!=(const MutableCherenkovParticleID &other) const
Definition MutableCherenkovParticleID.h:141
std::vector< edm4hep::Vector2f >::const_iterator thetaPhiPhotons_begin() const
Definition MutableCherenkovParticleID.cc:157
const podio::ObjectID getObjectID() const
Definition MutableCherenkovParticleID.cc:197
float getPhotonEnergy() const
Access the Average energy for these Cherenkov photons [GeV].
Definition MutableCherenkovParticleID.cc:55
void setPhotonEnergy(const float photonEnergy)
Set the Average energy for these Cherenkov photons [GeV].
Definition MutableCherenkovParticleID.cc:71
float & photonEnergy()
Get reference to Average energy for these Cherenkov photons [GeV].
Definition MutableCherenkovParticleID.cc:73
bool operator<(const MutableCherenkovParticleID &other) const
Definition MutableCherenkovParticleID.h:145
void setChargedParticle(const edm4eic::TrackSegment &value)
Set the reconstructed charged particle.
Definition MutableCherenkovParticleID.cc:75
friend class CherenkovParticleID
Definition MutableCherenkovParticleID.h:42
float getRefractiveIndex() const
Access the Average refractive index at the Cherenkov photons' vertices.
Definition MutableCherenkovParticleID.cc:54
~MutableCherenkovParticleID()=default
destructor
podio::RelationRange< edm4hep::Vector2f > getThetaPhiPhotons() const
Definition MutableCherenkovParticleID.cc:180
MutableCherenkovParticleID & operator=(MutableCherenkovParticleID other) &&=delete
std::vector< edm4eic::CherenkovParticleIDHypothesis >::const_iterator hypotheses_end() const
Definition MutableCherenkovParticleID.cc:127
void addToThetaPhiPhotons(const edm4hep::Vector2f &)
Definition MutableCherenkovParticleID.cc:152
friend class CherenkovParticleIDMutableCollectionIterator
Definition MutableCherenkovParticleID.h:41
MutableCherenkovParticleID(const MutableCherenkovParticleID &other)=default
copy constructor
std::size_t thetaPhiPhotons_size() const
Definition MutableCherenkovParticleID.cc:169
const edm4eic::TrackSegment getChargedParticle() const
Access the reconstructed charged particle.
Definition MutableCherenkovParticleID.cc:57
bool isAvailable() const
check whether the object is actually available
Definition MutableCherenkovParticleID.cc:193
void setRefractiveIndex(const float refractiveIndex)
Set the Average refractive index at the Cherenkov photons' vertices.
Definition MutableCherenkovParticleID.cc:68
float & refractiveIndex()
Get reference to Average refractive index at the Cherenkov photons' vertices.
Definition MutableCherenkovParticleID.cc:70
bool operator!=(const CherenkovParticleID &other) const
Definition MutableCherenkovParticleID.h:142
podio::RelationRange< edm4eic::CherenkovParticleIDHypothesis > getHypotheses() const
Definition MutableCherenkovParticleID.cc:144
friend void swap(MutableCherenkovParticleID &a, MutableCherenkovParticleID &b)
Definition MutableCherenkovParticleID.h:153
void addToHypotheses(const edm4eic::CherenkovParticleIDHypothesis &)
Definition MutableCherenkovParticleID.cc:116
MutableCherenkovParticleID clone(bool cloneRelations=true) const
Definition MutableCherenkovParticleID.cc:34
void unlink()
disconnect from CherenkovParticleIDObj instance
Definition MutableCherenkovParticleID.h:136
void addToRawHitAssociations(const edm4eic::MCRecoTrackerHitAssociation &)
Definition MutableCherenkovParticleID.cc:80
std::size_t rawHitAssociations_size() const
Definition MutableCherenkovParticleID.cc:97
friend class CherenkovParticleIDCollection
Definition MutableCherenkovParticleID.h:40
std::vector< edm4eic::MCRecoTrackerHitAssociation >::const_iterator rawHitAssociations_end() const
Definition MutableCherenkovParticleID.cc:91
float getNpe() const
Access the Overall photoelectron count.
Definition MutableCherenkovParticleID.cc:53
float & npe()
Get reference to Overall photoelectron count.
Definition MutableCherenkovParticleID.cc:67
std::size_t hypotheses_size() const
Definition MutableCherenkovParticleID.cc:133
MutableCherenkovParticleID & operator=(MutableCherenkovParticleID other) &
copy-assignment operator
Definition MutableCherenkovParticleID.cc:29
podio::ObjectID id() const
Definition MutableCherenkovParticleID.h:147
CherenkovParticleIDCollection collection_type
Definition MutableCherenkovParticleID.h:46
CherenkovParticleID object_type
Definition MutableCherenkovParticleID.h:45
podio::RelationRange< edm4eic::MCRecoTrackerHitAssociation > getRawHitAssociations() const
Definition MutableCherenkovParticleID.cc:108
void setNpe(const float npe)
Set the Overall photoelectron count.
Definition MutableCherenkovParticleID.cc:65
std::vector< edm4hep::Vector2f >::const_iterator thetaPhiPhotons_end() const
Definition MutableCherenkovParticleID.cc:163
MutableCherenkovParticleID()
default constructor
Definition MutableCherenkovParticleID.cc:19
std::vector< edm4eic::MCRecoTrackerHitAssociation >::const_iterator rawHitAssociations_begin() const
Definition MutableCherenkovParticleID.cc:85
bool operator==(const MutableCherenkovParticleID &other) const
Definition MutableCherenkovParticleID.h:138
Definition MutableTrackSegment.h:37
Definition TrackSegment.h:45
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::MutableCherenkovParticleID &obj) const
Definition MutableCherenkovParticleID.h:176