LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SimTrackerHitImpl.cc
Go to the documentation of this file.
2 
3 using namespace EVENT ;
4 
5 namespace EVENT{
6 
7  // the standard requires static const ints to be defined outside the class declaration
8  // so we do this here :
9  const int SimTrackerHit::BITOverlay ;
11 
12 }
13 
14 
15 namespace IMPL {
16 
17  SimTrackerHitImpl::SimTrackerHitImpl() :
18  _cellID0(0),
19  _cellID1(0),
20  //_dEdx(0),
21  _EDep(0),
22  _time(0),
23  _particle(0),
24  _pathLength(0),
25  _quality(0)
26  {
27  _pos[0] = 0. ;
28  _pos[1] = 0. ;
29  _pos[2] = 0. ;
30  _p[0] = 0. ;
31  _p[1] = 0. ;
32  _p[2] = 0. ;
33 
34  }
35 
37  }
38 
39  // DEPRECATED. use getCellID0()
40  int SimTrackerHitImpl::getCellID() const {
41  return getCellID0();
42  }
43  int SimTrackerHitImpl::getCellID0() const { return _cellID0 ; }
44  int SimTrackerHitImpl::getCellID1() const { return _cellID1 ; }
45 
46  const double * SimTrackerHitImpl::getPosition() const { return _pos ; }
47 
48  // DEPRECATED. use getEDep()
49  float SimTrackerHitImpl::getdEdx() const {
50  //return _dEdx ;
51  return getEDep() ;
52  }
53 
54  float SimTrackerHitImpl::getEDep() const { return _EDep ; }
55 
56  float SimTrackerHitImpl::getTime() const { return _time ; }
57 
59 
60  float SimTrackerHitImpl::getPathLength() const { return _pathLength ; }
61 
62  const float* SimTrackerHitImpl::getMomentum() const { return _p ; }
63 
65  checkAccess("SimTrackerHitImpl::setCellID0") ;
66  _cellID0 = id0 ;
67  }
68 
70  checkAccess("SimTrackerHitImpl::setCellID1") ;
71  _cellID1 = id1 ;
72  }
73 
74  void SimTrackerHitImpl::setPosition( const double pos[3]){
75  checkAccess("SimTrackerHitImpl::setPosition") ;
76  _pos[0] = pos[0] ;
77  _pos[1] = pos[1] ;
78  _pos[2] = pos[2] ;
79  }
80 
81  // DEPRECATED. use setEDep()
82  void SimTrackerHitImpl::setdEdx( float dedx ) {
83  //checkAccess("SimTrackerHitImpl::setdEdx") ;
84  //_dEdx = dedx ;
85  setEDep( dedx ) ;
86  }
87 
88  void SimTrackerHitImpl::setEDep( float e ) {
89  checkAccess("SimTrackerHitImpl::setEDep") ;
90  _EDep = e ;
91  }
92 
93  void SimTrackerHitImpl::setTime( float t ) {
94  checkAccess("SimTrackerHitImpl::setTime") ;
95  _time = t ;
96  }
97 
99  checkAccess("SimTrackerHitImpl::setMCParticle") ;
100  _particle = particle;
101  }
102 
103  void SimTrackerHitImpl::setMomentum( const float p[3] ) {
104 
105  setMomentum( p[0], p[1], p[2] ) ;
106  }
107 
108  void SimTrackerHitImpl::setMomentum( float px, float py, float pz ) {
109 
110  checkAccess("SimTrackerHitImpl::setMomentum") ;
111  _p[0] = px ;
112  _p[1] = py ;
113  _p[2] = pz ;
114 
115  }
116 
117  void SimTrackerHitImpl::setPathLength(float pathLength){
118  checkAccess("SimTrackerHitImpl::setPathLength") ;
119  _pathLength = pathLength ;
120  }
121 
122  void SimTrackerHitImpl::setQuality( int quality ) {
123  checkAccess("SimTrackerHitImpl::setQuality") ;
124  _quality = quality ;
125  }
126 
127  void SimTrackerHitImpl::setQualityBit( int bit , bool val ) {
128  checkAccess("SimTrackerHitImpl::setQualityBit") ;
129  if( val )
130  _quality |= ( 1 << bit ) ;
131  else
132  _quality &= ~( 1 << bit ) ;
133  }
134 
135  bool SimTrackerHitImpl::isOverlay() const { return _quality & (1 << BITOverlay) ; }
137 
140 
141 } // namespace IMPL
void setQuality(int quality)
float _p[3]
&lt;– fixme: ROOT cannot handle this pointer !!????
void setPathLength(float pathLength)
static const int BITOverlay
Definition: SimTrackerHit.h:85
virtual int getCellID() const =0
DEPRECATED: use ()
void setProducedBySecondary(bool val)
virtual ~SimTrackerHitImpl()
Destructor.
void setCellID1(int id1)
Sets the second cell id; Only store if the flag word (bit THBIT_ID1) of the collection is set...
virtual float getPathLength() const
The path length of the particle in the sensitive material that resulted in this hit.
EVENT::MCParticle * _particle
virtual bool isProducedBySecondary() const
True if the particle has been created by a secondary particle that is not stored in the MCParticle co...
virtual const float * getMomentum() const
Returns the 3-momentum of the particle at the hits position in [GeV] - optional, only if bit LCIO::TH...
void setEDep(float e)
Sets EDep.
virtual int getCellID0() const
Same name as in CalorimeterHit, even though there are no &#39;cells&#39; in this case.
virtual float getdEdx() const =0
Returns the dE/dx of the hit in [GeV].
virtual const double * getPosition() const
Returns the hit position.
virtual int getCellID1() const
Same name as in CalorimeterHit, even though there are no &#39;cells&#39; in this case 0 if information is not...
static const int BITProducedBySecondary
Definition: SimTrackerHit.h:86
void setMomentum(const float p[3])
Sets the momentum of the particle at the hit&#39;s position.
virtual bool isOverlay() const
True if the hit has been overlayed by the simulation (or digitization) program.
void setCellID0(int id0)
Sets the first cell id;.
The LCIO Monte Carlo particle.
Definition: MCParticle.h:27
virtual EVENT::MCParticle * getMCParticle() const
Returns the MC particle that caused the hit.
void setQualityBit(int bit, bool val=true)
virtual float getTime() const
Returns the time of the hit.
void setTime(float t)
Sets the time.
void setPosition(const double pos[3])
Sets the position.
void setMCParticle(EVENT::MCParticle *particle)
Sets the MCParticle that caused the hit.
virtual float getEDep() const
Returns the deposited energy of the hit [GeV].