35 #include "DetectorConstruction.hh"
36 #include "HistoManager.hh"
49 fParticle(0), fEkin(0.),
50 nbOfModules(0), nbOfLayers(0), kLayerMax(0),
51 EtotCalor(0.), Etot2Calor(0.), EvisCalor(0.), Evis2Calor(0.),
117 const Run* localRun =
static_cast<const Run*
>(run);
160 G4cout <<
" The run was " << nbEvents <<
" " << partName <<
" of "
163 G4cout <<
"------------------------------------------------------------"
168 if (nbEvents == 0)
return;
172 std::ios::fmtflags mode =
G4cout.flags();
178 <<
"total Energy (rms/mean) "
179 <<
"visible Energy (rms/mean)" <<
G4endl;
183 G4double meanEtot,meanEtot2,varianceEtot,rmsEtot,resEtot;
184 G4double meanEvis,meanEvis2,varianceEvis,rmsEvis,resEvis;
190 varianceEtot = meanEtot2 - meanEtot*meanEtot;
191 resEtot = rmsEtot = 0.;
192 if (varianceEtot > 0.) rmsEtot = std::sqrt(varianceEtot);
193 if (meanEtot > 0.) resEtot = 100*rmsEtot/meanEtot;
194 analysisManager->FillH1(3, i1+0.5, meanEtot);
199 varianceEvis = meanEvis2 - meanEvis*meanEvis;
200 resEvis = rmsEvis = 0.;
201 if (varianceEvis > 0.) rmsEvis = std::sqrt(varianceEvis);
202 if (meanEvis > 0.) resEvis = 100*rmsEvis/meanEvis;
203 analysisManager->FillH1(4, i1+0.5, meanEvis);
208 <<
"\n layer " << i1 <<
": "
209 << std::setprecision(5)
210 << std::setw(6) <<
G4BestUnit(meanEtot,
"Energy") <<
" +- "
211 << std::setprecision(4)
212 << std::setw(5) <<
G4BestUnit( rmsEtot,
"Energy") <<
" ("
213 << std::setprecision(2)
214 << std::setw(3) << resEtot <<
" %)"
216 << std::setprecision(5)
217 << std::setw(6) <<
G4BestUnit(meanEvis,
"Energy") <<
" +- "
218 << std::setprecision(4)
219 << std::setw(5) <<
G4BestUnit( rmsEvis,
"Energy") <<
" ("
220 << std::setprecision(2)
221 << std::setw(3) << resEvis <<
" %)";
228 varianceEtot = meanEtot2 - meanEtot*meanEtot;
229 resEtot = rmsEtot = 0.;
230 if (varianceEtot > 0.) rmsEtot = std::sqrt(varianceEtot);
231 if (meanEtot > 0.) resEtot = 100*rmsEtot/meanEtot;
236 varianceEvis = meanEvis2 - meanEvis*meanEvis;
237 resEvis = rmsEvis = 0.;
238 if (varianceEvis > 0.) rmsEvis = std::sqrt(varianceEvis);
239 if (meanEvis > 0.) resEvis = 100*rmsEvis/meanEvis;
244 <<
"\n total calor : "
245 << std::setprecision(5)
246 << std::setw(6) <<
G4BestUnit(meanEtot,
"Energy") <<
" +- "
247 << std::setprecision(4)
248 << std::setw(5) <<
G4BestUnit( rmsEtot,
"Energy") <<
" ("
249 << std::setprecision(2)
250 << std::setw(3) << resEtot <<
" %)"
252 << std::setprecision(5)
253 << std::setw(6) <<
G4BestUnit(meanEvis,
"Energy") <<
" +- "
254 << std::setprecision(4)
255 << std::setw(5) <<
G4BestUnit( rmsEvis,
"Energy") <<
" ("
256 << std::setprecision(2)
257 << std::setw(3) << resEvis <<
" %)";
259 G4cout <<
"\n------------------------------------------------------------"
263 G4double meanEleak,meanEleak2,varianceEleak,rmsEleak,ratio;
264 meanEleak =
Eleak /nbEvents;
265 meanEleak2 =
Eleak2/nbEvents;
266 varianceEleak = meanEleak2 - meanEleak*meanEleak;
268 if (varianceEleak > 0.) rmsEleak = std::sqrt(varianceEleak);
269 ratio = 100*meanEleak/
fEkin;
279 << std::setprecision(5)
280 << std::setw(6) <<
G4BestUnit(meanEleak,
"Energy") <<
" +- "
281 << std::setprecision(4)
282 << std::setw(5) <<
G4BestUnit( rmsEleak,
"Energy")
283 <<
"\n Eleak/Ebeam ="
284 << std::setprecision(3)
285 << std::setw(4) << ratio <<
" % ( forward ="
286 << std::setw(4) << forward <<
" %; backward ="
287 << std::setw(4) << bakward <<
" %; lateral ="
288 << std::setw(4) << lateral <<
" %)"
291 G4cout.setf(mode,std::ios::floatfield);
296 analysisManager->ScaleH1(5,factor);
virtual void Merge(const G4Run *)
void SumEvents_2(G4double, G4double, G4double)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
std::vector< G4double > Evis2Layer
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
std::vector< G4double > Etot2Layer
ExG4HbookAnalysisManager G4AnalysisManager
void DetailedLeakage(G4int, G4double)
static const G4double factor
void SumEvents_1(G4int, G4double, G4double)
G4double energy(const ThreeVector &p, const G4double m)
std::vector< G4double > EvisLayer
DetectorConstruction * fDetector
Detector construction class to demonstrate various ways of placement.
G4ParticleDefinition * fParticle
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
void PrintCalorParameters()
std::vector< G4double > EtotLayer
virtual void Merge(const G4Run *)