Loading...
Searching...
No Matches
LXeRun.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/// \file optical/LXe/src/LXeRun.cc
28/// \brief Implementation of the LXeRun class
29//
30//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
33#include "LXeRun.hh"
34
35#include "G4SystemOfUnits.hh"
36
37//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
38
39void LXeRun::Merge(const G4Run* run)
40{
41 const auto localRun = static_cast<const LXeRun*>(run);
42
43 fHitCount += localRun->fHitCount;
44 fHitCount2 += localRun->fHitCount2;
45 fPMTsAboveThreshold += localRun->fPMTsAboveThreshold;
46 fPMTsAboveThreshold2 += localRun->fPMTsAboveThreshold2;
47 fPhotonCount_Scint += localRun->fPhotonCount_Scint;
48 fPhotonCount_Scint2 += localRun->fPhotonCount_Scint2;
49 fPhotonCount_Ceren += localRun->fPhotonCount_Ceren;
50 fPhotonCount_Ceren2 += localRun->fPhotonCount_Ceren2;
51 fAbsorptionCount += localRun->fAbsorptionCount;
52 fAbsorptionCount2 += localRun->fAbsorptionCount2;
53 fBoundaryAbsorptionCount += localRun->fBoundaryAbsorptionCount;
54 fBoundaryAbsorptionCount2 += localRun->fBoundaryAbsorptionCount2;
55 fTotE += localRun->fTotE;
56 fTotE2 += localRun->fTotE2;
57
58 G4Run::Merge(run);
59}
60
61//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
62
64{
65 G4cout << "\n ======================== run summary ======================\n";
66
67 G4int prec = G4cout.precision();
68
69 auto n_evt = (G4double) numberOfEvent;
70 G4cout << "The run was " << numberOfEvent << " events." << G4endl;
71
72 G4cout.precision(4);
73 G4double hits = G4double(fHitCount) / n_evt;
74 G4double hits2 = G4double(fHitCount2) / n_evt;
75 G4double rms_hits = hits2 - hits * hits;
76 if(rms_hits > 0.)
77 rms_hits = std::sqrt(rms_hits / n_evt);
78 else
79 rms_hits = 0.;
80 G4cout << "Number of hits per event:\t " << hits << " +- " << rms_hits
81 << G4endl;
82
83 G4double hitsAbove = G4double(fPMTsAboveThreshold) / n_evt;
84 G4double hitsAbove2 = G4double(fPMTsAboveThreshold2) / n_evt;
85 G4double rms_hitsAbove = hitsAbove2 - hitsAbove * hitsAbove;
86 if(rms_hitsAbove > 0.)
87 rms_hitsAbove = std::sqrt(rms_hitsAbove / n_evt);
88 else
89 rms_hitsAbove = 0.;
90
91 G4cout << "Number of hits per event above threshold:\t " << hitsAbove
92 << " +- " << rms_hitsAbove << G4endl;
93
94 G4double scint = G4double(fPhotonCount_Scint) / n_evt;
95 G4double scint2 = G4double(fPhotonCount_Scint2) / n_evt;
96 G4double rms_scint = scint2 - scint * scint;
97 if(rms_scint > 0.)
98 rms_scint = std::sqrt(rms_scint / n_evt);
99 else
100 rms_scint = 0.;
101
102 G4cout << "Number of scintillation photons per event :\t " << scint << " +- "
103 << rms_scint << G4endl;
104
105 G4double ceren = G4double(fPhotonCount_Ceren) / n_evt;
106 G4double ceren2 = G4double(fPhotonCount_Ceren2) / n_evt;
107 G4double rms_ceren = ceren2 - ceren * ceren;
108 if(rms_ceren > 0.)
109 rms_ceren = std::sqrt(rms_ceren / n_evt);
110 else
111 rms_ceren = 0.;
112
113 G4cout << "Number of Cerenkov photons per event:\t " << ceren << " +- "
114 << rms_ceren << G4endl;
115
116 G4double absorb = G4double(fAbsorptionCount) / n_evt;
117 G4double absorb2 = G4double(fAbsorptionCount2) / n_evt;
118 G4double rms_absorb = absorb2 - absorb * absorb;
119 if(rms_absorb > 0.)
120 rms_absorb = std::sqrt(rms_absorb / n_evt);
121 else
122 rms_absorb = 0.;
123
124 G4cout << "Number of absorbed photons per event :\t " << absorb << " +- "
125 << rms_absorb << G4endl;
126
127 G4double bdry = G4double(fBoundaryAbsorptionCount) / n_evt;
128 G4double bdry2 = G4double(fBoundaryAbsorptionCount2) / n_evt;
129 G4double rms_bdry = bdry2 - bdry * bdry;
130 if(rms_bdry > 0.)
131 rms_bdry = std::sqrt(rms_bdry / n_evt);
132 else
133 rms_bdry = 0.;
134
135 G4cout << "Number of photons absorbed at boundary per event:\t " << bdry
136 << " +- " << rms_bdry << G4endl;
137
138 G4double en = fTotE / n_evt;
139 G4double en2 = fTotE2 / n_evt;
140 G4double rms_en = en2 - en * en;
141 if(rms_en > 0.)
142 rms_en = std::sqrt(rms_en / n_evt);
143 else
144 rms_en = 0.;
145
146 G4cout << "Total energy deposition in scintillator per event:\t " << en / keV
147 << " +- " << rms_en / keV << " keV." << G4endl;
148
149 G4cout << G4endl;
150 G4cout.precision(prec);
151}
Definition of the LXeRun class.
G4int fPMTsAboveThreshold2
Definition LXeRun.hh:99
void Merge(const G4Run *run) override
Definition LXeRun.cc:39
G4int fBoundaryAbsorptionCount2
Definition LXeRun.hh:97
G4double fTotE
Definition LXeRun.hh:101
G4int fPhotonCount_Ceren
Definition LXeRun.hh:92
G4int fAbsorptionCount2
Definition LXeRun.hh:95
G4int fAbsorptionCount
Definition LXeRun.hh:94
G4int fBoundaryAbsorptionCount
Definition LXeRun.hh:96
G4int fPhotonCount_Ceren2
Definition LXeRun.hh:93
G4int fPhotonCount_Scint
Definition LXeRun.hh:90
G4int fPMTsAboveThreshold
Definition LXeRun.hh:98
void EndOfRun()
Definition LXeRun.cc:63
G4double fTotE2
Definition LXeRun.hh:102
G4int fHitCount2
Definition LXeRun.hh:89
G4int fPhotonCount_Scint2
Definition LXeRun.hh:91
G4int fHitCount
Definition LXeRun.hh:88

Applications | User Support | Publications | Collaboration