testCorsikaUtilities.cc
Go to the documentation of this file.
1 
9 // header for unit test testCorsikaToPDG
10 #include <io/CorsikaUtilities.h>
11 #include <utl/Particle.h>
12 #include <utl/AugerUnits.h>
13 #include <tst/Verify.h>
14 #include <cppunit/extensions/HelperMacros.h>
15 
16 using namespace io::Corsika;
17 using namespace utl;
18 using namespace tst;
19 using utl::Particle;
20 using utl::deg;
21 
22 
23 namespace {
24  [[maybe_unused]] const static double eps = 1e-9; // precision for numerical comparisons
25 };
26 
27 
28 class testCorsikaUtilities : public CppUnit::TestFixture {
29 
30  CPPUNIT_TEST_SUITE(testCorsikaUtilities);
31  CPPUNIT_TEST(testConversion);
32  CPPUNIT_TEST(testCorsikaAzimuthToAuger);
33  // CPPUNIT_TEST(testFN);
34  // CPPUNIT_TEST_EXCEPTION(testFN, anException);
35  CPPUNIT_TEST_SUITE_END();
36 
37 public:
38  // shared data for tests
39 
40  void setUp() { }
41 
42  void tearDown() { }
43 
45  {
46  CPPUNIT_ASSERT(Verify<Equal>(CorsikaToPDG(3), int(Particle::eElectron)));
47  CPPUNIT_ASSERT(Verify<Equal>(CorsikaToPDG(5626), int(Particle::eIron)));
48  }
49 
51  {
52  double field_declination = -4.233*deg;
53  CPPUNIT_ASSERT(Verify<CloseTo>(CorsikaAzimuthToAuger(-14.767*deg, field_declination),
54  // -109.*deg));
55  71.*deg));
56  }
57 };
58 
59 
61 
62 
63 // Configure (x)emacs for this file ...
64 // Local Variables:
65 // mode: c++
66 // compile-command: "make -C .. -k testCorsika && (cd ..; ./testCorsika)"
67 // End:
Describes a particle for Simulation.
Definition: Particle.h:26
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
constexpr double deg
Definition: AugerUnits.h:140
double CorsikaAzimuthToAuger(const double corsikaAzimuth, const double magneticFieldDeclination)
Returns the azimuth rotated from Corisika&#39;s system to Auger standard.
double eps
int CorsikaToPDG(const int corsikaCode)
converters from CORSIKA to PDG particle codes

, generated on Tue Sep 26 2023.