Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE06RunAction.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 /// \file RE06/src/RE06RunAction.cc
27 /// \brief Implementation of the RE06RunAction class
28 //
29 // $Id: RE06RunAction.cc 77498 2013-11-25 10:26:36Z gcosmo $
30 //
31 
32 #include "RE06RunAction.hh"
33 #include "RE06Run.hh"
34 
35 #include "G4RegionStore.hh"
36 #include "G4Region.hh"
37 #include "G4ProductionCuts.hh"
38 #include "G4ios.hh"
39 #include "G4UnitsTable.hh"
40 
41 #include "G4VSteppingVerbose.hh"
42 #include "RE06SteppingVerbose.hh"
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
47  : G4UserRunAction()
48 {;}
49 
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
51 
53 {;}
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 
58 { return new RE06Run; }
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
61 
63 {
66 
67  sv->InitializeTimers();
68 
69 }
70 
71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72 
74 {
75  static G4String regName[3] = {"Calor-A","Calor-B","Calor-C"};
76 
77  const RE06Run* theRun = (const RE06Run*)aRun;
78 
79  if(IsMaster()) {
80 
81  G4cout
82  << "############################################################" << G4endl;
83  G4cout
84  << " Run Summary - Number of events : " << theRun->GetNumberOfEvent()
85  << G4endl;
86  G4cout
87  << "############################################################" << G4endl;
88 
89  G4double nEvt = (G4double)(theRun->GetNumberOfEvent());
90  for(size_t i=0;i<3;i++)
91  {
92  size_t ih1 = 2*i;
93  size_t ih2 = 2*i+1;
94 
95  G4Region* region = G4RegionStore::GetInstance()->GetRegion(regName[i]);
96  G4ProductionCuts* cuts = region->GetProductionCuts();
97  G4cout << "Region : " << region->GetName() << G4endl;
98  G4cout << " Production thresholds :" << G4endl << " "
99  << " gamma " << G4BestUnit(cuts->GetProductionCut("gamma"),"Length")
100  << " e- " << G4BestUnit(cuts->GetProductionCut("e-"),"Length")
101  << " e+ " << G4BestUnit(cuts->GetProductionCut("e+"),"Length")
102  << G4endl;
103  G4cout << " Energy deposition in an event :" << G4endl << " "
104  << " Absorber " << G4BestUnit((theRun->GetTotalE(ih1))/nEvt,"Energy")
105  << " Gap " << G4BestUnit((theRun->GetTotalE(ih2))/nEvt,"Energy")
106  << G4endl;
107  G4cout << " Number of secondaries in an event :" << G4endl << " "
108  << " gamma in Absorber " << (theRun->GetNGamma(ih1))/nEvt
109  << " in Gap " << (theRun->GetNGamma(ih2))/nEvt << G4endl << " "
110  << " e- in Absorber " << (theRun->GetNElectron(ih1))/nEvt
111  << " in Gap " << (theRun->GetNElectron(ih2))/nEvt << G4endl << " "
112  << " e+ in Absorber " << (theRun->GetNPositron(ih1))/nEvt
113  << " in Gap " << (theRun->GetNPositron(ih2))/nEvt << G4endl;
114  G4cout << " Minimum kinetic energy of generated secondaries :" << G4endl
115  << " " << " gamma in Absorber "
116  << G4BestUnit(theRun->GetEMinGamma(ih1),"Energy")
117  << " in Gap " << G4BestUnit(theRun->GetEMinGamma(ih2),"Energy")
118  << G4endl << " "
119  << " e- in Absorber "
120  << G4BestUnit(theRun->GetEMinElectron(ih1),"Energy")
121  << " in Gap " << G4BestUnit(theRun->GetEMinElectron(ih2),"Energy")
122  << G4endl << " "
123  << " e+ in Absorber "
124  << G4BestUnit(theRun->GetEMinPositron(ih1),"Energy")
125  << " in Gap " << G4BestUnit(theRun->GetEMinPositron(ih2),"Energy")
126  << G4endl;
127  G4cout << " Total track length of e+/e- in an event :" << G4endl
128  << " "
129  << " Absorber " << G4BestUnit((theRun->GetTotalL(ih1))/nEvt,"Length")
130  << " Gap " << G4BestUnit((theRun->GetTotalL(ih2))/nEvt,"Length")
131  << G4endl;
132  G4cout << " Total number of steps of e+/e- in an event :" << G4endl
133  << " "
134  << " Absorber " << (theRun->GetNStep(ih1))/nEvt
135  << " Gap " << (theRun->GetNStep(ih2))/nEvt
136  << G4endl;
137  G4cout
138  << "------------------------------------------------------------"
139  << G4endl;
140  G4cout << "Scores in parallel geometry" << G4endl;
141  G4cout
142  << "layer eDep/evt nGamma/evt nElec/evt nPosi/evt stpLen/evt nStep/evt"
143  << G4endl;
144  for(size_t k=0;k<20;k++)
145  {
146  G4cout << std::setw(8) << k;
147  for(size_t j=0;j<6;j++) {
148  G4cout << " " << std::setw(10) << (theRun->GetParaValue(i,j,k))/nEvt;
149  }
150  G4cout << G4endl;
151  }
152  G4cout
153  << "############################################################"
154  << G4endl;
155  }
156  } else {
157 
158  G4cout << "CPU Time spent by each region" << G4endl;
161  sv->Report();
162 
163  }
164 }
165 
166 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ProductionCuts * GetProductionCuts() const
G4double GetNGamma(G4int i) const
Definition: RE06Run.hh:52
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
const G4String & GetName() const
Definition of the RE06SteppingVerbose class.
static G4VSteppingVerbose * GetInstance()
G4double GetEMinElectron(G4int i) const
Definition: RE06Run.hh:59
virtual void BeginOfRunAction(const G4Run *)
G4double GetNElectron(G4int i) const
Definition: RE06Run.hh:53
G4double GetNPositron(G4int i) const
Definition: RE06Run.hh:54
G4double GetProductionCut(G4int index) const
G4double GetNStep(G4int i) const
Definition: RE06Run.hh:56
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4double GetEMinPositron(G4int i) const
Definition: RE06Run.hh:60
static G4RegionStore * GetInstance()
G4GLOB_DLL std::ostream G4cout
virtual void EndOfRunAction(const G4Run *)
G4int GetNumberOfEvent() const
Definition: G4Run.hh:79
G4bool IsMaster() const
Definition: G4Run.hh:46
G4double GetParaValue(G4int i, G4int j, G4int k) const
Definition: RE06Run.hh:62
G4double GetTotalL(G4int i) const
Definition: RE06Run.hh:55
G4Run * GenerateRun()
G4double GetTotalE(G4int i) const
Definition: RE06Run.hh:51
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
Definition of the RE06Run class.
Definition of the RE06RunAction class.
G4double GetEMinGamma(G4int i) const
Definition: RE06Run.hh:58
virtual ~RE06RunAction()