35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
37 #include "HistoManager.hh"
52 :fDetector(det),fKinematic(kin), fProcCounter(0), fMateWall(0),fMateCavity(0)
102 if ( analysisManager->IsActive() ) {
103 analysisManager->OpenFile();
117 std::ios::fmtflags mode =
G4cout.flags();
118 G4cout.setf(std::ios::fixed,std::ios::floatfield);
129 G4cout <<
"\n ======================== run summary ======================\n";
134 <<
G4BestUnit(energy,
"Energy") <<
" through 2*"
139 G4cout <<
"\n the cavity is "
140 <<
G4BestUnit(fCavityThickness,
"Length") <<
" of "
142 <<
G4BestUnit(fDensityCavity,
"Volumic Mass") <<
"); Mass = "
145 G4cout<<
"\n ============================================================\n";
149 G4cout <<
"\n Process calls frequency --->";
151 G4String procName = (*fProcCounter)[i]->GetName();
152 G4int count = (*fProcCounter)[i]->GetCounter();
153 G4cout <<
" " << procName <<
"= " << count;
160 G4cout <<
"\n Gamma crossSections in wall material :";
163 G4String procName = (*fProcCounter)[i]->GetName();
167 if (massSigma > 0.) {
169 G4cout <<
" " << procName <<
"= "
180 G4double varianceEsec = meanEsecond2 - meanEsecond*meanEsecond;
182 if (varianceEsec>0.) dToverT = std::sqrt(varianceEsec/
fNbSec)/meanEsecond;
188 <<
"\n Mean energy of secondary e- = " <<
G4BestUnit(meanEsecond,
"Energy")
189 <<
" +- " << 100*dToverT <<
" %"
190 <<
" (--> range in wall material = " <<
G4BestUnit(csdaRange,
"Length")
198 G4cout <<
" Mass_energy_transfer coef: "
212 <<
"\n StoppingPower in wall = "
215 <<
G4BestUnit(dedxCavity,
"Energy*Surface/Mass")
221 <<
"\n Charged particle flow in cavity :"
240 G4double varianceEdep = meanEdep2 - meanEdep*meanEdep;
242 if(varianceEdep>0.) dEoverE=std::sqrt(varianceEdep/
fNbEventCavity)/meanEdep;
255 <<
" +- " << 100*dEoverE <<
" %"
257 <<
" (mean value = " <<
G4BestUnit(meantrack,
"Length") <<
")"
258 <<
"\n Total dose in cavity = " << doseCavity/(
MeV/
mg) <<
" MeV/mg"
259 <<
"\n Dose/EnergyFluence = " <<
G4BestUnit(doseOverBeam,
"Surface/Mass")
264 G4double ratio = doseOverBeam/massTransfCoef;
265 G4double error = ratio*std::sqrt(dEoverE*dEoverE + dToverT*dToverT);
269 <<
"\n (Dose/EnergyFluence)/Mass_energy_transfer = " << ratio
270 <<
" +- " << error <<
G4endl;
276 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
280 <<
"\n StepSize of ch. tracks in wall = "
286 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
289 <<
"\n StepSize of ch. tracks in cavity = "
296 G4cout.setf(mode,std::ios::floatfield);
312 if (NbofEvents == 0)
return;
332 G4double doseOverBeam = doseCavity*surfaceBeam/(NbofEvents*beamEnergy);
338 std::ios::fmtflags mode =
G4cout.flags();
339 G4cout.setf(std::ios::fixed,std::ios::floatfield);
342 G4cout <<
"\n ---> NbofEvents= " << NbofEvents
343 <<
" NbOfelectr= " <<
fNbSec
344 <<
" Tkin= " <<
G4BestUnit(meanEsecond,
"Energy")
345 <<
" (" << rateEmean <<
" %)"
347 <<
" Dose/EnFluence= " <<
G4BestUnit(doseOverBeam,
"Surface/Mass")
348 <<
" (" << rateDose <<
" %)"
352 G4cout.setf(mode,std::ios::floatfield);
360 const Run* localRun =
static_cast<const Run*
>(run);
387 std::vector<OneProcessCount*>::iterator it;
407 while ((i<nbProc)&&((*
fProcCounter)[i]->GetName()!=procName)) i++;
410 (*fProcCounter)[i]->Count();
G4Material * GetWallMaterial()
DetectorConstruction * fDetector
static constexpr double MeV
G4double GetCavityRadius()
G4double GetCavityThickness()
std::vector< OneProcessCount * > ProcessesCount
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
const G4String & GetParticleName() const
G4ParticleGun * GetParticleGun()
G4Material * GetCavityMaterial()
const G4String & GetName() const
G4long fPartFlowCavity[2]
G4double GetWallThickness()
static constexpr double mg
virtual void Merge(const G4Run *)
The primary generator action class with particle gun.
G4CsvAnalysisManager G4AnalysisManager
G4double fCavityThickness
static G4Electron * Electron()
std::map< G4String, G4int > fProcCounter
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4double ComputeCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)
void CountProcesses(G4String procName)
G4double GetParticleEnergy() const
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
G4double fEnerFlowCavity[2]
G4GLOB_DLL std::ostream G4cout
static PROLOG_HANDLER error
virtual void Merge(const G4Run *)
void SurveyConvergence(G4int)
G4ParticleDefinition * GetParticleDefinition() const
PrimaryGeneratorAction * fKinematic
Simple detector construction with a box volume placed in a world.
static constexpr double pi
G4double GetDensity() const