1 #include <io/SenecaShowerFile.h>
3 #include <evt/ShowerSimData.h>
4 #include <utl/AugerException.h>
10 #include <io/IoCodes.h>
11 #include <evt/Event.h>
12 #include <evt/ShowerSimData.h>
13 #include <utl/AugerUnits.h>
14 #include <utl/Particle.h>
15 #include <utl/ShowerParticleIterator.h>
17 #include <fwk/CentralConfig.h>
18 #include <det/Detector.h>
20 #include <tst/Verify.h>
21 #include <cppunit/extensions/HelperMacros.h>
39 CPPUNIT_TEST(testConstruct);
41 CPPUNIT_TEST(testOpen);
45 CPPUNIT_TEST(testClose);
46 CPPUNIT_TEST(testCloseClose);
48 CPPUNIT_TEST(testFindEvent);
49 CPPUNIT_TEST(testGotoPosition);
50 CPPUNIT_TEST(testGetNEvents);
51 CPPUNIT_TEST(testRead);
52 CPPUNIT_TEST(testParticleRead);
53 CPPUNIT_TEST_EXCEPTION(testGetNEventsClosedException,
55 CPPUNIT_TEST_SUITE_END();
93 { f->Open(TESTFILE); }
99 f->Open(
"NoSuchSenecaShowerFile.ptcl");
133 CPPUNIT_ASSERT(Verify<Equal>(f->FindEvent(0),
io::eFail));
155 CPPUNIT_ASSERT(Verify<Equal>(f->GetNEvents(), 2));
171 int nEventsInFile = f->GetNEvents();
173 while (f->Read(event) !=
io::eEOF) {
178 const CoordinateSystemPtr refCS = det::Detector::GetInstance().GetReferenceCoordinateSystem();
183 CPPUNIT_ASSERT(Verify<CloseTo>(shower.
GetEnergy(), 9.99995e19*
eV));
186 const double zenith = (-shower.
GetDirection()).GetTheta(localCS);
187 const double azimuth = (-shower.
GetDirection()).GetPhi(localCS);
189 CPPUNIT_ASSERT(Verify<CloseTo>(zenith, 32.4199*
deg));
190 CPPUNIT_ASSERT(Verify<CloseTo>(azimuth, 91.0196*
deg - 180*
deg));
193 CPPUNIT_ASSERT(Verify<Equal>(shower.
GetShowerRunId(), std::string(
"1")));
198 CPPUNIT_ASSERT(Verify<Equal>(nEventsInFile, nEventsSeen));
206 for (
int i = 0; i < f->GetNEvents(); ++i) {
212 Point(0,0,0, det::Detector::GetInstance().GetSiteCoordinateSystem())
215 long double nParticles = 0;
218 nParticles +=
p->GetWeight();
220 CPPUNIT_ASSERT(Verify<Greater>(nParticles, 1e11L));
221 CPPUNIT_ASSERT(Verify<Less>(nParticles, 1e12L));
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.
Iterator to retrieve particles from utl::VShowerParticlList.
utl::ShowerParticleIterator GroundParticlesEnd() const
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
Base class to report exceptions in IO.
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.
void testOpenNonExisting()
const utl::Vector & GetDirection() const
Get the direction of the shower axis. This is the true direction of shower movement.
void testConstructException()
bool Verify(const Predicate &pred, const T &lhs, const T &rhs)
Test condition by evaluating a predicate and print on failure.
void Expected()
Print `Expected' for expected failures.
double GetEnergy() const
Get the energy of the shower primary particle.
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 ...
void testGetNEventsClosedException()
Read data from the output of Seneca.
utl::ShowerParticleIterator GroundParticlesBegin() const