8 #include <utl/TabulatedFunction.h>
9 #include <utl/Reader.h>
10 #include <utl/ErrorLogger.h>
11 #include <utl/PhysicalConstants.h>
12 #include <fwk/CentralConfig.h>
13 #include <det/Detector.h>
14 #include <atm/Atmosphere.h>
15 #include <atm/ProfileResult.h>
16 #include <atm/AirflyFluorescenceModel.h>
29 CentralConfig::GetInstance()->
GetTopBranch(
"AirflyFluorescenceModel");
33 topB.
GetChild(
"relativeIntensityError").
GetData(fRelativeIntensityError);
35 topB.
GetChild(
"pPrimeErrorUncorrelated").
GetData(fPPrimeErrorUncorrelated);
46 string tempParam, HumParam;
49 if (tempParam ==
"eAIRFLYtemp")
50 fTempParam = eAIRFLYtemp;
51 else if (tempParam ==
"eNONE")
52 fTempParam = eNoTempParam;
54 ERROR(
"Parametrization not implemented");
59 if (HumParam ==
"eAIRFLYhum")
60 fHumParam = eAIRFLYhum;
61 else if (HumParam ==
"eNONE")
62 fHumParam = eNoHumParam;
64 ERROR(
"Parametrization not implemented");
75 AirflyFluorescenceModel::EvaluateFluorescenceYield(
const double heightAboveSeaLevel)
78 const Atmosphere& atmo = det::Detector::GetInstance().GetAtmosphere();
83 const double temperature = tempProfile.
Y(heightAboveSeaLevel);
84 const double density = densityProfile.
Y(heightAboveSeaLevel);
85 const double pressure = pressureProfile.
Y(heightAboveSeaLevel);
86 const double vaporPressure = pvaporProfile.
Y(heightAboveSeaLevel);
88 double fluorescenceYield = 0;
95 const int nWaveLength = 34;
96 const double alphaAirfly[nWaveLength]={0.,0.,0.,0.,0.,-0.13,-0.19,0.,0.,0.,
97 0.,0.,-0.35,0.,-0.38,-0.22,-0.35,0.,
98 0.,-0.24,-0.17,-0.34,0.,0.,0.,-0.79,
99 -0.2,-0.2,-0.37,0.,0.,0.,0.,-0.54};
100 const double alphaNone[nWaveLength]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
101 0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
102 0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
104 const double pPrimeHumAirfly[nWaveLength]={0.,0.,0.,0.,0.,1.2*100*
pascal,
115 const double pPrimeHumNone[nWaveLength]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
116 0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
117 0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
119 const double * alpha = (fTempParam == eAIRFLYtemp) ? alphaAirfly : alphaNone;
120 const double * pPrimeHum = (fHumParam == eAIRFLYhum) ? pPrimeHumAirfly : pPrimeHumNone;
124 fFluorescenceSpectrum.Clear();
125 for (
unsigned int iwl = 0; iwl < fWavelength.size(); ++iwl) {
127 const double wavelength = fWavelength[iwl];
136 if(pPrimeHum[iwl]==0.) {
137 fluorescenceYield = density * fYield337 * fRelativeIntensity[iwl] * 0.01
138 * (1 + fPressure0/fPPrime[iwl])
139 / (1 + pressure/(fPPrime[iwl]*
pow((fTemperature0/temperature), (alpha[iwl]-0.5))));
142 fluorescenceYield = density * fYield337 * fRelativeIntensity[iwl] * 0.01
143 * ( (1 + fPressure0/fPPrime[iwl])
145 + (pressure/(fPPrime[iwl]*
pow((fTemperature0/temperature), (alpha[iwl]-0.5))))
146 - (vaporPressure/(fPPrime[iwl]*
pow((fTemperature0/temperature), (alpha[iwl]-0.5))))
147 + (vaporPressure/(pPrimeHum[iwl]*
sqrt(temperature/fTemperature0)))
154 fFluorescenceSpectrum.PushBack(wavelength, fluorescenceYield);
158 return fFluorescenceSpectrum;
163 AirflyFluorescenceModel::GetdEdX0()
Branch GetTopBranch() const
Top of the interface to Atmosphere information.
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.
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.
Class describing the Atmospheric profile.
void GetData(bool &b) const
Overloads of the GetData member template function.
#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.
const atm::ProfileResult & EvaluateTemperatureVsHeight() const
Tabulated function giving Y=temperature as a function of X=height.