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 {
22class RawTrackerHitCollection;
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
33class MutableRawTrackerHit;
34class RawTrackerHitCollection;
35class RawTrackerHitCollectionData;
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
55
56 /// Constructor initializing all members
57 RawTrackerHit(std::uint64_t cellID, std::int32_t charge, std::int32_t timeStamp);
58
59 /// copy constructor
60 RawTrackerHit(const RawTrackerHit& other) = default;
61
62 /// copy-assignment operator
64
65 /// create a mutable deep-copy of the object with identical relations
66 /// if cloneRelations=false, the relations are not cloned and will be empty
67 MutableRawTrackerHit clone(bool cloneRelations=true) const;
68
69 /// destructor
70 ~RawTrackerHit() = default;
71
72 /// converting constructor from mutable object
74
75 static RawTrackerHit makeEmpty();
76
77public:
78
79 static constexpr auto typeName = "edm4eic::RawTrackerHit";
80
81 /// Access the The detector specific (geometrical) cell id.
82 std::uint64_t getCellID() const;
83
84 /// Access the ADC value
85 std::int32_t getCharge() const;
86
87 /// Access the TDC value.
88 std::int32_t getTimeStamp() const;
89
90
91
92
93
94 /// check whether the object is actually available
95 bool isAvailable() const;
96 /// disconnect from RawTrackerHitObj instance
97 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RawTrackerHitObj>{nullptr}; }
98
99 bool operator==(const RawTrackerHit& other) const { return m_obj == other.m_obj; }
100 bool operator==(const MutableRawTrackerHit& other) const;
101
102 bool operator!=(const RawTrackerHit& other) const { return !(*this == other); }
103 bool operator!=(const MutableRawTrackerHit& other) const { return !(*this == other); }
104
105 // less comparison operator, so that objects can be e.g. stored in sets.
106 bool operator<(const RawTrackerHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
107
108 podio::ObjectID id() const { return getObjectID(); }
109
110 const podio::ObjectID getObjectID() const;
111
112 friend void swap(RawTrackerHit& a, RawTrackerHit& b) {
113 using std::swap;
114 swap(a.m_obj, b.m_obj); // swap out the internal pointers
115 }
116
117private:
118 /// constructor from existing RawTrackerHitObj
119 explicit RawTrackerHit(podio::utils::MaybeSharedPtr<RawTrackerHitObj> obj);
121
122 podio::utils::MaybeSharedPtr<RawTrackerHitObj> m_obj{nullptr};
123};
124
125std::ostream& operator<<(std::ostream& o, const RawTrackerHit& value);
126
127#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
128void to_json(nlohmann::json& j, const RawTrackerHit& value);
129#endif
130
131
132} // namespace edm4eic
133
134
135#endif
Definition MutableRawTrackerHit.h:33
Definition RawTrackerHitCollectionData.h:30
Definition RawTrackerHitCollection.h:91
Definition RawTrackerHitCollection.h:36
Definition RawTrackerHit.h:41
const podio::ObjectID getObjectID() const
Definition RawTrackerHit.cc:67
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition RawTrackerHit.cc:54
~RawTrackerHit()=default
destructor
void unlink()
disconnect from RawTrackerHitObj instance
Definition RawTrackerHit.h:97
std::int32_t getTimeStamp() const
Access the TDC value.
Definition RawTrackerHit.cc:56
RawTrackerHit()
default constructor
Definition RawTrackerHit.cc:20
bool operator==(const RawTrackerHit &other) const
Definition RawTrackerHit.h:99
bool operator!=(const RawTrackerHit &other) const
Definition RawTrackerHit.h:102
RawTrackerHit & operator=(RawTrackerHit other)
copy-assignment operator
Definition RawTrackerHit.cc:30
friend class MutableRawTrackerHit
Definition RawTrackerHit.h:43
bool isAvailable() const
check whether the object is actually available
Definition RawTrackerHit.cc:63
MutableRawTrackerHit clone(bool cloneRelations=true) const
Definition RawTrackerHit.cc:35
bool operator!=(const MutableRawTrackerHit &other) const
Definition RawTrackerHit.h:103
std::int32_t getCharge() const
Access the ADC value.
Definition RawTrackerHit.cc:55
friend class RawTrackerHitCollection
Definition RawTrackerHit.h:44
bool operator<(const RawTrackerHit &other) const
Definition RawTrackerHit.h:106
podio::ObjectID id() const
Definition RawTrackerHit.h:108
static RawTrackerHit makeEmpty()
Definition RawTrackerHit.cc:50
RawTrackerHit(const RawTrackerHit &other)=default
copy constructor
friend void swap(RawTrackerHit &a, RawTrackerHit &b)
Definition RawTrackerHit.h:112
static constexpr auto typeName
Definition RawTrackerHit.h:79
Definition RawTrackerHitObj.h:17
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