GEMC  1.8
Geant4 Monte-Carlo Framework
MPrimaryGeneratorAction.h
Go to the documentation of this file.
1 #ifndef MPrimaryGeneratorAction_h
2 #define MPrimaryGeneratorAction_h 1
3 
4 // %%%%%%%%%%
5 // G4 headers
6 // %%%%%%%%%%
7 #include "G4VUserPrimaryGeneratorAction.hh"
8 #include "G4ParticleGun.hh"
9 #include "G4Event.hh"
10 
11 // %%%%%%%%%%%%%
12 // gemc headers
13 // %%%%%%%%%%%%%
14 #include "usage.h"
15 
16 // %%%%%%%%%%%
17 // C++ headers
18 // %%%%%%%%%%%
19 #include <fstream>
20 
21 
22 // %%%%%%%%%%%%%%%%
23 // Class definition
24 // %%%%%%%%%%%%%%%%
26 {
27  public:
30 
31  public:
32  void GeneratePrimaries(G4Event* anEvent);
34  double GEN_VERBOSITY;
35  double getBeamPol() {return beamPol;}
36  double getTargetPol(){return targetPol;}
37 
38  private:
39  string input_gen;
40  string hd_msg;
41  G4ParticleTable* particleTable;
42 
43  // Primary Beam
44  G4ParticleDefinition *Particle;
45  double mom, dmom, Mom;
46  double theta, dtheta, Theta;
47  double phi, dphi, Phi;
48  double vx, vy, vz;
49  double dvr, dvz;
50  double Vx, Vy, Vz;
51  double polDeg, polTheta, polPhi;
52  G4ThreeVector beam_dir;
53  G4ThreeVector beam_vrt;
54  G4ThreeVector beam_pol;
55  double ctheta;
56  double cphi;
57 
58 
59  // Generators Input Files
60  ifstream gif;
61  string gformat;
62  string gfilename;
63  double targetPol, beamPol;
64 
66  // Luminosity Beam
67  G4ParticleDefinition *L_Particle;
68  double L_Mom;
69  double L_Theta;
70  double L_Phi;
71  double L_vx, L_vy, L_vz;
72  double L_dvr, L_dvz;
73  int NP;
74  double TWINDOW;
75  double TBUNCH;
76  G4ThreeVector L_beam_dir;
77  G4ThreeVector L_beam_vrt;
78 
79  // Luminosity Beam2
80  G4ParticleDefinition *L2_Particle;
81  double L2_Mom;
82  double L2_Theta;
83  double L2_Phi;
84  double L2_vx, L2_vy, L2_vz;
85  double L2_dvr, L2_dvz;
86  int NP2;
87  double TBUNCH2;
88  G4ThreeVector L2_beam_dir;
89  G4ThreeVector L2_beam_vrt;
90 
91  G4ParticleGun* particleGun;
92  void setBeam();
93 };
94 
95 #endif
96 
97 
void GeneratePrimaries(G4Event *anEvent)