00001 #ifndef IMPL_SIMCALORIMETERHITIMPL_H
00002 #define IMPL_SIMCALORIMETERHITIMPL_H 1
00003
00004
00005 #include "EVENT/MCParticle.h"
00006 #include "EVENT/SimCalorimeterHit.h"
00007 #include "AccessChecked.h"
00008 #include <vector>
00009
00010 namespace IMPL {
00011
00012
00013
00014 struct MCParticleCont{
00015 MCParticleCont():
00016 Particle(0) ,
00017 Energy(0.) ,
00018 Time(0.) ,
00019 Length(0.),
00020 PDG(0) {
00021 StepPosition[0] = 0. ;
00022 StepPosition[1] = 0. ;
00023 StepPosition[2] = 0. ;
00024 }
00025
00026 MCParticleCont( EVENT::MCParticle* part, float e,float t,float l,int pdg, const float* step ) :
00027 Particle( part ) ,
00028 Energy(e) ,
00029 Time(t) ,
00030 Length(l),
00031 PDG(pdg) {
00032 StepPosition[0] = step[0] ;
00033 StepPosition[1] = step[1] ;
00034 StepPosition[2] = step[2] ;
00035 }
00036
00037 EVENT::MCParticle* Particle ;
00038 float Energy ;
00039 float Time ;
00040 float Length ;
00041 int PDG ;
00042 float StepPosition[3] ;
00043 } ;
00044
00045 typedef std::vector< IMPL::MCParticleCont* > MCParticleContVec ;
00046
00053 class SimCalorimeterHitImpl : public EVENT::SimCalorimeterHit
00054 , public AccessChecked {
00055
00056 public:
00057
00060 SimCalorimeterHitImpl() ;
00061
00064 SimCalorimeterHitImpl(const EVENT::SimCalorimeterHit& hit) ;
00065
00067 virtual ~SimCalorimeterHitImpl() ;
00068
00069 virtual int id() const { return simpleUID() ; }
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00082 virtual int getCellID0() const ;
00083
00088 virtual int getCellID1() const ;
00089
00092 virtual float getEnergy() const ;
00093
00099 virtual const float * getPosition() const ;
00100
00101
00105 virtual const float* getStepPosition( int i ) const ;
00106
00107
00113 virtual int getNMCParticles() const ;
00114
00121 virtual int getNMCContributions() const ;
00122
00126 virtual float getEnergyCont(int i) const ;
00127
00131 virtual float getTimeCont(int i) const ;
00132
00136 virtual float getLengthCont(int i) const ;
00137
00143 virtual int getPDGCont(int i) const ;
00144
00150 virtual EVENT::MCParticle * getParticleCont(int i) const ;
00151
00152
00155 void setCellID0(int id0) ;
00156
00161 void setCellID1(int id1) ;
00162
00165 void setEnergy(float en) ;
00166
00169 void setPosition(const float pos[3]) ;
00170
00171
00177 void addMCParticleContribution( EVENT::MCParticle *p,
00178 float en,
00179 float t ) ;
00180
00181
00189 void addMCParticleContribution( EVENT::MCParticle *p,
00190 float en,
00191 float t,
00192 int pdg,
00193 float* stepPos=0
00194 ) {
00195
00196 addMCParticleContribution( p, en, t, 0., pdg, stepPos ) ;
00197 }
00198
00205 void addMCParticleContribution( EVENT::MCParticle *p,
00206 float en,
00207 float t,
00208 float l,
00209 int pdg,
00210 float* stepPos=0
00211 ) ;
00212
00213
00214
00215 protected:
00216
00217 int _cellID0 ;
00218 int _cellID1 ;
00219 float _energy ;
00220 float _position[3] ;
00221
00222 MCParticleContVec _vec{} ;
00223
00224 };
00225 }
00226 #endif