Geant4  10.02.p01
ExExChPrimaryGeneratorAction.cc
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 
28 
29 #include "G4RunManager.hh"
30 #include "G4Event.hh"
31 #include "G4ParticleTable.hh"
32 #include "G4ParticleDefinition.hh"
33 #include "Randomize.hh"
34 
36 
37 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
38 
40 {
42 
44  GetParticleTable()->FindParticle("proton"));
45 
46  // Position distribution
47  G4SPSPosDistribution *vPosDist =
49  vPosDist->SetPosDisType("Beam");
50  vPosDist->SetPosDisShape("Circle");
51  vPosDist->SetCentreCoords(G4ThreeVector(0.,0.,(- 10.5) * CLHEP::meter));
52  vPosDist->SetBeamSigmaInR(0.0 * CLHEP::mm);
53 
54  // Angular distribution
55  G4SPSAngDistribution *vAngDist =
57  vAngDist->DefineAngRefAxes("angref1",G4ThreeVector(1.,0.,0));
58  vAngDist->DefineAngRefAxes("angref2",G4ThreeVector(0.,-1.,0));
59  vAngDist->SetAngDistType("beam2d");
60  vAngDist->SetBeamSigmaInAngX(13.36E-6 * CLHEP::rad);
61  vAngDist->SetBeamSigmaInAngY(11.25E-6 * CLHEP::rad);
62 
63  // Energy distribution
64  G4SPSEneDistribution *vEneDist =
66  vEneDist->SetEnergyDisType("Mono");
67  vEneDist->SetMonoEnergy(400. * CLHEP::GeV);
68 }
69 
70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
71 
73  delete fParticleGun;
74 }
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
78 
79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
80 
83 }
84 
85 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
86 
G4SPSAngDistribution * GetAngDist() const
G4SPSEneDistribution * GetEneDist() const
G4SPSPosDistribution * GetPosDist() const
void SetPosDisType(G4String)
Important: This is a shared class between threads.
CLHEP::Hep3Vector G4ThreeVector
Andrea Dotti Feb 2015 Important: This is a shared class between threads.
Andrea Dotti Feb 2015 Important: This is a shared class between threads.
Andrea Dotti Feb 2015 GPS messenger design requires some explanation for what distributions parameter...
void SetBeamSigmaInAngY(G4double)
Andrea Dotti Feb 2015 Important: This is a shared class between threads.
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
void SetCentreCoords(G4ThreeVector)
static const double meter
Definition: G4SIunits.hh:81
void DefineAngRefAxes(G4String, G4ThreeVector)
static const double GeV
Definition: G4SIunits.hh:214
static const double rad
Definition: G4SIunits.hh:148
G4SingleParticleSource * GetCurrentSource() const
static const double mm
Definition: G4SIunits.hh:114
void SetBeamSigmaInAngX(G4double)