Geant4  10.02
ML2PrimaryGenerationAction.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // The code was written by :
27 // ^Claudio Andenna claudio.andenna@ispesl.it, claudio.andenna@iss.infn.it
28 // *Barbara Caccia barbara.caccia@iss.it
29 // with the support of Pablo Cirrone (LNS, INFN Catania Italy)
30 // with the contribute of Alessandro Occhigrossi*
31 //
32 // ^INAIL DIPIA - ex ISPESL and INFN Roma, gruppo collegato Sanità, Italy
33 // *Istituto Superiore di Sanità and INFN Roma, gruppo collegato Sanità, Italy
34 // Viale Regina Elena 299, 00161 Roma (Italy)
35 // tel (39) 06 49902246
36 // fax (39) 06 49387075
37 //
38 // more information:
39 // http://g4advancedexamples.lngs.infn.it/Examples/medical-linac
40 //
41 //*******************************************************//
42 
43 #ifndef CML2PrimaryGenerationActionH
44 #define CML2PrimaryGenerationActionH
45 
46 
48 #include "G4ParticleTable.hh"
49 #include "G4ParticleGun.hh"
50 #include "G4Event.hh"
51 #include "G4Timer.hh"
52 #include "Randomize.hh"
53 #include "G4RunManager.hh"
54 
55 #include "G4ParticleDefinition.hh"
56 #include "ML2SinputData.hh"
57 #include "ML2SDWithParticle.hh"
58 #include "ML2SDWithVoxels.hh"
60 
61 class G4ParticleGun;
64 
66 {
67 public:
70 
73  void GeneratePrimaries(G4Event *anEvent);
75  inline void setNRecycling(G4int val){nRecycling=val;}
77  inline void setNMaxParticlesInRamPhaseSpace(G4int val){nMaxParticlesInRamPhaseSpace=val;std::cout<<"Current nMaxParticlesInRamPhaseSpace: " << nMaxParticlesInRamPhaseSpace<< G4endl;}
78 
79  inline void setGunMeanEnergy(G4double val){GunMeanEnegy=val;}
80  inline void setGunStdEnergy(G4double val){GunStdEnegy=val;}
81  inline void setGunRadious(G4double val){GunRadious=val;}
83  inline void setSourceTypeName(G4String val)
84  {
85  sourceTypeName=val;
86  if (sourceTypeName=="randomTarget")
87  {
89  }
90  else if (sourceTypeName=="phaseSpace")
91  {
93  }
94  }
95  inline void setRotation(G4RotationMatrix *val){rm=val;};
96  inline G4int getNrecycling(){return nRecycling;};
98 
99 private:
100  void setGunRandom();
102  void GenerateFromRandom();
104  void fillParticlesContainer();
105  void applySourceRotation();
106 
108 
112 
115 
119 
131 };
132 
133 #endif
idParticleSource
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
static CML2PrimaryGenerationAction * instance
int G4int
Definition: G4Types.hh:78
void design(G4double accTargetZPosition)
void inizialize(SPrimaryParticle *primaryParticleData)
void setCalculatedPhaseSpaceFileIN(G4String val)
void setRotation(G4RotationMatrix *val)
CML2PrimaryGenerationActionMessenger * PrimaryGenerationActionMessenger
static CML2PrimaryGenerationAction * GetInstance(void)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76