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
82 /// Set the ADC value
83 void setCharge(const std::int32_t charge);
84 /// Get mutable reference to ADC value
85 std::int32_t& getCharge();
86
87 /// Set the TDC value.
88 void setTimeStamp(const std::int32_t timeStamp);
89 /// Get mutable reference to TDC value.
90 std::int32_t& getTimeStamp();
91
92
93
94
95
96
97 /// check whether the object is actually available
98 bool isAvailable() const;
99 /// disconnect from RawTrackerHitObj instance
100 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RawTrackerHitObj>{nullptr}; }
101
102 constexpr bool operator==(const MutableRawTrackerHit& other) const { return m_obj == other.m_obj; }
103 bool operator==(const RawTrackerHit& other) const;
104
105 constexpr bool operator!=(const MutableRawTrackerHit& other) const { return !(*this == other); }
106 bool operator!=(const RawTrackerHit& other) const { return !(*this == other); }
107
108 // less comparison operator, so that objects can be e.g. stored in sets.
109 bool operator<(const MutableRawTrackerHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
110
111 podio::ObjectID id() const { return getObjectID(); }
112
113 const podio::ObjectID getObjectID() const;
114
115 friend std::hash<MutableRawTrackerHit>;
116
118 using std::swap;
119 swap(a.m_obj, b.m_obj); // swap out the internal pointers
120 }
121
122private:
123 /// constructor from existing RawTrackerHitObj
124 explicit MutableRawTrackerHit(podio::utils::MaybeSharedPtr<RawTrackerHitObj> obj);
125
126 podio::utils::MaybeSharedPtr<RawTrackerHitObj> m_obj{new RawTrackerHitObj{}, podio::utils::MarkOwned};
127};
128
129#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
130void to_json(nlohmann::json& j, const MutableRawTrackerHit& value);
131#endif
132
133
134} // namespace edm4eic
135
136
137
138template<>
139struct std::hash<edm4eic::MutableRawTrackerHit> {
140 std::size_t operator()(const edm4eic::MutableRawTrackerHit& obj) const {
141 return std::hash<edm4eic::RawTrackerHitObj*>{}(obj.m_obj.get());
142 }
143};
144
145
146#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:100
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:105
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 & operator=(MutableRawTrackerHit other) &
copy-assignment operator
Definition MutableRawTrackerHit.cc:24
friend void swap(MutableRawTrackerHit &a, MutableRawTrackerHit &b)
Definition MutableRawTrackerHit.h:117
bool isAvailable() const
check whether the object is actually available
Definition MutableRawTrackerHit.cc:57
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:106
RawTrackerHitCollection collection_type
Definition MutableRawTrackerHit.h:41
bool operator<(const MutableRawTrackerHit &other) const
Definition MutableRawTrackerHit.h:109
const podio::ObjectID getObjectID() const
Definition MutableRawTrackerHit.cc:61
MutableRawTrackerHit(const MutableRawTrackerHit &other)=default
copy constructor
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:102
podio::ObjectID id() const
Definition MutableRawTrackerHit.h:111
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:61
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableRawTrackerHit &obj) const
Definition MutableRawTrackerHit.h:140