LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TrackerHitImpl.cc
Go to the documentation of this file.
1 #include "IMPL/TrackerHitImpl.h"
2 #include "EVENT/LCIO.h"
3 
4 using namespace EVENT ;
5 
6 namespace IMPL {
7 
8  TrackerHitImpl::TrackerHitImpl() :
9  _cellID0(0),
10  _cellID1(0),
11  _type(0),
12  //_dEdx(0),
13  _EDep(0),
14  _EDepError(0),
15  _time(0),
16  _quality(0),
17  _rawHits(0) {
18  _pos[0] = 0. ;
19  _pos[1] = 0. ;
20  _pos[2] = 0. ;
21 
23  // for(int i=0;i<TRKHITNCOVMATRIX;i++){
24  // _cov.push_back(0.0) ;
25  // }
26  }
27 
29  }
30 
31 
33  return _cellID0 ;
34  }
35 
37  return _cellID1 ;
38  }
39 
40  const double* TrackerHitImpl::getPosition() const { return _pos ; }
41 
43  return _cov ;
44  }
45 
46  // DEPRECATED. use getEDep()
47  float TrackerHitImpl::getdEdx() const {
48  //return _dEdx ;
49  return getEDep();
50  }
51 
52  float TrackerHitImpl::getTime() const { return _time ; }
53 
54 
56  return _rawHits ;
57  }
58 
60  checkAccess("TrackerHitImpl::rawHits") ;
61  return _rawHits ;
62  }
63 
64 // const std::string & TrackerHitImpl::getType() const {
65 // static std::string tpcHitType( LCIO::TPCHIT ) ;
66 // static std::string unknown( "Unknown" ) ;
67 // TPCHit* tpchit = dynamic_cast<TPCHit*>( _rawHit ) ;
68 // if( tpchit != 0 )
69 // return tpcHitType ;
70 // else
71 // return unknown ;
72 // }
73 
75  return _type ;
76  }
77 
79  checkAccess("TrackerHitImpl::setCellID0") ;
80  _cellID0 = id0 ;
81  }
82 
84  checkAccess("TrackerHitImpl::setCellID1") ;
85  _cellID1 = id1 ;
86  }
87 
88  void TrackerHitImpl::setType(int type) {
89  checkAccess("TrackerHitImpl::setType") ;
90  _type= type ;
91  }
92 
93  void TrackerHitImpl::setPosition( const double pos[3]){
94  checkAccess("TrackerHitImpl::setPosition") ;
95  _pos[0] = pos[0] ;
96  _pos[1] = pos[1] ;
97  _pos[2] = pos[2] ;
98  }
99 
100  // DEPRECATED. use setEDep()
101  void TrackerHitImpl::setdEdx( float dedx ) {
102  //checkAccess("TrackerHitImpl::setdEdx") ;
103  //_dEdx = dedx ;
104  setEDep( dedx ) ;
105  }
106 
107  void TrackerHitImpl::setEDep( float e ) {
108  checkAccess("TrackerHitImpl::setEDep") ;
109  _EDep = e ;
110  }
111 
112  void TrackerHitImpl::setEDepError( float e ) {
113  checkAccess("TrackerHitImpl::setEDepError") ;
114  _EDepError = e ;
115  }
116 
117  void TrackerHitImpl::setTime( float t ) {
118  checkAccess("TrackerHitImpl::setTime") ;
119  _time = t ;
120  }
121 
122  void TrackerHitImpl::setQuality( int quality ) {
123  checkAccess("TrackerHitImpl::setQuality") ;
124  _quality = quality ;
125  }
126 
127  void TrackerHitImpl::setQualityBit( int bit , bool val ) {
128  checkAccess("TrackerHitImpl::setQuality") ;
129 
130  if( val )
131  _quality |= ( 1 << bit ) ;
132  else
133  _quality &= ~( 1 << bit ) ;
134  }
135 
137  checkAccess("TrackerHitImpl::setCovMatrix") ;
138  for(int i=0;i<TRKHITNCOVMATRIX;i++){
139  _cov[i] = cov[i] ;
140  }
141  }
143  checkAccess("TrackerHitImpl::setCovMatrix") ;
144  for(int i=0;i<TRKHITNCOVMATRIX;i++){
145  _cov[i] = cov[i] ;
146  }
147  }
148 
149 
150 } // namespace IMPL
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...
void setCovMatrix(const EVENT::FloatVec &cov)
#define TRKHITNCOVMATRIX
virtual const double * getPosition() const
The hit position in [mm].
virtual int getType() const
Type of raw data hit, either one of LCIO::TPCHIT LCIO::SIMTRACKERHIT
virtual const EVENT::FloatVec & getCovMatrix() const
Covariance of the position (x,y,z)
virtual float getTime() const
The time of the hit in [ns].
void setCellID1(int id1)
Sets the second cell id; Only store if the flag word (bit RTHBIT_ID1) of the collection is set...
void setQuality(int quality)
T resize(T...args)
void setQualityBit(int bit, bool val=true)
virtual ~TrackerHitImpl()
Destructor.
virtual EVENT::LCObjectVec & rawHits()
Use to manipulate the raw hits.
EVENT::LCObjectVec _rawHits
void setCellID0(int id0)
Sets the first cell id;.
void setEDepError(float e)
virtual const EVENT::LCObjectVec & getRawHits() const
The raw data hits.
void setType(int type)
virtual float getdEdx() const =0
The dE/dx of the hit in [GeV].
virtual float getEDep() const
The deposited energy of the hit [GeV].
virtual int getCellID0() const
Same name as in CalorimeterHit, even though there are no &#39;cells&#39; in this case.
EVENT::FloatVec _cov
void setPosition(const double pos[3])