1 #include <io/ZHAireSFile.h>
2 #include <io/ZHAireSIOException.h>
3 #include <io/IoCodes.h>
6 #include <evt/ShowerSimData.h>
7 #include <evt/VGaisserHillasParameter.h>
8 #include <evt/RadioSimulation.h>
9 #include <evt/SimRadioPulse.h>
11 #include <utl/AugerUnits.h>
12 #include <utl/Particle.h>
14 #include <fwk/CentralConfig.h>
16 #include <det/Detector.h>
18 #include <tst/Verify.h>
19 #include <cppunit/extensions/HelperMacros.h>
33 CPPUNIT_TEST(testConstruct);
34 CPPUNIT_TEST(testGetNEvents);
35 CPPUNIT_TEST(testRead);
36 CPPUNIT_TEST_SUITE_END();
68 fFile->Open(TESTFILE);
69 CPPUNIT_ASSERT(fFile->GetNEvents() == 1);
77 fFile->Open(TESTFILE);
78 int nEventsInFile = fFile->GetNEvents();
81 while (fFile->Read(fEvent) !=
io::eEOF) {
85 const CoordinateSystemPtr refCS = det::Detector::GetInstance().GetReferenceCoordinateSystem();
90 CPPUNIT_ASSERT(Verify<CloseTo>(shower.
GetEnergy(), 7.4411e17*
eV));
93 const double zenith = (-shower.
GetDirection()).GetTheta(localCS);
94 CPPUNIT_ASSERT(Verify<CloseTo>(zenith, 51.73*
deg));
95 const double azimuth = (-shower.
GetDirection()).GetPhi(localCS);
96 const double airesAzimuthDeg = -105.23;
98 CPPUNIT_ASSERT(Verify<CloseTo>(azimuth, (airesAzimuthDeg + 90 - 4.23)*
deg));
101 CPPUNIT_ASSERT(Verify<Equal>(shower.
GetShowerRunId(), std::string(
"1")));
108 CPPUNIT_ASSERT(Verify<Equal>(radsim.
GetNumPulses(), 7L));
112 const unsigned int frontpadding = 0;
114 CPPUNIT_ASSERT(Verify<Equal>(ok,
true));
117 CPPUNIT_ASSERT(Verify<CloseTo>(simpulse.
GetBinning(), binning));
120 const unsigned int samplenumber = 3575;
122 CPPUNIT_ASSERT(Verify<CloseTo>(sample[0]/
volt*
meter, -2.85945943595946640e-03));
123 CPPUNIT_ASSERT(Verify<CloseTo>(sample[1]/
volt*meter, -2.03602779956765009e-03));
124 CPPUNIT_ASSERT(Verify<CloseTo>(sample[2]/
volt*meter, 2.61886417865753174e-03));
128 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.
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.
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.
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.