11 #include <utl/TabulatedFunction.h>
12 #include <utl/Reader.h>
13 #include <utl/ErrorLogger.h>
14 #include <utl/PhysicalConstants.h>
15 #include <fwk/CentralConfig.h>
16 #include <det/Detector.h>
17 #include <atm/Atmosphere.h>
18 #include <atm/ProfileResult.h>
19 #include <atm/AirFluorescenceModel.h>
32 string dataSetSelection;
39 if (dataSetSelection ==
"eAuger")
40 dataSetBranch = topB.
GetChild(
"AugerFluorescenceYieldDataSet");
41 else if (dataSetSelection ==
"eNagano")
42 dataSetBranch = topB.
GetChild(
"NaganoFluorescenceYieldDataSet");
43 else if (dataSetSelection ==
"eKakimoto")
44 dataSetBranch = topB.
GetChild(
"KakimotoFluorescenceYieldDataSet");
45 else if (dataSetSelection ==
"eKeilhauer")
46 dataSetBranch = topB.
GetChild(
"KeilhauerFluorescenceYieldDataSet");
47 else if (dataSetSelection ==
"eUserDefined")
48 dataSetBranch = topB.
GetChild(
"UserDefinedFluorescenceYieldDataSet");
50 ERROR(
"DataSet not implemented");
55 dataSetBranch.
GetChild(
"relativeIntensity").
GetData(fRelativeIntensity);
56 dataSetBranch.
GetChild(
"relativeIntensityError").
GetData(fRelativeIntensityError);
58 dataSetBranch.
GetChild(
"pPrimeErrorUncorrelated").
GetData(fPPrimeErrorUncorrelated);
59 dataSetBranch.
GetChild(
"pPrimeErrorCorrelated").
GetData(fPPrimeErrorCorrelated);
61 const string temp = dataSetBranch.
GetChild(
"collisionalCrossSection").
Get<
string>();
62 if (temp ==
"eAIRtemp")
63 fTempParam = eAIRtemp;
64 else if (temp ==
"eNONE")
65 fTempParam = eNoTempParam;
67 ERROR(
"Parametrization not implemented");
72 const string water = dataSetBranch.
GetChild(
"collisionalCrossSectionWater").
Get<
string>();
73 if (water ==
"eAIRWatertemp")
74 fTempWaterParam = eAIRWatertemp;
75 else if (water ==
"eNONE")
76 fTempWaterParam = eNoWaterTempParam;
78 ERROR(
"Parametrization not implemented");
84 const string hum = dataSetBranch.
GetChild(
"humidity").
Get<
string>();
87 else if (hum ==
"eNONE")
88 fHumParam = eNoHumParam;
90 ERROR(
"Parametrization not implemented");
103 " DataSet: " << dataSetSelection <<
"\n"
104 " yield337: " << fYield337/(1/
MeV) <<
" [1/MeV]\n"
105 " ref temperature: " << fTemperature0/
kelvin <<
" [kelvin]\n"
106 " ref pressure: " << fPressure0/100/
pascal <<
" [100*pascal]\n"
107 " temp dependence: " << temp <<
"\n"
108 " hum dependence: " << hum <<
"\n"
109 " water temp dep: " << water <<
'\n';
116 AirFluorescenceModel::EvaluateFluorescenceYield(
const double heightAboveSeaLevel)
119 const Atmosphere& atmo = det::Detector::GetInstance().GetAtmosphere();
126 const double temperature = tempProfile.
Y(heightAboveSeaLevel);
127 const double density = densityProfile.
Y(heightAboveSeaLevel);
128 const double pressure = pressureProfile.
Y(heightAboveSeaLevel);
129 const double vaporPressure = pvaporProfile.
Y(heightAboveSeaLevel);
131 fFluorescenceSpectrum.Clear();
132 for (
unsigned int iwl = 0; iwl < fWavelength.size(); ++iwl) {
134 const double current_alpha = (fTempParam == eAIRtemp) ? fAlpha[iwl] : 0;
135 const double current_alpha_w = (fTempWaterParam == eAIRWatertemp) ? fAlphaWater[iwl] : 0;
136 const double current_pprime_w = (fHumParam == eAIRhum) ? fPPrimeHum[iwl] : 0;
138 double pprime = fPPrime[iwl] *
pow(fTemperature0/temperature, current_alpha - 0.5);
141 const double pprime_w = current_pprime_w*
pow(fTemperature0/temperature, current_alpha_w - 0.5);
145 if (fHumParam == eAIRhum) {
147 pprime = (1/pprime) * (1 - vaporPressure/pressure) + vaporPressure / (pressure*pprime_w);
153 const double fluorescenceYield =
154 (fYield337 * fRelativeIntensity[iwl] * 0.01) *
155 (1 + fPressure0/fPPrime[iwl]) / (1 + pressure/pprime) *
158 fFluorescenceSpectrum.PushBack(fWavelength[iwl], fluorescenceYield);
162 return fFluorescenceSpectrum;
167 AirFluorescenceModel::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.
#define INFO(message)
Macro for logging informational messages.
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.