File indexing completed on 2026-04-02 07:37:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #include "LXeRun.hh"
0030
0031 #include "G4SystemOfUnits.hh"
0032
0033
0034
0035 void LXeRun::Merge(const G4Run* run)
0036 {
0037 const auto localRun = static_cast<const LXeRun*>(run);
0038
0039 fHitCount += localRun->fHitCount;
0040 fHitCount2 += localRun->fHitCount2;
0041 fPMTsAboveThreshold += localRun->fPMTsAboveThreshold;
0042 fPMTsAboveThreshold2 += localRun->fPMTsAboveThreshold2;
0043 fPhotonCount_Scint += localRun->fPhotonCount_Scint;
0044 fPhotonCount_Scint2 += localRun->fPhotonCount_Scint2;
0045 fPhotonCount_Ceren += localRun->fPhotonCount_Ceren;
0046 fPhotonCount_Ceren2 += localRun->fPhotonCount_Ceren2;
0047 fAbsorptionCount += localRun->fAbsorptionCount;
0048 fAbsorptionCount2 += localRun->fAbsorptionCount2;
0049 fBoundaryAbsorptionCount += localRun->fBoundaryAbsorptionCount;
0050 fBoundaryAbsorptionCount2 += localRun->fBoundaryAbsorptionCount2;
0051 fTotE += localRun->fTotE;
0052 fTotE2 += localRun->fTotE2;
0053
0054 G4Run::Merge(run);
0055 }
0056
0057
0058
0059 void LXeRun::EndOfRun()
0060 {
0061 G4cout << "\n ======================== run summary ======================\n";
0062
0063 G4int prec = G4cout.precision();
0064
0065 auto n_evt = (G4double)numberOfEvent;
0066 G4cout << "The run was " << numberOfEvent << " events." << G4endl;
0067
0068 G4cout.precision(4);
0069 G4double hits = G4double(fHitCount) / n_evt;
0070 G4double hits2 = G4double(fHitCount2) / n_evt;
0071 G4double rms_hits = hits2 - hits * hits;
0072 if (rms_hits > 0.)
0073 rms_hits = std::sqrt(rms_hits / n_evt);
0074 else
0075 rms_hits = 0.;
0076 G4cout << "Number of hits per event:\t " << hits << " +- " << rms_hits << G4endl;
0077
0078 G4double hitsAbove = G4double(fPMTsAboveThreshold) / n_evt;
0079 G4double hitsAbove2 = G4double(fPMTsAboveThreshold2) / n_evt;
0080 G4double rms_hitsAbove = hitsAbove2 - hitsAbove * hitsAbove;
0081 if (rms_hitsAbove > 0.)
0082 rms_hitsAbove = std::sqrt(rms_hitsAbove / n_evt);
0083 else
0084 rms_hitsAbove = 0.;
0085
0086 G4cout << "Number of hits per event above threshold:\t " << hitsAbove << " +- " << rms_hitsAbove
0087 << G4endl;
0088
0089 G4double scint = G4double(fPhotonCount_Scint) / n_evt;
0090 G4double scint2 = G4double(fPhotonCount_Scint2) / n_evt;
0091 G4double rms_scint = scint2 - scint * scint;
0092 if (rms_scint > 0.)
0093 rms_scint = std::sqrt(rms_scint / n_evt);
0094 else
0095 rms_scint = 0.;
0096
0097 G4cout << "Number of scintillation photons per event :\t " << scint << " +- " << rms_scint
0098 << G4endl;
0099
0100 G4double ceren = G4double(fPhotonCount_Ceren) / n_evt;
0101 G4double ceren2 = G4double(fPhotonCount_Ceren2) / n_evt;
0102 G4double rms_ceren = ceren2 - ceren * ceren;
0103 if (rms_ceren > 0.)
0104 rms_ceren = std::sqrt(rms_ceren / n_evt);
0105 else
0106 rms_ceren = 0.;
0107
0108 G4cout << "Number of Cerenkov photons per event:\t " << ceren << " +- " << rms_ceren << G4endl;
0109
0110 G4double absorb = G4double(fAbsorptionCount) / n_evt;
0111 G4double absorb2 = G4double(fAbsorptionCount2) / n_evt;
0112 G4double rms_absorb = absorb2 - absorb * absorb;
0113 if (rms_absorb > 0.)
0114 rms_absorb = std::sqrt(rms_absorb / n_evt);
0115 else
0116 rms_absorb = 0.;
0117
0118 G4cout << "Number of absorbed photons per event :\t " << absorb << " +- " << rms_absorb << G4endl;
0119
0120 G4double bdry = G4double(fBoundaryAbsorptionCount) / n_evt;
0121 G4double bdry2 = G4double(fBoundaryAbsorptionCount2) / n_evt;
0122 G4double rms_bdry = bdry2 - bdry * bdry;
0123 if (rms_bdry > 0.)
0124 rms_bdry = std::sqrt(rms_bdry / n_evt);
0125 else
0126 rms_bdry = 0.;
0127
0128 G4cout << "Number of photons absorbed at boundary per event:\t " << bdry << " +- " << rms_bdry
0129 << G4endl;
0130
0131 G4double en = fTotE / n_evt;
0132 G4double en2 = fTotE2 / n_evt;
0133 G4double rms_en = en2 - en * en;
0134 if (rms_en > 0.)
0135 rms_en = std::sqrt(rms_en / n_evt);
0136 else
0137 rms_en = 0.;
0138
0139 G4cout << "Total energy deposition in scintillator per event:\t " << en / keV << " +- "
0140 << rms_en / keV << " keV." << G4endl;
0141
0142 G4cout << G4endl;
0143 G4cout.precision(prec);
0144 }