2 #include <evt/ShowerRecData.h>
3 #include <evt/ShowerSRecData.h>
5 #include <sevt/SEvent.h>
6 #include <sevt/SortCriteria.h>
8 #include <utl/ErrorLogger.h>
9 #include <utl/Branch.h>
10 #include <utl/AugerUnits.h>
12 #include <tst/Validatrix.h>
14 #include <fwk/CentralConfig.h>
15 #include <fwk/LocalCoordinateSystem.h>
25 using namespace tst::Validatrix;
26 using namespace ValidationNS;
35 fResults =
new ofstream(fRefFileName +
".new");
45 ERROR(
"Event should contain an SEvent.");
50 const SEvent& sEvent =
event.GetSEvent();
56 const double sigEps = 0.05;
58 for (
const auto& station : sEvent.StationsRange()) {
59 if (station.HasRecData()) {
61 label <<
"E" << eventId <<
"_S" << station.GetId();
62 *fResults <<
BeLabel(label.str());
63 *fResults <<
BeCloseRel(station.GetRecData().GetTotalSignal(), sigEps);
67 *fResults <<
BeLabel(
"Shower_rec");
71 ERROR(
"Event does not contain a RecShower");
78 ERROR(
"RecShower does not have SRecShower");
80 *fResults <<
BeLabel(
"Shower_S_rec");
91 const double relEps = 1e-3;
95 label << eventId <<
"_ShowerSize";
96 *fResults <<
BeLabel(label.str());
100 label << eventId <<
"_ShowerSizeError";
101 *fResults <<
BeLabel(label.str());
105 label << eventId <<
"_LDFChi2";
106 *fResults <<
BeLabel(label.str());
110 label << eventId <<
"_LDFNdof";
111 *fResults <<
BeLabel(label.str());
115 label << eventId <<
"_Theta";
116 *fResults <<
BeLabel(label.str());
120 label << eventId <<
"_Phi";
121 *fResults <<
BeLabel(label.str());
125 label << eventId <<
"_ThetaError";
126 *fResults <<
BeLabel(label.str());
130 label << eventId <<
"_PhiError";
131 *fResults <<
BeLabel(label.str());
135 const double posEps = 0.1*
meter;
137 label << eventId <<
"_CoreX";
138 *fResults <<
BeLabel(label.str());
142 label << eventId <<
"_CoreY";
143 *fResults <<
BeLabel(label.str());
147 label << eventId <<
"_CoreZ";
148 *fResults <<
BeLabel(label.str());
158 label << eventId <<
"_CoreXVariance";
159 *fResults <<
BeLabel(label.str());
163 label << eventId <<
"_CoreYVariance";
164 *fResults <<
BeLabel(label.str());
168 label << eventId <<
"_CoreXYCovariance";
169 *fResults <<
BeLabel(label.str());
173 label << eventId <<
"_CoreTSecond";
174 *fResults <<
BeLabel(label.str());
178 label << eventId <<
"_CoreTNanoSecond";
179 *fResults <<
BeLabel(label.str());
183 label << eventId <<
"_CoreXError";
184 *fResults <<
BeLabel(label.str());
188 label << eventId <<
"_CoreYError";
189 *fResults <<
BeLabel(label.str());
193 label << eventId <<
"_CoreZError";
194 *fResults <<
BeLabel(label.str());
198 label << eventId <<
"_CoreTError";
199 *fResults <<
BeLabel(label.str());
212 ifstream newFile(fRefFileName +
".new");
213 ifstream oldFile(fRefFileName);
215 const bool comp =
Compare(oldFile, newFile,
true);
219 "#--------------------------------#\n"
220 ":all SD tests were successful:\n"
221 "#--------------------------------#");
224 "#------------------------------#\n"
225 ":one or more SD tests failed:\n"
226 "#------------------------------#");
Branch GetTopBranch() const
std::string BeCloseRel(const T &value, const double tolerance=kDefaultTolerance)
double GetPhi(const CoordinateSystemPtr &coordinateSystem) const
azimuth (phi) angle in spherical and cylindrical coordinates
Interface class to access to the SD Reconstruction of a Shower.
Interface class to access Shower Reconstructed parameters.
bool HasRecShower() const
Interface class to access to the SD part of an event.
double GetTheta(const CoordinateSystemPtr &coordinateSystem) const
zenith (theta) angle in spherical coordinates
double GetParameterCovariance(const Parameter q1, const Parameter q2) const
const utl::Vector & GetCoreError() const
#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)
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Class representing a document branch.
bool Compare(const string &oldFilename, const string &newFilename, const bool failOnFirst)
double GetX(const CoordinateSystemPtr &coordinateSystem) const
const utl::TimeStamp & GetCoreTime() const
time when shower front passes through the core point
std::string BeLabel(const string &tag)
const utl::Point & GetBarycenter() const
double GetThetaError() const
const utl::Vector & GetAxis() const
double GetPhiError() const
void GetData(bool &b) const
Overloads of the GetData member template function.
double GetLDFChi2() const
double GetInterval() const
Get the time interval as a double (in Auger base units)
std::string BeEqual(const T &value)
double GetY(const CoordinateSystemPtr &coordinateSystem) const
const utl::TimeInterval & GetCoreTimeError() const
ResultFlag
Flag returned by module methods to the RunController.
unsigned long GetGPSSecond() const
GPS second.
double GetGPSNanoSecond() const
GPS nanosecond.
double GetShowerSizeError() const
const utl::Point & GetCorePosition() const
sevt::Header & GetHeader()
double GetLDFNdof() const
double GetZ(const CoordinateSystemPtr &coordinateSystem) const
#define ERROR(message)
Macro for logging error messages.
bool HasSRecShower() const