source: trunk/examples/extended/medical/GammaTherapy/include/PrimaryGeneratorAction.hh @ 1013

Last change on this file since 1013 was 807, checked in by garnier, 16 years ago

update

File size: 4.2 KB
Line 
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#ifndef PrimaryGeneratorAction_h
27#define PrimaryGeneratorAction_h 1
28
29//---------------------------------------------------------------------------
30//
31// ClassName:   PrimaryGeneratorAction
32//
33// Description: Generate primary beam
34//
35// Authors: V.Grichine, V.Ivanchenko
36//
37// Modified:
38//
39//----------------------------------------------------------------------------
40//
41
42//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
44
45#include "G4Event.hh"
46#include "G4ParticleGun.hh"
47#include "G4VUserPrimaryGeneratorAction.hh"
48#include "G4ThreeVector.hh"
49#include "globals.hh"
50
51//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
52
53class PrimaryGeneratorMessenger;
54class DetectorConstruction;
55
56class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
57{
58public:
59
60  // The constructor defines a ParticleGun object, which allows
61  // shooting a beam of particles through the experimental set-up.
62  PrimaryGeneratorAction(DetectorConstruction* pDet);
63
64  //The destructor. It deletes the ParticleGun.
65  ~PrimaryGeneratorAction();
66
67public:
68
69  //It reads the parameters of the primary particles.
70  //Generates the primary event via the ParticleGun method.
71  void GeneratePrimaries(G4Event* anEvent);
72
73  //Get/Set methods
74  void SetBeamX(G4double val) {x0 = val;};
75  void SetBeamY(G4double val) {y0 = val;};
76  void SetBeamZ(G4double val) {z0 = val;};
77  void SetBeamSigmaX(G4double val) {sigmaX = val;};
78  void SetBeamSigmaY(G4double val) {sigmaY = val;};
79  void SetBeamSigmaZ(G4double val) {sigmaY = val;};
80  void SetBeamSigmaE(G4double val);
81  void SetBeamEnergy(G4double val);
82  void SetBeamMinCosTheta(G4double val) {minCosTheta = val;};
83  void SetSigmaTheta(G4double val) {sigmaTheta = val;};
84  void SetVerbose(G4int val) {verbose = val;};
85  G4ThreeVector GetBeamPosition() const {return position;};
86  G4ThreeVector GetBeamDirection() const {return direction;};
87  G4ThreeVector GetBeamEnergy() const {return energy;};
88  void SetRandom(const G4String& type) {m_gauss = type;};
89
90private:
91
92  void InitializeMe();
93
94  G4ParticleGun* particleGun;
95  PrimaryGeneratorMessenger* theMessenger;
96
97  DetectorConstruction* fDetector;
98
99  G4int counter;
100  G4int verbose;
101  G4double x0, y0, z0;
102  G4double sigmaX, sigmaY, sigmaZ;
103  G4double rMax2;
104  G4double sigmaE;
105  G4double sigmaTheta;
106  G4double energy;
107  G4double minCosTheta;
108  G4ThreeVector position;
109  G4ThreeVector direction;
110  G4String m_gauss;
111};
112
113//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
114
115#endif
116
117
118
119
120
121
Note: See TracBrowser for help on using the repository browser.