Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExN07RunAction.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 //
27 // $Id$
28 //
29 
30 #include "ExN07RunAction.hh"
31 #include "ExN07Run.hh"
32 
33 #include "G4RegionStore.hh"
34 #include "G4Region.hh"
35 #include "G4ProductionCuts.hh"
36 #include "G4ios.hh"
37 #include "G4UnitsTable.hh"
38 
39 #include "G4VSteppingVerbose.hh"
40 #include "ExN07SteppingVerbose.hh"
41 
43 {;}
44 
46 {;}
47 
49 { return new ExN07Run; }
50 
52 {
54  sv->InitializeTimers();
55 }
56 
58 {
59  static G4String regName[3] = {"Calor-A","Calor-B","Calor-C"};
60 
61  const ExN07Run* theRun = (const ExN07Run*)aRun;
62 
63  G4cout
64  << "############################################################" << G4endl;
65  G4cout
66  << " Run Summary - Number of events : " << theRun->GetNumberOfEvent()
67  << G4endl;
68  G4cout
69  << "############################################################" << G4endl;
70 
71  G4double nEvt = (G4double)(theRun->GetNumberOfEvent());
72  for(size_t i=0;i<3;i++)
73  {
74  size_t ih1 = 2*i;
75  size_t ih2 = 2*i+1;
76 
77  G4Region* region = G4RegionStore::GetInstance()->GetRegion(regName[i]);
78  G4ProductionCuts* cuts = region->GetProductionCuts();
79  G4cout << "Region : " << region->GetName() << G4endl;
80  G4cout << " Production thresholds :" << G4endl << " "
81  << " gamma " << G4BestUnit(cuts->GetProductionCut("gamma"),"Length")
82  << " e- " << G4BestUnit(cuts->GetProductionCut("e-"),"Length")
83  << " e+ " << G4BestUnit(cuts->GetProductionCut("e+"),"Length")
84  << G4endl;
85  G4cout << " Energy deposition in an event :" << G4endl << " "
86  << " Absorber " << G4BestUnit((theRun->GetTotalE(ih1))/nEvt,"Energy")
87  << " Gap " << G4BestUnit((theRun->GetTotalE(ih2))/nEvt,"Energy")
88  << G4endl;
89  G4cout << " Number of secondaries in an event :" << G4endl << " "
90  << " gamma in Absorber " << (theRun->GetNGamma(ih1))/nEvt
91  << " in Gap " << (theRun->GetNGamma(ih2))/nEvt << G4endl << " "
92  << " e- in Absorber " << (theRun->GetNElectron(ih1))/nEvt
93  << " in Gap " << (theRun->GetNElectron(ih2))/nEvt << G4endl << " "
94  << " e+ in Absorber " << (theRun->GetNPositron(ih1))/nEvt
95  << " in Gap " << (theRun->GetNPositron(ih2))/nEvt << G4endl;
96  G4cout << " Minimum kinetic energy of generated secondaries :" << G4endl << " "
97  << " gamma in Absorber " << G4BestUnit(theRun->GetEMinGamma(ih1),"Energy")
98  << " in Gap " << G4BestUnit(theRun->GetEMinGamma(ih2),"Energy")
99  << G4endl << " "
100  << " e- in Absorber " << G4BestUnit(theRun->GetEMinElectron(ih1),"Energy")
101  << " in Gap " << G4BestUnit(theRun->GetEMinElectron(ih2),"Energy")
102  << G4endl << " "
103  << " e+ in Absorber " << G4BestUnit(theRun->GetEMinPositron(ih1),"Energy")
104  << " in Gap " << G4BestUnit(theRun->GetEMinPositron(ih2),"Energy")
105  << G4endl;
106  G4cout << " Total track length of e+/e- in an event :" << G4endl << " "
107  << " Absorber " << G4BestUnit((theRun->GetTotalL(ih1))/nEvt,"Length")
108  << " Gap " << G4BestUnit((theRun->GetTotalL(ih2))/nEvt,"Length")
109  << G4endl;
110  G4cout << " Total number of steps of e+/e- in an event :" << G4endl << " "
111  << " Absorber " << (theRun->GetNStep(ih1))/nEvt
112  << " Gap " << (theRun->GetNStep(ih2))/nEvt
113  << G4endl;
114  G4cout
115  << "------------------------------------------------------------" << G4endl;
116  G4cout << "Scores in parallel geometry" << G4endl;
117  G4cout << "layer eDep/evt nGamma/evt nElec/evt nPosi/evt stpLen/evt nStep/evt"
118  << G4endl;
119  for(size_t k=0;k<20;k++)
120  {
121  G4cout << std::setw(8) << k;
122  for(size_t j=0;j<6;j++)
123  { G4cout << " " << std::setw(10) << (theRun->GetParaValue(i,j,k))/nEvt; }
124  G4cout << G4endl;
125  }
126  G4cout
127  << "############################################################" << G4endl;
128  }
129  G4cout << "CPU Time spent by each region" << G4cout;
131  sv->Report();
132 }
133