EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableRawCALOROCHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableRawCALOROCHit_H
4#define EDM4EIC_MutableRawCALOROCHit_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
12#include "podio/RelationRange.h"
13#include <cstdint>
14#include <vector>
15
16#include "podio/utilities/MaybeSharedPtr.h"
17
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 edm4eic {
31
32
33/** @class MutableRawCALOROCHit
34 * Raw hit from a CALOROC1A/B chip
35 * @author: D. Anderson, S. Joosten, T. Protzman, N. Novitzky, D. Kalinkin, M. Zurek, M. H. Kim
36 */
38
41 friend class RawCALOROCHit;
42
43public:
46
47 /// default constructor
49
50 /// Constructor initializing all members
51 MutableRawCALOROCHit(const std::uint64_t cellID, const std::int32_t samplePhase, const std::int32_t timeStamp);
52
53 /// copy constructor
55
56 /// copy-assignment operator
57 MutableRawCALOROCHit& operator=(MutableRawCALOROCHit other) &; // Rebind this to other's internal object
58 MutableRawCALOROCHit& operator=(MutableRawCALOROCHit other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
59
60 /// create a mutable deep-copy of the object with identical relations
61 /// if cloneRelations=false, the relations are not cloned and will be empty
62 MutableRawCALOROCHit clone(bool cloneRelations=true) const;
63
64 /// destructor
66
67
68public:
69
70 /// Access the Detector specific (geometrical) cell id
71 std::uint64_t getCellID() const;
72
73 /// Access the Phase of samples in [# samples], for synchronizing across chips
74 std::int32_t getSamplePhase() const;
75
76 /// Access the [TDC counts]
77 std::int32_t getTimeStamp() const;
78
79
80
81 /// Set the Detector specific (geometrical) cell id
82 void setCellID(const std::uint64_t cellID);
83 /// Get mutable reference to Detector specific (geometrical) cell id
84 std::uint64_t& getCellID();
85 /// Get reference to Detector specific (geometrical) cell id
86 [[deprecated("use getCellID instead")]]
87 std::uint64_t& cellID();
88
89 /// Set the Phase of samples in [# samples], for synchronizing across chips
90 void setSamplePhase(const std::int32_t samplePhase);
91 /// Get mutable reference to Phase of samples in [# samples], for synchronizing across chips
92 std::int32_t& getSamplePhase();
93 /// Get reference to Phase of samples in [# samples], for synchronizing across chips
94 [[deprecated("use getSamplePhase instead")]]
95 std::int32_t& samplePhase();
96
97 /// Set the [TDC counts]
98 void setTimeStamp(const std::int32_t timeStamp);
99 /// Get mutable reference to [TDC counts]
100 std::int32_t& getTimeStamp();
101 /// Get reference to [TDC counts]
102 [[deprecated("use getTimeStamp instead")]]
103 std::int32_t& timeStamp();
104
105
106
108 std::size_t aSamples_size() const;
109 edm4eic::CALOROC1ASample getASamples(std::size_t) const;
110 std::vector<edm4eic::CALOROC1ASample>::const_iterator aSamples_begin() const;
111 std::vector<edm4eic::CALOROC1ASample>::const_iterator aSamples_end() const;
112 podio::RelationRange<edm4eic::CALOROC1ASample> getASamples() const;
114 std::size_t bSamples_size() const;
115 edm4eic::CALOROC1BSample getBSamples(std::size_t) const;
116 std::vector<edm4eic::CALOROC1BSample>::const_iterator bSamples_begin() const;
117 std::vector<edm4eic::CALOROC1BSample>::const_iterator bSamples_end() const;
118 podio::RelationRange<edm4eic::CALOROC1BSample> getBSamples() const;
119
120
121
122 /// check whether the object is actually available
123 bool isAvailable() const;
124 /// disconnect from RawCALOROCHitObj instance
125 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RawCALOROCHitObj>{nullptr}; }
126
127 bool operator==(const MutableRawCALOROCHit& other) const { return m_obj == other.m_obj; }
128 bool operator==(const RawCALOROCHit& other) const;
129
130 bool operator!=(const MutableRawCALOROCHit& other) const { return !(*this == other); }
131 bool operator!=(const RawCALOROCHit& other) const { return !(*this == other); }
132
133 // less comparison operator, so that objects can be e.g. stored in sets.
134 bool operator<(const MutableRawCALOROCHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
135
136 podio::ObjectID id() const { return getObjectID(); }
137
138 const podio::ObjectID getObjectID() const;
139
140 friend std::hash<MutableRawCALOROCHit>;
141
143 using std::swap;
144 swap(a.m_obj, b.m_obj); // swap out the internal pointers
145 }
146
147private:
148 /// constructor from existing RawCALOROCHitObj
149 explicit MutableRawCALOROCHit(podio::utils::MaybeSharedPtr<RawCALOROCHitObj> obj);
150
151 podio::utils::MaybeSharedPtr<RawCALOROCHitObj> m_obj{new RawCALOROCHitObj{}, podio::utils::MarkOwned};
152};
153
154#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
155void to_json(nlohmann::json& j, const MutableRawCALOROCHit& value);
156#endif
157
158
159} // namespace edm4eic
160
161
162
163template<>
164struct std::hash<edm4eic::MutableRawCALOROCHit> {
165 std::size_t operator()(const edm4eic::MutableRawCALOROCHit& obj) const {
166 return std::hash<edm4eic::RawCALOROCHitObj*>{}(obj.m_obj.get());
167 }
168};
169
170
171#endif
Definition CALOROC1ASample.h:20
Definition CALOROC1BSample.h:20
Definition MutableRawCALOROCHit.h:37
podio::RelationRange< edm4eic::CALOROC1BSample > getBSamples() const
Definition MutableRawCALOROCHit.cc:125
friend class RawCALOROCHit
Definition MutableRawCALOROCHit.h:41
MutableRawCALOROCHit & operator=(MutableRawCALOROCHit other) &&=delete
MutableRawCALOROCHit(const MutableRawCALOROCHit &other)=default
copy constructor
const podio::ObjectID getObjectID() const
Definition MutableRawCALOROCHit.cc:142
void unlink()
disconnect from RawCALOROCHitObj instance
Definition MutableRawCALOROCHit.h:125
std::size_t bSamples_size() const
Definition MutableRawCALOROCHit.cc:114
bool operator!=(const RawCALOROCHit &other) const
Definition MutableRawCALOROCHit.h:131
std::uint64_t & cellID()
Get reference to Detector specific (geometrical) cell id.
Definition MutableRawCALOROCHit.cc:52
void setCellID(const std::uint64_t cellID)
Set the Detector specific (geometrical) cell id.
Definition MutableRawCALOROCHit.cc:50
std::size_t aSamples_size() const
Definition MutableRawCALOROCHit.cc:78
bool operator<(const MutableRawCALOROCHit &other) const
Definition MutableRawCALOROCHit.h:134
bool isAvailable() const
check whether the object is actually available
Definition MutableRawCALOROCHit.cc:138
std::vector< edm4eic::CALOROC1BSample >::const_iterator bSamples_end() const
Definition MutableRawCALOROCHit.cc:108
std::vector< edm4eic::CALOROC1ASample >::const_iterator aSamples_begin() const
Definition MutableRawCALOROCHit.cc:66
friend class RawCALOROCHitMutableCollectionIterator
Definition MutableRawCALOROCHit.h:40
podio::ObjectID id() const
Definition MutableRawCALOROCHit.h:136
bool operator!=(const MutableRawCALOROCHit &other) const
Definition MutableRawCALOROCHit.h:130
std::uint64_t getCellID() const
Access the Detector specific (geometrical) cell id.
Definition MutableRawCALOROCHit.cc:45
void setTimeStamp(const std::int32_t timeStamp)
Set the [TDC counts].
Definition MutableRawCALOROCHit.cc:56
~MutableRawCALOROCHit()=default
destructor
void addToASamples(const edm4eic::CALOROC1ASample &)
Definition MutableRawCALOROCHit.cc:61
std::int32_t & samplePhase()
Get reference to Phase of samples in [# samples], for synchronizing across chips.
Definition MutableRawCALOROCHit.cc:55
MutableRawCALOROCHit clone(bool cloneRelations=true) const
Definition MutableRawCALOROCHit.cc:29
friend void swap(MutableRawCALOROCHit &a, MutableRawCALOROCHit &b)
Definition MutableRawCALOROCHit.h:142
RawCALOROCHitCollection collection_type
Definition MutableRawCALOROCHit.h:45
friend class RawCALOROCHitCollection
Definition MutableRawCALOROCHit.h:39
bool operator==(const MutableRawCALOROCHit &other) const
Definition MutableRawCALOROCHit.h:127
std::vector< edm4eic::CALOROC1BSample >::const_iterator bSamples_begin() const
Definition MutableRawCALOROCHit.cc:102
std::int32_t getSamplePhase() const
Access the Phase of samples in [# samples], for synchronizing across chips.
Definition MutableRawCALOROCHit.cc:46
podio::RelationRange< edm4eic::CALOROC1ASample > getASamples() const
Definition MutableRawCALOROCHit.cc:89
std::int32_t getTimeStamp() const
Access the [TDC counts].
Definition MutableRawCALOROCHit.cc:47
MutableRawCALOROCHit & operator=(MutableRawCALOROCHit other) &
copy-assignment operator
Definition MutableRawCALOROCHit.cc:24
std::vector< edm4eic::CALOROC1ASample >::const_iterator aSamples_end() const
Definition MutableRawCALOROCHit.cc:72
RawCALOROCHit object_type
Definition MutableRawCALOROCHit.h:44
void setSamplePhase(const std::int32_t samplePhase)
Set the Phase of samples in [# samples], for synchronizing across chips.
Definition MutableRawCALOROCHit.cc:53
void addToBSamples(const edm4eic::CALOROC1BSample &)
Definition MutableRawCALOROCHit.cc:97
MutableRawCALOROCHit()=default
default constructor
std::int32_t & timeStamp()
Get reference to [TDC counts].
Definition MutableRawCALOROCHit.cc:58
Definition RawCALOROCHitCollection.h:138
Definition RawCALOROCHit.h:45
Definition RawCALOROCHitObj.h:21
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableRawCALOROCHit &obj) const
Definition MutableRawCALOROCHit.h:165