/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/McTruth/McTruth-00-02-19/McTruth/McParticle.h

Go to the documentation of this file.
00001 #ifndef Event_McParticle_H
00002 #define Event_McParticle_H 
00003 
00004 #include <iostream>
00005 #include "GaudiKernel/Kernel.h"
00006 #include "GaudiKernel/ContainedObject.h"
00007 #include "GaudiKernel/SmartRef.h"
00008 #include "GaudiKernel/SmartRefVector.h"
00009 #include "CLHEP/Vector/LorentzVector.h"
00010 #include "CLHEP/Geometry/Point3D.h"
00011 #include "GaudiKernel/ObjectVector.h"
00012 #include "GaudiKernel/ObjectList.h"
00013 #include "EventModel/EventModel.h"
00014 using namespace CLHEP;
00023 extern const CLID& CLID_McParticle;
00024 
00025 namespace Event {  // NameSpace
00026 
00027 
00028 class McParticle  : virtual public ContainedObject  {
00029   public:
00030     typedef int  StdHepId;
00031     
00033 
00034     enum StatusBits{  
00035         DECAYED =1 ,    
00036         DECAYFLT=1<<1,  
00037         PRIMARY =1<<2,  
00038         LEAF = 1<<3,    
00039         ERROR = 1<<4    
00040         //MISSED=  1<<2,  //! Does not hit detector
00041         //NOINTER =1<<3,  //! Traverses detector w/o interacting 
00042         //STOPPED =1<<4,  //! Energy below cut; other bits may say why 
00043         //INTERACT=1<<5,  //! Interacted, no further decision to be made
00044         //INTSHDEP=1<<6,  //! Interacted, further decision depends on ! selection of shower deposition  
00045         //PRIMARY =1<<7,  //! primary particle 
00046         //SWERROR =1<<8,  //! Error occurred in swimming the track 
00047         //BCKSPL=1<<9,    //! The particle is backsplashed from the CAL back in the TKR region
00048         //POSHIT =1<<10,     //! The particle released a hit a PositionHit detector
00049         //NOTTRACK=1<<11, //! Not tracked by user request 
00050         //Swum =   1<<12,  //! this particle was produced by the swimmer
00051         //LEAF = 1<<13     //! this particle is a leaf in the particle tree 
00052     };
00053     
00054 
00055     virtual const CLID& clID() const   { return McParticle::classID(); }
00056     static const CLID& classID()       { return CLID_McParticle; }
00058     McParticle() :
00059       m_statusFlags(0)
00060     {}
00062     virtual ~McParticle() {}
00063 
00066     void init( McParticle* mother, 
00067         StdHepId id, 
00068         unsigned int statusBits,
00069         const HepLorentzVector& initialMomentum,
00070         const HepLorentzVector& finalMomentum,
00071         const HepLorentzVector& initialPosition,
00072         const HepLorentzVector& finalPosition,
00073         const std::string process = "");
00074 
00076     void initialize(
00077         StdHepId id, 
00078         unsigned int statusBits,
00079         const HepLorentzVector& initialMomentum,
00080         const HepLorentzVector& initialPosition,
00081         const std::string process = "");
00082 
00083 
00084     void initialize( McParticle* mother, 
00085         StdHepId id, 
00086         unsigned int statusBits,
00087         const HepLorentzVector& initialMomentum,
00088         const HepLorentzVector& initialPosition,
00089         const std::string process = "");
00090 
00092     //void finalize( const HepLorentzVector& finalMomentum,const HepLorentzVector& finalPosition);
00093 
00094     void finalize( const HepLorentzVector& finalPosition);
00095 
00097     StdHepId particleProperty() const;
00098 
00100     unsigned int statusFlags()const;
00101 
00103     void addStatusFlag(unsigned int flag){m_statusFlags |= flag;};
00104 
00107     bool primaryParticle() const;
00108 
00110     bool leafParticle() const;
00111 
00113     bool decayFromGenerator() const;
00114 
00116     bool decayInFlight() const;
00117 
00119     void setVertexIndex0(int index0) { m_vertexIndex0 = index0; }
00120 
00121     int  vertexIndex0() const {return m_vertexIndex0;}
00122 
00123     void setVertexIndex1(int index1) { m_vertexIndex1 = index1; }
00124 
00125     int  vertexIndex1() const {return m_vertexIndex1;}
00126     
00127     // Set track index
00128     void setTrackIndex(int trackIndex) { m_trackIndex = trackIndex; }
00129  
00130     // Get track index
00131     int trackIndex() const {return m_trackIndex;}
00132 
00134     const HepLorentzVector& initialPosition() const;
00135     const HepLorentzVector& finalPosition() const;
00136 
00137     const HepLorentzVector&  initialFourMomentum()const;
00138     //const HepLorentzVector&  finalFourMomentum()const;
00139 
00141     const McParticle& mother()const; 
00142 
00144     void setMother(const SmartRef<McParticle> m);
00145 
00147     void addDaughter(const SmartRef<McParticle> d){m_daughters.push_back(d);};
00148 
00150     void removeDaughter(const SmartRef<McParticle> mcPart);
00151 
00153     //const std::string getProcess()const{return m_process;};
00154 
00156     // void setInitialId(idents::VolumeIdentifier id){m_initialId = id;};
00157     // void setFinalId(idents::VolumeIdentifier id){m_finalId = id;};
00158 
00160     // idents::VolumeIdentifier getInitialId(){return m_initialId;};
00161     // idents::VolumeIdentifier getFinalId(){return m_finalId;};
00162 
00164     const SmartRefVector<McParticle>& daughterList()const{return m_daughters;};
00165 
00166 
00167   private:
00168 
00170     StdHepId                  m_particleID;
00171 
00172     int m_trackIndex;
00173 
00175     int m_vertexIndex0;
00176     
00178     int m_vertexIndex1;
00179 
00181     unsigned long             m_statusFlags;
00183     HepLorentzVector                 m_initialPosition;
00185     HepLorentzVector                 m_finalPosition;
00186     
00188     HepLorentzVector           m_initialFourMomentum;
00190     HepLorentzVector           m_finalFourMomentum;
00192     SmartRef<McParticle>       m_mother;
00194     SmartRefVector<McParticle> m_daughters;
00196     std::string                m_process;
00197 
00199     // idents::VolumeIdentifier   m_initialId;
00200 
00202     // idents::VolumeIdentifier   m_finalId;  
00203 };
00204 
00205 typedef ObjectList<McParticle>       McParticleCol;
00206 
00207 } // NameSpace Event
00208 
00209 
00210 #endif    // Event_McParticle_H
00211 

Generated on Tue Nov 29 22:58:31 2016 for BOSS_7.0.2 by  doxygen 1.4.7