EICd
EIC data model
RawCalorimeterHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_RawCalorimeterHit_H
4#define EICD_RawCalorimeterHit_H
5
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 MutableRawCalorimeterHit;
21
22/** @class RawCalorimeterHit
23 * Raw (digitized) calorimeter hit
24 * @author: W. Armstrong, S. Joosten
25 */
27
31
32public:
33 /// default constructor
35 RawCalorimeterHit(std::uint64_t cellID, std::uint64_t amplitude, std::uint64_t timeStamp);
36
37 /// constructor from existing RawCalorimeterHitObj
39
40 /// copy constructor
42
43 /// copy-assignment operator
45
46 /// create a mutable deep-copy of the object with identical relations
48
49 /// destructor
51
52
53public:
54
55 /// Access the The detector specific (geometrical) cell id.
56 const std::uint64_t& getCellID() const;
57
58 /// Access the The magnitude of the hit in ADC counts.
59 const std::uint64_t& getAmplitude() const;
60
61 /// Access the Timing in TDC
62 const std::uint64_t& getTimeStamp() const;
63
64
65
66
67
68 /// check whether the object is actually available
69 bool isAvailable() const;
70 /// disconnect from RawCalorimeterHitObj instance
71 void unlink() { m_obj = nullptr; }
72
73 bool operator==(const RawCalorimeterHit& other) const { return m_obj == other.m_obj; }
74 bool operator==(const MutableRawCalorimeterHit& other) const;
75
76 // less comparison operator, so that objects can be e.g. stored in sets.
77 bool operator<(const RawCalorimeterHit& 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
84 using std::swap;
85 swap(a.m_obj, b.m_obj); // swap out the internal pointers
86 }
87
88private:
90};
91
92std::ostream& operator<<(std::ostream& o, const RawCalorimeterHit& value);
93
94#ifdef PODIO_JSON_OUTPUT
95void to_json(nlohmann::json& j, const RawCalorimeterHit& value);
96#endif
97
98
99} // namespace eicd
100
101
102#endif
Definition: MutableRawCalorimeterHit.h:27
Definition: RawCalorimeterHitCollection.h:82
Definition: RawCalorimeterHitCollection.h:35
Definition: RawCalorimeterHit.h:26
const std::uint64_t & getAmplitude() const
Access the The magnitude of the hit in ADC counts.
Definition: RawCalorimeterHit.cc:53
unsigned int id() const
Definition: RawCalorimeterHit.h:79
bool isAvailable() const
check whether the object is actually available
Definition: RawCalorimeterHit.cc:61
bool operator==(const RawCalorimeterHit &other) const
Definition: RawCalorimeterHit.h:73
RawCalorimeterHit & operator=(RawCalorimeterHit other)
copy-assignment operator
Definition: RawCalorimeterHit.cc:31
void unlink()
disconnect from RawCalorimeterHitObj instance
Definition: RawCalorimeterHit.h:71
MutableRawCalorimeterHit clone() const
create a mutable deep-copy of the object with identical relations
Definition: RawCalorimeterHit.cc:42
bool operator<(const RawCalorimeterHit &other) const
Definition: RawCalorimeterHit.h:77
~RawCalorimeterHit()
destructor
Definition: RawCalorimeterHit.cc:46
const std::uint64_t & getCellID() const
Access the The detector specific (geometrical) cell id.
Definition: RawCalorimeterHit.cc:52
friend void swap(RawCalorimeterHit &a, RawCalorimeterHit &b)
Definition: RawCalorimeterHit.h:83
const podio::ObjectID getObjectID() const
Definition: RawCalorimeterHit.cc:68
RawCalorimeterHit()
default constructor
Definition: RawCalorimeterHit.cc:16
const std::uint64_t & getTimeStamp() const
Access the Timing in TDC.
Definition: RawCalorimeterHit.cc:54
Definition: RawCalorimeterHitObj.h:17
Definition: CalorimeterHit.cc:13
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition: CalorimeterHit.cc:93