9 #include <io/EVAFile.h>
10 #include <io/EVAIOException.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>
39 CPPUNIT_TEST (testConstruct);
40 CPPUNIT_TEST (testGetNEvents);
41 CPPUNIT_TEST (testRead);
42 CPPUNIT_TEST_SUITE_END();
60 CPPUNIT_ASSERT (file =
new EVAFile (TESTFILE));
66 CPPUNIT_ASSERT (f->GetNEvents() == 1);
74 const double start_times[6] = {1.0824, 0.8214, 1.0596, 0.1590, 0.9667, 0.8041};
75 const double field_sample1[6][3] = {
76 { 9.7513824668E-05, 1.6809870176E-05, -3.1268147325E-05},
77 {-1.0457331050E-01, -2.1307854418E-02, 3.5102479773E-02},
78 {-1.3048007407E+00, -2.9347374586E-01, 4.3270475183E-01},
79 {-2.7832267828E+03, -5.0633607442E+02, 8.5908390450E+02},
80 {-1.5242416513E-02, -2.8939296207E-03, 3.6363917902E-03},
81 {-9.3780203407E+02, -2.1832715112E+02, 2.7429037668E+02}
83 const double field_sample2[6][3] = {
84 { 1.8118094038E+02, 2.7474426401E+01, -7.2966177649E+01},
85 { 4.2307544703E+02, 8.6342326262E+01, -1.0922502801E+02},
86 { 4.5767736476E+02, 1.0886486729E+02, -9.2860815629E+01},
87 { 4.0576623131E+02, 7.0267573388E+01, -1.2122706669E+02},
88 { 4.8185477571E+02, 1.1248897768E+02, -8.8667336289E+01},
89 { 4.5953447261E+02, 1.0833208790E+02, -8.7527963838E+01}
91 const double field_sample3[6][3] = {
92 { 3.4397880870E-03, -1.0811865284E-02, 1.1460809613E-02},
93 { 5.1979536749E-03, -8.6519291944E-03, 6.9117284726E-03},
94 { 7.0621774784E-03, -9.2785115705E-03, 7.5364749611E-03},
95 { 0.0000000000E+00, -0.0000000000E+00, 0.0000000000E+00},
96 { 1.1726113640E-02, -6.6024960407E-03, 8.2778160319E-03},
97 { 6.3571980942E-06, 1.0960432053E-06, -2.0383258957E-06}
101 int num_events_in_file = f->GetNEvents();
105 CPPUNIT_ASSERT (Verify<Equal>(num_events_in_file, 1));
107 while (f->Read (event) !=
io::eEOF) {
110 const CoordinateSystemPtr refCS = det::Detector::GetInstance().GetReferenceCoordinateSystem();
113 CPPUNIT_ASSERT (Verify <Less> (num_events, 1));
121 CPPUNIT_ASSERT (Verify <CloseTo> (shower.
GetEnergy(), 1.0919*
EeV));
124 const double zenith = (-shower.
GetDirection()).GetTheta(localCS);
125 const double azimuth = (-shower.
GetDirection()).GetPhi(localCS);
127 CPPUNIT_ASSERT (Verify <CloseTo> (zenith, 58.357683919*
deg));
128 CPPUNIT_ASSERT (Verify <CloseTo> (azimuth, -68.990120994*
deg));
134 CPPUNIT_ASSERT (Verify<Equal>(radsim.
GetNumPulses(), (long)6));
142 CPPUNIT_ASSERT (Verify<Less> (num_pulses, 6));
149 CPPUNIT_ASSERT (Verify<CloseTo>(simpulse.
GetStartTime(),
153 CPPUNIT_ASSERT (Verify<CloseTo>(sample[0],
155 CPPUNIT_ASSERT (Verify<CloseTo>(sample[1],
157 CPPUNIT_ASSERT (Verify<CloseTo>(sample[2],
161 CPPUNIT_ASSERT (Verify<CloseTo>(sample[0],
163 CPPUNIT_ASSERT (Verify<CloseTo>(sample[1],
165 CPPUNIT_ASSERT (Verify<CloseTo>(sample[2],
169 CPPUNIT_ASSERT (Verify<CloseTo>(sample[0],
171 CPPUNIT_ASSERT (Verify<CloseTo>(sample[1],
173 CPPUNIT_ASSERT (Verify<CloseTo>(sample[2],
177 CPPUNIT_ASSERT (Verify<CloseTo>(sample[0], 0 *
micro *
volt /
meter));
178 CPPUNIT_ASSERT (Verify<CloseTo>(sample[1], 0 *
micro *
volt /
meter));
179 CPPUNIT_ASSERT (Verify<CloseTo>(sample[2], 0 *
micro *
volt /
meter));
183 CPPUNIT_ASSERT (Verify<Equal>(num_pulses, 6));
186 CPPUNIT_ASSERT (Verify<Equal>(num_events, 1));
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Get the Auger coordinate system associated to the shower core position.
double GetBinning() const
Get the sampling time scale.
Data structure for simulated Radio pulses.
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.
Read EVA simulation output.
const SimRadioPulse & GetNextSimRadioPulse(bool &ok)
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
void MakeGeometry(const utl::Point &pointOnShowerAxis)
initialize the shower geometry. Pos is a point on the shower axis, but not necessarily the core ...
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.