LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MCParticleImpl.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #ifndef IMPL_MCPARTICLEIMPL_H
3 #define IMPL_MCPARTICLEIMPL_H 1
4 #include <vector>
5 
6 #include "EVENT/LCIO.h"
7 #include "AccessChecked.h"
8 
9 #include "EVENT/MCParticle.h"
10 #include <bitset>
11 
12 namespace IMPL {
13 
14  // fg 01042004 : changed to use vector of pointers !
15  // typedef std::vector<EVENT::MCParticle**> MCParticlePVec ;
16  // use pointers to pointer to MCParticle
17  // as SIO needs the address of the pointer for pointer reallocation....
18 
25 
26  public:
27 
28  MCParticleImpl() ;
29 
30 // /** Copy c'tor */
31 // MCParticleImpl(const EVENT::MCParticle& p) ;
32 
34  virtual ~MCParticleImpl() ;
35 
36  virtual int id() const { return simpleUID() ; }
37 
40  virtual const EVENT::MCParticleVec & getParents() const ;
41 
44  virtual const EVENT::MCParticleVec & getDaughters() const ;
45 
46 
47  // /** Returns the i-th daughter of this particle.
48  // * Same as getDaughter() except for return type.
49  // *
50  // * @see getNumberOfDaughters
51  // */
52  // virtual EVENT::MCParticle * getDaughter(int i) const ;
53 
54 
55  // /** Returns the number of parents of this particle - 0 if mother.
56  // */
57  // virtual int getNumberOfParents() const ;
58 
59 
60  // /** Returns the i-th parent of this particle.
61  // */
62  // virtual EVENT::MCParticle * getParent(int i) const ;
63 
64 
70  virtual const double* getEndpoint() const ;
71 
72  // /** Returns the number of daughters of this particle.
73  // */
74  // virtual int getNumberOfDaughters() const ;
75 
76 
79  virtual int getPDG() const ;
80 
87  virtual int getGeneratorStatus() const ;
88 
102  virtual int getSimulatorStatus() const ;
103 
106  virtual bool isCreatedInSimulation() const ;
107 
110  virtual bool isBackscatter() const ;
111 
114  virtual bool vertexIsNotEndpointOfParent() const ;
115 
118  virtual bool isDecayedInTracker() const ;
119 
122  virtual bool isDecayedInCalorimeter() const ;
123 
126  virtual bool hasLeftDetector() const ;
127 
130  virtual bool isStopped() const ;
131 
134  virtual bool isOverlay() const ;
135 
138  virtual const double* getVertex() const ;
139 
144  virtual float getTime() const ;
145 
148  virtual const double * getMomentum() const ;
149 
150 
153  virtual const double* getMomentumAtEndpoint() const ;
154 
157  virtual double getMass() const ;
158 
161  virtual float getCharge() const ;
162 
163 
167  virtual double getEnergy() const ;
168 
171  virtual const float* getSpin() const ;
172 
173 
176  virtual const int* getColorFlow() const ;
177 
178 
179  // set methods
182  void addParent( EVENT::MCParticle *mom ) ;
183 
184 // // set methods
185 // /** Sets the parent.
186 // */
187 // void setParent( EVENT::MCParticle *mom0 ) ;
188 
189 // /** Sets a second parent.
190 // */
191 // void setSecondParent( EVENT::MCParticle *mom1 ) ;
192 
193 
196  void setPDG(int pdg ) ;
197 
200  void setGeneratorStatus( int status ) ;
201 
204  void setSimulatorStatus( int status ) ;
205 
208  void setVertex( const double vtx[3] ) ;
209 
212  void setTime( float time) ;
213 
217  void setEndpoint( const double pnt[3] ) ;
218 
221  void setMomentum( const float p[3] );
222 
225  void setMomentum( const double p[3] );
226 
229  void setMomentumAtEndpoint( const float p[3] );
230 
233  void setMomentumAtEndpoint( const double p[3] );
234 
237  void setMass( float m ) ;
238 
241  void setCharge( float c ) ;
242 
245  void setSpin( const float spin[3] );
246 
249  void setColorFlow( const int cflow[2] );
250 
251 
252 
253  // setters for simulator status
254  virtual void setCreatedInSimulation(bool val) ;
255 
256  virtual void setBackscatter(bool val) ;
257 
258  virtual void setVertexIsNotEndpointOfParent(bool val) ;
259 
260  virtual void setDecayedInTracker(bool val) ;
261 
262  virtual void setDecayedInCalorimeter(bool val) ;
263 
264  virtual void setHasLeftDetector(bool val) ;
265 
266  virtual void setStopped(bool val) ;
267 
268  virtual void setOverlay(bool val) ;
269 
270  protected:
271 
274  void addDaughter( EVENT::MCParticle* daughter) ;
275 
276 // EVENT::MCParticle* _mother0 ;
277 // EVENT::MCParticle* _mother1 ;
278  int _pdg ;
280  // int _simstatus ;
282  double _vertex[3] ;
283  double _endpoint[3] ;
284  double _pEndpoint[3] ;
285  double _p[3] ;
286  double _mass ;
287  float _charge ;
288  float _time ;
292  float _spin[3] ;
293  int _colorFlow[2] ;
294 
295 }; // class
296 } // namespace IMPL
297 #endif /* ifndef IMPL_MCPARTICLEIMPL_H */
EVENT::MCParticleVec _daughters
virtual bool vertexIsNotEndpointOfParent() const
True if the particle&#39;s vertex is not the endpoint of the parent particle.
virtual const int * getColorFlow() const
Returns the color flow.
virtual const double * getMomentumAtEndpoint() const
Returns the particle momentum at the endpoint.
void setTime(float time)
Sets the createion time.
virtual const double * getMomentum() const
Returns the particle momentum at the production vertex.
void setEndpoint(const double pnt[3])
Sets the particle endpoint.
virtual float getTime() const
The creation time of the particle in [ns] wrt.
virtual double getMass() const
Returns the mass of the particle in [GeV].
virtual const EVENT::MCParticleVec & getParents() const
Returns the parents of this particle.
virtual bool hasLeftDetector() const
True if the particle has left the world volume undecayed.
virtual int getGeneratorStatus() const
Returns the status for particles from the generator 0 empty line 1 undecayed particle, stable in the generator 2 particle decayed in the generator 3 documentation line.
virtual bool isBackscatter() const
True if the particle is the result of a backscatter from a calorimeter shower.
std::bitset< 32 > _simstatus
void setGeneratorStatus(int status)
Sets the Generator status.
virtual const double * getEndpoint() const
Returns the i-th daughter of this particle.
void addParent(EVENT::MCParticle *mom)
Adds a parent particle.
virtual void setDecayedInCalorimeter(bool val)
void addDaughter(EVENT::MCParticle *daughter)
Adds a daughter particle - only called from addParent().
virtual bool isDecayedInTracker() const
True if the particle has interacted in a tracking region.
void setColorFlow(const int cflow[2])
Sets the color flow.
void setSimulatorStatus(int status)
Sets the Simulator status.
void setMass(float m)
Sets the mass.
virtual void setCreatedInSimulation(bool val)
virtual void setDecayedInTracker(bool val)
void setMomentum(const float p[3])
Sets the momentum.
void setMomentumAtEndpoint(const float p[3])
Sets the momentum at the endpoint.
void setVertex(const double vtx[3])
Sets the production vertex.
virtual void setVertexIsNotEndpointOfParent(bool val)
void setCharge(float c)
Sets the charge.
virtual const EVENT::MCParticleVec & getDaughters() const
Returns the daughters of this particle.
virtual double getEnergy() const
Returns the energy of the particle (at the vertex) in [GeV] computed from the particle&#39;s momentum and...
The LCIO Monte Carlo particle.
Definition: MCParticle.h:27
virtual bool isCreatedInSimulation() const
True if the particle has been created by the simulation program (rather than the generator).
void setPDG(int pdg)
Sets the parent.
virtual bool isStopped() const
True if the particle has been stopped by the simulation program.
virtual void setStopped(bool val)
virtual void setHasLeftDetector(bool val)
virtual int simpleUID() const
Definition: AccessChecked.h:26
virtual bool isDecayedInCalorimeter() const
True if the particle has interacted in a calorimeter region.
virtual bool isOverlay() const
True if the particle has been overlayed by the simulation (or digitization) program.
virtual void setOverlay(bool val)
virtual const double * getVertex() const
Returns the production vertex of the particle.
void setSpin(const float spin[3])
Sets the spin.
virtual int getPDG() const
Returns the number of daughters of this particle.
Controls access to objects.
Definition: AccessChecked.h:18
virtual int getSimulatorStatus() const
Returns the status for particles from the simulation, e.g.
EVENT::MCParticleVec _parents
virtual void setBackscatter(bool val)
virtual float getCharge() const
Returns the particle&#39;s charge.
Implementation of MCParticle.
virtual ~MCParticleImpl()
Copy c&#39;tor.
virtual const float * getSpin() const
Returns the spin.
virtual int id() const
Returns an object id for internal (debugging) use in LCIO.