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