LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SimCalorimeterHitImpl.h
Go to the documentation of this file.
1 #ifndef IMPL_SIMCALORIMETERHITIMPL_H
2 #define IMPL_SIMCALORIMETERHITIMPL_H 1
3 
4 
5 #include "EVENT/MCParticle.h"
7 #include "AccessChecked.h"
8 #include <vector>
9 #include "LCIODeprecated.h"
10 
11 namespace IMPL {
12 
13 
14  // helper class for particle contributions to hits
17  Particle(0) ,
18  Energy(0.) ,
19  Time(0.) ,
20  Length(0.),
21  PDG(0) {
22  StepPosition[0] = 0. ;
23  StepPosition[1] = 0. ;
24  StepPosition[2] = 0. ;
25  }
26 
27  MCParticleCont( EVENT::MCParticle* part, float e,float t,float l,int pdg, const float* step ) :
28  Particle( part ) ,
29  Energy(e) ,
30  Time(t) ,
31  Length(l),
32  PDG(pdg) {
33  StepPosition[0] = step[0] ;
34  StepPosition[1] = step[1] ;
35  StepPosition[2] = step[2] ;
36  }
37 
39  float Energy ;
40  float Time ;
41  float Length ;
42  int PDG ;
43  float StepPosition[3] ;
44  } ;
45 
47 
55  , public AccessChecked {
56 
57  public:
58 
62 
66 
68  virtual ~SimCalorimeterHitImpl() ;
69 
70  virtual int id() const { return simpleUID() ; }
71 
72 // /** Create a deep copy of itself.
73 // * Overwrites return type in LCObject::clone().
74 // * Not yet - as AID genereates virtual inheritance and
75 // * g++ doesn't support virtual constructors with virtual inheritance
76 // * TODO - change org.freehep.aid.CPPHeaderGenerator !
77 // */
78 // //virtual SimCalorimeterHit* clone() const;
79 // virtual LCObject* clone() const;
80 
83  virtual int getCellID0() const ;
84 
89  virtual int getCellID1() const ;
90 
93  virtual float getEnergy() const ;
94 
100  virtual const float * getPosition() const ;
101 
102 
106  virtual const float* getStepPosition( int i ) const ;
107 
108 
114  LCIO_DEPRECATED( "Use getNMCContributions() instead" , virtual int getNMCParticles() const ) ;
115 
122  virtual int getNMCContributions() const ;
123 
127  virtual float getEnergyCont(int i) const ;
128 
132  virtual float getTimeCont(int i) const ;
133 
137  virtual float getLengthCont(int i) const ;
138 
144  virtual int getPDGCont(int i) const ;
145 
151  virtual EVENT::MCParticle * getParticleCont(int i) const ;
152 
153  // setters
156  void setCellID0(int id0) ;
157 
162  void setCellID1(int id1) ;
163 
166  void setEnergy(float en) ;
167 
170  void setPosition(const float pos[3]) ;
171 
172 
179  float en,
180  float t ) ;
181 
182 
191  float en,
192  float t,
193  int pdg,
194  float* stepPos=0
195  ) {
196 
197  addMCParticleContribution( p, en, t, 0., pdg, stepPos ) ;
198  }
199 
207  float en,
208  float t,
209  float l,
210  int pdg,
211  float* stepPos=0
212  ) ;
213 
214 
215 
216  protected:
217 
218  int _cellID0 ;
219  int _cellID1 ;
220  float _energy ;
221  float _position[3] ;
222 
224 
225  }; // class
226 } // namespace IMPL
227 #endif /* ifndef IMPL_SIMCALORIMETERHITIMPL_H */
The generic simulated calorimeter hit.
virtual float getEnergy() const
Returns the energy of the hit.
void setCellID1(int id1)
Sets the second cell id; Only store if the flag word (bit CHBIT_ID1) of the collection is set...
virtual const float * getStepPosition(int i) const
Returns the position where the energy deposited (step) occurred optional, only if bit LCIO::CHBIT_STE...
MCParticleCont(EVENT::MCParticle *part, float e, float t, float l, int pdg, const float *step)
virtual int getCellID0() const
Create a deep copy of itself.
Implementation of the generic SimCalorimeterHit.
virtual const float * getPosition() const
Returns the position of the hit in world coordinates.
void setEnergy(float en)
Sets the energy.
void addMCParticleContribution(EVENT::MCParticle *p, float en, float t, int pdg, float *stepPos=0)
Adds a detailed MCParticle contribution to the hit.
virtual ~SimCalorimeterHitImpl()
Destructor.
virtual int getNMCParticles() const =0
Returns the number of MC contributions to the hit.
void addMCParticleContribution(EVENT::MCParticle *p, float en, float t)
Adds an MCParticle contribution to the hit - contributions for the same MCParticle are combined into ...
EVENT::MCParticle * Particle
virtual int getNMCContributions() const
Returns the number of MC contributions to the hit.
The LCIO Monte Carlo particle.
Definition: MCParticle.h:27
SimCalorimeterHitImpl()
Default constructor, initializes values to 0.
void setCellID0(int id0)
Sets the first cell id;.
virtual int simpleUID() const
Definition: AccessChecked.h:26
virtual float getLengthCont(int i) const
Returns the step length of the i-th contribution to the hit.
std::vector< IMPL::MCParticleCont * > MCParticleContVec
Controls access to objects.
Definition: AccessChecked.h:18
virtual int getCellID1() const
Returns the second detector specific (geometrical) cell id.
virtual int getPDGCont(int i) const
Returns the PDG code of the shower particle that caused this contribution.
virtual EVENT::MCParticle * getParticleCont(int i) const
Returns the MCParticle that caused the shower responsible for this contribution to the hit...
void setPosition(const float pos[3])
Sets the position.
virtual float getEnergyCont(int i) const
Returns the energy in [GeV] of the i-th contribution to the hit.
LCIO_DEPRECATED("Use getNMCContributions() instead", virtual int getNMCParticles() const )
Returns the number of MC contributions to the hit.
virtual float getTimeCont(int i) const
Returns the time of the i-th in [ns] contribution to the hit.
virtual int id() const
Returns an object id for internal (debugging) use in LCIO.