Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-27 07:02:49

0001 // ********************************************************************
0002 //
0003 // eASTPrimaryGeneratorAction.hh
0004 //   Header file of primary generator action class
0005 //
0006 // History
0007 //  May 8th, 2021 : first implementation - Makoto Asai (SLAC)
0008 //  June 23rd, 2021 : Add eASTHepMC3Interface - Makoto Asai (SLAC)
0009 //  December 28th, 2021 : Add event start time - Makoto Asai (JLab)
0010 //
0011 // ********************************************************************
0012 
0013 #ifndef eASTPrimaryGeneratorAction_h
0014 #define eASTPrimaryGeneratorAction_h 1
0015 
0016 #include "G4VUserPrimaryGeneratorAction.hh"
0017 #include "globals.hh"
0018 
0019 class G4ParticleGun;
0020 class G4GeneralParticleSource;
0021 class G4Event;
0022 
0023 #ifdef eAST_USE_HepMC3
0024 class eASTHepMC3Interface;
0025 #endif // eAST_USE_HepMC3
0026 
0027 class eASTPrimGenActionMessenger;
0028 
0029 class eASTPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
0030 {
0031   public:
0032     eASTPrimaryGeneratorAction(G4bool,G4bool,G4bool);
0033     virtual ~eASTPrimaryGeneratorAction();
0034     
0035     virtual void GeneratePrimaries(G4Event*);
0036  
0037   private:
0038     G4ParticleGun* fParticleGun = nullptr;
0039     G4GeneralParticleSource* fParticleSource = nullptr;
0040 #ifdef eAST_USE_HepMC3
0041     eASTHepMC3Interface* fHepMC3Interface = nullptr;
0042 #endif // eAST_USE_HepMC3
0043 
0044     eASTPrimGenActionMessenger* messenger = nullptr;
0045 
0046   public:
0047     // Event start time is set to (deltaT * eventID + T0)
0048     void SetT(G4double dt, G4double t0)
0049     {
0050       deltaT = dt;
0051       T0 = t0;
0052     }
0053     void GetT(G4double& dt, G4double& t0)
0054     {
0055       dt = deltaT;
0056       t0 = T0;
0057     }
0058 
0059   private:
0060     G4double deltaT = 0.0;
0061     G4double T0 = 0.0;
0062 };
0063 
0064 #endif