2 #include <sevt/SEvent.h>
3 #include <sevt/PMTSimData.h>
4 #include <utl/ErrorLogger.h>
5 #include <utl/Branch.h>
6 #include <utl/TimeDistribution.h>
7 #include <utl/Particle.h>
8 #include <utl/ParticlePropertiesFactory.h>
9 #include <fwk/CentralConfig.h>
20 namespace AnalyzerNS {
28 const int stationId = topB.
GetChild(
"StationId").
Get<
int>();
31 info <<
"\n StationId = " << stationId <<
'\n';
34 const string particleName = ParticlePropertiesFactory::Create(particleType)->GetName();
35 info <<
" Particle = " << particleType <<
" (" << particleName <<
")\n";
38 info <<
" Energy = " << energy/
GeV <<
" GeV\n";
41 filename << particleName <<
'_' << energy/
GeV <<
"GeV_3x800ns.txt";
43 fOutput.open(filename.str().c_str());
45 info <<
" Filename = " << filename.str();
56 ERROR(
"Event should have SEvent!");
60 const SEvent& sEvent =
event.GetSEvent();
64 for (
const auto& st : sEvent.StationsRange()) {
66 int bins800ns[3] = { 0 };
67 int bins800nsSSD[3] = { 0 };
69 for (
const auto& pmt : st.PMTsRange()) {
71 if (!pmt.HasSimData())
75 if (!sim.HasPETimeDistribution())
78 cerr <<
"PE " << st.GetId() <<
' ' << pmt.GetId() <<
"->";
82 const auto& peTD = sim.GetPETimeDistribution();
84 for (
const auto& tb : peTD.SparseRange()) {
85 const int t = tb.get<0>();
86 const int npe = tb.get<1>();
91 bins800ns[bin] += npe;
93 bins800nsSSD[bin] += npe;
95 cerr <<
' ' << t <<
':' << npe;
98 cerr <<
" total: " << peTotal <<
'\n';
102 fOutput << bins800ns[0] <<
' ' << bins800ns[1] <<
' ' << bins800ns[2] <<
" "
103 << bins800nsSSD[0] <<
' ' << bins800nsSSD[1] <<
' ' << bins800nsSSD[2]
109 cerr <<
"** nStations " << nStations << endl;
Branch GetTopBranch() const
Interface class to access to the SD part of an event.
#define INFO(message)
Macro for logging informational messages.
void Init()
Initialise the registry.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Class representing a document branch.
SEventSimData & GetSimData()
Get the object with simulated data, throw if n.a.
ResultFlag
Flag returned by module methods to the RunController.
#define ERROR(message)
Macro for logging error messages.