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
50 MutableRawTrackerHit(const MutableRawTrackerHit& other) noexcept = default;
51
52 /// move constructor
53 MutableRawTrackerHit(MutableRawTrackerHit&& other) noexcept = default;
54
55 /// copy-assignment operator
56 MutableRawTrackerHit& operator=(MutableRawTrackerHit other) &; // Rebind this to other's internal object
57 MutableRawTrackerHit& operator=(MutableRawTrackerHit 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 MutableRawTrackerHit clone(bool cloneRelations=true) const;
62
63 /// destructor
65
66
67public:
68
69 /// Access the The detector specific (geometrical) cell id.
70 std::uint64_t getCellID() const;
71
72 /// Access the ADC value
73 std::int32_t getCharge() const;
74
75 /// Access the TDC value.
76 std::int32_t getTimeStamp() const;
77
78
79
80 /// Set the The detector specific (geometrical) cell id.
81 void setCellID(const std::uint64_t cellID);
82 /// Get mutable reference to The detector specific (geometrical) cell id.
83 std::uint64_t& getCellID();
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
90 /// Set the TDC value.
91 void setTimeStamp(const std::int32_t timeStamp);
92 /// Get mutable reference to TDC value.
93 std::int32_t& getTimeStamp();
94
95
96
97
98
99
100 /// check whether the object is actually available
101 bool isAvailable() const;
102 /// disconnect from RawTrackerHitObj instance
103 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RawTrackerHitObj>{nullptr}; }
104
105 constexpr bool operator==(const MutableRawTrackerHit& other) const { return m_obj == other.m_obj; }
106 bool operator==(const RawTrackerHit& other) const;
107
108 constexpr bool operator!=(const MutableRawTrackerHit& other) const { return !(*this == other); }
109 bool operator!=(const RawTrackerHit& other) const { return !(*this == other); }
110
111 // less comparison operator, so that objects can be e.g. stored in sets.
112 bool operator<(const MutableRawTrackerHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
113
114 podio::ObjectID id() const { return getObjectID(); }
115
116 const podio::ObjectID getObjectID() const;
117
118 friend std::hash<MutableRawTrackerHit>;
119
121 using std::swap;
122 swap(a.m_obj, b.m_obj); // swap out the internal pointers
123 }
124
125private:
126 /// constructor from existing RawTrackerHitObj
127 explicit MutableRawTrackerHit(podio::utils::MaybeSharedPtr<RawTrackerHitObj> obj);
128
129 podio::utils::MaybeSharedPtr<RawTrackerHitObj> m_obj{new RawTrackerHitObj{}, podio::utils::MarkOwned};
130};
131
132#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
133void to_json(nlohmann::json& j, const MutableRawTrackerHit& value);
134#endif
135
136
137} // namespace edm4eic
138
139
140
141template<>
142struct std::hash<edm4eic::MutableRawTrackerHit> {
143 std::size_t operator()(const edm4eic::MutableRawTrackerHit& obj) const {
144 return std::hash<edm4eic::RawTrackerHitObj*>{}(obj.m_obj.get());
145 }
146};
147
148
149#endif
Definition MutableRawTrackerHit.h:33
void setCharge(const std::int32_t charge)
Set the ADC value.
Definition MutableRawTrackerHit.cc:46
~MutableRawTrackerHit()=default
destructor
void unlink()
disconnect from RawTrackerHitObj instance
Definition MutableRawTrackerHit.h:103
void setTimeStamp(const std::int32_t timeStamp)
Set the TDC value.
Definition MutableRawTrackerHit.cc:48
constexpr bool operator!=(const MutableRawTrackerHit &other) const
Definition MutableRawTrackerHit.h:108
void setCellID(const std::uint64_t cellID)
Set the The detector specific (geometrical) cell id.
Definition MutableRawTrackerHit.cc:44
std::int32_t getTimeStamp() const
Access the TDC value.
Definition MutableRawTrackerHit.cc:41
MutableRawTrackerHit()=default
default constructor
MutableRawTrackerHit(const MutableRawTrackerHit &other) noexcept=default
copy constructor
MutableRawTrackerHit & operator=(MutableRawTrackerHit other) &
copy-assignment operator
Definition MutableRawTrackerHit.cc:24
friend void swap(MutableRawTrackerHit &a, MutableRawTrackerHit &b)
Definition MutableRawTrackerHit.h:120
bool isAvailable() const
check whether the object is actually available
Definition MutableRawTrackerHit.cc:57
MutableRawTrackerHit(MutableRawTrackerHit &&other) noexcept=default
move constructor
friend class RawTrackerHitMutableCollectionIterator
Definition MutableRawTrackerHit.h:36
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition MutableRawTrackerHit.cc:39
bool operator!=(const RawTrackerHit &other) const
Definition MutableRawTrackerHit.h:109
RawTrackerHitCollection collection_type
Definition MutableRawTrackerHit.h:41
bool operator<(const MutableRawTrackerHit &other) const
Definition MutableRawTrackerHit.h:112
const podio::ObjectID getObjectID() const
Definition MutableRawTrackerHit.cc:61
MutableRawTrackerHit clone(bool cloneRelations=true) const
Definition MutableRawTrackerHit.cc:29
friend class RawTrackerHitCollection
Definition MutableRawTrackerHit.h:35
MutableRawTrackerHit & operator=(MutableRawTrackerHit other) &&=delete
constexpr bool operator==(const MutableRawTrackerHit &other) const
Definition MutableRawTrackerHit.h:105
podio::ObjectID id() const
Definition MutableRawTrackerHit.h:114
std::int32_t getCharge() const
Access the ADC value.
Definition MutableRawTrackerHit.cc:40
RawTrackerHit object_type
Definition MutableRawTrackerHit.h:40
friend class RawTrackerHit
Definition MutableRawTrackerHit.h:37
Definition RawTrackerHitCollection.h:139
Definition RawTrackerHit.h:41
Definition RawTrackerHitObj.h:17
Definition ArrowMapper.cc:60
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableRawTrackerHit &obj) const
Definition MutableRawTrackerHit.h:143