14 #include <det/Detector.h>
16 #include <atm/ParametricXMLRayleighModel.h>
17 #include <atm/InclinedAtmosphericProfile.h>
18 #include <atm/ScatteringResult.h>
19 #include <atm/AttenuationResult.h>
20 #include <atm/ProfileResult.h>
22 #include <fwk/CentralConfig.h>
23 #include <fwk/CoordinateSystemRegistry.h>
25 #include <utl/Point.h>
26 #include <utl/Vector.h>
27 #include <utl/AugerUnits.h>
28 #include <utl/Reader.h>
29 #include <utl/ErrorLogger.h>
30 #include <utl/MathConstants.h>
31 #include <utl/PhysicalConstants.h>
32 #include <utl/ReferenceEllipsoid.h>
33 #include <utl/TabulatedFunctionErrors.h>
55 return 1 + 1e-8 * (5791817. / (238.0185 - invWl2) + 167909. / (57.362 - invWl2));
59 ParametricXMLRayleighModel::ParametricXMLRayleighModel() :
60 fIntegratedGDistance(false),
61 fIntegrationStepWidth(0)
77 info <<
"do grammage integration in curved geometry using deltaDist="
106 const double distance,
107 const std::vector<double>& wLength)
119 const double distance,
123 double fractionError = 0;
128 const unsigned int nWl = attenuation.
GetNPoints();
129 for (
unsigned int iWl = 0; iWl < nWl; ++iWl) {
130 const double wl = attenuation.
GetX(iWl);
133 frac.
PushBack(wl, wError, sct, fractionError);
144 const double distance,
146 const double raylAtt)
151 / (distance * distance);
159 const double distance,
185 const vector<double>& wLength)
189 const double rAttError = 0;
190 const double wError = 0;
191 const double slantDistance =
GDistance(xInit, xFinal);
193 for (std::vector<double>::const_iterator it = wLength.begin();
194 it != wLength.end(); ++it) {
196 const double transAtt = exp(-slantDistance/attenuationLength);
197 attenuation.
PushBack(*it, wError, transAtt, rAttError);
225 Detector& theDetector = Detector::GetInstance();
228 double xDistance = 0;
238 double atmHeightMin = dvh.
MinX();
239 double atmHeightMax = dvh.
MaxX();
240 double depthA, depthB;
242 if (zA < atmHeightMin)
243 depthA = dvh.
Y(atmHeightMin);
244 else if (zA > atmHeightMax)
245 depthA = dvh.
Y(atmHeightMax);
249 if (zB < atmHeightMin)
250 depthB = dvh.
Y(atmHeightMin);
251 else if (zB > atmHeightMax)
252 depthB = dvh.
Y(atmHeightMax);
256 double distAB = (xA - xB).GetMag();
259 xDistance = distAB *
abs((depthA - depthB) / (zA - zB));
260 else if (zA <= 12.0*
km)
261 xDistance = distAB *
abs(depthA / (0.19 * (44340 *
m - zB)));
262 else if (zA <= 45.470*
km)
263 xDistance = distAB *
abs(depthA / (6.340*
km));
274 const double wLength)
278 const double N_s = 2.54743e19 /
cm3;
279 const double factorKing = (6 + 3.*
fRhoN) / (6 - 7.*
fRhoN);
282 const double refIndex2 = refIndex * refIndex;
284 const double sigma_molecule =
286 *
pow(((refIndex2 - 1) / (refIndex2 + 2)), 2)
287 /
pow(wLength, 4) / (N_s * N_s) * factorKing;
300 const double factor = 3 / (16 *
kPi);
301 return factor / (1 + 2*gamRay) *
302 ((1 + 3*gamRay) + (1 - gamRay) *
pow(cos(angle), 2));
double fIntegrationStepWidth
unsigned int GetNPoints() const
Top of the interface to Atmosphere information.
double RefractiveIndex(const double wl)
constexpr double atmosphere
constexpr double kDryAirMolarMass
bool fIntegratedGDistance
atm::AttenuationResult EvaluateRayleighAttenuation(const utl::Point &xInit, const utl::Point &xFinal, const std::vector< double > &wLength) const
Calculate the Rayleigh attenuation between two points for a vector of wavelengths.
const utl::TabulatedFunctionErrors & GetTransmissionFactor() const
Transmission factor.
atm::ScatteringResult EvaluateRayleighScattering(const utl::Point &xA, const utl::Point &xB, const double angle, const double distance, const std::vector< double > &wLength) const
Calculate the fraction of Rayleigh scattering photons in the beam.
#define INFO(message)
Macro for logging informational messages.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
double pow(const double x, const unsigned int i)
double Y(const double x) const
Get the Y value (coordinate) for given X (ordinate)
Class holding the output of the ScatteringResult function.
double EvaluateScatteringAngle(const utl::Point &p, const double angle, const double wLength) const
const atm::Atmosphere & GetAtmosphere() const
constexpr double micrometer
Class representing a document branch.
Reference ellipsoids for UTM transformations.
constexpr double kAvogadro
Class describing the Atmospheric profile.
double abs(const SVector< n, T > &v)
Top of the hierarchy of the detector description interface.
Triple PointToLatitudeLongitudeHeight(const Point &thePoint) const
Convert Point to Lat/Long/Height.
const atm::ProfileResult & EvaluateDepthVsHeight() const
Tabulated function giving Y=depth as a function of X=height.
void PushBack(const double x, const double xErr, const double y, const double yErr)
void GetData(bool &b) const
Overloads of the GetData member template function.
const double & GetY(const unsigned int idx) const
double MinX() const
Return the minimum value for X (ordinate) stored in the profile.
const double & GetX(const unsigned int idx) const
double GetAttenuationLength(const utl::Point &p, const double wLength) const
Attenuation [slant depth]; assumes const Rayleigh X-section vs height.
Main configuration utility.
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.
double IntegratedGrammage(const utl::Point &pStart, const utl::Point &pStop, const double delta) const
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)
double GDistance(const utl::Point &xA, const utl::Point &xB) const
Get the distance between two points in massive length.
Class describing the Atmospheric attenuation.
double MaxX() const
Return the maximum value for X (ordinate) stored in the profile.