Geant4
10.01.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ExExChUserActionInitialization.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
27
#ifdef G4MULTITHREADED
28
#include "
ExExChUserActionInitialization.hh
"
29
#include "
ExExChPrimaryGeneratorAction.hh
"
30
#include "
ExExChTrackingAction.hh
"
31
#include "
ExExChStackingAction.hh
"
32
#include "
ExExChEventAction.hh
"
33
#include "
ExExChRunAction.hh
"
34
#include "
G4GeneralParticleSource.hh
"
35
#include "
G4ParticleTable.hh
"
36
37
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
38
ExExChUserActionInitialization::ExExChUserActionInitialization() {
39
//GPS is special: it is thread-private,
40
//but underlying parameters and objects governing
41
//the distributions are shared among threads.
42
//We need to be sure that the defaults are set only once by master
43
masterGPS =
new
G4GeneralParticleSource
();
44
masterGPS->SetParticleDefinition(
G4ParticleTable
::
45
GetParticleTable()->FindParticle(
"proton"
));
46
47
// Position distribution
48
G4SPSPosDistribution
*vPosDist =
49
masterGPS->GetCurrentSource()->GetPosDist();
50
vPosDist->
SetPosDisType
(
"Beam"
);
51
vPosDist->
SetPosDisShape
(
"Circle"
);
52
vPosDist->
SetCentreCoords
(
G4ThreeVector
(0.,0.,-1.05 *
CLHEP::meter
));
53
vPosDist->
SetBeamSigmaInR
(0.0 *
CLHEP::mm
);
54
55
// Angular distribution
56
G4SPSAngDistribution
*vAngDist =
57
masterGPS->GetCurrentSource()->GetAngDist();
58
vAngDist->
DefineAngRefAxes
(
"angref1"
,
G4ThreeVector
(1.,0.,0));
59
vAngDist->
DefineAngRefAxes
(
"angref2"
,
G4ThreeVector
(0.,-1.,0));
60
vAngDist->
SetAngDistType
(
"beam2d"
);
61
vAngDist->
SetBeamSigmaInAngX
(13.36E-6 *
CLHEP::rad
);
62
vAngDist->
SetBeamSigmaInAngY
(11.25E-6 *
CLHEP::rad
);
63
64
// Energy distribution
65
G4SPSEneDistribution
*vEneDist =
66
masterGPS->GetCurrentSource()->GetEneDist();
67
vEneDist->
SetEnergyDisType
(
"Mono"
);
68
vEneDist->
SetMonoEnergy
(400. *
CLHEP::GeV
);
69
70
}
71
72
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73
74
ExExChUserActionInitialization::~ExExChUserActionInitialization() {
75
delete
masterGPS;
76
}
77
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78
79
void
ExExChUserActionInitialization::Build()
const
{
80
SetUserAction(
new
ExExChPrimaryGeneratorAction
());
81
SetUserAction(
new
ExExChEventAction
());
82
SetUserAction(
new
ExExChStackingAction
());
83
SetUserAction(
new
ExExChTrackingAction
());
84
SetUserAction(
new
ExExChRunAction
());
85
}
86
87
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
88
89
void
ExExChUserActionInitialization::BuildForMaster()
const
{
90
}
91
92
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
93
#endif
G4SPSPosDistribution::SetPosDisType
void SetPosDisType(G4String)
Important: This is a shared class between threads.
Definition:
G4SPSPosDistribution.cc:97
G4ThreeVector
CLHEP::Hep3Vector G4ThreeVector
Definition:
G4ThreeVector.hh:42
ExExChStackingAction
Definition:
ExExChStackingAction.hh:40
ExExChEventAction
Definition:
ExExChEventAction.hh:38
G4SPSEneDistribution
Andrea Dotti Feb 2015 Important: This is a shared class between threads.
Definition:
G4SPSEneDistribution.hh:171
G4SPSPosDistribution
Andrea Dotti Feb 2015 Important: This is a shared class between threads.
Definition:
G4SPSPosDistribution.hh:156
G4GeneralParticleSource
Andrea Dotti Feb 2015 GPS messenger design requires some explanation for what distributions parameter...
Definition:
G4GeneralParticleSource.hh:179
G4SPSAngDistribution::SetBeamSigmaInAngY
void SetBeamSigmaInAngY(G4double)
Definition:
G4SPSAngDistribution.cc:165
G4SPSAngDistribution
Andrea Dotti Feb 2015 Important: This is a shared class between threads.
Definition:
G4SPSAngDistribution.hh:174
ExExChTrackingAction
Definition:
ExExChTrackingAction.hh:33
G4SPSPosDistribution::SetCentreCoords
void SetCentreCoords(G4ThreeVector)
Definition:
G4SPSPosDistribution.cc:107
G4SPSEneDistribution::SetEnergyDisType
void SetEnergyDisType(G4String)
Definition:
G4SPSEneDistribution.cc:148
G4SPSPosDistribution::SetBeamSigmaInR
void SetBeamSigmaInR(G4double)
Definition:
G4SPSPosDistribution.cc:160
G4ParticleTable.hh
meter
static const double meter
Definition:
G4SIunits.hh:72
ExExChTrackingAction.hh
G4ParticleTable
Definition:
G4ParticleTable.hh:65
G4SPSAngDistribution::DefineAngRefAxes
void DefineAngRefAxes(G4String, G4ThreeVector)
Definition:
G4SPSAngDistribution.cc:107
ExExChEventAction.hh
GeV
static const double GeV
Definition:
G4SIunits.hh:196
G4SPSPosDistribution::SetPosDisShape
void SetPosDisShape(G4String)
Definition:
G4SPSPosDistribution.cc:102
rad
static const double rad
Definition:
G4SIunits.hh:130
ExExChPrimaryGeneratorAction.hh
G4SPSAngDistribution::SetAngDistType
void SetAngDistType(G4String)
Definition:
G4SPSAngDistribution.cc:90
ExExChUserActionInitialization.hh
G4GeneralParticleSource.hh
ExExChRunAction.hh
mm
static const double mm
Definition:
G4SIunits.hh:102
G4SPSEneDistribution::SetMonoEnergy
void SetMonoEnergy(G4double)
Definition:
G4SPSEneDistribution.cc:210
ExExChStackingAction.hh
ExExChPrimaryGeneratorAction
Definition:
ExExChPrimaryGeneratorAction.hh:40
G4SPSAngDistribution::SetBeamSigmaInAngX
void SetBeamSigmaInAngX(G4double)
Definition:
G4SPSAngDistribution.cc:159
ExExChRunAction
Definition:
ExExChRunAction.hh:35
geant4.10.01.p02
examples
extended
exoticphysics
channeling
src
ExExChUserActionInitialization.cc
Generated on Wed Dec 30 2015 22:37:23 for Geant4 by
1.8.8