EDM4eic
EIC data model
Loading...
Searching...
No Matches
RawCALOROCHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_RawCALOROCHit_H
4#define EDM4EIC_RawCALOROCHit_H
5
7
10#include "podio/RelationRange.h"
11#include <cstdint>
12#include <vector>
13
14#include "podio/utilities/MaybeSharedPtr.h"
15#include "podio/detail/OrderKey.h"
16
17#include <ostream>
18#include <cstdint>
19
20#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
21#include "nlohmann/json_fwd.hpp"
22#endif
23
24// forward declarations
25namespace edm4eic {
27}
28
29
30namespace podio::detail {
31// Internal function used in less comparison operators of the datatypes and interface types
32OrderKey getOrderKey(const edm4eic::RawCALOROCHit& obj);
33};
34
35namespace edm4eic {
36
40
41/** @class RawCALOROCHit
42 * Raw hit from a CALOROC1A/B chip
43 * @author: D. Anderson, S. Joosten, T. Protzman, N. Novitzky, D. Kalinkin, M. Zurek, M. H. Kim
44 */
46
51 friend podio::detail::OrderKey podio::detail::getOrderKey(const RawCALOROCHit & obj);
52
53public:
56
57 /// default constructor
58 RawCALOROCHit() = default;
59
60 /// Constructor initializing all members
61 RawCALOROCHit(const std::uint64_t cellID, const std::int32_t samplePhase, const std::int32_t timeStamp);
62
63 /// copy constructor
64 RawCALOROCHit(const RawCALOROCHit& other) noexcept = default;
65
66 /// move constructor
67 RawCALOROCHit(RawCALOROCHit&& other) noexcept = default;
68
69 /// copy-assignment operator
70 RawCALOROCHit& operator=(RawCALOROCHit other) &; // Rebind this to other's internal object
71 RawCALOROCHit& operator=(RawCALOROCHit other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
72
73 /// create a mutable deep-copy of the object with identical relations
74 /// if cloneRelations=false, the relations are not cloned and will be empty
75 MutableRawCALOROCHit clone(bool cloneRelations=true) const;
76
77 /// destructor
78 ~RawCALOROCHit() = default;
79
80 /// converting constructor from mutable object
82
83 static RawCALOROCHit makeEmpty();
84
85public:
86
87 static constexpr std::string_view typeName = "edm4eic::RawCALOROCHit";
88
89 /// Access the Detector specific (geometrical) cell id
90 std::uint64_t getCellID() const;
91
92 /// Access the Phase of samples in [# samples], for synchronizing across chips
93 std::int32_t getSamplePhase() const;
94
95 /// Access the [TDC counts]
96 std::int32_t getTimeStamp() const;
97
98
99
100 std::size_t aSamples_size() const;
101 edm4eic::CALOROC1ASample getASamples(std::size_t) const;
102 std::vector<edm4eic::CALOROC1ASample>::const_iterator aSamples_begin() const;
103 std::vector<edm4eic::CALOROC1ASample>::const_iterator aSamples_end() const;
104 podio::RelationRange<edm4eic::CALOROC1ASample> getASamples() const;
105 std::size_t bSamples_size() const;
106 edm4eic::CALOROC1BSample getBSamples(std::size_t) const;
107 std::vector<edm4eic::CALOROC1BSample>::const_iterator bSamples_begin() const;
108 std::vector<edm4eic::CALOROC1BSample>::const_iterator bSamples_end() const;
109 podio::RelationRange<edm4eic::CALOROC1BSample> getBSamples() const;
110
111
112 /// check whether the object is actually available
113 bool isAvailable() const;
114 /// disconnect from RawCALOROCHitObj instance
115 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RawCALOROCHitObj>{nullptr}; }
116
117 constexpr bool operator==(const RawCALOROCHit& other) const { return m_obj == other.m_obj; }
118 bool operator==(const MutableRawCALOROCHit& other) const;
119
120 constexpr bool operator!=(const RawCALOROCHit& other) const { return !(*this == other); }
121 bool operator!=(const MutableRawCALOROCHit& other) const { return !(*this == other); }
122
123 // less comparison operator, so that objects can be e.g. stored in sets.
124 bool operator<(const RawCALOROCHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
125
126 podio::ObjectID id() const { return getObjectID(); }
127
128 const podio::ObjectID getObjectID() const;
129
130 friend std::hash<RawCALOROCHit>;
131
132 friend void swap(RawCALOROCHit& a, RawCALOROCHit& b) {
133 using std::swap;
134 swap(a.m_obj, b.m_obj); // swap out the internal pointers
135 }
136
137private:
138 /// constructor from existing RawCALOROCHitObj
139 explicit RawCALOROCHit(podio::utils::MaybeSharedPtr<RawCALOROCHitObj> obj);
141
142 podio::utils::MaybeSharedPtr<RawCALOROCHitObj> m_obj{new RawCALOROCHitObj{}, podio::utils::MarkOwned};
143};
144
145std::ostream& operator<<(std::ostream& o, const RawCALOROCHit& value);
146
147#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
148void to_json(nlohmann::json& j, const RawCALOROCHit& value);
149#endif
150
151
152} // namespace edm4eic
153
154
155
156template<>
157struct std::hash<edm4eic::RawCALOROCHit> {
158 std::size_t operator()(const edm4eic::RawCALOROCHit& obj) const {
159 return std::hash<edm4eic::RawCALOROCHitObj*>{}(obj.m_obj.get());
160 }
161};
162
163
164// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
165// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
166// and https://github.com/AIDASoft/podio/issues/770
167#if defined(__clang__)
168 #pragma clang diagnostic push
169 #pragma clang diagnostic ignored "-Wunknown-warning-option"
170 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
171 #pragma clang diagnostic ignored "-Wdeprecated"
172constexpr std::string_view edm4eic::RawCALOROCHit::typeName;
173 #pragma clang diagnostic pop
174#elif defined(__GNUC__)
175 #pragma GCC diagnostic push
176 #pragma GCC diagnostic ignored "-Wdeprecated"
177constexpr std::string_view edm4eic::RawCALOROCHit::typeName;
178 #pragma GCC diagnostic pop
179#endif
180
181
182#endif
Definition CALOROC1ASample.h:20
Definition CALOROC1BSample.h:20
Definition MutableRawCALOROCHit.h:37
Definition RawCALOROCHitCollectionData.h:31
Definition RawCALOROCHitCollection.h:139
Definition RawCALOROCHit.h:45
MutableRawCALOROCHit clone(bool cloneRelations=true) const
Definition RawCALOROCHit.cc:31
RawCALOROCHit & operator=(RawCALOROCHit other) &
copy-assignment operator
Definition RawCALOROCHit.cc:26
friend void swap(RawCALOROCHit &a, RawCALOROCHit &b)
Definition RawCALOROCHit.h:132
RawCALOROCHit(const RawCALOROCHit &other) noexcept=default
copy constructor
void unlink()
disconnect from RawCALOROCHitObj instance
Definition RawCALOROCHit.h:115
std::int32_t getTimeStamp() const
Access the [TDC counts].
Definition RawCALOROCHit.cc:74
constexpr bool operator==(const RawCALOROCHit &other) const
Definition RawCALOROCHit.h:117
friend class RawCALOROCHitCollectionIterator
Definition RawCALOROCHit.h:50
RawCALOROCHit()=default
default constructor
RawCALOROCHitCollection collection_type
Definition RawCALOROCHit.h:55
std::vector< edm4eic::CALOROC1BSample >::const_iterator bSamples_begin() const
Definition RawCALOROCHit.cc:110
static RawCALOROCHit makeEmpty()
Definition RawCALOROCHit.cc:68
podio::RelationRange< edm4eic::CALOROC1BSample > getBSamples() const
Definition RawCALOROCHit.cc:133
~RawCALOROCHit()=default
destructor
std::vector< edm4eic::CALOROC1BSample >::const_iterator bSamples_end() const
Definition RawCALOROCHit.cc:116
std::vector< edm4eic::CALOROC1ASample >::const_iterator aSamples_begin() const
Definition RawCALOROCHit.cc:78
podio::RelationRange< edm4eic::CALOROC1ASample > getASamples() const
Definition RawCALOROCHit.cc:101
std::uint64_t getCellID() const
Access the Detector specific (geometrical) cell id.
Definition RawCALOROCHit.cc:72
constexpr bool operator!=(const RawCALOROCHit &other) const
Definition RawCALOROCHit.h:120
bool isAvailable() const
check whether the object is actually available
Definition RawCALOROCHit.cc:145
const podio::ObjectID getObjectID() const
Definition RawCALOROCHit.cc:149
bool operator<(const RawCALOROCHit &other) const
Definition RawCALOROCHit.h:124
friend class MutableRawCALOROCHit
Definition RawCALOROCHit.h:47
friend class RawCALOROCHitCollection
Definition RawCALOROCHit.h:48
RawCALOROCHit(RawCALOROCHit &&other) noexcept=default
move constructor
bool operator!=(const MutableRawCALOROCHit &other) const
Definition RawCALOROCHit.h:121
RawCALOROCHit & operator=(RawCALOROCHit other) &&=delete
std::size_t aSamples_size() const
Definition RawCALOROCHit.cc:90
std::size_t bSamples_size() const
Definition RawCALOROCHit.cc:122
std::int32_t getSamplePhase() const
Access the Phase of samples in [# samples], for synchronizing across chips.
Definition RawCALOROCHit.cc:73
std::vector< edm4eic::CALOROC1ASample >::const_iterator aSamples_end() const
Definition RawCALOROCHit.cc:84
static constexpr std::string_view typeName
Definition RawCALOROCHit.h:87
MutableRawCALOROCHit mutable_type
Definition RawCALOROCHit.h:54
podio::ObjectID id() const
Definition RawCALOROCHit.h:126
Definition RawCALOROCHitObj.h:21
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::RawCALOROCHit &obj) const
Definition RawCALOROCHit.h:158