2 #include <sevt/SEvent.h>
3 #include <sevt/SortCriteria.h>
4 #include <sevt/PMTSimData.h>
6 #include <utl/ErrorLogger.h>
7 #include <utl/Branch.h>
8 #include <utl/TimeDistribution.h>
9 #include <utl/Particle.h>
10 #include <tst/Validatrix.h>
12 #include <fwk/CentralConfig.h>
21 using namespace tst::Validatrix;
22 using namespace TankValidationNS;
28 auto topB = CentralConfig::GetInstance()->GetTopBranch(
"TankValidation");
29 topB.GetChild(
"RefFilename").GetData(fRefFile);
39 ERROR(
"Event should have SEvent.");
43 const auto newRefFile = fRefFile + string(
".new");
45 ofstream outFile(newRefFile);
48 const auto& sEvent =
event.GetSEvent();
50 for (
const auto&
s : sEvent.StationsRange()) {
52 for (
const auto& pmt :
s.PMTsRange()) {
54 if (!pmt.HasSimData())
57 const auto& pmtSim = pmt.GetSimData();
59 for (
const auto& pe : pmtSim.PETimeDistributionsRange()) {
63 label <<
"Station_" <<
s.GetId() <<
"_PMT_" << pmt.GetId() <<
"_label_" << pe.GetLabel();
64 outFile <<
BeLabel(label.str()) <<
BeEqual(pe.GetTimeDistribution());
71 ifstream newFile(newRefFile);
72 ifstream oldFile(fRefFile);
79 TankValidation::Finish()
#define INFO(message)
Macro for logging informational messages.
void Init()
Initialise the registry.
bool Compare(const string &oldFilename, const string &newFilename, const bool failOnFirst)
std::string BeLabel(const string &tag)
std::string BeEqual(const T &value)
ResultFlag
Flag returned by module methods to the RunController.
#define ERROR(message)
Macro for logging error messages.