Geant4  10.02.p03
G4HumanPhantomRunAction Class Reference

#include <G4HumanPhantomRunAction.hh>

Inheritance diagram for G4HumanPhantomRunAction:
Collaboration diagram for G4HumanPhantomRunAction:

Public Member Functions

 G4HumanPhantomRunAction (G4HumanPhantomAnalysisManager *analysis)
 
 ~G4HumanPhantomRunAction ()
 
void BeginOfRunAction (const G4Run *)
 
void EndOfRunAction (const G4Run *)
 
void Fill (G4String bodypartName, G4double energyDeposit)
 
- Public Member Functions inherited from G4UserRunAction
 G4UserRunAction ()
 
virtual ~G4UserRunAction ()
 
virtual G4RunGenerateRun ()
 
void SetMaster (G4bool val=true)
 
G4bool IsMaster () const
 

Private Member Functions

void totalRunEnergyDeposit ()
 

Private Attributes

std::map< std::string, G4doubleenergyTotal
 
G4String bodypartName
 

Additional Inherited Members

- Protected Attributes inherited from G4UserRunAction
G4bool isMaster
 

Detailed Description

Definition at line 38 of file G4HumanPhantomRunAction.hh.

Constructor & Destructor Documentation

◆ G4HumanPhantomRunAction()

G4HumanPhantomRunAction::G4HumanPhantomRunAction ( G4HumanPhantomAnalysisManager analysis)

Definition at line 48 of file G4HumanPhantomRunAction.cc.

49  {}

◆ ~G4HumanPhantomRunAction()

G4HumanPhantomRunAction::~G4HumanPhantomRunAction ( )

Definition at line 52 of file G4HumanPhantomRunAction.cc.

53 {
54 }

Member Function Documentation

◆ BeginOfRunAction()

void G4HumanPhantomRunAction::BeginOfRunAction ( const G4Run aRun)
virtual

Reimplemented from G4UserRunAction.

Definition at line 56 of file G4HumanPhantomRunAction.cc.

57 {
58  G4int run_number = aRun->GetRunID();
59  G4cout << "### Run " << run_number << " start." << G4endl;
60  energyTotal["logicalHead"]=0.;
61  energyTotal["logicalTrunk"]=0.;
62  energyTotal["logicalLeftLeg"]=0.;
63  energyTotal["logicalRightLeg"]=0.;
64  energyTotal["logicalSkull"]=0.;
65  energyTotal["logicalLeftArmBone"]=0.;
66  energyTotal["logicalRightArmBone"]=0.;
67  energyTotal["logicalUpperSpine"]=0.;
68  energyTotal["logicalMiddleLowerSpine"]=0.;
69  energyTotal["logicalPelvis"]=0.;
70  energyTotal["logicalRibCage"]=0.;
71  energyTotal["logicalLeftClavicle"]=0.;
72  energyTotal["logicalRightClavicle"]=0.;
73  energyTotal["logicalLeftLegBone"]=0.;
74  energyTotal["logicalRightLegBone"]=0.;
75  energyTotal["logicalLeftScapula"]=0.;
76  energyTotal["logicalRightScapula"]=0.;
77  energyTotal["logicalHeart"]=0.;
78  energyTotal["logicalThyroid"]=0.;
79  energyTotal["logicalThymus"]=0.;
80  energyTotal["logicalMaleGenitalia"]=0.;
81  energyTotal["logicalBrain"]=0.;
82  energyTotal["logicalStomach"]=0.;
83  energyTotal["logicalUpperLargeIntestine"]=0.;
84  energyTotal["logicalLowerLargeIntestine"]=0.;
85  energyTotal["logicalSmallIntestine"]=0;
86  energyTotal["logicalSpleen"]=0.;
87  energyTotal["logicalPancreas"]=0.;
88  energyTotal["logicalLeftKidney"]=0.;
89  energyTotal["logicalRightKidney"]=0.;
90  energyTotal["logicalUrinaryBladder"]=0.;
91  energyTotal["logicalUterus"]=0.;
92  energyTotal["logicalLeftLung"]=0.;
93  energyTotal["logicalRightLung"]=0.;
94  energyTotal["logicalLeftOvary"]=0.;
95  energyTotal["logicalRightOvary"]=0.;
96  energyTotal["logicalLeftTeste"]=0;
97  energyTotal["logicalRightTeste"]=0;
98  energyTotal["logicalLeftBreast"]=0.;
99  energyTotal["logicalRightBreast"]=0.;
100  energyTotal["logicalLeftAdrenal"]=0.;
101  energyTotal["logicalRightAdrenal"]=0.;
102 
103 #ifdef ANALYSIS_USE
104  // Create ROOT file, histograms and ntuple
105  analysisMan -> book();
106 #endif
107 }
std::map< std::string, G4double > energyTotal
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4int GetRunID() const
Definition: G4Run.hh:76
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

◆ EndOfRunAction()

void G4HumanPhantomRunAction::EndOfRunAction ( const G4Run aRun)
virtual

Reimplemented from G4UserRunAction.

Definition at line 109 of file G4HumanPhantomRunAction.cc.

110 {
111  G4cout << "Number of events = " << aRun->GetNumberOfEvent() << G4endl;
113 
114 #ifdef ANALYSIS_USE
115 // Close the output ROOT file with the results
116  analysisMan -> save();
117 #endif
118 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4int GetNumberOfEvent() const
Definition: G4Run.hh:79
Here is the call graph for this function:

◆ Fill()

void G4HumanPhantomRunAction::Fill ( G4String  bodypartName,
G4double  energyDeposit 
)

Definition at line 121 of file G4HumanPhantomRunAction.cc.

124 {
125  energyTotal[bName] += energyDeposit;
126 }
std::map< std::string, G4double > energyTotal
Here is the caller graph for this function:

◆ totalRunEnergyDeposit()

void G4HumanPhantomRunAction::totalRunEnergyDeposit ( )
private

Definition at line 128 of file G4HumanPhantomRunAction.cc.

129 {
130  std::map<std::string,G4double>::iterator i = energyTotal.begin();
131  std::map<std::string,G4double>::iterator end = energyTotal.end();
132 
133  G4double totalEnergyDepositInPhantom =0.;
134  G4int k=0;
135  while(i!=end)
136  {
137  G4String bodypart = i->first;
138  G4double energyDep = i->second;
139  // if(energyDep != 0.)
140  // {
141 
142  G4cout << "Energy Total in Run:" << bodypart << ", ID: " << k
143  << ", Energy Deposition (MeV): "
144  << energyDep/MeV
145  << G4endl;
146 
147 #ifdef ANALYSIS_USE
148  // Fill Ntuple
149  analysisMan -> FillNtupleWithEnergyDeposition(k, energyDep/MeV);
150 #endif
151  i++;
152  k++;
153 
154  totalEnergyDepositInPhantom += energyDep;
155  }
156 
157 
158  G4cout << "Total Energy deposit in the body is: "
159  << totalEnergyDepositInPhantom/MeV << " MeV" <<G4endl;
160 }
static const double MeV
Definition: G4SIunits.hh:211
G4int first(char) const
std::map< std::string, G4double > energyTotal
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

Member Data Documentation

◆ bodypartName

G4String G4HumanPhantomRunAction::bodypartName
private

Definition at line 51 of file G4HumanPhantomRunAction.hh.

◆ energyTotal

std::map<std::string,G4double> G4HumanPhantomRunAction::energyTotal
private

Definition at line 50 of file G4HumanPhantomRunAction.hh.


The documentation for this class was generated from the following files: