2 #include <evt/ShowerRecData.h>
3 #include <evt/ShowerSRecData.h>
5 #include <sevt/SEvent.h>
6 #include <sevt/PMTSimData.h>
8 #include <fevt/FEvent.h>
10 #include <fevt/Telescope.h>
11 #include <fevt/EyeRecData.h>
12 #include <fevt/TelescopeRecData.h>
14 #include <evt/ShowerFRecData.h>
16 #include <utl/ErrorLogger.h>
17 #include <utl/Branch.h>
18 #include <utl/Particle.h>
19 #include <utl/AugerUnits.h>
21 #include <tst/Validatrix.h>
23 #include <fwk/CentralConfig.h>
35 using namespace tst::Validatrix;
36 using namespace HybridSimValidationNS;
43 CentralConfig::GetInstance()->
GetTopBranch(
"HybridSimValidation");
46 fOutputName = fRefFileName + string(
".new");
47 fOutput =
new ofstream(fOutputName.c_str());
56 ostringstream eventId;
57 eventId <<
event.GetHeader().GetId();
58 *fOutput <<
BeLabel(eventId.str());
64 ERROR(
"Event does not contain an SEvent.");
70 ERROR(
"Event should contain an FEvent.");
74 const FEvent& fEvent =
event.GetFEvent();
79 eIt != fEvent.
EyesEnd(ComponentSelector::eHasData); ++eIt) {
81 if (eIt->HasRecData()) {
83 eLabel <<
"Eye_" << eIt->GetId();
84 *fOutput <<
BeLabel(eLabel.str());
86 if (eIt->HasRecData()) {
87 if (eIt->GetRecData().HasFRecShower()) {
88 const ShowerFRecData& showerRec = eIt->GetRecData().GetFRecShower();
89 *fOutput <<
BeLabel(
"Stations_in_fit");
92 *fOutput <<
BeLabel(
"TotalEnergy(EeV)");
95 *fOutput <<
BeLabel(
"Xmax(g/cm2)");
102 tIt != eIt->TelescopesEnd(ComponentSelector::eHasData); ++tIt) {
104 if (tIt->HasRecData()) {
105 ostringstream tLabel;
106 tLabel <<
"Telescope_" << tIt->GetId();
107 *fOutput <<
BeLabel(tLabel.str());
116 *fOutput <<
BeLabel(
"Shower_rec");
121 ERROR(
"Event does not contain a RecShower");
128 ERROR(
"RecShower does not have SRecShower");
130 *fOutput <<
BeLabel(
"Shower_S_rec");
142 HybridSimValidation::Finish()
147 ifstream oldFile(fRefFileName.c_str());
148 ifstream newFile(fOutputName.c_str());
150 const bool comp =
Compare(oldFile, newFile,
false);
Branch GetTopBranch() const
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
std::vector< unsigned short int > & GetStationIds()
retrieve vector of station IDs used in hybrid fit
EyeIterator EyesEnd(const ComponentSelector::Status status)
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.
void GetData(bool &b) const
Overloads of the GetData member template function.
Top of Fluorescence Detector event hierarchy.
std::string BeEqual(const T &value)
ResultFlag
Flag returned by module methods to the RunController.
Interface class to access to Fluorescence reconstruction of a Shower.
#define ERROR(message)
Macro for logging error messages.
bool HasSRecShower() const
boost::filter_iterator< ComponentSelector, ConstAllTelescopeIterator > ConstTelescopeIterator