13 pCal[0] = 1.62710e+16;
16 pCal[0] = 1.40738e+16;
21 pCal[0] = 2.23584e+17;
24 pCal[0] = 1.78368e+17;
35 return (lgE - log10(pCal[0])) / pCal[1];
41 return 0.5 * (1 + TMath::Erf((x - pars[0]) / pars[1]));
50 const double pA[4] = {1.18586522, -2.5940793, 3.25692833, -1.19604131};
51 const double cos2th =
pow(TMath::Cos(zenith), 2.);
53 const double A = pA[0] + cos2th * pA[1] + cos2th * cos2th * pA[2] + cos2th * cos2th * cos2th * pA[3];
54 const double B = 0.36868343;
56 const double effpars[] = {A, B};
57 const std::vector<double> parvec(effpars, effpars + 2);
72 const double pA[4] = {2.38516877, -4.85552037, 4.10415064, -0.97515248};
73 const double cos2th =
pow(TMath::Cos(zenith), 2.);
75 const double A = pA[0] + cos2th * pA[1] + cos2th * cos2th * pA[2] + cos2th * cos2th * cos2th * pA[3];
76 const double B = 0.24852449;
78 const double effpars[] = {A, B};
79 const std::vector<double> parvec(effpars, effpars + 2);
91 const double zenith = x[0];
92 const double lgE[1] = {par[0]};
93 const bool infill = par[1];
102 return eff * TMath::Cos(zenith) * TMath::Sin(zenith);
109 const double thmax = (infill ? 55. : 60.) * TMath::DegToRad();
110 const double thmin = 0. * TMath::DegToRad();
113 feff.FixParameter(0, lgE);
114 feff.FixParameter(1, infill);
116 ROOT::Math::IntegratorOneDimOptions::SetDefaultAbsTolerance(1.E-6);
117 ROOT::Math::IntegratorOneDimOptions::SetDefaultRelTolerance(1.E-6);
119 ROOT::Math::WrappedTF1 weff(feff);
120 ROOT::Math::Integrator ig(ROOT::Math::IntegrationOneDim::kADAPTIVE);
121 ig.SetFunction(weff);
123 double value_integral = ig.Integral(thmin, thmax);
124 double fnorm = 0.5 * (
pow(TMath::Sin(thmax), 2) -
pow(TMath::Sin(thmin), 2));
126 return value_integral / fnorm;
130 TVectorD
EnergyBias(TVectorD lgEs, TVectorD pCal,
const bool infill)
135 int ncol = lgEs.GetNoElements();
136 TVectorD biasEnergy(ncol);
138 for (
int i = 0; i < ncol; ++i) {
161 double p0 = 1.090032150314515363e-01;
162 double p1 = 4.353891452953017049e-01;
164 double Esd =
pow(10., lgE);
166 double relErrs = p0 + p1 /
sqrt(Esd / 1e+17) ;
177 const double pars_p[2] = {1.078638367648934449e-01, 1.595403269466228735e-01};
178 const double pars_fe[2] = {4.836779040905066218e-02, 1.697359371453481258e-01};
179 const double pars[2] = {(pars_p[0] + pars_fe[0]) / 2., (pars_p[1] + pars_fe[1]) / 2.};
181 return pars[0] + pars[1] /
sqrt(
pow(10, lgE) / 1e17);
190 const double pars[9] = {7.964648011936218460e-04,
191 4.118659698340852438e-01,
192 -1.517612358021901198e+00,
193 9.102368706313619384e+00,
194 -9.938644262370022631e+00,
195 4.120050818744602217e-01,
196 1.244124736151181560e-03,
197 -6.535475475395227107e+00,
198 1.039836139398396853e+01
200 const double lgsectheta = TMath::Log10(1 / cos(zenith));
201 double res = pars[0] + (pars[1] + pars[2] * lgsectheta + pars[3] * lgsectheta * lgsectheta + pars[4] * lgsectheta * lgsectheta * lgsectheta) *
pow(10., -lgS38 * 0.5)
202 + (pars[5] + pars[6] * lgsectheta + pars[7] * lgsectheta * lgsectheta + pars[8] * lgsectheta * lgsectheta * lgsectheta) *
pow(10., -lgS38);
204 return res * pCal[1];
213 const double pars[6] = {1.713893029281758462e+00, -1.115258876619560580e+00, 1.557604707934408061e+01,
214 6.861112716697782554e-01, -8.015754473911778089e-01, 8.852556156454199909e-01
216 const double lgsectheta = TMath::Log10(1 / cos(zenith));
218 return (pars[0] + pars[1] * lgsectheta + pars[2] * lgsectheta * lgsectheta)
219 * (
pow(10., (-pars[3] * lgS35)) + pars[4] *
pow(10., (-pars[5] * lgS35)));
226 const double zenith = x[0];
227 const double lgE = par[0];
228 const bool data = bool(par[1]);
229 const bool infill = bool(par[2]);
243 return res * TMath::Cos(zenith) * TMath::Sin(zenith);
249 const double thmax = (infill ? 55. : 60.) * TMath::DegToRad();
250 const double thmin = 0. * TMath::DegToRad();
253 fres.FixParameter(0, lgE);
254 fres.FixParameter(1, 1. * data);
255 fres.FixParameter(2, 1. * infill);
257 ROOT::Math::IntegratorOneDimOptions::SetDefaultAbsTolerance(1.E-6);
258 ROOT::Math::IntegratorOneDimOptions::SetDefaultRelTolerance(1.E-6);
260 ROOT::Math::WrappedTF1 wres(fres);
261 ROOT::Math::Integrator ig(ROOT::Math::IntegrationOneDim::kADAPTIVE);
262 ig.SetFunction(wres);
264 double value_integral = ig.Integral(thmin, thmax);
265 double fnorm = 0.5 * (
pow(TMath::Sin(thmax), 2) -
pow(TMath::Sin(thmin), 2));
267 return value_integral / fnorm;
273 const double xmin = 16.5;
274 const double xmax = 20.5;
275 const double z = (lgE - xmin) / (xmax - xmin);
277 const double pars[2] = {0.2, 0.0783};
278 double shsh = (1 - z) * pars[0] + z * pars[1];
293 int ncol = lgEs.GetNoElements();
294 TVectorD EnergyRes(ncol);
296 for (
int i = 0; i < ncol; ++i) {
297 double lgE = lgEs[i];
298 double Esd =
pow(10., lgE);
310 double relErrs = TMath::Sqrt(
pow(relErrs1, 2) +
pow(relErrs2, 2));
312 EnergyRes[i] = relErrs * Esd;
319 TMatrixD
kResolutionMatrix(TVectorD pCal, TVectorD xos,
double* resolutionOffset,
const bool useResFromData,
const bool infill)
322 int N = xos.GetNoElements();
326 TVectorD Ebias =
EnergyBias(xos, pCal, infill);
328 TMatrixD tmp_kmatrix(N, N);
329 for (
int i = 0; i < N; ++i) {
331 double ey =
pow(10, xos[i]);
332 for (
int j = 0; j < N; ++j) {
334 double ex =
pow(10, xos[j]);
335 tmp_kmatrix[i][j] = TMath::Gaus(ey, ex * Ebias[j], ses[j],
true) * ey * log(10.) *
SDTriggerEfficiency(xos[j], infill);
const bool HeraldAnalysis
TVectorD EnergyResolution(TVectorD lgEs, const bool data, const bool infill)
double CustomShowerToShowerFluctuation(const double lgE)
double DataSD750EnergyResolution(const double lgE, const double zenith)
double SD1500TriggerEfficiency(const double lgE, const double zenith)
double ResolutionZenithDistrib(double *x, double *par)
double SimulationSD750EnergyResolution(const double lgE, const double zenith)
TVectorD GetSDCalPars(bool infill=false)
double CustomInfillShowerToShowerFluctuation(const double lgE)
double SD750TriggerEfficiency(const double lgE, const double zenith)
double pow(const double x, const unsigned int i)
double IntegrateEnergyResolution(const double lgE, const bool data, const bool infill)
double DataSD1500EnergyResolution(const double lgE, const double zenith)
double SimulationSD1500EnergyResolution(const double lgE, const double zenith)
double InverseSdCalibration(const double lgE, TVectorD pCal)
double SDTriggerEfficiency(const double lgE, const bool infill)
TVectorD EnergyBias(TVectorD lgEs, TVectorD pCal, const bool infill)
double ScaledErrorFunction(const double x, const std::vector< double > &pars)
TMatrixD kResolutionMatrix(TVectorD pCal, TVectorD xos, double *resolutionOffset, const bool useResFromData, const bool infill)
double EfficientZenithDistrib(double *x, double *par)