CalorimeterHit.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 CalorimeterHit::CalorimeterHit(long long cellID, long flag, long g4ID, dd4pod::FourVector position, dd4pod::MonteCarloContrib truth, double energyDeposit) : m_obj(new CalorimeterHitObj()) {
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.truth = truth;
28 }
29 
30 CalorimeterHit::CalorimeterHit(const CalorimeterHit& other) : m_obj(other.m_obj) {
31  m_obj->acquire();
32 }
33 
35  if (m_obj) m_obj->release();
36  m_obj = other.m_obj;
37  return *this;
38 }
39 
41  if (m_obj) m_obj->acquire();
42 }
43 
45  return {new CalorimeterHitObj(*m_obj)};
46 }
47 
49  if (m_obj) m_obj->release();
50 }
51 CalorimeterHit::operator ConstCalorimeterHit() const { return ConstCalorimeterHit(m_obj); }
52 
53 const long long& CalorimeterHit::cellID() const { return m_obj->data.cellID; }
54 const long& CalorimeterHit::flag() const { return m_obj->data.flag; }
55 const long& CalorimeterHit::g4ID() const { return m_obj->data.g4ID; }
56 const dd4pod::FourVector& CalorimeterHit::position() const { return m_obj->data.position; }
57 const dd4pod::MonteCarloContrib& CalorimeterHit::truth() const { return m_obj->data.truth; }
58 const double& CalorimeterHit::energyDeposit() const { return m_obj->data.energyDeposit; }
59 
60 
61 void CalorimeterHit::cellID(long long value) { m_obj->data.cellID = value; }
62 void CalorimeterHit::flag(long value) { m_obj->data.flag = value; }
63 void CalorimeterHit::g4ID(long value) { m_obj->data.g4ID = value; }
69 
70 
71 
72 
73 
74 
75 
77  if (m_obj) {
78  return true;
79  }
80  return false;
81 }
82 
83 const podio::ObjectID CalorimeterHit::getObjectID() const {
84  if (m_obj) {
85  return m_obj->id;
86  }
87  return podio::ObjectID{podio::ObjectID::invalid, podio::ObjectID::invalid};
88 }
89 
91  return m_obj == other.m_obj;
92 }
93 
94 std::ostream& operator<<(std::ostream& o, const ConstCalorimeterHit& value) {
95  o << " id: " << value.id() << '\n';
96  o << " cellID : " << value.cellID() << '\n';
97  o << " flag : " << value.flag() << '\n';
98  o << " g4ID : " << value.g4ID() << '\n';
99  o << " position : " << value.position() << '\n';
100  o << " truth : " << value.truth() << '\n';
101  o << " energyDeposit : " << value.energyDeposit() << '\n';
102 
103 
104 
105  return o;
106 }
107 
108 } // namespace dd4pod
109 
bool isAvailable() const
check whether the object is actually available
const long long & cellID() const
Access the cellID.
parameter value(const doc_string &label, Targets &&... tgts)
makes required, blocking, repeatable value parameter; matches any non-empty string
Definition: clipp.h:2094
long flag
User flag to classify hits.
const dd4pod::FourVector & position() const
Access the position.
::dd4pod::FourVector position
position
const dd4pod::MonteCarloContrib & truth() const
Access the truth.
CalorimeterHit clone() const
support cloning (deep-copy)
double energyDeposit
energyDeposit
const double & energyDeposit() const
Access the energyDeposit.
const podio::ObjectID getObjectID() const
long g4ID
Original Geant4 track identifier of the creating track (debugging)
::dd4pod::MonteCarloContrib truth
truth
CalorimeterHit()
default constructor
std::ostream & operator<<(std::ostream &o, const ConstCalorimeterHit &value)
bool operator==(const CalorimeterHit &other) const
const long & g4ID() const
Access the Original Geant4 track identifier of the creating track (debugging)
const long & flag() const
Access the User flag to classify hits.
CalorimeterHit & operator=(const CalorimeterHit &other)
copy-assignment operator