4 #include <TMatrixTSym.h>
5 #include <TMatrixDSym.h>
6 #include <TMatrixDSymEigen.h>
7 #include <TGraphErrors.h>
12 using namespace UnivRecNS;
120 for (
int itype = 0; itype < 3; itype++) {
127 bool UnivRec::InitRec(
bool IsData,
int RecType,
int CalibOpt,
int RecDetector ,
int RecSys ,
int RecMixture )
132 if (gRecType < 0 || gRecType > 8) {
133 printf(
"ERROR: Wrong [RecType] \n");
138 if (gCalibOpt < -3 || gCalibOpt > 3) {
139 printf(
"ERROR: Wrong [CalibOpt] %d \n",
gCalibOpt);
143 if (RecDetector < 0 || RecDetector > 3) {
144 printf(
"Wrong [RecDetector] \n");
148 printf(
"ERROR: Time model for Scintillator above below ground is not tested, you can delete this break at your own risk \n");
151 if (
gRecType == 3 && RecDetector == 0) {
152 printf(
"ERROR: Nmu_SD only possible with upgrades \n");
162 if (CalibOpt > -2 &&
gRecSys != 0) {
163 printf(
"ERROR: Systematics only implemented for CalibOpt=-2 \n");
167 printf(
"ERROR: Wrong [RecSys] \n");
174 printf(
"ERROR: Wrong [gRecMixture] \n");
178 if (
gRecType == 6 && CalibOpt != -1)
179 printf(
"WARNING: Photon search without photon calib parameters \n");
189 printf(
"ERROR: Wrong CalibOpt \n");
210 gRecInfill = RecInfill;
212 gRecSDE_Upgrade = RecSDEUpgrade;
214 if (!(gRecAoP == 0 || gRecAoP == 2 || gRecAoP == 3)) {
215 printf(
"Wrong [RecAoP]\n");
219 gRecDataSet = RecDataSet;
220 if (!(gRecDataSet == 0 || gRecDataSet == 1 || gRecDataSet == 2 || gRecDataSet == 3)) {
221 printf(
"Wrong [RecDataSet]\n");
225 if ((gRecDataSet == 0 || gRecDataSet == 2 || gRecDataSet == 3) && IsGoldenRec)
226 printf(
"Hybrid reconstruction on SD data not possible\n");
227 if ((gRecDataSet == 2 || gRecDataSet == 3) && gRecInfill)
228 printf(
"Wrong data set for Infill rec.\n");
231 if (gRecDataSet == 0 && !gRecInfill && (year < 2004 || year > 2012)) {
232 printf(
"Wrong SD data set\n");
235 if (gRecDataSet == 0)
236 FileName = ToyUtilsNS::GetDataFileName(gRecInfill ? 1 : 0 , year);
237 else if (gRecDataSet == 1)
238 FileName = ToyUtilsNS::GetDataFileName(gRecInfill ? 3 : 2, year);
239 else if (gRecDataSet == 2)
240 FileName = ToyUtilsNS::GetDataFileName(4, year);
241 else if (gRecDataSet == 3)
242 FileName = ToyUtilsNS::GetDataFileName(5, year);
274 for (
int icomp = 0; icomp < 4; icomp++) {
275 station->
DX[icomp] = 0.;
276 station->
DL[icomp] = 0.;
277 station->
T0_CF[icomp] = 0.;
347 for (
int iloop = 0; iloop < 2; iloop++)
350 for (
int iloop = 0; iloop < 3; iloop++) {
360 for (
int i = 0; i < 2; i++) {
422 bool UnivRec::InitEvent(ToyShowerNS::ToyShower* fevt)
430 bool okT4 =
true, okEnergyCut =
true, okAtm =
true, okXmax =
true;
436 recinfo.
id = (
gRecMC ? int(fevt->GetCorsikaInfo()->runnr) : fevt->GetAugerInfo()->sdid);
447 MCinfo.
azi = fevt->GetCorsikaInfo()->azi;
449 float x_ref, y_ref, z_ref;
450 fevt->GetCoreMC(x_ref, y_ref, z_ref);
457 MCinfo.
logE = log10(fevt->GetCorsikaInfo()->E0) + 9.;
458 MCinfo.
Xmax = fevt->GetCorsikaInfo()->Xmax + ToyUtilsNS::XmaxCorsikaOffset;
460 int ir0 = 4 , ipsi0 = 2;
461 ToyShowerNS::SamplingArea_t* saRef = fevt->GetDenseSA(ir0, ipsi0);
462 double density = fevt->GetAtmosphere()->GetDensity(saRef->zg);
463 double sMu = saRef->Muon.vem;
466 density, ToyShowerNS::hgroundRef, 1.0 , 0 ,
MCinfo.
iatm);
477 int imonth = fevt->GetAtmosphere()->GetCurrentAtmosphereMonth();
482 ToyShowerNS::AugerInfo_t* ainfo = fevt->GetAugerInfo();
483 if (ainfo->p == 0. || ainfo->T == 0.)
491 unsigned int nsec = 0;
493 int imonth = time_stamp.GetMonth();
516 TVector3 rndD = theCR.Orthogonal();
517 rndD.SetMag(fabs(rnd->Gaus(0,
SmearingAngle * TMath::DegToRad())));
518 rndD.Rotate(rnd->Rndm()*TMath::TwoPi(), theCR);
524 ToyShowerNS::AugerInfo_t* ainfo = fevt->GetAugerInfo();
539 float Xmax_FD, Xmax_FD_err, E_FD, E_FD_err, theta_FD, theta_FD_err, azi_FD, azi_FD_err;
540 augerinfo.
isGoodFD = fevt->isGoodFD(Xmax_FD, Xmax_FD_err, E_FD, E_FD_err, theta_FD, theta_FD_err, azi_FD, azi_FD_err ,
true, EyeSel);
563 printf(
" Event is not T4 %d \n",
recinfo.
id);
567 printf(
" Energy below analysis threshold %d \n",
recinfo.
id);
571 printf(
"Error: inconsistency in the atmospheres %d \n",
recinfo.
id);
575 printf(
" Xmax not well defined %d \n",
recinfo.
id);
580 printf(
"Warning: SD event not 6T5 \n");
584 printf(
"Error: Golden event without FD rec parameters %d \n",
recinfo.
id);
589 printf(
"Lightening event %d \n",
recinfo.
id);
597 int nSignalStations = 0;
598 for (
int idet = 0; idet < ToyUtilsNS::nDetectors; idet++)
599 for (
int itype = 0; itype < 3; itype++) {
603 ToyShowerNS::SamplingArea_t* sa = fevt->GetArraySA(idet);
605 if (!sa->isAlive && sa->triggerFlag == 0)
continue;
606 if (sa->isAccidental && sa->triggerFlag > 0)
continue;
609 if (
recinfo.
id == 13296659 && sa->id == 203)
continue;
610 if (
recinfo.
id == 13769235 && sa->id == 131)
continue;
611 if (
recinfo.
id == 8270184 && sa->id == 294)
continue;
614 if (
recinfo.
id == 7728630 && sa->id == 752)
continue;
617 if (
recinfo.
id == 648728 && sa->id == 157)
continue;
618 if (
recinfo.
id == 1711230 && sa->id == 216)
continue;
619 if (
recinfo.
id == 10961377 && sa->id == 438)
continue;
624 station.
type = itype;
625 station.
id = (
gRecMC ? idet : sa->id);
635 if (sa->triggerFlag == 0) {
640 bool hasTrace =
true;
660 int nTimeBins = (!
gRecSDE_Upgrade || itype == 2 ? ToyShowerNS::nFADC : ToyShowerNS::nTimeBins / 4);
669 }
else if (itype == 1) {
670 vemtrace = (
gRecSDE_Upgrade ? sa->vemtraceScin_8ns : sa->vemtraceScin);
673 vemtrace = sa->vemtraceMD;
684 }
else if (itype == 1) {
688 }
else if (itype == 2) {
698 start = sa->StartBin;
702 for (
int itime = start; itime < end; itime++)
708 end = (itype == 2 ? nTimeBins - 3 : nTimeBins) ;
716 if (vemtrace[itime] > vemSat) {
718 vemtrace[itime] = vemSat;
724 if (vemtrace[itime] > vemSat) {
726 vemtrace[itime] = vemSat;
732 if (itime >= end)
break;
749 int StartTimeBin = sa->StartTimeBin;
750 station.
starttime = (double(StartTimeBin) + 0.5) * TimeUnit;
757 for (
int itime = 0; itime < nTimeBins; itime++)
758 if (vemtrace[itime] > 0.) {
759 StartTimeBin = itime;
765 for (
int itime = 0; itime < nTimeBins - nWindow; itime++) {
766 if (vemtrace[itime] <= (0.1 /
double(nWindow)))
continue;
767 double vemWindow = 0.;
768 for (
int it = itime; it < itime + nWindow; it++) vemWindow += vemtrace[it];
769 if (vemWindow > 0.1) {
770 StartTimeBin = itime;
775 station.
starttime = (double(StartTimeBin) + 0.5) * TimeUnit;
786 for (
int iq = 0; iq <
nQ; iq++) {
787 float tq, tq_err, signal = station.
signalsize;
788 ToyUtilsNS::GetTQ(&vemtrace[start], signal, end - start, TimeUnit, station.
quantile[iq], tq, tq_err);
789 station.
tquantile[0][iq] = tq + double(start) * TimeUnit;
791 for (
int iq = 0; iq <
nQ; iq++)
856 if (st->
type == 0)
continue;
859 int idet_wcd =
UNDEF;
864 if (idet_wcd ==
UNDEF)
continue;
872 double vemMax = -1.e10;
898 for (
int itype = 0; itype < 3; itype++)
939 double E_sum = 0., w = 0.;
943 if (station->
type != 0)
continue;
948 if (station->
r < 600.e2 || station->
r > 2500.e2)
continue;
952 if (logEi < 18. || logEi > 20.5)
continue;
955 E_sum += (
pow(10., logEi) * wi);
981 return sqrtf((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
987 if (angle > 2 * M_PI)
988 return angle - int(angle / 2 / M_PI) * 2 * M_PI;
990 return 2 * M_PI + angle + int(-angle / 2 / M_PI) * 2 * M_PI;
1009 double xr = xg0 * cosazi + yg0 * sinazi;
1010 double yr = -xg0 * sinazi + yg0 * cosazi;
1013 station->
r =
sqrt((-xr * costheta + zr * sintheta) * (-xr * costheta + zr * sintheta) + yr * yr);
1018 for (
int icomp = 0; icomp < 4; icomp++) {
1062 if (station->
type != itype)
continue;
1069 if (vemsqrt == 0.)
return false;
1075 if (!
PlaneFit(
false,
false,
true, itype))
return false;
1081 if (!
PlaneFit(
true,
true,
true, itype)) {
1082 PlaneFit(
false,
false,
true, itype);
1086 if (fabs(theta_prev -
recinfo.
theta) < 0.1 * M_PI / 180.)
break;
1089 if (nIter > 10)
break;
1097 std::vector<double> fX, fY, fT, fW;
1104 if (station->
type != itype)
continue;
1108 if (nSel < 3)
return false;
1112 if (station->
type != itype)
continue;
1121 if (nMuons < 2)
continue;
1122 float TimeVariance2 = 134 + 2.4 *
pow((t50 + 10.) / (nMuons + 1), 2) * nMuons / (nMuons + 2);
1130 float tcurv = station->
r * station->
r / speedC / 2 / R;
1135 fW.push_back(1. / TimeVariance2);
1136 fX.push_back(station->
xg);
1137 fY.push_back(station->
yg);
1138 fT.push_back(tstation);
1140 if (fX.size() < 3)
return false;
1141 if (!
PlaneFit(fX, fY, fT, fW))
return false;
1145 bool UnivRec::PlaneFit(std::vector<double> fX, std::vector<double>fY, std::vector<double>fT, std::vector<double>fW)
1147 if (fX.size() == 0.)
return false;
1152 double fX0 = 0., fY0 = 0., fT0 = 0.;
1154 for (
unsigned int i = 0; i < fX.size(); i++) {
1156 fX0 += (fX[i] * fW[i]);
1157 fY0 += (fY[i] * fW[i]);
1158 fT0 += (fT[i] * fW[i]);
1161 for (
unsigned int i = 0; i < fX.size(); i++) {
1162 fX[i] = (fX[i] - fX0 / WSum);
1163 fY[i] = (fY[i] - fY0 / WSum);
1164 fT[i] = (fT[i] - fT0 / WSum);
1168 float Det, Det1, Det2;
1169 float b[2][2],
c[2];
1170 float l,
m, lerr, merr, lmerr;
1180 for (
unsigned int i = 0; i < fX.size(); i++) {
1181 b[0][0] += fX[i] * fX[i] * fW[i];
1182 b[0][1] += fX[i] * fY[i] * fW[i];
1183 b[1][1] += fY[i] * fY[i] * fW[i];
1185 c[0] -= (fT[i] * speedC * fX[i] * fW[i]);
1186 c[1] -= (fT[i] * speedC * fY[i] * fW[i]);
1191 Det = b[1][1] * b[0][0] - b[0][1] * b[1][0];
1192 Det1 = c[0] * b[1][1] - b[1][0] * c[1];
1193 Det2 = c[1] * b[0][0] - b[1][0] * c[0];
1198 lm2 = l * l + m *
m;
1200 if (lm2 > 1. || l == 0.)
return false;
1204 deter = b[0][0] * b[1][1] * WSum - b[0][1] * b[1][0] * WSum;
1206 lerr = (speedC * speedC) * WSum * b[1][1] / deter;
1207 merr = (speedC * speedC) * WSum * b[0][0] / deter;
1208 lmerr = (speedC * speedC) * WSum * b[0][1] / deter;
1211 float theta = asin(
sqrt(l * l + m * m));
1212 float azi = atan2(m, l);
1213 float theta_err, azi_err;
1215 theta_err = cos(azi) * cos(azi) * lerr + sin(azi) * sin(azi) * merr + 2 * cos(azi) * sin(azi) * lmerr;
1216 if (theta_err > 0) theta_err =
sqrt(theta_err) / cos(theta);
1217 azi_err = cos(azi) * cos(azi) * merr + sin(azi) * sin(azi) * lerr - 2 * cos(azi) * sin(azi) * lmerr ;
1218 if (azi_err > 0) azi_err =
sqrt(azi_err) / sin(theta);
1231 float minDistance = (!
gRecInfill ? 1200.e2 : 700.e2);
1232 float maxDistance = (!
gRecInfill ? 1700.e2 : 800.e2);
1236 if (
fstation[i].type != itype)
continue;
1238 if (
fstation[j].type != itype)
continue;
1241 if (dij > maxDistance || dij < minDistance)
continue;
1244 if (k == i || k == j)
continue;
1245 if (
fstation[k].type != itype)
continue;
1248 if (dik > maxDistance || dik < minDistance)
continue;
1250 if (djk > maxDistance || djk < minDistance)
continue;
1253 if (Size > SizeMax) {
1276 printf(
"---------------------------------------\n");
1278 printf(
"---------------------------------------\n");
1281 printf(
"theta=%5.2lf (%5.2lf) azi=%5.2lf (%5.2lf) (x,y,z)=(%5.2lf,%5.2lf,%5.2lf) (%5.2lf,%5.2lf,%5.2lf) sigma_x,sigma_y=(%5.2lf,%5.2lf) \n",
1288 printf(
"logE=%5.2lf +-%5.2lf (%5.2lf), Nmu=%5.2lf+-%5.2lf (%5.2lf) Xmax=%5.2lf +- %5.2lf (%5.2lf) \n",
1317 if (PrintResiduals) {
1318 for (
int iloop = 0; iloop < 2; iloop++) {
1319 if (iloop == 0) printf(
"Signal likelihood \n");
1320 else printf(
"Time likelihood \n");
1321 printf(
"--------------------------\n");
1328 printf(
"idet=%d (%d) %d | %4.0lf %4.0lf %4.0lf %4.0lf %d %d ", idet, (st->
id), st->
type, st->
r / 1.e2, st->
psi * 180. / M_PI,
1334 printf(
" %4.0lf %4.2lf| t0_cf=%3.0lf | %d %d St= %4.0lf (%4.0lf %4.0lf)| %d %d%d%d T1= %4.0lf (%4.0lf %4.0lf) T10=%4.0lf (%4.0lf %4.0lf) T50=%4.0lf (%4.0lf %4.0lf) | lnP=%3.1lf %3.1lf \n",
1354 TVector3 theDir0, theDir;
1360 double Chi2[2] = {0., 0.};
1361 int nChi2[2] = {0, 0};
1362 if (okRec)
GetChi2(Chi2, nChi2);
1365 unsigned int GPSnano = 0;
1368 unsigned int year = (!
gRecMC ? time_stamp.GetYear() :
UNDEF);
1371 fprintf(fp,
"%d %d %d %d %d %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %d %d %lf %lf %d %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %d %lf %d %lf %lf %d %d %d %d %lf %lf %d %d %d %lf %lf \n",
1382 theDir0.Angle(theDir),
1396 if (fp == NULL)
return false;
1397 if (readFlag && feof(fp))
return false;
1400 fwrite(&
gRecType, 1,
sizeof(
int), fp);
1401 fwrite(&
gRecMC, 1,
sizeof(
bool), fp);
1404 fwrite(&
gRecAoP, 1,
sizeof(
int), fp);
1406 fwrite(&DataSet_Sys, 1,
sizeof(
int), fp);
1409 for (
int itype = 0; itype < 3; itype++)
1415 if (!
gRecMC) fwrite(&
GPSsec, 1,
sizeof(
unsigned int), fp);
1419 fwrite(&nDet, 1,
sizeof(
int), fp);
1422 if (
fstation[idet].signalsize > 0.) nDet++;
1423 fwrite(&nDet, 1,
sizeof(
int), fp);
1425 if (
fstation[idet].signalsize > 0.)
1429 [[maybe_unused]]
int nread = 0;
1430 nread += fread(&
gRecType, 1,
sizeof(
int), fp);
1432 if (feof(fp))
return false;
1433 nread += fread(&
gRecMC, 1,
sizeof(
bool), fp);
1434 nread += fread(&
gRecInfill, 1,
sizeof(
bool), fp);
1436 nread += fread(&
gRecAoP, 1,
sizeof(
int), fp);
1438 nread += fread(&DataSet_Sys, 1,
sizeof(
int), fp);
1445 nread += fread(&
gCalibOpt, 1,
sizeof(
int), fp);
1447 for (
int itype = 0; itype < 3; itype++)
1453 if (!
gRecMC) nread += fread(&
GPSsec,
sizeof(
unsigned int), 1, fp);
1456 nread += fread(&nRecStations,
sizeof(
int), 1, fp);
1457 if (feof(fp))
return false;
1460 if (nRecStations > 0) {
1477 double vemMax = -1.e10;
1480 vemMax =
fstation[idet].signalsize;
1491 for (
int i = 0; i < 2; i++) {
1509 for (
int iq = 0; iq <
nQ; iq++) {
1520 void UnivRec::GetResiduals(std::vector<double>& mean, std::vector<double>& rms, std::vector<double>& rec,
int optY, std::vector<double>& fx,
int optX)
1525 void UnivRec::GetResiduals(std::vector<double>& mean, std::vector<double>& rms, std::vector<double>& rec,
int optY, std::vector<double>& fx,
int optX ,
bool OnlyNotSaturated)
1528 if (optY < 0 || optY > 4)
return;
1529 if (optX < 0 || optX > 2)
return;
1539 if (OnlyNotSaturated && st->
isSaturated)
continue;
1545 if (optX == 0) x_i = st->
r;
1554 }
else if (optY == 1) {
1560 mean.push_back(st->
tq_pred[optY - 2]);
1561 rms.push_back(st->
tq_rms[optY - 2]);
1562 rec.push_back(st->
tq_rec[optY - 2]);
1572 double nStations = 0.;
1581 if (nStations < 2) {
1587 rms =
sqrt(nStations / (nStations - 1) * (rms / nStations - mean * mean));
1590 bool UnivRec::ScanRange(
int iparX,
int iparY, std::vector<double> par, std::vector<int>
parStatus,
double* rangeX,
double* rangeY,
double* d,
double RotAngle,
double errDef,
double& edm)
1592 double InitStep = 2.0;
1593 return ScanRange(iparX, iparY, par, parStatus, rangeX, rangeY, d, RotAngle, errDef, InitStep, edm);
1596 bool UnivRec::ScanRange(
int iparX,
int iparY, std::vector<double> par, std::vector<int>
parStatus,
double* rangeX,
double* rangeY,
double* d,
double RotAngle,
double errDef,
double InitStep,
double& edm)
1600 std::vector<bool> isFixed;
1601 for (
unsigned int ipar = 0; ipar < par.size(); ipar++)
1602 isFixed.push_back(parStatus[ipar] < 2 ?
false :
true);
1605 bool okX = (iparX >= 0 && iparX < int(par.size()));
1606 bool okY = (iparY >= 0 && iparY < int(par.size()));
1607 if (okX) okX = !isFixed[iparX];
1608 if (okY) okY = !isFixed[iparY];
1609 if (!okX && !okY)
return false;
1611 if (okX && okY && iparX == iparY) okY =
false;
1612 if (!okX) RotAngle = M_PI / 2.;
1613 if (!okY) RotAngle = 0.;
1615 const int niter_max = (InitStep < 1. ? 500 : 100);
1618 double val_max[2] = { (okX ? par[iparX] :
UNDEF) , (okY ? par[iparY] :
UNDEF) };
1619 bool ok_range =
true;
1623 lowX =
low[iparX] /
unit[iparX];
1630 lowX = (val_max[0] + lowX);
1631 highX = (val_max[0] + highX);
1636 lowY =
low[iparY] /
unit[iparY];
1643 lowY = (val_max[1] + lowY);
1644 highY = (val_max[1] + highY);
1648 for (
int iside = 0; iside < 2; iside++) {
1649 double sign = (iside == 0 ? -1. : 1.);
1650 double t_iter = 0., lnP_iter = 0., step = InitStep;
1654 t_iter += (sign * step);
1655 if (okX) par[iparX] = val_max[0] + cos(RotAngle) * t_iter;
1656 if (okY) par[iparY] = val_max[1] + sin(RotAngle) * t_iter;
1660 printf(
" ipar=(%d,%d) iside=%d iter=%d t=%5.4lf step=%5.4lf lnP=%lf (%lf %lf) ", iparX, iparY, iside, niter, t_iter, step, lnP_iter, lnP_max, errDef);
1661 if (okX) printf(
" parX=%lf (%lf) ", par[iparX]*
unit[iparX], val_max[0]*
unit[iparX]);
1662 if (okY) printf(
" parY=%lf (%lf) ", par[iparY]*
unit[iparY], val_max[0]*
unit[iparY]);
1667 if (lnP_iter > lnP_max) edm = lnP_iter - lnP_max;
1670 if ((okX && (par[iparX] < lowX || par[iparX] > highX)) ||
1671 (okY && (par[iparY] < lowY || par[iparY] > highY)) || niter > niter_max) {
1677 if (lnP_iter < (lnP_max - errDef)) {
1678 if ((lnP_max - errDef) - lnP_iter < 0.01)
break;
1680 t_iter -= (sign * step);
1688 if (!ok_range)
break;
1692 double t_i[2] = { t_iter - sign * step , t_iter };
1693 double lnP_i[2] = { 0., lnP_iter};
1695 if (okX) par[iparX] = val_max[0] + cos(RotAngle) * t_i[0];
1696 if (okY) par[iparY] = val_max[1] + sin(RotAngle) * t_i[0];
1700 double t = (t_i[1] - t_i[0]) * (lnP_max - errDef - lnP_i[0]) / (lnP_i[1] - lnP_i[0]) + t_i[0];
1701 if (okX) rangeX[iside] = val_max[0] + cos(RotAngle) * t;
1702 if (okY) rangeY[iside] = val_max[1] + sin(RotAngle) * t;
1708 printf(
" ipar=(%d,%d) iside=%d niter=%d lnP=%lf %lf (%lf) RotAngle=%4.2lf ", iparX, iparY, iside, niter, lnP_i[0], lnP_i[1], lnP_max, RotAngle * 180. / M_PI);
1709 if (okX) printf(
" parX=%lf (%lf) ", rangeX[iside]*
unit[iparX], val_max[0]*
unit[iparX]);
1710 if (okY) printf(
" parY=%lf (%lf) ", rangeY[iside]*
unit[iparY], val_max[1]*
unit[iparY]);
1712 if (okX) par[iparX] = rangeX[iside];
1713 if (okY) par[iparY] = rangeY[iside];
1714 printf(
" | d=%5.2lf %lf \n", d[iside], lnP_max -
GetLikelihood(par, parStatus));
1731 if (okX) par[iparX] = val_max[0];
1732 if (okY) par[iparY] = val_max[1];
1737 return ok_range && ok_minima;
1741 void UnivRec::ScanLikelihood(
int iparX,
int iparY,
int N, std::vector<std::pair<double, double> >& parXY, std::vector<double>& lnP,
1742 std::pair<double, double>& parXY_min,
double& lnP_min)
1747 std::vector<double> par, epar;
1749 std::vector<bool> isFixed, hasLimits;
1751 for (
unsigned int ipar = 0; ipar < par.size(); ipar++)
1752 isFixed.push_back(parStatus[ipar] < 2 ?
false :
true);
1754 bool okX = (iparX >= 0 && iparX < int(par.size()));
1755 if (okX) okX = !isFixed[iparX];
1756 bool okY = (iparY >= 0 && iparY < int(par.size()));
1757 if (okY) okY = !isFixed[iparY];
1758 if (!okX && !okY)
return;
1760 double range[2][2] = { {1.e10, -1.e10}, {1.e10, -1.e10} };
1762 double step[2] = {0., 0.};
1763 unsigned int NX = 1, NY = 1;
1766 for (
int irot = 0; irot < 8; irot++) {
1767 double RotAngle = M_PI / 8.*double(irot);
1768 double rangeX[2], rangeY[2];
1769 ScanRange(iparX, iparY, par, parStatus, rangeX, rangeY, dum, RotAngle, 6., edm);
1770 for (
int iside = 0; iside < 2; iside++) {
1771 if (okX && rangeX[iside] < range[0][0]) range[0][0] = rangeX[iside];
1772 if (okX && rangeX[iside] > range[0][1]) range[0][1] = rangeX[iside];
1773 if (okY && rangeY[iside] < range[1][0]) range[1][0] = rangeY[iside];
1774 if (okY && rangeY[iside] > range[1][1]) range[1][1] = rangeY[iside];
1777 }
else ScanRange(iparX, iparY, par, parStatus, range[0], range[1], dum, (okX ? 0. : M_PI / 2.) , 6., edm);
1781 printf(
"rangeX=(%5.2lf %5.2lf ) rangeY=(%5.2lf,%5.2lf ) \n", range[0][0]*
unit[iparX], range[0][1]*
unit[iparX], range[1][0]*
unit[iparY], range[1][1]*
unit[iparY]);
1784 step[0] = (range[0][1] - range[0][0]) /
double(N);
1788 step[1] = (range[1][1] - range[1][0]) /
double(N);
1792 for (
unsigned int ix = 0; ix < NX; ix++)
1793 for (
unsigned int iy = 0; iy < NY; iy++) {
1794 std::vector<double> par_i;
1795 for (
unsigned int ipar = 0; ipar < par.size(); ipar++) par_i.push_back(par[ipar]);
1796 std::pair<double, double> parXY_i;
1798 parXY_i.first = range[0][0] + double(ix) * step[0];
1799 par_i[iparX] = parXY_i.first;
1800 parXY_i.first *=
unit[iparX];
1801 }
else parXY_i.first = 0.;
1804 parXY_i.second = range[1][0] + double(iy) * step[1];
1805 par_i[iparY] = parXY_i.second;
1806 parXY_i.second *=
unit[iparY];
1807 }
else parXY_i.second = 0.;
1810 parXY.push_back(parXY_i);
1811 lnP.push_back(lnP_i);
1817 parXY_min.first = par[iparX] *
unit[iparX];
1819 parXY_min.second = par[iparY] * unit[iparY];
1838 if (!gRecMC && CutBadYears && gRecDataSet == 1) {
1839 unsigned int GPSnano = 0;
1841 if (time.GetYear() < 2008)
return false;
1847 okRec = (recinfo.FitStatus[0] == 3 && recinfo.FitStage == 0);
1849 bool okQuality = (recinfo.Xmax_err < 200. && (gRecType == 6 ?
true : recinfo.TimeMaxdev[0] < 4.0));
1850 bool okMinimum = (recinfo.FitStatus[1] >= 2 && recinfo.MinEigenVal > -0.5);
1851 okRec = (recinfo.FitStatus[0] == 3 && recinfo.FitStage == 2 && recinfo.AllTimesOK && okMinimum && okQuality);
1857 printf(
"sdid=%d ok=%d Status=%d/%d FitStage=%d EDM=%5.3lf MinEigenVal=%5.3lf AlltimesOK=%d theta=%5.2f (%5.2lf %5.2lf) logE=%5.2lf (%5.2lf %5.2lf) Xmax=%5.2lf+-%5.2lf (%5.2lf %5.2lf ) Nmu=%5.2lf nStations=%d/%d\n",
1858 recinfo.id, okRec, recinfo.FitStatus[0], recinfo.FitStatus[1], recinfo.FitStage,
1859 recinfo.edm, recinfo.MinEigenVal,
1861 recinfo.theta * 180. / M_PI, MCinfo.theta * 180. / M_PI, augerinfo.theta_FD * 180. / M_PI,
1862 recinfo.logE, MCinfo.logE, augerinfo.logE_FD,
1863 recinfo.Xmax, recinfo.Xmax_err, MCinfo.Xmax, augerinfo.Xmax_FD,
1864 recinfo.Nmu, recinfo.nSignalStations, recinfo.nTimeStations);
1877 double logE_Thresh = 18.60;
1879 else if (
gRecType == 1) logE_Thresh = 19.10;
1880 else if (
gRecSys > 0) logE_Thresh = 19.00;
1882 if (logE < logE_Thresh) {
1883 if (PrintOut) printf(
"%d Event not selected : logE=%5.2lf \n",
recinfo.
id, logE);
1912 for (
int iq = 0; iq <
nQ; iq++) {
1925 int type = st->
type;
1941 double vemTot_p = 0., fcomp[4];
1942 for (
int icomp = 0; icomp < 4; icomp++) {
1945 vemTot_p += fcomp[icomp];
1947 for (
int icomp = 0; icomp < 4; icomp++) fcomp[icomp] /= vemTot_p;
1958 double UnitPerMuon = 0;
1961 else if (st->
type == 1)
1963 else if (st->
type == 2)
1965 double nmuDetector = fcomp[0] * st->
signalsize / UnitPerMuon;
1966 if (nmuDetector <= 1.)
1977 else if (P_extreme < exp(
lnP_inf))
1993 for (
int iq = 0; iq <
nQ; iq++) {
2008 for (
int iq = 0; iq <
nQ; iq++) {
2014 st->
tq_rec[iq] -= corrAoP;
2017 double NanoSecPerVEM = RiseTime / st->
signalsize / 0.4;
2019 if (!UseAvgQuantiles)
2022 st->
tq_corr[iq] = corrAoP + corr;
2027 for (
int iq = 0; iq <
nQ; iq++) {
2030 double signalsize = (UseAvgQuantiles ? 1.e4 : st->
signalsize);
2067 int type = st->
type;
2081 double RMS_sh = 0.02 * Pred;
2082 double rms =
sqrt(Pred + RMS_sh * RMS_sh);
2092 double dev = (Rec - Pred) / 2. / rms;
2093 double Pi = TMath::Erfc(dev) / 2.;
2094 if (Pi > exp(
lnP_inf)) lnP = log(Pi);
2099 else if (Rec > 20) {
2101 else lnP = -
pow((Rec - Pred) / rms, 2.) / 2. + log(1. /
sqrt(2.*M_PI) / rms);
2105 double part = double(
int(Rec + 0.5));
2106 double Pi = TMath::Poisson(part, Pred);
2107 if (Pi < exp(
lnP_inf) || std::isnan(Pi) || std::isinf(Pi)) lnP =
lnP_inf;
2113 for (
int i = 0; i < 3; i++) Pi += TMath::Poisson(
double(i), Pred);
2136 for (
int icomp = 0; icomp < 4; icomp++) {
2140 if (st->
DX[icomp] <= DX0)
return false;
2153 else if (FitStage == 2) {
2171 int type = st->
type;
2172 if (type != 0)
continue;
2187 if (Pred < vemCut) {
2198 for (
int idet_i = 0; idet_i <
nRecStations; idet_i++) {
2200 if (st->
type == 0)
continue;
2203 int idet_wcd =
UNDEF;
2208 if (idet_wcd ==
UNDEF)
continue;
2236 double Chi2 = 0., nChi2 = 0.;
2240 if (st->
type != 0)
continue;
2242 int type = st->
type;
2258 if (Chi2 /
double(nChi2) > 100.)
return false;
2262 int nTimeStations = 0, nSignalStations = 0;
2265 if (st->
type != 0)
continue;
2285 fstation[idet_max].mask_quantiles =
true;
2286 fstation[idet_max].mask_starttime =
true;
2287 fstation[idet_max].mask_signal =
true;
2289 if (
debug == 1) printf(
"Rejecting station : %d %d \n",
fstation[idet_max].
id, idet_max);
2307 for (
int iq = 0; iq <
nQ; iq++) {
2346 const int status_golden[
npar] = { 0, 0, 3, 0, 3, 3, 2, 2, 3 };
2347 const int status_sd[
npar] = { 0, 0, 0, (
gRecType == 3 ? 0 : 3), 3, 3, 2, 2, 3 };
2348 for (
unsigned int ipar = 0; ipar <
npar; ipar++) {
2349 if (
IsGoldenRec) status.push_back(status_golden[ipar]);
2350 else status.push_back(status_sd[ipar]);
2356 const int status_golden[
npar] = { 0, 0, 1, 0, 1, 3, 2, 2, 3 };
2357 const int status_sd[
npar] = { 0, 0, 0, (
gRecType == 3 ? 0 : 3), 3, 3, 2, 2, 3 };
2359 for (
unsigned int ipar = 0; ipar <
npar; ipar++) {
2360 if (
IsGoldenRec) status.push_back(status_golden[ipar]);
2361 else status.push_back(status_sd[ipar]);
2367 const int status_xmax[
npar] = { 2, 2, 2, 2, (
gRecType == 7 ? 2 : 0), 0, 2, 2, (
gRecType == 7 ? 0 : 3) };
2368 for (
unsigned int ipar = 0; ipar <
npar; ipar++) status.push_back(status_xmax[ipar]);
2374 const int status_OffsetM_mu_FD[
npar] = { 2, 2, 2, 2, 2, 0, 2 , 2, 0 };
2375 const int status_photon[
npar] = { 2, 2, 2, 3, 0, 0, 0 , 0, 3 };
2376 for (
unsigned int ipar = 0; ipar <
npar; ipar++) {
2377 if (
gRecType == 6) status.push_back(status_photon[ipar]);
2378 else if (
gRecType == 7) status.push_back(status_OffsetM_mu_FD[ipar]);
2379 else status.push_back(status_xmax[ipar]);
2398 for (
unsigned int ipar = 0; ipar <
npar; ipar++) {
2399 par.push_back((status[ipar] == 3 ? 0. : val_i[ipar] /
unit[ipar]));
2400 if (status[ipar] == 0 || status[ipar] == 1) {
2402 hasLimits.push_back((ipar == 3 || ipar == 4 || ipar == 8 ?
true :
false));
2405 hasLimits.push_back(
false);
2422 std::vector<double> epar;
2423 for (
unsigned int i = 0; i < par.size(); i++) epar.push_back(0.);
2460 double theta_p = asin(
sqrt(l_p * l_p + m_p * m_p));
2464 theDir_p.SetMagThetaPhi(1., theta_p, azi_p);
2468 theta = theDir_p.Theta();
2479 for (
int itype = 0; itype < 3; ++itype)
2486 double vemTot_p = 0., fcomp[4];
2487 for (
int icomp = 0; icomp < 4; icomp++) {
2489 vemTot_p += fcomp[icomp];
2491 for (
int icomp = 0; icomp < 4; icomp++)
2492 fcomp[icomp] /= vemTot_p;
2495 double UnitPerMuon = 0;
2498 else if (st->
type == 1)
2500 else if (st->
type == 2)
2502 double nmuDetector = fcomp[0] * st->
signalsize / UnitPerMuon;
2503 if (nmuDetector <= 1.)
2505 double pred = 0, rms = 0;
2507 ftime[st->
type]->
tFirstPDF(st->
DL[0], st->
r,
recinfo.
logE, st->
psi,
recinfo.
theta, st->
T0_CF[0], nmuDetector, -1.,
false, pred, rms);
2516 if (par.size() !=
npar) {
2517 printf(
"ERROR (GetLikelihood): par size %ld\n", par.size());
2520 for (
unsigned int ipar = 0; ipar <
npar; ++ipar)
2521 if (std::isnan(par[ipar]) || std::isinf(par[ipar])) {
2522 printf(
"ERROR (GetLikelihood): par %d ->%lf \n", ipar, par[ipar]);
2528 if (status[6] < 2 && status[7] < 2)
2534 if (status[2] < 2)
recinfo.
logE = par[2] * unit[2];
2535 else if (status[2] == 3) {
2539 printf(
"ERROR (GetLikelihood): setting energy \n");
2544 if (status[4] < 2)
recinfo.
Xmax = par[4] * unit[4];
2545 else if (status[4] == 3) {
2550 if (status[3] < 2)
recinfo.
Nmu = par[3] * unit[3];
2551 else if (status[3] == 3) {
2559 for (
int itype = 0; itype < 3; itype++)
2574 if (status[2] == 1) {
2576 printf(
"ERROR (GetLikelihood): constraining energy \n");
2581 double lnP_Energy = (-
pow((mean - rec) / rms, 2.) / 2. + log(1. /
sqrt(2.*M_PI) / rms));
2586 if (status[4] == 1) {
2588 printf(
"ERROR (GetLikelihood): constraining Xmax \n");
2593 double lnP_Xmax = (-
pow((mean - rec) / rms, 2.) / 2. + log(1. /
sqrt(2.*M_PI) / rms));
2598 if (status[3] == 1) {
2600 double mean = 1., rms = 0.2;
2601 double lnP_Nmu = (-
pow((mean - rec) / rms, 2.) / 2. + log(1. /
sqrt(2.*M_PI) / rms));
2620 if (std::isnan(lnP) || std::isinf(lnP)) {
2636 bool ok_range =
true;
2638 std::vector<bool> isFixed;
2639 for (
unsigned int ipar = 0; ipar < par.size(); ipar++)
2640 isFixed.push_back(parStatus[ipar] < 2 ?
false :
true);
2643 for (
unsigned int ipar = 0; ipar < par.size(); ipar++)
2644 if (!isFixed[ipar]) ndim++;
2648 if (
debug > 0) printf(
"1D scan of parameter errors \n\n");
2649 double errDef_i[
npar] = { 0.5, 1.20, 1.35, 2.40, 3.00, 3.60, 4.20 , 4.75, 5.30 };
2650 for (
unsigned int i = 0; i < par.size(); i++) {
2651 if (isFixed[i])
continue;
2652 double rangeX[2], rangeY[2];
2654 bool ok =
ScanRange(i,
UNDEF, par, parStatus, rangeX, rangeY, d , 0. , errDef_i[ndim - 1], edm);
2655 if (!ok) ok_range =
false;
2656 epar[i] = (fabs(d[0]) + fabs(d[1])) / 2.;
2657 if (
debug > 0) printf(
" ipar=%d %lf (%lf,%lf) edm=%5.2lf ok=%d \n", i, par[i]*
unit[i], (par[i] + d[0])*
unit[i], (par[i] + d[1])*
unit[i], edm, ok);
2659 if (!ok_range)
return 1;
2663 double errDef = 1.0;
2664 if (
debug > 0) printf(
"\n\n2D scan of parameter errors \n\n");
2666 double d_side[par.size()][par.size()][2];
2667 for (
unsigned int i = 0; i < par.size(); i++)
2668 for (
unsigned int j = 0; j <= i; j++) {
2669 double range_i[2], range_j[2];
2670 if (isFixed[i] || isFixed[j]) {
2671 d_side[i][j][0] = 0.;
2672 d_side[i][j][1] = 0.;
2676 bool ok =
ScanRange(i, j, par, parStatus, range_i, range_j, d_side[i][j] , (i == j ? 0. : M_PI / 4.) , errDef, edm);
2677 if (!ok) ok_range =
false;
2680 printf(
"(i,j)=(%d,%d) ok=%d d=(%lf,%lf) ", i, j, ok, d_side[i][j][0], d_side[i][j][1]);
2681 if (i == j) printf(
" (%lf,%lf) \n", (par[i] + d_side[i][i][0])*
unit[i], (par[i] + d_side[i][i][1])*
unit[i]);
2683 if (edm > 0.) printf(
"Warning %lf \n", edm);
2686 if (!ok_range)
return 1;
2690 double d[par.size()][par.size()];
2691 for (
unsigned int i = 0; i < par.size(); i++)
2692 for (
unsigned int j = 0; j < par.size(); j++) {
2693 if (j <= i) d[i][j] = (fabs(d_side[i][j][0]) + fabs(d_side[i][j][1])) / 2.;
2694 else d[i][j] = (fabs(d_side[j][i][0]) + fabs(d_side[j][i][1])) / 2.;
2695 d[i][j] /=
sqrt(errDef * 2.);
2696 if (isFixed[i] || isFixed[j])
continue;
2702 TMatrixDSym G(ndim);
2705 for (
unsigned int i = 0; i < par.size(); i++) {
2706 if (isFixed[i])
continue;
2708 for (
unsigned int j = 0; j < par.size(); j++) {
2709 if (isFixed[j])
continue;
2710 if (i == j) TMatrixDRow(G, ir)[ic] = 1. / d[i][j] / d[i][j];
2711 else TMatrixDRow(G, ir)[ic] = 1. / d[i][j] / d[i][j] - 1. / d[i][i] / d[i][i] / 2. - 1. / d[j][j] / d[j][j] / 2. ;
2719 const TMatrixDSymEigen eigen(G);
2721 TVectorD eigenVal = eigen.GetEigenValues();
2722 double MaxEigenVal = -1.e10, MinEigenVal = 1.e10;
2723 for (
int i = 0; i < ndim; i++) {
2724 if (eigenVal[i] < MinEigenVal) MinEigenVal = eigenVal[i];
2725 if (eigenVal[i] > MaxEigenVal) MaxEigenVal = eigenVal[i];
2729 printf(
" Max/Min eigen value %5.2lf %5.2lf \n", MaxEigenVal, MinEigenVal);
2731 if (MinEigenVal <= 0.)
return 2;
2736 TMatrixD ErrMatrix = G;
2739 bool ok_errors =
true;
2740 for (
int i = 0; i < ndim; i++)
2741 if (TMatrixDRow(ErrMatrix, i)[i] < 0.) ok_errors =
false;
2742 if (!ok_errors)
return 2;
2745 printf(
" \n\n Errors : ");
2747 for (
unsigned int ipar = 0; ipar < par.size(); ipar++) {
2748 if (isFixed[ipar]) epar[ipar] = 0.;
2750 epar[ipar] =
sqrt(TMatrixDRow(ErrMatrix, ii)[ii]);
2754 printf(
" %5.2lf %5.2lf %5.2lf (%5.2lf) | ", epar[ipar]*
unit[ipar], d_side[ipar][ipar][0]*
unit[ipar], d_side[ipar][ipar][1]*
unit[ipar], epar[ipar]);
2762 std::string MatrixName[2] = {
" Covariance Matrix",
"Error Matrix"};
2763 for (
int iloop = 0; iloop < 2; iloop++) {
2764 printf(
"%s \n", MatrixName[iloop].c_str());
2765 printf(
"-----------------------------\n");
2766 for (
int ir = 0; ir < ndim; ir++) {
2767 for (
int ic = 0; ic < ndim; ic++) {
2769 if (iloop == 0) val = TMatrixDRow(G, ir)[ic];
2770 if (iloop == 1) val = TMatrixDRow(ErrMatrix, ir)[ic];
2771 printf(
" %5.2lf ", val);
2777 printf(
" FCN calls calculating errors %d Ok=%d \n", ok_range,
recinfo.
nFCNcalls - nFCNcalls_start);
bool SetFitStage(int FitStage)
UnivParamTimeNS::UnivParamTime * ftime[nDetectorType]
float NormalizeAngle(const float angle)
bool ScanRange(int iparX, int iparY, std::vector< double > par, std::vector< int > parStatus, double *rangeX, double *rangeY, double *d, double RotAngle, double errDef, double InitStep, double &edm)
const bool UseDiffusive[4]
bool IsSaturated[nDetectorType]
UnivCalibConstantsNS::UnivCalibConstants * fcalib
double GetLikelihood(std::vector< double > par, std::vector< int > status)
void InitRecStation(RecStation *station)
double GetMeanNmu(double logE, double theta)
float Get_DX_DL(float r, float psi, float SlantDepth, float theta, float hground, bool UseDL, bool IsDiffusive)
const double ParameterizationRMSLimit
double GetSignalLikelihood()
void Unrotate(double l_p, double m_p, double &theta, double &azi)
const double vemTimeCut[nQ]
UnivParamNS::UnivParam * fsignal[nDetectorType]
double GetD_TO(double X, double theta, double logE, int icomp)
void GetResiduals(std::vector< double > &mean, std::vector< double > &rms, std::vector< double > &rec, int optY, std::vector< double > &fx, int optX, bool OnlyNotSaturated)
int InitFCNParameters(std::vector< double > &par, std::vector< double > &epar, std::vector< int > &status, std::vector< bool > &hasLimits)
void PrintRecInfo(bool PrintResiduals)
const bool XmaxShift_time[4]
bool GetRecEstimate(int itype)
double tQuantilePDF(double *t0, double *m, double *s, double *fcomp, double vemTot, double ti, double f, bool UseApprox, double pf, double &mean, double &rms)
double pow(const double x, const unsigned int i)
double GetMeanXmax(double logE)
void Chi2(int &, double *const , double &value, double *const par, const int)
const double AreaOverPeak_Run[nAoP]
const double rStartCut[2]
double GetSignal(double r, double XmaxEdep, double logE, double theta, double psi, double rhoGround, double hGround, double Nmu, int icomp0, int iatm)
float GetTimeCF_h(float r, float psi, float h1, float theta, float hground)
A TimeStamp holds GPS second and nanosecond for some event.
static const int nRecMixtures
bool UseGausPDF_quantiles[nQ]
AtmosphereNS::Atmosphere * fatm
void SetAllSPCoordinates()
float GetDensity(float h)
const double rSignalCut[2]
void GetRecSeed(int itype)
float DistPoints(float x1, float y1, float x2, float y2)
const double SaturationLevelMD
const double SmearingAngle
bool RWRecinfo(FILE *fp, bool RWStations, bool readFlag)
void SetSPCoordinates(int idet)
const int nTimeStationsMin
void ScanLikelihood(int iparX, int iparY, int N, std::vector< std::pair< double, double > > &parXY, std::vector< double > &lnP, std::pair< double, double > &parXY_min, double &lnP_min)
double GetTimeLikelihood()
double tStartCorrection(double r, double logE, double theta, bool Is8nsFADC)
void SaveFCNParameters(std::vector< double > par, std::vector< int > status)
const double SaturationLevelVEM_WCD[2]
bool Check_DX_DL(RecStation *)
bool InitRec_InternalFramework(bool RecInfill, int RecDataSet, int year, std::string &FileName, bool RecSDEUpgrade, int RecAoP)
std::vector< RecStation_t > fstation
void SetT0FromHot(bool UseT0_relative, double T0_relative)
const double StartAccuracyAMIGA
const double StartAccuracy[2]
int GetErrors(std::vector< double > par, std::vector< double > &epar, std::vector< int > parStatus)
float SlantDepthToHeight(float sdepth, float theta)
double RFunc(double r, int icomp, int iparDX)
double GetLogE(double vem, double r, double XmaxEdep, double theta, double psi, double rhoGround, double hGround, double Nmu, int iatm)
void GetChi2(double *Chi2, int *nChi2)
void GetMeanRMS_AoP(double &mean, double &rms)
const bool UseDiffusive_time[4]
const double edm_tolerance
const bool UseStartTimeOnlyWhenSaturated
static const double fXmaxSys_Auger[nSys]
bool gDetectorTypeMask[nDetectorType]
const double rQuantileCut[2]
float GetTimePF_h(float r, float psi, float hStart, float theta, float hground)
const int nSignalStationsMin
double tFirstPDF(double t0_mu, double m_mu, double s_mu, double npart, double t, bool UseApprox, double &mean, double &rms)
const double vemSignalCut
bool InitRec(bool IsData, int RecType, int CalibOpt, int RecDetector, int RecSys, int RecMixture)
static std::vector< int > parStatus
bool RejectTimeOutliers()
double GetTime(double *DL, double r, double logE, double psi, double theta, double *fcomp, double *t0, double fi)
bool PlaneFit(bool CurvCorr, bool AltitudeCorr, bool RecSeed, int itype)
const double InterGPSAccuracy[2]
void SetCurrentAtmosphere(AtmModel theAtm)
double tQuantileCorrection_AoP(double RiseTime, int iq, double AoP)
int GetCurrentAtmosphereMonth()
void WriteTextFile(FILE *fp)
double tQuantileCorrection(double NanoSecPerVEM, int iq)
static const double fEnergySys_Auger[nSys]
double GetOffsetM_Mu(double theta)
const double SaturationLevelVEM_Scin[2]
bool CheckEnergyCut(bool PrintOut)