LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
SimCalorimeterHitImpl.h
1 #ifndef IMPL_SIMCALORIMETERHITIMPL_H
2 #define IMPL_SIMCALORIMETERHITIMPL_H 1
3 
4 
5 #include "EVENT/MCParticle.h"
6 #include "EVENT/SimCalorimeterHit.h"
7 #include "AccessChecked.h"
8 #include <vector>
9 
10 namespace IMPL {
11 
12 
13  // helper class for particle contributions to hits
16  Particle(0) ,
17  Energy(0.) ,
18  Time(0.) ,
19  PDG(0) {
20  StepPosition[0] = 0. ;
21  StepPosition[1] = 0. ;
22  StepPosition[2] = 0. ;
23  }
24 
25  MCParticleCont( EVENT::MCParticle* part, float e,float t,int pdg, const float* step ) :
26  Particle( part ) ,
27  Energy(e) ,
28  Time(t) ,
29  PDG(pdg) {
30  StepPosition[0] = step[0] ;
31  StepPosition[1] = step[1] ;
32  StepPosition[2] = step[2] ;
33  }
34 
35  EVENT::MCParticle* Particle ;
36  float Energy ;
37  float Time ;
38  int PDG ;
39  float StepPosition[3] ;
40  } ;
41 
42  typedef std::vector< IMPL::MCParticleCont* > MCParticleContVec ;
43 
51  , public AccessChecked {
52 
53  public:
54 
58 
62 
64  virtual ~SimCalorimeterHitImpl() ;
65 
66  virtual int id() const { return simpleUID() ; }
67 
68 // /** Create a deep copy of itself.
69 // * Overwrites return type in LCObject::clone().
70 // * Not yet - as AID genereates virtual inheritance and
71 // * g++ doesn't support virtual constructors with virtual inheritance
72 // * TODO - change org.freehep.aid.CPPHeaderGenerator !
73 // */
74 // //virtual SimCalorimeterHit* clone() const;
75 // virtual LCObject* clone() const;
76 
79  virtual int getCellID0() const ;
80 
85  virtual int getCellID1() const ;
86 
89  virtual float getEnergy() const ;
90 
96  virtual const float * getPosition() const ;
97 
98 
102  virtual const float* getStepPosition( int i ) const ;
103 
104 
110  virtual int getNMCParticles() const ;
111 
118  virtual int getNMCContributions() const ;
119 
123  virtual float getEnergyCont(int i) const ;
124 
128  virtual float getTimeCont(int i) const ;
129 
135  virtual int getPDGCont(int i) const ;
136 
142  virtual EVENT::MCParticle * getParticleCont(int i) const ;
143 
144  // setters
147  void setCellID0(int id0) ;
148 
153  void setCellID1(int id1) ;
154 
157  void setEnergy(float en) ;
158 
161  void setPosition(const float pos[3]) ;
162 
163 
170  float en,
171  float t ) ;
172 
173 
181  float en,
182  float t,
183  int pdg,
184  float* stepPos=0
185  ) ;
186 
187 
188 
189 
190  protected:
191 
192  int _cellID0 ;
193  int _cellID1 ;
194  float _energy ;
195  float _position[3] ;
196 
197  MCParticleContVec _vec ;
198 
199  }; // class
200 } // namespace IMPL
201 #endif /* ifndef IMPL_SIMCALORIMETERHITIMPL_H */
The generic simulated calorimeter hit.
Definition: SimCalorimeterHit.h:23
virtual int getNMCParticles() const
Returns the number of MC contributions to the hit.
Definition: SimCalorimeterHitImpl.cc:82
virtual float getEnergy() const
Returns the energy of the hit.
Definition: SimCalorimeterHitImpl.cc:70
void setCellID1(int id1)
Sets the second cell id; Only store if the flag word (bit CHBIT_ID1) of the collection is set...
Definition: SimCalorimeterHitImpl.cc:125
virtual const float * getStepPosition(int i) const
Returns the position where the energy deposited (step) occurred optional, only if bit LCIO::CHBIT_STE...
Definition: SimCalorimeterHitImpl.cc:78
virtual int getCellID0() const
Create a deep copy of itself.
Definition: SimCalorimeterHitImpl.cc:62
Implementation of the generic SimCalorimeterHit.
Definition: SimCalorimeterHitImpl.h:50
virtual const float * getPosition() const
Returns the position of the hit in world coordinates.
Definition: SimCalorimeterHitImpl.cc:74
void setEnergy(float en)
Sets the energy.
Definition: SimCalorimeterHitImpl.cc:130
virtual ~SimCalorimeterHitImpl()
Destructor.
Definition: SimCalorimeterHitImpl.cc:52
void addMCParticleContribution(EVENT::MCParticle *p, float en, float t)
Adds an MCParticle contribution to the hit - contributions for the same MCParticle are combined into ...
Definition: SimCalorimeterHitImpl.cc:143
virtual int getNMCContributions() const
Returns the number of MC contributions to the hit.
Definition: SimCalorimeterHitImpl.cc:95
The LCIO Monte Carlo particle.
Definition: MCParticle.h:27
SimCalorimeterHitImpl()
Default constructor, initializes values to 0.
Definition: SimCalorimeterHitImpl.cc:11
void setCellID0(int id0)
Sets the first cell id;.
Definition: SimCalorimeterHitImpl.cc:120
Definition: SimCalorimeterHitImpl.h:14
Controls access to objects.
Definition: AccessChecked.h:17
virtual int getCellID1() const
Returns the second detector specific (geometrical) cell id.
Definition: SimCalorimeterHitImpl.cc:66
virtual int getPDGCont(int i) const
Returns the PDG code of the shower particle that caused this contribution.
Definition: SimCalorimeterHitImpl.cc:116
virtual EVENT::MCParticle * getParticleCont(int i) const
Returns the MCParticle that caused the shower responsible for this contribution to the hit...
Definition: SimCalorimeterHitImpl.cc:99
void setPosition(const float pos[3])
Sets the position.
Definition: SimCalorimeterHitImpl.cc:135
virtual float getEnergyCont(int i) const
Returns the energy in [GeV] of the i-th contribution to the hit.
Definition: SimCalorimeterHitImpl.cc:108
virtual float getTimeCont(int i) const
Returns the time of the i-th in [ns] contribution to the hit.
Definition: SimCalorimeterHitImpl.cc:112
virtual int id() const
Returns an object id for internal (debugging) use in LCIO.
Definition: SimCalorimeterHitImpl.h:66