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