33 #include "RunAction.hh"
34 #include "DetectorConstruction.hh"
35 #include "PrimaryGeneratorAction.hh"
36 #include "HistoManager.hh"
102 std::map<G4String,G4int>::iterator
it =
fProcCounter.find(procName);
214 if (nbEvents == 0)
return;
226 G4cout <<
"\n ======================== run summary ======================\n";
227 G4cout <<
"\n The run was " << nbEvents <<
" " << partName <<
" of "
228 <<
G4BestUnit(ePrimary,
"Energy") <<
" through "
230 << material->
GetName() <<
" (density: "
244 G4int count = procCounter.second;
245 G4String space =
" ";
if (++index%4 == 0) space =
"\n";
246 G4cout <<
" " << std::setw(15) << procName <<
"="<< std::setw(7) << count
258 <<
"\n TrackLength = "
260 <<
" nb of steps = " << nbStepPerEvent
261 <<
" stepSize = " <<
G4BestUnit(stepSize,
"Length")
271 <<
"\n Energy continuously deposited along primary track"
272 <<
" (restricted dE/dx) dE1 = "
284 G4double etry = ePrimary - energyPerEvent;
287 G4double dEtable = ePrimary - efinal;
289 if (dEtable > 0.) ratio = energyPerEvent/dEtable;
292 <<
"\n Evaluation of dE1 from reading restricted Range table : dE1_table = "
294 <<
" ---> dE1/dE1_table = " << ratio
299 G4cout <<
"\n Energy transfered to secondary particles :" <<
G4endl;
300 std::map<G4String,MinMaxData>::iterator it1;
303 MinMaxData
data = it1->second;
304 energyPerEvent = data.fVsum/nbEvents;
308 G4cout <<
" " << std::setw(17) <<
"due to " + name <<
": dE2 = "
309 << std::setw(6) <<
G4BestUnit(energyPerEvent,
"Energy")
320 <<
"\n Total energy transfered to secondaries : dE3 = sum of dE2 = "
331 <<
"\n Total energy lost by incident particle : dE4 = dE1 + dE3 = "
342 <<
"\n calcul of dE4 from energy balance : dE4_bal = E_in - E_out = "
351 r1 = r0 - trackLPerEvent;
352 etry = ePrimary - energyPerEvent;
355 dEtable = ePrimary - efinal;
357 if (dEtable > 0.) ratio = energyPerEvent/dEtable;
360 <<
"\n Evaluation of dE4 from reading full Range table : dE4_table = "
362 <<
" ---> dE4/dE4_table = " << ratio
367 G4cout <<
"\n Energy spectrum of secondary particles :" <<
G4endl;
368 std::map<G4String,MinMaxData>::iterator it2;
371 MinMaxData
data = it2->second;
372 G4int count = data.fCount;
377 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
378 <<
" Emean = " << std::setw(6) <<
G4BestUnit(eMean,
"Energy")
392 <<
"\n Energy continuously deposited along secondary tracks"
393 <<
" (restricted dE/dx) dE5 = "
404 <<
"\n Total energy deposited : dE6 = dE1 + dE5 = "
415 fProcCounter.clear();
421 if ( analysisManager->
IsActive() ) {
422 analysisManager->
Write();
440 G4int iter = 0 , itermax = 10;
441 while (err > errmax && iter < itermax) {
446 dEdx = emCal.
GetDEDX(Energy,particle,material);
450 if (iter == itermax) {
452 <<
"\n ---> warning: RunAction::GetEnergyFromRestRange() did not converge"
454 <<
" Energy = " <<
G4BestUnit(Energy,
"Energy")
456 <<
" iter = " << iter <<
G4endl;
472 G4int iter = 0 , itermax = 10;
473 while (err > errmax && iter < itermax) {
482 if (iter == itermax) {
484 <<
"\n ---> warning: RunAction::GetEnergyFromCSDARange() did not converge"
486 <<
" Energy = " <<
G4BestUnit(Energy,
"Energy")
488 <<
" iter = " << iter <<
G4endl;