EICd
EIC data model
MutableRawTrackerHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_MutableRawTrackerHit_H
4#define EICD_MutableRawTrackerHit_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
10#include <cstdint>
11#include "podio/ObjectID.h"
12#include <ostream>
13
14#ifdef PODIO_JSON_OUTPUT
15#include "nlohmann/json.hpp"
16#endif
17
18
19
20namespace eicd {
21
22
23/** @class MutableRawTrackerHit
24 * Raw (digitized) tracker hit
25 * @author: W. Armstrong, S. Joosten
26 */
28
31 friend class RawTrackerHit;
32
33public:
34
35 /// default constructor
37 MutableRawTrackerHit(std::uint64_t cellID, std::int32_t charge, std::int32_t timeStamp);
38
39 /// constructor from existing RawTrackerHitObj
41
42 /// copy constructor
44
45 /// copy-assignment operator
47
48 /// create a mutable deep-copy of the object with identical relations
50
51 /// destructor
53
54 /// conversion to const object
55 operator RawTrackerHit() const;
56
57public:
58
59 /// Access the The detector specific (geometrical) cell id.
60 const std::uint64_t& getCellID() const;
61
62 /// Access the ADC value
63 const std::int32_t& getCharge() const;
64
65 /// Access the TDC value.
66 const std::int32_t& getTimeStamp() const;
67
68
69
70 /// Set the The detector specific (geometrical) cell id.
71 void setCellID(std::uint64_t value);
72
73 /// Set the ADC value
74 void setCharge(std::int32_t value);
75
76 /// Set the TDC value.
77 void setTimeStamp(std::int32_t value);
78
79
80
81
82
83
84 /// check whether the object is actually available
85 bool isAvailable() const;
86 /// disconnect from RawTrackerHitObj instance
87 void unlink() { m_obj = nullptr; }
88
89 bool operator==(const MutableRawTrackerHit& other) const { return m_obj == other.m_obj; }
90 bool operator==(const RawTrackerHit& other) const;
91
92 // less comparison operator, so that objects can be e.g. stored in sets.
93 bool operator<(const MutableRawTrackerHit& other) const { return m_obj < other.m_obj; }
94
95 unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
96
97 const podio::ObjectID getObjectID() const;
98
100 using std::swap;
101 swap(a.m_obj, b.m_obj); // swap out the internal pointers
102 }
103
104private:
105 RawTrackerHitObj* m_obj;
106};
107
108#ifdef PODIO_JSON_OUTPUT
109void to_json(nlohmann::json& j, const MutableRawTrackerHit& value);
110#endif
111
112
113} // namespace eicd
114
115
116#endif
Definition: MutableRawTrackerHit.h:27
unsigned int id() const
Definition: MutableRawTrackerHit.h:95
~MutableRawTrackerHit()
destructor
Definition: MutableRawTrackerHit.cc:46
MutableRawTrackerHit & operator=(MutableRawTrackerHit other)
copy-assignment operator
Definition: MutableRawTrackerHit.cc:31
const std::uint64_t & getCellID() const
Access the The detector specific (geometrical) cell id.
Definition: MutableRawTrackerHit.cc:53
void unlink()
disconnect from RawTrackerHitObj instance
Definition: MutableRawTrackerHit.h:87
const std::int32_t & getCharge() const
Access the ADC value.
Definition: MutableRawTrackerHit.cc:54
bool operator<(const MutableRawTrackerHit &other) const
Definition: MutableRawTrackerHit.h:93
MutableRawTrackerHit()
default constructor
Definition: MutableRawTrackerHit.cc:16
friend void swap(MutableRawTrackerHit &a, MutableRawTrackerHit &b)
Definition: MutableRawTrackerHit.h:99
bool operator==(const MutableRawTrackerHit &other) const
Definition: MutableRawTrackerHit.h:89
const podio::ObjectID getObjectID() const
Definition: MutableRawTrackerHit.cc:75
MutableRawTrackerHit clone() const
create a mutable deep-copy of the object with identical relations
Definition: MutableRawTrackerHit.cc:42
void setTimeStamp(std::int32_t value)
Set the TDC value.
Definition: MutableRawTrackerHit.cc:60
void setCellID(std::uint64_t value)
Set the The detector specific (geometrical) cell id.
Definition: MutableRawTrackerHit.cc:58
void setCharge(std::int32_t value)
Set the ADC value.
Definition: MutableRawTrackerHit.cc:59
const std::int32_t & getTimeStamp() const
Access the TDC value.
Definition: MutableRawTrackerHit.cc:55
friend class RawTrackerHit
Definition: MutableRawTrackerHit.h:31
bool isAvailable() const
check whether the object is actually available
Definition: MutableRawTrackerHit.cc:68
Definition: RawTrackerHitCollection.h:82
Definition: RawTrackerHit.h:26
Definition: RawTrackerHitCollection.h:57
Definition: RawTrackerHitObj.h:17
Definition: CalorimeterHit.cc:13