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