Geant4
v4-10.4-release
메인 페이지
관련된 페이지
모듈
네임스페이스
클래스
파일들
파일 목록
파일 멤버
모두
클래스
네임스페이스들
파일들
함수
변수
타입정의
열거형 타입
열거형 멤버
Friends
매크로
그룹들
페이지들
examples
extended
eventgenerator
particleGun
src
examples/extended/eventgenerator/particleGun/src/PrimaryGeneratorAction.cc
이 파일의 문서화 페이지로 가기
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
//
28
//
29
//
30
// $Id: PrimaryGeneratorAction.cc 98304 2016-07-05 15:29:08Z gcosmo $
31
//
32
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34
35
#include "PrimaryGeneratorAction.hh"
36
#include "
PrimaryGeneratorAction0.hh
"
37
#include "
PrimaryGeneratorAction1.hh
"
38
#include "
PrimaryGeneratorAction2.hh
"
39
#include "
PrimaryGeneratorAction3.hh
"
40
#include "
PrimaryGeneratorAction4.hh
"
41
#include "PrimaryGeneratorMessenger.hh"
42
43
#include "
G4Event.hh
"
44
#include "
G4ParticleGun.hh
"
45
#include "
G4ParticleTable.hh
"
46
#include "
G4ParticleDefinition.hh
"
47
#include "
Randomize.hh
"
48
49
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50
51
PrimaryGeneratorAction::PrimaryGeneratorAction
()
52
:
G4VUserPrimaryGeneratorAction
(),
53
fParticleGun(0),
54
fAction0(0),
55
fAction1(0),
56
fAction2(0),
57
fAction3(0),
58
fAction4(0),
59
fSelectedAction(0),
60
fGunMessenger(0)
61
{
62
// default particle kinematic
63
//
64
G4int
n_particle = 1;
65
fParticleGun
=
new
G4ParticleGun
(n_particle);
66
67
G4ParticleDefinition
* particle
68
=
G4ParticleTable::GetParticleTable
()->
FindParticle
(
"geantino"
);
69
fParticleGun
->
SetParticleDefinition
(particle);
70
71
fParticleGun
->
SetParticlePosition
(
G4ThreeVector
(0., 0., 0.));
72
73
fAction0
=
new
PrimaryGeneratorAction0
(
fParticleGun
);
74
fAction1
=
new
PrimaryGeneratorAction1
(
fParticleGun
);
75
fAction2
=
new
PrimaryGeneratorAction2
(
fParticleGun
);
76
fAction3
=
new
PrimaryGeneratorAction3
(
fParticleGun
);
77
fAction4
=
new
PrimaryGeneratorAction4
(
fParticleGun
);
78
79
//create a messenger for this class
80
fGunMessenger
=
new
PrimaryGeneratorMessenger
(
this
);
81
}
82
83
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84
85
PrimaryGeneratorAction::~PrimaryGeneratorAction
()
86
{
87
delete
fAction0
;
88
delete
fAction1
;
89
delete
fAction2
;
90
delete
fAction3
;
91
delete
fAction4
;
92
delete
fParticleGun
;
93
delete
fGunMessenger
;
94
}
95
96
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
97
98
void
PrimaryGeneratorAction::GeneratePrimaries
(
G4Event
* anEvent)
99
{
100
switch
(
fSelectedAction
)
101
{
102
case
0:
103
fAction0
->
GeneratePrimaries
(anEvent);
104
break
;
105
case
1:
106
fAction1
->
GeneratePrimaries
(anEvent);
107
break
;
108
case
2:
109
fAction2
->
GeneratePrimaries
(anEvent);
110
break
;
111
case
3:
112
fAction3
->
GeneratePrimaries
(anEvent);
113
break
;
114
case
4:
115
fAction4
->
GeneratePrimaries
(anEvent);
116
break
;
117
default
:
118
G4cerr
<<
"Invalid generator fAction"
<<
G4endl
;
119
}
120
}
121
122
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ParticleTable::FindParticle
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
Definition:
G4ParticleTable.cc:577
G4ParticleGun.hh
PrimaryGeneratorAction::fAction3
PrimaryGeneratorAction3 * fAction3
Definition:
examples/extended/eventgenerator/particleGun/include/PrimaryGeneratorAction.hh:80
G4ThreeVector
CLHEP::Hep3Vector G4ThreeVector
Definition:
G4ThreeVector.hh:42
G4ParticleTable::GetParticleTable
static G4ParticleTable * GetParticleTable()
Definition:
G4ParticleTable.cc:105
Randomize.hh
G4ParticleGun
Definition:
G4ParticleGun.hh:62
PrimaryGeneratorAction4.hh
Definition of the PrimaryGeneratorAction4 class.
PrimaryGeneratorAction::fAction0
PrimaryGeneratorAction0 * fAction0
Definition:
examples/extended/eventgenerator/particleGun/include/PrimaryGeneratorAction.hh:77
G4endl
#define G4endl
Definition:
G4ios.hh:61
PrimaryGeneratorAction1.hh
Definition of the PrimaryGeneratorAction1 class.
PrimaryGeneratorAction1::GeneratePrimaries
void GeneratePrimaries(G4Event *)
Definition:
PrimaryGeneratorAction1.cc:59
PrimaryGeneratorAction::fSelectedAction
G4int fSelectedAction
Definition:
examples/extended/eventgenerator/particleGun/include/PrimaryGeneratorAction.hh:82
G4VPrimaryGenerator::SetParticlePosition
void SetParticlePosition(G4ThreeVector aPosition)
Definition:
G4VPrimaryGenerator.hh:69
PrimaryGeneratorAction0
Definition:
PrimaryGeneratorAction0.hh:46
G4Event.hh
PrimaryGeneratorAction4::GeneratePrimaries
void GeneratePrimaries(G4Event *)
Definition:
PrimaryGeneratorAction4.cc:73
PrimaryGeneratorAction::fAction2
PrimaryGeneratorAction2 * fAction2
Definition:
examples/extended/eventgenerator/particleGun/include/PrimaryGeneratorAction.hh:79
PrimaryGeneratorAction2::GeneratePrimaries
void GeneratePrimaries(G4Event *)
Definition:
PrimaryGeneratorAction2.cc:63
G4Event
Definition:
G4Event.hh:52
PrimaryGeneratorAction::fAction1
PrimaryGeneratorAction1 * fAction1
Definition:
examples/extended/eventgenerator/particleGun/include/PrimaryGeneratorAction.hh:78
G4ParticleGun::SetParticleDefinition
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
Definition:
G4ParticleGun.cc:102
PrimaryGeneratorAction3::GeneratePrimaries
void GeneratePrimaries(G4Event *)
Definition:
PrimaryGeneratorAction3.cc:68
G4VUserPrimaryGeneratorAction
Definition:
G4VUserPrimaryGeneratorAction.hh:48
PrimaryGeneratorAction0::GeneratePrimaries
void GeneratePrimaries(G4Event *)
Definition:
PrimaryGeneratorAction0.cc:66
G4ParticleDefinition
Definition:
G4ParticleDefinition.hh:73
G4ParticleTable.hh
PrimaryGeneratorAction2.hh
Definition of the PrimaryGeneratorAction2 class.
PrimaryGeneratorAction::PrimaryGeneratorAction
PrimaryGeneratorAction()
Definition:
examples/advanced/microbeam/src/PrimaryGeneratorAction.cc:44
G4cerr
G4GLOB_DLL std::ostream G4cerr
PrimaryGeneratorMessenger
Definition:
advanced/amsEcal/include/PrimaryGeneratorMessenger.hh:44
PrimaryGeneratorAction1
Definition:
PrimaryGeneratorAction1.hh:46
PrimaryGeneratorAction::fGunMessenger
PrimaryGeneratorMessenger * fGunMessenger
Definition:
examples/advanced/nanobeam/include/PrimaryGeneratorAction.hh:72
PrimaryGeneratorAction3
Definition:
PrimaryGeneratorAction3.hh:47
G4int
int G4int
Definition:
G4Types.hh:78
PrimaryGeneratorAction3.hh
Definition of the PrimaryGeneratorAction3 class.
PrimaryGeneratorAction0.hh
Definition of the PrimaryGeneratorAction0 class.
G4ParticleDefinition.hh
PrimaryGeneratorAction::fParticleGun
G4ParticleGun * fParticleGun
Definition:
examples/advanced/microbeam/include/PrimaryGeneratorAction.hh:54
PrimaryGeneratorAction::GeneratePrimaries
void GeneratePrimaries(G4Event *)
Definition:
environments/g4py/examples/demos/TestEm0/module/PrimaryGeneratorAction.cc:74
PrimaryGeneratorAction::fAction4
PrimaryGeneratorAction4 * fAction4
Definition:
examples/extended/eventgenerator/particleGun/include/PrimaryGeneratorAction.hh:81
PrimaryGeneratorAction2
Definition:
PrimaryGeneratorAction2.hh:47
PrimaryGeneratorAction4
Definition:
PrimaryGeneratorAction4.hh:47
PrimaryGeneratorAction::~PrimaryGeneratorAction
~PrimaryGeneratorAction()
Definition:
environments/g4py/examples/demos/TestEm0/module/PrimaryGeneratorAction.cc:54
다음에 의해 생성됨 :
1.8.5