9 #include <io/AiresShowerFile.h>
10 #include <io/AiresUtilities.h>
11 #include <io/IoCodes.h>
12 #include <evt/Event.h>
13 #include <evt/ShowerSimData.h>
14 #include <utl/AugerUnits.h>
15 #include <utl/Particle.h>
16 #include <utl/NucleusProperties.h>
17 #include <utl/ShowerParticleIterator.h>
18 #include <fwk/CentralConfig.h>
19 #include <det/Detector.h>
21 #include <tst/Verify.h>
22 #include <cppunit/extensions/HelperMacros.h>
38 CPPUNIT_TEST(testConstruct);
40 CPPUNIT_TEST(testOpen);
44 CPPUNIT_TEST(testClose);
49 CPPUNIT_TEST(testGetNEvents);
50 CPPUNIT_TEST(testRead);
51 CPPUNIT_TEST(testReadNucleus);
52 CPPUNIT_TEST(testParticleRead);
56 CPPUNIT_TEST(testLongitudinalProfile);
57 CPPUNIT_TEST(testdEdX);
58 CPPUNIT_TEST(testSingleShowerLongitudinalProfile);
59 CPPUNIT_TEST(testSingleShowerdEdX);
63 CPPUNIT_TEST_SUITE_END();
103 f->Open(
"NoSuchAiresEventFile.grdpcles");
135 CPPUNIT_ASSERT(f->FindEvent(2) !=
io::eFail);
136 CPPUNIT_ASSERT(f->FindEvent(0) ==
io::eFail);
143 CPPUNIT_ASSERT(f->GotoPosition(0) !=
io::eFail);
144 CPPUNIT_ASSERT(f->GotoPosition(2) ==
io::eFail);
159 CPPUNIT_ASSERT(f->GetNEvents() == 5);
174 const int nEventsInFile = f->GetNEvents();
177 while (f->Read(event) !=
io::eEOF) {
180 CPPUNIT_ASSERT(event.HasSimShower());
186 CPPUNIT_ASSERT(Verify<CloseTo>(shower.GetEnergy(), 1.e20*
eV));
187 CPPUNIT_ASSERT(Verify<CloseTo>(shower.GetZenith(), 32.42*
deg));
188 CPPUNIT_ASSERT(Verify<CloseTo>(shower.GetMinRadiusCut(), 1.*
m));
189 CPPUNIT_ASSERT(Verify<CloseTo>(shower.GetMaxRadiusCut(), 10.*
km));
190 CPPUNIT_ASSERT(shower.GetShowerRunId() == string(
"AiresTest"));
196 CPPUNIT_ASSERT(shower.GetShowerNumber() == showerId);
201 CPPUNIT_ASSERT(nEventsInFile == nEventsSeen);
207 f->Open(TESTFILEIRON);
211 CPPUNIT_ASSERT(event.HasSimShower());
214 CPPUNIT_ASSERT(shower.GetPrimaryParticle() ==
215 NucleusProperties::TypeCode(26, 56));
224 for (
int i = 0; i < f->GetNEvents(); i++) {
229 CPPUNIT_ASSERT(event.HasSimShower());
232 shower.MakePosition(
Point(0,0,0,
233 det::Detector::GetInstance().GetSiteCoordinateSystem()));
235 double nParticles = 0;
239 p != shower.GroundParticlesEnd(); ++
p, ++num)
240 nParticles +=
p->GetWeight();
243 CPPUNIT_ASSERT(1e11 < nParticles && nParticles < 1e12);
258 CPPUNIT_ASSERT(event.HasSimShower());
261 CPPUNIT_ASSERT(shower.HasLongitudinalProfile());
264 const double zen = shower.GetZenith();
266 CPPUNIT_ASSERT(Verify<CloseTo>(prof.Y(43.2583*(
g/
cm2)/cos(zen)),
268 CPPUNIT_ASSERT(Verify<CloseTo>(prof.Y(242.240*(
g/
cm2)/cos(zen)),
281 CPPUNIT_ASSERT(event.HasSimShower());
284 const double zen = shower.GetZenith();
287 const double auxStep = 873.792/100./cos(zen);
289 CPPUNIT_ASSERT(shower.HasdEdX());
292 CPPUNIT_ASSERT(Verify<CloseTo>(dEdX.Y(43.2583*(
g/
cm2)/cos(zen))*auxStep/(
GeV/(
g/
cm2)),
294 CPPUNIT_ASSERT(Verify<CloseTo>(dEdX.Y(795.930*(
g/
cm2)/cos(zen))*auxStep/(
GeV/(
g/
cm2)),
301 f->Open(TESTFILESINGLESHOWER);
305 CPPUNIT_ASSERT(event.HasSimShower());
308 CPPUNIT_ASSERT(shower.HasLongitudinalProfile());
311 const double zen = shower.GetZenith();
313 CPPUNIT_ASSERT(Verify<CloseTo>(prof.Y(43.2583*(
g/
cm2)/cos(zen)),
315 CPPUNIT_ASSERT(Verify<CloseTo>(prof.Y(242.240*(
g/
cm2)/cos(zen)),
322 f->Open(TESTFILESINGLESHOWER);
326 CPPUNIT_ASSERT(event.HasSimShower());
329 const double zen = shower.GetZenith();
332 const double auxStep = 873.792/100./cos(zen);
334 CPPUNIT_ASSERT(shower.HasdEdX());
337 CPPUNIT_ASSERT(Verify<CloseTo>(dEdX.Y(43.2583*(
g/
cm2)/cos(zen))*auxStep/(
GeV/(
g/
cm2)),
339 CPPUNIT_ASSERT(Verify<CloseTo>(dEdX.Y(795.930*(
g/
cm2)/cos(zen))*auxStep/(
GeV/(
g/
cm2)),
Iterator to retrieve particles from utl::VShowerParticlList.
Class to hold collection (x,y) points and provide interpolation between them.
void testGetNEventsClosedException()
void testSingleShowerLongitudinalProfile()
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
Interface class to access Shower Simulated parameters.
void Expected()
Print `Expected' for expected failures.
void testOpenNonExisting()
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
void testSingleShowerdEdX()
void testConstructException()
Utility to open an Aires generated shower file on disc.
void testLongitudinalProfile()