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
54 MutableRawCALOROCHit(const MutableRawCALOROCHit& other) noexcept = default;
55
56 /// move constructor
57 MutableRawCALOROCHit(MutableRawCALOROCHit&& other) noexcept = default;
58
59 /// copy-assignment operator
60 MutableRawCALOROCHit& operator=(MutableRawCALOROCHit other) &; // Rebind this to other's internal object
61 MutableRawCALOROCHit& operator=(MutableRawCALOROCHit other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
62
63 /// create a mutable deep-copy of the object with identical relations
64 /// if cloneRelations=false, the relations are not cloned and will be empty
65 MutableRawCALOROCHit clone(bool cloneRelations=true) const;
66
67 /// destructor
69
70
71public:
72
73 /// Access the Detector specific (geometrical) cell id
74 std::uint64_t getCellID() const;
75
76 /// Access the Phase of samples in [# samples], for synchronizing across chips
77 std::int32_t getSamplePhase() const;
78
79 /// Access the [TDC counts]
80 std::int32_t getTimeStamp() const;
81
82
83
84 /// Set the Detector specific (geometrical) cell id
85 void setCellID(const std::uint64_t cellID);
86 /// Get mutable reference to Detector specific (geometrical) cell id
87 std::uint64_t& getCellID();
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
94 /// Set the [TDC counts]
95 void setTimeStamp(const std::int32_t timeStamp);
96 /// Get mutable reference to [TDC counts]
97 std::int32_t& getTimeStamp();
98
99
100
102 std::size_t aSamples_size() const;
103 edm4eic::CALOROC1ASample getASamples(std::size_t) const;
104 std::vector<edm4eic::CALOROC1ASample>::const_iterator aSamples_begin() const;
105 std::vector<edm4eic::CALOROC1ASample>::const_iterator aSamples_end() const;
106 podio::RelationRange<edm4eic::CALOROC1ASample> getASamples() const;
108 std::size_t bSamples_size() const;
109 edm4eic::CALOROC1BSample getBSamples(std::size_t) const;
110 std::vector<edm4eic::CALOROC1BSample>::const_iterator bSamples_begin() const;
111 std::vector<edm4eic::CALOROC1BSample>::const_iterator bSamples_end() const;
112 podio::RelationRange<edm4eic::CALOROC1BSample> getBSamples() const;
113
114
115
116 /// check whether the object is actually available
117 bool isAvailable() const;
118 /// disconnect from RawCALOROCHitObj instance
119 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RawCALOROCHitObj>{nullptr}; }
120
121 constexpr bool operator==(const MutableRawCALOROCHit& other) const { return m_obj == other.m_obj; }
122 bool operator==(const RawCALOROCHit& other) const;
123
124 constexpr bool operator!=(const MutableRawCALOROCHit& other) const { return !(*this == other); }
125 bool operator!=(const RawCALOROCHit& other) const { return !(*this == other); }
126
127 // less comparison operator, so that objects can be e.g. stored in sets.
128 bool operator<(const MutableRawCALOROCHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
129
130 podio::ObjectID id() const { return getObjectID(); }
131
132 const podio::ObjectID getObjectID() const;
133
134 friend std::hash<MutableRawCALOROCHit>;
135
137 using std::swap;
138 swap(a.m_obj, b.m_obj); // swap out the internal pointers
139 }
140
141private:
142 /// constructor from existing RawCALOROCHitObj
143 explicit MutableRawCALOROCHit(podio::utils::MaybeSharedPtr<RawCALOROCHitObj> obj);
144
145 podio::utils::MaybeSharedPtr<RawCALOROCHitObj> m_obj{new RawCALOROCHitObj{}, podio::utils::MarkOwned};
146};
147
148#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
149void to_json(nlohmann::json& j, const MutableRawCALOROCHit& value);
150#endif
151
152
153} // namespace edm4eic
154
155
156
157template<>
158struct std::hash<edm4eic::MutableRawCALOROCHit> {
159 std::size_t operator()(const edm4eic::MutableRawCALOROCHit& obj) const {
160 return std::hash<edm4eic::RawCALOROCHitObj*>{}(obj.m_obj.get());
161 }
162};
163
164
165#endif
Definition CALOROC1ASample.h:20
Definition CALOROC1BSample.h:20
Definition MutableRawCALOROCHit.h:37
podio::RelationRange< edm4eic::CALOROC1BSample > getBSamples() const
Definition MutableRawCALOROCHit.cc:122
friend class RawCALOROCHit
Definition MutableRawCALOROCHit.h:41
MutableRawCALOROCHit & operator=(MutableRawCALOROCHit other) &&=delete
MutableRawCALOROCHit(const MutableRawCALOROCHit &other) noexcept=default
copy constructor
constexpr bool operator!=(const MutableRawCALOROCHit &other) const
Definition MutableRawCALOROCHit.h:124
const podio::ObjectID getObjectID() const
Definition MutableRawCALOROCHit.cc:139
void unlink()
disconnect from RawCALOROCHitObj instance
Definition MutableRawCALOROCHit.h:119
std::size_t bSamples_size() const
Definition MutableRawCALOROCHit.cc:111
bool operator!=(const RawCALOROCHit &other) const
Definition MutableRawCALOROCHit.h:125
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:75
bool operator<(const MutableRawCALOROCHit &other) const
Definition MutableRawCALOROCHit.h:128
bool isAvailable() const
check whether the object is actually available
Definition MutableRawCALOROCHit.cc:135
std::vector< edm4eic::CALOROC1BSample >::const_iterator bSamples_end() const
Definition MutableRawCALOROCHit.cc:105
std::vector< edm4eic::CALOROC1ASample >::const_iterator aSamples_begin() const
Definition MutableRawCALOROCHit.cc:63
friend class RawCALOROCHitMutableCollectionIterator
Definition MutableRawCALOROCHit.h:40
podio::ObjectID id() 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:54
~MutableRawCALOROCHit()=default
destructor
void addToASamples(const edm4eic::CALOROC1ASample &)
Definition MutableRawCALOROCHit.cc:58
MutableRawCALOROCHit(MutableRawCALOROCHit &&other) noexcept=default
move constructor
MutableRawCALOROCHit clone(bool cloneRelations=true) const
Definition MutableRawCALOROCHit.cc:29
constexpr bool operator==(const MutableRawCALOROCHit &other) const
Definition MutableRawCALOROCHit.h:121
friend void swap(MutableRawCALOROCHit &a, MutableRawCALOROCHit &b)
Definition MutableRawCALOROCHit.h:136
RawCALOROCHitCollection collection_type
Definition MutableRawCALOROCHit.h:45
friend class RawCALOROCHitCollection
Definition MutableRawCALOROCHit.h:39
std::vector< edm4eic::CALOROC1BSample >::const_iterator bSamples_begin() const
Definition MutableRawCALOROCHit.cc:99
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:86
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:69
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:52
void addToBSamples(const edm4eic::CALOROC1BSample &)
Definition MutableRawCALOROCHit.cc:94
MutableRawCALOROCHit()=default
default constructor
Definition RawCALOROCHitCollection.h:139
Definition RawCALOROCHit.h:45
Definition RawCALOROCHitObj.h:21
Definition ArrowMapper.cc:63
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableRawCALOROCHit &obj) const
Definition MutableRawCALOROCHit.h:159