EICd
EIC data model
RawPMTHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_RawPMTHit_H
4#define EICD_RawPMTHit_H
5
6#include "eicd/RawPMTHitObj.h"
7
8#include <cstdint>
9#include "podio/ObjectID.h"
10#include <ostream>
11
12#ifdef PODIO_JSON_OUTPUT
13#include "nlohmann/json.hpp"
14#endif
15
16
17
18namespace eicd {
19
20class MutableRawPMTHit;
21
22/** @class RawPMTHit
23 * EIC Raw PMT hit
24 * @author: S. Joosten, C. Peng
25 */
26class RawPMTHit {
27
28 friend class MutableRawPMTHit;
29 friend class RawPMTHitCollection;
31
32public:
33 /// default constructor
34 RawPMTHit();
35 RawPMTHit(std::uint64_t cellID, std::uint32_t integral, std::uint32_t timeStamp);
36
37 /// constructor from existing RawPMTHitObj
39
40 /// copy constructor
41 RawPMTHit(const RawPMTHit& other);
42
43 /// copy-assignment operator
45
46 /// create a mutable deep-copy of the object with identical relations
47 MutableRawPMTHit clone() const;
48
49 /// destructor
50 ~RawPMTHit();
51
52
53public:
54
55 /// Access the The detector specific (geometrical) cell id.
56 const std::uint64_t& getCellID() const;
57
58 /// Access the PMT signal integral [ADC]
59 const std::uint32_t& getIntegral() const;
60
61 /// Access the PMT signal time [TDC]
62 const std::uint32_t& getTimeStamp() const;
63
64
65
66
67
68 /// check whether the object is actually available
69 bool isAvailable() const;
70 /// disconnect from RawPMTHitObj instance
71 void unlink() { m_obj = nullptr; }
72
73 bool operator==(const RawPMTHit& other) const { return m_obj == other.m_obj; }
74 bool operator==(const MutableRawPMTHit& other) const;
75
76 // less comparison operator, so that objects can be e.g. stored in sets.
77 bool operator<(const RawPMTHit& other) const { return m_obj < other.m_obj; }
78
79 unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
80
81 const podio::ObjectID getObjectID() const;
82
83 friend void swap(RawPMTHit& a, RawPMTHit& b) {
84 using std::swap;
85 swap(a.m_obj, b.m_obj); // swap out the internal pointers
86 }
87
88private:
89 RawPMTHitObj* m_obj;
90};
91
92std::ostream& operator<<(std::ostream& o, const RawPMTHit& value);
93
94#ifdef PODIO_JSON_OUTPUT
95void to_json(nlohmann::json& j, const RawPMTHit& value);
96#endif
97
98
99} // namespace eicd
100
101
102#endif
Definition: MutableRawPMTHit.h:27
Definition: RawPMTHitCollection.h:82
Definition: RawPMTHitCollection.h:35
Definition: RawPMTHit.h:26
friend void swap(RawPMTHit &a, RawPMTHit &b)
Definition: RawPMTHit.h:83
unsigned int id() const
Definition: RawPMTHit.h:79
RawPMTHit()
default constructor
Definition: RawPMTHit.cc:16
RawPMTHit & operator=(RawPMTHit other)
copy-assignment operator
Definition: RawPMTHit.cc:31
const std::uint32_t & getTimeStamp() const
Access the PMT signal time [TDC].
Definition: RawPMTHit.cc:54
bool operator<(const RawPMTHit &other) const
Definition: RawPMTHit.h:77
~RawPMTHit()
destructor
Definition: RawPMTHit.cc:46
bool isAvailable() const
check whether the object is actually available
Definition: RawPMTHit.cc:61
void unlink()
disconnect from RawPMTHitObj instance
Definition: RawPMTHit.h:71
MutableRawPMTHit clone() const
create a mutable deep-copy of the object with identical relations
Definition: RawPMTHit.cc:42
const std::uint32_t & getIntegral() const
Access the PMT signal integral [ADC].
Definition: RawPMTHit.cc:53
const std::uint64_t & getCellID() const
Access the The detector specific (geometrical) cell id.
Definition: RawPMTHit.cc:52
const podio::ObjectID getObjectID() const
Definition: RawPMTHit.cc:68
bool operator==(const RawPMTHit &other) const
Definition: RawPMTHit.h:73
Definition: RawPMTHitObj.h:17
Definition: CalorimeterHit.cc:13
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition: CalorimeterHit.cc:93