Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
LXeRun.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 //
26 // $Id: LXeRunAction.cc 66587 2012-12-21 11:06:44Z ihrivnac $
27 //
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "LXeRun.hh"
35 #include "G4SystemOfUnits.hh"
36 
37 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
38 
40 {
41  fHitCount = fHitCount2 = 0;
47 
48  fTotE = fTotE2 = 0.0;
49 }
50 
51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52 
54 {}
55 
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 
58 void LXeRun::Merge(const G4Run* run)
59 {
60  const LXeRun* localRun = static_cast<const LXeRun*>(run);
61 
62  fHitCount += localRun->fHitCount;
63  fHitCount2 += localRun->fHitCount2;
74  fTotE += localRun->fTotE;
75  fTotE2 += localRun->fTotE2;
76 
77  G4Run::Merge(run);
78 }
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81 
83 {
84  G4cout << "\n ======================== run summary ======================\n";
85 
86  G4int prec = G4cout.precision();
87 
88  G4int n_evt = numberOfEvent;
89  G4cout << "The run was " << n_evt << " events." << G4endl;
90 
91  G4cout.precision(4);
93  G4double hits2 = G4double(fHitCount2)/n_evt;
94  G4double rms_hits = hits2 - hits*hits;
95  if (rms_hits > 0.) rms_hits = std::sqrt(rms_hits/n_evt);
96  else rms_hits = 0.;
97  G4cout << "Number of hits per event:\t " << hits << " +- " << rms_hits
98  << G4endl;
99 
100  G4double hitsAbove = G4double(fPMTsAboveThreshold)/n_evt;
101  G4double hitsAbove2 = G4double(fPMTsAboveThreshold2)/n_evt;
102  G4double rms_hitsAbove = hitsAbove2 - hitsAbove*hitsAbove;
103  if (rms_hitsAbove > 0.) rms_hitsAbove = std::sqrt(rms_hitsAbove/n_evt);
104  else rms_hitsAbove = 0.;
105 
106  G4cout << "Number of hits per event above threshold:\t " << hitsAbove
107  << " +- " << rms_hitsAbove << G4endl;
108 
109  G4double scint = G4double(fPhotonCount_Scint)/n_evt;
110  G4double scint2 = G4double(fPhotonCount_Scint2)/n_evt;
111  G4double rms_scint = scint2 - scint*scint;
112  if (rms_scint > 0.) rms_scint = std::sqrt(rms_scint/n_evt);
113  else rms_scint = 0.;
114 
115  G4cout << "Number of scintillation photons per event :\t " << scint << " +- "
116  << rms_scint << G4endl;
117 
118  G4double ceren = G4double(fPhotonCount_Ceren)/n_evt;
119  G4double ceren2 = G4double(fPhotonCount_Ceren2)/n_evt;
120  G4double rms_ceren = ceren2 - ceren*ceren;
121  if (rms_ceren > 0.) rms_ceren = std::sqrt(rms_ceren/n_evt);
122  else rms_ceren = 0.;
123 
124  G4cout << "Number of Cerenkov photons per event:\t " << ceren << " +- "
125  << rms_ceren << G4endl;
126 
127  G4double absorb = G4double(fAbsorptionCount)/n_evt;
128  G4double absorb2 = G4double(fAbsorptionCount2)/n_evt;
129  G4double rms_absorb = absorb2 - absorb*absorb;
130  if (rms_absorb > 0.) rms_absorb = std::sqrt(rms_absorb/n_evt);
131  else rms_absorb = 0.;
132 
133  G4cout << "Number of absorbed photons per event :\t " << absorb << " +- "
134  << rms_absorb << G4endl;
135 
138  G4double rms_bdry = bdry2 - bdry*bdry;
139  if (rms_bdry > 0.) rms_bdry = std::sqrt(rms_bdry/n_evt);
140  else rms_bdry = 0.;
141 
142  G4cout << "Number of photons absorbed at boundary per event:\t " << bdry
143  << " +- " << rms_bdry << G4endl;
144  //G4cout << "Number of unaccounted for photons: " << G4endl;
145 
146  G4double en = fTotE/n_evt;
147  G4double en2 = fTotE2/n_evt;
148  G4double rms_en = en2 - en*en;
149  if (rms_en > 0.) rms_en = std::sqrt(rms_en/n_evt);
150  else rms_en = 0.;
151 
152  G4cout << "Total energy deposition in scintillator per event:\t " << en/keV
153  << " +- " << rms_en/keV << " keV." << G4endl;
154 
155  G4cout << G4endl;
156  G4cout.precision(prec);
157 }
G4int fPhotonCount_Scint2
Definition: LXeRun.hh:84
static const double prec
Definition: RanecuEngine.cc:58
G4int fBoundaryAbsorptionCount2
Definition: LXeRun.hh:87
virtual void Merge(const G4Run *run)
Definition: LXeRun.cc:58
G4int numberOfEvent
Definition: G4Run.hh:59
static constexpr double keV
Definition: G4SIunits.hh:216
G4int fHitCount2
Definition: LXeRun.hh:83
#define G4endl
Definition: G4ios.hh:61
Definition: LXeRun.hh:42
G4int fAbsorptionCount2
Definition: LXeRun.hh:86
G4int fAbsorptionCount
Definition: LXeRun.hh:86
G4double fTotE2
Definition: LXeRun.hh:90
G4int fPhotonCount_Scint
Definition: LXeRun.hh:84
double G4double
Definition: G4Types.hh:76
void hits()
Definition: readHits.C:15
G4int fHitCount
Definition: LXeRun.hh:83
G4int fPMTsAboveThreshold2
Definition: LXeRun.hh:88
G4int fBoundaryAbsorptionCount
Definition: LXeRun.hh:87
Definition: G4Run.hh:46
~LXeRun()
Definition: LXeRun.cc:53
LXeRun()
Definition: LXeRun.cc:39
void EndOfRun()
Definition: LXeRun.cc:82
int G4int
Definition: G4Types.hh:78
G4int fPhotonCount_Ceren2
Definition: LXeRun.hh:85
G4int fPhotonCount_Ceren
Definition: LXeRun.hh:85
G4GLOB_DLL std::ostream G4cout
G4double fTotE
Definition: LXeRun.hh:90
virtual void Merge(const G4Run *)
Definition: G4Run.cc:54
G4int fPMTsAboveThreshold
Definition: LXeRun.hh:88