00001 //! \file 00002 //! 00003 //! Header file for Generator class used for defining the OLYMPUS 00004 //! event generator. 00005 //! 00006 //! This defines the Generator class and the member routines which 00007 //! generate the primary events. 00008 //! 00009 //! \author D.K. Hasell 00010 //! \version 1.0 00011 //! \date 2010-10-14 00012 //! 00013 //! \ingroup event 00014 00015 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+**** 00016 00017 #ifndef GENERATOR_H 00018 #define GENERATOR_H 00019 00020 // Include the GEANT4 header files referenced here. 00021 00022 #include "G4VUserPrimaryGeneratorAction.hh" 00023 #include "G4ThreeVector.hh" 00024 00025 // Declare the classes referenced here. 00026 00027 class G4Event; 00028 class G4ParticleGun; 00029 00030 class ep_Kinematics; 00031 00032 //! Generator class. 00033 00034 class Generator : public G4VUserPrimaryGeneratorAction { 00035 00036 public: 00037 00038 //! Constructor. 00039 00040 Generator(); 00041 00042 //! Destructor. 00043 00044 ~Generator(); 00045 00046 // Member functions. 00047 00048 //! Generate the requested primary particles. 00049 00050 void GeneratePrimaries( G4Event * event ); 00051 00052 //! Return a location in the target following a triangular distribution. 00053 00054 G4ThreeVector Target_Distribution(); 00055 00056 //! Set/Get beam kinetic energy. 00057 00058 G4double setEbeam( G4double ); 00059 G4double getEbeam(); 00060 00061 //! Set/Get beam charge. 00062 00063 G4int setBeamCharge( G4int ); 00064 G4int getBeamCharge(); 00065 00066 //! Set/Get ep Theta min. 00067 00068 G4double setepThetaMin( G4double ); 00069 G4double getepThetaMin(); 00070 00071 //! Set/Get ep Theta max. 00072 00073 G4double setepThetaMax( G4double ); 00074 G4double getepThetaMax(); 00075 00076 //! Set/Get ep Phi min. 00077 00078 G4double setepPhiMin( G4double ); 00079 G4double getepPhiMin(); 00080 00081 //! Set/Get ep Phi max. 00082 00083 G4double setepPhiMax( G4double ); 00084 G4double getepPhiMax(); 00085 00086 //! Print 00087 00088 void Print(); 00089 00090 private: 00091 00092 G4ParticleGun * particleGun; 00093 00094 G4double Ebeam; 00095 G4int BeamCharge; 00096 00097 G4bool ep_Elastic; 00098 00099 ep_Kinematics * epKin; 00100 00101 G4double epTheta_Min; 00102 G4double epTheta_Max; 00103 G4double cos_epThMin; 00104 G4double cos_epThMax; 00105 G4double epPhi_Min; 00106 G4double epPhi_Max; 00107 00108 }; 00109 00110 //! Class for calculating ep elastic kinematics. 00111 00112 class ep_Kinematics { 00113 00114 public: 00115 00116 //! Constructors. 00117 00118 ep_Kinematics( G4double Ebeam ); 00119 00120 //! Destructor. 00121 00122 ~ep_Kinematics(); 00123 00124 //! Return kinematic variables as a function of electron scattering angle. 00125 00126 void for_e_angle( G4double theta3, G4double & E3, G4double & E4, 00127 G4double & Q2, G4double & theta4 ); 00128 00129 //! Print 00130 00131 void Print(); 00132 00133 // Data members. 00134 00135 private: 00136 00137 G4double E1; 00138 G4double p1; 00139 G4double beta; 00140 G4double E3cmbyG; 00141 00142 }; 00143 00144 //! Calculate the ep elastic cross section. 00145 00146 G4double epCrossSection( const G4double & E, const G4double & theta3, 00147 const G4double & Ep, const G4double & Q2 ); 00148 00149 #endif