InterferometryCache.h
1 #ifndef INTERFEROMETRY_CACHE_H
2 #define INTERFEROMETRY_CACHE_H
3 
4 #include "AnitaConventions.h"
5 
6 
7 #include <vector>
8 
9 
10 namespace Acclaim
11 {
12 
13 
14  class AnalysisReco;
15  class CrossCorrelator;
16 
23 
24  friend class InterferometricMap;
25 
26  public:
31 
39 
47  void init(CrossCorrelator* cc, const AnalysisReco* reco, bool forceCacheRecalculation = false);
48 
59  inline int coarseIndex(int pol, int combo, int phiBin, int thetaBin){
60  return ((pol*fNumCombos + combo)*fNCoarseBinsPhi + phiBin)*fNCoarseBinsTheta + thetaBin;
61  }
62 
73  inline double coarseDt(int pol, int combo, int phiBin, int thetaBin){
74  return fDeltaTs[coarseIndex(pol, combo, phiBin, thetaBin)];
75  }
76 
88  inline int partBAsIndex(int pol, int combo, int fineThetaBin){
89  return (pol*fNumCombos + combo)*fNFineBinsTheta + fineThetaBin;
90  }
91 
103  inline int zoomedCosPartIndex(int pol, int ant, int finePhiBin){
104  return (pol*NUM_SEAVEYS + ant)*fNFineBinsPhi + finePhiBin;
105  }
106 
116  inline int part21sIndex(int pol, int combo, int finePhiBin){
117  return (pol*fNumCombos + combo)*fNFineBinsPhi + finePhiBin;
118  }
119 
126  void populateCache(CrossCorrelator* cc, const AnalysisReco* reco);
127 
134  void populateFineCache(CrossCorrelator* cc, const AnalysisReco* reco);
135 
136 
142  std::vector<double> fDeltaTs;
143 
146 
154  //[AnitaPol::kNotAPol][NUM_COMBOS][NUM_BINS_THETA_ZOOM_TOTAL]
155  std::vector<double> fPartBAsZoom;
156 
157  //[AnitaPol::kNotAPol][NUM_COMBOS][NUM_BINS_PHI_ZOOM_TOTAL]
158  std::vector<double> fPart21sZoom;
159 
160  // NUM_BINS_PHI_ZOOM_TOTAL
161  std::vector<double> fZoomedThetaWaves;
162 
163  // NUM_BINS_THETA_ZOOM_TOTAL
164  std::vector<double> fZoomedTanThetaWaves;
165 
166  // NUM_BINS_THETA_ZOOM_TOTAL
167  std::vector<double> fZoomedCosThetaWaves;
168 
169  // NUM_BINS_THETA_ZOOM_TOTAL
170  std::vector<double> fDtFactors;
171 
172  // NUM_BINS_PHI_ZOOM_TOTAL
173  std::vector<double> fZoomedPhiWaveLookup;
174 
175  // NUM_BINS_PHI_ZOOM_TOTAL
176  std::vector<double> fZoomedCosPartLookup;
177 
178  // [AnitaPol::kNotAPol][NUM_COMBOS][NUM_BINS_PHI_ZOOM_TOTAL]
179  std::vector<double> fOffAxisDelays;
180 
181  // [AnitaPol::kNotAPol][NUM_COMBOS][NUM_BINS_PHI_ZOOM_TOTAL]
182  std::vector<double> fOffAxisDelaysDivided;
183  };
184 }
185 
186 #endif
double coarseDt(int pol, int combo, int phiBin, int thetaBin)
Look up the delay for the antenna pair / polarization at a given angle.
std::vector< double > fZoomedThetaWaves
Values of theta (radians) for the finely binned InterferometricMap.
int fNCoarseBinsPhi
The number of phi bins in the coarsely binned interferometric map.
std::vector< double > fZoomedCosPartLookup
Partial caching for the of the deltaT calculation.
Does the event reconstruction, and produces a summary of it.
Definition: AnalysisReco.h:30
int fUseOffAxisDelay
Should we use the off-axis delay? Set to 1 or 0 as it&#39;s used in a multiplication for speed...
std::vector< double > fDtFactors
Multiplier factor for the finely binned InterferometricMap.
std::vector< double > fOffAxisDelaysDivided
Same as fOffAxisDelays, but delays scaled to remove an operation from an inner loop in Interfermetric...
std::vector< double > fZoomedCosThetaWaves
Values of cos(theta) for the finely binned InterferometricMap.
Namespace which wraps everything in the library.
int fNFineBinsPhi
If a finely binned InterferometricMap extended over all 360 in phi (plus edge effects) it would have ...
std::vector< double > fPartBAsZoom
Partial caching for the finely binned InterferometricMap.
std::vector< double > fZoomedPhiWaveLookup
The value of phi in each bin in radians.
void populateCache(CrossCorrelator *cc, const AnalysisReco *reco)
int fNFineBinsTheta
If a finely binned InterferometricMap extended over all theta (plus edge effects) it would have this ...
std::vector< double > fDeltaTs
Delays between antenna pairs for the coarsely binned interferometric map.
void init(CrossCorrelator *cc, const AnalysisReco *reco, bool forceCacheRecalculation=false)
Initialize the cache, only needs to be done once.
int partBAsIndex(int pol, int combo, int fineThetaBin)
Get the index for part of the deltaT calculation for the finely binned InterferometricMap.
int fNumCombos
The number of possible antenna pairs to be correlated.
int zoomedCosPartIndex(int pol, int ant, int finePhiBin)
Get the index for part of the deltaT calculation for the finely binned InterferometricMap.
std::vector< double > fZoomedTanThetaWaves
Values of tan(theta) for the finely binned InterferometricMap.
int coarseIndex(int pol, int combo, int phiBin, int thetaBin)
Get the internal array index for the fDeltaTs vector (for coarsely binned InterferometericMap) ...
void populateFineCache(CrossCorrelator *cc, const AnalysisReco *reco)
int fNCoarseBinsTheta
The number of theta bins in the coarsely binned interferometric map.
A class to take in FiteredAnitaEvents and cross-correlate nearby channels.
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.
std::vector< double > fOffAxisDelays
Off-axis delays for use when making fine binned InterferometricMap.
bool fInitialized
Has the cache been initialized?
int part21sIndex(int pol, int combo, int finePhiBin)