42 #include "HistoManager.hh"
50 #include "EmAcceptance.hh"
78 fMaxEnergy = 50.0*
MeV;
80 fMaxEnergyAbs = 10.*
MeV;
105 fHisto->
Add1D(
"10",
"Evis/E0 in central crystal",fBinsED,0.0,1,1.0);
106 fHisto->
Add1D(
"11",
"Evis/E0 in 3x3",fBinsED,0.0,1.0,1.0);
107 fHisto->
Add1D(
"12",
"Evis/E0 in 5x5",fBinsED,0.0,1.0,1.0);
108 fHisto->
Add1D(
"13",
"Energy (MeV) of delta-electrons",
109 fBinsE,0.0,fMaxEnergy,
MeV);
110 fHisto->
Add1D(
"14",
"Energy (MeV) of gammas",fBinsE,0.0,fMaxEnergy,
MeV);
111 fHisto->
Add1D(
"15",
"Energy (MeV) in abs1",fBinsEA,0.0,fMaxEnergyAbs,
MeV);
112 fHisto->
Add1D(
"16",
"Energy (MeV) in abs2",fBinsEA,0.0,fMaxEnergyAbs,
MeV);
113 fHisto->
Add1D(
"17",
"Energy (MeV) in abs3",fBinsEA,0.0,fMaxEnergyAbs,
MeV);
114 fHisto->
Add1D(
"18",
"Energy (MeV) in abs4",fBinsEA,0.0,fMaxEnergyAbs,
MeV);
115 fHisto->
Add1D(
"19",
"Number of vertex hits",20,-0.5,19.5,1.0);
116 fHisto->
Add1D(
"20",
"E1/E9 Ratio",fBinsED,0.0,1,1.0);
117 fHisto->
Add1D(
"21",
"E1/E25 Ratio",fBinsED,0.0,1.0,1.0);
118 fHisto->
Add1D(
"22",
"E9/E25 Ratio",fBinsED,0.0,1.0,1.0);
133 for(
G4int i=0; i<6; i++) {
144 fBrem.resize(93,0.0);
145 fPhot.resize(93,0.0);
146 fComp.resize(93,0.0);
147 fConv.resize(93,0.0);
150 for(
G4int i=0; i<fNmax; i++) {
161 G4cout <<
"HistoManager: Histograms are booked and run has been started"
172 G4cout <<
"HistoManager: End of run actions are started RunID# "
174 G4String nam[6] = {
"1x1",
"3x3",
"5x5",
"E1/E9 ",
"E1/E25",
"E9/E25"};
178 G4cout<<
"================================================================="
181 if(fEvt > 0) x = 1.0/
x;
183 for(j=0; j<fNmax; j++) {
187 G4double y = fErms[j]*x - fEdep[j]*fEdep[j];
189 fErms[j] = std::sqrt(y);
193 if(xx > 0.0) xx = 1.0/
xx;
195 y = fErmstr[j]*xx - fEdeptr[j]*fEdeptr[j];
197 fErmstr[j] = std::sqrt(y);
207 G4cout << std::setprecision(4) <<
"Average number of e- " << xe <<
G4endl;
208 G4cout << std::setprecision(4) <<
"Average number of gamma " << xg <<
G4endl;
209 G4cout << std::setprecision(4) <<
"Average number of e+ " << xp <<
G4endl;
210 G4cout << std::setprecision(4) <<
"Average number of steps " << xs <<
G4endl;
216 if(xx > 0.0) xx = 1.0/
xx;
218 G4cout << std::setprecision(4) <<
"Edep " << nam[j]
221 if(ex > 0.1)
G4cout <<
" res= " << f*sx/ex <<
" % " << fStat[j];
224 if(fLimittrue[0] < 10. || fLimittrue[1] < 10. || fLimittrue[2] < 10.) {
225 G4cout<<
"=========== Mean values without trancating ====================="<<
G4endl;
226 for(j=0; j<fNmax; j++) {
230 G4cout << std::setprecision(4) <<
"Edep " << nam[j]
233 if(ex > 0.0)
G4cout <<
" res= " << f*sx/ex <<
" %";
237 G4cout<<
"=========== Ratios without trancating ==========================="<<
G4endl;
241 if(xx > 0.0) xx = 1.0/
xx;
245 if(y > 0.0) r = std::sqrt(y*xx);
246 G4cout <<
" " << nam[j] <<
" = " << e
250 G4cout << std::setprecision(4) <<
"Beam Energy " << fBeamEnergy/
GeV
252 if(fLowe > 0)
G4cout <<
"Number of events E/E0<0.8 " << fLowe <<
G4endl;
253 G4cout<<
"=================================================================="<<
G4endl;
258 for(
G4int i=0; i<fNHisto; i++) {
263 if(0 < runID) {
return; }
268 for (j=0; j<fNmax; j++) {
285 G4cout <<
" Z bremsstrahlung photoeffect compton conversion" <<
G4endl;
286 for(j=1; j<93; ++j) {
291 if(n1 + n2 + n3 + n4 > 0) {
292 G4cout << std::setw(4) << j << std::setw(12) << n1 << std::setw(12) << n2
293 << std::setw(12) << n3 << std::setw(12) << n4 <<
G4endl;
310 for (
G4int i=0; i<25; i++) {
321 for (
G4int i=0; i<25; i++) {
322 fE[i] /= fBeamEnergy;
324 if( ( 6<=i && 8>=i) || (11<=i && 13>=i) || (16<=i && 18>=i)) e9 += fE[i];
327 if(1 < fVerbose && e25 < 0.8) {
329 G4cout <<
"### in the event# " << fEvt <<
" E25= " << e25 <<
G4endl;
344 fErms[4] += e125*e125;
346 fErms[5] += e925*e925;
353 fHisto->
Fill(0,e0,1.0);
354 fHisto->
Fill(1,e9,1.0);
355 fHisto->
Fill(2,e25,1.0);
356 fHisto->
Fill(5,fEabs1,1.0);
357 fHisto->
Fill(6,fEabs2,1.0);
358 fHisto->
Fill(7,fEabs3,1.0);
359 fHisto->
Fill(8,fEabs4,1.0);
361 fHisto->
Fill(10,e19,1.0);
362 fHisto->
Fill(11,e125,1.0);
363 fHisto->
Fill(12,e925,1.0);
374 if(std::abs(e0-fEdeptrue[0])<fRmstrue[0]*fLimittrue[0]) {
379 if(std::abs(e9-fEdeptrue[1])<fRmstrue[1]*fLimittrue[1]) {
384 if(std::abs(e25-fEdeptrue[2])<fRmstrue[2]*fLimittrue[2]) {
387 fErmstr[2] += e25*e25;
414 G4cout <<
"TrackingAction: Primary kinE(MeV)= " << kinE/
MeV
415 <<
"; m(MeV)= " << mass/
MeV
416 <<
"; pos= " << pos <<
"; dir= " << dir <<
G4endl;
428 if(Z > 0 && Z < 93) { fBrem[
Z] += 1.0; }
432 static_cast<const G4VEmProcess*
>(proc)->GetCurrentElement();
435 if(Z > 0 && Z < 93) { fPhot[
Z] += 1.0; }
439 static_cast<const G4VEmProcess*
>(proc)->GetCurrentElement();
442 if(Z > 0 && Z < 93) { fConv[
Z] += 1.0; }
446 static_cast<const G4VEmProcess*
>(proc)->GetCurrentElement();
449 if(Z > 0 && Z < 93) { fComp[
Z] += 1.0; }
454 if (particle == fElectron) {
456 G4cout <<
"TrackingAction: Secondary electron " <<
G4endl;
460 }
else if (particle == fPositron) {
462 G4cout <<
"TrackingAction: Secondary positron " <<
G4endl;
466 }
else if (particle == fGamma) {
468 G4cout <<
"TrackingAction: Secondary gamma; parentID= " << pid
469 <<
" E= " << kinE <<
G4endl;
481 G4cout <<
"HistoManager::AddEnergy: e(keV)= " << edep/
keV
482 <<
"; volIdx= " << volIndex
483 <<
"; copyNo= " << copyNo
488 }
else if (1 == volIndex) {
490 }
else if (2 == volIndex) {
492 }
else if (3 == volIndex) {
494 }
else if (4 == volIndex) {
496 }
else if (5 == volIndex) {
497 G4int n = fNvertex.size();
500 for(
G4int i=0; i<
n; i++) {
501 if (copyNo == fNvertex[i]) {
509 fNvertex.push_back(copyNo);
510 fEvertex.push_back(edep);
521 fHisto->
Fill(3,e,1.0);
530 fHisto->
Fill(4,e,1.0);
537 if(i<fNmax && i>=0) {
538 if(val[0] > 0.0) fEdeptrue[i] = val[0];
539 if(val[1] > 0.0) fRmstrue[i] = val[1];
540 if(val[2] > 0.0) fLimittrue[i] = val[2];