Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // << 27 /// \file medical/GammaTherapy/include/Primary << 28 /// \brief Definition of the PrimaryGeneratorA << 29 // << 30 << 31 #ifndef PrimaryGeneratorAction_h 23 #ifndef PrimaryGeneratorAction_h 32 #define PrimaryGeneratorAction_h 1 24 #define PrimaryGeneratorAction_h 1 33 25 34 //-------------------------------------------- 26 //--------------------------------------------------------------------------- 35 // 27 // 36 // ClassName: PrimaryGeneratorAction 28 // ClassName: PrimaryGeneratorAction 37 // 29 // 38 // Description: Generate primary beam 30 // Description: Generate primary beam 39 // 31 // 40 // Authors: V.Grichine, V.Ivanchenko 32 // Authors: V.Grichine, V.Ivanchenko 41 // 33 // 42 // Modified: 34 // Modified: 43 // 35 // 44 //-------------------------------------------- 36 //---------------------------------------------------------------------------- 45 // 37 // 46 38 47 //....oooOO0OOooo........oooOO0OOooo........oo 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 48 //....oooOO0OOooo........oooOO0OOooo........oo 40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 49 41 50 #include "G4Event.hh" 42 #include "G4Event.hh" 51 #include "G4ParticleGun.hh" 43 #include "G4ParticleGun.hh" 52 #include "G4ThreeVector.hh" << 53 #include "G4VUserPrimaryGeneratorAction.hh" 44 #include "G4VUserPrimaryGeneratorAction.hh" >> 45 #include "G4ThreeVector.hh" 54 #include "globals.hh" 46 #include "globals.hh" 55 47 56 //....oooOO0OOooo........oooOO0OOooo........oo 48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 57 49 58 class PrimaryGeneratorMessenger; 50 class PrimaryGeneratorMessenger; 59 class DetectorConstruction; 51 class DetectorConstruction; 60 52 61 class PrimaryGeneratorAction : public G4VUserP 53 class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction 62 { 54 { 63 public: << 55 public: 64 // The constructor defines a ParticleGun o << 56 65 // shooting a beam of particles through th << 57 // The constructor defines a ParticleGun object, which allows 66 PrimaryGeneratorAction(DetectorConstructio << 58 // shooting a beam of particles through the experimental set-up. 67 << 59 PrimaryGeneratorAction(DetectorConstruction* pDet); 68 // The destructor. It deletes the Particle << 60 69 virtual ~PrimaryGeneratorAction(); << 61 //The destructor. It deletes the ParticleGun. 70 << 62 ~PrimaryGeneratorAction(); 71 // It reads the parameters of the primary << 63 72 // Generates the primary event via the Par << 64 public: 73 void GeneratePrimaries(G4Event* anEvent); << 65 74 << 66 //It reads the parameters of the primary particles. 75 // Get/Set methods << 67 //Generates the primary event via the ParticleGun method. 76 void SetBeamEnergy(G4double val); << 68 void GeneratePrimaries(G4Event* anEvent); 77 << 69 78 inline void SetBeamSigmaE(G4double val) { << 70 //Get/Set methods 79 inline void SetBeamX(G4double val) { fX0 = << 71 void SetBeamX(G4double val) {x0 = val;}; 80 inline void SetBeamY(G4double val) { fY0 = << 72 void SetBeamY(G4double val) {y0 = val;}; 81 inline void SetBeamZ(G4double val) { fZ0 = << 73 void SetBeamZ(G4double val) {z0 = val;}; 82 inline void SetBeamSigmaX(G4double val) { << 74 void SetBeamSigmaX(G4double val) {sigmaX = val;}; 83 inline void SetBeamSigmaY(G4double val) { << 75 void SetBeamSigmaY(G4double val) {sigmaY = val;}; 84 inline void SetBeamSigmaZ(G4double val) { << 76 void SetBeamSigmaZ(G4double val) {sigmaY = val;}; 85 inline void SetBeamMinCosTheta(G4double va << 77 void SetBeamSigmaE(G4double val); 86 inline void SetSigmaTheta(G4double val) { << 78 void SetBeamEnergy(G4double val); 87 inline void SetVerbose(G4int val) { fVerbo << 79 void SetBeamMinCosTheta(G4double val) {minCosTheta = val;}; 88 inline void SetRandom(const G4String& type << 80 void SetSigmaTheta(G4double val) {sigmaTheta = val;}; 89 << 81 void SetVerbose(G4int val) {verbose = val;}; 90 G4bool GetVerbose() const { return fVerbos << 82 G4ThreeVector GetBeamPosition() const {return position;}; 91 << 83 G4ThreeVector GetBeamDirection() const {return direction;}; 92 private: << 84 G4ThreeVector GetBeamEnergy() const {return energy;}; 93 void InitializeMe(); << 85 void SetRandom(const G4String& type) {m_gauss = type;}; 94 << 86 95 PrimaryGeneratorAction& operator=(const Pr << 87 private: 96 PrimaryGeneratorAction(const PrimaryGenera << 88 97 << 89 void InitializeMe(); 98 G4int fVerbose; << 90 99 PrimaryGeneratorMessenger* fMessenger; << 91 G4ParticleGun* particleGun; 100 G4ParticleGun* fParticleGun; << 92 PrimaryGeneratorMessenger* theMessenger; 101 DetectorConstruction* fDetector; << 93 102 << 94 DetectorConstruction* fDetector; 103 G4int fCounter; << 95 104 G4double fX0, fY0, fZ0; << 96 G4int counter; 105 G4double fSigmaX, fSigmaY, fSigmaZ; << 97 G4int verbose; 106 G4double fRMax2; << 98 G4double x0, y0, z0; 107 G4double fSigmaE; << 99 G4double sigmaX, sigmaY, sigmaZ; 108 G4double fSigmaTheta; << 100 G4double rMax2; 109 G4double fEnergy; << 101 G4double sigmaE; 110 G4double fMinCosTheta; << 102 G4double sigmaTheta; 111 G4ThreeVector fPosition; << 103 G4double energy; 112 G4ThreeVector fDirection; << 104 G4double minCosTheta; 113 G4String fGauss; << 105 G4ThreeVector position; >> 106 G4ThreeVector direction; >> 107 G4String m_gauss; 114 }; 108 }; 115 109 116 //....oooOO0OOooo........oooOO0OOooo........oo 110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 117 111 118 #endif 112 #endif >> 113 >> 114 >> 115 >> 116 >> 117 >> 118 119 119