44 #include "HistoManager.hh"
52 #include "EmAcceptance.hh"
84 fMaxEnergy = 50.0*
MeV;
86 fMaxEnergyAbs = 10.*
MeV;
111 fHisto->Add1D(
"10",
"Evis/E0 in central crystal",fBinsED,0.0,1,1.0);
112 fHisto->Add1D(
"11",
"Evis/E0 in 3x3",fBinsED,0.0,1.0,1.0);
113 fHisto->Add1D(
"12",
"Evis/E0 in 5x5",fBinsED,0.0,1.0,1.0);
114 fHisto->Add1D(
"13",
"Energy (MeV) of delta-electrons",
115 fBinsE,0.0,fMaxEnergy,
MeV);
116 fHisto->Add1D(
"14",
"Energy (MeV) of gammas",fBinsE,0.0,fMaxEnergy,
MeV);
117 fHisto->Add1D(
"15",
"Energy (MeV) in abs1",fBinsEA,0.0,fMaxEnergyAbs,
MeV);
118 fHisto->Add1D(
"16",
"Energy (MeV) in abs2",fBinsEA,0.0,fMaxEnergyAbs,
MeV);
119 fHisto->Add1D(
"17",
"Energy (MeV) in abs3",fBinsEA,0.0,fMaxEnergyAbs,
MeV);
120 fHisto->Add1D(
"18",
"Energy (MeV) in abs4",fBinsEA,0.0,fMaxEnergyAbs,
MeV);
121 fHisto->Add1D(
"19",
"Number of vertex hits",20,-0.5,19.5,1.0);
122 fHisto->Add1D(
"20",
"E1/E9 Ratio",fBinsED,0.0,1,1.0);
123 fHisto->Add1D(
"21",
"E1/E25 Ratio",fBinsED,0.0,1.0,1.0);
124 fHisto->Add1D(
"22",
"E9/E25 Ratio",fBinsED,0.0,1.0,1.0);
139 for(
G4int i=0; i<6; i++) {
150 fBrem.resize(93,0.0);
151 fPhot.resize(93,0.0);
152 fComp.resize(93,0.0);
153 fConv.resize(93,0.0);
156 for(
G4int i=0; i<fNmax; i++) {
162 if(fHisto->IsActive()) {
163 for(
G4int i=0; i<fNHisto; ++i) {fHisto->Activate(i,
true); }
167 G4cout <<
"HistoManager: Histograms are booked and run has been started"
178 G4cout <<
"HistoManager: End of run actions are started RunID# "
180 G4String nam[6] = {
"1x1",
"3x3",
"5x5",
"E1/E9 ",
"E1/E25",
"E9/E25"};
184 G4cout<<
"================================================================="
187 if(fEvt > 0) x = 1.0/
x;
189 for(j=0; j<fNmax; j++) {
193 G4double y = fErms[j]*x - fEdep[j]*fEdep[j];
195 fErms[j] = std::sqrt(y);
199 if(xx > 0.0) xx = 1.0/xx;
201 y = fErmstr[j]*xx - fEdeptr[j]*fEdeptr[j];
203 fErmstr[j] = std::sqrt(y);
213 G4cout << std::setprecision(4) <<
"Average number of e- " << xe <<
G4endl;
214 G4cout << std::setprecision(4) <<
"Average number of gamma " << xg <<
G4endl;
215 G4cout << std::setprecision(4) <<
"Average number of e+ " << xp <<
G4endl;
216 G4cout << std::setprecision(4) <<
"Average number of steps " << xs <<
G4endl;
222 if(xx > 0.0) xx = 1.0/xx;
224 G4cout << std::setprecision(4) <<
"Edep " << nam[j]
227 if(ex > 0.1)
G4cout <<
" res= " << f*sx/ex <<
" % " << fStat[j];
230 if(fLimittrue[0] < 10. || fLimittrue[1] < 10. || fLimittrue[2] < 10.) {
232 <<
"=========== Mean values without trancating ====================="<<
G4endl;
233 for(j=0; j<fNmax; j++) {
237 G4cout << std::setprecision(4) <<
"Edep " << nam[j]
240 if(ex > 0.0)
G4cout <<
" res= " << f*sx/ex <<
" %";
245 <<
"=========== Ratios without trancating ==========================="<<
G4endl;
249 if(xx > 0.0) xx = 1.0/xx;
253 if(y > 0.0) r = std::sqrt(y*xx);
254 G4cout <<
" " << nam[j] <<
" = " << e
258 G4cout << std::setprecision(4) <<
"Beam Energy " << fBeamEnergy/
GeV
260 if(fLowe > 0)
G4cout <<
"Number of events E/E0<0.8 " << fLowe <<
G4endl;
262 <<
"=================================================================="<<
G4endl;
266 if(fHisto->IsActive()) {
267 for(
G4int i=0; i<fNHisto; i++) {
268 fHisto->ScaleH1(i,x);
272 if(0 < runID) {
return; }
277 for (j=0; j<fNmax; j++) {
294 G4cout <<
" Z bremsstrahlung photoeffect compton conversion" <<
G4endl;
295 for(j=1; j<93; ++j) {
300 if(n1 + n2 + n3 + n4 > 0) {
301 G4cout << std::setw(4) << j << std::setw(12) << n1 << std::setw(12) << n2
302 << std::setw(12) << n3 << std::setw(12) << n4 <<
G4endl;
319 for (
G4int i=0; i<25; i++) {
330 for (
G4int i=0; i<25; i++) {
331 fE[i] /= fBeamEnergy;
333 if( ( 6<=i && 8>=i) || (11<=i && 13>=i) || (16<=i && 18>=i)) e9 += fE[i];
336 if(1 < fVerbose && e25 < 0.8) {
338 G4cout <<
"### in the event# " << fEvt <<
" E25= " << e25 <<
G4endl;
353 fErms[4] += e125*e125;
355 fErms[5] += e925*e925;
362 fHisto->Fill(0,e0,1.0);
363 fHisto->Fill(1,e9,1.0);
364 fHisto->Fill(2,e25,1.0);
365 fHisto->Fill(5,fEabs1,1.0);
366 fHisto->Fill(6,fEabs2,1.0);
367 fHisto->Fill(7,fEabs3,1.0);
368 fHisto->Fill(8,fEabs4,1.0);
369 fHisto->Fill(9,
G4double(fNvertex.size()),1.0);
370 fHisto->Fill(10,e19,1.0);
371 fHisto->Fill(11,e125,1.0);
372 fHisto->Fill(12,e925,1.0);
383 if(std::abs(e0-fEdeptrue[0])<fRmstrue[0]*fLimittrue[0]) {
388 if(std::abs(e9-fEdeptrue[1])<fRmstrue[1]*fLimittrue[1]) {
393 if(std::abs(e25-fEdeptrue[2])<fRmstrue[2]*fLimittrue[2]) {
396 fErmstr[2] += e25*e25;
423 G4cout <<
"TrackingAction: Primary kinE(MeV)= " << kinE/
MeV
424 <<
"; m(MeV)= " << mass/
MeV
425 <<
"; pos= " << pos <<
"; dir= " << dir <<
G4endl;
437 if(Z > 0 && Z < 93) { fBrem[
Z] += 1.0; }
441 static_cast<const G4VEmProcess*
>(proc)->GetCurrentElement();
444 if(Z > 0 && Z < 93) { fPhot[
Z] += 1.0; }
448 static_cast<const G4VEmProcess*
>(proc)->GetCurrentElement();
451 if(Z > 0 && Z < 93) { fConv[
Z] += 1.0; }
455 static_cast<const G4VEmProcess*
>(proc)->GetCurrentElement();
458 if(Z > 0 && Z < 93) { fComp[
Z] += 1.0; }
463 if (particle == fElectron) {
465 G4cout <<
"TrackingAction: Secondary electron " <<
G4endl;
469 }
else if (particle == fPositron) {
471 G4cout <<
"TrackingAction: Secondary positron " <<
G4endl;
475 }
else if (particle == fGamma) {
477 G4cout <<
"TrackingAction: Secondary gamma; parentID= " << pid
478 <<
" E= " << kinE <<
G4endl;
490 G4cout <<
"HistoManager::AddEnergy: e(keV)= " << edep/
keV
491 <<
"; volIdx= " << volIndex
492 <<
"; copyNo= " << copyNo
497 }
else if (1 == volIndex) {
499 }
else if (2 == volIndex) {
501 }
else if (3 == volIndex) {
503 }
else if (4 == volIndex) {
505 }
else if (5 == volIndex) {
506 G4int n = fNvertex.size();
509 for(
G4int i=0; i<
n; i++) {
510 if (copyNo == fNvertex[i]) {
518 fNvertex.push_back(copyNo);
519 fEvertex.push_back(edep);
530 fHisto->Fill(3,e,1.0);
539 fHisto->Fill(4,e,1.0);
546 if(i<fNmax && i>=0) {
547 if(val[0] > 0.0) fEdeptrue[i] = val[0];
548 if(val[1] > 0.0) fRmstrue[i] = val[1];
549 if(val[2] > 0.0) fLimittrue[i] = val[2];
void AddPositron(const G4DynamicParticle *)
G4ParticleDefinition * GetDefinition() const
G4int GetParentID() const
void AddPhoton(const G4DynamicParticle *)
G4double GetKineticEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
void EmAcceptanceGauss(const G4String &title, G4int stat, G4double avr, G4double avr0, G4double rms, G4double limit)
void SetEdepAndRMS(G4int, G4ThreeVector)
void BeginOfAcceptance(const G4String &title, G4int stat)
const G4VProcess * GetCreatorProcess() const
G4GLOB_DLL std::ostream G4cout
void AddDeltaElectron(const G4DynamicParticle *)
const G4ThreeVector & GetMomentumDirection() const
const G4ThreeVector & GetVertexPosition() const
static G4Positron * Positron()
G4double GetPDGMass() const
static constexpr double GeV
void ScoreNewTrack(const G4Track *aTrack)
static G4Electron * Electron()
static constexpr double MeV
static HistoManager * GetPointer()
static constexpr double keV
G4int GetProcessSubType() const
static const G4double pos
void AddEnergy(G4double edep, G4int idx, G4int copyNo)