1 #include "InterferometryCache.h" 2 #include "CrossCorrelator.h" 3 #include "AnalysisReco.h" 16 fNCoarseBinsTheta = 0;
17 populateCache(cc, reco);
18 populateFineCache(cc, reco);
22 if(!fInitialized || forceCacheRecalculation){
23 populateCache(cc, reco);
24 populateFineCache(cc, reco);
36 fNCoarseBinsPhi = coarsePhiBinEdges.size()-1;
39 fNCoarseBinsTheta = coarseThetaBinEdges.size()-1;
42 std::vector<Double_t> phiWaveLookup(fNCoarseBinsPhi);
43 for(Int_t phiIndex=0; phiIndex < fNCoarseBinsPhi; phiIndex++){
44 Double_t phiDeg = coarsePhiBinEdges.at(phiIndex);
45 Double_t phiWave = TMath::DegToRad()*phiDeg;
46 phiWaveLookup[phiIndex] = phiWave;
49 std::vector<Double_t> thetaWaves(fNCoarseBinsTheta);
51 for(Int_t thetaIndex=0; thetaIndex < fNCoarseBinsTheta; thetaIndex++){
52 Double_t thetaWaveDeg = coarseThetaBinEdges.at(thetaIndex);
53 Double_t thetaWave = thetaWaveDeg*TMath::DegToRad();
54 thetaWaves[thetaIndex] = thetaWave;
58 fDeltaTs.resize(numDeltaTs);
63 for(Int_t combo=0; combo<fNumCombos; combo++){
67 for(Int_t phiBin = 0; phiBin < fNCoarseBinsPhi; phiBin++){
68 Double_t phiWave = phiWaveLookup[phiBin];
70 for(Int_t thetaBin = 0; thetaBin < fNCoarseBinsTheta; thetaBin++){
71 Double_t thetaWave = thetaWaves[thetaBin];
72 fDeltaTs.at(coarseIndex(pol, combo, phiBin, thetaBin)) = reco->
getDeltaTExpected(pol, ant1, ant2, phiWave, thetaWave);
84 fNFineBinsTheta = fineBinsTheta.size() - 1;
85 fNFineBinsPhi = fineBinsPhi.size() - 1;
88 fZoomedPhiWaveLookup.resize(fNFineBinsPhi);
89 for(
unsigned phiIndex=0; phiIndex < fZoomedPhiWaveLookup.size(); phiIndex++){
90 Double_t phiDeg = fineBinsPhi.at(phiIndex);
93 fZoomedPhiWaveLookup.at(phiIndex) = phiDeg*TMath::DegToRad();
96 fZoomedThetaWaves.resize(fNFineBinsTheta);
97 fZoomedTanThetaWaves.resize(fNFineBinsTheta);
98 fZoomedCosThetaWaves.resize(fNFineBinsTheta);
99 fDtFactors.resize(fNFineBinsTheta);
102 for(
unsigned thetaIndex=0; thetaIndex < fZoomedThetaWaves.size(); thetaIndex++){
104 Double_t thetaWaveDeg = fineBinsTheta.at(thetaIndex);
105 Double_t thetaWave = -1*thetaWaveDeg*TMath::DegToRad();
106 fZoomedThetaWaves[thetaIndex] = thetaWave;
107 fZoomedTanThetaWaves[thetaIndex] = tan(thetaWave);
108 fZoomedCosThetaWaves[thetaIndex] = cos(thetaWave);
109 fDtFactors[thetaIndex] = fZoomedCosThetaWaves[thetaIndex]/(SPEED_OF_LIGHT_NS*cc->
correlationDeltaT);
117 for(Int_t combo=0; combo < NUM_COMBOS; combo++){
120 for(Int_t thetaIndex=0; thetaIndex < fNFineBinsTheta; thetaIndex++){
121 fPartBAsZoom[partBAsIndex(pol, combo, thetaIndex)] = fZoomedTanThetaWaves[thetaIndex]*(reco->
fZArray[pol].at(ant2)-reco->
fZArray[pol].at(ant1));
134 for(Int_t ant=0; ant<NUM_SEAVEYS; ant++){
135 for(Int_t phiIndex=0; phiIndex < fNFineBinsPhi; phiIndex++){
136 Double_t phiDeg = fineBinsPhi.at(phiIndex);
137 Double_t phiWave = phiDeg*TMath::DegToRad();
138 fZoomedCosPartLookup.at(zoomedCosPartIndex(pol, ant, phiIndex)) = reco->
fRArray[pol].at(ant)*cos(phiWave-TMath::DegToRad()*reco->
fPhiArrayDeg[pol].at(ant));
142 for(Int_t combo=0; combo < NUM_COMBOS; combo++){
146 for(Int_t phiIndex=0; phiIndex < fNFineBinsPhi; phiIndex++){
147 Double_t phiDeg = fineBinsPhi.at(phiIndex);
150 int p21 = part21sIndex(pol, combo, phiIndex);
151 fOffAxisDelays[p21] = offAxisDelay;
153 fPart21sZoom[p21] = fZoomedCosPartLookup.at((zoomedCosPartIndex(pol, ant2, phiIndex))) - fZoomedCosPartLookup.at((zoomedCosPartIndex(pol, ant1, phiIndex)));
static const std::vector< Double_t > & getFineBinEdgesTheta()
int fNCoarseBinsPhi
The number of phi bins in the coarsely binned interferometric map.
std::vector< Double_t > fPhiArrayDeg[AnitaPol::kNotAPol]
Local copies of the antenna azimuth positions (in degrees) from AnitaGeomTool.
std::vector< Int_t > comboToAnt1s
Vector mapping combo index to ant1.
std::vector< Double_t > fZArray[AnitaPol::kNotAPol]
Local copies of the antenna z positions (metres) from AnitaGeomTool.
static const std::vector< Double_t > & getFineBinEdgesPhi()
Does the event reconstruction, and produces a summary of it.
static const std::vector< Double_t > & getCoarseBinEdgesTheta()
Double_t correlationDeltaT
nominalSamplingDeltaT/UPSAMPLE_FACTOR, deltaT of for interpolation.
Double_t relativeOffAxisDelay(AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2, Double_t phiDeg) const
Get the off axis delay between two antennas for a given phi angle.
std::vector< Int_t > comboToAnt2s
Vector mapping combo index to ant2.
Double_t getDeltaTExpected(AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2, Double_t phiWave, Double_t thetaWave) const
Get the expected delay between antenna pairs for a given direction.
Int_t numCombos
Number of possible antenna pairs, counted during initialization. Should equal NUM_COMBOS.
void populateCache(CrossCorrelator *cc, const AnalysisReco *reco)
std::vector< Double_t > fRArray[AnitaPol::kNotAPol]
Local copies of the antenna radial positions (metres) from AnitaGeomTool.
void init(CrossCorrelator *cc, const AnalysisReco *reco, bool forceCacheRecalculation=false)
Initialize the cache, only needs to be done once.
int fNumCombos
The number of possible antenna pairs to be correlated.
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.
static const std::vector< Double_t > & getCoarseBinEdgesPhi()
bool fInitialized
Has the cache been initialized?
enum AnitaPol::EAnitaPol AnitaPol_t
Polarisation enumeration.
Int_t GetUseOffAxisDelay() const
Get the value of fUseOffAxisDelay.