2 #include <det/Detector.h>
4 #include <utl/PhysicalConstants.h>
6 #include <sevt/Meteo.h>
7 #include <sevt/SEvent.h>
8 #include <evt/ShowerRecData.h>
9 #include <evt/ShowerSRecData.h>
10 #include <fwk/LocalCoordinateSystem.h>
11 #include <fwk/CentralConfig.h>
21 namespace EnergyCalculationPG {
24 EnergyCalculation::GetCorrectedS1000Geomagnetic(
const double theta,
27 const double s1000Err,
31 const double sinTheta = sin(theta);
32 const double cosTheta = cos(theta);
34 const double thetaB = 54.8 *
degree;
35 const double phiB = 87.4 *
degree;
36 const double axisBMag =
37 sinTheta * cos(phi) * sin(thetaB) * cos(phiB) +
38 sinTheta * sin(phi) * sin(thetaB) * sin(phiB) +
39 cosTheta * cos(thetaB);
40 const double correctionFactor =
41 1 + 4.2e-3 *
pow(cosTheta, -2.8) * (1 -
Sqr(axisBMag));
43 sGeo1000 = s1000 / correctionFactor;
44 sGeo1000Err = s1000Err / correctionFactor;
49 EnergyCalculation::Run(
Event& event)
51 if (!event.
HasSEvent() || !
event.HasRecShower())
53 auto& recShower =
event.GetRecShower();
54 if (!recShower.HasSRecShower())
60 auto& sRecShower = recShower.GetSRecShower();
62 const double showerSize = sRecShower.GetShowerSize();
63 const double showerSizeErr = sRecShower.GetShowerSizeError();
65 const Point core = sRecShower.GetCorePosition();
67 const auto& axis = sRecShower.GetAxis();
68 const double theta = axis.GetTheta(coreCS);
69 const double phi = axis.GetPhi(coreCS);
72 double s1000ErrGeo = 0;
73 GetCorrectedS1000Geomagnetic(theta, phi, showerSize, showerSizeErr, s1000Geo, s1000ErrGeo);
75 sRecShower.SetSizeGeomagneticCorr(s1000Geo, s1000ErrGeo);
constexpr T Sqr(const T &x)
double pow(const double x, const unsigned int i)
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
ResultFlag
Flag returned by module methods to the RunController.