9 #include <io/CONEXFile.h>
10 #include <io/CONEXIOException.h>
11 #include <io/CONEXStructures.h>
12 #include <io/IoCodes.h>
14 #include <evt/Event.h>
15 #include <evt/ShowerSimData.h>
17 #include <utl/AugerUnits.h>
18 #include <utl/Particle.h>
19 #include <utl/TabulatedFunction.h>
21 #include <fwk/CentralConfig.h>
23 #include <det/Detector.h>
25 #include <cppunit/extensions/HelperMacros.h>
29 #include <tst/Verify.h>
41 CPPUNIT_TEST(testConstruct);
43 CPPUNIT_TEST(testOpen);
46 CPPUNIT_TEST(testClose);
48 CPPUNIT_TEST(testFindEvent);
49 CPPUNIT_TEST(testGotoPosition);
50 CPPUNIT_TEST(testGetNEvents);
51 CPPUNIT_TEST(testRead);
52 CPPUNIT_TEST(testProfileRead);
54 CPPUNIT_TEST_SUITE_END();
76 CPPUNIT_ASSERT (file =
new CONEXFile (TESTFILE));
88 { f->Open (TESTFILE); }
94 f->Open(
"NoSuchCONEXShowerFile.root");
115 CPPUNIT_ASSERT(f->FindEvent(2) ==
io::eFail);
116 CPPUNIT_ASSERT(f->FindEvent(0) !=
io::eFail);
123 CPPUNIT_ASSERT(f->GotoPosition(0) !=
io::eFail);
124 CPPUNIT_ASSERT(f->GotoPosition(2) ==
io::eFail);
139 CPPUNIT_ASSERT(f->GetNEvents() == 1);
154 const int nEventsInFile = f->GetNEvents();
158 while (f->Read(event) !=
io::eEOF) {
162 const CoordinateSystemPtr refCS = det::Detector::GetInstance().GetReferenceCoordinateSystem();
167 CPPUNIT_ASSERT(Verify<CloseTo>(shower.
GetEnergy(), 1.e19*
eV));
170 const double zenith = (-shower.
GetDirection()).GetTheta(localCS);
171 const double azimuth = (-shower.
GetDirection()).GetPhi(localCS);
173 CPPUNIT_ASSERT(Verify<CloseTo>(zenith, 60.*
deg));
174 CPPUNIT_ASSERT(Verify<CloseTo>(azimuth, 0*
deg));
178 CPPUNIT_ASSERT(Verify<Equal>(nEventsInFile, nEventsSeen));
187 for (
int i = 0; i < f->GetNEvents(); ++i) {
193 CPPUNIT_ASSERT(shower.
HasdEdX());
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.
Read profiles from CONEX.
void testGetNEventsClosedException()
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
Interface class to access Shower Simulated parameters.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
const utl::Vector & GetDirection() const
Get the direction of the shower axis. This is the true direction of shower movement.
void Expected()
Print `Expected' for expected failures.
double GetEnergy() const
Get the energy of the shower primary particle.
void testConstructException()
Base for exceptions in the CORSIKA reader.
bool HasdEdX() const
Check initialization of the energy deposit.
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 ...
void testOpenNonExisting()
bool HasLongitudinalProfile(const ProfileType type=eCharged) const
Check initialization of the longitudinal profile.