EDM4eic
EIC data model
Loading...
Searching...
No Matches
CherenkovParticleID.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_CherenkovParticleID_H
4#define EDM4EIC_CherenkovParticleID_H
5
7
10#include "podio/RelationRange.h"
11#include <vector>
12
13#include "podio/utilities/MaybeSharedPtr.h"
14#include "podio/detail/OrderKey.h"
15
16#include <ostream>
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 podio::detail {
32// Internal function used in less comparison operators of the datatypes and interface types
33OrderKey getOrderKey(const edm4eic::CherenkovParticleID& obj);
34};
35
36namespace edm4eic {
37
41
42/** @class CherenkovParticleID
43 * Cherenkov detector PID
44 * @author: A. Kiselev, C. Chatterjee, C. Dilks
45 */
47
52 friend podio::detail::OrderKey podio::detail::getOrderKey(const CherenkovParticleID & obj);
53
54public:
57
58 /// default constructor
60
61 /// Constructor initializing all members
62 CherenkovParticleID(const float npe, const float refractiveIndex, const float photonEnergy);
63
64 /// copy constructor
65 CherenkovParticleID(const CherenkovParticleID& other) noexcept = default;
66
67 /// move constructor
68 CherenkovParticleID(CherenkovParticleID&& other) noexcept = default;
69
70 /// copy-assignment operator
71 CherenkovParticleID& operator=(CherenkovParticleID other) &; // Rebind this to other's internal object
72 CherenkovParticleID& operator=(CherenkovParticleID other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
73
74 /// create a mutable deep-copy of the object with identical relations
75 /// if cloneRelations=false, the relations are not cloned and will be empty
76 MutableCherenkovParticleID clone(bool cloneRelations=true) const;
77
78 /// destructor
80
81 /// converting constructor from mutable object
83
85
86public:
87
88 static constexpr std::string_view typeName = "edm4eic::CherenkovParticleID";
89
90 /// Access the Overall photoelectron count
91 float getNpe() const;
92
93 /// Access the Average refractive index at the Cherenkov photons' vertices
94 float getRefractiveIndex() const;
95
96 /// Access the Average energy for these Cherenkov photons [GeV]
97 float getPhotonEnergy() const;
98
99
100 /// Access the reconstructed charged particle
102
103 std::size_t rawHits_size() const;
104 edm4eic::RawTrackerHit getRawHits(std::size_t) const;
105 std::vector<edm4eic::RawTrackerHit>::const_iterator rawHits_begin() const;
106 std::vector<edm4eic::RawTrackerHit>::const_iterator rawHits_end() const;
107 podio::RelationRange<edm4eic::RawTrackerHit> getRawHits() const;
108 std::size_t hypotheses_size() const;
110 std::vector<edm4eic::CherenkovParticleIDHypothesis>::const_iterator hypotheses_begin() const;
111 std::vector<edm4eic::CherenkovParticleIDHypothesis>::const_iterator hypotheses_end() const;
112 podio::RelationRange<edm4eic::CherenkovParticleIDHypothesis> getHypotheses() const;
113 std::size_t thetaPhiPhotons_size() const;
114 edm4hep::Vector2f getThetaPhiPhotons(std::size_t) const;
115 std::vector<edm4hep::Vector2f>::const_iterator thetaPhiPhotons_begin() const;
116 std::vector<edm4hep::Vector2f>::const_iterator thetaPhiPhotons_end() const;
117 podio::RelationRange<edm4hep::Vector2f> getThetaPhiPhotons() const;
118
119
120 /// check whether the object is actually available
121 bool isAvailable() const;
122 /// disconnect from CherenkovParticleIDObj instance
123 void unlink() { m_obj = podio::utils::MaybeSharedPtr<CherenkovParticleIDObj>{nullptr}; }
124
125 constexpr bool operator==(const CherenkovParticleID& other) const { return m_obj == other.m_obj; }
126 bool operator==(const MutableCherenkovParticleID& other) const;
127
128 constexpr bool operator!=(const CherenkovParticleID& other) const { return !(*this == other); }
129 bool operator!=(const MutableCherenkovParticleID& other) const { return !(*this == other); }
130
131 // less comparison operator, so that objects can be e.g. stored in sets.
132 bool operator<(const CherenkovParticleID& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
133
134 podio::ObjectID id() const { return getObjectID(); }
135
136 const podio::ObjectID getObjectID() const;
137
138 friend std::hash<CherenkovParticleID>;
139
141 using std::swap;
142 swap(a.m_obj, b.m_obj); // swap out the internal pointers
143 }
144
145private:
146 /// constructor from existing CherenkovParticleIDObj
147 explicit CherenkovParticleID(podio::utils::MaybeSharedPtr<CherenkovParticleIDObj> obj);
149
150 podio::utils::MaybeSharedPtr<CherenkovParticleIDObj> m_obj{new CherenkovParticleIDObj{}, podio::utils::MarkOwned};
151};
152
153std::ostream& operator<<(std::ostream& o, const CherenkovParticleID& value);
154
155#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
156void to_json(nlohmann::json& j, const CherenkovParticleID& value);
157#endif
158
159
160} // namespace edm4eic
161
162
163
164template<>
165struct std::hash<edm4eic::CherenkovParticleID> {
166 std::size_t operator()(const edm4eic::CherenkovParticleID& obj) const {
167 return std::hash<edm4eic::CherenkovParticleIDObj*>{}(obj.m_obj.get());
168 }
169};
170
171
172// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
173// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
174// and https://github.com/AIDASoft/podio/issues/770
175#if defined(__clang__)
176 #pragma clang diagnostic push
177 #pragma clang diagnostic ignored "-Wunknown-warning-option"
178 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
179 #pragma clang diagnostic ignored "-Wdeprecated"
180constexpr std::string_view edm4eic::CherenkovParticleID::typeName;
181 #pragma clang diagnostic pop
182#elif defined(__GNUC__)
183 #pragma GCC diagnostic push
184 #pragma GCC diagnostic ignored "-Wdeprecated"
185constexpr std::string_view edm4eic::CherenkovParticleID::typeName;
186 #pragma GCC diagnostic pop
187#endif
188
189
190#endif
Definition CherenkovParticleIDCollectionData.h:33
Definition CherenkovParticleIDCollection.h:139
Definition CherenkovParticleID.h:46
float getNpe() const
Access the Overall photoelectron count.
Definition CherenkovParticleID.cc:87
constexpr bool operator==(const CherenkovParticleID &other) const
Definition CherenkovParticleID.h:125
CherenkovParticleIDCollection collection_type
Definition CherenkovParticleID.h:56
MutableCherenkovParticleID clone(bool cloneRelations=true) const
Definition CherenkovParticleID.cc:32
const edm4eic::TrackSegment getChargedParticle() const
Access the reconstructed charged particle.
Definition CherenkovParticleID.cc:91
MutableCherenkovParticleID mutable_type
Definition CherenkovParticleID.h:55
std::vector< edm4hep::Vector2f >::const_iterator thetaPhiPhotons_end() const
Definition CherenkovParticleID.cc:170
CherenkovParticleID & operator=(CherenkovParticleID other) &
copy-assignment operator
Definition CherenkovParticleID.cc:27
podio::ObjectID id() const
Definition CherenkovParticleID.h:134
std::vector< edm4eic::RawTrackerHit >::const_iterator rawHits_end() const
Definition CherenkovParticleID.cc:106
std::vector< edm4hep::Vector2f >::const_iterator thetaPhiPhotons_begin() const
Definition CherenkovParticleID.cc:164
std::size_t hypotheses_size() const
Definition CherenkovParticleID.cc:144
float getPhotonEnergy() const
Access the Average energy for these Cherenkov photons [GeV].
Definition CherenkovParticleID.cc:89
~CherenkovParticleID()=default
destructor
friend class CherenkovParticleIDCollectionIterator
Definition CherenkovParticleID.h:51
const podio::ObjectID getObjectID() const
Definition CherenkovParticleID.cc:203
CherenkovParticleID()=default
default constructor
static constexpr std::string_view typeName
Definition CherenkovParticleID.h:88
friend void swap(CherenkovParticleID &a, CherenkovParticleID &b)
Definition CherenkovParticleID.h:140
bool isAvailable() const
check whether the object is actually available
Definition CherenkovParticleID.cc:199
CherenkovParticleID(const CherenkovParticleID &other) noexcept=default
copy constructor
CherenkovParticleID & operator=(CherenkovParticleID other) &&=delete
void unlink()
disconnect from CherenkovParticleIDObj instance
Definition CherenkovParticleID.h:123
std::vector< edm4eic::CherenkovParticleIDHypothesis >::const_iterator hypotheses_end() const
Definition CherenkovParticleID.cc:138
std::vector< edm4eic::CherenkovParticleIDHypothesis >::const_iterator hypotheses_begin() const
Definition CherenkovParticleID.cc:132
friend class MutableCherenkovParticleID
Definition CherenkovParticleID.h:48
bool operator<(const CherenkovParticleID &other) const
Definition CherenkovParticleID.h:132
friend class CherenkovParticleIDCollection
Definition CherenkovParticleID.h:49
static CherenkovParticleID makeEmpty()
Definition CherenkovParticleID.cc:83
podio::RelationRange< edm4hep::Vector2f > getThetaPhiPhotons() const
Definition CherenkovParticleID.cc:187
std::size_t rawHits_size() const
Definition CherenkovParticleID.cc:112
podio::RelationRange< edm4eic::RawTrackerHit > getRawHits() const
Definition CherenkovParticleID.cc:123
bool operator!=(const MutableCherenkovParticleID &other) const
Definition CherenkovParticleID.h:129
constexpr bool operator!=(const CherenkovParticleID &other) const
Definition CherenkovParticleID.h:128
podio::RelationRange< edm4eic::CherenkovParticleIDHypothesis > getHypotheses() const
Definition CherenkovParticleID.cc:155
std::vector< edm4eic::RawTrackerHit >::const_iterator rawHits_begin() const
Definition CherenkovParticleID.cc:100
float getRefractiveIndex() const
Access the Average refractive index at the Cherenkov photons' vertices.
Definition CherenkovParticleID.cc:88
std::size_t thetaPhiPhotons_size() const
Definition CherenkovParticleID.cc:176
CherenkovParticleID(CherenkovParticleID &&other) noexcept=default
move constructor
Definition CherenkovParticleIDHypothesis.h:20
Definition CherenkovParticleIDObj.h:26
Definition MutableCherenkovParticleID.h:38
Definition MutableTrackSegment.h:37
Definition RawTrackerHit.h:41
Definition TrackSegment.h:45
Definition ArrowMapper.cc:63
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:99
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::CherenkovParticleID &obj) const
Definition CherenkovParticleID.h:166