1 #include "InterferometricMap.h" 2 #include "AnalysisReco.h" 3 #include "InterferometryCache.h" 11 #include "UsefulAdu5Pat.h" 12 #include "RampdemReader.h" 13 #include "TruthAnitaEvent.h" 14 #include "TGraphAntarctica.h" 15 #include "TArrowAntarctica.h" 17 #include "AcclaimClustering.h" 21 std::vector<Double_t> coarseBinEdgesPhi;
22 std::vector<Double_t> fineBinEdgesPhi;
24 std::vector<Double_t> coarseBinEdgesTheta;
25 std::vector<Double_t> fineBinEdgesTheta;
26 Double_t bin0PhiDeg = -9999;
29 bool doneInitSVD =
false;
32 std::vector<Double_t> phiCenterCenterDegs;
46 void Acclaim::InterferometricMap::getDeltaBinRangeSVD(Int_t& dPhiBinLow, Int_t& dPhiBinHigh, Int_t& dThetaBinLow, Int_t& dThetaBinHigh){
47 dPhiBinLow = -NUM_BINS_QUAD_FIT_PHI/2;
48 dPhiBinHigh = dPhiBinLow + NUM_BINS_QUAD_FIT_PHI;
49 dThetaBinLow = -NUM_BINS_QUAD_FIT_THETA/2;
50 dThetaBinHigh = dThetaBinLow + NUM_BINS_QUAD_FIT_THETA;
68 const TDecompSVD& Acclaim::InterferometricMap::getSVD(){
73 const int nCoeffs = 6;
76 int firstBinPhi, lastBinPhi, firstBinTheta, lastBinTheta;
77 getDeltaBinRangeSVD(firstBinPhi, lastBinPhi, firstBinTheta, lastBinTheta);
80 TMatrixD A(NUM_BINS_QUAD_FIT_PHI*NUM_BINS_QUAD_FIT_THETA, nCoeffs);
83 for(
int i=firstBinPhi; i < lastBinPhi; i++){
84 const double dPhi = ZOOM_BIN_SIZE_PHI * i;
85 for(
int j=firstBinTheta; j < lastBinTheta; j++){
86 const double dTheta = ZOOM_BIN_SIZE_THETA * j;
87 A(row, 0) = dPhi*dPhi;
88 A(row, 1) = dTheta*dTheta;
89 A(row, 2) = dPhi*dTheta;
133 if(event == kButton1Double){
139 TH2D::ExecuteEvent(event, x, y);
154 if(phiCenterCenterDegs.size()==0){
156 Double_t aftForeOffset = geom->aftForeOffsetAngleVertical*TMath::RadToDeg();
158 Double_t phi0 = -aftForeOffset;
159 if(phi0 < -DEGREES_IN_CIRCLE/2){
160 phi0+=DEGREES_IN_CIRCLE;
162 else if(phi0 >= DEGREES_IN_CIRCLE/2){
163 phi0-=DEGREES_IN_CIRCLE;
166 for(
int phi=0; phi < NUM_PHI; phi++){
167 phiCenterCenterDegs.push_back(phi0 + PHI_RANGE*phi);
171 return phiCenterCenterDegs.at(phi);
183 if(bin0PhiDeg == -9999){
184 double phi0 = getPhiSectorCenterPhiDeg(0);
185 bin0PhiDeg = phi0 - PHI_RANGE/2;
200 if(coarseBinEdgesTheta.size()==0)
204 UInt_t nBinsTheta = NUM_BINS_THETA;
205 Double_t minTheta = MIN_THETA;
206 Double_t maxTheta = MAX_THETA;
209 Double_t sinThetaMin = sin(minTheta*TMath::DegToRad());
210 Double_t sinThetaMax = sin(maxTheta*TMath::DegToRad());
211 Double_t sinThetaRange = sinThetaMax - sinThetaMin;
212 Double_t dSinTheta = sinThetaRange/nBinsTheta;
215 coarseBinEdgesTheta.reserve(nBinsTheta+1);
216 for(
unsigned bt = 0; bt <= nBinsTheta; bt++){
217 Double_t thisSinTheta = sinThetaMin + bt*dSinTheta;
218 Double_t thisTheta = TMath::RadToDeg()*TMath::ASin(thisSinTheta);
220 coarseBinEdgesTheta.push_back(thisTheta);
223 return coarseBinEdgesTheta;
234 if(fineBinEdgesTheta.size()==0)
237 UInt_t nBinsTheta = NUM_BINS_THETA_ZOOM_TOTAL;
238 Double_t minTheta = MIN_THETA - THETA_RANGE_ZOOM/2;
239 Double_t maxTheta = MAX_THETA + THETA_RANGE_ZOOM/2;
241 Double_t dTheta = (maxTheta - minTheta) / nBinsTheta;
242 fineBinEdgesTheta.reserve(nBinsTheta+1);
243 for(
unsigned bt = 0; bt <= nBinsTheta; bt++){
244 double thisTheta = minTheta + bt*dTheta;
245 fineBinEdgesTheta.push_back(thisTheta);
248 return fineBinEdgesTheta;
262 if(coarseBinEdgesPhi.size()==0)
264 UInt_t nBinsPhi = NUM_BINS_PHI*NUM_PHI;
265 Double_t minPhi = getBin0PhiDeg();
266 Double_t dPhi = double(DEGREES_IN_CIRCLE)/nBinsPhi;
268 coarseBinEdgesTheta.reserve(nBinsPhi+1);
269 for(
unsigned bp = 0; bp <= nBinsPhi; bp++){
270 Double_t thisPhi = minPhi + dPhi*bp;
271 coarseBinEdgesPhi.push_back(thisPhi);
274 return coarseBinEdgesPhi;
286 if(fineBinEdgesPhi.size()==0)
290 UInt_t nBinsPhi = NUM_BINS_PHI_ZOOM_TOTAL;
291 Double_t minPhi = getBin0PhiDeg() - PHI_RANGE_ZOOM/2;
294 Double_t dPhi = double(DEGREES_IN_CIRCLE + PHI_RANGE_ZOOM)/nBinsPhi;
296 fineBinEdgesTheta.reserve(nBinsPhi+1);
297 for(
unsigned bp = 0; bp <= nBinsPhi; bp++){
298 Double_t thisPhi = minPhi + dPhi*bp;
299 fineBinEdgesPhi.push_back(thisPhi);
302 return fineBinEdgesPhi;
314 static unsigned defaultCounter = 0;
315 fName = TString::Format(
"hDefault%u", defaultCounter);
330 fName += TString::Format(
"%u_%u", peakIndex, eventNumber);
332 fTitle = TString::Format(
"Event %u ", eventNumber);
334 fTitle += TString::Format(
" Zoom Map - Peak %u", peakIndex);
339 fName += TString::Format(
"%u", eventNumber);
341 fTitle = TString::Format(
"Event %u ", eventNumber);
369 : fUsefulPat(NULL), truthLat(-9999), truthLon(-9999), truthAlt(-9999)
372 fPeakPhiSector = phiSector;
374 Double_t minPhiDesired = zoomCentrePhi - phiRange/2;
375 Double_t maxPhiDesired = zoomCentrePhi + phiRange/2;
380 getIndicesOfEdgeBins(fineBinsPhi, minPhiDesired, maxPhiDesired, minPhiBin, maxPhiBin);
384 Double_t minThetaDesired = zoomCentreTheta - thetaRange/2;
385 Double_t maxThetaDesired = zoomCentreTheta + thetaRange/2;
389 int maxThetaBin = -1;
390 getIndicesOfEdgeBins(fineBinsTheta, minThetaDesired, maxThetaDesired, minThetaBin, maxThetaBin);
394 SetBins(maxPhiBin - minPhiBin, &fineBinsPhi[minPhiBin], maxThetaBin - minThetaBin, &fineBinsTheta[minThetaBin]);
395 initializeInternals();
406 : fUsefulPat(NULL), truthLat(-9999), truthLon(-9999), truthAlt(-9999)
417 SetBins(coarseBinsPhi.size()-1, &coarseBinsPhi[0], coarseBinsTheta.size()-1, &coarseBinsTheta[0]);
419 initializeInternals();
432 void Acclaim::InterferometricMap::Reset(Option_t* opt){
500 std::vector<Int_t>* combosToUse = NULL;
501 Int_t binsPerPhiSector = GetNbinsPhi()/NUM_PHI;
502 for(Int_t phiSector = 0; phiSector < NUM_PHI; phiSector++){
505 Int_t startPhiBin = phiSector*binsPerPhiSector;
506 Int_t endPhiBin = startPhiBin + binsPerPhiSector;
508 for(UInt_t comboInd=0; comboInd<combosToUse->size(); comboInd++){
509 Int_t combo = combosToUse->at(comboInd);
513 for(Int_t phiBin = startPhiBin; phiBin < endPhiBin; phiBin++){
514 for(Int_t thetaBin = 0; thetaBin < GetNbinsTheta(); thetaBin++){
516 Int_t bin = (thetaBin+1)*(GetNbinsPhi()+2) + phiBin+1;
517 Double_t cInterp = cc->getCrossCorrelation(pol, combo, dtCache->
coarseDt(pol, combo, phiBin, thetaBin));
518 AddBinContent(bin,cInterp);
525 for(Int_t phiSector = 0; phiSector < NUM_PHI; phiSector++){
528 Double_t normFactor = cc->
kOnlyThisCombo < 0 && combosToUse->size() > 0 ? combosToUse->size() : 1;
532 Int_t startPhiBin = phiSector*binsPerPhiSector;
533 Int_t endPhiBin = (phiSector+1)*binsPerPhiSector;
534 for(Int_t phiBin = startPhiBin; phiBin < endPhiBin; phiBin++){
535 for(Int_t thetaBin = 0; thetaBin < GetNbinsTheta(); thetaBin++){
537 Double_t val = GetBinContent(phiBin+1, thetaBin+1);
538 SetBinContent(phiBin+1, thetaBin+1, val/normFactor);
540 if(val > fPeakBinValue){
544 fPeakBinPhi = phiBin;
545 fPeakBinTheta = thetaBin;
546 fPeakPhiSector = phiSector;
551 setPeakInfoJustFromPeakBin(fPeakBinPhi, fPeakBinTheta);
556 cc->doUpsampledCrossCorrelations(pol, fPeakPhiSector);
561 for(UInt_t comboInd=0; comboInd<combosToUse->size(); comboInd++){
562 Int_t combo = combosToUse->at(comboInd);
569 for(Int_t thetaBin = 0; thetaBin < GetNbinsTheta(); thetaBin++){
570 Int_t zoomThetaInd = minThetaBin + thetaBin;
575 Double_t dtFactor = dtCache->
fDtFactors[zoomThetaInd];
578 for(Int_t phiBin = 0; phiBin < GetNbinsPhi(); phiBin++){
579 Int_t zoomPhiInd = minPhiBin + phiBin;
582 int p21 = dtCache->
part21sIndex(pol, combo, zoomPhiInd);
583 Double_t offsetLowDouble = dtFactor*(partBA - dtCache->
fPart21sZoom[p21]);
592 Int_t offsetLow = (int) offsetLowDouble - (offsetLowDouble < (
int) offsetLowDouble);
594 Double_t deltaT = (offsetLowDouble - offsetLow);
598 Double_t cInterp = deltaT*(c2 - c1) + c1;
600 Int_t bin = (thetaBin+1)*(GetNbinsPhi()+2) + phiBin+1;
601 AddBinContent(bin, cInterp);
607 Double_t normFactor = cc->
kOnlyThisCombo < 0 && combosToUse->size() > 0 ? combosToUse->size() : 1;
612 fPeakBinValue = -DBL_MAX;
614 for(Int_t thetaBin = 0; thetaBin < GetNbinsTheta(); thetaBin++){
615 for(Int_t phiBin = 0; phiBin < GetNbinsPhi(); phiBin++){
616 Double_t val = GetBinContent(phiBin+1, thetaBin+1);
618 SetBinContent(phiBin+1, thetaBin+1, val);
619 if(val > fPeakBinValue){
623 fPeakBinPhi = phiBin;
624 fPeakBinTheta = thetaBin;
628 fitPeakWithQuadratic(fPeakBinPhi, fPeakBinTheta);
643 fPeakPhi = GetPhiAxis()->GetBinLowEdge(peakPhiBin+1);
644 fPeakTheta = GetThetaAxis()->GetBinLowEdge(peakThetaBin+1);
645 fPeakValue = GetBinContent(peakPhiBin+1, peakThetaBin+1);
660 std::cerr <<
"Error in " << __PRETTY_FUNCTION__ <<
", not implemented for coarse map." << std::endl;
665 int minDeltaPhiBin, maxDeltaPhiBin, minDeltaThetaBin, maxDeltaThetaBin;
666 getDeltaBinRangeSVD(minDeltaPhiBin, maxDeltaPhiBin, minDeltaThetaBin, maxDeltaThetaBin);
668 int firstPhiBin = minDeltaPhiBin + peakPhiBin;
669 int lastPhiBin = maxDeltaPhiBin + peakPhiBin;
670 int firstThetaBin = minDeltaThetaBin + peakThetaBin;
671 int lastThetaBin = maxDeltaThetaBin + peakThetaBin;
673 if(firstPhiBin < 0 || lastPhiBin >= GetNbinsPhi() || firstThetaBin < 0 || lastThetaBin >= GetNbinsTheta()){
676 setPeakInfoJustFromPeakBin(peakPhiBin, peakThetaBin);
681 TVectorD peakData(NUM_BINS_QUAD_FIT_PHI*NUM_BINS_QUAD_FIT_THETA);
683 for(
int phiBin=firstPhiBin; phiBin < lastPhiBin; phiBin++){
684 for(
int thetaBin=firstThetaBin; thetaBin < lastThetaBin; thetaBin++){
685 peakData[row] = GetBinContent(phiBin+1, thetaBin+1);
691 TDecompSVD& svd =
const_cast<TDecompSVD&
>(getSVD());
693 TVectorD quadraticCoefficients = svd.Solve(peakData, ok);
695 std::cerr <<
"Warning in " << __PRETTY_FUNCTION__ <<
": something went wrong with the peak interpolation. Will just use peak bin." << std::endl;
696 setPeakInfoJustFromPeakBin(peakPhiBin, peakThetaBin);
701 double a = quadraticCoefficients(0);
702 double b = quadraticCoefficients(1);
703 double c = quadraticCoefficients(2);
704 double d = quadraticCoefficients(3);
705 double e = quadraticCoefficients(4);
706 double f = quadraticCoefficients(5);
710 const double denom = (4*a*b - c*c);
711 const double x_c = (-2*b*d + c*e)/denom;
712 const double y_c = (-2*a*e + c*d)/denom;
713 const double p_c = a*x_c*x_c + b*y_c*y_c + c*x_c*y_c + d*x_c + e*y_c + f;
716 fPeakPhi = x_c + GetPhiAxis()->GetBinLowEdge(peakPhiBin+1);
717 fPeakTheta = y_c + GetThetaAxis()->GetBinLowEdge(peakThetaBin+1);
721 TVectorD residual = svd.GetMatrix()*quadraticCoefficients - peakData;
722 fPeakReducedChisquare = residual.Norm2Sqr()/(residual.GetNrows());
738 void Acclaim::InterferometricMap::findPeakValues(Int_t numPeaks, std::vector<Double_t>& peakValues, std::vector<Double_t>& phiDegs, std::vector<Double_t>& thetaDegs)
const{
752 peakValues.resize(numPeaks, -999);
753 phiDegs.resize(numPeaks, -999);
754 thetaDegs.resize(numPeaks, -999);
760 int nTheta = GetNbinsTheta();
761 int nPhi = GetNbinsPhi();
762 std::vector<short> allowedBins(nPhi*nTheta, 1);
765 for(Int_t peakInd=0; peakInd < numPeaks; peakInd++){
767 for(Int_t phiBin=0; phiBin<nPhi; phiBin++){
768 for(Int_t thetaBin = 0; thetaBin < nTheta; thetaBin++){
771 if(allowedBins[phiBin*nTheta + thetaBin] > 0){
775 Double_t mapValue = GetBinContent(phiBin+1, thetaBin+1);
776 if(mapValue > peakValues[peakInd]){
788 Int_t lastPhiBin = phiBin != 0 ? phiBin - 1 : (NUM_BINS_PHI*NUM_PHI) - 1;
789 Int_t nextPhiBin = phiBin != (NUM_BINS_PHI*NUM_PHI) - 1 ? phiBin + 1 : 0;
795 if(GetBinContent(lastPhiBin+1, thetaBin+1) < mapValue &&
796 GetBinContent(nextPhiBin+1, thetaBin+1) < mapValue){
801 Int_t nextThetaBin = thetaBin != (NUM_BINS_THETA) - 1 ? thetaBin+1 : thetaBin;
802 Int_t lastThetaBin = thetaBin != 0 ? thetaBin-1 : thetaBin;
806 if(thetaBin == 0 || (GetBinContent(lastPhiBin+1, lastThetaBin+1) < mapValue &&
807 GetBinContent(phiBin+1, lastThetaBin+1) < mapValue &&
808 GetBinContent(nextPhiBin+1, lastThetaBin+1) < mapValue)){
812 if(thetaBin == NUM_BINS_THETA-1 || (GetBinContent(lastPhiBin+1, nextThetaBin+1) < mapValue &&
813 GetBinContent(phiBin+1, nextThetaBin+1) < mapValue &&
814 GetBinContent(nextPhiBin+1, nextThetaBin+1) < mapValue)){
817 peakValues[peakInd] = GetBinContent(phiBin+1, thetaBin+1);
820 phiDegs[peakInd] = GetPhiAxis()->GetBinLowEdge(phiBin+1);
821 thetaDegs[peakInd] = GetThetaAxis()->GetBinLowEdge(thetaBin+1);
834 if(peakValues[peakInd] >= -999){
836 for(Int_t phiBin=0; phiBin<nPhi; phiBin++){
838 Double_t phiDeg = GetPhiAxis()->GetBinLowEdge(phiBin+1);
839 Double_t absDeltaPhi = TMath::Abs(RootTools::getDeltaAngleDeg(phiDegs[peakInd], phiDeg));
840 if(absDeltaPhi < PEAK_PHI_DEG_RANGE){
842 for(Int_t thetaBin = 0; thetaBin < nTheta; thetaBin++){
845 Double_t thetaDeg = GetThetaAxis()->GetBinLowEdge(thetaBin+1);
846 Double_t absDeltaTheta = TMath::Abs(RootTools::getDeltaAngleDeg(thetaDegs[peakInd], thetaDeg));
847 if(absDeltaTheta < PEAK_THETA_DEG_RANGE){
851 allowedBins[phiBin*nTheta + thetaBin] = 0;
857 if(peakValues[peakInd] < 0){
858 std::cerr <<
"Peak " << peakInd <<
" = " << peakValues[peakInd] <<
"\t" << gotHere << std::endl;
859 for(
int pi=0; pi <= peakInd; pi++){
860 std::cerr << peakValues[pi] <<
"\t" << phiDegs[pi] <<
"\t" << thetaDegs[pi] << std::endl;
872 void Acclaim::InterferometricMap::initializeInternals(){
873 fThetaAxisInSinTheta =
true;
886 void Acclaim::InterferometricMap::getIndicesOfEdgeBins(
const std::vector<double>& binEdges, Double_t lowVal, Double_t highVal, Int_t& lowIndex, Int_t& highIndex){
893 for(
unsigned i=0; i < binEdges.size(); i++){
899 if(binEdges.at(i) < lowVal){
914 highIndex = binEdges.size() - 1;
916 for(
int i=binEdges.size()-1; i >= 0; i--){
917 if(binEdges.at(i) > highVal){
927 Acclaim::Clustering::getAngularResolution(snr, fSigmaTheta, fSigmaPhi);
934 double phiWave = fPeakPhi*TMath::DegToRad();
935 double thetaWave = -fPeakTheta*TMath::DegToRad();
936 double sourceLon, sourceLat, sourceAlt, thetaAdj;
938 int success = fUsefulPat->traceBackToContinent3(phiWave, thetaWave, &sourceLon, &sourceLat, &sourceAlt, &thetaAdj);
941 grSource->SetName(
"Source");
943 TPad* thisPad = pad ? pad :
new TCanvas();
945 grSource->SetMarkerStyle(8);
948 grSource->SetMarkerColor(grPeak->GetMarkerColor());
953 grSource->Draw(
"psame");
954 grSource->SetBit(kCanDelete);
957 grAnita->SetName(
"ANITA");
959 grAnita->SetMarkerColor(kGreen);
960 grAnita->SetMarkerStyle(8);
961 grAnita->Draw(
"psame");
962 grAnita->SetBit(kCanDelete);
966 arr->SetBit(kCanDelete);
967 arr->SetFillColor(grSource->GetMarkerColor());
968 arr->SetLineColor(grSource->GetMarkerColor());
974 double meanEasting = 0.5*(grSource->GetEasting()[0] + grAnita->GetEasting()[0]);
975 double meanNorthing = 0.5*(grSource->GetNorthing()[0] + grAnita->GetNorthing()[0]);
977 const double zoomRangeEastingNorthing = 500*1000;
978 grSource->GetXaxis()->SetRangeUser(meanEasting - zoomRangeEastingNorthing, meanEasting + zoomRangeEastingNorthing);
979 grSource->GetYaxis()->SetRangeUser(meanNorthing - zoomRangeEastingNorthing, meanNorthing + zoomRangeEastingNorthing);
981 b->SetGrayScale(
true);
982 b->SetShowBases(
true);
984 TLegend* l =
new TLegend(0.79, 0.69, 0.99, 0.99);
985 l->AddEntry(grAnita,
"ANITA",
"p");
986 l->AddEntry(grSource,
"Source",
"p");
987 l->AddEntry(arr,
"Projection",
"l");
990 if(fSigmaTheta > 0 && fSigmaPhi > 0){
992 const int numSigma = 3;
993 const int numPointsPerContour = 100;
994 const double x0 = phiWave;
995 const double y0 = thetaWave;
997 for(
int sigma = 1; sigma <= numSigma; sigma++){
1000 grSigma->SetName(TString::Format(
"%d_sigma_contour", sigma));
1001 grSigma->SetBit(kCanDelete);
1003 const double sigmaThetaRad = sigma*fSigmaTheta*TMath::DegToRad();
1004 const double sigmaPhiRad = sigma*fSigmaPhi*TMath::DegToRad();
1006 for(
int point=0; point < numPointsPerContour; point++){
1012 double alpha = 1.5*TMath::Pi() + TMath::TwoPi()*point/(numPointsPerContour - 1);
1013 double x = sigmaThetaRad*cos(alpha);
1014 double y = sigmaPhiRad*sin(alpha);
1016 double lon, lat, alt, dTheta = 0;
1017 int success = fUsefulPat->traceBackToContinent3(x+x0, y+y0, &lon, &lat, &alt, &dTheta);
1019 if(fabs(dTheta) <= 1e-8){
1020 grSigma->
SetPoint(grSigma->GetN(), lon, lat);
1024 if(grSigma->GetN() > 0){
1025 grSigma->SetLineStyle(1+sigma);
1026 grSigma->Draw(
"lsame");
1044 TString name =
"grPeak";
1048 grPeak->SetName(name);
1049 addGuiChild(grPeak);
1051 grPeak->SetMarkerColor(GetLineColor());
1052 grPeak->SetMarkerStyle(8);
1053 grPeak->SetMarkerSize(1);
1061 TString name =
"grSun";
1062 TGraphInteractive* grSun =
const_cast<TGraphInteractive*
>(findChild(name));
1063 if(fUsefulPat && grSun==NULL){
1064 Double_t phiDeg, thetaDeg;
1065 fUsefulPat->getSunPosition(phiDeg, thetaDeg);
1067 const double phi0 = getBin0PhiDeg();
1068 phiDeg = phiDeg < phi0 ? phiDeg + DEGREES_IN_CIRCLE : phiDeg;
1069 phiDeg = phiDeg >= phi0 + DEGREES_IN_CIRCLE ? phiDeg - DEGREES_IN_CIRCLE : phiDeg;
1072 grSun =
new TGraphInteractive(1, &phiDeg, &thetaDeg,
"p");
1073 grSun->SetName(name);
1076 grSun->SetMarkerStyle(kOpenCircle);
1077 grSun->SetMarkerSize(1);
1084 const char* name =
"grTruth";
1085 TGraphInteractive* grTruth =
const_cast<TGraphInteractive*
>(findChild(name));
1087 if(fUsefulPat && grTruth == NULL && truthLon > -999 && truthLat > -999 && truthAlt > -999){
1088 Double_t thetaDeg, phiDeg;
1089 fUsefulPat->getThetaAndPhiWave(truthLon, truthLat, truthAlt, thetaDeg, phiDeg);
1091 thetaDeg*=-TMath::RadToDeg();
1092 phiDeg*=TMath::RadToDeg();
1094 const double phi0 = getBin0PhiDeg();
1095 phiDeg = phiDeg < phi0 ? phiDeg + DEGREES_IN_CIRCLE : phiDeg;
1096 phiDeg = phiDeg >= phi0 + DEGREES_IN_CIRCLE ? phiDeg - DEGREES_IN_CIRCLE : phiDeg;
1098 grTruth =
new TGraphInteractive(1, &phiDeg, &thetaDeg,
"p");
1099 addGuiChild(grTruth);
1103 grTruth->SetMarkerStyle(kFullStar);
1104 grTruth->SetMarkerSize(1.5);
1105 grTruth->SetMarkerColor(kRed);
1114 const char* name =
"grEdgeBox";
1115 TGraphInteractive* grEdgeBox =
const_cast<TGraphInteractive*
>(findChild(name));
1117 if(grEdgeBox==NULL){
1118 grEdgeBox =
new TGraphInteractive(0, NULL, NULL,
"l");
1119 const TAxis* phiAxis = GetPhiAxis();
1120 const TAxis* thetaAxis = GetThetaAxis();
1122 for(
int phiBin=1; phiBin <= GetNbinsPhi()+1; phiBin++){
1123 grEdgeBox->SetPoint(grEdgeBox->GetN(), phiAxis->GetBinLowEdge(phiBin), thetaAxis->GetBinLowEdge(1));
1126 for(
int thetaBin=1; thetaBin <= GetNbinsTheta()+1; thetaBin++){
1127 grEdgeBox->SetPoint(grEdgeBox->GetN(), phiAxis->GetBinLowEdge(GetNbinsPhi()+1), thetaAxis->GetBinLowEdge(thetaBin));
1130 for(
int phiBin=GetNbinsPhi()+1; phiBin > 0; phiBin--){
1131 grEdgeBox->SetPoint(grEdgeBox->GetN(), phiAxis->GetBinLowEdge(phiBin), thetaAxis->GetBinLowEdge(GetNbinsTheta()+1));
1134 for(
int thetaBin=GetNbinsTheta()+1; thetaBin > 0; thetaBin--){
1135 grEdgeBox->SetPoint(grEdgeBox->GetN(), phiAxis->GetBinLowEdge(1), thetaAxis->GetBinLowEdge(thetaBin));
1137 addGuiChild(grEdgeBox);
1139 grEdgeBox->SetLineWidth(3);
1140 grEdgeBox->SetLineColor(GetLineColor());
1148 Int_t Acclaim::InterferometricMap::getPhiSectorFromPhiRough(
double phiRough){
1149 Double_t phi0 = getBin0PhiDeg();
1150 return static_cast<Int_t
>((phiRough - phi0)/PHI_RANGE);
double coarseDt(int pol, int combo, int phiBin, int thetaBin)
Look up the delay for the antenna pair / polarization at a given angle.
Double_t sourceLat
RF position when leaving the ice: Latitude (using icemc model)
static const std::vector< Double_t > & getFineBinEdgesTheta()
TPad * makeProjectionCanvas()
void addTruthInfo(const TruthAnitaEvent *truth)
std::vector< Int_t > comboToAnt1s
Vector mapping combo index to ant1.
Adu5Pat – The ADU5 Position and Attitude Data.
virtual void Draw(Option_t *opt="")
static const std::vector< Double_t > & getFineBinEdgesPhi()
void setPeakInfoJustFromPeakBin(Int_t peakPhiBin, Int_t peakThetaBin)
static const std::vector< Double_t > & getCoarseBinEdgesTheta()
Double_t correlationDeltaT
nominalSamplingDeltaT/UPSAMPLE_FACTOR, deltaT of for interpolation.
int fUseOffAxisDelay
Should we use the off-axis delay? Set to 1 or 0 as it's used in a multiplication for speed...
virtual ~InterferometricMap()
Double_t sourceLon
RF position when leaving the ice: Longitude (using icemc model)
Double_t sourceAlt
RF position when leaving the ice: Altitude (using icemc model)
virtual void Draw(Option_t *opt)
std::vector< double > fDtFactors
Multiplier factor for the finely binned InterferometricMap.
void Fill(AnitaPol::AnitaPol_t pol, CrossCorrelator *cc, InterferometryCache *dtCache)
std::vector< Int_t > comboToAnt2s
Vector mapping combo index to ant2.
void fitPeakWithQuadratic(Int_t peakPhiBin, Int_t peakThetaBin)
Fit a 2D quadratic function to the bins around the peak of the map. Only implemented for zoomed maps...
std::vector< double > fOffAxisDelaysDivided
Same as fOffAxisDelays, but delays scaled to remove an operation from an inner loop in Interfermetric...
static Double_t getBin0PhiDeg()
std::vector< double > fPartBAsZoom
Partial caching for the finely binned InterferometricMap.
A minimalistic extension to TGraphAligned for some GUI bells and whistles.
UInt_t eventNumber[AnitaPol::kNotAPol]
For tracking event number.
Double_t fSigmaPhi
Estimate of the pointing resolution from the waveform SNR.
std::vector< Int_t > combosToUseGlobal[NUM_PHI]
Depends on L3 trigger for global image.
int partBAsIndex(int pol, int combo, int fineThetaBin)
Get the index for part of the deltaT calculation for the finely binned InterferometricMap.
Double_t fSigmaTheta
Width of peak theta.
TruthAnitaEvent – The Truth ANITA Event.
static Double_t getPhiSectorCenterPhiDeg(int phi)
Int_t numSamples
Number of samples in waveform after padding.
As UsefulAnitaEvent is to RawAnitaEvent, UsefulAdu5Pat is to Adu5Pat. Well not quite as useful but yo...
virtual void ExecuteEvent(int event, int x, int y)
A class to take in FiteredAnitaEvents and cross-correlate nearby channels.
Int_t numSamplesUpsampled
Number of samples in waveform after padding and up sampling.
Double_t crossCorrelationsUpsampled[AnitaPol::kNotAPol][336][NUM_SAMP *2 *6 *2]
Upsampled cross correlations.
Class to cache the deltaTs or parts of their calculation for fast map making.
std::vector< double > fPart21sZoom
Partial caching for the finely binned InterferometricMap.
void setResolutionEstimateFromWaveformSNR(double snr)
static const std::vector< Double_t > & getCoarseBinEdgesPhi()
void addGpsInfo(const Adu5Pat *pat)
virtual void SetPoint(Int_t i, Double_t lon, Double_t lat)
Draw an arrow between two lon/lat points.
enum AnitaPol::EAnitaPol AnitaPol_t
Polarisation enumeration.
Int_t kOnlyThisCombo
For debugging, only fill histograms with one particular antenna pair.
int part21sIndex(int pol, int combo, int finePhiBin)