34 #include "DetectorConstruction.hh"
35 #include "PrimaryGeneratorAction.hh"
36 #include "HistoManager.hh"
51 :
G4Run(),fDetector(det), fKinematic(kin), fProcCounter(0),
52 fEdepCavity(0.), fEdepCavity2(0.),
53 fTrkSegmCavity(0.), fNbEventCavity(0),
54 fStepWall(0.), fStepWall2(0.),
55 fStepCavity(0.), fStepCavity2(0.),
56 fNbStepWall(0), fNbStepCavity(0),
57 fEnergyGun(0.), fMassWall(0.),
58 fMassCavity(0.),fIsMaster(isMaster)
82 G4double effWallThick = factor*RangeWall;
83 if ((effWallThick > wallThickness)||(effWallThick <= 0.))
84 effWallThick = wallThickness;
101 std::ios::fmtflags mode =
G4cout.flags();
102 G4cout.setf(std::ios::fixed,std::ios::floatfield);
105 G4cout <<
"\n ===================== run conditions =====================\n";
109 <<
G4BestUnit(effWallThick,
"Length") <<
" of "
110 << mateWall->
GetName() <<
" (density: "
111 <<
G4BestUnit(densityWall,
"Volumic Mass") <<
"); Mass/cm2 = "
115 G4cout <<
"\n the cavity is "
116 <<
G4BestUnit(cavityThickness,
"Length") <<
" of "
117 << mateCavity->
GetName() <<
" (density: "
118 <<
G4BestUnit(densityCavity,
"Volumic Mass") <<
"); Mass/cm2 = "
120 <<
" --> massRatio = "<< std::setprecision(6) << massRatio <<
G4endl;
124 <<
"; range in cavity: " <<
G4BestUnit(RangeCavity,
"Length")
127 G4cout <<
"\n ==========================================================\n";
133 dedxWall /= densityWall;
136 dedxCavity /= densityCavity;
138 G4cout << std::setprecision(4)
139 <<
"\n StoppingPower in wall = "
142 <<
G4BestUnit(dedxCavity,
"Energy*Surface/Mass")
166 G4cout.setf(mode,std::ios::floatfield);
172 if ( analysisManager->
IsActive() ) {
192 while ((i<nbProc)&&((*
fProcCounter)[i]->GetName()!=procName)) i++;
195 (*fProcCounter)[i]->Count();
202 if (NbofEvents == 0)
return;
223 std::ios::fmtflags mode =
G4cout.flags();
224 G4cout.setf(std::ios::fixed,std::ios::floatfield);
227 G4cout <<
"--->evntNb= " << NbofEvents
228 <<
" Nwall= " << Nwall
229 <<
" Ncav= " << Ncavity
230 <<
" Ic/Iw= " << Iratio
232 <<
" doseCavity/Ebeam= " << ratio
233 <<
" (100*(ratio-1) = " << err <<
" %) \n"
237 G4cout.setf(mode,std::ios::floatfield);
247 std::ios::fmtflags mode =
G4cout.flags();
248 G4cout.setf(std::ios::fixed,std::ios::floatfield);
256 G4cout <<
"\n Process calls frequency --->";
258 G4String procName = (*fProcCounter)[i]->GetName();
259 G4int count = (*fProcCounter)[i]->GetCounter();
260 G4cout <<
" " << procName <<
"= " << count;
267 <<
"\n Charged particle flow in cavity :"
288 <<
"\n beamFluence in wall = " << Nwall
289 <<
"\t in cavity = " << Ncavity
290 <<
"\t Icav/Iwall = " << Iratio
291 <<
"\t energyFluence = " << energyFluence/(
MeV*
cm2/
mg) <<
" MeV*cm2/mg"
299 G4double varianceEdep = meanEdep2 - meanEdep*meanEdep;
301 if(varianceEdep>0.) dEoverE = std::sqrt(varianceEdep/
fNbEventCavity)/meanEdep;
307 G4double ratio = doseCavity/energyFluence,
error = ratio*dEoverE;
311 <<
" +- " << 100*dEoverE <<
" %"
312 <<
"\n Total dose in cavity = " << doseCavity/(
MeV*
cm2/
mg) <<
" MeV*cm2/mg"
313 <<
" +- " << 100*dEoverE <<
" %"
314 <<
"\n\n DoseCavity/EnergyFluence = " << ratio
315 <<
" +- " << error << G4endl;
323 <<
"\n Total charged trackLength in cavity = "
325 <<
" (mean value = " <<
G4BestUnit(meantrack,
"Length") <<
")"
332 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
336 <<
"\n StepSize of ch. tracks in wall = "
338 <<
"\t (nbSteps/track = " << double(
fNbStepWall)/nbTrackWall <<
")";
342 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
345 <<
"\n StepSize of ch. tracks in cavity = "
352 G4cout.setf(mode,std::ios::floatfield);
371 const Run* localRun =
static_cast<const Run*
>(run);
394 std::vector<OneProcessCount*>::iterator
it;