AtmCorr.cc
Go to the documentation of this file.
1 
19 #include "AtmCorr.h"
20 #include "Atmosphere.h"
21 
22 using namespace AtmCorrNS;
23 
24 
25 AtmCorr::AtmCorr(int DetectorType)
26 {
27  if (DetectorType < 0 || DetectorType > 2) {
28  printf("AtmCorr: Incorrect Detector type %d \n", DetectorType);
29  exit(1);
30  }
31  fDetectorType = DetectorType;
32 };
33 
34 
35 //----------------------------------------------------------------------------------------------------------------------------
36 // Type I atmospheric corection:
37 // Multiplying factor to convert signal for a shower with (r,rhoGround) to the reference case defined as:
38 // Density at ground 1.043e-3 g/cm^3
39 
40 double
41 AtmCorr::GetAlphaRho(double r, int icomp) // Alpha rho was obtained from simulations with hground=1452.e2 for Water Cherenkov
42 {
43  double r_km = r / 1e5;
44  double alphaRho = parAtmTypeI[0][icomp] * pow(r_km, parAtmTypeI[1][icomp]);
45  return alphaRho;
46 }
47 
48 
49 double
50 AtmCorr::GetCorrTypeI(double r, int icomp, double rhoGround, double hGround)
51 {
52  if (fDetectorType == 2)
53  return 1;
54 
56  const double rhoGroundRef = fatm.GetDensity(hGround);
57 
58  //Moliere correction
59  if (icomp > 0 && icomp < 4) {
60  double alphaRho = GetAlphaRho(r, icomp);
61  double fcorr = (1 - alphaRho * (rhoGround - rhoGroundRef) * 1e3 / 0.03);
62  return 1 / fcorr;
63  } else
64  return 1;
65 }
66 
67 
68 //----------------------------------------------------------------------------------------------------------------------------
69 // Type II atmospheric corection:
70 // Multiplying factor to convert signal for a shower with theta to the reference zenith angle 0 [deg]
71 
72 
73 double
74 AtmCorr::GetCorrTypeII(double r, double theta, int icomp, double hground)
75 {
76  if (fDetectorType == 2)
77  return 1;
78 
80  const double rhoAboveGroundRef = fatm.GetDensityAboveGround(hground, 0., 2); //theta=0
81 
82  if (icomp > 0 && icomp < 4) {
83  // double r_km = r / 1.e5;
84  double alphaRho = GetAlphaRho(r, icomp);
85  double rhoAboveGround = fatm.GetDensityAboveGround(hground, theta, 2);
86 
87  double fcorr = (1. - alphaRho * (rhoAboveGround - rhoAboveGroundRef) * 1.e3 / 0.03);
88  return 1 / fcorr;
89  } else
90  return 1;
91 }
92 
93 
94 //----------------------------------------------------------------------------------------------------------------------------
95 // Type III atmospheric corection + Other possible effects
96 // Multiplying factor to convert signal for a shower with psi to the reference psi angle 90 [deg]
97 
98 double
99 AtmCorr::GetParCorrTypeIII(double r, int icomp, int ipar)
100 {
101  if (fDetectorType == 2 && icomp > 0)
102  return 0;
103  if (ipar < 0 || ipar > 1)
104  return 0;
105 
106  const double* par = 0;
107  if (ipar == 0 && fDetectorType == 0)
108  par = f_mod1_par_WCD[icomp];
109  else if (ipar == 1 && fDetectorType == 0)
110  par = f_mod2_par_WCD[icomp];
111  else if (ipar == 0 && fDetectorType == 1)
112  par = f_mod1_par_Scin[icomp];
113  else if (ipar == 1 && fDetectorType == 1)
114  par = f_mod2_par_Scin[icomp];
115  else if (ipar == 0 && fDetectorType == 2)
116  par = f_mod1_par_MD[icomp];
117  else if (ipar == 1 && fDetectorType == 2)
118  par = f_mod2_par_MD[icomp];
119  else {
120  printf("unknown case\n");
121  exit(1);
122  }
123 
124  return par[0] + par[1] * r / 1.e5 + par[2] * r * r / 1e10;
125 }
126 
127 
128 double
129 AtmCorr::GetCorrTypeIII(double r, double theta, double psi, int icomp)
130 {
131  if (fDetectorType == 2 && icomp > 0)
132  return 1;
133 
134  //f_mod1/f_mod2
135  const double f_mod1 = GetParCorrTypeIII(r, icomp, 0);
136  const double f_mod2 = GetParCorrTypeIII(r, icomp, 1);
137 
138  //----
139 
140  const double theta_deg = theta * 180 / M_PI;
141  const double f_mod = f_mod1 * theta_deg / 60 + f_mod2 * pow(theta_deg / 60, 2);
142  const double fcorr = (1 + cos(psi) * f_mod);
143 
144  return 1 / fcorr;
145 }
const double f_mod1_par_MD[4][3]
Definition: AtmCorr.h:33
const double parAtmTypeI[2][4]
Definition: AtmCorr.h:25
const double f_mod2_par_MD[4][3]
Definition: AtmCorr.h:34
AtmCorr(int DetectorType)
Definition: AtmCorr.cc:25
double GetCorrTypeIII(double r, double theta, double psi, int icomp)
Definition: AtmCorr.cc:129
const double f_mod2_par_WCD[4][3]
Definition: AtmCorr.h:28
double GetAlphaRho(double r, int icomp)
Definition: AtmCorr.cc:41
double pow(const double x, const unsigned int i)
int exit
Definition: dump1090.h:237
double GetParCorrTypeIII(double r, int icomp, int ipar)
Definition: AtmCorr.cc:99
double GetCorrTypeI(double r, int icomp, double rhoGround, double hGround)
Definition: AtmCorr.cc:50
float GetDensityAboveGround(float hground, float theta, float nRad)
const double f_mod2_par_Scin[4][3]
Definition: AtmCorr.h:31
double GetCorrTypeII(double r, double theta, int icomp, double hground)
Definition: AtmCorr.cc:74
const double f_mod1_par_Scin[4][3]
Definition: AtmCorr.h:30
const double f_mod1_par_WCD[4][3]
Definition: AtmCorr.h:27

, generated on Tue Sep 26 2023.