9 #include <io/REASFile.h>
10 #include <io/REASIOException.h>
11 #include <io/IoCodes.h>
13 #include <evt/Event.h>
14 #include <evt/ShowerSimData.h>
15 #include <evt/VGaisserHillasParameter.h>
16 #include <evt/RadioSimulation.h>
17 #include <evt/SimRadioPulse.h>
19 #include <utl/AugerUnits.h>
20 #include <utl/Particle.h>
22 #include <fwk/CentralConfig.h>
24 #include <det/Detector.h>
26 #include <tst/Verify.h>
27 #include <cppunit/extensions/HelperMacros.h>
40 CPPUNIT_TEST (testConstruct);
49 CPPUNIT_TEST (testGetNEvents);
50 CPPUNIT_TEST (testRead);
54 CPPUNIT_TEST_SUITE_END();
79 CPPUNIT_ASSERT(file =
new REASFile(TESTFILE));
146 CPPUNIT_ASSERT(f->GetNEvents() == 1);
164 int nEventsInFile = f->GetNEvents();
167 while (f->Read(event) !=
io::eEOF) {
172 const CoordinateSystemPtr refCS = det::Detector::GetInstance().GetReferenceCoordinateSystem();
177 CPPUNIT_ASSERT(Verify<CloseTo>(shower.
GetEnergy(), 1.36772e+18*
eV));
180 const double zenith = (-shower.
GetDirection()).GetTheta(localCS);
181 const double azimuth = (-shower.
GetDirection()).GetPhi(localCS);
187 CPPUNIT_ASSERT(Verify<CloseTo>(zenith/
deg, 58.7811));
188 CPPUNIT_ASSERT(Verify<CloseTo>(azimuth/
deg+360, 23.3532 + 180 - 2.714 + 90.0));
190 CPPUNIT_ASSERT(Verify<Equal>(shower.
GetShowerRunId(), std::string(
"1")));
200 CPPUNIT_ASSERT(Verify<Equal>(radsim.
GetNumPulses(), (long)14));
204 const unsigned int frontpadding = 0;
206 CPPUNIT_ASSERT(Verify<Equal>(ok,
true));
209 CPPUNIT_ASSERT(Verify<CloseTo>(simpulse.
GetBinning(), binning));
210 CPPUNIT_ASSERT(Verify<CloseTo>(simpulse.
GetStartTime(), 5.026e-07*
second-frontpadding*binning));
223 CPPUNIT_ASSERT(Verify<Equal>(nEventsInFile, nEventsSeen));
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Get the Auger coordinate system associated to the shower core position.
int GetPrimaryParticle() const
Get the type of the shower primary particle.
double GetBinning() const
Get the sampling time scale.
const evt::VGaisserHillasParameter & GetGHParameters() const
Get the Gaisser-Hillas parameters of the shower.
Data structure for simulated Radio pulses.
bool HasGroundParticles() const
Data structure for a radio simulation (including several SimRadioPulses)
double GetBinning() const
size of one slot
bool HasRadioSimulation() const
Check initialization of the RadioSimulation.
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
Interface class to access Shower Simulated parameters.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
int GetShowerNumber() const
Get the number of the shower in the file.
double GetDistanceOfShowerMaximum() const
Get the geometrical distance of the shower maximum from the core.
const utl::Vector & GetDirection() const
Get the direction of the shower axis. This is the true direction of shower movement.
std::vector< T >::size_type SizeType
bool HasCorePosition() const
RadioSimulation & GetRadioSimulation()
Get the radio simulation data.
constexpr double nanosecond
double GetEnergy() const
Get the energy of the shower primary particle.
const SimRadioPulse & GetNextSimRadioPulse(bool &ok)
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
std::string GetShowerRunId() const
Get the run id for the shower.
void MakeGeometry(const utl::Point &pointOnShowerAxis)
initialize the shower geometry. Pos is a point on the shower axis, but not necessarily the core ...
bool HasGHParameters() const
Check initialization of the Gaisser-Hillas parameters.
Read REAS simulation output.
long GetNumPulses() const
Get the number of radio pulses contained in the RadioSimulation.
const utl::TraceV3D & GetEfieldTimeSeries() const
Get the Trace of the simulated electric field.
double GetStartTime() const
Get the timestamp of the first sample.