34 #include "DetectorConstruction.hh"
35 #include "HistoManager.hh"
48 fParticle(0), fEkin(0.),
49 nbOfModules(0), nbOfLayers(0), kLayerMax(0),
50 EtotCalor(0.), Etot2Calor(0.), EvisCalor(0.), Evis2Calor(0.),
116 const Run* localRun =
static_cast<const Run*
>(run);
159 G4cout <<
" The run was " << nbEvents <<
" " << partName <<
" of "
162 G4cout <<
"------------------------------------------------------------"
167 if (nbEvents == 0)
return;
171 std::ios::fmtflags mode =
G4cout.flags();
177 <<
"total Energy (rms/mean) "
178 <<
"visible Energy (rms/mean)" <<
G4endl;
182 G4double meanEtot,meanEtot2,varianceEtot,rmsEtot,resEtot;
183 G4double meanEvis,meanEvis2,varianceEvis,rmsEvis,resEvis;
189 varianceEtot = meanEtot2 - meanEtot*meanEtot;
190 resEtot = rmsEtot = 0.;
191 if (varianceEtot > 0.) rmsEtot = std::sqrt(varianceEtot);
192 if (meanEtot > 0.) resEtot = 100*rmsEtot/meanEtot;
193 analysisManager->
FillH1(3, i1+0.5, meanEtot);
198 varianceEvis = meanEvis2 - meanEvis*meanEvis;
199 resEvis = rmsEvis = 0.;
200 if (varianceEvis > 0.) rmsEvis = std::sqrt(varianceEvis);
201 if (meanEvis > 0.) resEvis = 100*rmsEvis/meanEvis;
202 analysisManager->
FillH1(4, i1+0.5, meanEvis);
207 <<
"\n layer " << i1 <<
": "
208 << std::setprecision(5)
209 << std::setw(6) <<
G4BestUnit(meanEtot,
"Energy") <<
" +- "
210 << std::setprecision(4)
211 << std::setw(5) <<
G4BestUnit( rmsEtot,
"Energy") <<
" ("
212 << std::setprecision(2)
213 << std::setw(3) << resEtot <<
" %)"
215 << std::setprecision(5)
216 << std::setw(6) <<
G4BestUnit(meanEvis,
"Energy") <<
" +- "
217 << std::setprecision(4)
218 << std::setw(5) <<
G4BestUnit( rmsEvis,
"Energy") <<
" ("
219 << std::setprecision(2)
220 << std::setw(3) << resEvis <<
" %)";
227 varianceEtot = meanEtot2 - meanEtot*meanEtot;
228 resEtot = rmsEtot = 0.;
229 if (varianceEtot > 0.) rmsEtot = std::sqrt(varianceEtot);
230 if (meanEtot > 0.) resEtot = 100*rmsEtot/meanEtot;
235 varianceEvis = meanEvis2 - meanEvis*meanEvis;
236 resEvis = rmsEvis = 0.;
237 if (varianceEvis > 0.) rmsEvis = std::sqrt(varianceEvis);
238 if (meanEvis > 0.) resEvis = 100*rmsEvis/meanEvis;
243 <<
"\n total calor : "
244 << std::setprecision(5)
245 << std::setw(6) <<
G4BestUnit(meanEtot,
"Energy") <<
" +- "
246 << std::setprecision(4)
247 << std::setw(5) <<
G4BestUnit( rmsEtot,
"Energy") <<
" ("
248 << std::setprecision(2)
249 << std::setw(3) << resEtot <<
" %)"
251 << std::setprecision(5)
252 << std::setw(6) <<
G4BestUnit(meanEvis,
"Energy") <<
" +- "
253 << std::setprecision(4)
254 << std::setw(5) <<
G4BestUnit( rmsEvis,
"Energy") <<
" ("
255 << std::setprecision(2)
256 << std::setw(3) << resEvis <<
" %)";
258 G4cout <<
"\n------------------------------------------------------------"
263 meanEleak =
Eleak /nbEvents;
264 meanEleak2 =
Eleak2/nbEvents;
265 varianceEleak = meanEleak2 - meanEleak*meanEleak;
267 if (varianceEleak > 0.) rmsEleak = std::sqrt(varianceEleak);
268 ratio = 100*meanEleak/
fEkin;
278 << std::setprecision(5)
279 << std::setw(6) <<
G4BestUnit(meanEleak,
"Energy") <<
" +- "
280 << std::setprecision(4)
281 << std::setw(5) <<
G4BestUnit( rmsEleak,
"Energy")
282 <<
"\n Eleak/Ebeam ="
283 << std::setprecision(3)
284 << std::setw(4) << ratio <<
" % ( forward ="
285 << std::setw(4) << forward <<
" %; backward ="
286 << std::setw(4) << bakward <<
" %; lateral ="
287 << std::setw(4) << lateral <<
" %)"
290 G4cout.setf(mode,std::ios::floatfield);
295 analysisManager->
ScaleH1(5,factor);