AirflyFluorescenceModel.cc
Go to the documentation of this file.
1 
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>
17 
18 using namespace utl;
19 using namespace atm;
20 using namespace fwk;
21 using namespace std;
22 
23 
24 void
26 {
27 
28  Branch topB =
29  CentralConfig::GetInstance()->GetTopBranch("AirflyFluorescenceModel");
30 
31  topB.GetChild("wavelength").GetData(fWavelength);
32  topB.GetChild("relativeIntensity").GetData(fRelativeIntensity);
33  topB.GetChild("relativeIntensityError").GetData(fRelativeIntensityError);
34  topB.GetChild("pPrime").GetData(fPPrime);
35  topB.GetChild("pPrimeErrorUncorrelated").GetData(fPPrimeErrorUncorrelated);
36  topB.GetChild("pPrimeErrorCorrelated").GetData(fPPrimeErrorCorrelated);
37  topB.GetChild("temperature0").GetData(fTemperature0);
38  topB.GetChild("pressure0").GetData(fPressure0);
39  topB.GetChild("yield337").GetData(fYield337);
40 
41  /* Extension of module from B. Keilhauer, Sep. 2009 according to
42  NIM A597 (2008) 50 and presentation from M. Bohacova at 6th Fl.
43  Workshop in L'Aquila:
44  */
45 
46  string tempParam, HumParam;
47 
48  topB.GetChild("collisionalCrossSection").GetData(tempParam);
49  if (tempParam == "eAIRFLYtemp")
50  fTempParam = eAIRFLYtemp;
51  else if (tempParam == "eNONE")
52  fTempParam = eNoTempParam;
53  else {
54  ERROR("Parametrization not implemented");
56  }
57 
58  topB.GetChild("humidity").GetData(HumParam);
59  if (HumParam == "eAIRFLYhum")
60  fHumParam = eAIRFLYhum;
61  else if (HumParam == "eNONE")
62  fHumParam = eNoHumParam;
63  else {
64  ERROR("Parametrization not implemented");
66  }
67 
68  //end of Extension
69 
70 }
71 
72 
73 const
75 AirflyFluorescenceModel::EvaluateFluorescenceYield(const double heightAboveSeaLevel)
76  const
77 {
78  const Atmosphere& atmo = det::Detector::GetInstance().GetAtmosphere();
79  const ProfileResult& tempProfile = atmo.EvaluateTemperatureVsHeight();
80  const ProfileResult& densityProfile = atmo.EvaluateDensityVsHeight();
81  const ProfileResult& pressureProfile = atmo.EvaluatePressureVsHeight();
82  const ProfileResult& pvaporProfile = atmo.EvaluateVaporPressureVsHeight();
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);
87 
88  double fluorescenceYield = 0;
89 
90  /* Extension of module from B. Keilhauer, Sep. 2009 according to
91  NIM A597 (2008) 50 and presentation from M. Bohacova at 6th Fl.
92  Workshop in L'Aquila; the given values are the measured ones
93  from Martina's presentation:
94  */
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.,
103  0.,0.,0.,0.};
104  const double pPrimeHumAirfly[nWaveLength]={0.,0.,0.,0.,0.,1.2*100*pascal,
105  1.1*100*pascal,0.,0.,0.,
106  0.,0.,1.28*100*pascal,0.,
107  1.5*100*pascal,1.27*100*pascal,
108  1.3*100*pascal,0.,0.,
109  1.3*100*pascal,
110  1.1*100*pascal,1.4*100*pascal,
111  0.,0.,0.,0.33*100*pascal,
112  1.2*100*pascal,1.1*100*pascal,
113  1.5*100*pascal,0.,
114  0.,0.,0.,0.6*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.,
118  0.,0.,0.,0.};
119  const double * alpha = (fTempParam == eAIRFLYtemp) ? alphaAirfly : alphaNone;
120  const double * pPrimeHum = (fHumParam == eAIRFLYhum) ? pPrimeHumAirfly : pPrimeHumNone;
121 
122  //end of Extension
123 
124  fFluorescenceSpectrum.Clear();
125  for (unsigned int iwl = 0; iwl < fWavelength.size(); ++iwl) {
126 
127  const double wavelength = fWavelength[iwl];
128 
129  /* Extension of module from B. Keilhauer, Sep. 2009 according to
130  NIM A597 (2008) 50 and presentation from M. Bohacova at 6th Fl.
131  Workshop in L'Aquila:
132  */
133 
134  // double Edep = GetdEdX0();
135 
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))));
140  }
141  else {
142  fluorescenceYield = density * fYield337 * fRelativeIntensity[iwl] * 0.01
143  * ( (1 + fPressure0/fPPrime[iwl])
144  / (1
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)))
148  )
149  );
150  }
151 
152  //end of Extension
153 
154  fFluorescenceSpectrum.PushBack(wavelength, fluorescenceYield);
155 
156  }
157 
158  return fFluorescenceSpectrum;
159 }
160 
161 
162 double
163 AirflyFluorescenceModel::GetdEdX0()
164  const
165 {
166  // Energy loss evaluated for an electron of .85 MeV
167  return 1; //.658*MeV/(g/cm/cm);
168 }
169 
170 
171 // Configure (x)emacs for this file ...
172 // Local Variables:
173 // mode: c++
174 // compile-command: "make -C .. -k"
175 // End:
Branch GetTopBranch() const
Definition: Branch.cc:63
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.
Definition: Branch.cc:211
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.
Definition: Branch.h:107
constexpr double pascal
Definition: AugerUnits.h:212
Class describing the Atmospheric profile.
Definition: ProfileResult.h:25
void GetData(bool &b) const
Overloads of the GetData member template function.
Definition: Branch.cc:644
#define ERROR(message)
Macro for logging error messages.
Definition: ErrorLogger.h:165
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.

, generated on Tue Sep 26 2023.