11 #include <det/Detector.h>
13 #include <evt/Event.h>
14 #include <evt/ShowerFRecData.h>
15 #include <evt/ShowerRecData.h>
17 #include <fdet/Channel.h>
19 #include <fdet/FDetector.h>
20 #include <fdet/FTimeFitModel.h>
21 #include <fdet/Pixel.h>
22 #include <fdet/Telescope.h>
25 #include <fevt/EyeHeader.h>
26 #include <fevt/EyeRecData.h>
27 #include <fevt/FdComponentSelector.h>
28 #include <fevt/FEvent.h>
29 #include <fevt/Pixel.h>
30 #include <fevt/PixelRecData.h>
31 #include <fevt/Telescope.h>
32 #include <fevt/TelescopeRecData.h>
34 #include <fwk/CentralConfig.h>
35 #include <fwk/LocalCoordinateSystem.h>
36 #include <fwk/VModule.h>
38 #include <sdet/SDetector.h>
40 #include <sevt/SEvent.h>
41 #include <sevt/Station.h>
43 #include <utl/AxialVector.h>
44 #include <utl/CoordinateSystemPtr.h>
45 #include <utl/CorrelationMatrix.h>
46 #include <utl/ErrorLogger.h>
47 #include <utl/MathConstants.h>
48 #include <utl/NumericalErrorPropagation.h>
49 #include <utl/Point.h>
50 #include <utl/PhysicalConstants.h>
51 #include <utl/Reader.h>
52 #include <utl/ReferenceEllipsoid.h>
53 #include <utl/TimeStamp.h>
54 #include <utl/TimeInterval.h>
55 #include <utl/Transformation.h>
56 #include <utl/UTMPoint.h>
57 #include <utl/Vector.h>
71 namespace HybridGeometryFinderWG {
73 fevt::Eye* HybridGeometryFinder::fgCurEye = NULL;
76 vector<unsigned short int> HybridGeometryFinder::fgStationList;
78 int HybridGeometryFinder::fgHybridFitMode = 0;
79 unsigned int HybridGeometryFinder::fgNDofAxis = 0;
81 int HybridGeometryFinder::fgVerbosity = -1;
82 int HybridGeometryFinder::fgLaserShots = 0;
84 double HybridGeometryFinder::fgVerticalCurvature = 0.0001111 /
utl::m;
85 double HybridGeometryFinder::fgSDPError = 0.35 *
utl::degree;
87 double HybridGeometryFinder::fgCoreHeight = 1400. *
utl::m;
98 ERROR(
"Could not find branch HybridGeometryFinderWG");
116 switch (fTimeFitModel) {
124 ERROR(
"Invalid input parameter for TimeFitModel");
129 if (fgVerbosity >= 0) {
132 << GetVersionInfo(VModule::eRevisionNumber) <<
"\n";
133 info <<
" Verbosity level: " << fgVerbosity <<
"\n";
134 info <<
" SDP Error: " << fgSDPError <<
"\n";
135 info <<
" Time Fit Model: " << fTimeFitModel <<
"\n";
136 info <<
" Minimum number of pixels for axis fit: " << fAxisMinPixel <<
"\n";
137 info <<
" Maximal difference in Chi_i for the axis: " << fMaxSDPDist <<
"\n";
138 info <<
" Vertical curvature: " << fgVerticalCurvature <<
"\n";
139 info <<
" Maximal Axis-Station Distance: " << fMaxStationToSDPDist <<
"\n";
140 info <<
" Maximal Time Residue: " << fMaxTimeResidue <<
"\n";
141 info <<
" Reconstruct laser shots: " << fgLaserShots <<
"\n";
142 info <<
" Allow Fd Only: " << fFdOnly <<
"\n";
156 INFO(
"Run HybridGeometryFinderWG");
159 if (fgVerbosity >= 0) {
160 INFO(
"This event has no FEvent --- Skip event!");
162 return eContinueLoop;
166 if (fgVerbosity >= 0) {
167 INFO(
"This event has no SEvent --- Skip event!");
180 if (fgVerbosity >= 0) {
182 info <<
"\n Start reconstructing eye " << eyeIter->GetId() <<
"\n";
187 fgCurEye = &*eyeIter;
188 const fdet::Eye& detEye = det::Detector::GetInstance().GetFDetector().GetEye(*fgCurEye);
189 bool foundAxis =
false;
191 if (!fgCurEye->HasRecData())
194 if (fgCurEye->GetRecData().GetNPulsedPixels() < fAxisMinPixel) {
195 if (fgVerbosity >= 0) {
197 info <<
"There are not enough pulsed pixels (";
198 info << fgCurEye->GetRecData().GetNPulsedPixels();
200 info << fAxisMinPixel;
201 info <<
") for an axis fit in eye ";
202 info << fgCurEye->
GetId();
203 info <<
" --- jump to next eye!";
211 const int prevEye = GetDataFromPreviousFit();
213 if (fgVerbosity >= 0) {
214 INFO(
"Could not find results from previous fits --- jump to next eye!");
219 else if (!(SelectHybridStation(prevEye)
222 if (fgVerbosity >= 0) {
223 INFO(
"No hybrid station found --- jump to next eye!");
230 CalculateGeometryForTels();
236 if (fgCurEye->GetRecData().GetNTimeFitPixels() < fAxisMinPixel) {
237 if (fgVerbosity >= 0) {
239 info <<
"There are not enough time fit pixels (";
240 info << fgCurEye->GetRecData().GetNTimeFitPixels();
242 info << fAxisMinPixel;
243 info <<
") for an axis fit in eye ";
244 info << fgCurEye->GetId();
245 info <<
" --- jump to next eye!";
269 CalculateGeometryForTels();
272 RecalculateChiSquare();
275 while (ReadmitPixel()) {
281 CalculateGeometryForTels();
283 RecalculateChiSquare();
287 while (RemovePixel()) {
293 CalculateGeometryForTels();
295 RecalculateChiSquare();
300 if (fgVerbosity >= 0) {
302 info <<
"No axis for eye " << eyeIter->GetId() <<
" found --- jump to next eye.";
320 HybridGeometryFinder::Finish()
329 HybridGeometryFinder::GetDataFromPreviousFit()
332 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
335 set<unsigned int> eyeIds;
343 if (fevent.
HasEye(eyeIter->GetId())) {
344 eyeIds.insert(eyeIter->GetId());
354 bool hasData =
false;
355 if (fgCurEye->HasRecData()) {
356 if ((fgCurEye->GetRecData().HasFRecShower()) && (fgCurEye->GetRecData().GetRp() != 0.)) {
361 if (hasData && fPassThrough) {
362 eyeIds.insert(fgCurEye->GetId());
370 if (fevent.
HasEye(eyeIter->GetId())) {
371 eyeIds.insert(eyeIter->GetId());
379 int maxNFitPixels = 0;
380 unsigned int maxNFitPixelsId = 0;
381 for (set<unsigned int>::const_iterator IdIter = eyeIds.begin();
382 IdIter != eyeIds.end();
396 if (nFitPixels > maxNFitPixels) {
397 maxNFitPixels = nFitPixels;
398 maxNFitPixelsId = *IdIter;
401 if (fgVerbosity >= 2) {
402 cout <<
"Eye " << *IdIter <<
" has " << nFitPixels <<
" pixels in the time fit" << endl;
408 if (maxNFitPixelsId != 0) {
409 takeFromEye = maxNFitPixelsId;
415 const fdet::Eye& detEye = det::Detector::GetInstance().GetFDetector().GetEye(takeFromEye);
416 fevt::Eye& eventEye = fEvent->GetFEvent().GetEye(takeFromEye);
436 fCore -= fAxis * (coreHeight - fgCoreHeight) / fAxis.GetZ(coreCS);
446 ERROR (
"UTMZoneException: core invalid");
450 ERROR (
"UTMException: core invalid");
456 const bool downGoing = fAxis.GetTheta(coreCS) <
utl::kPiOnTwo;
467 if (pointRp.
GetZ(coreCS) > fCore.GetZ(coreCS)) {
485 fAxisTheta = fAxis.GetTheta(coreCS);
486 fAxisPhi = fAxis.GetPhi(coreCS);
489 if (fgVerbosity >= 1) {
490 cout <<
"The following parameters from the previous fits in eye "
492 <<
" are taken as first guess\n"
496 <<
" Core(Northing) = " << fNorthing /
utl::m <<
"m,\n"
497 <<
" Core(Easting) = " << fEasting /
utl::m <<
"m,\n"
498 <<
" Core(Altitude) = " << height /
utl::m <<
"m,\n"
499 <<
" AxisTheta(coreCS) = " << fAxisTheta /
utl::degree <<
"deg,\n"
500 <<
" AxisPhi(coreCS) = " << fAxisPhi /
utl::degree <<
"deg,\n"
501 <<
" SDPsTheta(coreCS) = " <<
fSDP.GetTheta(coreCS) /
utl::degree <<
"deg,\n"
502 <<
" SDPsPhi(coreCS) = " <<
fSDP.GetPhi(coreCS) /
utl::degree <<
"deg,\n"
503 <<
" TCore = " << fTCore /
utl::ns <<
"ns,\n"
504 <<
" The Shower is " << (downGoing ?
"down-going" :
"up-going") << endl;
513 HybridGeometryFinder::CalculateGeometryForTels()
516 const fdet::Eye& detEye = det::Detector::GetInstance().GetFDetector().GetEye(fgCurEye->GetId());
521 const int telId = telIter->
GetId();
522 fTelParameters[telId] = CalculateAxisForTel(fCore, fAxis, fTCore, telId);
530 HybridGeometryFinder::CalculateAxisForTel(
const utl::Point core,
536 const utl::Point telPos = det::Detector::GetInstance().GetFDetector().GetEye(*fgCurEye).GetTelescope(telId).GetPosition();
557 const double rp = telToCore.
GetMag() * sin(chiZero);
572 double tZero = tCore;
573 if (pointRp.
GetZ(telCS) > core.
GetZ(telCS)) {
590 vector<double> returnValues;
592 returnValues.push_back(telCore.
GetX(telCS));
593 returnValues.push_back(telCore.
GetY(telCS));
594 returnValues.push_back(axis.
GetTheta(telCS));
595 returnValues.push_back(axis.
GetPhi(telCS));
596 returnValues.push_back(sdp.
GetTheta(telCS));
597 returnValues.push_back(sdp.
GetPhi(telCS));
598 returnValues.push_back(chiZero);
599 returnValues.push_back(tZero);
600 returnValues.push_back(rp);
608 HybridGeometryFinder::SelectPixels()
611 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
637 const int telId = pixelIter->GetTelescopeId();
640 const vector<double> parameters = fTelParameters[telId];
641 const double coreX = parameters[0];
642 const double coreY = parameters[1];
643 const double sdpTheta = parameters[4];
644 const double sdpPhi = parameters[5];
645 const double chiZero = parameters[6];
646 const double tZero = parameters[7];
647 const double rp = parameters[8];
653 const utl::Point core(coreX, coreY, 0, telCS);
656 const utl::Vector vertical(0, 0, 1, telCS, utl::Vector::kCartesian);
660 const utl::Vector pixelDirInSDP = pixelDirection - (sdp * pixelDirection) * sdp;
663 const double pixelChi =
utl::Angle(pixelDirInSDP, horizontalInSDP);
666 const double pixelTime = pixelIter->GetRecData().GetT_i().GetNanoSecond();
667 const double pixelTimeError = pixelIter->GetRecData().GetT_iError().GetInterval();
668 const double pixelTimeExpected = timeFitModel.
GetTimeAtAperture(tZero, rp, chiZero, pixelChi, sdp.
GetTheta(telCS), fgCurEye->GetId(), telId);
669 const double tmp = pixelTime - pixelTimeExpected;
670 const double timeResidue = tmp / pixelTimeError;
675 if ((
abs(timeResidue) < 6 * fMaxTimeResidue) && (angleWithSDP < fMaxSDPDist)) {
679 if (fgVerbosity >= 2) {
680 cout <<
"Pixel " << pixelIter->GetId()
681 <<
" in telescope " << pixelIter->GetTelescopeId()
682 <<
" has time=" << pixelTime <<
","
683 <<
" residue=" << timeResidue <<
","
686 if ((
abs(timeResidue) < 6 * fMaxTimeResidue) && (angleWithSDP < fMaxSDPDist)) {
687 cout <<
" be added to the time fit" << endl;
690 cout <<
" NOT be added to the time fit" << endl;
696 if (fgVerbosity >= 1) {
699 <<
" pixels selected for the time fit";
707 HybridGeometryFinder::SelectHybridStation(
const int prevEye)
711 fgStationList.clear();
715 fevt::EyeRecData& eyeRecData = fEvent->GetFEvent().GetEye(prevEye).GetRecData();
723 if (fgStationList.size() == 0 || fgStationList.at(0) == 9999) {
724 fgStationList.clear();
735 if (stationIter->GetId() == fgStationList.at(0)) {
736 fgFitStation = &*stationIter;
741 if (fgVerbosity >=1) {
743 info <<
"Use hybrid station "
744 << fgFitStation->GetId()
745 <<
" from previous fit";
755 HybridGeometryFinder::FitAxis()
759 const int nParameters = 5;
762 TMinuit theMinuit(nParameters);
765 theMinuit.SetPrintLevel(-1);
768 theMinuit.SetFCN(HybridGeometryFinder::MinuitFitFuncAxis);
771 double argList[nParameters];
776 theMinuit.mnexcm(
"SET ERR", argList, 1, errorFlag);
779 ERROR(
"Minuit SET ERR failed");
783 double startParameters[nParameters];
785 startParameters[0] = fNorthing;
786 startParameters[1] = fEasting;
787 startParameters[2] = fAxisTheta;
788 startParameters[3] = fAxisPhi;
789 startParameters[4] = fTCore;
792 double stepSize[nParameters];
801 theMinuit.mnparm(0,
"Northing", startParameters[0], stepSize[0], 0, 0, errorFlag);
802 theMinuit.mnparm(1,
"Easting", startParameters[1], stepSize[1], 0, 0, errorFlag);
803 theMinuit.mnparm(2,
"AxisTheta", startParameters[2], stepSize[2], 0, 0, errorFlag);
804 theMinuit.mnparm(3,
"AxisPhi", startParameters[3], stepSize[3], 0, 0, errorFlag);
805 theMinuit.mnparm(4,
"TCore", startParameters[4], stepSize[4], 0, 0, errorFlag);
814 theMinuit.mnexcm(
"MINIMIZE", argList, 2, errorFlag);
818 ERROR(
"Minuit MINIMIZE failed");
822 theMinuit.mnexcm(
"HESSE", argList, 2, errorFlag);
826 double fmin, fedm, errdef;
829 theMinuit.mnstat(fmin, fedm, errdef, npari, nparx, istat);
831 theMinuit.mnexcm(
"MINOS", argList, 2, errorFlag);
832 theMinuit.mnstat(fmin, fedm, errdef, npari, nparx, istat);
834 WARNING(
"Neither HESSE nor MINOS found accurate covariance matrix");
838 theMinuit.GetParameter(0, fNorthing, fNorthingError);
839 theMinuit.GetParameter(1, fEasting, fEastingError);
840 theMinuit.GetParameter(2, fAxisTheta, fAxisThetaError);
841 theMinuit.GetParameter(3, fAxisPhi, fAxisPhiError);
842 theMinuit.GetParameter(4, fTCore, fTCoreError);
843 theMinuit.mnemat(&fCovMatrixAxis[0][0], nParameters);
844 fChiSqAxis = theMinuit.fAmin;
851 const utl::UTMPoint UTMCore(fNorthing, fEasting, fgCoreHeight, 19,
'H', refEllipsoid);
860 if (fgVerbosity >= 1) {
862 info <<
"The parameters of the fitted axis for eye " << fgCurEye->GetId() <<
" are:" << endl
863 <<
" Northing = " << fNorthing /
utl::m
864 <<
" +/- " << fNorthingError /
utl::m <<
"m," << endl
865 <<
" Easting = " << fEasting /
utl::m
866 <<
" +/- " << fEastingError /
utl::m <<
"m," << endl
868 <<
" +/- " << fAxisThetaError /
utl::degree <<
"deg," << endl
870 <<
" +/- " << fAxisPhiError /
utl::degree <<
"deg," << endl
871 <<
" TCore = " << fTCore /
utl::ns
872 <<
" +/- " << fTCoreError /
utl::ns <<
"ns," << endl
873 <<
" ChiSquare / NDF = " << fChiSqAxis <<
" / " << fgNDofAxis
874 <<
" = " << fChiSqAxis / fgNDofAxis;
884 HybridGeometryFinder::MinuitFitFuncAxis(
int& ,
891 double northing = par[0];
892 double easting = par[1];
893 double axisTheta = par[2];
894 double axisPhi = par[3];
895 double tCore = par[4];
902 const utl::UTMPoint UTMCore(northing, easting, fgCoreHeight, 19,
'H', refEllipsoid);
912 map<int, vector<double> > telParameter;
917 const int telId = telIter->GetId();
919 telParameter[telId] = CalculateAxisForTel(core, axis, tCore, telId);
923 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
927 const int eyeId = fgCurEye->GetId();
931 double chiSquareTime = 0.;
932 double chiSquareSDP = 0.;
933 double chiSquareSD = 0.;
934 double totalCharge = 0.;
943 const int telId = pixelIter->GetTelescopeId();
944 const vector<double> parameters = telParameter[telId];
945 const double coreX = parameters[0];
946 const double coreY = parameters[1];
947 const double sdpTheta = parameters[4];
948 const double sdpPhi = parameters[5];
949 const double chiZero = parameters[6];
950 const double tZero = parameters[7];
951 const double rp = parameters[8];
963 const utl::Point core(coreX, coreY, 0, telCS);
965 const utl::Vector vertical(0, 0, 1, telCS, utl::Vector::kCartesian);
968 const utl::Vector pixelDirInSDP = pixelDirection - (sdp * pixelDirection) * sdp;
969 const double pixelChi =
utl::Angle(pixelDirInSDP, horizontalInSDP);
975 const double pixelTimeExpected = timeFitModel.
GetTimeAtAperture(tZero, rp, chiZero, pixelChi, sdp.
GetTheta(telCS), eyeId, telId);
977 const double tmp = pixelTime - pixelTimeExpected;
979 chiSquareTime += tmp * tmp / (pixelTimeError * pixelTimeError);
987 chiSquareSDP += angDistToSDP * angDistToSDP * pixelCharge / (fgSDPError * fgSDPError);
989 totalCharge += pixelCharge;
994 if (fgVerbosity >=2) {
995 cout <<
"Pixel no. " << pixelIter->GetId()
996 <<
" in Tel " << pixelIter->GetTelescopeId()
997 <<
" ChiSquareTime = " << tmp*tmp/(pixelTimeError*pixelTimeError) <<
","
998 <<
" ChiSquareSDP = " << angDistToSDP*angDistToSDP/(fgSDPError*fgSDPError) <<
","
999 <<
" charge = " << pixelCharge
1006 chiSquareSDP /= totalCharge;
1010 if (fgStationList.size() > 0 && fgFitStation != NULL && fgFitStation->HasRecData()) {
1015 const sdet::SDetector& detSD = det::Detector::GetInstance().GetSDetector();
1020 const utl::Vector coreToStation = stationPos - core;
1021 const double axisCoreStationAngle =
utl::Angle(axis, coreToStation);
1022 const double deltaStationAxis = coreToStation.
GetMag() * sin(axisCoreStationAngle);
1028 const double deltaCoreRp = coreToStation.
GetMag() * cos(axisCoreStationAngle);
1031 if (fgHybridFitMode == 0) {
1032 chiSquareSD = coreToStation.
GetMag() * coreToStation.
GetMag() / (10 * 10);
1035 else if (fgHybridFitMode == 1) {
1043 double expectedStationTime = tCore - timeShift;
1051 const double curvature = fgVerticalCurvature * axis.
GetCosTheta(coreCS);
1052 const double timeDelay = curvature * deltaStationAxis * deltaStationAxis / (2 *
utl::kSpeedOfLight);
1053 expectedStationTime += timeDelay;
1058 double triggerTimeFD = fgCurEye->GetHeader().GetTimeStamp().GetGPSNanoSecond();
1062 triggerTimeFD -= numberFADCBins * lengthFADCBin;
1064 expectedStationTime += triggerTimeFD;
1070 expectedStationTime += 180 *
utl::ns;
1077 double timeSD = fgFitStation->GetRecData().GetSignalStartTime().GetGPSNanoSecond();
1078 const int secondFD = fgCurEye->GetHeader().GetTimeStamp().GetGPSSecond();
1079 const int secondSD = fgFitStation->GetRecData().GetSignalStartTime().GetGPSSecond();
1080 if (secondSD > secondFD) {
1083 if (secondSD < secondFD) {
1088 const double timeDiff = timeSD - expectedStationTime;
1090 const double timeErr = 100. *
utl::ns;
1092 chiSquareSD = timeDiff * timeDiff / (timeErr * timeErr);
1101 double chiSquare = chiSquareTime + chiSquareSDP + chiSquareSD;
1106 if (fgVerbosity >= 2) {
1107 cout <<
"Minuit Run Axis FD:"
1108 <<
" Northing = " << northing /
utl::m <<
","
1109 <<
" Easting = " << easting /
utl::m <<
","
1110 <<
" AxisTheta = " << axisTheta /
utl::degree <<
","
1112 <<
" TCore = " << tCore /
utl::ns <<
","
1113 <<
" ChiSquareTime = " << chiSquareTime <<
","
1114 <<
" ChiSquareSDP = " << chiSquareSDP <<
","
1115 <<
" ChiSquareSD = " << chiSquareSD <<
","
1116 <<
" ChiSquare = " << chiSquare <<
","
1117 <<
" NDF = " << fgNDofAxis
1125 HybridGeometryFinder::RecalculateChiSquare()
1133 const utl::UTMPoint UTMCore(fNorthing, fEasting, fgCoreHeight, 19,
'H', refEllipsoid);
1142 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
1146 const int eyeId = fgCurEye->GetId();
1152 double chiSquareTime = 0.;
1153 double chiSquareSDP = 0.;
1154 double chiSquareSD = 0.;
1155 double totalCharge = 0.;
1157 map<int, double> totalChargePerTel;
1158 map<int, int> pixelPerTel;
1165 int telId = telIter->GetId();
1167 totalChargePerTel[telId] = 0.;
1168 fChiSqAxisPerTel[telId] = 0.;
1169 fNDofAxisPerTel[telId] = 0;
1170 fChiSqTimePerTel[telId] = 0.;
1171 fNDofTimePerTel[telId] = 0;
1172 fChiSqSDPPerTel[telId] = 0.;
1173 fNDofSDPPerTel[telId] = 0;
1184 const int telId = pixelIter->GetTelescopeId();
1185 const vector<double> parameters = fTelParameters[telId];
1186 const double coreX = parameters[0];
1187 const double coreY = parameters[1];
1188 const double sdpTheta = parameters[4];
1189 const double sdpPhi = parameters[5];
1190 const double chiZero = parameters[6];
1191 const double tZero = parameters[7];
1192 const double rp = parameters[8];
1204 const utl::Point core(coreX, coreY, 0, telCS);
1206 const utl::Vector vertical(0, 0, 1, telCS, utl::Vector::kCartesian);
1209 const utl::Vector pixelDirInSDP = pixelDirection - (sdp * pixelDirection) * sdp;
1210 const double pixelChi =
utl::Angle(pixelDirInSDP, horizontalInSDP);
1216 const double pixelTimeExpected = timeFitModel.
GetTimeAtAperture(tZero, rp, chiZero, pixelChi, sdp.
GetTheta(telCS), eyeId, telId);
1218 const double tmp = pixelTime - pixelTimeExpected;
1220 const double chiSquareTimePart = tmp * tmp / (pixelTimeError * pixelTimeError);
1221 chiSquareTime += chiSquareTimePart;
1222 fChiSqTimePerTel[telId] += chiSquareTimePart;
1230 const double chiSquareSDPPart = angDistToSDP * angDistToSDP * pixelCharge / (fgSDPError * fgSDPError);
1231 chiSquareSDP += chiSquareSDPPart;
1232 fChiSqSDPPerTel[telId] += chiSquareSDPPart;
1234 totalCharge += pixelCharge;
1235 totalChargePerTel[telId] += pixelCharge;
1236 ++(fNDofTimePerTel[telId]);
1237 ++(fNDofSDPPerTel[telId]);
1238 fNDofAxisPerTel[telId] += 2;
1246 if (totalCharge != 0)
1247 chiSquareSDP /= totalCharge;
1253 for (map<int, double>::iterator iter = fChiSqSDPPerTel.begin();
1254 iter != fChiSqSDPPerTel.end();
1257 if (totalChargePerTel[iter->first] != 0)
1258 iter->second /= totalChargePerTel[iter->first];
1259 iter->second *= fNDofTimePerTel[iter->first];
1263 double deltaStationAxis = 0.;
1265 if (fgStationList.size() > 0 && fgFitStation != NULL && fgFitStation->HasRecData()) {
1270 const sdet::SDetector& detSD = det::Detector::GetInstance().GetSDetector();
1275 const utl::Vector coreToStation = stationPos - core;
1276 const double axisCoreStationAngle =
utl::Angle(axis, coreToStation);
1277 deltaStationAxis = coreToStation.
GetMag() * sin(axisCoreStationAngle);
1283 const double deltaCoreRp = coreToStation.
GetMag() * cos(axisCoreStationAngle);
1292 double expectedStationTime = fTCore - timeShift;
1300 const double curvature = fgVerticalCurvature * axis.
GetCosTheta(coreCS);
1301 const double timeDelay = curvature * deltaStationAxis * deltaStationAxis / (2 *
utl::kSpeedOfLight);
1302 expectedStationTime += timeDelay;
1307 double triggerTimeFD = fgCurEye->GetHeader().GetTimeStamp().GetGPSNanoSecond();
1311 triggerTimeFD -= numberFADCBins * lengthFADCBin;
1313 expectedStationTime += triggerTimeFD;
1319 expectedStationTime += 180 *
utl::ns;
1327 double timeSD = fgFitStation->GetRecData().GetSignalStartTime().GetGPSNanoSecond();
1328 const int secondFD = fgCurEye->GetHeader().GetTimeStamp().GetGPSSecond();
1329 const int secondSD = fgFitStation->GetRecData().GetSignalStartTime().GetGPSSecond();
1330 if (secondSD > secondFD) {
1333 if (secondSD < secondFD) {
1339 const double timeDiff = timeSD - expectedStationTime;
1341 const double timeErr = 100. *
utl::ns;
1343 chiSquareSD = timeDiff * timeDiff / (timeErr * timeErr);
1344 fFitStationOffset = timeDiff;
1352 for (map<int, double>::iterator iter = fChiSqSDPPerTel.begin();
1353 iter != fChiSqSDPPerTel.end();
1356 fChiSqAxisPerTel[iter->first] = fChiSqTimePerTel[iter->first] + fChiSqSDPPerTel[iter->first] + chiSquareSD;
1358 if (fNDofAxisPerTel[iter->first] >= 5)
1359 fNDofAxisPerTel[iter->first] -= 5;
1361 fNDofAxisPerTel[iter->first] = 0;
1363 if (fNDofTimePerTel[iter->first] >= 3)
1364 fNDofTimePerTel[iter->first] -= 3;
1366 fNDofTimePerTel[iter->first] = 0;
1368 if (fNDofSDPPerTel[iter->first] >= 2)
1369 fNDofSDPPerTel[iter->first] -= 2;
1371 fNDofSDPPerTel[iter->first] = 0;
1375 fChiSqTime = chiSquareTime;
1377 fChiSqSDP = chiSquareSDP;
1379 fDeltaStationAxis = deltaStationAxis;
1385 HybridGeometryFinder::ReadmitPixel()
1392 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
1396 bool readmitted =
false;
1397 unsigned int countReadmitted = 0;
1403 bool inTimeFit =
false;
1408 if ((pixelIter2->GetId() == pixelIter->GetId()) && (pixelIter2->GetTelescopeId() == pixelIter->GetTelescopeId())) {
1419 const int telId = pixelIter->GetTelescopeId();
1421 const vector<double> parameters = fTelParameters[telId];
1422 const double coreX = parameters[0];
1423 const double coreY = parameters[1];
1424 const double sdpTheta = parameters[4];
1425 const double sdpPhi = parameters[5];
1426 const double chiZero = parameters[6];
1427 const double tZero = parameters[7];
1428 const double rp = parameters[8];
1434 const utl::Point core(coreX, coreY, 0, telCS);
1437 const utl::Vector vertical(0, 0, 1, telCS, utl::Vector::kCartesian);
1441 const utl::Vector pixelDirInSDP = pixelDirection - (sdp * pixelDirection) * sdp;
1444 const double pixelChi =
utl::Angle(pixelDirInSDP, horizontalInSDP);
1447 const double pixelTime = pixelIter->GetRecData().GetT_i().GetNanoSecond();
1448 const double pixelTimeError = pixelIter->GetRecData().GetT_iError().GetInterval();
1449 const double pixelTimeExpected = timeFitModel.
GetTimeAtAperture(tZero, rp, chiZero, pixelChi, sdp.
GetTheta(telCS), fgCurEye->GetId(), telId);
1450 const double tmp = pixelTime - pixelTimeExpected;
1451 const double timeResidue = tmp / pixelTimeError;
1456 if ((
abs(timeResidue) < 3 * fMaxTimeResidue) && (angleWithSDP < fMaxSDPDist)) {
1462 if (fgVerbosity >= 2) {
1463 cout <<
"Pixel " << pixelIter->GetId()
1464 <<
" in telescope " << pixelIter->GetTelescopeId()
1465 <<
" has time=" << pixelTime <<
","
1466 <<
" residue=" << timeResidue <<
","
1469 if ((
abs(timeResidue) < 3 * fMaxTimeResidue) && (angleWithSDP < fMaxSDPDist)) {
1470 cout <<
" be readmitted." << endl;
1473 cout <<
" NOT be readmitted." << endl;
1479 if (readmitted && fgVerbosity >= 1) {
1482 <<
" pixels for the axis fit"
1483 <<
" --- " << countReadmitted <<
" are readmitted.";
1493 HybridGeometryFinder::RemovePixel()
1496 bool removed =
false;
1498 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
1502 const int eyeId = fgCurEye->GetId();
1507 double maxTimeResidue = 0.;
1508 int maxTimeResiduePixel = -1;
1509 int maxTimeResidueTel = -1;
1518 const int telId = pixelIter->GetTelescopeId();
1519 const vector<double> parameters = fTelParameters[telId];
1520 const double coreX = parameters[0];
1521 const double coreY = parameters[1];
1522 const double sdpTheta = parameters[4];
1523 const double sdpPhi = parameters[5];
1524 const double chiZero = parameters[6];
1525 const double tZero = parameters[7];
1526 const double rp = parameters[8];
1537 const utl::Point core(coreX, coreY, 0, telCS);
1539 const utl::Vector vertical(0, 0, 1, telCS, utl::Vector::kCartesian);
1542 const utl::Vector pixelDirInSDP = pixelDirection - (sdp * pixelDirection) * sdp;
1543 const double pixelChi =
utl::Angle(pixelDirInSDP, horizontalInSDP);
1546 const double pixelTimeExpected = timeFitModel.
GetTimeAtAperture(tZero, rp, chiZero, pixelChi, sdp.
GetTheta(telCS), eyeId, telId);
1548 const double tmp = pixelTime - pixelTimeExpected;
1549 const double timeResidue =
abs(tmp / pixelTimeError);
1552 if (timeResidue > maxTimeResidue) {
1553 maxTimeResidue = timeResidue;
1554 maxTimeResiduePixel = pixelIter->GetId();
1555 maxTimeResidueTel = telId;
1558 if (fgVerbosity >= 2) {
1559 cout <<
"Pixel " << pixelIter->GetId()
1560 <<
" in Telescope " << pixelIter->GetTelescopeId()
1561 <<
" has Residue = " << timeResidue << endl;
1566 if ((maxTimeResidue > fMaxTimeResidue) && (eyeRecData.
GetNTimeFitPixels() > fAxisMinPixel)) {
1570 if ((
int(pixelIter->GetId()) == maxTimeResiduePixel)
1571 && (int(pixelIter->GetTelescopeId()) == maxTimeResidueTel)) {
1582 if (removed && fgVerbosity >= 1) {
1584 info <<
"Pixel " << maxTimeResiduePixel
1585 <<
" in Telescope " << maxTimeResidueTel
1586 <<
" is removed from the time fit due to its time residue of " << maxTimeResidue;
1596 HybridGeometryFinder::StoreData()
1617 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
1621 vector<utl::Parameter> fitParameterAndErrors;
1622 fitParameterAndErrors.push_back(
utl::Parameter(fNorthing, fNorthingError));
1623 fitParameterAndErrors.push_back(
utl::Parameter(fEasting, fEastingError));
1624 fitParameterAndErrors.push_back(
utl::Parameter(fAxisTheta, fAxisThetaError));
1625 fitParameterAndErrors.push_back(
utl::Parameter(fAxisPhi, fAxisPhiError));
1626 fitParameterAndErrors.push_back(
utl::Parameter(fTCore, fTCoreError));
1628 vector<double> fitParameter;
1629 fitParameter.push_back(fNorthing);
1630 fitParameter.push_back(fEasting);
1631 fitParameter.push_back(fAxisTheta);
1632 fitParameter.push_back(fAxisPhi);
1633 fitParameter.push_back(fTCore);
1636 fitCorrelations.
Set(0, 1, fCovMatrixAxis[0][1]/(fNorthingError*fEastingError));
1637 fitCorrelations.
Set(0, 2, fCovMatrixAxis[0][2]/(fNorthingError*fAxisThetaError));
1638 fitCorrelations.
Set(0, 3, fCovMatrixAxis[0][3]/(fNorthingError*fAxisPhiError));
1639 fitCorrelations.
Set(0, 4, fCovMatrixAxis[0][4]/(fNorthingError*fTCoreError));
1640 fitCorrelations.
Set(1, 2, fCovMatrixAxis[1][2]/(fEastingError*fAxisThetaError));
1641 fitCorrelations.
Set(1, 3, fCovMatrixAxis[1][3]/(fEastingError*fAxisPhiError));
1642 fitCorrelations.
Set(1, 4, fCovMatrixAxis[1][4]/(fEastingError*fTCoreError));
1643 fitCorrelations.
Set(2, 3, fCovMatrixAxis[2][3]/(fAxisThetaError*fAxisPhiError));
1644 fitCorrelations.
Set(2, 4, fCovMatrixAxis[2][4]/(fAxisThetaError*fTCoreError));
1645 fitCorrelations.
Set(3, 4, fCovMatrixAxis[3][4]/(fAxisPhiError*fTCoreError));
1657 const unsigned int telId = telIter->GetId();
1660 if ((telPos - eyePos).GetMag2() < 1.*
utl::m) {
1664 const vector<double> parameters = fTelParameters[telId];
1665 const double coreX = parameters[0];
1666 const double coreY = parameters[1];
1667 const double axisTheta = parameters[2];
1668 const double axisPhi = parameters[3];
1669 const double sdpTheta = parameters[4];
1670 const double sdpPhi = parameters[5];
1671 const double chiZero = parameters[6];
1672 const double tZero = parameters[7];
1673 const double rp = parameters[8];
1683 const double chiZeroError = axisParameterErrors[0];
1684 const double tZeroError = axisParameterErrors[1];
1685 const double rpError = axisParameterErrors[2];
1686 const double sdpThetaError = axisParameterErrors[3];
1687 const double sdpPhiError = axisParameterErrors[4];
1689 const double rTZeroRp = axisParameterCorrelations.
Get(1, 2);
1690 const double rChiZeroRp = axisParameterCorrelations.
Get(0, 2);
1691 const double rChiZeroTZero = axisParameterCorrelations.
Get(0, 1);
1692 const double rSDPThetaPhi = axisParameterCorrelations.
Get(3, 4);
1696 const utl::Point core(coreX, coreY, 0, telCS);
1702 eyeRecData.
SetChiZero(chiZero, chiZeroError);
1703 eyeRecData.
SetTZero(tZero, tZeroError);
1704 eyeRecData.
SetRp(rp, rpError);
1713 fitCorrelations.
Get(0, 2),
1714 fitCorrelations.
Get(0, 3),
1715 fitCorrelations.
Get(0, 4),
1716 fitCorrelations.
Get(1, 2),
1717 fitCorrelations.
Get(1, 3),
1718 fitCorrelations.
Get(1, 4),
1719 fitCorrelations.
Get(2, 3),
1720 fitCorrelations.
Get(2, 4),
1721 fitCorrelations.
Get(3, 4));
1725 if (!fEvent->HasRecShower()) {
1726 fEvent->MakeRecShower();
1741 double tCore = tZero;
1743 utl::TimeStamp timeAtCore = fgCurEye->GetHeader().GetTimeStamp() -
1748 if (fgStationList.size() > 0) {
1758 if (fgVerbosity >= 0) {
1760 info <<
"The following data for eye " << fgCurEye->GetId()
1761 <<
" is stored:" << endl
1762 <<
" Core: X(eyeCS) = " << coreX /
utl::m << endl
1763 <<
" Y(eyeCS) = " << coreY /
utl::m << endl
1764 <<
" Northing = " << fNorthing /
utl::m <<
" +/- " << fNorthingError /
utl::m << endl
1765 <<
" Easting = " << fEasting /
utl::m <<
" +/- " << fEastingError /
utl::m << endl
1766 <<
" Axis: Theta(coreCS) = " << fAxisTheta /
utl::degree <<
" +/- " << fAxisThetaError /
utl::degree << endl
1771 <<
" T0 = " << tZero /
utl::ns <<
" +/- " << tZeroError /
utl::ns << endl
1772 <<
" Rp = " << rp /
utl::m <<
" +/- " << rpError /
utl::m << endl
1773 <<
" TCore = " << tCore /
utl::ns << endl
1774 <<
" ChiSq / Ndf (Time) = " << fChiSqTime <<
" / " << fNDofTime << endl
1775 <<
" ChiSq / Ndf (SDP) = " << fChiSqSDP <<
" / " << fNDofSDP << endl
1776 <<
" ChiSq / Ndf (Axis) = " << fChiSqAxis <<
" / " << fgNDofAxis << endl;
1791 const int telId = telIter->GetId();
1796 const vector<double> parameters = fTelParameters[telId];
1797 const double coreX = parameters[0];
1798 const double coreY = parameters[1];
1799 const double axisTheta = parameters[2];
1800 const double axisPhi = parameters[3];
1801 const double sdpTheta = parameters[4];
1802 const double sdpPhi = parameters[5];
1803 const double chiZero = parameters[6];
1804 const double tZero = parameters[7];
1805 const double rp = parameters[8];
1815 const double chiZeroError = axisParameterErrors[0];
1816 const double tZeroError = axisParameterErrors[1];
1817 const double rpError = axisParameterErrors[2];
1818 const double sdpThetaError = axisParameterErrors[3];
1819 const double sdpPhiError = axisParameterErrors[4];
1821 const double rTZeroRp = axisParameterCorrelations.
Get(1, 2);
1822 const double rChiZeroRp = axisParameterCorrelations.
Get(0, 2);
1823 const double rChiZeroTZero = axisParameterCorrelations.
Get(0, 1);
1824 const double rSDPThetaPhi = axisParameterCorrelations.
Get(3, 4);
1828 const utl::Point core(coreX, coreY, 0, telCS);
1832 const utl::Vector vertical(0, 0, 1, telCS, utl::Vector::kCartesian);
1837 pixelIter != fgCurEye->GetRecData().PulsedPixelsEnd();
1840 if (
int(pixelIter->GetTelescopeId()) != telId) {
1845 const utl::Vector pixelDirInSDP = pixelDirection - (sdp * pixelDirection) * sdp;
1846 const double pixelChi =
utl::Angle(pixelDirInSDP, horizontalInSDP);
1848 pixelIter->GetRecData().SetChi_i(pixelChi);
1853 if (!telIter->HasRecData()) {
1854 telIter->MakeRecData();
1858 telRecData.
SetChiZero(chiZero, chiZeroError);
1859 telRecData.
SetTZero(tZero, tZeroError);
1860 telRecData.
SetRp(rp, rpError);
1869 fitCorrelations.
Get(0, 2),
1870 fitCorrelations.
Get(0, 3),
1871 fitCorrelations.
Get(0, 4),
1872 fitCorrelations.
Get(1, 2),
1873 fitCorrelations.
Get(1, 3),
1874 fitCorrelations.
Get(1, 4),
1875 fitCorrelations.
Get(2, 3),
1876 fitCorrelations.
Get(2, 4),
1877 fitCorrelations.
Get(3, 4));
1880 if (fgVerbosity >= 0) {
1882 info <<
"The following data for telescope " << telId
1883 <<
" is stored:" << endl
1884 <<
" Core: X(telCS) = " << coreX /
utl::m << endl
1885 <<
" Y(telCS) = " << coreY /
utl::m << endl
1886 <<
" Northing = " << fNorthing /
utl::m <<
" +/- " << fNorthingError /
utl::m << endl
1887 <<
" Easting = " << fEasting /
utl::m <<
" +/- " << fEastingError /
utl::m << endl
1888 <<
" Axis: Theta(coreCS) = " << fAxisTheta /
utl::degree <<
" +/- " << fAxisThetaError /
utl::degree << endl
1893 <<
" T0 = " << tZero /
utl::ns <<
" +/- " << tZeroError /
utl::ns << endl
1894 <<
" Rp = " << rp /
utl::m <<
" +/- " << rpError /
utl::m << endl
1895 <<
" ChiSq / Ndf (Time) = " << fChiSqTimePerTel[telId] <<
" / " << fNDofTimePerTel[telId] << endl
1896 <<
" ChiSq / Ndf (SDP) = " << fChiSqSDPPerTel[telId] <<
" / " << fNDofSDPPerTel[telId] << endl
1897 <<
" ChiSq / Ndf (Axis) = " << fChiSqAxisPerTel[telId] <<
" / " << fNDofAxisPerTel[telId] << endl;
1907 AxisParameterCalculator::operator() (
const vector<double>& input)
1911 const double northing = input[0];
1912 const double easting = input[1];
1913 const double axisTheta = input[2];
1914 const double axisPhi = input[3];
1915 const double tCore = input[4];
1923 const utl::UTMPoint UTMCore(northing, easting, fHybridFinder->fgCoreHeight, 19,
'H', refEllipsoid);
1934 const fevt::Eye& eye = *(fHybridFinder->fgCurEye);
1935 const unsigned int telId = fHybridFinder->fCurTelId;
1936 const utl::Point telPos = det::Detector::GetInstance().GetFDetector().GetEye(eye).GetTelescope(telId).GetPosition();
1949 double chiZero =
utl::Angle(axis, telToCore);
1952 const double rp = telToCore.
GetMag() * sin(chiZero);
1967 double tZero = tCore;
1968 if (pointRp.
GetZ(telCS) > core.
GetZ(telCS)) {
1985 vector<double> output;
1987 output.push_back(chiZero);
1988 output.push_back(tZero);
1989 output.push_back(rp);
1990 output.push_back(sdp.
GetTheta(telCS));
1991 output.push_back(sdp.
GetPhi(telCS));
AxialVector cross(const Vector &l, const Vector &r)
vector cross product
PixelIterator RemoveTimeFitPixel(PixelIterator it)
Remove a pixel from the list of Time Fit pixels.
const utl::Vector & GetDirection() const
pointing direction of this pixel
void SetChiZero(const double chiZero, const double error)
StationIterator StationsEnd()
End of all stations.
void SetSDPFitChiSquare(const double sdpChi2, const unsigned int ndof)
void SetSDPPhiError(const double sdpPhiError)
void SetModel(const Model m)
Description of the electronic channel for the 480 channels of the crate.
double GetPhi(const CoordinateSystemPtr &coordinateSystem) const
azimuth (phi) angle in spherical and cylindrical coordinates
Detector description interface for Station-related data.
void SetSDPFitChiSquare(const double sdpChi2, const unsigned int ndof)
fevt::EyeHeader & GetHeader()
Header for this Eye Event.
Fluorescence Detector Eye Event.
const std::vector< double > & GetPropagatedErrors() const
PixelIterator PulsedPixelsEnd()
Interface class to access Shower Reconstructed parameters.
const Pixel & GetPixel(const fevt::Pixel &eventPixel) const
Get fdet::Pixel from fevt::Channel.
Interface class to access to the SD part of an event.
double GetTheta(const CoordinateSystemPtr &coordinateSystem) const
zenith (theta) angle in spherical coordinates
void SetSDTimeResidual(const double time)
double GetChiZero() const
Class to hold and convert a point in geodetic coordinates.
void SetAxis(const utl::Vector &axis)
double GetCosTheta(const CoordinateSystemPtr &coordinateSystem) const
cos of zenith (theta) angle
std::vector< unsigned short int > & GetStationIds()
retrieve vector of station IDs used in hybrid fit
void SetCorePosition(const utl::Point &core)
const Channel & GetChannel(const unsigned int channelId) const
Get Channel by id, throw utl::NonExistentComponentException if n.a.
void SetTimeFitCorrelations(double rRpT0, double rRpChi0, double rChi0T0)
#define INFO(message)
Macro for logging informational messages.
void SetTimeFitCorrelations(const double rRpT0, const double rRpChi0, const double rChi0T0)
void SetRp(const double rp, const double error)
void Init()
Initialise the registry.
const Eye & GetEye(const unsigned int eyeId) const
Find eye by numerical Id.
EyeIterator EyesBegin(const FDetComponentSelector::Type type=FDetComponentSelector::ePhysical) const
iterator pointing to first eye of given type (ePhysical, eVirtual, eAll)
Detector description interface for Eye-related data.
boost::filter_iterator< ComponentSelector, AllEyeIterator > EyeIterator
selective Eye iterators
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
void AddSDPPixel(fevt::Pixel &pixel)
add a pixel to the list of SDP pixels
PixelIterator PulsedPixelsBegin()
double GetNorthing() const
Get the northing.
Report attempts to use invalid UTM zone.
Detector description interface for FDetector-related data.
A TimeStamp holds GPS second and nanosecond for some event.
boost::indirect_iterator< ConstInternalPixelIterator, const Pixel & > ConstPixelIterator
Const iterator over pixels used in reconstruction.
utl::Point GetPosition() const
Tank position.
void SetSDP(const utl::AxialVector &vec)
void SetAxisFitCorrelations(double northEast, double northTheta, double northPhi, double northTCore, double eastTheta, double eastPhi, double eastTCore, double thetaPhi, double thetaTCore, double phiTCore)
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
void Set(const int iPar, const int jPar, const double corr)
void SetAxisFitCorrelations(const double northEast, const double northTheta, const double northPhi, const double northTCore, const double eastTheta, const double eastPhi, const double eastTCore, const double thetaPhi, const double thetaTCore, const double phiTCore)
Class representing a document branch.
class to hold data at Station level
void MakeFRecShower()
Allocate reconstructed shower info.
Reference ellipsoids for UTM transformations.
PixelIterator SDPPixelsBegin()
boost::filter_iterator< FDetComponentSelector, AllEyeIterator > EyeIterator
double GetHeight() const
Get the height.
double GetX(const CoordinateSystemPtr &coordinateSystem) const
void SetCoreTime(const utl::TimeStamp &coreTime, const utl::TimeInterval &coreTimeErr)
utl::TimeInterval GetT_i() const
TelescopeIterator TelescopesBegin() const
Beginning of the collection of telescopes.
void SetAxis(const utl::Vector &axis)
double abs(const SVector< n, T > &v)
const Telescope & GetTelescope(const unsigned int telescopeId) const
Find Telescope by numerical Id.
bool HasFRecShower() const
Check if reconstructed shower info has been allocated.
evt::ShowerFRecData & GetFRecShower()
Reconstructed shower info for this eye.
void SetSDPCorrThetaPhi(double sdpCorrThetaPhi)
EyeIterator EyesBegin(const ComponentSelector::Status status)
Triple PointToLatitudeLongitudeHeight(const Point &thePoint) const
Convert Point to Lat/Long/Height.
void SetSDPPhiError(const double sdpPhiError)
void SetChiZero(const double chiZero, const double error)
const CorrelationMatrix & GetPropagatedCorrelations() const
unsigned int GetId() const
Eye numerical Id.
void SetTimeFitChiSquare(const double tfitChi2, const unsigned int ndof)
int GetFADCTraceLength() const
double GetEasting() const
Get the easting.
static const ReferenceEllipsoid & GetWGS84()
Get the auger standard ellipsoid: wgs84.
constexpr double kPiOnTwo
Telescope-specific shower reconstruction data.
void SetSDPThetaError(const double sdpThetaError)
boost::filter_iterator< ComponentSelector, AllTelescopeIterator > TelescopeIterator
selective Telescope iterators
static const CSpherical kSpherical
#define WARNING(message)
Macro for logging warning messages.
void GetData(bool &b) const
Overloads of the GetData member template function.
double Get(const int iPar, const int jPar) const
Top of Fluorescence Detector event hierarchy.
Eye-specific shower reconstruction data.
Eye & GetEye(const unsigned int eyeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
return Eye by id
void SetAxisFitChiSquare(const double globalChi2, const unsigned int ndof)
double GetInterval() const
Get the time interval as a double (in Auger base units)
const utl::AxialVector & GetSDP() const
boost::filter_iterator< TelIsCommissioned, InternalConstTelescopeIterator > TelescopeIterator
An iterator over telescopes.
fevt::FEvent & GetFEvent()
unsigned int GetNTimeFitPixels() const
Get number of Time Fit pixels.
bool HasEye(const unsigned int eyeId, const ComponentSelector::Status status=ComponentSelector::eHasData) const
boost::indirect_iterator< InternalPixelIterator, fevt::Pixel & > PixelIterator
Iterator over pixels used in reconstruction.
double GetY(const CoordinateSystemPtr &coordinateSystem) const
constexpr double kSpeedOfLight
A TimeInterval is used to represent time elapsed between two events.
ResultFlag
Flag returned by module methods to the RunController.
void SetAxisFitChiSquare(const double globalChi2, const unsigned int ndof)
Report problems in UTM handling.
double GetFADCBinSize() const
void SetTZero(const double tzero, const double error)
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
StationIterator StationsBegin()
Beginning of all stations.
double GetTotalCharge() const
integrated pulse charge
utl::Point GetPosition() const
void SetTimeFitChiSquare(const double tfitChi2, const unsigned int ndof)
PixelIterator TimeFitPixelsEnd()
double Angle(const Vector &left, const Vector &right)
Interface class to access to Fluorescence reconstruction of a Shower.
Detector description interface for SDetector-related data.
void SetSDPThetaError(const double sdpThetaError)
void SetRp(const double rp, const double error)
utl::TimeInterval GetT_iError() const
Main configuration utility.
void SetCorePosition(const utl::Point &core)
boost::indirect_iterator< InternalStationIterator, Station & > StationIterator
Iterator over all stations.
TelescopeIterator TelescopesEnd() const
End of the collection of telescopes.
void SetSDP(const utl::AxialVector &vec)
double GetTimeAtAperture(const double t0, const double rp, const double chi0, const double chi_i, const double thetaSDP, const int eye, const int tel) const
void SetTZero(const double tzero, const double error)
PixelIterator SDPPixelsEnd()
void AddTimeFitPixel(fevt::Pixel &pixel)
add a pixel to the list of Time Fit pixels
double GetZ(const CoordinateSystemPtr &coordinateSystem) const
const Station & GetStation(const int stationId) const
Get station by Station Id.
double GetNanoSecond() const
Get integer number of nanoseconds past seconds boundary.
static Policy::type Create(const utl::Point &theOrigin)
Create the standard local coordinate system for a Point.
PixelIterator TimeFitPixelsBegin()
Point GetPoint(const CoordinateSystemPtr &theCS=CoordinateSystemPtr()) const
Get a cartesian point from an UTMPoint.
#define ERROR(message)
Macro for logging error messages.
PixelIterator RemoveSDPPixel(PixelIterator it)
Remove a pixel from the list of SDP pixels.
const utl::Point & GetCorePosition() const
Shower core as reconstructed by the FD or FD eye.
Fluorescence Detector Pixel Reconstructed Data.
utl::Point GetPosition() const
Eye position.
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)
void SetSDPCorrThetaPhi(double sdpCorrThetaPhi)
void AddStationId(const unsigned short int id)
add a station id to the list of used hybrid stations
fevt::EyeRecData & GetRecData()
Reconstructed data for this eye.
bool IsVirtual() const
Returns whether this eye is a virtual eye.
EyeIterator EyesEnd(const FDetComponentSelector::Type type=FDetComponentSelector::ePhysical) const
iterator pointing to end of available eyes of given type (ePhysical, eVirtual, eAll) ...
const utl::Vector & GetAxis() const
Shower Axis as reconstructed by the FD or FD eye.