33 #include "RunAction.hh"
35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
37 #include "HistoManager.hh"
54 fDetector(det), fPrimary(prim), fProcCounter(0), fHistoManager(HistM)
85 for(
size_t i = 0; i<
n; ++i) {
87 (*fProcCounter)[i]->Count();
101 if (NbOfEvents == 0)
return;
114 G4cout <<
"\n The run consists of " << NbOfEvents <<
" "<< particle <<
" of "
117 << material->
GetName() <<
" (density: "
122 G4cout <<
"\n Number of process calls --->";
124 G4String procName = (*fProcCounter)[i]->GetName();
125 if (procName !=
"Transportation") {
126 G4int count = (*fProcCounter)[i]->GetCounter();
127 G4cout <<
"\t" << procName <<
" : " << count;
136 G4double MeanFreePath = 1./totalCrossSection;
137 G4double massCrossSection = totalCrossSection/density;
140 G4cout <<
"\n Simulation: "
141 <<
"total CrossSection = " << totalCrossSection*
cm <<
" /cm"
142 <<
"\t MeanFreePath = " <<
G4BestUnit(MeanFreePath,
"Length")
143 <<
"\t massicCrossSection = " << massCrossSection*
g/
cm2 <<
" cm2/g"
148 if(particle ==
"mu+" || particle ==
"mu-") {
149 totalCrossSection = 0.;
151 G4String procName = (*fProcCounter)[i]->GetName();
152 if (procName !=
"Transportation") {
157 MeanFreePath = 1./totalCrossSection;
158 massCrossSection = totalCrossSection/density;
161 <<
"total CrossSection = " << totalCrossSection*
cm <<
" /cm"
162 <<
"\t MeanFreePath = " <<
G4BestUnit(MeanFreePath,
"Length")
163 <<
"\t massicCrossSection = " << massCrossSection*
g/
cm2 <<
" cm2/g"
172 for(
size_t i = 0; i<
n; ++i) {
delete (*fProcCounter)[i]; }
189 if (process ==
"muIoni") {
id = 11; cut =
GetEnergyCut(material,1);}
190 else if (process ==
"muPairProd") {
id = 12; cut = 2*(
GetEnergyCut(material,1)
192 else if (process ==
"muBrems") {
id = 13; cut =
GetEnergyCut(material,0);}
193 else if (process ==
"muonNuclear"){
id = 14; cut = 100*
MeV;}
194 if (
id == 0) {
return 0.; }
196 G4int nbOfBins = 100;
198 G4double binMin = std::log10(cut/ekin);
220 G4double lgeps, etransf, sigmaE, dsigma;
228 for (
G4int ibin=0; ibin<nbOfBins; ibin++) {
229 lgeps = binMin + (ibin+0.5)*binWidth;
230 etransf = ekin*std::pow(10.,lgeps);
232 dsigma = sigmaE*etransf*binWidth*
ln10;
233 if (etransf > cut) sigmaTot += dsigma;
235 G4double NbProcess = NbOfMu*length*dsigma;
236 histoTh->fill(lgeps, NbProcess);
253 (index < table->GetTableSize())) index++;