52 histName(
"histfile"),nbinStep(0),nbinEn(0),nbinTt(0),nbinTb(0),
53 nbinTsec(0),nbinTh(0),nbinThback(0),nbinR(0),nbinGamma(0),
59 EnergySumAbs = EnergySquareSumAbs = tlSumAbs = tlsquareSumAbs =
60 nStepSumCharged = nStepSum2Charged= nStepSumNeutral = nStepSum2Neutral=
61 TotNbofEvents = SumCharged= SumNeutral=Sum2Charged=Sum2Neutral=Selectron=
62 Spositron=Transmitted=Reflected =dStep=entryStep=underStep=overStep=
63 dEn = entryEn= underEn=overEn=dTt = entryTt=underTt=overTt=Ttmean=
64 Tt2mean=dTb = entryTb=underTb=overTb=Tbmean=Tb2mean=dTsec =entryTsec=
65 underTsec=overTsec=dTh = entryTh=underTh=overTh=dThback =entryThback=
66 underThback=overThback=dR =entryR =underR =overR =Rmean=R2mean=dEGamma=
67 entryGamma = underGamma=overGamma=dz=entryvertexz=undervertexz=
80 void Em10RunAction::bookHisto()
100 if(pVVisManager) UI->
ApplyCommand(
"/vis/scene/notifyHandlers");
104 EnergySquareSumAbs = 0.;
106 tlsquareSumAbs = 0. ;
107 nStepSumCharged = 0. ;
108 nStepSum2Charged= 0. ;
109 nStepSumNeutral = 0. ;
110 nStepSum2Neutral= 0. ;
126 dStep=(Stephigh-Steplow)/nbinStep;
130 for(
G4int ist=0; ist<200; ist++)
137 dEn = (Enhigh-Enlow)/nbinEn ;
142 for (
G4int ien=0; ien<200; ien++) distEn[ien]=0.;
146 dTt = (Tthigh-Ttlow)/nbinTt ;
151 for (
G4int itt=0; itt<200; itt++) distTt[itt]=0.;
158 dTb = (Tbhigh-Tblow)/nbinTb ;
162 for (
G4int itt=0; itt<200; itt++)
171 dTsec = (Tsechigh-Tseclow)/nbinTsec ;
175 for (
G4int its=0; its<200; its++)
182 dTh = (Thhigh-Thlow)/nbinTh ;
186 for (
G4int ith=0; ith<200; ith++)
194 dThback = (Thhighback-Thlowback)/nbinThback ;
198 for (
G4int ithback=0; ithback<200; ithback++)
200 distThback[ithback]=0.;
207 dR = (Rhigh-Rlow)/nbinR ;
211 for (
G4int ir =0; ir<200; ir++)
221 dEGamma = std::log(EhighGamma/ElowGamma)/nbinGamma ;
225 for (
G4int ig=0; ig<200; ig++)
232 dz=(zhigh-zlow)/nbinvertexz;
249 G4double sAbs,sigAbs,sigstep,sigcharged,signeutral;
250 if(0.0 >= TotNbofEvents) {
return; }
252 tlSumAbs /= TotNbofEvents ;
253 sAbs = tlsquareSumAbs/TotNbofEvents-tlSumAbs*tlSumAbs ;
255 sAbs = std::sqrt(sAbs/TotNbofEvents) ;
259 EnergySumAbs /= TotNbofEvents ;
260 sigAbs = EnergySquareSumAbs/TotNbofEvents-EnergySumAbs*EnergySumAbs;
262 sigAbs = std::sqrt(sigAbs/TotNbofEvents);
266 nStepSumCharged /= TotNbofEvents ;
267 sigstep = nStepSum2Charged/TotNbofEvents-nStepSumCharged*nStepSumCharged;
269 sigstep = std::sqrt(sigstep/TotNbofEvents);
274 nStepSumNeutral /= TotNbofEvents ;
275 sigstep = nStepSum2Neutral/TotNbofEvents-nStepSumNeutral*nStepSumNeutral;
277 sigstep = std::sqrt(sigstep/TotNbofEvents);
282 SumCharged /= TotNbofEvents;
283 sigcharged = Sum2Charged/TotNbofEvents-SumCharged*SumCharged;
285 sigcharged = std::sqrt(sigcharged/TotNbofEvents);
289 SumNeutral /= TotNbofEvents;
290 signeutral = Sum2Neutral/TotNbofEvents-SumNeutral*SumNeutral;
292 signeutral = std::sqrt(signeutral/TotNbofEvents);
296 Selectron /= TotNbofEvents ;
297 Spositron /= TotNbofEvents ;
299 Transmitted /=TotNbofEvents ;
300 Reflected /=TotNbofEvents ;
301 G4cout <<
" ================== run summary =====================" <<
G4endl;
303 G4cout <<
" end of Run TotNbofEvents = " <<
305 G4cout <<
" mean charged track length in absorber=" <<
306 tlSumAbs/
mm <<
" +- " << sAbs/
mm <<
309 G4cout <<
" mean energy deposit in absorber=" <<
310 EnergySumAbs/
MeV <<
" +- " << sigAbs/
MeV <<
313 G4cout <<
" mean number of steps in absorber (charged) =" <<
314 nStepSumCharged <<
" +- " << sigch <<
316 G4cout <<
" mean number of steps in absorber (neutral) =" <<
317 nStepSumNeutral <<
" +- " << signe <<
320 G4cout <<
" mean number of charged secondaries = " <<
321 SumCharged <<
" +- " << sigcharged <<
G4endl;
323 G4cout <<
" mean number of neutral secondaries = " <<
324 SumNeutral <<
" +- " << signeutral <<
G4endl;
327 G4cout <<
" mean number of e-s =" << Selectron <<
328 " and e+s =" << Spositron <<
G4endl;
331 G4cout <<
"(number) transmission coeff=" << Transmitted <<
332 " reflection coeff=" << Reflected <<
G4endl;
337 G4cout <<
" step number/event distribution " <<
G4endl ;
338 G4cout <<
"#entries=" << entryStep <<
" #underflows=" << underStep <<
339 " #overflows=" << overStep <<
G4endl ;
342 E = Steplow - dStep ;
343 norm = TotNbofEvents ;
344 G4cout <<
" bin nb nsteplow entries normalized " <<
G4endl ;
345 for(
G4int iss=0; iss<nbinStep; iss++)
348 dnorm = distStep[iss]/
norm;
349 G4cout << std::setw(5) << iss << std::setw(10) << E <<
350 std::setw(12) << distStep[iss] <<
351 std::setw(12) << dnorm <<
G4endl ;
358 std::ofstream fileOut(
"distribution.out", std::ios::out ) ;
359 fileOut.setf( std::ios::scientific, std::ios::floatfield );
361 std::ofstream normOut(
"normDist.out", std::ios::out ) ;
362 normOut.setf( std::ios::scientific, std::ios::floatfield );
367 G4cout <<
"#entries=" << entryEn <<
" #underflows=" << underEn <<
368 " #overflows=" << overEn <<
G4endl ;
372 norm = TotNbofEvents*1.0 ;
373 G4cout <<
" bin nb Elow entries normalized " <<
G4endl ;
376 for(
G4int ien=0; ien<nbinEn; ien++)
385 dnorm = distEn[ien]/
norm;
387 G4cout << std::setw(5) << ien << std::setw(10) << E/
keV <<
388 std::setw(12) << distEn[ien] <<
389 std::setw(12) << dnorm <<
G4endl ;
391 fileOut << E/
keV <<
"\t"<< distEn[ien] <<
G4endl ;
392 normOut << E/
keV <<
"\t"<< dnorm <<
G4endl ;
402 for(
G4int i1=0; i1<nbinEn; i1++)
407 if(distEn[i1] >= 0.5*fmax)
416 for(
G4int i2=0; i2<nbinEn; i2++)
420 if(distEn[i2] >= 0.5*fmax) E2=E ;
422 G4cout <<
" Emp = " << std::setw(15) << Emp/
MeV <<
" width="
423 << std::setw(15) << (E2-E1)/
MeV <<
" MeV " << G4endl;
430 G4cout <<
" transmitted energy distribution " <<
G4endl ;
431 G4cout <<
"#entries=" << entryTt <<
" #underflows=" << underTt <<
432 " #overflows=" << overTt <<
G4endl ;
436 sig=Tt2mean/entryTt-Ttmean*Ttmean ;
440 sig=std::sqrt(sig/entryTt) ;
441 G4cout <<
" mean energy of transmitted particles=" << Ttmean/
keV <<
444 norm = TotNbofEvents*dTt ;
445 G4cout <<
" bin nb Elow entries normalized " <<
G4endl ;
446 for(
G4int itt=0; itt<nbinTt; itt++)
449 dnorm = distTt[itt]/
norm;
450 G4cout << std::setw(5) << itt << std::setw(10) << E <<
451 std::setw(12) << distTt[itt] <<
452 std::setw(12) << dnorm <<
G4endl ;
460 G4cout <<
" backscattered energy distribution " <<
G4endl ;
461 G4cout <<
"#entries=" << entryTb <<
" #underflows=" << underTb <<
462 " #overflows=" << overTb <<
G4endl ;
466 sig=Tb2mean/entryTb-Tbmean*Tbmean ;
470 sig=std::sqrt(sig/entryTb) ;
471 G4cout <<
" mean energy of backscattered particles=" << Tbmean/
keV <<
474 norm = TotNbofEvents*dTb ;
475 G4cout <<
" bin nb Elow entries normalized " <<
G4endl ;
476 for(
G4int itt=0; itt<nbinTb; itt++)
479 dnorm = distTb[itt]/
norm;
480 G4cout << std::setw(5) << itt << std::setw(10) << E <<
481 std::setw(12) << distTb[itt] <<
482 std::setw(12) << dnorm <<
G4endl ;
489 G4cout <<
" energy distribution of charged secondaries " <<
G4endl ;
490 G4cout <<
"#entries=" << entryTsec <<
" #underflows=" << underTsec <<
491 " #overflows=" << overTsec <<
G4endl ;
494 E = Tseclow - dTsec ;
495 norm = TotNbofEvents*dTsec ;
496 G4cout <<
" bin nb Elow entries normalized " <<
G4endl ;
497 for(
G4int itt=0; itt<nbinTsec; itt++)
500 dnorm = distTsec[itt]/
norm;
501 G4cout << std::setw(5) << itt << std::setw(10) << E <<
502 std::setw(12) << distTsec[itt] <<
503 std::setw(12) << dnorm <<
G4endl ;
512 G4cout <<
"#entries=" << entryR <<
" #underflows=" << underR <<
513 " #overflows=" << overR <<
G4endl ;
517 sig = R2mean/entryR - Rmean*Rmean;
519 else sig = std::sqrt(sig/entryR) ;
520 G4cout <<
" mean lateral displacement at exit=" << Rmean/
mm <<
" +- "
523 norm = TotNbofEvents*dR ;
524 G4cout <<
" bin nb Rlow entries normalized " <<
G4endl ;
525 for(
G4int ier=0; ier<nbinR ; ier++)
528 dnorm = distR[ier]/
norm;
529 G4cout << std::setw(5) << ier << std::setw(10) << R <<
530 std::setw(12) << distR[ier] <<
531 std::setw(12) << dnorm <<
G4endl ;
538 {
G4double Th,Thdeg, dnorm,
norm,fac0,fnorm,pere,Thpere,Thmean,sum;
540 G4cout <<
"#entries=" << entryTh <<
" #underflows=" << underTh <<
541 " #overflows=" << overTh <<
G4endl ;
545 norm = TotNbofEvents ;
549 fac0 = 1./distTh[0] ;
550 pere = 1./std::exp(1.) ;
552 G4cout <<
" bin nb Thlowdeg Thlowrad " <<
553 " entries normalized " <<
G4endl ;
557 for(
G4int ien=0; ien<nbinTh; ien++)
562 Thmean += distTh[ien]*(Th+0.5*dTh) ;
563 dnorm = distTh[ien]/
norm;
564 fnorm = fac0*distTh[ien] ;
567 G4cout << std::setw(5) << ien << std::setw(10) << Thdeg <<
" " <<
568 std::setw(10) << Th <<
" " <<
569 std::setw(12) << distTh[ien] <<
" " <<
570 std::setw(12) << dnorm <<
" " << std::setw(12) << fnorm <<
G4endl ;
574 G4cout <<
" mean = " << Thmean <<
" rad or " << 180.*Thmean/
pi <<
576 G4cout <<
" theta(1/e)=" << Thpere <<
" - " << Thpere+dTh <<
" rad "
577 <<
" or " << 180.*Thpere/
pi <<
" - " << 180.*(Thpere+dTh)/
pi
578 <<
" deg." << G4endl;
584 {
G4double Thb,Thdegb, dnormb, normb,fac0b,fnormb,pereb,Thpereb,Thmeanb,sumb;
585 G4cout <<
" backscattering angle distribution " <<
G4endl ;
586 G4cout <<
"#entries=" << entryThback <<
" #underflows=" << underThback <<
587 " #overflows=" << overThback <<
G4endl ;
590 Thb= Thlowback - dThback ;
591 normb = TotNbofEvents ;
592 if(distThback[0] == 0.)
595 fac0b = 1./distThback[0] ;
596 pereb = 1./std::exp(1.) ;
598 G4cout <<
" bin nb Thlowdeg Thlowrad " <<
599 " entries normalized " <<
G4endl ;
603 for(
G4int ien=0; ien<nbinThback; ien++)
606 Thdegb = Thb*180./
pi ;
607 sumb += distThback[ien] ;
608 Thmeanb += distThback[ien]*(Thb+0.5*dThback) ;
609 dnormb = distThback[ien]/normb;
610 fnormb = fac0b*distThback[ien] ;
613 G4cout << std::setw(5) << ien << std::setw(10) << Thdegb <<
" " <<
614 std::setw(10) << Thb <<
" " <<
615 std::setw(12) << distThback[ien] <<
" " <<
616 std::setw(12) << dnormb <<
" " << std::setw(12) << fnormb <<
G4endl ;
620 G4cout <<
" mean = " << Thmeanb <<
" rad or " << 180.*Thmeanb/
pi <<
622 G4cout <<
" theta(1/e)=" << Thpereb <<
" - " << Thpereb+dThback <<
" rad "
623 <<
" or " << 180.*Thpereb/
pi <<
" - " << 180.*(Thpereb+dThback)/
pi
624 <<
" deg." << G4endl;
632 G4cout <<
"#entries=" << entryGamma <<
" #underflows=" << underGamma <<
633 " #overflows=" << overGamma <<
G4endl ;
636 fact=std::exp(dEGamma) ;
638 norm = TotNbofEvents*dEGamma;
639 G4cout <<
" bin nb Elow entries normalized " <<
G4endl ;
640 for(
G4int itt=0; itt<nbinGamma; itt++)
643 dnorm = distGamma[itt]/
norm;
644 G4cout << std::setw(5) << itt << std::setw(13) << E <<
645 std::setw(12) << distGamma[itt] <<
646 std::setw(15) << dnorm <<
G4endl ;
655 G4cout <<
"#entries=" << entryvertexz <<
" #underflows=" << undervertexz <<
656 " #overflows=" << oververtexz <<
G4endl ;
657 if( entryvertexz >0.)
660 norm = TotNbofEvents*dz ;
661 G4cout <<
" bin nb zlow entries normalized " <<
G4endl ;
662 for(
G4int iez=0; iez<nbinvertexz ; iez++)
665 if(std::fabs(z)<1.e-12) z=0.;
666 dnorm = distvertexz[iez]/
norm;
667 G4cout << std::setw(5) << iez << std::setw(10) << z <<
668 std::setw(12) << distvertexz[iez] <<
669 std::setw(12) << dnorm <<
G4endl ;
695 TotNbofEvents += 1. ;
702 nStepSumCharged += nstp;
703 nStepSum2Charged += nstp*nstp;
710 nStepSumNeutral += nstp;
711 nStepSum2Neutral += nstp*nstp;
718 EnergySumAbs += Eabs;
719 EnergySquareSumAbs += Eabs*Eabs;
727 tlsquareSumAbs += tlabs*tlabs ;
754 if(En < Enlow) underEn += 1. ;
755 else if( En >= Enhigh) overEn += 1. ;
758 bin = (En-Enlow)/dEn;
760 if(ibin < 0) { ibin = 0; }
761 if(ibin > 199) { ibin = 199; }
825 if(nbin> 0 && nbin<= 200) {
827 G4cout <<
" Nb of bins in #step plot = " << nbinStep <<
G4endl ;
835 G4cout <<
" low in the #step plot = " << Steplow <<
G4endl ;
842 G4cout <<
" high in the #step plot = " << Stephigh <<
G4endl ;
850 if(nbin > 0 && nbin <= 200) {
852 G4cout <<
" Nb of bins in Edep plot = " << nbinEn <<
G4endl ;
860 G4cout <<
" Elow in the Edep plot = " << Enlow <<
G4endl ;
868 G4cout <<
" Ehigh in the Edep plot = " << Enhigh <<
G4endl ;
876 if(nbin > 0 && nbin <= 200) {
878 G4cout <<
" Nb of bins in gamma spectrum plot = " << nbinGamma <<
G4endl ;
886 G4cout <<
" Elow in the gamma spectrum plot = " << ElowGamma <<
G4endl ;
894 G4cout <<
" Ehigh in the gamma spectrum plot = " << EhighGamma <<
G4endl ;
900 if(nbin > 0 && nbin <= 200) {
902 G4cout <<
" Nb of bins in Etransmisssion plot = " << nbinTt <<
G4endl ;
910 G4cout <<
" Elow in the Etransmission plot = " << Ttlow <<
G4endl ;
918 G4cout <<
" Ehigh in the Etransmission plot = " << Tthigh <<
G4endl ;
924 if(nbin > 0 && nbin <= 200) {
926 G4cout <<
" Nb of bins in Ebackscattered plot = " << nbinTb <<
G4endl ;
934 G4cout <<
" Elow in the Ebackscattered plot = " << Tblow <<
G4endl ;
940 G4cout <<
" Ehigh in the Ebackscattered plot = " << Tbhigh <<
G4endl ;
945 if(nbin > 0 && nbin <= 200) {
947 G4cout <<
" Nb of bins in Tsecondary plot = " << nbinTsec <<
G4endl ;
954 G4cout <<
" Elow in the Tsecondary plot = " << Tseclow <<
G4endl ;
960 G4cout <<
" Ehigh in the Tsecondary plot = " << Tsechigh <<
G4endl ;
965 if(nbin > 0 && nbin <= 200) {
967 G4cout <<
" Nb of bins in R plot = " << nbinR <<
G4endl ;
980 G4cout <<
" Rhigh in the R plot = " << Rhigh <<
G4endl ;
985 if(nbin > 0 && nbin <= 200) {
987 G4cout <<
" Nb of bins in Z plot = " << nbinvertexz <<
G4endl ;
1000 G4cout <<
" zhigh in the Z plot = " << zhigh <<
G4endl ;
1005 if(nbin > 0 && nbin <= 200) {
1007 G4cout <<
" Nb of bins in Theta plot = " << nbinTh <<
G4endl ;
1014 G4cout <<
" Tlow in the Theta plot = " << Thlow <<
G4endl ;
1020 G4cout <<
" Thigh in the Theta plot = " << Thhigh <<
G4endl ;
1025 if(nbin > 0 && nbin <= 200) {
1027 G4cout <<
" Nb of bins in Theta plot = " << nbinThback <<
G4endl ;
1034 G4cout <<
" Tlow in the Theta plot = " << Thlowback <<
G4endl ;
1039 Thhighback = Thigh ;
1040 G4cout <<
" Thigh in the Theta plot = " << Thhighback <<
G4endl ;
1047 Sum2Charged += nch*nch ;
1048 Sum2Neutral += nne*nne ;
void Fillvertexz(G4double z)
void SetThhigh(G4double Thhigh)
void SetEnhigh(G4double Enhigh)
void SethistName(G4String name)
void SetnbinR(G4int nbin)
void SetTblow(G4double Tblow)
Definition of the Em10RunAction class.
void SetnbinTh(G4int nbin)
void SetEhighGamma(G4double Ehigh)
static G4VVisManager * GetConcreteInstance()
void SetnbinGamma(G4int nbin)
void SetnbinTt(G4int nbin)
void FillNbOfSteps(G4double nstep)
void FillThBack(G4double Th)
void CountParticles(G4double, G4double)
void SetTtlow(G4double Ttlow)
static G4UImanager * GetUIpointer()
void Setzhigh(G4double z)
G4GLOB_DLL std::ostream G4cout
void SetRlow(G4double Rlow)
void SetnbinTsec(G4int nbin)
Definition of the Em10RunMessenger class.
void SetTbhigh(G4double Tbhigh)
void SetnbinEn(G4int nbin)
void BeginOfRunAction(const G4Run *)
void SetnbinTb(G4int nbin)
void EndOfRunAction(const G4Run *)
void SetSteplow(G4double Slow)
void SetnbinStep(G4int nbin)
void AddEdeps(G4double Eabs)
static void showEngineStatus()
void SetnbinThBack(G4int nbin)
void SetEnlow(G4double Elow)
void SetTthigh(G4double Tthigh)
void SetTseclow(G4double Tlow)
static void saveEngineStatus(const char filename[]="Config.conf")
void SetTsechigh(G4double Thigh)
void AddTrRef(G4double tr, G4double ref)
void FillTsec(G4double T)
void FillGammaSpectrum(G4double E)
void SetStephigh(G4double Shigh)
void AddnStepsNeutral(G4double ns)
void Setnbinzvertex(G4int nbin)
void SetElowGamma(G4double Elow)
void SetThlowBack(G4double Thlow)
void AddnStepsCharged(G4double ns)
void AddTrackLength(G4double tlabs)
void AddEP(G4double, G4double)
void SetRhigh(G4double Rhigh)
G4int ApplyCommand(const char *aCommand)
void SetThhighBack(G4double Thhigh)
void SetThlow(G4double Thlow)