PhotoMultiplierHit.cc
Go to the documentation of this file.
1 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2 
3 // datamodel specific includes
9 
10 
11 #include <ostream>
12 
13 namespace dd4pod {
14 
15 
17  m_obj->acquire();
18 }
19 
20 PhotoMultiplierHit::PhotoMultiplierHit(long long cellID, long flag, long g4ID, dd4pod::FourVector position, dd4pod::FourVector momentum, double length, dd4pod::MonteCarloContrib truth, double energy) : m_obj(new PhotoMultiplierHitObj()) {
21  m_obj->acquire();
22  m_obj->data.cellID = cellID;
23  m_obj->data.flag = flag;
24  m_obj->data.g4ID = g4ID;
25  m_obj->data.position = position;
26  m_obj->data.momentum = momentum;
27  m_obj->data.length = length;
28  m_obj->data.truth = truth;
29  m_obj->data.energy = energy;
30 }
31 
32 PhotoMultiplierHit::PhotoMultiplierHit(const PhotoMultiplierHit& other) : m_obj(other.m_obj) {
33  m_obj->acquire();
34 }
35 
37  if (m_obj) m_obj->release();
38  m_obj = other.m_obj;
39  return *this;
40 }
41 
43  if (m_obj) m_obj->acquire();
44 }
45 
47  return {new PhotoMultiplierHitObj(*m_obj)};
48 }
49 
51  if (m_obj) m_obj->release();
52 }
53 PhotoMultiplierHit::operator ConstPhotoMultiplierHit() const { return ConstPhotoMultiplierHit(m_obj); }
54 
55 const long long& PhotoMultiplierHit::cellID() const { return m_obj->data.cellID; }
56 const long& PhotoMultiplierHit::flag() const { return m_obj->data.flag; }
57 const long& PhotoMultiplierHit::g4ID() const { return m_obj->data.g4ID; }
60 const double& PhotoMultiplierHit::length() const { return m_obj->data.length; }
62 const double& PhotoMultiplierHit::energy() const { return m_obj->data.energy; }
63 
64 
65 void PhotoMultiplierHit::cellID(long long value) { m_obj->data.cellID = value; }
66 void PhotoMultiplierHit::flag(long value) { m_obj->data.flag = value; }
67 void PhotoMultiplierHit::g4ID(long value) { m_obj->data.g4ID = value; }
72 void PhotoMultiplierHit::length(double value) { m_obj->data.length = value; }
75 void PhotoMultiplierHit::energy(double value) { m_obj->data.energy = value; }
76 
77 
78 
79 
80 
81 
82 
84  if (m_obj) {
85  return true;
86  }
87  return false;
88 }
89 
90 const podio::ObjectID PhotoMultiplierHit::getObjectID() const {
91  if (m_obj) {
92  return m_obj->id;
93  }
94  return podio::ObjectID{podio::ObjectID::invalid, podio::ObjectID::invalid};
95 }
96 
98  return m_obj == other.m_obj;
99 }
100 
101 std::ostream& operator<<(std::ostream& o, const ConstPhotoMultiplierHit& value) {
102  o << " id: " << value.id() << '\n';
103  o << " cellID : " << value.cellID() << '\n';
104  o << " flag : " << value.flag() << '\n';
105  o << " g4ID : " << value.g4ID() << '\n';
106  o << " position : " << value.position() << '\n';
107  o << " momentum : " << value.momentum() << '\n';
108  o << " length : " << value.length() << '\n';
109  o << " truth : " << value.truth() << '\n';
110  o << " energy : " << value.energy() << '\n';
111 
112 
113 
114  return o;
115 }
116 
117 } // namespace dd4pod
118 
bool operator==(const PhotoMultiplierHit &other) const
const long & g4ID() const
Access the Original Geant 4 track identifier of the creating track (debugging)
const podio::ObjectID getObjectID() const
::dd4pod::FourVector momentum
momentum
parameter value(const doc_string &label, Targets &&... tgts)
makes required, blocking, repeatable value parameter; matches any non-empty string
Definition: clipp.h:2094
long g4ID
Original Geant 4 track identifier of the creating track (debugging)
const dd4pod::FourVector & position() const
Access the position.
::dd4pod::FourVector position
position
PhotoMultiplierHit & operator=(const PhotoMultiplierHit &other)
copy-assignment operator
PhotoMultiplierHit()
default constructor
const long long & cellID() const
Access the cellID.
const dd4pod::MonteCarloContrib & truth() const
Access the truth.
::dd4pod::MonteCarloContrib truth
truth
bool isAvailable() const
check whether the object is actually available
long flag
User flag to classify hits.
const dd4pod::FourVector & momentum() const
Access the momentum.
const long & flag() const
Access the User flag to classify hits.
PhotoMultiplierHit clone() const
support cloning (deep-copy)
std::ostream & operator<<(std::ostream &o, const ConstCalorimeterHit &value)
const double & length() const
Access the length.
const double & energy() const
Access the photon energy.