1 #include <det/Detector.h>
2 #include <sdet/SDetector.h>
3 #include <fwk/CentralConfig.h>
4 #include <utl/TimeStamp.h>
5 #include <utl/UTCDateTime.h>
6 #include <utl/TabulatedFunction.h>
7 #include <utl/Reader.h>
8 #include <utl/CoordinateSystem.h>
10 #include <utl/AugerException.h>
11 #include <utl/ErrorLogger.h>
13 #include <fwk/CoordinateSystemRegistry.h>
14 #include <fwk/RunController.h>
16 #include <evt/Event.h>
17 #include <evt/ShowerSimData.h>
18 #include <evt/DefaultShowerGeometryProducer.h>
20 #include <sevt/SEvent.h>
21 #include <sevt/Station.h>
23 #include <tst/Verify.h>
25 #include <cppunit/extensions/HelperMacros.h>
52 CPPUNIT_TEST(testBasicZenith);
53 CPPUNIT_TEST_SUITE_END();
62 CentralConfig::GetInstance(BOOTSTRAPFILE);
65 Detector::GetInstance().Update(
UTCDateTime(2005,1,1).GetTimeStamp());
73 const auto& det = Detector::GetInstance();
80 Event& evt = RunController::GetInstance().GetCurrentEvent();
86 const double theta = 45*
degree;
88 const double x = -10*
km;
89 const double y = 17*
km;
91 const Point core(x, y, z, pampaCS);
94 const auto& sDet = det.GetSDetector();
95 const int refStationId = 860;
96 const auto& ref = sDet.GetStation(refStationId).GetPosition();
98 const double xyTol = 3*
m;
99 const double zTol = 0.8*
m;
101 const Point& p0 = sDet.GetStation(99999).GetPosition();
102 CPPUNIT_ASSERT(Verify<CloseTo>(p0.
GetX(pampaCS), core.
GetX(pampaCS), xyTol));
103 CPPUNIT_ASSERT(Verify<CloseTo>(p0.
GetY(pampaCS), core.
GetY(pampaCS), xyTol));
104 CPPUNIT_ASSERT(Verify<CloseTo>(p0.
GetZ(pampaCS), ref.GetZ(pampaCS), zTol));
106 #define DUMP(_x_) #_x_ " (" << (_x_.GetX(pampaCS) - core.GetX(pampaCS)) << ", " \
107 << (_x_.GetY(pampaCS) - core.GetY(pampaCS)) << ", " \
108 << (_x_.GetZ(pampaCS) - ref.GetZ(pampaCS)) << ")\n"
115 for (
int i = 1; i < 10; ++i) {
116 const int id = 99999 - i;
117 const double phi = 45 * i *
degree;
118 const double x = 1000 * cos(phi) / cos(theta);
119 const double y = 1000 * sin(phi);
120 const Point& p1 = sDet.GetStation(
id).GetPosition();
121 cout <<
"dense " <<
id <<
" (" << (p1.
GetX(pampaCS) - core.
GetX(pampaCS) - x)/
m <<
", "
122 << (p1.
GetY(pampaCS) - core.
GetY(pampaCS) - y)/
m <<
", "
123 << (p1.
GetZ(pampaCS) - ref.GetZ(pampaCS))/
m <<
")\n";
124 CPPUNIT_ASSERT(Verify<CloseTo>(p1.
GetX(pampaCS) - core.
GetX(pampaCS), x, xyTol));
125 CPPUNIT_ASSERT(Verify<CloseTo>(p1.
GetY(pampaCS) - core.
GetY(pampaCS), y, xyTol));
126 CPPUNIT_ASSERT(Verify<CloseTo>(p1.
GetZ(pampaCS), ref.GetZ(pampaCS), zTol));
bool HasSimShower() const
void SetGroundParticleCoordinateSystemAzimuth(const double azimuth)
Set the azimuth angle of the shower. Angle in x-y plane wrt. to the x axis (0 is from east)...
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
Interface class to access Shower Simulated parameters.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
double GetX(const CoordinateSystemPtr &coordinateSystem) const
ShowerSimData & GetSimShower()
double GetY(const CoordinateSystemPtr &coordinateSystem) const
void SetGroundParticleCoordinateSystemZenith(const double zenith)
Set the zenith angle of the shower. Room angle between z-axis and direction from where the shower is ...
void MakeGeometry(const utl::Point &pointOnShowerAxis)
initialize the shower geometry. Pos is a point on the shower axis, but not necessarily the core ...
void MakeSimShower(const evt::VShowerGeometryProducer &p)
double GetZ(const CoordinateSystemPtr &coordinateSystem) const