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 {
22class RawTrackerHitCollection;
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(std::uint64_t cellID, std::int32_t charge, std::int32_t timeStamp);
48
49 /// copy constructor
51
52 /// copy-assignment operator
54
55 /// create a mutable deep-copy of the object with identical relations
56 /// if cloneRelations=false, the relations are not cloned and will be empty
57 MutableRawTrackerHit clone(bool cloneRelations=true) const;
58
59 /// destructor
61
62
63public:
64
65 /// Access the The detector specific (geometrical) cell id.
66 std::uint64_t getCellID() const;
67
68 /// Access the ADC value
69 std::int32_t getCharge() const;
70
71 /// Access the TDC value.
72 std::int32_t getTimeStamp() const;
73
74
75
76 /// Set the The detector specific (geometrical) cell id.
77 void setCellID(std::uint64_t value);
78 /// Get mutable reference to The detector specific (geometrical) cell id.
79 std::uint64_t& getCellID();
80 /// Get reference to The detector specific (geometrical) cell id.
81 [[deprecated("use getCellID instead")]]
82 std::uint64_t& cellID();
83
84 /// Set the ADC value
85 void setCharge(std::int32_t value);
86 /// Get mutable reference to ADC value
87 std::int32_t& getCharge();
88 /// Get reference to ADC value
89 [[deprecated("use getCharge instead")]]
90 std::int32_t& charge();
91
92 /// Set the TDC value.
93 void setTimeStamp(std::int32_t value);
94 /// Get mutable reference to TDC value.
95 std::int32_t& getTimeStamp();
96 /// Get reference to TDC value.
97 [[deprecated("use getTimeStamp instead")]]
98 std::int32_t& timeStamp();
99
100
101
102
103
104
105 /// check whether the object is actually available
106 bool isAvailable() const;
107 /// disconnect from RawTrackerHitObj instance
108 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RawTrackerHitObj>{nullptr}; }
109
110 bool operator==(const MutableRawTrackerHit& other) const { return m_obj == other.m_obj; }
111 bool operator==(const RawTrackerHit& other) const;
112
113 bool operator!=(const MutableRawTrackerHit& other) const { return !(*this == other); }
114 bool operator!=(const RawTrackerHit& other) const { return !(*this == other); }
115
116 // less comparison operator, so that objects can be e.g. stored in sets.
117 bool operator<(const MutableRawTrackerHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
118
119 podio::ObjectID id() const { return getObjectID(); }
120
121 const podio::ObjectID getObjectID() const;
122
124 using std::swap;
125 swap(a.m_obj, b.m_obj); // swap out the internal pointers
126 }
127
128private:
129 /// constructor from existing RawTrackerHitObj
130 explicit MutableRawTrackerHit(podio::utils::MaybeSharedPtr<RawTrackerHitObj> obj);
131
132 podio::utils::MaybeSharedPtr<RawTrackerHitObj> m_obj{nullptr};
133};
134
135#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
136void to_json(nlohmann::json& j, const MutableRawTrackerHit& value);
137#endif
138
139
140} // namespace edm4eic
141
142
143#endif
Definition MutableRawTrackerHit.h:33
bool operator==(const MutableRawTrackerHit &other) const
Definition MutableRawTrackerHit.h:110
bool operator!=(const MutableRawTrackerHit &other) const
Definition MutableRawTrackerHit.h:113
~MutableRawTrackerHit()=default
destructor
void setTimeStamp(std::int32_t value)
Set the TDC value.
Definition MutableRawTrackerHit.cc:54
void unlink()
disconnect from RawTrackerHitObj instance
Definition MutableRawTrackerHit.h:108
std::int32_t & charge()
Get reference to ADC value.
Definition MutableRawTrackerHit.cc:53
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:123
bool isAvailable() const
check whether the object is actually available
Definition MutableRawTrackerHit.cc:64
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:114
void setCellID(std::uint64_t value)
Set the The detector specific (geometrical) cell id.
Definition MutableRawTrackerHit.cc:48
bool operator<(const MutableRawTrackerHit &other) const
Definition MutableRawTrackerHit.h:117
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
void setCharge(std::int32_t value)
Set the ADC value.
Definition MutableRawTrackerHit.cc:51
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
podio::ObjectID id() const
Definition MutableRawTrackerHit.h:119
std::int32_t getCharge() const
Access the ADC value.
Definition MutableRawTrackerHit.cc:44
friend class RawTrackerHit
Definition MutableRawTrackerHit.h:37
Definition RawTrackerHitCollection.h:91
Definition RawTrackerHit.h:41
Definition RawTrackerHitCollection.h:62
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150