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
66
67 /// copy-assignment operator
68 CherenkovParticleID& operator=(CherenkovParticleID other) &; // Rebind this to other's internal object
69 CherenkovParticleID& operator=(CherenkovParticleID other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
70
71 /// create a mutable deep-copy of the object with identical relations
72 /// if cloneRelations=false, the relations are not cloned and will be empty
73 MutableCherenkovParticleID clone(bool cloneRelations=true) const;
74
75 /// destructor
77
78 /// converting constructor from mutable object
80
82
83public:
84
85 static constexpr std::string_view typeName = "edm4eic::CherenkovParticleID";
86
87 /// Access the Overall photoelectron count
88 float getNpe() const;
89
90 /// Access the Average refractive index at the Cherenkov photons' vertices
91 float getRefractiveIndex() const;
92
93 /// Access the Average energy for these Cherenkov photons [GeV]
94 float getPhotonEnergy() const;
95
96
97 /// Access the reconstructed charged particle
99
100 std::size_t rawHitAssociations_size() const;
102 std::vector<edm4eic::MCRecoTrackerHitAssociation>::const_iterator rawHitAssociations_begin() const;
103 std::vector<edm4eic::MCRecoTrackerHitAssociation>::const_iterator rawHitAssociations_end() const;
104 podio::RelationRange<edm4eic::MCRecoTrackerHitAssociation> getRawHitAssociations() const;
105 std::size_t hypotheses_size() const;
107 std::vector<edm4eic::CherenkovParticleIDHypothesis>::const_iterator hypotheses_begin() const;
108 std::vector<edm4eic::CherenkovParticleIDHypothesis>::const_iterator hypotheses_end() const;
109 podio::RelationRange<edm4eic::CherenkovParticleIDHypothesis> getHypotheses() const;
110 std::size_t thetaPhiPhotons_size() const;
111 edm4hep::Vector2f getThetaPhiPhotons(std::size_t) const;
112 std::vector<edm4hep::Vector2f>::const_iterator thetaPhiPhotons_begin() const;
113 std::vector<edm4hep::Vector2f>::const_iterator thetaPhiPhotons_end() const;
114 podio::RelationRange<edm4hep::Vector2f> getThetaPhiPhotons() const;
115
116
117 /// check whether the object is actually available
118 bool isAvailable() const;
119 /// disconnect from CherenkovParticleIDObj instance
120 void unlink() { m_obj = podio::utils::MaybeSharedPtr<CherenkovParticleIDObj>{nullptr}; }
121
122 bool operator==(const CherenkovParticleID& other) const { return m_obj == other.m_obj; }
123 bool operator==(const MutableCherenkovParticleID& other) const;
124
125 bool operator!=(const CherenkovParticleID& other) const { return !(*this == other); }
126 bool operator!=(const MutableCherenkovParticleID& other) const { return !(*this == other); }
127
128 // less comparison operator, so that objects can be e.g. stored in sets.
129 bool operator<(const CherenkovParticleID& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
130
131 podio::ObjectID id() const { return getObjectID(); }
132
133 const podio::ObjectID getObjectID() const;
134
135 friend std::hash<CherenkovParticleID>;
136
138 using std::swap;
139 swap(a.m_obj, b.m_obj); // swap out the internal pointers
140 }
141
142private:
143 /// constructor from existing CherenkovParticleIDObj
144 explicit CherenkovParticleID(podio::utils::MaybeSharedPtr<CherenkovParticleIDObj> obj);
146
147 podio::utils::MaybeSharedPtr<CherenkovParticleIDObj> m_obj{nullptr};
148};
149
150std::ostream& operator<<(std::ostream& o, const CherenkovParticleID& value);
151
152#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
153void to_json(nlohmann::json& j, const CherenkovParticleID& value);
154#endif
155
156
157} // namespace edm4eic
158
159
160
161template<>
162struct std::hash<edm4eic::CherenkovParticleID> {
163 std::size_t operator()(const edm4eic::CherenkovParticleID& obj) const {
164 return std::hash<edm4eic::CherenkovParticleIDObj*>{}(obj.m_obj.get());
165 }
166};
167
168
169// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
170// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
171// and https://github.com/AIDASoft/podio/issues/770
172#if defined(__clang__)
173#pragma clang diagnostic push
174#pragma clang diagnostic ignored "-Wunknown-warning-option"
175#pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
176#pragma clang diagnostic ignored "-Wdeprecated"
177constexpr std::string_view edm4eic::CherenkovParticleID::typeName;
178#pragma clang diagnostic pop
179#elif defined(__GNUC__)
180#pragma GCC diagnostic push
181#pragma GCC diagnostic ignored "-Wdeprecated"
182constexpr std::string_view edm4eic::CherenkovParticleID::typeName;
183#pragma GCC diagnostic pop
184#endif
185
186#endif
Definition CherenkovParticleIDCollectionData.h:32
Definition CherenkovParticleIDCollection.h:137
Definition CherenkovParticleID.h:46
std::vector< edm4eic::MCRecoTrackerHitAssociation >::const_iterator rawHitAssociations_begin() const
Definition CherenkovParticleID.cc:104
float getNpe() const
Access the Overall photoelectron count.
Definition CherenkovParticleID.cc:91
CherenkovParticleIDCollection collection_type
Definition CherenkovParticleID.h:56
MutableCherenkovParticleID clone(bool cloneRelations=true) const
Definition CherenkovParticleID.cc:36
const edm4eic::TrackSegment getChargedParticle() const
Access the reconstructed charged particle.
Definition CherenkovParticleID.cc:95
podio::RelationRange< edm4eic::MCRecoTrackerHitAssociation > getRawHitAssociations() const
Definition CherenkovParticleID.cc:127
MutableCherenkovParticleID mutable_type
Definition CherenkovParticleID.h:55
std::vector< edm4hep::Vector2f >::const_iterator thetaPhiPhotons_end() const
Definition CherenkovParticleID.cc:174
CherenkovParticleID & operator=(CherenkovParticleID other) &
copy-assignment operator
Definition CherenkovParticleID.cc:31
CherenkovParticleID(const CherenkovParticleID &other)=default
copy constructor
podio::ObjectID id() const
Definition CherenkovParticleID.h:131
std::vector< edm4hep::Vector2f >::const_iterator thetaPhiPhotons_begin() const
Definition CherenkovParticleID.cc:168
std::size_t hypotheses_size() const
Definition CherenkovParticleID.cc:148
float getPhotonEnergy() const
Access the Average energy for these Cherenkov photons [GeV].
Definition CherenkovParticleID.cc:93
~CherenkovParticleID()=default
destructor
friend class CherenkovParticleIDCollectionIterator
Definition CherenkovParticleID.h:51
const podio::ObjectID getObjectID() const
Definition CherenkovParticleID.cc:207
static constexpr std::string_view typeName
Definition CherenkovParticleID.h:85
CherenkovParticleID()
default constructor
Definition CherenkovParticleID.cc:21
friend void swap(CherenkovParticleID &a, CherenkovParticleID &b)
Definition CherenkovParticleID.h:137
bool isAvailable() const
check whether the object is actually available
Definition CherenkovParticleID.cc:203
std::vector< edm4eic::MCRecoTrackerHitAssociation >::const_iterator rawHitAssociations_end() const
Definition CherenkovParticleID.cc:110
CherenkovParticleID & operator=(CherenkovParticleID other) &&=delete
void unlink()
disconnect from CherenkovParticleIDObj instance
Definition CherenkovParticleID.h:120
std::vector< edm4eic::CherenkovParticleIDHypothesis >::const_iterator hypotheses_end() const
Definition CherenkovParticleID.cc:142
std::vector< edm4eic::CherenkovParticleIDHypothesis >::const_iterator hypotheses_begin() const
Definition CherenkovParticleID.cc:136
friend class MutableCherenkovParticleID
Definition CherenkovParticleID.h:48
bool operator<(const CherenkovParticleID &other) const
Definition CherenkovParticleID.h:129
friend class CherenkovParticleIDCollection
Definition CherenkovParticleID.h:49
static CherenkovParticleID makeEmpty()
Definition CherenkovParticleID.cc:87
podio::RelationRange< edm4hep::Vector2f > getThetaPhiPhotons() const
Definition CherenkovParticleID.cc:191
bool operator!=(const MutableCherenkovParticleID &other) const
Definition CherenkovParticleID.h:126
bool operator!=(const CherenkovParticleID &other) const
Definition CherenkovParticleID.h:125
bool operator==(const CherenkovParticleID &other) const
Definition CherenkovParticleID.h:122
podio::RelationRange< edm4eic::CherenkovParticleIDHypothesis > getHypotheses() const
Definition CherenkovParticleID.cc:159
float getRefractiveIndex() const
Access the Average refractive index at the Cherenkov photons' vertices.
Definition CherenkovParticleID.cc:92
std::size_t rawHitAssociations_size() const
Definition CherenkovParticleID.cc:116
std::size_t thetaPhiPhotons_size() const
Definition CherenkovParticleID.cc:180
Definition CherenkovParticleIDHypothesis.h:19
Definition CherenkovParticleIDObj.h:26
Definition MCRecoTrackerHitAssociation.h:46
Definition MutableCherenkovParticleID.h:38
Definition MutableTrackSegment.h:37
Definition TrackSegment.h:45
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::CherenkovParticleID &obj) const
Definition CherenkovParticleID.h:163