7 #include <det/Detector.h>
8 #include <sdet/SDetector.h>
9 #include <fwk/CentralConfig.h>
10 #include <utl/TimeStamp.h>
11 #include <utl/UTCDateTime.h>
12 #include <utl/TabulatedFunction.h>
13 #include <utl/Reader.h>
14 #include <utl/CoordinateSystem.h>
15 #include <utl/Point.h>
16 #include <utl/AugerException.h>
17 #include <utl/ErrorLogger.h>
18 #include <fwk/CoordinateSystemRegistry.h>
20 #include <evt/Event.h>
21 #include <sevt/SEvent.h>
22 #include <sevt/Station.h>
24 #include <cppunit/extensions/HelperMacros.h>
25 #include <tst/Verify.h>
34 #define ASSERT_CLOSE(x, y, eps) CPPUNIT_ASSERT(Verify<CloseTo>(x, y, eps))
35 #define ASSERT_EQUAL(x, y) CPPUNIT_ASSERT(Verify<Equal>(x, y))
41 CPPUNIT_TEST(testBasic);
42 CPPUNIT_TEST(testGroups);
43 CPPUNIT_TEST(testOffGridStations);
44 CPPUNIT_TEST_EXCEPTION(testStationNotCommissioned,
AugerException);
45 CPPUNIT_TEST(testStationListManager);
46 CPPUNIT_TEST(testCrowns);
47 CPPUNIT_TEST(testSModelsXMLManager);
48 CPPUNIT_TEST(testSdSimCalibrationManager);
50 CPPUNIT_TEST_SUITE_END();
61 CentralConfig::GetInstance(BOOTSTRAPFILE);
66 Detector::GetInstance();
74 Detector& detector = Detector::GetInstance();
95 for (
const auto& pmt : dStation.PMTsRange()) {
104 Detector& detector = Detector::GetInstance();
118 CPPUNIT_ASSERT(st64.GetGroupId() == 1);
120 CPPUNIT_ASSERT(groups.find(1) != groups.end());
121 const set<int>& group1 = groups.find(1)->second;
122 CPPUNIT_ASSERT(group1.find(49) != group1.end());
123 CPPUNIT_ASSERT(group1.find(64) != group1.end());
126 const vector<int>::const_iterator find64 =
127 find(partners.begin(), partners.end(), 64);
128 CPPUNIT_ASSERT(find64 != partners.end());
131 CPPUNIT_ASSERT(!st61.GetGroupId());
133 CPPUNIT_ASSERT(!partners61.size());
139 Detector& detector = Detector::GetInstance();
169 Detector& detector = Detector::GetInstance();
178 Detector& detector = Detector::GetInstance();
188 for (
const auto& station : sDetector.StationsRange())
189 for (
const auto& pmt : station.PMTsRange())
190 CPPUNIT_ASSERT(pmt.GetCollectionEfficiency() == 0.6);
196 Detector& detector = Detector::GetInstance();
203 CPPUNIT_ASSERT(st133.
GetName() ==
"Uli");
207 CPPUNIT_ASSERT(crown.size() == 1);
208 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 133) != crown.end());
211 CPPUNIT_ASSERT(crown.size() == 5);
212 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 142) != crown.end());
213 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 106) != crown.end());
216 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 147) != crown.end());
217 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 146) != crown.end());
218 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 135) != crown.end());
221 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 143) != crown.end());
222 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 144) != crown.end());
223 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 145) != crown.end());
224 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 105) != crown.end());
225 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 134) != crown.end());
226 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 113) != crown.end());
227 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 111) != crown.end());
228 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 219) != crown.end());
229 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 232) != crown.end());
230 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 222) != crown.end());
231 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 194) != crown.end());
232 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 191) != crown.end());
235 CPPUNIT_ASSERT(crown.size() == 18);
236 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 192) != crown.end());
237 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 193) != crown.end());
238 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 198) != crown.end());
239 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 195) != crown.end());
240 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 148) != crown.end());
241 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 149) != crown.end());
242 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 150) != crown.end());
243 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 102) != crown.end());
244 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 138) != crown.end());
245 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 185) != crown.end());
246 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 112) != crown.end());
247 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 229) != crown.end());
248 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 223) != crown.end());
249 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 220) != crown.end());
250 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 225) != crown.end());
251 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 231) != crown.end());
252 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 224) != crown.end());
253 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 316) != crown.end());
257 CPPUNIT_ASSERT(crown.size() == 24);
258 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 101) != crown.end());
259 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 186) != crown.end());
260 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 119) != crown.end());
261 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 122) != crown.end());
262 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 218) != crown.end());
263 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 226) != crown.end());
264 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 207) != crown.end());
265 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 227) != crown.end());
266 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 233) != crown.end());
267 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 243) != crown.end());
268 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 241) != crown.end());
269 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 246) != crown.end());
270 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 274) != crown.end());
271 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 295) != crown.end());
272 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 202) != crown.end());
273 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 200) != crown.end());
274 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 201) != crown.end());
275 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 121) != crown.end());
276 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 167) != crown.end());
277 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 169) != crown.end());
278 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 170) != crown.end());
279 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 158) != crown.end());
280 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 151) != crown.end());
281 CPPUNIT_ASSERT(find(crown.begin(), crown.end(), 131) != crown.end());
289 const SDetector& sDetector = Detector::GetInstance().GetSDetector();
291 CPPUNIT_ASSERT(firstStation.
GetRadius() == 1.8);
306 CPPUNIT_ASSERT(Verify<CloseTo>(qe.
Y(2.081*
eV), 0.020124859073964059, 1e-5));
307 CPPUNIT_ASSERT(Verify<CloseTo>(qe.
Y(2.16), 0.030, 1e-5));
308 CPPUNIT_ASSERT(Verify<CloseTo>(wal.
Y(2.081*
eV), 4.6256*
m, 0.01*
mm));
311 CPPUNIT_ASSERT(Verify<CloseTo>(wal.
Y(2.1*
eV), 5.11247*
m, 0.01*
mm));
312 CPPUNIT_ASSERT(Verify<CloseTo>(wal.
Y(2.16*
eV), 6.64997*
m, 0.01*
mm));
313 CPPUNIT_ASSERT(Verify<CloseTo>(wal.
Y(2.79*
eV), 49.6499*
m, 0.01*
mm));
315 CPPUNIT_ASSERT(Verify<CloseTo>(r.
Y(.0921*
eV), 1.33, 1e-5));
316 CPPUNIT_ASSERT(Verify<CloseTo>(r.
Y(.102*
eV), 1.33, 1e-5));
318 CPPUNIT_ASSERT(Verify<CloseTo>(lr.
Y(2.5*
eV), 0.94563, 1e-5));
319 CPPUNIT_ASSERT(Verify<CloseTo>(lr.
Y(4.07*
eV), 0.776911, 1e-5));
323 CPPUNIT_ASSERT(Verify<CloseTo>(sl.
Y(2.1*
eV), 0.2, 1e-5));
325 CPPUNIT_ASSERT(Verify<CloseTo>(ss.
Y(2.1*
eV), 0.0, 1e-5));
331 const auto& pmt = Detector::GetInstance().GetSDetector().GetStation(14).GetPMT(1);
333 CPPUNIT_ASSERT(Verify<CloseTo>(pmt.GetVEMPeak(
"G4TankSimulatorOG"), 10.));
334 CPPUNIT_ASSERT(Verify<CloseTo>(pmt.GetVEMCharge(
"G4TankSimulatorOG"), 20.));
336 CPPUNIT_ASSERT(Verify<CloseTo>(pmt.GetGainRatio(), 70.));
const StationGroups & GetStationGroups() const
void Update(const utl::TimeStamp &time, const bool invData=true, const bool invComp=true, const bool forceRadio=false)
Update detector: deletes currently constructed stations and sets new time.
std::map< int, std::set< int > > StationGroups
StationGroups: map key = groupId, value = stationId set.
const StationIdCollection & GetCrown(const int level) const
Returns a list of station id's in the crown. If the argument is 0, it returns the station id...
Detector description interface for Station-related data.
const std::vector< int > & GetPartnerIds() const
returns vector of partner station ids
int GetGroupId() const
returns unique identifier of a group of stations or zero (if single)
void testOffGridStations()
Base class for all exceptions used in the auger offline code.
void testStationListManager()
Interface class to access to the SD part of an event.
Class to hold collection (x,y) points and provide interpolation between them.
void testSdSimCalibrationManager()
const utl::TabulatedFunction & GetLinerSpecularLobe() const
Tyvek liner specular lobe constant as a function of photon energy.
bool IsInGrid(const SDetectorConstants::GridIndex index=SDetectorConstants::eStandard) const
Tells whether the station is in the regular triangular grid.
int crown(double x1, double x2, double y1, double y2)
const PMT & GetPMT(const int id) const
Get specified PMT by id.
utl::CoordinateSystemPtr GetSiteCoordinateSystem() const
Get the coordinate system for the site.
const utl::TabulatedFunction & GetWaterAbsorptionLength() const
Water absorption length as a function of photon energy.
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
A TimeStamp holds GPS second and nanosecond for some event.
const std::string & GetName() const
Station name.
utl::Point GetPosition() const
Tank position.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
class to hold data at Station level
const utl::TabulatedFunction & GetLinerReflectivity() const
Tyvek liner reflectivity as a function of photon energy.
double GetCollectionEfficiency() const
Collection efficiency.
double GetX(const CoordinateSystemPtr &coordinateSystem) const
Top of the hierarchy of the detector description interface.
const sdet::SDetector & GetSDetector() const
double GetRadius() const
Radius of the tank (water only)
void MakeStation(const int stationId)
make a station with specifying Id, throw if invalid stationId
Station & GetStation(const int stationId)
retrieve station by id throw utl::NonExistentComponentException if n.a.
const utl::TabulatedFunction & GetLinerSpecularSpike() const
Tyvek liner specular spike constant as a function of photon energy.
#define ASSERT_CLOSE(x, y, eps)
double GetY(const CoordinateSystemPtr &coordinateSystem) const
void testSModelsXMLManager()
void testStationNotCommissioned()
const utl::TabulatedFunction & GetQuantumEfficiency() const
Quantum efficiency.
const utl::TabulatedFunction & GetWaterRefractionIndex() const
Water refraction index as a function of photon energy.
Detector description interface for SDetector-related data.
double GetZ(const CoordinateSystemPtr &coordinateSystem) const
double GetLinerSigmaAlpha() const
Tyvek liner sigma_alpha roughness parameter.
const Station & GetStation(const int stationId) const
Get station by Station Id.
double Y(const double x) const
Get or interpolate the Y value that corresponds to parameter x.
TimeStamp GetTimeStamp() const
#define ASSERT_EQUAL(x, y)