EICd
EIC data model
PMTHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_PMTHit_H
4#define EICD_PMTHit_H
5
6#include "eicd/PMTHitObj.h"
7
8#include "edm4hep/Vector3f.h"
9#include <cstdint>
10#include "podio/ObjectID.h"
11#include <ostream>
12
13#ifdef PODIO_JSON_OUTPUT
14#include "nlohmann/json.hpp"
15#endif
16
17
18
19namespace eicd {
20
21class MutablePMTHit;
22
23/** @class PMTHit
24 * EIC PMT hit
25 * @author: S. Joosten, C. Peng
26 */
27class PMTHit {
28
29 friend class MutablePMTHit;
30 friend class PMTHitCollection;
32
33public:
34 /// default constructor
35 PMTHit();
36 PMTHit(std::uint64_t cellID, float npe, float time, float timeError, edm4hep::Vector3f position, edm4hep::Vector3f dimension, std::int32_t sector, edm4hep::Vector3f local);
37
38 /// constructor from existing PMTHitObj
39 PMTHit(PMTHitObj* obj);
40
41 /// copy constructor
42 PMTHit(const PMTHit& other);
43
44 /// copy-assignment operator
45 PMTHit& operator=(PMTHit other);
46
47 /// create a mutable deep-copy of the object with identical relations
48 MutablePMTHit clone() const;
49
50 /// destructor
51 ~PMTHit();
52
53
54public:
55
56 /// Access the The detector specific (geometrical) cell id.
57 const std::uint64_t& getCellID() const;
58
59 /// Access the Estimated number of photo-electrons [#]
60 const float& getNpe() const;
61
62 /// Access the Time [ns]
63 const float& getTime() const;
64
65 /// Access the Error on the time [ns]
66 const float& getTimeError() const;
67
68 /// Access the PMT hit position [mm]
69 const edm4hep::Vector3f& getPosition() const;
70
71 /// Access the The dimension information of the pixel [mm].
72 const edm4hep::Vector3f& getDimension() const;
73
74 /// Access the The sector this hit occured in
75 const std::int32_t& getSector() const;
76
77 /// Access the The local position of the hit in detector coordinates (relative to the sector) [mm]
78 const edm4hep::Vector3f& getLocal() const;
79
80
81
82
83
84 /// check whether the object is actually available
85 bool isAvailable() const;
86 /// disconnect from PMTHitObj instance
87 void unlink() { m_obj = nullptr; }
88
89 bool operator==(const PMTHit& other) const { return m_obj == other.m_obj; }
90 bool operator==(const MutablePMTHit& other) const;
91
92 // less comparison operator, so that objects can be e.g. stored in sets.
93 bool operator<(const PMTHit& 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
99 friend void swap(PMTHit& a, PMTHit& b) {
100 using std::swap;
101 swap(a.m_obj, b.m_obj); // swap out the internal pointers
102 }
103
104private:
105 PMTHitObj* m_obj;
106};
107
108std::ostream& operator<<(std::ostream& o, const PMTHit& value);
109
110#ifdef PODIO_JSON_OUTPUT
111void to_json(nlohmann::json& j, const PMTHit& value);
112#endif
113
114
115} // namespace eicd
116
117
118#endif
Definition: MutablePMTHit.h:28
Definition: PMTHitCollection.h:82
Definition: PMTHitCollection.h:35
Definition: PMTHit.h:27
MutablePMTHit clone() const
create a mutable deep-copy of the object with identical relations
Definition: PMTHit.cc:47
const edm4hep::Vector3f & getDimension() const
Access the The dimension information of the pixel [mm].
Definition: PMTHit.cc:62
bool operator==(const PMTHit &other) const
Definition: PMTHit.h:89
void unlink()
disconnect from PMTHitObj instance
Definition: PMTHit.h:87
unsigned int id() const
Definition: PMTHit.h:95
const std::int32_t & getSector() const
Access the The sector this hit occured in.
Definition: PMTHit.cc:63
const float & getTime() const
Access the Time [ns].
Definition: PMTHit.cc:59
friend void swap(PMTHit &a, PMTHit &b)
Definition: PMTHit.h:99
bool operator<(const PMTHit &other) const
Definition: PMTHit.h:93
const edm4hep::Vector3f & getPosition() const
Access the PMT hit position [mm].
Definition: PMTHit.cc:61
const edm4hep::Vector3f & getLocal() const
Access the The local position of the hit in detector coordinates (relative to the sector) [mm].
Definition: PMTHit.cc:64
bool isAvailable() const
check whether the object is actually available
Definition: PMTHit.cc:71
PMTHit & operator=(PMTHit other)
copy-assignment operator
Definition: PMTHit.cc:36
const podio::ObjectID getObjectID() const
Definition: PMTHit.cc:78
const float & getNpe() const
Access the Estimated number of photo-electrons [#].
Definition: PMTHit.cc:58
const float & getTimeError() const
Access the Error on the time [ns].
Definition: PMTHit.cc:60
const std::uint64_t & getCellID() const
Access the The detector specific (geometrical) cell id.
Definition: PMTHit.cc:57
PMTHit()
default constructor
Definition: PMTHit.cc:16
~PMTHit()
destructor
Definition: PMTHit.cc:51
Definition: PMTHitObj.h:17
Definition: CalorimeterHit.cc:13
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition: CalorimeterHit.cc:93