36 #include "DetectorConstruction.hh"
37 #include "PrimaryGeneratorAction.hh"
38 #include "EmAcceptance.hh"
48 :
G4Run(),fDet(det),fKin(kin),
121 dLCumul += f_dEdL[i];
131 dRCumul += f_dEdR[j];
149 analysisManager->FillH1(1, 100.*dLCumul/(Ekin+mass));
150 analysisManager->FillH1(2, fChargTrLength/radl);
151 analysisManager->FillH1(3, fNeutrTrLength/radl);
158 analysisManager->FillP1(0, bin, norm*
f_dEdL[i]/dLradl);
163 analysisManager->FillP1(1, bin, norm*
f_dEdR[j]/dRradl);
171 const Run* localRun =
static_cast<const Run*
>(run);
205 assert(NbOfEvents*kinEnergy > 0);
211 G4double norme = 100./(NbOfEvents*(kinEnergy+mass));
217 MyVector MeanELongit(f_nLbin), rmsELongit(f_nLbin);
218 MyVector MeanELongitCumul(f_nLbin), rmsELongitCumul(f_nLbin);
227 - fSumELongit[i]*fSumELongit[i]));
230 rmsELongitCumul[i] = norme*std::sqrt(std::abs(NbOfEvents*
233 analysisManager->FillH1(4, bin,MeanELongit[i]/dLradl);
234 analysisManager->FillH1(5, bin, rmsELongit[i]/dLradl);
236 analysisManager->FillH1(6, bin,MeanELongitCumul[i]);
237 analysisManager->FillH1(7, bin, rmsELongitCumul[i]);
249 rmsERadial[i] = norme*std::sqrt(std::abs(NbOfEvents*
fSumE2Radial[i]
250 - fSumERadial[i]*fSumERadial[i]));
255 - fSumERadialCumul[i]*fSumERadialCumul[i]));
258 analysisManager->FillH1(8, bin,MeanERadial[i]/dRradl);
259 analysisManager->FillH1(9, bin, rmsERadial[i]/dRradl);
261 analysisManager->FillH1(10, bin,MeanERadialCumul[i]);
262 analysisManager->FillH1(11, bin, rmsERadialCumul[i]);
269 if ((MeanERadialCumul[0] <= EMoliere) &&
270 (MeanERadialCumul[f_nRbin-1] >= EMoliere)) {
272 while( (imin < f_nRbin-1) && (MeanERadialCumul[imin] < EMoliere) )
274 G4double ratio = (EMoliere - MeanERadialCumul[imin]) /
275 (MeanERadialCumul[imin+1] - MeanERadialCumul[imin]);
276 iMoliere = 1. + imin + ratio;
285 - fSumChargTrLength*fSumChargTrLength));
290 - fSumNeutrTrLength*fSumNeutrTrLength));
293 std::ios::fmtflags mode =
G4cout.flags();
294 G4cout.setf(std::ios::fixed,std::ios::floatfield);
299 G4cout <<
" LOGITUDINAL PROFILE "
300 <<
" CUMULATIVE LOGITUDINAL PROFILE" <<
G4endl <<
G4endl;
302 G4cout <<
" bin " <<
" Mean rms "
303 <<
" bin " <<
" Mean rms \n" <<
G4endl;
306 G4double inf=i*dLradl, sup=inf+dLradl;
308 G4cout << std::setw(8) << inf <<
"->"
309 << std::setw(5) << sup <<
" radl: "
310 << std::setw(7) << MeanELongit[i] <<
"% "
311 << std::setw(9) << rmsELongit[i] <<
"% "
312 <<
" 0->" << std::setw(5) << sup <<
" radl: "
313 << std::setw(7) << MeanELongitCumul[i] <<
"% "
314 << std::setw(7) << rmsELongitCumul[i] <<
"% "
320 G4cout <<
" RADIAL PROFILE "
321 <<
" CUMULATIVE RADIAL PROFILE" << G4endl <<
G4endl;
323 G4cout <<
" bin " <<
" Mean rms "
324 <<
" bin " <<
" Mean rms \n" <<
G4endl;
327 G4double inf=i*dRradl, sup=inf+dRradl;
329 G4cout << std::setw(8) << inf <<
"->"
330 << std::setw(5) << sup <<
" radl: "
331 << std::setw(7) << MeanERadial[i] <<
"% "
332 << std::setw(9) << rmsERadial[i] <<
"% "
333 <<
" 0->" << std::setw(5) << sup <<
" radl: "
334 << std::setw(7) << MeanERadialCumul[i] <<
"% "
335 << std::setw(7) << rmsERadialCumul[i] <<
"% "
342 G4cout <<
" Total number of events: " << NbOfEvents <<
"\n"
347 G4cout <<
" energy deposit : "
348 << std::setw(7) << MeanELongitCumul[f_nLbin-1] <<
" % E0 +- "
349 << std::setw(7) << rmsELongitCumul[f_nLbin-1] <<
" % E0" <<
G4endl;
350 G4cout <<
" charged traklen: "
351 << std::setw(7) << MeanChargTrLength <<
" radl +- "
352 << std::setw(7) << rmsChargTrLength <<
" radl" <<
G4endl;
353 G4cout <<
" neutral traklen: "
354 << std::setw(7) << MeanNeutrTrLength <<
" radl +- "
355 << std::setw(7) << rmsNeutrTrLength <<
" radl" <<
G4endl;
357 if (iMoliere > 0. ) {
360 G4cout <<
"\n " << EMoliere <<
" % confinement: radius = "
361 << RMoliere1 <<
" radl ("
365 G4cout.setf(mode,std::ios::floatfield);
374 G4double e = MeanELongitCumul[nLbin-1]/100.;
375 G4double r = rmsELongitCumul[nLbin-1]/100.;
G4double GetdRlength() const
PrimaryGeneratorAction * fKin
std::vector< G4double > MyVector
G4double GetRadlen() const
G4double fSumNeutrTrLength
G4ParticleGun * GetParticleGun()
MyVector fSumE2RadialCumul
G4double GetPDGMass() const
G4int GetNumberOfEvent() const
G4double GetdRradl() const
G4double fSum2NeutrTrLength
MyVector fSumE2LongitCumul
G4double fSumChargTrLength
DetectorConstruction * fDet
G4double fSum2ChargTrLength
virtual void Merge(const G4Run *)
The primary generator action class with particle gun.
G4CsvAnalysisManager G4AnalysisManager
G4double GetdLradl() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void InitializePerEvent()
void EmAcceptanceGauss(const G4String &title, G4int stat, G4double avr, G4double avr0, G4double rms, G4double limit)
G4double GetParticleEnergy() const
MyVector fSumERadialCumul
G4GLOB_DLL std::ostream G4cout
virtual void Merge(const G4Run *)
void BeginOfAcceptance(const G4String &title, G4int stat)
G4ParticleDefinition * GetParticleDefinition() const
G4Material * GetMaterial()
Simple detector construction with a box volume placed in a world.
MyVector fSumELongitCumul