EICd
EIC data model
MutableRawCalorimeterHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_MutableRawCalorimeterHit_H
4#define EICD_MutableRawCalorimeterHit_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 MutableRawCalorimeterHit
24 * Raw (digitized) calorimeter hit
25 * @author: W. Armstrong, S. Joosten
26 */
28
31 friend class RawCalorimeterHit;
32
33public:
34
35 /// default constructor
37 MutableRawCalorimeterHit(std::uint64_t cellID, std::uint64_t amplitude, std::uint64_t timeStamp);
38
39 /// constructor from existing RawCalorimeterHitObj
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 RawCalorimeterHit() const;
56
57public:
58
59 /// Access the The detector specific (geometrical) cell id.
60 const std::uint64_t& getCellID() const;
61
62 /// Access the The magnitude of the hit in ADC counts.
63 const std::uint64_t& getAmplitude() const;
64
65 /// Access the Timing in TDC
66 const std::uint64_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 The magnitude of the hit in ADC counts.
74 void setAmplitude(std::uint64_t value);
75
76 /// Set the Timing in TDC
77 void setTimeStamp(std::uint64_t value);
78
79
80
81
82
83
84 /// check whether the object is actually available
85 bool isAvailable() const;
86 /// disconnect from RawCalorimeterHitObj instance
87 void unlink() { m_obj = nullptr; }
88
89 bool operator==(const MutableRawCalorimeterHit& other) const { return m_obj == other.m_obj; }
90 bool operator==(const RawCalorimeterHit& other) const;
91
92 // less comparison operator, so that objects can be e.g. stored in sets.
93 bool operator<(const MutableRawCalorimeterHit& 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:
106};
107
108#ifdef PODIO_JSON_OUTPUT
109void to_json(nlohmann::json& j, const MutableRawCalorimeterHit& value);
110#endif
111
112
113} // namespace eicd
114
115
116#endif
Definition: MutableRawCalorimeterHit.h:27
~MutableRawCalorimeterHit()
destructor
Definition: MutableRawCalorimeterHit.cc:46
void setTimeStamp(std::uint64_t value)
Set the Timing in TDC.
Definition: MutableRawCalorimeterHit.cc:60
MutableRawCalorimeterHit & operator=(MutableRawCalorimeterHit other)
copy-assignment operator
Definition: MutableRawCalorimeterHit.cc:31
MutableRawCalorimeterHit()
default constructor
Definition: MutableRawCalorimeterHit.cc:16
MutableRawCalorimeterHit clone() const
create a mutable deep-copy of the object with identical relations
Definition: MutableRawCalorimeterHit.cc:42
void setAmplitude(std::uint64_t value)
Set the The magnitude of the hit in ADC counts.
Definition: MutableRawCalorimeterHit.cc:59
friend class RawCalorimeterHit
Definition: MutableRawCalorimeterHit.h:31
bool isAvailable() const
check whether the object is actually available
Definition: MutableRawCalorimeterHit.cc:68
bool operator<(const MutableRawCalorimeterHit &other) const
Definition: MutableRawCalorimeterHit.h:93
friend void swap(MutableRawCalorimeterHit &a, MutableRawCalorimeterHit &b)
Definition: MutableRawCalorimeterHit.h:99
void setCellID(std::uint64_t value)
Set the The detector specific (geometrical) cell id.
Definition: MutableRawCalorimeterHit.cc:58
void unlink()
disconnect from RawCalorimeterHitObj instance
Definition: MutableRawCalorimeterHit.h:87
const std::uint64_t & getAmplitude() const
Access the The magnitude of the hit in ADC counts.
Definition: MutableRawCalorimeterHit.cc:54
const std::uint64_t & getCellID() const
Access the The detector specific (geometrical) cell id.
Definition: MutableRawCalorimeterHit.cc:53
bool operator==(const MutableRawCalorimeterHit &other) const
Definition: MutableRawCalorimeterHit.h:89
const std::uint64_t & getTimeStamp() const
Access the Timing in TDC.
Definition: MutableRawCalorimeterHit.cc:55
unsigned int id() const
Definition: MutableRawCalorimeterHit.h:95
const podio::ObjectID getObjectID() const
Definition: MutableRawCalorimeterHit.cc:75
Definition: RawCalorimeterHitCollection.h:82
Definition: RawCalorimeterHit.h:26
Definition: RawCalorimeterHitCollection.h:57
Definition: RawCalorimeterHitObj.h:17
Definition: CalorimeterHit.cc:13