Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
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"
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 
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
70 
72 
78 
79  //create a messenger for this class
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
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 
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......
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
CLHEP::Hep3Vector G4ThreeVector
static G4ParticleTable * GetParticleTable()
Definition of the PrimaryGeneratorAction4 class.
#define G4endl
Definition: G4ios.hh:61
Definition of the PrimaryGeneratorAction1 class.
void SetParticlePosition(G4ThreeVector aPosition)
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
Definition of the PrimaryGeneratorAction2 class.
G4GLOB_DLL std::ostream G4cerr
int G4int
Definition: G4Types.hh:78
Definition of the PrimaryGeneratorAction3 class.
Definition of the PrimaryGeneratorAction0 class.