9 #include <det/Detector.h>
11 #include <atm/HumidAirRayleighModel.h>
12 #include <atm/InclinedAtmosphericProfile.h>
13 #include <atm/ScatteringResult.h>
14 #include <atm/AttenuationResult.h>
15 #include <atm/ProfileResult.h>
17 #include <fwk/CentralConfig.h>
18 #include <fwk/CoordinateSystemRegistry.h>
20 #include <utl/Point.h>
21 #include <utl/Vector.h>
22 #include <utl/AugerUnits.h>
23 #include <utl/Reader.h>
24 #include <utl/ErrorLogger.h>
25 #include <utl/MathConstants.h>
26 #include <utl/PhysicalConstants.h>
27 #include <utl/ReferenceEllipsoid.h>
28 #include <utl/TabulatedFunctionErrors.h>
42 HumidAirRayleighModel::HumidAirRayleighModel() :
43 fIntegrationStepWidth(0)
52 CentralConfig::GetInstance()->
GetTopBranch(
"HumidAirRayleighModel");
72 const double distance,
73 const std::vector<double>& wLength)
85 const double distance,
89 const double fractionError = 0;
90 const double wError = 0;
94 const unsigned int nWl = attenuation.
GetNPoints();
95 for (
unsigned int iWl = 0; iWl < nWl; ++iWl) {
96 const double wl = attenuation.
GetX(iWl);
99 frac.
PushBack(wl, wError, sct, fractionError);
110 const double distance,
111 const double wLength)
123 const double distance,
124 const double wLength,
125 const double raylAtt)
128 return (1. - raylAtt)
130 / (distance * distance);
142 const vector<double>& wLength)
146 const double transAttError = 0;
147 const double wError = 0;
149 for (std::vector<double>::const_iterator it = wLength.begin();
150 it != wLength.end(); ++it) {
152 attenuation.
PushBack(*it, wError, transAtt, transAttError);
170 const Atmosphere& atmos = Detector::GetInstance().GetAtmosphere();
179 Vector dir = xFinal - xInit;
180 const double length = dir.
GetMag();
184 double transmittance = 1;
186 while (distance < length) {
194 const Point p1 = xInit + distance * dir;
196 const Point p2 = xInit + distance * dir;
200 const double height = 0.5 * (hP1 + hP2);
202 const double pr = prVsH.
Y(height);
203 const double pv = pvVsH.
Y(height);
204 const double temp = tempVsH.
Y(height);
205 const double ri = riVsH.
Y(height);
213 transmittance *= exp(-Nair * sigmaR * delta);
216 return transmittance;
222 const double wLength)
225 const Atmosphere& atmos = Detector::GetInstance().GetAtmosphere();
240 return 1 / (Nair * sigmaR);
247 const double wLength)
250 const Atmosphere& atmos = Detector::GetInstance().GetAtmosphere();
259 const double Fk =
KingFactor(wLength, pr, pv);
260 const double rhoN = (6. * Fk - 6.) / (7. * Fk + 3.);
261 const double costh = cos(angle);
264 return 3 / (8*
kPi * (2 + rhoN)) * ((1 + rhoN) + (1 - rhoN) * costh*costh);
270 const double vaporPressure)
277 const double FkN2 = 1.034 + 3.17e-4 * invWl2;
278 const double FkO2 = 1.096 + invWl2 * (1.385e-3 + 1.448e-4 * invWl2);
279 const double FkAr = 1.;
280 const double FkCO2 = 1.15;
281 const double FkH2O = 1.001;
283 const double H2OAirFraction = vaporPressure / pressure;
288 FkH2O * H2OAirFraction) /
297 const double refIndex,
298 const double temperature,
299 const double pressure,
300 const double vaporPressure)
303 const double N_air = pressure / (
kBoltzmann * temperature);
304 const double refIndex2 = refIndex * refIndex;
305 const double factorKing =
KingFactor(wl, pressure, vaporPressure);
308 *
pow(((refIndex2 - 1) / (refIndex2 + 2)), 2)
309 *
pow(wl, -4) / (N_air * N_air) * factorKing;
Branch GetTopBranch() const
unsigned int GetNPoints() const
Top of the interface to Atmosphere information.
const utl::TabulatedFunctionErrors & GetTransmissionFactor() const
Transmission factor.
const atm::ProfileResult & EvaluatePressureVsHeight() const
Tabulated function giving Y=air pressure as a function of X=height.
double GetAttenuationLength(const utl::Point &p, const double wLength) const
Attenuation in units of length [1/scattering coefficient].
double EvaluateScatteringAngle(const utl::Point &p, const double angle, const double wLength) const
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
constexpr double kN2AirFraction
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.
constexpr double micrometer
Class representing a document branch.
Reference ellipsoids for UTM transformations.
Class describing the Atmospheric profile.
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.
Triple PointToLatitudeLongitudeHeight(const Point &thePoint) const
Convert Point to Lat/Long/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 RayleighCrossSection(const double wl, const double refIndex, const double temperature, const double pressure, const double vaporPressure) const
constexpr double kBoltzmann
constexpr double kO2AirFraction
const double & GetX(const unsigned int idx) const
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.
double KingFactor(const double wl, const double pressure, const double vaporPressure) const
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.
const atm::ProfileResult & EvaluateRefractionIndexVsHeight() const
Tabulated function giving Y=refraction index as a function of X=height.
constexpr double kCO2AirFraction
constexpr double kArAirFraction
const atm::ProfileResult & EvaluateVaporPressureVsHeight() const
Tabulated function giving Y=H20 vapor pressure as a function of X=height.
const atm::ProfileResult & EvaluateTemperatureVsHeight() const
Tabulated function giving Y=temperature as a function of X=height.
Class describing the Atmospheric attenuation.
double fIntegrationStepWidth