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) = default;
65
66 /// copy-assignment operator
67 RawCALOROCHit& operator=(RawCALOROCHit other) &; // Rebind this to other's internal object
68 RawCALOROCHit& operator=(RawCALOROCHit other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
69
70 /// create a mutable deep-copy of the object with identical relations
71 /// if cloneRelations=false, the relations are not cloned and will be empty
72 MutableRawCALOROCHit clone(bool cloneRelations=true) const;
73
74 /// destructor
75 ~RawCALOROCHit() = default;
76
77 /// converting constructor from mutable object
79
80 static RawCALOROCHit makeEmpty();
81
82public:
83
84 static constexpr std::string_view typeName = "edm4eic::RawCALOROCHit";
85
86 /// Access the Detector specific (geometrical) cell id
87 std::uint64_t getCellID() const;
88
89 /// Access the Phase of samples in [# samples], for synchronizing across chips
90 std::int32_t getSamplePhase() const;
91
92 /// Access the [TDC counts]
93 std::int32_t getTimeStamp() const;
94
95
96
97 std::size_t aSamples_size() const;
98 edm4eic::CALOROC1ASample getASamples(std::size_t) const;
99 std::vector<edm4eic::CALOROC1ASample>::const_iterator aSamples_begin() const;
100 std::vector<edm4eic::CALOROC1ASample>::const_iterator aSamples_end() const;
101 podio::RelationRange<edm4eic::CALOROC1ASample> getASamples() const;
102 std::size_t bSamples_size() const;
103 edm4eic::CALOROC1BSample getBSamples(std::size_t) const;
104 std::vector<edm4eic::CALOROC1BSample>::const_iterator bSamples_begin() const;
105 std::vector<edm4eic::CALOROC1BSample>::const_iterator bSamples_end() const;
106 podio::RelationRange<edm4eic::CALOROC1BSample> getBSamples() const;
107
108
109 /// check whether the object is actually available
110 bool isAvailable() const;
111 /// disconnect from RawCALOROCHitObj instance
112 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RawCALOROCHitObj>{nullptr}; }
113
114 bool operator==(const RawCALOROCHit& other) const { return m_obj == other.m_obj; }
115 bool operator==(const MutableRawCALOROCHit& other) const;
116
117 bool operator!=(const RawCALOROCHit& other) const { return !(*this == other); }
118 bool operator!=(const MutableRawCALOROCHit& other) const { return !(*this == other); }
119
120 // less comparison operator, so that objects can be e.g. stored in sets.
121 bool operator<(const RawCALOROCHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
122
123 podio::ObjectID id() const { return getObjectID(); }
124
125 const podio::ObjectID getObjectID() const;
126
127 friend std::hash<RawCALOROCHit>;
128
129 friend void swap(RawCALOROCHit& a, RawCALOROCHit& b) {
130 using std::swap;
131 swap(a.m_obj, b.m_obj); // swap out the internal pointers
132 }
133
134private:
135 /// constructor from existing RawCALOROCHitObj
136 explicit RawCALOROCHit(podio::utils::MaybeSharedPtr<RawCALOROCHitObj> obj);
138
139 podio::utils::MaybeSharedPtr<RawCALOROCHitObj> m_obj{new RawCALOROCHitObj{}, podio::utils::MarkOwned};
140};
141
142std::ostream& operator<<(std::ostream& o, const RawCALOROCHit& value);
143
144#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
145void to_json(nlohmann::json& j, const RawCALOROCHit& value);
146#endif
147
148
149} // namespace edm4eic
150
151
152
153template<>
154struct std::hash<edm4eic::RawCALOROCHit> {
155 std::size_t operator()(const edm4eic::RawCALOROCHit& obj) const {
156 return std::hash<edm4eic::RawCALOROCHitObj*>{}(obj.m_obj.get());
157 }
158};
159
160
161// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
162// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
163// and https://github.com/AIDASoft/podio/issues/770
164#if defined(__clang__)
165 #pragma clang diagnostic push
166 #pragma clang diagnostic ignored "-Wunknown-warning-option"
167 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
168 #pragma clang diagnostic ignored "-Wdeprecated"
169constexpr std::string_view edm4eic::RawCALOROCHit::typeName;
170 #pragma clang diagnostic pop
171#elif defined(__GNUC__)
172 #pragma GCC diagnostic push
173 #pragma GCC diagnostic ignored "-Wdeprecated"
174constexpr std::string_view edm4eic::RawCALOROCHit::typeName;
175 #pragma GCC diagnostic pop
176#endif
177
178
179#endif
Definition CALOROC1ASample.h:20
Definition CALOROC1BSample.h:20
Definition MutableRawCALOROCHit.h:37
Definition RawCALOROCHitCollectionData.h:31
Definition RawCALOROCHitCollection.h:138
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
bool operator!=(const RawCALOROCHit &other) const
Definition RawCALOROCHit.h:117
friend void swap(RawCALOROCHit &a, RawCALOROCHit &b)
Definition RawCALOROCHit.h:129
void unlink()
disconnect from RawCALOROCHitObj instance
Definition RawCALOROCHit.h:112
std::int32_t getTimeStamp() const
Access the [TDC counts].
Definition RawCALOROCHit.cc:74
friend class RawCALOROCHitCollectionIterator
Definition RawCALOROCHit.h:50
bool operator==(const RawCALOROCHit &other) const
Definition RawCALOROCHit.h:114
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
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:121
friend class MutableRawCALOROCHit
Definition RawCALOROCHit.h:47
friend class RawCALOROCHitCollection
Definition RawCALOROCHit.h:48
bool operator!=(const MutableRawCALOROCHit &other) const
Definition RawCALOROCHit.h:118
RawCALOROCHit(const RawCALOROCHit &other)=default
copy constructor
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:84
MutableRawCALOROCHit mutable_type
Definition RawCALOROCHit.h:54
podio::ObjectID id() const
Definition RawCALOROCHit.h:123
Definition RawCALOROCHitObj.h:21
Definition CalorimeterHit.cc:17
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:155