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