testParametricXMLProfileModel.cc
Go to the documentation of this file.
1 
10 #include <det/Detector.h>
11 #include <atm/AerosolDB.h>
12 #include <atm/AerosolZone.h>
13 #include <atm/AttSlice.h>
14 #include <atm/PFSlice.h>
15 #include <atm/MolecularZone.h>
16 #include <atm/ProfileResult.h>
17 
18 #include <fwk/CentralConfig.h>
19 
20 #include <utl/TimeStamp.h>
21 #include <utl/UTCDateTime.h>
22 #include <utl/ErrorLogger.h>
23 
24 #include <cppunit/extensions/HelperMacros.h>
25 #include <tst/Verify.h>
26 
27 #include <iostream>
28 
29 using namespace std;
30 using namespace det;
31 using namespace atm;
32 using namespace fwk;
33 using namespace utl;
34 using namespace tst;
35 
36 
37 class testParametricXMLProfileModel : public CppUnit::TestFixture {
38 
39  CPPUNIT_TEST_SUITE(testParametricXMLProfileModel);
40 
41  CPPUNIT_TEST(testEvaluateDepth);
42  CPPUNIT_TEST(testEvaluateHeight);
43  CPPUNIT_TEST(testEvaluateTemperature);
44  CPPUNIT_TEST(testEvaluateDensity);
45  CPPUNIT_TEST(testEvaluateRefractionIndex);
46  // CPPUNIT_TEST(testMinMax);
47 
48  CPPUNIT_TEST_SUITE_END();
49 
50 public:
51 
52  void setUp(){
53 
54  CentralConfig::GetInstance(BOOTSTRAPFILE);
55  ErrorLogger::GetInstance().SetVerbosity(Verbosity::eVerbose);
56 
57  }
58 
59  void tearDown(){
60  }
61 
63 
64  Detector::GetInstance().Update(UTCDateTime(2005,1,1,0,0,0).GetTimeStamp());
65  const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
66 
67  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateDepthVsHeight().Y(500.*meter), 972.868*gram/cm/cm, 1e-3));
68  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateDepthVsHeight().Y(11000.*meter), 230.918*gram/cm/cm, 1e-3));
69  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateDepthVsHeight().Y(26500.*meter), 20.3484*gram/cm/cm, 1e-3));
70  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateDepthVsHeight().Y(0.), 1033.93*gram/cm/cm, 1e-3));
71  CPPUNIT_ASSERT(Verify<CloseTo> (theAtm.EvaluateDepthVsHeight().Y(500.*meter),
72  theAtm.EvaluateDepthVsHeight().Y( theAtm.EvaluateHeightVsDepth().Y( theAtm.EvaluateDepthVsHeight().Y(500.*m))), 1e-3));
73 
74  }
75 
77 
78  Detector::GetInstance().Update(UTCDateTime(2005,1,1,0,0,0).GetTimeStamp());
79 
80  const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
81 
82  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateHeightVsDepth().Y(20.3484*gram/cm/cm), 26500.*meter, 1e-3));
83  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateHeightVsDepth().Y(972.858*gram/cm/cm), 500.*meter, 1e-3));
84  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateHeightVsDepth().Y(230.918*gram/cm/cm), 11000.*meter, 1e-3));
85 
86 
87  }
88 
90 
91  Detector::GetInstance().Update(UTCDateTime(2005,1,1,0,0,0).GetTimeStamp());
92 
93  const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
94 
95  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateTemperatureVsHeight().Y(0.), 288.15*kelvin, 1e-3));
96  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateTemperatureVsHeight().Y(11500.*m), 216.65*kelvin, 1e-3));
97  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateTemperatureVsHeight().Y(29500.*m), 226.15*kelvin, 1e-3));
98 
99  }
100 
102 
103  Detector::GetInstance().Update(UTCDateTime(2005,1,1,0,0,0).GetTimeStamp());
104 
105  const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
106 
107  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateDensityVsHeight().Y(0.), 1.23e-3*g/cm/cm/cm));
108  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateDensityVsHeight().Y(11500.*meter), 3.36458e-4*g/cm/cm/cm));
109  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateDensityVsHeight().Y(29000.*meter), 2.10e-5*g/cm/cm/cm));
110 
111  }
112 
114 
115  Detector::GetInstance().Update(UTCDateTime(2005,1,1,0,0,0).GetTimeStamp());
116 
117  const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
118 
119  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateRefractionIndexVsHeight().Y(0.) , 1.00029, 1e-3));
120  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateRefractionIndexVsHeight().Y(11500*meter), 1.00006, 1e-3));
121  CPPUNIT_ASSERT(Verify<CloseTo>( theAtm.EvaluateRefractionIndexVsHeight().Y(29000*meter), 1., 1e-3));
122  }
123 
124 // void testMinMax() {
125 
126 // Detector::GetInstance().Update(UTCDateTime(2005,1,1,0,0,0).GetTimeStamp());
127 // const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
128 
129 // cout << "theAtm.GetMinDepth " << theAtm.GetMinDepth()/(g/cm/cm) << endl;
130 
131 // }
132 
133 };
134 
136 
137 
138 
139 // Configure (x)emacs for this file ...
140 // Local Variables:
141 // mode:c++
142 // compile-command: "make -C .. -k"
143 // End:
Top of the interface to Atmosphere information.
const atm::ProfileResult & EvaluateDensityVsHeight() const
Tabulated function giving Y=density as a function of X=height.
const double meter
Definition: GalacticUnits.h:29
Traditional name.
Definition: Verbosity.h:17
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
double Y(const double x) const
Get the Y value (coordinate) for given X (ordinate)
const atm::ProfileResult & EvaluateDepthVsHeight() const
Tabulated function giving Y=depth as a function of X=height.
constexpr double g
Definition: AugerUnits.h:200
constexpr double kelvin
Definition: AugerUnits.h:259
constexpr double cm
Definition: AugerUnits.h:117
const atm::ProfileResult & EvaluateHeightVsDepth() const
Tabulated function giving Y=height as a function of X=depth.
const atm::ProfileResult & EvaluateRefractionIndexVsHeight() const
Tabulated function giving Y=refraction index as a function of X=height.
constexpr double m
Definition: AugerUnits.h:121
constexpr double gram
Definition: AugerUnits.h:195
const atm::ProfileResult & EvaluateTemperatureVsHeight() const
Tabulated function giving Y=temperature as a function of X=height.

, generated on Tue Sep 26 2023.