| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

GiGaPrimaryParticleInformation.h

Go to the documentation of this file.
00001 // $Id: GiGaPrimaryParticleInformation.h,v 1.6 2008/10/20 12:31:41 robbep Exp $ 
00002 // ============================================================================
00003 // CVS tag $Name: v18r6 $ 
00004 // ============================================================================
00005 // $Log: GiGaPrimaryParticleInformation.h,v $
00006 // Revision 1.6  2008/10/20 12:31:41  robbep
00007 // Add link to HepMC generator mother
00008 //
00009 // Revision 1.5  2006/01/31 10:39:33  gcorti
00010 // adapt to event model
00011 //
00012 // Revision 1.4  2005/01/17 18:14:40  robbep
00013 // Use generator energy instead of Geant4 energy for short lived particles.
00014 //
00015 // Revision 1.3  2004/04/07 15:47:55  gcorti
00016 // signal info, extended collision, new vertex types
00017 //
00018 // Revision 1.2  2004/02/20 19:11:59  ibelyaev
00019 //  upgrade for newer GiGa
00020 // 
00021 // ============================================================================
00022 #ifndef GIGACNV_GIGAPRIMARYPARTICLEINFORMATION_H 
00023 #define GIGACNV_GIGAPRIMARYPARTICLEINFORMATION_H 1
00024 // ============================================================================
00025 // Include files
00026 // ============================================================================
00027 // GiGa 
00028 // ============================================================================
00029 #include "GiGa/GiGaUtil.h"
00030 // ============================================================================
00031 // G4 
00032 // ============================================================================
00033 #include "G4VUserPrimaryParticleInformation.hh"
00034 #include "G4ios.hh"
00035 // ============================================================================
00036 // Event
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 // The END 
00171 // ============================================================================
00172 #endif // GIGACNV_GIGAPRIMARYPARTICLEINFORMATION_H
00173 // ============================================================================
00174 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:03:52 2011 for GiGaCnv by doxygen 1.4.7