00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GIGACNV_GIGAPRIMARYPARTICLEINFORMATION_H
00023 #define GIGACNV_GIGAPRIMARYPARTICLEINFORMATION_H 1
00024
00025
00026
00027
00028
00029 #include "GiGa/GiGaUtil.h"
00030
00031
00032
00033 #include "G4VUserPrimaryParticleInformation.hh"
00034 #include "G4ios.hh"
00035
00036
00037 #include "Event/HepMCEvent.h"
00038
00039 namespace LHCb {
00040 class MCParticle ;
00041 };
00042
00050 class GiGaPrimaryParticleInformation :
00051 public G4VUserPrimaryParticleInformation {
00052 public:
00055 GiGaPrimaryParticleInformation( bool osc ) :
00056 G4VUserPrimaryParticleInformation ( ),
00057 m_hasOscillated( osc ) ,
00058 m_isSignal ( false ) ,
00059 m_signalBarcode( -1 ) ,
00060 m_pHepMCEvent ( 0 ) ,
00061 m_mcParticle ( 0 ) { ; }
00062
00064 GiGaPrimaryParticleInformation( bool sig, int code, LHCb::HepMCEvent *event ) :
00065 G4VUserPrimaryParticleInformation ( ),
00066 m_hasOscillated ( false ),
00067 m_isSignal ( sig ),
00068 m_signalBarcode ( code ),
00069 m_pHepMCEvent ( event ),
00070 m_mcParticle ( 0 ) { ; }
00071
00072
00073 virtual ~GiGaPrimaryParticleInformation( ) {;}
00074
00076 void setHasOscillated( bool osc ) { m_hasOscillated = osc ; }
00077
00079 void setIsSignal( bool sig ) { m_isSignal = sig ; }
00080
00082 void setSignalBarcode( int code ) { m_signalBarcode = code ; }
00083
00085 void setHepMCPointer( LHCb::HepMCEvent * event ) { m_pHepMCEvent = event ; }
00086
00088 void setMotherMCParticle( LHCb::MCParticle * mcp ) { m_mcParticle = mcp ; }
00089
00091 bool hasOscillated( ) { return m_hasOscillated ; }
00092
00094 bool isSignal( ) { return m_isSignal ; }
00095
00097 int signalBarcode( ) { return m_signalBarcode ; }
00098
00100 LHCb::HepMCEvent * pHepMCEvent ( ) { return m_pHepMCEvent ; }
00101
00103 LHCb::MCParticle * motherMCParticle( ) { return m_mcParticle ; }
00104
00106 virtual void Print( ) const { if ( m_hasOscillated )
00107 G4cout << "Particle has oscillated" << G4endl ;
00108 }
00109
00110
00111 protected:
00112
00113 private:
00115 bool m_hasOscillated ;
00117 bool m_isSignal ;
00119 int m_signalBarcode ;
00121 LHCb::HepMCEvent * m_pHepMCEvent ;
00123 LHCb::MCParticle * m_mcParticle ;
00124 };
00125
00126
00127
00133
00134 inline GiGaPrimaryParticleInformation*
00135 gigaPrimaryParticleInformation
00136 ( G4VUserPrimaryParticleInformation* info )
00137 {
00138 if( 0 == info ) { return 0 ; }
00139 GiGaUtil::FastCast
00140 <
00141 G4VUserPrimaryParticleInformation ,
00142 GiGaPrimaryParticleInformation
00143 > cast;
00144 return cast( info );
00145 };
00146
00147
00148
00154
00155 inline const GiGaPrimaryParticleInformation*
00156 gigaPrimaryParticleInformation
00157 ( const G4VUserPrimaryParticleInformation* info )
00158 {
00159 if( 0 == info ) { return 0 ; }
00160 GiGaUtil::FastCast
00161 <
00162 const G4VUserPrimaryParticleInformation ,
00163 const GiGaPrimaryParticleInformation
00164 > cast;
00165 return cast( info );
00166 };
00167
00168
00169
00170
00171
00172 #endif // GIGACNV_GIGAPRIMARYPARTICLEINFORMATION_H
00173
00174