EICd
EIC data model
MutableRawPMTHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_MutableRawPMTHit_H
4#define EICD_MutableRawPMTHit_H
5
6#include "eicd/RawPMTHitObj.h"
7// Make the immutable class available from its mutable version but not vice versa
8#include "eicd/RawPMTHit.h"
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 MutableRawPMTHit
24 * EIC Raw PMT hit
25 * @author: S. Joosten, C. Peng
26 */
28
29 friend class RawPMTHitCollection;
31 friend class RawPMTHit;
32
33public:
34
35 /// default constructor
37 MutableRawPMTHit(std::uint64_t cellID, std::uint32_t integral, std::uint32_t timeStamp);
38
39 /// constructor from existing RawPMTHitObj
41
42 /// copy constructor
44
45 /// copy-assignment operator
47
48 /// create a mutable deep-copy of the object with identical relations
49 MutableRawPMTHit clone() const;
50
51 /// destructor
53
54 /// conversion to const object
55 operator RawPMTHit() const;
56
57public:
58
59 /// Access the The detector specific (geometrical) cell id.
60 const std::uint64_t& getCellID() const;
61
62 /// Access the PMT signal integral [ADC]
63 const std::uint32_t& getIntegral() const;
64
65 /// Access the PMT signal time [TDC]
66 const std::uint32_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 PMT signal integral [ADC]
74 void setIntegral(std::uint32_t value);
75
76 /// Set the PMT signal time [TDC]
77 void setTimeStamp(std::uint32_t value);
78
79
80
81
82
83
84 /// check whether the object is actually available
85 bool isAvailable() const;
86 /// disconnect from RawPMTHitObj instance
87 void unlink() { m_obj = nullptr; }
88
89 bool operator==(const MutableRawPMTHit& other) const { return m_obj == other.m_obj; }
90 bool operator==(const RawPMTHit& other) const;
91
92 // less comparison operator, so that objects can be e.g. stored in sets.
93 bool operator<(const MutableRawPMTHit& 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 RawPMTHitObj* m_obj;
106};
107
108#ifdef PODIO_JSON_OUTPUT
109void to_json(nlohmann::json& j, const MutableRawPMTHit& value);
110#endif
111
112
113} // namespace eicd
114
115
116#endif
Definition: MutableRawPMTHit.h:27
~MutableRawPMTHit()
destructor
Definition: MutableRawPMTHit.cc:46
void setIntegral(std::uint32_t value)
Set the PMT signal integral [ADC].
Definition: MutableRawPMTHit.cc:59
MutableRawPMTHit()
default constructor
Definition: MutableRawPMTHit.cc:16
void unlink()
disconnect from RawPMTHitObj instance
Definition: MutableRawPMTHit.h:87
unsigned int id() const
Definition: MutableRawPMTHit.h:95
bool operator<(const MutableRawPMTHit &other) const
Definition: MutableRawPMTHit.h:93
MutableRawPMTHit & operator=(MutableRawPMTHit other)
copy-assignment operator
Definition: MutableRawPMTHit.cc:31
friend void swap(MutableRawPMTHit &a, MutableRawPMTHit &b)
Definition: MutableRawPMTHit.h:99
bool isAvailable() const
check whether the object is actually available
Definition: MutableRawPMTHit.cc:68
void setCellID(std::uint64_t value)
Set the The detector specific (geometrical) cell id.
Definition: MutableRawPMTHit.cc:58
const std::uint64_t & getCellID() const
Access the The detector specific (geometrical) cell id.
Definition: MutableRawPMTHit.cc:53
const podio::ObjectID getObjectID() const
Definition: MutableRawPMTHit.cc:75
const std::uint32_t & getTimeStamp() const
Access the PMT signal time [TDC].
Definition: MutableRawPMTHit.cc:55
void setTimeStamp(std::uint32_t value)
Set the PMT signal time [TDC].
Definition: MutableRawPMTHit.cc:60
const std::uint32_t & getIntegral() const
Access the PMT signal integral [ADC].
Definition: MutableRawPMTHit.cc:54
bool operator==(const MutableRawPMTHit &other) const
Definition: MutableRawPMTHit.h:89
MutableRawPMTHit clone() const
create a mutable deep-copy of the object with identical relations
Definition: MutableRawPMTHit.cc:42
friend class RawPMTHit
Definition: MutableRawPMTHit.h:31
Definition: RawPMTHitCollection.h:82
Definition: RawPMTHit.h:26
Definition: RawPMTHitCollection.h:57
Definition: RawPMTHitObj.h:17
Definition: CalorimeterHit.cc:13