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 /// move constructor
59
60 /// copy-assignment operator
61 MutableCherenkovParticleID& operator=(MutableCherenkovParticleID other) &; // Rebind this to other's internal object
62 MutableCherenkovParticleID& operator=(MutableCherenkovParticleID other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
63
64 /// create a mutable deep-copy of the object with identical relations
65 /// if cloneRelations=false, the relations are not cloned and will be empty
66 MutableCherenkovParticleID clone(bool cloneRelations=true) const;
67
68 /// destructor
70
71
72public:
73
74 /// Access the Overall photoelectron count
75 float getNpe() const;
76
77 /// Access the Average refractive index at the Cherenkov photons' vertices
78 float getRefractiveIndex() const;
79
80 /// Access the Average energy for these Cherenkov photons [GeV]
81 float getPhotonEnergy() const;
82
83
84 /// Access the reconstructed charged particle
86
87 /// Set the Overall photoelectron count
88 void setNpe(const float npe);
89 /// Get mutable reference to Overall photoelectron count
90 float& getNpe();
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
97 /// Set the Average energy for these Cherenkov photons [GeV]
98 void setPhotonEnergy(const float photonEnergy);
99 /// Get mutable reference to Average energy for these Cherenkov photons [GeV]
100 float& getPhotonEnergy();
101
102
103 /// Set the reconstructed charged particle
104 void setChargedParticle(const edm4eic::TrackSegment& value);
105
107 std::size_t rawHits_size() const;
108 edm4eic::RawTrackerHit getRawHits(std::size_t) const;
109 std::vector<edm4eic::RawTrackerHit>::const_iterator rawHits_begin() const;
110 std::vector<edm4eic::RawTrackerHit>::const_iterator rawHits_end() const;
111 podio::RelationRange<edm4eic::RawTrackerHit> getRawHits() const;
113 std::size_t hypotheses_size() const;
115 std::vector<edm4eic::CherenkovParticleIDHypothesis>::const_iterator hypotheses_begin() const;
116 std::vector<edm4eic::CherenkovParticleIDHypothesis>::const_iterator hypotheses_end() const;
117 podio::RelationRange<edm4eic::CherenkovParticleIDHypothesis> getHypotheses() const;
118 void addToThetaPhiPhotons(const edm4hep::Vector2f&);
119 std::size_t thetaPhiPhotons_size() const;
120 edm4hep::Vector2f getThetaPhiPhotons(std::size_t) const;
121 std::vector<edm4hep::Vector2f>::const_iterator thetaPhiPhotons_begin() const;
122 std::vector<edm4hep::Vector2f>::const_iterator thetaPhiPhotons_end() const;
123 podio::RelationRange<edm4hep::Vector2f> getThetaPhiPhotons() const;
124
125
126
127 /// check whether the object is actually available
128 bool isAvailable() const;
129 /// disconnect from CherenkovParticleIDObj instance
130 void unlink() { m_obj = podio::utils::MaybeSharedPtr<CherenkovParticleIDObj>{nullptr}; }
131
132 constexpr bool operator==(const MutableCherenkovParticleID& other) const { return m_obj == other.m_obj; }
133 bool operator==(const CherenkovParticleID& other) const;
134
135 constexpr bool operator!=(const MutableCherenkovParticleID& other) const { return !(*this == other); }
136 bool operator!=(const CherenkovParticleID& other) const { return !(*this == other); }
137
138 // less comparison operator, so that objects can be e.g. stored in sets.
140
141 podio::ObjectID id() const { return getObjectID(); }
142
143 const podio::ObjectID getObjectID() const;
144
145 friend std::hash<MutableCherenkovParticleID>;
146
148 using std::swap;
149 swap(a.m_obj, b.m_obj); // swap out the internal pointers
150 }
151
152private:
153 /// constructor from existing CherenkovParticleIDObj
154 explicit MutableCherenkovParticleID(podio::utils::MaybeSharedPtr<CherenkovParticleIDObj> obj);
155
156 podio::utils::MaybeSharedPtr<CherenkovParticleIDObj> m_obj{new CherenkovParticleIDObj{}, podio::utils::MarkOwned};
157};
158
159#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
160void to_json(nlohmann::json& j, const MutableCherenkovParticleID& value);
161#endif
162
163
164} // namespace edm4eic
165
166
167
168template<>
169struct std::hash<edm4eic::MutableCherenkovParticleID> {
170 std::size_t operator()(const edm4eic::MutableCherenkovParticleID& obj) const {
171 return std::hash<edm4eic::CherenkovParticleIDObj*>{}(obj.m_obj.get());
172 }
173};
174
175
176#endif
Definition CherenkovParticleIDCollection.h:139
Definition CherenkovParticleID.h:46
Definition CherenkovParticleIDHypothesis.h:20
Definition CherenkovParticleIDObj.h:26
Definition MutableCherenkovParticleID.h:38
std::vector< edm4eic::CherenkovParticleIDHypothesis >::const_iterator hypotheses_begin() const
Definition MutableCherenkovParticleID.cc:114
void addToRawHits(const edm4eic::RawTrackerHit &)
Definition MutableCherenkovParticleID.cc:73
std::vector< edm4hep::Vector2f >::const_iterator thetaPhiPhotons_begin() const
Definition MutableCherenkovParticleID.cc:150
const podio::ObjectID getObjectID() const
Definition MutableCherenkovParticleID.cc:190
float getPhotonEnergy() const
Access the Average energy for these Cherenkov photons [GeV].
Definition MutableCherenkovParticleID.cc:51
MutableCherenkovParticleID(MutableCherenkovParticleID &&other) noexcept=default
move constructor
std::vector< edm4eic::RawTrackerHit >::const_iterator rawHits_begin() const
Definition MutableCherenkovParticleID.cc:78
void setPhotonEnergy(const float photonEnergy)
Set the Average energy for these Cherenkov photons [GeV].
Definition MutableCherenkovParticleID.cc:65
bool operator<(const MutableCherenkovParticleID &other) const
Definition MutableCherenkovParticleID.h:139
void setChargedParticle(const edm4eic::TrackSegment &value)
Set the reconstructed charged particle.
Definition MutableCherenkovParticleID.cc:68
friend class CherenkovParticleID
Definition MutableCherenkovParticleID.h:42
float getRefractiveIndex() const
Access the Average refractive index at the Cherenkov photons' vertices.
Definition MutableCherenkovParticleID.cc:50
~MutableCherenkovParticleID()=default
destructor
podio::RelationRange< edm4hep::Vector2f > getThetaPhiPhotons() const
Definition MutableCherenkovParticleID.cc:173
MutableCherenkovParticleID & operator=(MutableCherenkovParticleID other) &&=delete
std::vector< edm4eic::CherenkovParticleIDHypothesis >::const_iterator hypotheses_end() const
Definition MutableCherenkovParticleID.cc:120
void addToThetaPhiPhotons(const edm4hep::Vector2f &)
Definition MutableCherenkovParticleID.cc:145
friend class CherenkovParticleIDMutableCollectionIterator
Definition MutableCherenkovParticleID.h:41
std::size_t thetaPhiPhotons_size() const
Definition MutableCherenkovParticleID.cc:162
const edm4eic::TrackSegment getChargedParticle() const
Access the reconstructed charged particle.
Definition MutableCherenkovParticleID.cc:53
MutableCherenkovParticleID()=default
default constructor
bool isAvailable() const
check whether the object is actually available
Definition MutableCherenkovParticleID.cc:186
podio::RelationRange< edm4eic::RawTrackerHit > getRawHits() const
Definition MutableCherenkovParticleID.cc:101
void setRefractiveIndex(const float refractiveIndex)
Set the Average refractive index at the Cherenkov photons' vertices.
Definition MutableCherenkovParticleID.cc:63
constexpr bool operator!=(const MutableCherenkovParticleID &other) const
Definition MutableCherenkovParticleID.h:135
bool operator!=(const CherenkovParticleID &other) const
Definition MutableCherenkovParticleID.h:136
std::vector< edm4eic::RawTrackerHit >::const_iterator rawHits_end() const
Definition MutableCherenkovParticleID.cc:84
podio::RelationRange< edm4eic::CherenkovParticleIDHypothesis > getHypotheses() const
Definition MutableCherenkovParticleID.cc:137
friend void swap(MutableCherenkovParticleID &a, MutableCherenkovParticleID &b)
Definition MutableCherenkovParticleID.h:147
void addToHypotheses(const edm4eic::CherenkovParticleIDHypothesis &)
Definition MutableCherenkovParticleID.cc:109
MutableCherenkovParticleID clone(bool cloneRelations=true) const
Definition MutableCherenkovParticleID.cc:30
void unlink()
disconnect from CherenkovParticleIDObj instance
Definition MutableCherenkovParticleID.h:130
friend class CherenkovParticleIDCollection
Definition MutableCherenkovParticleID.h:40
float getNpe() const
Access the Overall photoelectron count.
Definition MutableCherenkovParticleID.cc:49
MutableCherenkovParticleID(const MutableCherenkovParticleID &other) noexcept=default
copy constructor
constexpr bool operator==(const MutableCherenkovParticleID &other) const
Definition MutableCherenkovParticleID.h:132
std::size_t hypotheses_size() const
Definition MutableCherenkovParticleID.cc:126
MutableCherenkovParticleID & operator=(MutableCherenkovParticleID other) &
copy-assignment operator
Definition MutableCherenkovParticleID.cc:25
podio::ObjectID id() const
Definition MutableCherenkovParticleID.h:141
CherenkovParticleIDCollection collection_type
Definition MutableCherenkovParticleID.h:46
CherenkovParticleID object_type
Definition MutableCherenkovParticleID.h:45
void setNpe(const float npe)
Set the Overall photoelectron count.
Definition MutableCherenkovParticleID.cc:61
std::vector< edm4hep::Vector2f >::const_iterator thetaPhiPhotons_end() const
Definition MutableCherenkovParticleID.cc:156
std::size_t rawHits_size() const
Definition MutableCherenkovParticleID.cc:90
Definition MutableTrackSegment.h:37
Definition RawTrackerHit.h:41
Definition TrackSegment.h:45
Definition ArrowMapper.cc:63
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableCherenkovParticleID &obj) const
Definition MutableCherenkovParticleID.h:170