Import Geant4 1.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:34:16 +02:00
parent ca1c8cb059
commit 103bda00c8
2654 changed files with 29719 additions and 20203 deletions
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: Em5RunAction.cc,v 1.1.4.1 1999/12/07 20:47:11 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: Em5RunAction.cc,v 1.4 2000/01/20 15:34:40 maire Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
@@ -20,22 +20,28 @@
#include "G4UImanager.hh"
#include "G4VVisManager.hh"
#include "G4ios.hh"
#include <iomanip.h>
#include "g4std/iomanip"
#include "Randomize.hh"
#ifndef G4NOHIST
#include "CLHEP/Hist/HBookFile.h"
#include <assert.h>
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em5RunAction::Em5RunAction()
:histName("histfile"),nbinStep(0.),nbinEn(0.),nbinTt(0.),nbinTb(0.),
nbinTsec(0.),nbinTh(0.),nbinThback(0.),nbinR(0.),nbinGamma(0.),
nbinvertexz(0.),histo1(0),histo2(0),histo3(0),histo4(0),histo5(0),
histo6(0),histo7(0),histo8(0),histo9(0),histo10(0)
:histName("histfile"),nbinStep(0),nbinEn(0),nbinTt(0),nbinTb(0),
nbinTsec(0),nbinTh(0),nbinThback(0),nbinR(0),nbinGamma(0),nbinvertexz(0)
{
runMessenger = new Em5RunMessenger(this);
saveRndm = 1;
saveRndm = 1;
#ifndef G4NOHIST
histo1=0; histo2=0; histo3=0; histo4=0; histo5=0; histo6=0; histo7=0;
histo8=0; histo9=0; histo10=0;hi2bis=0;
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -43,24 +49,26 @@ Em5RunAction::Em5RunAction()
Em5RunAction::~Em5RunAction()
{
delete runMessenger;
if(histo1) delete histo1 ;
if(histo2) delete histo2 ;
if(histo3) delete histo3 ;
if(histo4) delete histo4 ;
if(histo5) delete histo5 ;
if(histo6) delete histo6 ;
if(histo7) delete histo7 ;
if(histo8) delete histo8 ;
if(histo9) delete histo9 ;
if(histo10) delete histo10 ;
#ifndef G4NOHIST
if(histo1) delete histo1 ;
if(histo2) {delete histo2 ; delete hi2bis;}
if(histo3) delete histo3 ;
if(histo4) delete histo4 ;
if(histo5) delete histo5 ;
if(histo6) delete histo6 ;
if(histo7) delete histo7 ;
if(histo8) delete histo8 ;
if(histo9) delete histo9 ;
if(histo10) delete histo10;
delete hbookManager;
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em5RunAction::bookHisto()
{
#ifndef G4NOHIST
// init hbook
hbookManager = new HBookFile(histName, 68);
assert (hbookManager != 0);
@@ -77,6 +85,10 @@ void Em5RunAction::bookHisto()
histo2 = hbookManager->histogram("energy deposit in absorber(in MeV)"
,nbinEn,Enlow,Enhigh) ;
assert (histo2 != 0);
hi2bis = hbookManager->histogram("energy deposit: normalized distribution"
,nbinEn,Enlow,Enhigh) ;
assert (hi2bis != 0);
}
if(nbinTh>0)
{
@@ -127,13 +139,14 @@ void Em5RunAction::bookHisto()
,nbinGamma,log10(ElowGamma),log10(EhighGamma)) ;
assert (histo10 != 0);
}
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em5RunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout << "### Run " << aRun->GetRunID() << " start." << endl;
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
// save Rndm status
if (saveRndm > 0)
@@ -147,8 +160,7 @@ void Em5RunAction::BeginOfRunAction(const G4Run* aRun)
if(pVVisManager)
{
UI->ApplyCommand("/vis/clear/view");
UI->ApplyCommand("/vis/draw/current");
UI->ApplyCommand("/vis/scene/notifyHandlers");
}
EnergySumAbs = 0. ;
@@ -350,87 +362,91 @@ void Em5RunAction::EndOfRunAction(const G4Run* aRun)
Transmitted /=TotNbofEvents ;
Reflected /=TotNbofEvents ;
G4cout << " ================== run summary =====================" << endl;
G4cout << " ================== run summary =====================" << G4endl;
G4int prec = G4cout.precision(6);
G4cout << " end of Run TotNbofEvents = " <<
TotNbofEvents << endl ;
TotNbofEvents << G4endl ;
G4cout << " mean charged track length in absorber=" <<
tlSumAbs/mm << " +- " << sAbs/mm <<
" mm " << endl;
G4cout << endl;
" mm " << G4endl;
G4cout << G4endl;
G4cout << " mean energy deposit in absorber=" <<
EnergySumAbs/MeV << " +- " << sigAbs/MeV <<
" MeV " << endl ;
G4cout << endl ;
" MeV " << G4endl ;
G4cout << G4endl ;
G4cout << " mean number of steps in absorber (charged) =" <<
nStepSumCharged << " +- " << sigch <<
" " << endl ;
" " << G4endl ;
G4cout << " mean number of steps in absorber (neutral) =" <<
nStepSumNeutral << " +- " << signe <<
" " << endl ;
G4cout << endl ;
" " << G4endl ;
G4cout << G4endl ;
G4cout << " mean number of charged secondaries = " <<
SumCharged << " +- " << sigcharged << endl;
G4cout << endl ;
SumCharged << " +- " << sigcharged << G4endl;
G4cout << G4endl ;
G4cout << " mean number of neutral secondaries = " <<
SumNeutral << " +- " << signeutral << endl;
G4cout << endl ;
SumNeutral << " +- " << signeutral << G4endl;
G4cout << G4endl ;
G4cout << " mean number of e-s =" << Selectron <<
" and e+s =" << Spositron << endl;
G4cout << endl;
" and e+s =" << Spositron << G4endl;
G4cout << G4endl;
G4cout << "(number) transmission coeff=" << Transmitted <<
" reflection coeff=" << Reflected << endl;
G4cout << endl;
" reflection coeff=" << Reflected << G4endl;
G4cout << G4endl;
if(nbinStep>0)
{G4double E , dnorm, norm ;
G4cout << " step number/event distribution " << endl ;
G4cout << " step number/event distribution " << G4endl ;
G4cout << "#entries=" << entryStep << " #underflows=" << underStep <<
" #overflows=" << overStep << endl ;
" #overflows=" << overStep << G4endl ;
if( entryStep>0.)
{
E = Steplow - dStep ;
norm = TotNbofEvents ;
G4cout << " bin nb nsteplow entries normalized " << endl ;
G4cout << " bin nb nsteplow entries normalized " << G4endl ;
for(G4int iss=0; iss<nbinStep; iss++)
{
E += dStep ;
dnorm = distStep[iss]/norm;
G4cout << setw(5) << iss << setw(10) << E <<
setw(12) << distStep[iss] <<
setw(12) << dnorm << endl ;
G4cout << G4std::setw(5) << iss << G4std::setw(10) << E <<
G4std::setw(12) << distStep[iss] <<
G4std::setw(12) << dnorm << G4endl ;
}
G4cout << endl;
G4cout << G4endl;
}
}
if(nbinEn>0)
{G4double E , dnorm, norm,fmax,Emp,width ;
Emp=-999.999 ;
G4cout << " energy deposit distribution " << endl ;
G4cout << " energy deposit distribution " << G4endl ;
G4cout << "#entries=" << entryEn << " #underflows=" << underEn <<
" #overflows=" << overEn << endl ;
" #overflows=" << overEn << G4endl ;
if( entryEn>0.)
{
E = Enlow - dEn ;
norm = TotNbofEvents*dEn ;
G4cout << " bin nb Elow entries normalized " << endl ;
G4cout << " bin nb Elow entries normalized " << G4endl ;
fmax = 0. ;
for(G4int ien=0; ien<nbinEn; ien++)
{
E += dEn ;
#ifndef G4NOHIST
hi2bis->accumulate(E+0.5*dEn,distEn[ien]/TotNbofEvents);
#endif
if(distEn[ien]>fmax)
{
fmax=distEn[ien];
Emp = E ;
}
dnorm = distEn[ien]/norm;
G4cout << setw(5) << ien << setw(10) << E <<
setw(12) << distEn[ien] <<
setw(12) << dnorm << endl ;
G4cout << G4std::setw(5) << ien << G4std::setw(10) << E <<
G4std::setw(12) << distEn[ien] <<
G4std::setw(12) << dnorm << G4endl ;
}
G4cout << endl;
G4cout << G4endl;
G4int ii ;
G4double E1,E2 ;
E1=-1.e6 ;
@@ -456,16 +472,16 @@ void Em5RunAction::EndOfRunAction(const G4Run* aRun)
if(distEn[i2] >= 0.5*fmax)
E2=E ;
}
G4cout << " Emp = " << setw(15) << Emp/MeV << " width="
<< setw(15) << (E2-E1)/MeV << " MeV " << endl;
G4cout << endl ;
G4cout << " Emp = " << G4std::setw(15) << Emp/MeV << " width="
<< G4std::setw(15) << (E2-E1)/MeV << " MeV " << G4endl;
G4cout << G4endl ;
}
}
if(nbinTt>0)
{G4double E , dnorm, norm ,sig;
G4cout << " transmitted energy distribution " << endl ;
G4cout << " transmitted energy distribution " << G4endl ;
G4cout << "#entries=" << entryTt << " #underflows=" << underTt <<
" #overflows=" << overTt << endl ;
" #overflows=" << overTt << G4endl ;
if( entryTt>0.)
{
Ttmean /= entryTt;
@@ -475,26 +491,26 @@ void Em5RunAction::EndOfRunAction(const G4Run* aRun)
else
sig=sqrt(sig/entryTt) ;
G4cout << " mean energy of transmitted particles=" << Ttmean/keV <<
" +- " << sig/keV << " keV." << endl;
" +- " << sig/keV << " keV." << G4endl;
E = Ttlow - dTt ;
norm = TotNbofEvents*dTt ;
G4cout << " bin nb Elow entries normalized " << endl ;
G4cout << " bin nb Elow entries normalized " << G4endl ;
for(G4int itt=0; itt<nbinTt; itt++)
{
E += dTt ;
dnorm = distTt[itt]/norm;
G4cout << setw(5) << itt << setw(10) << E <<
setw(12) << distTt[itt] <<
setw(12) << dnorm << endl ;
G4cout << G4std::setw(5) << itt << G4std::setw(10) << E <<
G4std::setw(12) << distTt[itt] <<
G4std::setw(12) << dnorm << G4endl ;
}
G4cout << endl;
G4cout << G4endl;
}
}
if(nbinTb>0)
{G4double E , dnorm, norm ,sig;
G4cout << " backscattered energy distribution " << endl ;
G4cout << " backscattered energy distribution " << G4endl ;
G4cout << "#entries=" << entryTb << " #underflows=" << underTb <<
" #overflows=" << overTb << endl ;
" #overflows=" << overTb << G4endl ;
if( entryTb>0.)
{
Tbmean /= entryTb;
@@ -504,48 +520,48 @@ void Em5RunAction::EndOfRunAction(const G4Run* aRun)
else
sig=sqrt(sig/entryTb) ;
G4cout << " mean energy of backscattered particles=" << Tbmean/keV <<
" +- " << sig/keV << " keV." << endl;
" +- " << sig/keV << " keV." << G4endl;
E = Tblow - dTb ;
norm = TotNbofEvents*dTb ;
G4cout << " bin nb Elow entries normalized " << endl ;
G4cout << " bin nb Elow entries normalized " << G4endl ;
for(G4int itt=0; itt<nbinTb; itt++)
{
E += dTb ;
dnorm = distTb[itt]/norm;
G4cout << setw(5) << itt << setw(10) << E <<
setw(12) << distTb[itt] <<
setw(12) << dnorm << endl ;
G4cout << G4std::setw(5) << itt << G4std::setw(10) << E <<
G4std::setw(12) << distTb[itt] <<
G4std::setw(12) << dnorm << G4endl ;
}
G4cout << endl;
G4cout << G4endl;
}
}
if(nbinTsec>0)
{G4double E , dnorm, norm ;
G4cout << " energy distribution of charged secondaries " << endl ;
G4cout << " energy distribution of charged secondaries " << G4endl ;
G4cout << "#entries=" << entryTsec << " #underflows=" << underTsec <<
" #overflows=" << overTsec << endl ;
" #overflows=" << overTsec << G4endl ;
if( entryTsec>0.)
{
E = Tseclow - dTsec ;
norm = TotNbofEvents*dTsec ;
G4cout << " bin nb Elow entries normalized " << endl ;
G4cout << " bin nb Elow entries normalized " << G4endl ;
for(G4int itt=0; itt<nbinTsec; itt++)
{
E += dTsec ;
dnorm = distTsec[itt]/norm;
G4cout << setw(5) << itt << setw(10) << E <<
setw(12) << distTsec[itt] <<
setw(12) << dnorm << endl ;
G4cout << G4std::setw(5) << itt << G4std::setw(10) << E <<
G4std::setw(12) << distTsec[itt] <<
G4std::setw(12) << dnorm << G4endl ;
}
G4cout << endl;
G4cout << G4endl;
}
}
if(nbinR >0)
{G4double R , dnorm, norm,sig ;
G4cout << " R distribution " << endl ;
G4cout << " R distribution " << G4endl ;
G4cout << "#entries=" << entryR << " #underflows=" << underR <<
" #overflows=" << overR << endl ;
" #overflows=" << overR << G4endl ;
if( entryR >0.)
{
Rmean /= entryR;
@@ -553,27 +569,27 @@ void Em5RunAction::EndOfRunAction(const G4Run* aRun)
if(sig<=0.) sig=0. ;
else sig = sqrt(sig/entryR) ;
G4cout << " mean lateral displacement at exit=" << Rmean/mm << " +- "
<< sig/mm << " mm." << endl ;
<< sig/mm << " mm." << G4endl ;
R = Rlow - dR ;
norm = TotNbofEvents*dR ;
G4cout << " bin nb Rlow entries normalized " << endl ;
G4cout << " bin nb Rlow entries normalized " << G4endl ;
for(G4int ier=0; ier<nbinR ; ier++)
{
R+= dR ;
dnorm = distR[ier]/norm;
G4cout << setw(5) << ier << setw(10) << R <<
setw(12) << distR[ier] <<
setw(12) << dnorm << endl ;
G4cout << G4std::setw(5) << ier << G4std::setw(10) << R <<
G4std::setw(12) << distR[ier] <<
G4std::setw(12) << dnorm << G4endl ;
}
G4cout << endl;
G4cout << G4endl;
}
}
if(nbinTh>0)
{G4double Th,Thdeg, dnorm, norm,fac0,fnorm,pere,Thpere,Thmean,sum;
G4cout << " angle distribution " << endl ;
G4cout << " angle distribution " << G4endl ;
G4cout << "#entries=" << entryTh << " #underflows=" << underTh <<
" #overflows=" << overTh << endl ;
" #overflows=" << overTh << G4endl ;
if( entryTh>0.)
{
Th= Thlow - dTh ;
@@ -585,7 +601,7 @@ void Em5RunAction::EndOfRunAction(const G4Run* aRun)
pere = 1./exp(1.) ;
G4cout << " bin nb Thlowdeg Thlowrad " <<
" entries normalized " << endl ;
" entries normalized " << G4endl ;
Thpere = 0. ;
sum = 0. ;
Thmean = 0. ;
@@ -599,27 +615,27 @@ void Em5RunAction::EndOfRunAction(const G4Run* aRun)
fnorm = fac0*distTh[ien] ;
if( fnorm > pere)
Thpere = Th ;
G4cout << setw(5) << ien << setw(10) << Thdeg << " " <<
setw(10) << Th << " " <<
setw(12) << distTh[ien] << " " <<
setw(12) << dnorm << " " << setw(12) << fnorm <<endl ;
G4cout << G4std::setw(5) << ien << G4std::setw(10) << Thdeg << " " <<
G4std::setw(10) << Th << " " <<
G4std::setw(12) << distTh[ien] << " " <<
G4std::setw(12) << dnorm << " " << G4std::setw(12) << fnorm <<G4endl ;
}
Thmean /= sum ;
G4cout << endl;
G4cout << G4endl;
G4cout << " mean = " << Thmean << " rad or " << 180.*Thmean/pi <<
" deg." << endl;
" deg." << G4endl;
G4cout << " theta(1/e)=" << Thpere << " - " << Thpere+dTh << " rad "
<< " or " << 180.*Thpere/pi << " - " << 180.*(Thpere+dTh)/pi
<< " deg." << endl;
G4cout << endl;
<< " deg." << G4endl;
G4cout << G4endl;
}
}
if(nbinThback>0)
{G4double Thb,Thdegb, dnormb, normb,fac0b,fnormb,pereb,Thpereb,Thmeanb,sumb;
G4cout << " backscattering angle distribution " << endl ;
G4cout << " backscattering angle distribution " << G4endl ;
G4cout << "#entries=" << entryThback << " #underflows=" << underThback <<
" #overflows=" << overThback << endl ;
" #overflows=" << overThback << G4endl ;
if( entryThback>0.)
{
Thb= Thlowback - dThback ;
@@ -631,7 +647,7 @@ void Em5RunAction::EndOfRunAction(const G4Run* aRun)
pereb = 1./exp(1.) ;
G4cout << " bin nb Thlowdeg Thlowrad " <<
" entries normalized " << endl ;
" entries normalized " << G4endl ;
Thpereb = 0. ;
sumb = 0. ;
Thmeanb = 0. ;
@@ -645,75 +661,77 @@ void Em5RunAction::EndOfRunAction(const G4Run* aRun)
fnormb = fac0b*distThback[ien] ;
if( fnormb > pereb)
Thpereb = Thb ;
G4cout << setw(5) << ien << setw(10) << Thdegb << " " <<
setw(10) << Thb << " " <<
setw(12) << distThback[ien] << " " <<
setw(12) << dnormb << " " << setw(12) << fnormb <<endl ;
G4cout << G4std::setw(5) << ien << G4std::setw(10) << Thdegb << " " <<
G4std::setw(10) << Thb << " " <<
G4std::setw(12) << distThback[ien] << " " <<
G4std::setw(12) << dnormb << " " << G4std::setw(12) << fnormb <<G4endl ;
}
Thmeanb /= sumb ;
G4cout << endl;
G4cout << G4endl;
G4cout << " mean = " << Thmeanb << " rad or " << 180.*Thmeanb/pi <<
" deg." << endl;
" deg." << G4endl;
G4cout << " theta(1/e)=" << Thpereb << " - " << Thpereb+dThback << " rad "
<< " or " << 180.*Thpereb/pi << " - " << 180.*(Thpereb+dThback)/pi
<< " deg." << endl;
G4cout << endl;
<< " deg." << G4endl;
G4cout << G4endl;
}
}
if(nbinGamma>0)
{G4double E , fact,dnorm, norm ;
G4cout << " gamma energy distribution " << endl ;
G4cout << " gamma energy distribution " << G4endl ;
G4cout << "#entries=" << entryGamma << " #underflows=" << underGamma <<
" #overflows=" << overGamma << endl ;
" #overflows=" << overGamma << G4endl ;
if( entryGamma>0.)
{
fact=exp(dEGamma) ;
E = ElowGamma/fact ;
norm = TotNbofEvents*dEGamma;
G4cout << " bin nb Elow entries normalized " << endl ;
G4cout << " bin nb Elow entries normalized " << G4endl ;
for(G4int itt=0; itt<nbinGamma; itt++)
{
E *= fact ;
dnorm = distGamma[itt]/norm;
G4cout << setw(5) << itt << setw(13) << E <<
setw(12) << distGamma[itt] <<
setw(15) << dnorm << endl ;
G4cout << G4std::setw(5) << itt << G4std::setw(13) << E <<
G4std::setw(12) << distGamma[itt] <<
G4std::setw(15) << dnorm << G4endl ;
}
G4cout << endl;
G4cout << G4endl;
}
}
if(nbinvertexz >0)
{G4double z , dnorm, norm ;
G4cout << " vertex Z distribution " << endl ;
G4cout << " vertex Z distribution " << G4endl ;
G4cout << "#entries=" << entryvertexz << " #underflows=" << undervertexz <<
" #overflows=" << oververtexz << endl ;
" #overflows=" << oververtexz << G4endl ;
if( entryvertexz >0.)
{
z =zlow - dz ;
norm = TotNbofEvents*dz ;
G4cout << " bin nb zlow entries normalized " << endl ;
G4cout << " bin nb zlow entries normalized " << G4endl ;
for(G4int iez=0; iez<nbinvertexz ; iez++)
{
z+= dz ;
if(abs(z)<1.e-12) z=0.;
dnorm = distvertexz[iez]/norm;
G4cout << setw(5) << iez << setw(10) << z <<
setw(12) << distvertexz[iez] <<
setw(12) << dnorm << endl ;
G4cout << G4std::setw(5) << iez << G4std::setw(10) << z <<
G4std::setw(12) << distvertexz[iez] <<
G4std::setw(12) << dnorm << G4endl ;
}
G4cout << endl;
G4cout << G4endl;
}
}
G4cout.precision(prec);
if (G4VVisManager::GetConcreteInstance())
G4UImanager::GetUIpointer()->ApplyCommand("/vis/show/view");
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
#ifndef G4NOHIST
// Write histogram file
hbookManager->write();
#endif
// save Rndm status
if (saveRndm == 1)
@@ -777,7 +795,7 @@ void Em5RunAction::FillNbOfSteps(G4double ns)
G4double n,bin ;
G4int ibin;
if(histo1)
if(nbinStep>0)
{
entryStep += 1. ;
@@ -792,7 +810,9 @@ void Em5RunAction::FillNbOfSteps(G4double ns)
ibin= bin ;
distStep[ibin] += 1. ;
}
histo1->accumulate(ns) ;
#ifndef G4NOHIST
histo1->accumulate(ns);
#endif
}
}
@@ -803,7 +823,7 @@ void Em5RunAction::FillEn(G4double En)
G4double bin ;
G4int ibin;
if(histo2)
if(nbinEn>0)
{
entryEn += 1. ;
@@ -817,7 +837,9 @@ void Em5RunAction::FillEn(G4double En)
ibin= bin ;
distEn[ibin] += 1. ;
}
histo2->accumulate(En/MeV) ;
#ifndef G4NOHIST
histo2->accumulate(En/MeV);
#endif
}
}
@@ -828,7 +850,7 @@ void Em5RunAction::FillTt(G4double En)
G4double bin ;
G4int ibin;
if(histo5)
if(nbinTt>0)
{
entryTt += 1. ;
Ttmean += En ;
@@ -844,7 +866,9 @@ void Em5RunAction::FillTt(G4double En)
ibin= bin ;
distTt[ibin] += 1. ;
}
histo5->accumulate(En/MeV) ;
#ifndef G4NOHIST
histo5->accumulate(En/MeV);
#endif
}
}
@@ -855,7 +879,7 @@ void Em5RunAction::FillTb(G4double En)
G4double bin ;
G4int ibin;
if(histo7)
if(nbinTb>0)
{
entryTb += 1. ;
Tbmean += En ;
@@ -871,7 +895,9 @@ void Em5RunAction::FillTb(G4double En)
ibin= bin ;
distTb[ibin] += 1. ;
}
#ifndef G4NOHIST
histo7->accumulate(En/MeV) ;
#endif
}
}
@@ -882,7 +908,7 @@ void Em5RunAction::FillTsec(G4double En)
G4double bin ;
G4int ibin;
if(histo8)
if(nbinTsec>0)
{
entryTsec += 1. ;
@@ -896,7 +922,9 @@ void Em5RunAction::FillTsec(G4double En)
ibin= bin ;
distTsec[ibin] += 1. ;
}
#ifndef G4NOHIST
histo8->accumulate(En/MeV) ;
#endif
}
}
@@ -907,7 +935,7 @@ void Em5RunAction::FillGammaSpectrum(G4double En)
G4double bin ;
G4int ibin;
if(histo10)
if(nbinGamma>0)
{
entryGamma += 1. ;
@@ -921,7 +949,9 @@ void Em5RunAction::FillGammaSpectrum(G4double En)
ibin= bin ;
distGamma[ibin] += 1. ;
}
#ifndef G4NOHIST
histo10->accumulate(log10(En/MeV)) ;
#endif
}
}
@@ -935,7 +965,7 @@ void Em5RunAction::FillTh(G4double Th)
G4double bin,Thbin ,wg;
G4int ibin;
if(histo3)
if(nbinTh>0)
{
entryTh += 1. ;
@@ -956,13 +986,14 @@ void Em5RunAction::FillTh(G4double Th)
{
G4double thdeg=Th*180./pi;
G4cout << "theta < 0.001*dth (from plot excluded) theta="
<< setw(12) << setprecision(4) << thdeg << endl;
<< G4std::setw(12) << G4std::setprecision(4) << thdeg << G4endl;
wg=0. ;
}
distTh[ibin] += wg ;
}
#ifndef G4NOHIST
histo3->accumulate(Th/deg, wg) ;
#endif
}
}
@@ -976,7 +1007,7 @@ void Em5RunAction::FillThBack(G4double Th)
G4double bin,Thbin,wg ;
G4int ibin;
if(histo6)
if(nbinThback>0)
{
entryThback += 1. ;
@@ -995,12 +1026,14 @@ void Em5RunAction::FillThBack(G4double Th)
{
G4double thdeg=Th*180./pi;
G4cout << "theta < 0.001*dth (from plot excluded) theta="
<< setw(12) << setprecision(4) << thdeg << endl;
<< G4std::setw(12) << G4std::setprecision(4) << thdeg << G4endl;
wg=0. ;
}
distThback[ibin] += wg ;
}
#ifndef G4NOHIST
histo6->accumulate(Th/deg, wg) ;
#endif
}
}
@@ -1012,7 +1045,7 @@ void Em5RunAction::FillR(G4double R )
G4double bin ;
G4int ibin;
if(histo4)
if(nbinR>0)
{
entryR += 1. ;
Rmean += R ;
@@ -1028,7 +1061,9 @@ void Em5RunAction::FillR(G4double R )
ibin= bin ;
distR[ibin] += 1. ;
}
#ifndef G4NOHIST
histo4->accumulate(R/mm) ;
#endif
}
}
@@ -1039,7 +1074,7 @@ void Em5RunAction::Fillvertexz(G4double z )
G4double bin ;
G4int ibin;
if(histo9)
if(nbinvertexz>0)
{
entryvertexz += 1. ;
@@ -1053,7 +1088,9 @@ void Em5RunAction::Fillvertexz(G4double z )
ibin= bin ;
distvertexz[ibin] += 1. ;
}
#ifndef G4NOHIST
histo9->accumulate(z/mm) ;
#endif
}
}
@@ -1062,195 +1099,195 @@ void Em5RunAction::Fillvertexz(G4double z )
void Em5RunAction::SethistName(G4String name)
{
histName = name ;
G4cout << " hist file = " << histName << endl;
G4cout << " hist file = " << histName << G4endl;
}
void Em5RunAction::SetnbinStep(G4int nbin)
{
nbinStep = nbin ;
if(nbinStep>0)
G4cout << " Nb of bins in #step plot = " << nbinStep << endl ;
G4cout << " Nb of bins in #step plot = " << nbinStep << G4endl ;
}
void Em5RunAction::SetSteplow(G4double low)
{
Steplow = low ;
if(nbinStep>0)
G4cout << " low in the #step plot = " << Steplow << endl ;
G4cout << " low in the #step plot = " << Steplow << G4endl ;
}
void Em5RunAction::SetStephigh(G4double high)
{
Stephigh = high ;
if(nbinStep>0)
G4cout << " high in the #step plot = " << Stephigh << endl ;
G4cout << " high in the #step plot = " << Stephigh << G4endl ;
}
void Em5RunAction::SetnbinEn(G4int nbin)
{
nbinEn = nbin ;
if(nbinEn>0)
G4cout << " Nb of bins in Edep plot = " << nbinEn << endl ;
G4cout << " Nb of bins in Edep plot = " << nbinEn << G4endl ;
}
void Em5RunAction::SetEnlow(G4double Elow)
{
Enlow = Elow ;
if(nbinEn>0)
G4cout << " Elow in the Edep plot = " << Enlow << endl ;
G4cout << " Elow in the Edep plot = " << Enlow << G4endl ;
}
void Em5RunAction::SetEnhigh(G4double Ehigh)
{
Enhigh = Ehigh ;
if(nbinEn>0)
G4cout << " Ehigh in the Edep plot = " << Enhigh << endl ;
G4cout << " Ehigh in the Edep plot = " << Enhigh << G4endl ;
}
void Em5RunAction::SetnbinGamma(G4int nbin)
{
nbinGamma = nbin ;
if(nbinGamma>0)
G4cout << " Nb of bins in gamma spectrum plot = " << nbinGamma << endl ;
G4cout << " Nb of bins in gamma spectrum plot = " << nbinGamma << G4endl ;
}
void Em5RunAction::SetElowGamma(G4double Elow)
{
ElowGamma = Elow ;
if(nbinGamma>0)
G4cout << " Elow in the gamma spectrum plot = " << ElowGamma << endl ;
G4cout << " Elow in the gamma spectrum plot = " << ElowGamma << G4endl ;
}
void Em5RunAction::SetEhighGamma(G4double Ehigh)
{
EhighGamma = Ehigh ;
if(nbinGamma>0)
G4cout << " Ehigh in the gamma spectrum plot = " << EhighGamma << endl ;
G4cout << " Ehigh in the gamma spectrum plot = " << EhighGamma << G4endl ;
}
void Em5RunAction::SetnbinTt(G4int nbin)
{
nbinTt = nbin ;
if(nbinTt>0)
G4cout << " Nb of bins in Etransmisssion plot = " << nbinTt << endl ;
G4cout << " Nb of bins in Etransmisssion plot = " << nbinTt << G4endl ;
}
void Em5RunAction::SetTtlow(G4double Elow)
{
Ttlow = Elow ;
if(nbinTt>0)
G4cout << " Elow in the Etransmission plot = " << Ttlow << endl ;
G4cout << " Elow in the Etransmission plot = " << Ttlow << G4endl ;
}
void Em5RunAction::SetTthigh(G4double Ehigh)
{
Tthigh = Ehigh ;
if(nbinTt>0)
G4cout << " Ehigh in the Etransmission plot = " << Tthigh << endl ;
G4cout << " Ehigh in the Etransmission plot = " << Tthigh << G4endl ;
}
void Em5RunAction::SetnbinTb(G4int nbin)
{
nbinTb = nbin ;
if(nbinTb>0)
G4cout << " Nb of bins in Ebackscattered plot = " << nbinTb << endl ;
G4cout << " Nb of bins in Ebackscattered plot = " << nbinTb << G4endl ;
}
void Em5RunAction::SetTblow(G4double Elow)
{
Tblow = Elow ;
if(nbinTb>0)
G4cout << " Elow in the Ebackscattered plot = " << Tblow << endl ;
G4cout << " Elow in the Ebackscattered plot = " << Tblow << G4endl ;
}
void Em5RunAction::SetTbhigh(G4double Ehigh)
{
Tbhigh = Ehigh ;
if(nbinTb>0)
G4cout << " Ehigh in the Ebackscattered plot = " << Tbhigh << endl ;
G4cout << " Ehigh in the Ebackscattered plot = " << Tbhigh << G4endl ;
}
void Em5RunAction::SetnbinTsec(G4int nbin)
{
nbinTsec = nbin ;
if(nbinTsec>0)
G4cout << " Nb of bins in Tsecondary plot = " << nbinTsec << endl ;
G4cout << " Nb of bins in Tsecondary plot = " << nbinTsec << G4endl ;
}
void Em5RunAction::SetTseclow(G4double Elow)
{
Tseclow = Elow ;
if(nbinTsec>0)
G4cout << " Elow in the Tsecondary plot = " << Tseclow << endl ;
G4cout << " Elow in the Tsecondary plot = " << Tseclow << G4endl ;
}
void Em5RunAction::SetTsechigh(G4double Ehigh)
{
Tsechigh = Ehigh ;
if(nbinTsec>0)
G4cout << " Ehigh in the Tsecondary plot = " << Tsechigh << endl ;
G4cout << " Ehigh in the Tsecondary plot = " << Tsechigh << G4endl ;
}
void Em5RunAction::SetnbinR(G4int nbin)
{
nbinR = nbin ;
if(nbinR>0)
G4cout << " Nb of bins in R plot = " << nbinR << endl ;
G4cout << " Nb of bins in R plot = " << nbinR << G4endl ;
}
void Em5RunAction::SetRlow(G4double rlow)
{
Rlow = rlow ;
if(nbinR>0)
G4cout << " Rlow in the R plot = " << Rlow << endl ;
G4cout << " Rlow in the R plot = " << Rlow << G4endl ;
}
void Em5RunAction::SetRhigh(G4double rhigh)
{
Rhigh = rhigh ;
if(nbinR>0)
G4cout << " Rhigh in the R plot = " << Rhigh << endl ;
G4cout << " Rhigh in the R plot = " << Rhigh << G4endl ;
}
void Em5RunAction::Setnbinzvertex(G4int nbin)
{
nbinvertexz = nbin ;
if(nbinvertexz>0)
G4cout << " Nb of bins in Z plot = " << nbinvertexz << endl ;
G4cout << " Nb of bins in Z plot = " << nbinvertexz << G4endl ;
}
void Em5RunAction::Setzlow(G4double z)
{
zlow = z ;
if(nbinvertexz>0)
G4cout << " zlow in the Z plot = " << zlow << endl ;
G4cout << " zlow in the Z plot = " << zlow << G4endl ;
}
void Em5RunAction::Setzhigh(G4double z)
{
zhigh = z ;
if(nbinvertexz>0)
G4cout << " zhigh in the Z plot = " << zhigh << endl ;
G4cout << " zhigh in the Z plot = " << zhigh << G4endl ;
}
void Em5RunAction::SetnbinTh(G4int nbin)
{
nbinTh = nbin ;
if(nbinTh>0)
G4cout << " Nb of bins in Theta plot = " << nbinTh << endl ;
G4cout << " Nb of bins in Theta plot = " << nbinTh << G4endl ;
}
void Em5RunAction::SetThlow(G4double Tlow)
{
Thlow = Tlow ;
if(nbinTh>0)
G4cout << " Tlow in the Theta plot = " << Thlow << endl ;
G4cout << " Tlow in the Theta plot = " << Thlow << G4endl ;
}
void Em5RunAction::SetThhigh(G4double Thigh)
{
Thhigh = Thigh ;
if(nbinTh>0)
G4cout << " Thigh in the Theta plot = " << Thhigh << endl ;
G4cout << " Thigh in the Theta plot = " << Thhigh << G4endl ;
}
void Em5RunAction::SetnbinThBack(G4int nbin)
{
nbinThback = nbin ;
if(nbinThback>0)
G4cout << " Nb of bins in Theta plot = " << nbinThback << endl ;
G4cout << " Nb of bins in Theta plot = " << nbinThback << G4endl ;
}
void Em5RunAction::SetThlowBack(G4double Tlow)
{
Thlowback = Tlow ;
if(nbinThback>0)
G4cout << " Tlow in the Theta plot = " << Thlowback << endl ;
G4cout << " Tlow in the Theta plot = " << Thlowback << G4endl ;
}
void Em5RunAction::SetThhighBack(G4double Thigh)
{
Thhighback = Thigh ;
if(nbinThback>0)
G4cout << " Thigh in the Theta plot = " << Thhighback << endl ;
G4cout << " Thigh in the Theta plot = " << Thhighback << G4endl ;
}
void Em5RunAction::CountParticles(G4double nch,G4double nne)
{