9 #include <utl/TabulatedFunction.h>
10 #include <utl/Reader.h>
11 #include <utl/ErrorLogger.h>
12 #include <utl/MathConstants.h>
13 #include <utl/PhysicalConstants.h>
14 #include <fwk/CentralConfig.h>
15 #include <det/Detector.h>
16 #include <atm/Atmosphere.h>
17 #include <atm/ProfileResult.h>
18 #include <atm/Keilhauer2008FluorescenceModel.h>
30 CentralConfig::GetInstance()->
GetTopBranch(
"Keilhauer2008FluorescenceModel");
32 string tempParam, HumParam;
35 if (tempParam ==
"eAIRFLY")
37 else if (tempParam ==
"eNONE")
38 fTempParam = eNoTempParam;
40 ERROR(
"Parametrization not implemented");
45 if (HumParam ==
"eMorozov")
47 else if (HumParam ==
"eTilo")
49 else if (HumParam ==
"eNONE")
50 fHumParam = eNoHumParam;
52 ERROR(
"Parametrization not implemented");
56 const int nWaveLength = 23;
57 double wavelength[nWaveLength] =
67 for (
int i = 0; i < nWaveLength; ++i)
68 fWavelength.push_back(wavelength[i]);
74 Keilhauer2008FluorescenceModel::EvaluateFluorescenceYield(
const double heightAboveSeaLevel)
78 const Atmosphere& atmo = det::Detector::GetInstance().GetAtmosphere();
83 const double pressure = pressureProfile.
Y(heightAboveSeaLevel);
84 const double temperature = tempProfile.
Y(heightAboveSeaLevel);
85 const double density = densityProfile.
Y(heightAboveSeaLevel);
86 const double vaporPressure = pvaporProfile.
Y(heightAboveSeaLevel);
88 fFluorescenceSpectrum.Clear();
90 const unsigned int nWaveLength=23;
91 const double sigma_nn[nWaveLength]={1.2e-19*
m2 ,8.8e-20*
m2 ,3.77e-20*
m2,1.2e-19*
m2,
92 8.8e-20*
m2 ,3.77e-20*
m2,1.82e-20*
m2,1.2e-19*
m2,
93 8.8e-20*
m2 ,3.77e-20*
m2,1.82e-20*
m2,1.2e-19*
m2,
94 8.8e-20*
m2 ,3.77e-20*
m2,1.82e-20*
m2,1.2e-19*
m2,
95 4.37e-19*
m2,8.8e-20*
m2 ,3.77e-20*
m2,1.82e-20*
m2,
96 1.2e-19*
m2 ,8.8e-20*
m2 ,3.77e-20*
m2};
98 const double sigma_no[nWaveLength]={8.e-19*
m2 ,7.e-19*
m2,5.e-19*
m2,8.e-19*
m2,7.0e-19*
m2,
99 5.e-19*
m2,2.1e-19*
m2,8.e-19*
m2,7.e-19*
m2,5.0e-19*
m2,
100 2.1e-19*
m2,8.e-19*
m2,7.e-19*
m2,5.e-19*
m2,2.1e-19*
m2,
101 8.e-19*
m2,13.e-19*
m2,7.e-19*
m2,5.e-19*
m2,2.1e-19*
m2,
102 8.e-19*
m2 ,7.e-19*
m2,5.e-19*
m2};
111 const double tau[nWaveLength]={6.65e-8*
s,4.45e-8*
s,4.17e-8*
s,6.65e-8*
s,4.45e-8*
s,4.17e-8*
s,
112 4.17e-8*
s,6.65e-8*
s,4.45e-8*
s,4.17e-8*
s,4.17e-8*
s,6.65e-8*
s,
113 4.45e-8*
s,4.17e-8*
s,4.17e-8*
s,6.65e-8*
s,6.58e-8*
s,4.45e-8*
s,
114 4.17e-8*
s,4.17e-8*
s,6.65e-8*
s,4.45e-8*
s,4.17e-8*
s};
117 const double alphaAirfly[nWaveLength]={0.,-0.09,-0.21,0.,-0.09,-0.21,-0.36,0.,-0.09,-0.21,-0.36,0.,
118 -0.09,-0.21,-0.36,0.,-0.8,-0.09,-0.21,-0.36,0.,-0.09,-0.21};
119 const double alphaNone[nWaveLength]={0.,0.,0.,0.,0.,0.,0.,0.,0.,
120 0.,0.,0.,0.,0.,0.,0.,0.,0.,
123 const double * alpha = (fTempParam == eAIRFLY) ? alphaAirfly : alphaNone;
125 const double sigma_nvMorozov[nWaveLength]={0.*
m2,0.*
m2,8.91e-19*
m2,0.*
m2,0.*
m2,8.91e-19*
m2,
126 9.45e-19*
m2,0.*
m2,0.*
m2,8.91e-19*
m2,9.45e-19*
m2,
129 const double sigma_nvTilo[nWaveLength]={0.*
m2,0.*
m2,7.71e-19*
m2,0.*
m2,0.*
m2,7.71e-19*
m2,
130 7.25e-19*
m2,0.*
m2,0.*
m2,7.71e-19*
m2,7.25e-19*
m2,
133 const double sigma_nvNone[nWaveLength]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
134 0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
136 const double * sigma_nv = (fHumParam == eMorozov) ?
138 (fHumParam == eTilo) ?
139 sigma_nvTilo : sigma_nvNone;
142 const double volV = vaporPressure / pressure;
149 for (
unsigned int iwl = 0; iwl < nWaveLength; ++iwl)
151 const double snn = sigma_nn[iwl] *
pow(293 *
kelvin, -alpha[iwl]);
152 const double sno = sigma_no[iwl] *
pow(293 *
kelvin, -alpha[iwl]);
154 const double nnQuenching = 4 * volN * snn *
pow(temperature, alpha[iwl])
156 const double noQuenching = 2 * volO * sno *
pow(temperature, alpha[iwl])
158 const double nvQuenching = 2 * volV * sigma_nv[iwl]
160 const double pOverpPrime = tau[iwl] * preFactor
161 * (nnQuenching + noQuenching + nvQuenching);
163 const double deff = eff[iwl] / (1 + pOverpPrime);
166 const double fluorescenceYield = dscn * GetdEdX0() * density;
168 fFluorescenceSpectrum.PushBack(fWavelength[iwl], fluorescenceYield);
171 return fFluorescenceSpectrum;
176 Keilhauer2008FluorescenceModel::GetdEdX0()
183 const std::vector<double>&
184 Keilhauer2008FluorescenceModel::GetWavelengths()
const{
Branch GetTopBranch() const
Top of the interface to Atmosphere information.
constexpr double kO2MolarMass
Class to hold collection (x,y) points and provide interpolation between them.
const atm::ProfileResult & EvaluatePressureVsHeight() const
Tabulated function giving Y=air pressure as a function of X=height.
const atm::ProfileResult & EvaluateDensityVsHeight() const
Tabulated function giving Y=density as a function of X=height.
void Init()
Initialise the registry.
Base class for exceptions trying to access non-existing components.
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 representing a document branch.
constexpr double kAvogadro
Class describing the Atmospheric profile.
void GetData(bool &b) const
Overloads of the GetData member template function.
constexpr double kN2MolarMass
constexpr double kH2OMolarMass
constexpr double kSpeedOfLight
constexpr double kMolarGasConstant
constexpr double kBoltzmann
constexpr double kO2AirFraction
#define ERROR(message)
Macro for logging error messages.
const atm::ProfileResult & EvaluateVaporPressureVsHeight() const
Tabulated function giving Y=H20 vapor pressure as a function of X=height.
constexpr double angstrom
const atm::ProfileResult & EvaluateTemperatureVsHeight() const
Tabulated function giving Y=temperature as a function of X=height.