Geant4
10.03
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
RunAction.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
//
28
//
29
// $Id: RunAction.cc 98279 2016-07-04 18:03:33Z gcosmo $
30
//
31
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33
34
#include "RunAction.hh"
35
#include "DetectorConstruction.hh"
36
#include "PrimaryGeneratorAction.hh"
37
#include "Run.hh"
38
39
#include "
G4Run.hh
"
40
#include "
G4RunManager.hh
"
41
#include "
G4UnitsTable.hh
"
42
43
#include "
Randomize.hh
"
44
#include <iomanip>
45
46
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47
48
RunAction::RunAction
(
DetectorConstruction
* det,
PrimaryGeneratorAction
* kin)
49
:
G4UserRunAction
(),fDetector(det),fPrimary(kin),fRun(0)
50
{ }
51
52
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53
54
RunAction::~RunAction
()
55
{ }
56
57
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58
59
G4Run
*
RunAction::GenerateRun
()
60
{
61
fRun
=
new
Run
(
fDetector
);
62
return
fRun
;
63
}
64
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65
66
void
RunAction::BeginOfRunAction
(
const
G4Run
*)
67
{
68
// save Rndm status
70
if
(
isMaster
) G4Random::showEngineStatus();
71
72
// keep run condition
73
if
(
fPrimary
) {
74
G4ParticleDefinition
* particle
75
=
fPrimary
->
GetParticleGun
()->
GetParticleDefinition
();
76
G4double
energy
=
fPrimary
->
GetParticleGun
()->
GetParticleEnergy
();
77
fRun
->
SetPrimary
(particle, energy);
78
}
79
}
80
81
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82
83
void
RunAction::EndOfRunAction
(
const
G4Run
*)
84
{
85
// compute and print statistic
86
if
(
isMaster
)
fRun
->
EndOfRun
();
87
88
// show Rndm status
89
if
(
isMaster
) G4Random::showEngineStatus();
90
}
91
92
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::RunAction
RunAction()
Definition:
RunAction.cc:42
PrimaryGeneratorAction
The primary generator action class with particle gun.
Definition:
PrimaryGeneratorAction.hh:43
RunAction::BeginOfRunAction
void BeginOfRunAction(const G4Run *)
Definition:
RunAction.cc:57
G4RunManager.hh
G4UnitsTable.hh
RunAction::GenerateRun
virtual G4Run * GenerateRun()
Definition:
RunAction.cc:66
G4ParticleDefinition
Definition:
G4ParticleDefinition.hh:72
RunAction::fDetector
DetectorConstruction * fDetector
Definition:
RunAction.hh:63
RunAction::EndOfRunAction
void EndOfRunAction(const G4Run *)
Definition:
RunAction.cc:260
G4Run
Definition:
G4Run.hh:46
Randomize.hh
RunAction::~RunAction
~RunAction()
Definition:
RunAction.cc:52
G4UserRunAction::isMaster
G4bool isMaster
Definition:
G4UserRunAction.hh:64
PrimaryGeneratorAction::GetParticleGun
G4ParticleGun * GetParticleGun()
Definition:
PrimaryGeneratorAction.hh:53
G4Run.hh
G4INCL::KinematicsUtils::energy
G4double energy(const ThreeVector &p, const G4double m)
Definition:
G4INCLKinematicsUtils.cc:157
G4ParticleGun::GetParticleDefinition
G4ParticleDefinition * GetParticleDefinition() const
Definition:
G4ParticleGun.hh:106
G4UserRunAction
Definition:
G4UserRunAction.hh:52
DetectorConstruction
Detector construction class to demonstrate various ways of placement.
Definition:
DetectorConstruction.hh:46
Run::EndOfRun
void EndOfRun()
Definition:
Run.cc:147
Run::SetPrimary
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
Definition:
Run.cc:77
G4double
double G4double
Definition:
G4Types.hh:76
Run
Definition:
Run.hh:46
G4ParticleGun::GetParticleEnergy
G4double GetParticleEnergy() const
Definition:
G4ParticleGun.hh:110
RunAction::fRun
Run * fRun
Definition:
RunAction.hh:65
RunAction::fPrimary
PrimaryGeneratorAction * fPrimary
Definition:
RunAction.hh:64
geant4.10.03
examples
extended
electromagnetic
TestEm13
src
RunAction.cc
Generated on Thu Feb 14 2002 02:27:22 for Geant4 by
1.8.8