Kakimoto1996FluorescenceModel.cc
Go to the documentation of this file.
1 
10 #include <utl/TabulatedFunction.h>
11 #include <utl/Reader.h>
12 #include <utl/ErrorLogger.h>
13 #include <utl/MathConstants.h>
14 #include <utl/Vector.h>
15 #include <utl/PhysicalConstants.h>
16 #include <utl/Transformation.h>
17 #include <utl/TabulatedFunctionErrors.h>
18 #include <utl/AugerException.h>
19 #include <det/Detector.h>
20 #include <atm/Atmosphere.h>
21 #include <atm/ProfileResult.h>
22 #include <atm/Kakimoto1996FluorescenceModel.h>
23 #include <fwk/CentralConfig.h>
24 #include <sstream>
25 
26 using namespace utl;
27 using namespace atm;
28 using namespace fwk;
29 using namespace std;
30 
31 
32 void
34 {
35  Branch topB =
36  CentralConfig::GetInstance()->GetTopBranch("Kakimoto1996FluorescenceModel");
37 
38  topB.GetChild("wavelength").GetData(fWavelength);
39  topB.GetChild("fluorescenceYield").GetData(fFluorescenceYield);
40 
41  // Finding the bin that constains the 391.4nm line
42  bool found = false;
43  const double line = 391.4*nanometer;
44  for (int i = 0; i < int(fWavelength.size()-1); ++i)
45  if (fWavelength[i] < line && line < fWavelength[i+1]) {
46  found = true;
47  // Find closest bin
48  if ((line - fWavelength[i]) < (fWavelength[i+1] - line)) {
49  fBin391 = i;
50  break;
51  } else {
52  fBin391 = i + 1;
53  break;
54  }
55  }
56 
57  if (!found) {
58  string msg("Supplied Fluorescence spectrum misses wavelength for 391.4 nm");
59  FATAL(msg);
60  throw NoDataForModelException(msg);
61  }
62 
63  // Computing the total light
64  fTotalLight = 0;
65  for (int i = 0; i < int(fFluorescenceYield.size()); ++i)
66  fTotalLight += fFluorescenceYield[i];
67 }
68 
69 
70 const std::vector<double>&
71 Kakimoto1996FluorescenceModel::GetWavelengths()
72  const
73 {
74  return fWavelength;
75 }
76 
77 
79 Kakimoto1996FluorescenceModel::EvaluateFluorescenceYield(const double heightAboveSeaLevel)
80  const
81 {
82  const Atmosphere& atmo = det::Detector::GetInstance().GetAtmosphere();
83  const ProfileResult& tempProfile = atmo.EvaluateTemperatureVsHeight();
84  const ProfileResult& densityProfile = atmo.EvaluateDensityVsHeight();
85  const double temperature = tempProfile.Y(heightAboveSeaLevel);
86  const double density = densityProfile.Y(heightAboveSeaLevel);
87 
88  const double rho = density / (g/cm3);
89 
90  TabulatedFunction seaLevelFluorescenceSpectrum(fWavelength,
91  fFluorescenceYield);
92 
93  // Experimental parameters
94  const double a1 = 0.929071;
95  const double b1 = 1850.0;
96  const double a2 = 0.574145;
97  const double b2 = 6500.0;
98  const double f = 1.0439e-5;
99 
100  // Total light except from bin with the 391nm line
101  const double k2 = fFluorescenceYield[fBin391];
102  const double k = fTotalLight - k2;
103 
104  const double waveLengthBin391 = fWavelength[fBin391];
105 
106  fFluorescenceSpectrum.Clear();
107  for (TabulatedFunction::Iterator it = seaLevelFluorescenceSpectrum.Begin();
108  it != seaLevelFluorescenceSpectrum.End(); ++it) {
109 
110  const double wavelength = it->X();
111  const double seaLevelFluorescenceYield = it->Y();
112 
113  double fluorescenceYield;
114  if (wavelength != waveLengthBin391)
115  fluorescenceYield = seaLevelFluorescenceYield*rho*a1 /
116  ((1 + rho*b1*sqrt(temperature))*k*f);
117  else
118  fluorescenceYield = seaLevelFluorescenceYield*rho*a2 /
119  ((1 + rho*b2*sqrt(temperature))*k2*f);
120 
121  fFluorescenceSpectrum.PushBack(wavelength, fluorescenceYield);
122  }
123 
124  return fFluorescenceSpectrum;
125 }
126 
127 
128 double Kakimoto1996FluorescenceModel::GetdEdX0() const {
129 
130  // Energy loss evaluated for an electron of 1.4 MeV at standard
131  // temperature and pressure.
132  // Value taken from the ESTAR program of NIST (2004)
133  // http://physics.nist.gov/PhysRefData/Star/Text/ESTAR.html
134  return 1.658*MeV/(g/cm/cm);
135 }
136 
137 // Configure (x)emacs for this file ...
138 // Local Variables:
139 // mode: c++
140 // compile-command: "make -C .. -k"
141 // End:
Branch GetTopBranch() const
Definition: Branch.cc:63
Top of the interface to Atmosphere information.
constexpr double cm3
Definition: AugerUnits.h:119
Class to hold collection (x,y) points and provide interpolation between them.
const atm::ProfileResult & EvaluateDensityVsHeight() const
Tabulated function giving Y=density as a function of X=height.
#define FATAL(message)
Macro for logging fatal messages.
Definition: ErrorLogger.h:167
void Init()
Initialise the registry.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Definition: Branch.cc:211
double Y(const double x) const
Get the Y value (coordinate) for given X (ordinate)
Exception to use in a atmosphere model cannot find data it needs.
constexpr double nanometer
Definition: AugerUnits.h:102
constexpr double MeV
Definition: AugerUnits.h:184
Class representing a document branch.
Definition: Branch.h:107
Class describing the Atmospheric profile.
Definition: ProfileResult.h:25
constexpr double g
Definition: AugerUnits.h:200
void GetData(bool &b) const
Overloads of the GetData member template function.
Definition: Branch.cc:644
constexpr double cm
Definition: AugerUnits.h:117
const atm::ProfileResult & EvaluateTemperatureVsHeight() const
Tabulated function giving Y=temperature as a function of X=height.

, generated on Tue Sep 26 2023.