1 #include <det/Detector.h>
3 #include <atm/Atmosphere.h>
4 #include <atm/ProfileResult.h>
5 #include <atm/InclinedAtmosphericProfile.h>
7 #include <fwk/CentralConfig.h>
8 #include <fwk/LocalCoordinateSystem.h>
9 #include <fwk/CoordinateSystemRegistry.h>
11 #include <utl/TimeStamp.h>
12 #include <utl/UTCDateTime.h>
13 #include <utl/Point.h>
14 #include <utl/Vector.h>
15 #include <utl/TabulatedFunction.h>
16 #include <utl/AugerUnits.h>
17 #include <utl/AugerException.h>
18 #include <utl/ErrorLogger.h>
20 #include <cppunit/extensions/HelperMacros.h>
21 #include <tst/Verify.h>
45 CPPUNIT_TEST_EXCEPTION(TestAccessHeightException,
47 CPPUNIT_TEST(TestAccessHeight);
48 CPPUNIT_TEST(TestAccessDepth);
49 CPPUNIT_TEST(TestVerticalGeometry);
52 CPPUNIT_TEST_SUITE_END();
62 CentralConfig::GetInstance(BOOTSTRAPFILE);
63 Detector::GetInstance().Update(
UTCDateTime(2005, 1, 1, 0, 0, 0).GetTimeStamp());
67 void tearDown()
override { }
72 Detector::GetInstance().GetAtmosphere().EvaluateHeightVsSlantDepth();
78 const auto& cs = det::Detector::GetInstance().GetReferenceCoordinateSystem();
79 const auto& atm = Detector::GetInstance().GetAtmosphere();
80 const Point origin(0,0,0, cs);
81 const Vector dir(0,0,-1, cs);
82 const double xStep = 20*
g/
cm2;
83 atm.InitSlantProfileModel(origin, -dir, xStep);
84 atm.EvaluateHeightVsSlantDepth();
90 const auto& cs = det::Detector::GetInstance().GetReferenceCoordinateSystem();
91 const auto& atm = Detector::GetInstance().GetAtmosphere();
92 const Point origin(0,0,0, cs);
93 const Vector dir(0,0,-1, cs);
94 const double xStep = 20*
g/
cm2;
95 atm.InitSlantProfileModel(origin, -dir, xStep);
96 atm.EvaluateHeightVsSlantDepth();
102 const auto& cs = det::Detector::GetInstance().GetReferenceCoordinateSystem();
105 const Point core(0,0,0, cs);
106 const Vector dir(0,0,-1, cs);
107 const double xStep = 20*
g/
cm2;
108 const auto& atm = Detector::GetInstance().GetAtmosphere();
109 atm.InitSlantProfileModel(core, -dir, xStep);
116 const auto& det = det::Detector::GetInstance();
117 const auto& atm = det.GetAtmosphere();
118 const auto& depthProfile = atm.EvaluateDepthVsHeight();
122 const auto& cs = det.GetReferenceCoordinateSystem();
123 const Point core(0,0,0, cs);
124 const Vector dir(0,0,-1, cs);
125 const double xStep = 20*
g/
cm2;
127 atm.InitSlantProfileModel(core, -dir, xStep);
129 const auto& heightVsSlant = atm.EvaluateDistanceVsSlantDepth();
131 const unsigned int nBins = 10;
132 const double minSlantDepth = heightVsSlant.MinX();
133 const double maxSlantDepth = heightVsSlant.MaxX();
134 const double dSlant = (maxSlantDepth - minSlantDepth) / (nBins - 1);
135 cout <<
" -- " << minSlantDepth <<
' '
136 << maxSlantDepth <<
' ' << nBins <<
'\n';
138 for (
unsigned int i = 0; i < nBins; ++i) {
139 const double atmSlantDepth = minSlantDepth + i * dSlant;
140 const double height = heightVsSlant.Y(atmSlantDepth);
141 const double atmDepth = depthProfile.Y(height);
143 << atmSlantDepth/
g*
cm2 <<
' '
144 << atmDepth/
g*
cm2 <<
' '
145 <<
abs(atmSlantDepth - atmDepth)/
g*
cm2
147 CPPUNIT_ASSERT(Verify<CloseTo>(atmDepth, atmSlantDepth, 1e-1*
g/
cm2));
223 auto& det = det::Detector::GetInstance();
224 [[maybe_unused]]
const auto& cs = det.GetReferenceCoordinateSystem();
225 auto& atm = det.GetAtmosphere();
227 const auto& depthProfile = atm.EvaluateDepthVsHeight();
228 cout <<
"depth profile: X " << depthProfile.MinX()/
meter <<
' ' << depthProfile.MaxX()/
meter <<
"\n"
229 " Y " << depthProfile.Y(depthProfile.MinX())/(
g/
cm2) <<
' ' << depthProfile.Y(depthProfile.MaxX())/(
g/
cm2)
232 const auto& heightProfile = atm.EvaluateHeightVsDepth();
233 cout <<
"height profile: X " << heightProfile.MinX()/(
g/
cm2) <<
' ' << heightProfile.MaxX()/(
g/
cm2) <<
"\n"
234 " Y " << heightProfile.Y(heightProfile.MinX())/
meter <<
' ' << heightProfile.Y(heightProfile.MaxX())/
meter
void TestInitWithProfile()
void TestHorizontalGeometry()
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
double abs(const SVector< n, T > &v)
void TestAccessHeightException()
void TestVerticalGeometry()
execption handling for calculation/access for inclined atmosphere model