2 #include <evt/ShowerRecData.h>
3 #include <evt/ShowerSRecData.h>
5 #include <sevt/SEvent.h>
6 #include <sevt/SortCriteria.h>
7 #include <sevt/PMTSimData.h>
9 #include <fevt/FEvent.h>
11 #include <fevt/Telescope.h>
12 #include <fevt/EyeRecData.h>
13 #include <fevt/TelescopeRecData.h>
15 #include <evt/ShowerFRecData.h>
17 #include <utl/ErrorLogger.h>
18 #include <utl/Branch.h>
19 #include <utl/Particle.h>
20 #include <utl/AugerUnits.h>
22 #include <tst/Validatrix.h>
24 #include <fwk/CentralConfig.h>
36 using namespace tst::Validatrix;
39 namespace ValidationNS {
44 INFO(
"Doing the validation !!!!");
47 const string mode = topB.
GetChild(
"Mode").
Get<
string>();
49 cout <<
"Validation mode = " << mode << endl;
51 fMode = (mode ==
"Create") ? Validation::eCreate : Validation::eCompare;
53 fResults =
new stringstream;
64 ERROR(
"Event should contain an SEvent.");
69 const SEvent& sEvent =
event.GetSEvent();
75 if (sIt->HasRecData()) {
77 label <<
"Station_" << sIt->GetId();
78 *fResults <<
BeLabel(label.str());
79 *fResults <<
BeCloseRel(sIt->GetRecData().GetTotalSignal(), 0.05);
85 ERROR(
"Event should contain an FEvent.");
89 const FEvent& fEvent =
event.GetFEvent();
94 eIt != fEvent.
EyesEnd(ComponentSelector::eHasData); ++eIt) {
96 if (eIt->HasRecData()) {
98 eLabel <<
"Eye_" << eIt->GetId();
99 *fResults <<
BeLabel(eLabel.str());
101 if (eIt->GetRecData().HasFRecShower()) {
102 const ShowerFRecData& showerRec = eIt->GetRecData().GetFRecShower();
103 *fResults <<
BeLabel(
"Stations_in_fit");
106 *fResults <<
BeLabel(
"TotalEnergy(EeV)");
109 *fResults <<
BeLabel(
"TotalEnergyError(EeV)");
112 *fResults <<
BeLabel(
"Xmax(g/cm2)");
117 *fResults <<
BeLabel(
"Xmax2Error");
124 tIt != eIt->TelescopesEnd(ComponentSelector::eHasData); ++tIt) {
125 if (tIt->HasRecData()) {
126 ostringstream tLabel;
127 tLabel <<
"Telescope_" << tIt->GetId();
128 *fResults <<
BeLabel(tLabel.str());
133 *fResults <<
BeLabel(
"photon_trace_start_sec");
134 *fResults <<
BeEqual(tRec.GetPhotonsStartTime().GetGPSSecond());
135 *fResults <<
BeLabel(
"photon_trace_start_ns");
136 *fResults <<
BeCloseAbs(tRec.GetPhotonsStartTime().GetGPSNanoSecond(), 50*
ns);
142 *fResults <<
BeLabel(
"Shower_rec");
146 ERROR(
"Event does not contain a RecShower");
152 ERROR(
"RecShower does not have SRecShower");
154 *fResults <<
BeLabel(
"Shower_S_rec");
170 if (fMode == Validation::eCreate) {
171 INFO(
"Writing reference file");
172 ofstream fout(fRefFileName.c_str());
173 fout << fResults->str();
176 INFO(
"Comparing re-reconstruction results to reference file");
177 ifstream savedFile(fRefFileName.c_str());
178 comp =
Compare(*fResults, savedFile,
false);
182 string newRef = fRefFileName +
".after-rereconstruction";
183 ofstream fout(newRef.c_str());
184 fout << fResults->str();
Branch GetTopBranch() const
StationIterator StationsEnd()
End of all stations.
std::string BeCloseRel(const T &value, const double tolerance=kDefaultTolerance)
Interface class to access to the SD Reconstruction of a Shower.
boost::filter_iterator< ComponentSelector, ConstAllEyeIterator > ConstEyeIterator
Interface class to access Shower Reconstructed parameters.
bool HasRecShower() const
double GetTotalEnergy() const
retrieve total energy and its uncertainty
Interface class to access to the SD part of an event.
std::vector< unsigned short int > & GetStationIds()
retrieve vector of station IDs used in hybrid fit
EyeIterator EyesEnd(const ComponentSelector::Status status)
#define INFO(message)
Macro for logging informational messages.
double GetShowerSize() const
void Init()
Initialise the registry.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
ShowerSRecData & GetSRecShower()
std::string BeCloseAbs(const T &value, const double tolerance=kDefaultTolerance)
Class representing a document branch.
bool Compare(const string &oldFilename, const string &newFilename, const bool failOnFirst)
std::string BeLabel(const string &tag)
EyeIterator EyesBegin(const ComponentSelector::Status status)
Telescope-specific shower reconstruction data.
double GetTotalEnergyError(const EUncertaintyType type=eTotal) const
void GetData(bool &b) const
Overloads of the GetData member template function.
Top of Fluorescence Detector event hierarchy.
std::string BeEqual(const T &value)
bool HasGHParameters() const
ResultFlag
Flag returned by module methods to the RunController.
StationIterator StationsBegin()
Beginning of all stations.
Interface class to access to Fluorescence reconstruction of a Shower.
boost::indirect_iterator< InternalConstStationIterator, const Station & > ConstStationIterator
#define ERROR(message)
Macro for logging error messages.
bool HasSRecShower() const
boost::filter_iterator< ComponentSelector, ConstAllTelescopeIterator > ConstTelescopeIterator