Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 /// \file optical/LXe/src/LXeRun.cc 28 /// \brief Implementation of the LXeRun class 29 // 30 //....oooOO0OOooo........oooOO0OOooo........oo 31 //....oooOO0OOooo........oooOO0OOooo........oo 32 33 #include "LXeRun.hh" 34 35 #include "G4SystemOfUnits.hh" 36 37 //....oooOO0OOooo........oooOO0OOooo........oo 38 39 void LXeRun::Merge(const G4Run* run) 40 { 41 const auto localRun = static_cast<const LXeR 42 43 fHitCount += localRun->fHitCount; 44 fHitCount2 += localRun->fHitCount2; 45 fPMTsAboveThreshold += localRun->fPMTsAboveT 46 fPMTsAboveThreshold2 += localRun->fPMTsAbove 47 fPhotonCount_Scint += localRun->fPhotonCount 48 fPhotonCount_Scint2 += localRun->fPhotonCoun 49 fPhotonCount_Ceren += localRun->fPhotonCount 50 fPhotonCount_Ceren2 += localRun->fPhotonCoun 51 fAbsorptionCount += localRun->fAbsorptionCou 52 fAbsorptionCount2 += localRun->fAbsorptionCo 53 fBoundaryAbsorptionCount += localRun->fBound 54 fBoundaryAbsorptionCount2 += localRun->fBoun 55 fTotE += localRun->fTotE; 56 fTotE2 += localRun->fTotE2; 57 58 G4Run::Merge(run); 59 } 60 61 //....oooOO0OOooo........oooOO0OOooo........oo 62 63 void LXeRun::EndOfRun() 64 { 65 G4cout << "\n ======================== run s 66 67 G4int prec = G4cout.precision(); 68 69 auto n_evt = (G4double)numberOfEvent; 70 G4cout << "The run was " << numberOfEvent << 71 72 G4cout.precision(4); 73 G4double hits = G4double(fHitCount) / n_evt; 74 G4double hits2 = G4double(fHitCount2) / n_ev 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 " << 81 82 G4double hitsAbove = G4double(fPMTsAboveThre 83 G4double hitsAbove2 = G4double(fPMTsAboveThr 84 G4double rms_hitsAbove = hitsAbove2 - hitsAb 85 if (rms_hitsAbove > 0.) 86 rms_hitsAbove = std::sqrt(rms_hitsAbove / 87 else 88 rms_hitsAbove = 0.; 89 90 G4cout << "Number of hits per event above th 91 << G4endl; 92 93 G4double scint = G4double(fPhotonCount_Scint 94 G4double scint2 = G4double(fPhotonCount_Scin 95 G4double rms_scint = scint2 - scint * scint; 96 if (rms_scint > 0.) 97 rms_scint = std::sqrt(rms_scint / n_evt); 98 else 99 rms_scint = 0.; 100 101 G4cout << "Number of scintillation photons p 102 << G4endl; 103 104 G4double ceren = G4double(fPhotonCount_Ceren 105 G4double ceren2 = G4double(fPhotonCount_Cere 106 G4double rms_ceren = ceren2 - ceren * ceren; 107 if (rms_ceren > 0.) 108 rms_ceren = std::sqrt(rms_ceren / n_evt); 109 else 110 rms_ceren = 0.; 111 112 G4cout << "Number of Cerenkov photons per ev 113 114 G4double absorb = G4double(fAbsorptionCount) 115 G4double absorb2 = G4double(fAbsorptionCount 116 G4double rms_absorb = absorb2 - absorb * abs 117 if (rms_absorb > 0.) 118 rms_absorb = std::sqrt(rms_absorb / n_evt) 119 else 120 rms_absorb = 0.; 121 122 G4cout << "Number of absorbed photons per ev 123 124 G4double bdry = G4double(fBoundaryAbsorption 125 G4double bdry2 = G4double(fBoundaryAbsorptio 126 G4double rms_bdry = bdry2 - bdry * bdry; 127 if (rms_bdry > 0.) 128 rms_bdry = std::sqrt(rms_bdry / n_evt); 129 else 130 rms_bdry = 0.; 131 132 G4cout << "Number of photons absorbed at bou 133 << G4endl; 134 135 G4double en = fTotE / n_evt; 136 G4double en2 = fTotE2 / n_evt; 137 G4double rms_en = en2 - en * en; 138 if (rms_en > 0.) 139 rms_en = std::sqrt(rms_en / n_evt); 140 else 141 rms_en = 0.; 142 143 G4cout << "Total energy deposition in scinti 144 << rms_en / keV << " keV." << G4endl; 145 146 G4cout << G4endl; 147 G4cout.precision(prec); 148 } 149