36 #include "DetectorConstruction.hh"
37 #include "PrimaryGeneratorAction.hh"
38 #include "RunActionMessenger.hh"
39 #include "EmAcceptance.hh"
54 :
G4Run(),fDet(det),fKin(kin),
127 dLCumul += f_dEdL[i];
137 dRCumul += f_dEdR[j];
155 analysisManager->FillH1(1, 100.*dLCumul/(Ekin+mass));
156 analysisManager->FillH1(2, fChargTrLength/radl);
157 analysisManager->FillH1(3, fNeutrTrLength/radl);
164 const Run* localRun =
static_cast<const Run*
>(run);
198 assert(NbOfEvents*kinEnergy > 0);
204 G4double norme = 100./(NbOfEvents*(kinEnergy+mass));
210 MyVector MeanELongit(f_nLbin), rmsELongit(f_nLbin);
211 MyVector MeanELongitCumul(f_nLbin), rmsELongitCumul(f_nLbin);
220 - fSumELongit[i]*fSumELongit[i]));
223 rmsELongitCumul[i] = norme*std::sqrt(std::abs(NbOfEvents*
226 analysisManager->FillH1(4, bin,MeanELongit[i]/dLradl);
227 analysisManager->FillH1(5, bin, rmsELongit[i]/dLradl);
229 analysisManager->FillH1(6, bin,MeanELongitCumul[i]);
230 analysisManager->FillH1(7, bin, rmsELongitCumul[i]);
242 rmsERadial[i] = norme*std::sqrt(std::abs(NbOfEvents*
fSumE2Radial[i]
243 - fSumERadial[i]*fSumERadial[i]));
248 - fSumERadialCumul[i]*fSumERadialCumul[i]));
251 analysisManager->FillH1(8, bin,MeanERadial[i]/dRradl);
252 analysisManager->FillH1(9, bin, rmsERadial[i]/dRradl);
254 analysisManager->FillH1(10, bin,MeanERadialCumul[i]);
255 analysisManager->FillH1(11, bin, rmsERadialCumul[i]);
262 if ((MeanERadialCumul[0] <= EMoliere) &&
263 (MeanERadialCumul[f_nRbin-1] >= EMoliere)) {
265 while( (imin < f_nRbin-1) && (MeanERadialCumul[imin] < EMoliere) )
267 G4double ratio = (EMoliere - MeanERadialCumul[imin]) /
268 (MeanERadialCumul[imin+1] - MeanERadialCumul[imin]);
269 iMoliere = 1. + imin + ratio;
278 - fSumChargTrLength*fSumChargTrLength));
283 - fSumNeutrTrLength*fSumNeutrTrLength));
286 std::ios::fmtflags mode =
G4cout.flags();
287 G4cout.setf(std::ios::fixed,std::ios::floatfield);
292 G4cout <<
" LOGITUDINAL PROFILE "
293 <<
" CUMULATIVE LOGITUDINAL PROFILE" <<
G4endl <<
G4endl;
295 G4cout <<
" bin " <<
" Mean rms "
296 <<
" bin " <<
" Mean rms \n" <<
G4endl;
299 G4double inf=i*dLradl, sup=inf+dLradl;
301 G4cout << std::setw(8) << inf <<
"->"
302 << std::setw(5) << sup <<
" radl: "
303 << std::setw(7) << MeanELongit[i] <<
"% "
304 << std::setw(9) << rmsELongit[i] <<
"% "
305 <<
" 0->" << std::setw(5) << sup <<
" radl: "
306 << std::setw(7) << MeanELongitCumul[i] <<
"% "
307 << std::setw(7) << rmsELongitCumul[i] <<
"% "
313 G4cout <<
" RADIAL PROFILE "
314 <<
" CUMULATIVE RADIAL PROFILE" << G4endl <<
G4endl;
316 G4cout <<
" bin " <<
" Mean rms "
317 <<
" bin " <<
" Mean rms \n" <<
G4endl;
320 G4double inf=i*dRradl, sup=inf+dRradl;
322 G4cout << std::setw(8) << inf <<
"->"
323 << std::setw(5) << sup <<
" radl: "
324 << std::setw(7) << MeanERadial[i] <<
"% "
325 << std::setw(9) << rmsERadial[i] <<
"% "
326 <<
" 0->" << std::setw(5) << sup <<
" radl: "
327 << std::setw(7) << MeanERadialCumul[i] <<
"% "
328 << std::setw(7) << rmsERadialCumul[i] <<
"% "
335 G4cout <<
" Total number pf events: " << NbOfEvents <<
"\n"
340 G4cout <<
" energy deposit : "
341 << std::setw(7) << MeanELongitCumul[f_nLbin-1] <<
" % E0 +- "
342 << std::setw(7) << rmsELongitCumul[f_nLbin-1] <<
" % E0" <<
G4endl;
343 G4cout <<
" charged traklen: "
344 << std::setw(7) << MeanChargTrLength <<
" radl +- "
345 << std::setw(7) << rmsChargTrLength <<
" radl" <<
G4endl;
346 G4cout <<
" neutral traklen: "
347 << std::setw(7) << MeanNeutrTrLength <<
" radl +- "
348 << std::setw(7) << rmsNeutrTrLength <<
" radl" <<
G4endl;
350 if (iMoliere > 0. ) {
353 G4cout <<
"\n " << EMoliere <<
" % confinement: radius = "
354 << RMoliere1 <<
" radl ("
358 G4cout.setf(mode,std::ios::floatfield);
367 G4double e = MeanELongitCumul[nLbin-1]/100.;
368 G4double r = rmsELongitCumul[nLbin-1]/100.;
virtual void Merge(const G4Run *)
DetectorConstruction * fDet
MyVector fSumE2RadialCumul
G4double fSum2ChargTrLength
void EmAcceptanceGauss(const G4String &title, G4int stat, G4double avr, G4double avr0, G4double rms, G4double limit)
MyVector fSumELongitCumul
G4double fSumNeutrTrLength
G4double fSum2NeutrTrLength
void InitializePerEvent()
void BeginOfAcceptance(const G4String &title, G4int stat)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
std::vector< G4double > MyVector
G4double fSumChargTrLength
G4GLOB_DLL std::ostream G4cout
MyVector fSumERadialCumul
G4int GetNumberOfEvent() const
G4Material * GetMaterial()
ExG4HbookAnalysisManager G4AnalysisManager
G4double GetRadlen() const
G4double GetPDGMass() const
G4ParticleGun * GetParticleGun()
MyVector fSumE2LongitCumul
G4ParticleDefinition * GetParticleDefinition() const
Detector construction class to demonstrate various ways of placement.
virtual void Merge(const G4Run *)
PrimaryGeneratorAction * fKin
G4double GetParticleEnergy() const
Run(DetectorConstruction *)