TrackerHitConst.cc
Go to the documentation of this file.
1 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2 
3 // datamodel specific includes
4 #include "dd4pod/TrackerHit.h"
6 #include "dd4pod/TrackerHitObj.h"
9 
10 
11 #include <ostream>
12 
13 namespace dd4pod {
14 
15 
17  m_obj->acquire();
18 }
19 
20 ConstTrackerHit::ConstTrackerHit(long long cellID, long flag, long g4ID, dd4pod::FourVector position, dd4pod::FourVector momentum, double length, dd4pod::MonteCarloContrib truth, double energyDeposit) : m_obj(new TrackerHitObj()) {
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;
30 }
31 
32 ConstTrackerHit::ConstTrackerHit(const ConstTrackerHit& 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 TrackerHitObj(*m_obj)};
48 }
49 
51  if (m_obj) m_obj->release();
52 }
53 const long long& ConstTrackerHit::cellID() const { return m_obj->data.cellID; }
54 const long& ConstTrackerHit::flag() const { return m_obj->data.flag; }
55 const long& ConstTrackerHit::g4ID() const { return m_obj->data.g4ID; }
56 const dd4pod::FourVector& ConstTrackerHit::position() const { return m_obj->data.position; }
57 const dd4pod::FourVector& ConstTrackerHit::momentum() const { return m_obj->data.momentum; }
58 const double& ConstTrackerHit::length() const { return m_obj->data.length; }
60 const double& ConstTrackerHit::energyDeposit() const { return m_obj->data.energyDeposit; }
61 
62 
63 
64 
65 
66 
68  if (m_obj) {
69  return true;
70  }
71  return false;
72 }
73 
74 const podio::ObjectID ConstTrackerHit::getObjectID() const {
75  if (m_obj) {
76  return m_obj->id;
77  }
78  return podio::ObjectID{podio::ObjectID::invalid, podio::ObjectID::invalid};
79 }
80 
81 bool ConstTrackerHit::operator==(const TrackerHit& other) const {
82  return m_obj == other.m_obj;
83 }
84 
85 } // namespace dd4pod
86 
ConstTrackerHit clone() const
support cloning (deep-copy)
const long & flag() const
Access the User flag to classify hits.
const long long & cellID() const
Access the cellID.
bool isAvailable() const
check whether the object is actually available
const dd4pod::MonteCarloContrib & truth() const
Access the truth.
const double & energyDeposit() const
Access the energyDeposit.
const dd4pod::FourVector & position() const
Access the position.
long g4ID
Original Geant4 track identifier of the creating track (debugging)
ConstTrackerHit & operator=(const ConstTrackerHit &other)
copy-assignment operator
double energyDeposit
energyDeposit
bool operator==(const ConstTrackerHit &other) const
::dd4pod::FourVector momentum
momentum
::dd4pod::FourVector position
position
const double & length() const
Access the length.
long long cellID
cellID
TrackerHitData data
Definition: TrackerHitObj.h:30
const long & g4ID() const
Access the Original Geant4 track identifier of the creating track (debugging)
const dd4pod::FourVector & momentum() const
Access the momentum.
::dd4pod::MonteCarloContrib truth
truth
ConstTrackerHit()
default constructor
const podio::ObjectID getObjectID() const
long flag
User flag to classify hits.