EDM4eic
EIC data model
Loading...
Searching...
No Matches
RawTrackerHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_RawTrackerHit_H
4#define EDM4EIC_RawTrackerHit_H
5
7
8#include <cstdint>
9
10#include "podio/utilities/MaybeSharedPtr.h"
11#include "podio/detail/OrderKey.h"
12
13#include <ostream>
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 podio::detail {
27// Internal function used in less comparison operators of the datatypes and interface types
28OrderKey getOrderKey(const edm4eic::RawTrackerHit& obj);
29};
30
31namespace edm4eic {
32
36
37/** @class RawTrackerHit
38 * Raw (digitized) tracker hit
39 * @author: W. Armstrong, S. Joosten
40 */
42
47 friend podio::detail::OrderKey podio::detail::getOrderKey(const RawTrackerHit & obj);
48
49public:
52
53 /// default constructor
54 RawTrackerHit() = default;
55
56 /// Constructor initializing all members
57 RawTrackerHit(const std::uint64_t cellID, const std::int32_t charge, const std::int32_t timeStamp);
58
59 /// copy constructor
60 RawTrackerHit(const RawTrackerHit& other) noexcept = default;
61
62 /// move constructor
63 RawTrackerHit(RawTrackerHit&& other) noexcept = default;
64
65 /// copy-assignment operator
66 RawTrackerHit& operator=(RawTrackerHit other) &; // Rebind this to other's internal object
67 RawTrackerHit& operator=(RawTrackerHit other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
68
69 /// create a mutable deep-copy of the object with identical relations
70 /// if cloneRelations=false, the relations are not cloned and will be empty
71 MutableRawTrackerHit clone(bool cloneRelations=true) const;
72
73 /// destructor
74 ~RawTrackerHit() = default;
75
76 /// converting constructor from mutable object
78
79 static RawTrackerHit makeEmpty();
80
81public:
82
83 static constexpr std::string_view typeName = "edm4eic::RawTrackerHit";
84
85 /// Access the The detector specific (geometrical) cell id.
86 std::uint64_t getCellID() const;
87
88 /// Access the ADC value
89 std::int32_t getCharge() const;
90
91 /// Access the TDC value.
92 std::int32_t getTimeStamp() const;
93
94
95
96
97
98 /// check whether the object is actually available
99 bool isAvailable() const;
100 /// disconnect from RawTrackerHitObj instance
101 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RawTrackerHitObj>{nullptr}; }
102
103 constexpr bool operator==(const RawTrackerHit& other) const { return m_obj == other.m_obj; }
104 bool operator==(const MutableRawTrackerHit& other) const;
105
106 constexpr bool operator!=(const RawTrackerHit& other) const { return !(*this == other); }
107 bool operator!=(const MutableRawTrackerHit& other) const { return !(*this == other); }
108
109 // less comparison operator, so that objects can be e.g. stored in sets.
110 bool operator<(const RawTrackerHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
111
112 podio::ObjectID id() const { return getObjectID(); }
113
114 const podio::ObjectID getObjectID() const;
115
116 friend std::hash<RawTrackerHit>;
117
118 friend void swap(RawTrackerHit& a, RawTrackerHit& b) {
119 using std::swap;
120 swap(a.m_obj, b.m_obj); // swap out the internal pointers
121 }
122
123private:
124 /// constructor from existing RawTrackerHitObj
125 explicit RawTrackerHit(podio::utils::MaybeSharedPtr<RawTrackerHitObj> obj);
127
128 podio::utils::MaybeSharedPtr<RawTrackerHitObj> m_obj{new RawTrackerHitObj{}, podio::utils::MarkOwned};
129};
130
131std::ostream& operator<<(std::ostream& o, const RawTrackerHit& value);
132
133#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
134void to_json(nlohmann::json& j, const RawTrackerHit& value);
135#endif
136
137
138} // namespace edm4eic
139
140
141
142template<>
143struct std::hash<edm4eic::RawTrackerHit> {
144 std::size_t operator()(const edm4eic::RawTrackerHit& obj) const {
145 return std::hash<edm4eic::RawTrackerHitObj*>{}(obj.m_obj.get());
146 }
147};
148
149
150// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
151// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
152// and https://github.com/AIDASoft/podio/issues/770
153#if defined(__clang__)
154 #pragma clang diagnostic push
155 #pragma clang diagnostic ignored "-Wunknown-warning-option"
156 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
157 #pragma clang diagnostic ignored "-Wdeprecated"
158constexpr std::string_view edm4eic::RawTrackerHit::typeName;
159 #pragma clang diagnostic pop
160#elif defined(__GNUC__)
161 #pragma GCC diagnostic push
162 #pragma GCC diagnostic ignored "-Wdeprecated"
163constexpr std::string_view edm4eic::RawTrackerHit::typeName;
164 #pragma GCC diagnostic pop
165#endif
166
167
168#endif
Definition MutableRawTrackerHit.h:33
Definition RawTrackerHitCollectionData.h:31
Definition RawTrackerHitCollection.h:139
Definition RawTrackerHit.h:41
const podio::ObjectID getObjectID() const
Definition RawTrackerHit.cc:63
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition RawTrackerHit.cc:50
MutableRawTrackerHit mutable_type
Definition RawTrackerHit.h:50
~RawTrackerHit()=default
destructor
static constexpr std::string_view typeName
Definition RawTrackerHit.h:83
friend class RawTrackerHitCollectionIterator
Definition RawTrackerHit.h:46
void unlink()
disconnect from RawTrackerHitObj instance
Definition RawTrackerHit.h:101
std::int32_t getTimeStamp() const
Access the TDC value.
Definition RawTrackerHit.cc:52
RawTrackerHit & operator=(RawTrackerHit other) &&=delete
RawTrackerHit(const RawTrackerHit &other) noexcept=default
copy constructor
RawTrackerHitCollection collection_type
Definition RawTrackerHit.h:51
friend class MutableRawTrackerHit
Definition RawTrackerHit.h:43
bool isAvailable() const
check whether the object is actually available
Definition RawTrackerHit.cc:59
MutableRawTrackerHit clone(bool cloneRelations=true) const
Definition RawTrackerHit.cc:31
constexpr bool operator==(const RawTrackerHit &other) const
Definition RawTrackerHit.h:103
constexpr bool operator!=(const RawTrackerHit &other) const
Definition RawTrackerHit.h:106
bool operator!=(const MutableRawTrackerHit &other) const
Definition RawTrackerHit.h:107
std::int32_t getCharge() const
Access the ADC value.
Definition RawTrackerHit.cc:51
RawTrackerHit(RawTrackerHit &&other) noexcept=default
move constructor
RawTrackerHit()=default
default constructor
friend class RawTrackerHitCollection
Definition RawTrackerHit.h:44
bool operator<(const RawTrackerHit &other) const
Definition RawTrackerHit.h:110
RawTrackerHit & operator=(RawTrackerHit other) &
copy-assignment operator
Definition RawTrackerHit.cc:26
podio::ObjectID id() const
Definition RawTrackerHit.h:112
static RawTrackerHit makeEmpty()
Definition RawTrackerHit.cc:46
friend void swap(RawTrackerHit &a, RawTrackerHit &b)
Definition RawTrackerHit.h:118
Definition RawTrackerHitObj.h:17
Definition ArrowMapper.cc:63
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:99
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::RawTrackerHit &obj) const
Definition RawTrackerHit.h:144