EDM4eic
EIC data model
Loading...
Searching...
No Matches
RawHGCROCHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_RawHGCROCHit_H
4#define EDM4EIC_RawHGCROCHit_H
5
7
9#include "podio/RelationRange.h"
10#include <cstdint>
11#include <vector>
12
13#include "podio/utilities/MaybeSharedPtr.h"
14#include "podio/detail/OrderKey.h"
15
16#include <ostream>
17#include <cstdint>
18
19#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
20#include "nlohmann/json_fwd.hpp"
21#endif
22
23// forward declarations
24namespace edm4eic {
26}
27
28
29namespace podio::detail {
30// Internal function used in less comparison operators of the datatypes and interface types
31OrderKey getOrderKey(const edm4eic::RawHGCROCHit& obj);
32};
33
34namespace edm4eic {
35
39
40/** @class RawHGCROCHit
41 * Raw hit from an HGCROC chip
42 * @author: D. Anderson, S. Joosten, T. Protzman, N. Novitzky, D. Kalinkin
43 */
45
46 friend class MutableRawHGCROCHit;
50 friend podio::detail::OrderKey podio::detail::getOrderKey(const RawHGCROCHit & obj);
51
52public:
55
56 /// default constructor
58
59 /// Constructor initializing all members
60 RawHGCROCHit(const std::uint64_t cellID, const std::int32_t samplePhase, const std::int32_t timeStamp);
61
62 /// copy constructor
63 RawHGCROCHit(const RawHGCROCHit& other) = default;
64
65 /// copy-assignment operator
66 RawHGCROCHit& operator=(RawHGCROCHit other) &; // Rebind this to other's internal object
67 RawHGCROCHit& operator=(RawHGCROCHit 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 MutableRawHGCROCHit clone(bool cloneRelations=true) const;
72
73 /// destructor
74 ~RawHGCROCHit() = default;
75
76 /// converting constructor from mutable object
78
79 static RawHGCROCHit makeEmpty();
80
81public:
82
83 static constexpr std::string_view typeName = "edm4eic::RawHGCROCHit";
84
85 /// Access the Detector specific (geometrical) cell id
86 std::uint64_t getCellID() const;
87
88 /// Access the Phase of samples in [# samples], for synchronizing across chips
89 std::int32_t getSamplePhase() const;
90
91 /// Access the [TDC counts]
92 std::int32_t getTimeStamp() const;
93
94
95
96 std::size_t samples_size() const;
97 edm4eic::HGCROCSample getSamples(std::size_t) const;
98 std::vector<edm4eic::HGCROCSample>::const_iterator samples_begin() const;
99 std::vector<edm4eic::HGCROCSample>::const_iterator samples_end() const;
100 podio::RelationRange<edm4eic::HGCROCSample> getSamples() const;
101
102
103 /// check whether the object is actually available
104 bool isAvailable() const;
105 /// disconnect from RawHGCROCHitObj instance
106 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RawHGCROCHitObj>{nullptr}; }
107
108 bool operator==(const RawHGCROCHit& other) const { return m_obj == other.m_obj; }
109 bool operator==(const MutableRawHGCROCHit& other) const;
110
111 bool operator!=(const RawHGCROCHit& other) const { return !(*this == other); }
112 bool operator!=(const MutableRawHGCROCHit& other) const { return !(*this == other); }
113
114 // less comparison operator, so that objects can be e.g. stored in sets.
115 bool operator<(const RawHGCROCHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
116
117 podio::ObjectID id() const { return getObjectID(); }
118
119 const podio::ObjectID getObjectID() const;
120
121 friend std::hash<RawHGCROCHit>;
122
123 friend void swap(RawHGCROCHit& a, RawHGCROCHit& b) {
124 using std::swap;
125 swap(a.m_obj, b.m_obj); // swap out the internal pointers
126 }
127
128private:
129 /// constructor from existing RawHGCROCHitObj
130 explicit RawHGCROCHit(podio::utils::MaybeSharedPtr<RawHGCROCHitObj> obj);
132
133 podio::utils::MaybeSharedPtr<RawHGCROCHitObj> m_obj{nullptr};
134};
135
136std::ostream& operator<<(std::ostream& o, const RawHGCROCHit& value);
137
138#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
139void to_json(nlohmann::json& j, const RawHGCROCHit& value);
140#endif
141
142
143} // namespace edm4eic
144
145
146
147template<>
148struct std::hash<edm4eic::RawHGCROCHit> {
149 std::size_t operator()(const edm4eic::RawHGCROCHit& obj) const {
150 return std::hash<edm4eic::RawHGCROCHitObj*>{}(obj.m_obj.get());
151 }
152};
153
154
155// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
156// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
157// and https://github.com/AIDASoft/podio/issues/770
158#if defined(__clang__)
159#pragma clang diagnostic push
160#pragma clang diagnostic ignored "-Wunknown-warning-option"
161#pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
162#pragma clang diagnostic ignored "-Wdeprecated"
163constexpr std::string_view edm4eic::RawHGCROCHit::typeName;
164#pragma clang diagnostic pop
165#elif defined(__GNUC__)
166#pragma GCC diagnostic push
167#pragma GCC diagnostic ignored "-Wdeprecated"
168constexpr std::string_view edm4eic::RawHGCROCHit::typeName;
169#pragma GCC diagnostic pop
170#endif
171
172#endif
Definition HGCROCSample.h:19
Definition MutableRawHGCROCHit.h:36
Definition RawHGCROCHitCollectionData.h:30
Definition RawHGCROCHitCollection.h:137
Definition RawHGCROCHit.h:44
const podio::ObjectID getObjectID() const
Definition RawHGCROCHit.cc:110
bool isAvailable() const
check whether the object is actually available
Definition RawHGCROCHit.cc:106
friend class RawHGCROCHitCollection
Definition RawHGCROCHit.h:47
bool operator==(const RawHGCROCHit &other) const
Definition RawHGCROCHit.h:108
~RawHGCROCHit()=default
destructor
std::int32_t getSamplePhase() const
Access the Phase of samples in [# samples], for synchronizing across chips.
Definition RawHGCROCHit.cc:66
friend class RawHGCROCHitCollectionIterator
Definition RawHGCROCHit.h:49
MutableRawHGCROCHit mutable_type
Definition RawHGCROCHit.h:53
static constexpr std::string_view typeName
Definition RawHGCROCHit.h:83
MutableRawHGCROCHit clone(bool cloneRelations=true) const
Definition RawHGCROCHit.cc:35
void unlink()
disconnect from RawHGCROCHitObj instance
Definition RawHGCROCHit.h:106
podio::ObjectID id() const
Definition RawHGCROCHit.h:117
bool operator!=(const RawHGCROCHit &other) const
Definition RawHGCROCHit.h:111
std::uint64_t getCellID() const
Access the Detector specific (geometrical) cell id.
Definition RawHGCROCHit.cc:65
static RawHGCROCHit makeEmpty()
Definition RawHGCROCHit.cc:61
friend class MutableRawHGCROCHit
Definition RawHGCROCHit.h:46
bool operator<(const RawHGCROCHit &other) const
Definition RawHGCROCHit.h:115
std::vector< edm4eic::HGCROCSample >::const_iterator samples_begin() const
Definition RawHGCROCHit.cc:71
podio::RelationRange< edm4eic::HGCROCSample > getSamples() const
Definition RawHGCROCHit.cc:94
bool operator!=(const MutableRawHGCROCHit &other) const
Definition RawHGCROCHit.h:112
RawHGCROCHit(const RawHGCROCHit &other)=default
copy constructor
RawHGCROCHit & operator=(RawHGCROCHit other) &&=delete
friend void swap(RawHGCROCHit &a, RawHGCROCHit &b)
Definition RawHGCROCHit.h:123
RawHGCROCHit & operator=(RawHGCROCHit other) &
copy-assignment operator
Definition RawHGCROCHit.cc:30
RawHGCROCHitCollection collection_type
Definition RawHGCROCHit.h:54
RawHGCROCHit()
default constructor
Definition RawHGCROCHit.cc:20
std::size_t samples_size() const
Definition RawHGCROCHit.cc:83
std::int32_t getTimeStamp() const
Access the [TDC counts].
Definition RawHGCROCHit.cc:67
std::vector< edm4eic::HGCROCSample >::const_iterator samples_end() const
Definition RawHGCROCHit.cc:77
Definition RawHGCROCHitObj.h:20
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::RawHGCROCHit &obj) const
Definition RawHGCROCHit.h:149