ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LXeRun.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file 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 //
29 //
30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 
33 #include "LXeRun.hh"
34 #include "G4SystemOfUnits.hh"
35 
36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
37 
39 {
40  fHitCount = fHitCount2 = 0;
46 
47  fTotE = fTotE2 = 0.0;
48 }
49 
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
51 
53 {}
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 
57 void LXeRun::Merge(const G4Run* run)
58 {
59  const LXeRun* localRun = static_cast<const LXeRun*>(run);
60 
61  fHitCount += localRun->fHitCount;
62  fHitCount2 += localRun->fHitCount2;
73  fTotE += localRun->fTotE;
74  fTotE2 += localRun->fTotE2;
75 
76  G4Run::Merge(run);
77 }
78 
79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
80 
82 {
83  G4cout << "\n ======================== run summary ======================\n";
84 
85  G4int prec = G4cout.precision();
86 
87  G4int n_evt = numberOfEvent;
88  G4cout << "The run was " << n_evt << " events." << G4endl;
89 
90  G4cout.precision(4);
92  G4double hits2 = G4double(fHitCount2)/n_evt;
93  G4double rms_hits = hits2 - hits*hits;
94  if (rms_hits > 0.) rms_hits = std::sqrt(rms_hits/n_evt);
95  else rms_hits = 0.;
96  G4cout << "Number of hits per event:\t " << hits << " +- " << rms_hits
97  << G4endl;
98 
99  G4double hitsAbove = G4double(fPMTsAboveThreshold)/n_evt;
100  G4double hitsAbove2 = G4double(fPMTsAboveThreshold2)/n_evt;
101  G4double rms_hitsAbove = hitsAbove2 - hitsAbove*hitsAbove;
102  if (rms_hitsAbove > 0.) rms_hitsAbove = std::sqrt(rms_hitsAbove/n_evt);
103  else rms_hitsAbove = 0.;
104 
105  G4cout << "Number of hits per event above threshold:\t " << hitsAbove
106  << " +- " << rms_hitsAbove << G4endl;
107 
108  G4double scint = G4double(fPhotonCount_Scint)/n_evt;
109  G4double scint2 = G4double(fPhotonCount_Scint2)/n_evt;
110  G4double rms_scint = scint2 - scint*scint;
111  if (rms_scint > 0.) rms_scint = std::sqrt(rms_scint/n_evt);
112  else rms_scint = 0.;
113 
114  G4cout << "Number of scintillation photons per event :\t " << scint << " +- "
115  << rms_scint << G4endl;
116 
117  G4double ceren = G4double(fPhotonCount_Ceren)/n_evt;
118  G4double ceren2 = G4double(fPhotonCount_Ceren2)/n_evt;
119  G4double rms_ceren = ceren2 - ceren*ceren;
120  if (rms_ceren > 0.) rms_ceren = std::sqrt(rms_ceren/n_evt);
121  else rms_ceren = 0.;
122 
123  G4cout << "Number of Cerenkov photons per event:\t " << ceren << " +- "
124  << rms_ceren << G4endl;
125 
126  G4double absorb = G4double(fAbsorptionCount)/n_evt;
127  G4double absorb2 = G4double(fAbsorptionCount2)/n_evt;
128  G4double rms_absorb = absorb2 - absorb*absorb;
129  if (rms_absorb > 0.) rms_absorb = std::sqrt(rms_absorb/n_evt);
130  else rms_absorb = 0.;
131 
132  G4cout << "Number of absorbed photons per event :\t " << absorb << " +- "
133  << rms_absorb << G4endl;
134 
137  G4double rms_bdry = bdry2 - bdry*bdry;
138  if (rms_bdry > 0.) rms_bdry = std::sqrt(rms_bdry/n_evt);
139  else rms_bdry = 0.;
140 
141  G4cout << "Number of photons absorbed at boundary per event:\t " << bdry
142  << " +- " << rms_bdry << G4endl;
143  //G4cout << "Number of unaccounted for photons: " << G4endl;
144 
145  G4double en = fTotE/n_evt;
146  G4double en2 = fTotE2/n_evt;
147  G4double rms_en = en2 - en*en;
148  if (rms_en > 0.) rms_en = std::sqrt(rms_en/n_evt);
149  else rms_en = 0.;
150 
151  G4cout << "Total energy deposition in scintillator per event:\t " << en/keV
152  << " +- " << rms_en/keV << " keV." << G4endl;
153 
154  G4cout << G4endl;
155  G4cout.precision(prec);
156 }