Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /// \file Run.cc 26 /// \file Run.cc 27 /// \brief Implementation of the Run class 27 /// \brief Implementation of the Run class 28 // 28 // 29 // << 29 // $Id: Run.cc 71376 2013-06-14 07:44:50Z maire $ >> 30 // 30 //....oooOO0OOooo........oooOO0OOooo........oo 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 31 //....oooOO0OOooo........oooOO0OOooo........oo 32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 33 33 #include "Run.hh" 34 #include "Run.hh" 34 << 35 #include "DetectorConstruction.hh" 35 #include "DetectorConstruction.hh" >> 36 36 #include "EventAction.hh" 37 #include "EventAction.hh" 37 #include "HistoManager.hh" 38 #include "HistoManager.hh" 38 #include "PrimaryGeneratorAction.hh" 39 #include "PrimaryGeneratorAction.hh" 39 40 40 #include "G4Event.hh" << 41 #include "G4Material.hh" 41 #include "G4Material.hh" >> 42 #include "G4Event.hh" 42 #include "G4SystemOfUnits.hh" 43 #include "G4SystemOfUnits.hh" 43 #include "G4UnitsTable.hh" 44 #include "G4UnitsTable.hh" 44 << 45 #include <iomanip> 45 #include <iomanip> 46 46 47 //....oooOO0OOooo........oooOO0OOooo........oo 47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 48 48 49 Run::Run(DetectorConstruction* detector) : fDe << 49 Run::Run(DetectorConstruction* detector) 50 { << 50 : G4Run(), 51 fTotEdep[1] = fEleak[1] = fEtotal[1] = joule << 51 fDetector(detector), 52 << 52 fParticle(0), fEkin(0.) 53 for (G4int i = 0; i < kMaxAbsor; ++i) { << 53 { 54 fEdeposit[i] = 0.; << 54 for (G4int i=0; i<3; ++i) { fStatus[i] = 0; fTotEdep[i] = 0.; } 55 fEmin[i] = joule; << 55 fTotEdep[1] = joule; 56 fEmax[i] = 0.; << 56 for (G4int i=0; i<kMaxAbsor; ++i) { 57 } << 57 fEdeposit[i] = 0.; fEmin[i] = joule; fEmax[i] = 0.; >> 58 } 58 } 59 } 59 60 60 //....oooOO0OOooo........oooOO0OOooo........oo 61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 61 62 62 void Run::SetPrimary(G4ParticleDefinition* par << 63 Run::~Run() 63 { << 64 { } >> 65 >> 66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 67 >> 68 void Run::SetPrimary (G4ParticleDefinition* particle, G4double energy) >> 69 { 64 fParticle = particle; 70 fParticle = particle; 65 fEkin = energy; << 71 fEkin = energy; 66 } 72 } 67 73 68 //....oooOO0OOooo........oooOO0OOooo........oo 74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 69 75 70 void Run::CountProcesses(const G4VProcess* pro << 76 void Run::CountProcesses(const G4VProcess* process) 71 { 77 { 72 if (process == nullptr) return; << 73 G4String procName = process->GetProcessName( 78 G4String procName = process->GetProcessName(); 74 std::map<G4String, G4int>::iterator it = fPr << 79 std::map<G4String,G4int>::iterator it = fProcCounter.find(procName); 75 if (it == fProcCounter.end()) { << 80 if ( it == fProcCounter.end()) { 76 fProcCounter[procName] = 1; 81 fProcCounter[procName] = 1; 77 } 82 } 78 else { 83 else { 79 fProcCounter[procName]++; << 84 fProcCounter[procName]++; 80 } 85 } 81 } 86 } 82 87 83 //....oooOO0OOooo........oooOO0OOooo........oo 88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 84 89 85 void Run::ParticleCount(G4int k, G4String name << 90 void Run::ParticleCount(G4int k, G4String name, G4double Ekin) 86 { 91 { 87 std::map<G4String, ParticleData>::iterator i << 92 std::map<G4String, ParticleData>::iterator it = fParticleDataMap[k].find(name); 88 if (it == fParticleDataMap[k].end()) { << 93 if ( it == fParticleDataMap[k].end()) { 89 (fParticleDataMap[k])[name] = ParticleData << 94 (fParticleDataMap[k])[name] = ParticleData(1, Ekin, Ekin, Ekin); 90 } 95 } 91 else { 96 else { 92 ParticleData& data = it->second; 97 ParticleData& data = it->second; 93 data.fCount++; 98 data.fCount++; 94 data.fEmean += Ekin; 99 data.fEmean += Ekin; 95 // update min max << 100 //update min max 96 G4double emin = data.fEmin; 101 G4double emin = data.fEmin; 97 if (Ekin < emin) data.fEmin = Ekin; 102 if (Ekin < emin) data.fEmin = Ekin; 98 G4double emax = data.fEmax; 103 G4double emax = data.fEmax; 99 if (Ekin > emax) data.fEmax = Ekin; << 104 if (Ekin > emax) data.fEmax = Ekin; 100 data.fTmean = meanLife; << 105 } 101 } << 102 } 106 } 103 107 104 //....oooOO0OOooo........oooOO0OOooo........oo 108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 105 109 106 void Run::AddEdep(G4int i, G4double e) << 110 void Run::AddEdep (G4int i, G4double e) 107 { 111 { 108 if (e > 0.) { 112 if (e > 0.) { 109 fEdeposit[i] += e; << 113 fEdeposit[i] += e; 110 if (e < fEmin[i]) fEmin[i] = e; 114 if (e < fEmin[i]) fEmin[i] = e; 111 if (e > fEmax[i]) fEmax[i] = e; 115 if (e > fEmax[i]) fEmax[i] = e; 112 } 116 } 113 } 117 } 114 118 115 //....oooOO0OOooo........oooOO0OOooo........oo 119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 116 120 117 void Run::AddTotEdep(G4double e) << 121 void Run::AddTotEdep (G4double e) 118 { 122 { 119 if (e > 0.) { 123 if (e > 0.) { 120 fTotEdep[0] += e; << 124 fTotEdep[0] += e; 121 if (e < fTotEdep[1]) fTotEdep[1] = e; 125 if (e < fTotEdep[1]) fTotEdep[1] = e; 122 if (e > fTotEdep[2]) fTotEdep[2] = e; 126 if (e > fTotEdep[2]) fTotEdep[2] = e; 123 } 127 } 124 } 128 } 125 129 126 //....oooOO0OOooo........oooOO0OOooo........oo 130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 127 << 131 128 void Run::AddEleak(G4double e) << 132 void Run::AddTrackStatus (G4int i) 129 { << 130 if (e > 0.) { << 131 fEleak[0] += e; << 132 if (e < fEleak[1]) fEleak[1] = e; << 133 if (e > fEleak[2]) fEleak[2] = e; << 134 } << 135 } << 136 << 137 //....oooOO0OOooo........oooOO0OOooo........oo << 138 << 139 void Run::AddEtotal(G4double e) << 140 { 133 { 141 if (e > 0.) { << 134 fStatus[i]++ ; 142 fEtotal[0] += e; << 143 if (e < fEtotal[1]) fEtotal[1] = e; << 144 if (e > fEtotal[2]) fEtotal[2] = e; << 145 } << 146 } << 147 << 148 //....oooOO0OOooo........oooOO0OOooo........oo << 149 << 150 void Run::AddTrackStatus(G4int i) << 151 { << 152 fStatus[i]++; << 153 } 135 } 154 136 155 //....oooOO0OOooo........oooOO0OOooo........oo 137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 156 138 157 void Run::Merge(const G4Run* run) 139 void Run::Merge(const G4Run* run) 158 { 140 { 159 const Run* localRun = static_cast<const Run* 141 const Run* localRun = static_cast<const Run*>(run); 160 << 142 161 // pass information about primary particle 143 // pass information about primary particle 162 fParticle = localRun->fParticle; 144 fParticle = localRun->fParticle; 163 fEkin = localRun->fEkin; << 145 fEkin = localRun->fEkin; 164 146 165 // Edep in absorbers 147 // Edep in absorbers 166 // 148 // 167 G4int nbOfAbsor = fDetector->GetNbOfAbsor(); 149 G4int nbOfAbsor = fDetector->GetNbOfAbsor(); 168 for (G4int i = 1; i <= nbOfAbsor; ++i) { << 150 for (G4int i=1; i<=nbOfAbsor; ++i) { 169 fEdeposit[i] += localRun->fEdeposit[i]; << 151 fEdeposit[i] += localRun->fEdeposit[i]; 170 // min, max 152 // min, max 171 G4double min, max; << 153 G4double min,max; 172 min = localRun->fEmin[i]; << 154 min = localRun->fEmin[i]; max = localRun->fEmax[i]; 173 max = localRun->fEmax[i]; << 174 if (fEmin[i] > min) fEmin[i] = min; 155 if (fEmin[i] > min) fEmin[i] = min; 175 if (fEmax[i] < max) fEmax[i] = max; 156 if (fEmax[i] < max) fEmax[i] = max; 176 } 157 } 177 << 158 178 for (G4int i = 0; i < 3; ++i) << 159 for (G4int i=0; i<3; ++i) fStatus[i] += localRun->fStatus[i]; 179 fStatus[i] += localRun->fStatus[i]; << 160 180 << 181 // total Edep 161 // total Edep 182 fTotEdep[0] += localRun->fTotEdep[0]; 162 fTotEdep[0] += localRun->fTotEdep[0]; 183 G4double min, max; << 163 G4double min,max; 184 min = localRun->fTotEdep[1]; << 164 min = localRun->fTotEdep[1]; max = localRun->fTotEdep[2]; 185 max = localRun->fTotEdep[2]; << 186 if (fTotEdep[1] > min) fTotEdep[1] = min; 165 if (fTotEdep[1] > min) fTotEdep[1] = min; 187 if (fTotEdep[2] < max) fTotEdep[2] = max; 166 if (fTotEdep[2] < max) fTotEdep[2] = max; 188 167 189 // Eleak << 168 //map: processes count 190 fEleak[0] += localRun->fEleak[0]; << 169 std::map<G4String,G4int>::const_iterator itp; 191 min = localRun->fEleak[1]; << 170 for ( itp = localRun->fProcCounter.begin(); 192 max = localRun->fEleak[2]; << 171 itp != localRun->fProcCounter.end(); ++itp ) { 193 if (fEleak[1] > min) fEleak[1] = min; << 172 194 if (fEleak[2] < max) fEleak[2] = max; << 195 << 196 // Etotal << 197 fEtotal[0] += localRun->fEtotal[0]; << 198 min = localRun->fEtotal[1]; << 199 max = localRun->fEtotal[2]; << 200 if (fEtotal[1] > min) fEtotal[1] = min; << 201 if (fEtotal[2] < max) fEtotal[2] = max; << 202 << 203 // map: processes count << 204 std::map<G4String, G4int>::const_iterator it << 205 for (itp = localRun->fProcCounter.begin(); i << 206 G4String procName = itp->first; 173 G4String procName = itp->first; 207 G4int localCount = itp->second; 174 G4int localCount = itp->second; 208 if (fProcCounter.find(procName) == fProcCo << 175 if ( fProcCounter.find(procName) == fProcCounter.end()) { 209 fProcCounter[procName] = localCount; 176 fProcCounter[procName] = localCount; 210 } 177 } 211 else { 178 else { 212 fProcCounter[procName] += localCount; 179 fProcCounter[procName] += localCount; 213 } << 180 } 214 } 181 } >> 182 >> 183 //map: created particles in absorbers count >> 184 for (G4int k=0; k<=nbOfAbsor; ++k) { >> 185 std::map<G4String,ParticleData>::const_iterator itc; >> 186 for (itc = localRun->fParticleDataMap[k].begin(); >> 187 itc != localRun->fParticleDataMap[k].end(); ++itc) { 215 188 216 // map: created particles in absorbers count << 217 for (G4int k = 0; k <= nbOfAbsor; ++k) { << 218 std::map<G4String, ParticleData>::const_it << 219 for (itc = localRun->fParticleDataMap[k].b << 220 ++itc) << 221 { << 222 G4String name = itc->first; 189 G4String name = itc->first; 223 const ParticleData& localData = itc->sec << 190 const ParticleData& localData = itc->second; 224 if (fParticleDataMap[k].find(name) == fP << 191 if ( fParticleDataMap[k].find(name) == fParticleDataMap[k].end()) { 225 (fParticleDataMap[k])[name] = Particle << 192 (fParticleDataMap[k])[name] 226 localData.fCount, localData.fEmean, << 193 = ParticleData(localData.fCount, >> 194 localData.fEmean, >> 195 localData.fEmin, >> 196 localData.fEmax); 227 } 197 } 228 else { 198 else { 229 ParticleData& data = (fParticleDataMap << 199 ParticleData& data = (fParticleDataMap[k])[name]; 230 data.fCount += localData.fCount; 200 data.fCount += localData.fCount; 231 data.fEmean += localData.fEmean; 201 data.fEmean += localData.fEmean; 232 G4double emin = localData.fEmin; 202 G4double emin = localData.fEmin; 233 if (emin < data.fEmin) data.fEmin = em 203 if (emin < data.fEmin) data.fEmin = emin; 234 G4double emax = localData.fEmax; 204 G4double emax = localData.fEmax; 235 if (emax > data.fEmax) data.fEmax = em << 205 if (emax > data.fEmax) data.fEmax = emax; 236 data.fTmean = localData.fTmean; << 237 } 206 } 238 } 207 } 239 } 208 } 240 209 241 G4Run::Merge(run); << 210 G4Run::Merge(run); 242 } << 211 } 243 212 244 //....oooOO0OOooo........oooOO0OOooo........oo 213 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 245 214 246 void Run::EndOfRun() << 215 void Run::EndOfRun() 247 { 216 { 248 G4int prec = 5, wid = prec + 2; << 217 G4int prec = 5, wid = prec + 2; 249 G4int dfprec = G4cout.precision(prec); << 218 G4int dfprec = G4cout.precision(prec); 250 219 251 // run conditions << 220 //run conditions 252 // << 221 // 253 G4String partName = fParticle->GetParticleNa 222 G4String partName = fParticle->GetParticleName(); 254 G4int nbOfAbsor = fDetector->GetNbOfAbsor(); << 223 G4int nbOfAbsor = fDetector->GetNbOfAbsor(); 255 << 224 256 G4cout << "\n ======================== run s 225 G4cout << "\n ======================== run summary =====================\n"; 257 G4cout << "\n The run is " << numberOfEvent << 226 G4cout 258 << G4BestUnit(fEkin, "Energy") << " t << 227 << "\n The run is " << numberOfEvent << " "<< partName << " of " 259 for (G4int i = 1; i <= nbOfAbsor; i++) { << 228 << G4BestUnit(fEkin,"Energy") 260 G4Material* material = fDetector->GetAbsor << 229 << " through " << nbOfAbsor << " absorbers: \n"; 261 G4double thickness = fDetector->GetAbsorTh << 230 for (G4int i=1; i<= nbOfAbsor; i++) { 262 G4double density = material->GetDensity(); << 231 G4Material* material = fDetector->GetAbsorMaterial(i); 263 G4cout << std::setw(5) << i << std::setw(1 << 232 G4double thickness = fDetector->GetAbsorThickness(i); 264 << material->GetName() << " (densit << 233 G4double density = material->GetDensity(); 265 << G4endl; << 234 G4cout << std::setw(5) << i 266 } << 235 << std::setw(10) << G4BestUnit(thickness,"Length") << " of " 267 << 236 << material->GetName() << " (density: " 268 if (numberOfEvent == 0) { << 237 << G4BestUnit(density,"Volumic Mass") << ")" << G4endl; 269 G4cout.precision(dfprec); << 238 } 270 return; << 271 } << 272 239 >> 240 if (numberOfEvent == 0) { G4cout.precision(dfprec); return;} >> 241 273 G4cout.precision(3); 242 G4cout.precision(3); 274 << 243 275 // frequency of processes << 244 //frequency of processes 276 // 245 // 277 G4cout << "\n Process calls frequency :" << 246 G4cout << "\n Process calls frequency :" << G4endl; 278 G4int index = 0; 247 G4int index = 0; 279 std::map<G4String, G4int>::iterator it; << 248 std::map<G4String,G4int>::iterator it; 280 for (it = fProcCounter.begin(); it != fProcC 249 for (it = fProcCounter.begin(); it != fProcCounter.end(); it++) { 281 G4String procName = it->first; << 250 G4String procName = it->first; 282 G4int count = it->second; << 251 G4int count = it->second; 283 G4String space = " "; << 252 G4String space = " "; if (++index%3 == 0) space = "\n"; 284 if (++index % 3 == 0) space = "\n"; << 253 G4cout << " " << std::setw(20) << procName << "="<< std::setw(7) << count 285 G4cout << " " << std::setw(20) << procName << 254 << space; 286 } 255 } 287 G4cout << G4endl; 256 G4cout << G4endl; 288 << 257 289 // Edep in absorbers << 258 //Edep in absorbers 290 // 259 // 291 for (G4int i = 1; i <= nbOfAbsor; i++) { << 260 for (G4int i=1; i<= nbOfAbsor; i++) { 292 fEdeposit[i] /= numberOfEvent; << 261 fEdeposit[i] /= numberOfEvent; 293 262 294 G4cout << "\n Edep in absorber " << i << " << 263 G4cout 295 << G4BestUnit(fEmin[i], "Energy") < << 264 << "\n Edep in absorber " << i << " = " >> 265 << G4BestUnit(fEdeposit[i],"Energy") >> 266 << "\t(" << G4BestUnit(fEmin[i], "Energy") >> 267 << "-->" << G4BestUnit(fEmax[i], "Energy") >> 268 << ")"; 296 } 269 } 297 G4cout << G4endl; 270 G4cout << G4endl; 298 271 299 if (nbOfAbsor > 1) { 272 if (nbOfAbsor > 1) { 300 fTotEdep[0] /= numberOfEvent; 273 fTotEdep[0] /= numberOfEvent; 301 G4cout << "\n Edep in all absorb = " << G4 << 274 G4cout 302 << G4BestUnit(fTotEdep[1], "Energy" << 275 << "\n Edep in all absorbers = " << G4BestUnit(fTotEdep[0],"Energy") 303 << G4endl; << 276 << "\t(" << G4BestUnit(fTotEdep[1], "Energy") >> 277 << "-->" << G4BestUnit(fTotEdep[2], "Energy") >> 278 << ")" << G4endl; 304 } 279 } 305 280 306 // Eleak << 281 //particles count in absorbers 307 // 282 // 308 fEleak[0] /= numberOfEvent; << 283 for (G4int k=1; k<= nbOfAbsor; k++) { 309 G4cout << " Energy leakage = " << G4Best << 284 G4cout << "\n List of generated particles in absorber " << k << ":" << G4endl; 310 << G4BestUnit(fEleak[1], "Energy") << << 311 << G4endl; << 312 285 313 // Etotal << 286 std::map<G4String,ParticleData>::iterator itc; 314 // << 287 for (itc = fParticleDataMap[k].begin(); 315 fEtotal[0] /= numberOfEvent; << 288 itc != fParticleDataMap[k].end(); itc++) { 316 G4cout << " Energy total = " << G4Best << 289 G4String name = itc->first; 317 << G4BestUnit(fEtotal[1], "Energy") < << 290 ParticleData data = itc->second; 318 << G4endl; << 291 G4int count = data.fCount; 319 << 292 G4double eMean = data.fEmean/count; 320 // particles count in absorbers << 293 G4double eMin = data.fEmin; 321 // << 294 G4double eMax = data.fEmax; 322 for (G4int k = 1; k <= nbOfAbsor; k++) { << 295 323 G4cout << "\n List of created particles in << 296 G4cout << " " << std::setw(13) << name << ": " << std::setw(7) << count 324 << 297 << " Emean = " << std::setw(wid) << G4BestUnit(eMean, "Energy") 325 std::map<G4String, ParticleData>::iterator << 298 << "\t( " << G4BestUnit(eMin, "Energy") 326 for (itc = fParticleDataMap[k].begin(); it << 299 << " --> " << G4BestUnit(eMax, "Energy") 327 G4String name = itc->first; << 300 << ")" << G4endl; 328 ParticleData data = itc->second; << 329 G4int count = data.fCount; << 330 G4double eMean = data.fEmean / count; << 331 G4double eMin = data.fEmin; << 332 G4double eMax = data.fEmax; << 333 G4double meanLife = data.fTmean; << 334 << 335 G4cout << " " << std::setw(13) << name << 336 << " Emean = " << std::setw(wid) << 337 << G4BestUnit(eMin, "Energy") << << 338 if (meanLife >= 0.) << 339 G4cout << "\tmean life = " << G4BestUn << 340 else << 341 G4cout << "\tstable" << G4endl; << 342 } 301 } 343 } 302 } 344 // particles emerging from absorbers << 303 //particles emerging from absorbers 345 // 304 // 346 G4cout << "\n List of particles emerging fro 305 G4cout << "\n List of particles emerging from absorbers :" << G4endl; 347 << 306 348 std::map<G4String, ParticleData>::iterator i << 307 std::map<G4String,ParticleData>::iterator itc; 349 for (itc = fParticleDataMap[0].begin(); itc << 308 for (itc = fParticleDataMap[0].begin(); >> 309 itc != fParticleDataMap[0].end(); itc++) { 350 G4String name = itc->first; 310 G4String name = itc->first; 351 ParticleData data = itc->second; 311 ParticleData data = itc->second; 352 G4int count = data.fCount; 312 G4int count = data.fCount; 353 G4double eMean = data.fEmean / count; << 313 G4double eMean = data.fEmean/count; 354 G4double eMin = data.fEmin; 314 G4double eMin = data.fEmin; 355 G4double eMax = data.fEmax; 315 G4double eMax = data.fEmax; 356 /// G4double meanLife = data.fTmean; << 357 316 358 G4cout << " " << std::setw(13) << name << 317 G4cout << " " << std::setw(13) << name << ": " << std::setw(7) << count 359 << " Emean = " << std::setw(wid) < << 318 << " Emean = " << std::setw(wid) << G4BestUnit(eMean, "Energy") 360 << G4BestUnit(eMin, "Energy") << " << 319 << "\t( " << G4BestUnit(eMin, "Energy") >> 320 << " --> " << G4BestUnit(eMax, "Energy") >> 321 << ")" << G4endl; 361 } 322 } 362 323 363 // transmission coefficients << 324 //transmission coefficients 364 // 325 // 365 G4double dNofEvents = double(numberOfEvent); 326 G4double dNofEvents = double(numberOfEvent); 366 G4double absorbed = 100. * fStatus[0] / dNof << 327 G4double absorbed = 100.*fStatus[0]/dNofEvents; 367 G4double transmit = 100. * fStatus[1] / dNof << 328 G4double transmit = 100.*fStatus[1]/dNofEvents; 368 G4double reflected = 100. * fStatus[2] / dNo << 329 G4double reflected = 100.*fStatus[2]/dNofEvents; 369 << 330 370 G4cout.precision(2); << 331 G4cout.precision(2); 371 G4cout << "\n Nb of events with primary abso << 332 G4cout 372 << " transmit = " << transmit << " << 333 << "\n Nb of events with primary absorbed = " << absorbed << " %," 373 << " reflected = " << reflected << << 334 << " transmit = " << transmit << " %," >> 335 << " reflected = " << reflected << " %" << G4endl; 374 336 375 // normalize histograms of longitudinal ener 337 // normalize histograms of longitudinal energy profile 376 // 338 // 377 G4AnalysisManager* analysisManager = G4Analy 339 G4AnalysisManager* analysisManager = G4AnalysisManager::Instance(); 378 G4int ih = 10; 340 G4int ih = 10; 379 G4double binWidth = analysisManager->GetH1Wi << 341 G4double binWidth = analysisManager->GetH1Width(ih) 380 G4double fac = (1. / (numberOfEvent * binWid << 342 *analysisManager->GetH1Unit(ih); 381 analysisManager->ScaleH1(ih, fac); << 343 G4double fac = (1./(numberOfEvent*binWidth))*(mm/MeV); >> 344 analysisManager->ScaleH1(ih,fac); 382 345 383 // remove all contents in fProcCounter, fCou << 346 //remove all contents in fProcCounter, fCount 384 fProcCounter.clear(); 347 fProcCounter.clear(); 385 for (G4int k = 0; k <= nbOfAbsor; k++) << 348 for (G4int k=0; k<= nbOfAbsor; k++) fParticleDataMap[k].clear(); 386 fParticleDataMap[k].clear(); << 387 349 388 // reset default formats 350 // reset default formats 389 G4cout.precision(dfprec); 351 G4cout.precision(dfprec); 390 } 352 } 391 353 392 //....oooOO0OOooo........oooOO0OOooo........oo 354 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 393 355