Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CrossCorrelator Class Reference

A class to take in UsefulAnitaEvents and get interferometric maps with a single function. More...

#include <CrossCorrelator.h>

Classes

struct  threadArgs
 Container required to get threading to work inside a class, includes the thread index and the pointer to the class. More...
 

Public Types

enum  mapMode_t { kGlobal, kTriggered, kNumMapModes }
 Flag to pass to CrossCorrelator when making a map telling it whether to use all phi-sectors or triggered phi-sectors.
 
enum  zoomMode_t { kZoomedOut, kZoomedIn, kNumZoomModes }
 Flag to pass to CrossCorrelator when making a map telling it whether to reconstruct all arrival directions or a finer binned close up of a particular region.
 

Public Member Functions

 CrossCorrelator ()
 Constructor.
 
 ~CrossCorrelator ()
 Destructor.
 
void initializeVariables ()
 Workhorse function to set internal variables.
 
void printInfo ()
 Prints some summary information about the CrossCorrelator to stdout.
 
void getNormalizedInterpolatedTGraphs (UsefulAnitaEvent *realEvent, AnitaPol::AnitaPol_t pol)
 Makes evenly re-sampled, normalized waveform graphs from the UsefulAnitaEvent. More...
 
void simple260MHzSatelliteNotch (AnitaPol::AnitaPol_t pol, Int_t ant)
 Applies a 52MHz wide notch centered at 260 MHz to filter the most problematic satellite frequency. More...
 
void simple370MHzSatelliteNotch (AnitaPol::AnitaPol_t pol, Int_t ant)
 Applies a 40MHz wide notch centered at 370 MHz to filter another satellite frequency. More...
 
void simpleNotch (AnitaPol::AnitaPol_t pol, Int_t ant, Double_t notchLowEdgeMHz, Double_t notchHighEdgeMHz)
 Applies a simple notch between the given frequencies. More...
 
void renormalizeFourierDomain (AnitaPol::AnitaPol_t pol, Int_t ant)
 Scales the fft such that the inverse fft would have mean=0 and rms=1. For use after notching. More...
 
TGraph * interpolateWithStartTimeAndZeroMean (TGraph *grIn, Double_t startTime, Double_t dt, Int_t nSamp)
 Creates an interpolated TGraph with zero mean. More...
 
void doFFTs (AnitaPol::AnitaPol_t pol)
 Takes FFTs of the normalized, evenly resampled waveforms and puts them in memory. More...
 
void correlateEvent (UsefulAnitaEvent *realEvent)
 Correlate the event. More...
 
void correlateEvent (UsefulAnitaEvent *realEvent, AnitaPol::AnitaPol_t pol)
 Correlate the event. More...
 
void reconstructEvent (UsefulAnitaEvent *usefulEvent, Int_t numFinePeaks=MAX_NUM_PEAKS, Int_t numCoarsePeaks=MAX_NUM_PEAKS)
 Reconstruct event. More...
 
void findPeakValues (AnitaPol::AnitaPol_t pol, Int_t numPeaks, Double_t *peakValues, Double_t *phiDegs, Double_t *thetaDegs)
 Goes through the coarseMap and finds the top N values. More...
 
void getMaxCorrelationTimeValue (AnitaPol::AnitaPol_t pol, Int_t combo, Double_t &time, Double_t &value)
 Get the maximum correlation time and value from a polarization and antenna combo index. More...
 
void getMaxCorrelationTimeValue (AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2, Double_t &time, Double_t &value)
 Get the maximum correlation time and value from a polarization and pair of antennas. More...
 
void getMaxUpsampledCorrelationTimeValue (AnitaPol::AnitaPol_t pol, Int_t combo, Double_t &time, Double_t &value)
 Get the maximum upsampled correlation time and value from a polarization and antenna combo index. More...
 
void getMaxUpsampledCorrelationTimeValue (AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2, Double_t &time, Double_t &value)
 Get the maximum upsampled correlation time and value from a polarization and pair of antennas. More...
 
void doAllCrossCorrelationsThreaded (AnitaPol::AnitaPol_t pol)
 Wrapper function which launches the threads for generating all the cross correlations. More...
 
void doUpsampledCrossCorrelationsThreaded (AnitaPol::AnitaPol_t pol, Int_t phiSector)
 Static member function which generates the finely binned set of cross correlations from the FFTs held in memory. More...
 
Double_t getDeltaTExpected (AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2, Double_t phiWave, Double_t thetaWave)
 Function to calculate the time taken by a plane wave to cross the payload. More...
 
Double_t relativeOffAxisDelay (AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2, Double_t phiDeg)
 Get the relative off-axis delay between an antenna pair. More...
 
Double_t singleAntennaOffAxisDelay (Double_t deltaPhiDeg)
 Get the off-axis delay for an off boresight angle. More...
 
Bool_t useCombo (Int_t ant1, Int_t ant2, Int_t phiSector, Int_t deltaPhiSect)
 This function encodes whether a pair of antennas should be used in a particular phi sector. More...
 
void fillCombosToUse ()
 Creates vectors of antenna combo indices and puts them in the combosToUseGlobal map.
 
void do5PhiSectorCombinatorics ()
 Function to index all possible antenna pairs for use in reconstuction. More...
 
TH2D * initializeNewCombinatorics ()
 
void fillDeltaTLookup ()
 Fills in an array of cached deltaTs between antenna pairs as a function of arrival direction.
 
Double_t getBin0PhiDeg ()
 Single function to get the angle of the first bin of the interferometric histogram. More...
 
void getCoarsePeakInfo (AnitaPol::AnitaPol_t pol, Int_t peakIndex, Double_t &value, Double_t &phiDeg, Double_t &thetaDeg)
 Gets the results from the coarse reconstruction. More...
 
void getFinePeakInfo (AnitaPol::AnitaPol_t pol, Int_t peakIndex, Double_t &value, Double_t &phiDeg, Double_t &thetaDeg)
 Gets the results from the fine reconstruction. More...
 
Double_t getInterpolatedUpsampledCorrelationValue (AnitaPol::AnitaPol_t pol, Int_t combo, Double_t deltaT)
 Linearly interpolates between upsampled correlation points. More...
 
TH2D * getMap (AnitaPol::AnitaPol_t pol, Double_t &peakValue, Double_t &peakPhiDeg, Double_t &peakThetaDeg, UShort_t l3TrigPattern=ALL_PHI_TRIGS)
 Gets an actual histogram of the zoomed in map. More...
 
TH2D * getZoomMap (AnitaPol::AnitaPol_t pol)
 Gets an actual histogram of the zoomed in map. More...
 
void reconstruct (AnitaPol::AnitaPol_t pol, Double_t &imagePeak, Double_t &peakPhiDeg, Double_t &peakThetaDeg)
 Wrapper function which launches the threaded functions, which fill the interferometric maps. More...
 
void reconstructZoom (AnitaPol::AnitaPol_t pol, Double_t &imagePeak, Double_t &peakPhiDeg, Double_t &peakThetaDeg, Double_t zoomCenterPhiDeg=0, Double_t zoomCenterThetaDeg=0)
 Wrapper function which launches the threaded functions, which fill the zoomed maps. More...
 
TH2D * makeGlobalImage (AnitaPol::AnitaPol_t pol, Double_t &imagePeak, Double_t &peakPhiDeg, Double_t &peakThetaDeg)
 Creates an interferometric map using plane wave deltaTs and antenna pairs from all phi-sectors. More...
 
TH2D * makeGlobalImage (AnitaPol::AnitaPol_t pol)
 Creates an interferometric map using plane wave deltaTs and antenna pairs from all phi-sectors. More...
 
TH2D * makeTriggeredImage (AnitaPol::AnitaPol_t pol, Double_t &imagePeak, Double_t &peakPhiDeg, Double_t &peakThetaDeg, UShort_t l3TrigPattern)
 Creates an interferometric map using plane wave deltaTs and l3Triggered pairs from all phi-sectors. More...
 
TH2D * makeZoomedImage (AnitaPol::AnitaPol_t pol, UShort_t l3TrigPattern, Double_t zoomCenterPhiDeg, Double_t zoomCenterThetaDeg)
 Creates an interferometric map using plane wave deltaTs centered around a particular phi/theta. More...
 
TH2D * makeZoomedImage (AnitaPol::AnitaPol_t pol, Double_t &imagePeak, Double_t &peakPhiDeg, Double_t &peakThetaDeg, UShort_t l3TrigPattern, Double_t zoomCenterPhiDeg, Double_t zoomCenterThetaDeg)
 Creates an interferometric map using plane wave deltaTs centered around a particular phi/theta. More...
 
TH2D * makeZoomedImage (AnitaPol::AnitaPol_t pol, Double_t &imagePeak, Double_t &peakPhiDeg, Double_t &peakThetaDeg, Double_t zoomCenterPhiDeg, Double_t zoomCenterThetaDeg)
 Creates an interferometric map using plane wave deltaTs centered around a particular phi/theta. More...
 
Int_t getPhiSectorOfAntennaClosestToPhiDeg (AnitaPol::AnitaPol_t pol, Double_t phiDeg)
 Finds the phi-sector closest to a particular phi direction. More...
 
TGraph * makeCoherentlySummedWaveform (AnitaPol::AnitaPol_t pol, Double_t phiDeg, Double_t thetaDeg, Int_t maxDeltaPhiSect, Double_t &snr)
 Creates the coherently summed waveform from the FFTs held in memory. More...
 
TGraph * makeUpsampledCoherentlySummedWaveform (AnitaPol::AnitaPol_t pol, Double_t phiDeg, Double_t thetaDeg, Int_t maxDeltaPhiSect, Double_t &snr)
 Creates the coherently summed waveform from the zero padded FFTs held in memory. More...
 
TGraph * makeCoherentWorker (AnitaPol::AnitaPol_t pol, Double_t phiDeg, Double_t thetaDeg, Int_t maxDeltaPhiSect, Double_t &snr, Int_t nSamp)
 Worker function to create the coherently summed waveform from either the regular ffts or the padded ffts. More...
 
void deleteAllWaveforms (AnitaPol::AnitaPol_t pol)
 Deletes the waveform TGraphs in memory and removes dangling pointers. More...
 
TGraph * getCrossCorrelationGraph (AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2)
 Turns internal correlation arrays into TGraphs to be seen by humans. More...
 
TGraph * getUpsampledCrossCorrelationGraph (AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2)
 Turns internal upsampled correlation arrays into TGraphs to be seen by humans. More...
 
TGraph * getCrossCorrelationGraphWorker (Int_t numSamps, AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2)
 Called by wrapper functions. Turns internal correlation arrays into TGraphs to be seen by humans. More...
 
void insertPhotogrammetryGeometry ()
 Inserts the photogrammetry geometry into the CrossCorrelator internals AND the AnitaEventCalibrator internals.
 

Static Public Member Functions

static void * doSomeCrossCorrelationsThreaded (void *voidPtrArgs)
 Static member function which generates the coarsely binned set of cross correlations from the FFTs held in memory. More...
 
static void * doSomeUpsampledCrossCorrelationsThreaded (void *voidPtrArgs)
 Static member function which generates the finely binned set of cross correlations from the FFTs held in memory. More...
 
static void * makeSomeOfImageThreaded (void *voidPtrArgs)
 Static member function which fills the interferometric maps. More...
 
static void * makeSomeOfZoomImageThreaded (void *voidPtrArgs)
 Static member function which fills the interferometric maps. More...
 
static Int_t directlyInsertGeometry (TString pathToLindasFile, AnitaPol::AnitaPol_t pol)
 Used to insert phase center geometry files from Linda. More...
 

Public Attributes

TString mapModeNames [kNumMapModes]
 Maps text to the mapMode_t enum, used for histogram names/titles.
 
TString zoomModeNames [kNumZoomModes]
 Maps text to the zoomMode_t enum, used for histogram names/titles.
 
Double_t interpPreFactors [NUM_POL][NUM_COMBOS][NUM_PHI *NUM_BINS_PHI][NUM_BINS_THETA]
 The interpolation factor for neighbouring samples.
 
Int_t offsetLows [NUM_POL][NUM_COMBOS][NUM_PHI *NUM_BINS_PHI][NUM_BINS_THETA]
 The interpolation factor for neighbouring samples.
 
Double_t crossCorrelations [NUM_POL][NUM_COMBOS][NUM_SAMPLES *PAD_FACTOR]
 Cross correlations.
 
Double_t coarseMap [NUM_POL][NUM_BINS_PHI *NUM_PHI][NUM_BINS_THETA]
 Internal storage for the coarsely binned map.
 
std::set< std::vector< int > >::iterator comboSetIterator [NUM_BINS_THETA][NUM_BINS_PHI *NUM_PHI]
 Pointer to a vector of combo indices (actually an iterator over a set, but you know what I mean).
 
Double_t partBAsZoom [NUM_POL][NUM_COMBOS][NUM_BINS_THETA_ZOOM_TOTAL]
 Yet more geometric caching.
 
Double_t part21sZoom [NUM_POL][NUM_COMBOS][NUM_BINS_PHI_ZOOM_TOTAL]
 Yet more geometric caching.
 
Double_t crossCorrelationsUpsampled [NUM_POL][NUM_COMBOS][NUM_SAMPLES *PAD_FACTOR *UPSAMPLE_FACTOR *PAD_FACTOR]
 Upsampled cross correlations.
 
Double_t fineMap [NUM_POL][NUM_BINS_THETA_ZOOM][NUM_BINS_PHI_ZOOM]
 Internal storage for the finely binned map.
 
std::complex< Double_t > fftsPadded [NUM_POL][NUM_SEAVEYS][GETNUMFREQS(NUM_SAMPLES *PAD_FACTOR *UPSAMPLE_FACTOR)]
 FFTs of evenly resampled waveforms, padded with zeros so that the inverse fourier transform is interpolated.
 
std::complex< Double_t > ffts [NUM_POL][NUM_SEAVEYS][GETNUMFREQS(NUM_SAMPLES *PAD_FACTOR)]
 FFTs of evenly resampled waveforms.
 
TGraph * grs [NUM_POL][NUM_SEAVEYS]
 Raw waveforms obtained from the UsefulAnitaEvent.
 
TGraph * grsResampled [NUM_POL][NUM_SEAVEYS]
 Evenly resampled TGraphs.
 
Double_t interpRMS [NUM_POL][NUM_SEAVEYS]
 RMS of interpolated TGraphs.
 
Double_t interpRMS2 [NUM_POL][NUM_SEAVEYS]
 RMS of interpolated TGraphs with extra zero padding.
 
Int_t comboIndices [NUM_SEAVEYS][NUM_SEAVEYS]
 Array mapping ant1+ant2 to combo index.
 
UInt_t eventNumber [NUM_POL]
 For tracking event number.
 
UInt_t lastEventNormalized [NUM_POL]
 Prevents cross-correlation of the same event twice.
 
Double_t nominalSamplingDeltaT
 ANITA-3 => 1./2.6 ns, deltaT for evenly resampling.
 
Double_t correlationDeltaT
 nominalSamplingDeltaT/UPSAMPLE_FACTOR, deltaT of for interpolation.
 
Int_t numSamples
 Number of samples in waveform after padding.
 
Int_t numSamplesUpsampled
 Number of samples in waveform after padding and up sampling.
 
Int_t numCombos
 Number of possible antenna pairs, counted during initialization. Should equal NUM_COMBOS.
 
std::vector< Int_t > comboToAnt1s
 Vector mapping combo index to ant1.
 
std::vector< Int_t > comboToAnt2s
 Vector mapping combo index to ant2.
 
std::vector< Int_t > combosToUseGlobal [NUM_PHI]
 Depends on L3 trigger for global image.
 
std::vector< Double_t > rArray [NUM_POL]
 Vector of antenna radial positions.
 
std::vector< Double_t > phiArrayDeg [NUM_POL]
 Vector of antenna azimuth positions.
 
std::vector< Double_t > zArray [NUM_POL]
 Vector of antenna heights.
 
Double_t coarseMapPeakValues [NUM_POL][MAX_NUM_PEAKS]
 Stores the peak of the interally stored map.
 
Double_t coarseMapPeakPhiDegs [NUM_POL][MAX_NUM_PEAKS]
 Stores the peak phi (degrees) of the interally stored map.
 
Double_t coarseMapPeakThetaDegs [NUM_POL][MAX_NUM_PEAKS]
 Stores the peak theta (degrees) of the interally stored map.
 
Double_t fineMapPeakValues [NUM_POL][MAX_NUM_PEAKS]
 Stores the peak of the interally stored map.
 
Double_t fineMapPeakPhiDegs [NUM_POL][MAX_NUM_PEAKS]
 Stores the peak phi (degrees) of the interally stored map.
 
Double_t fineMapPeakThetaDegs [NUM_POL][MAX_NUM_PEAKS]
 Stores the peak theta (degrees) of the interally stored map.
 
Double_t zoomedThetaWaves [NUM_BINS_THETA_ZOOM_TOTAL]
 Cached theta for zoomed image.
 
Double_t zoomedTanThetaWaves [NUM_BINS_THETA_ZOOM_TOTAL]
 Cached tan(theta) for zoomed image.
 
Double_t zoomedCosThetaWaves [NUM_BINS_THETA_ZOOM_TOTAL]
 Cached cos(theta) for zoomed image.
 
Double_t zoomedPhiWaveLookup [NUM_BINS_PHI_ZOOM_TOTAL]
 Cached phi for zoomed image.
 
Double_t zoomedCosPartLookup [NUM_POL][NUM_SEAVEYS][NUM_BINS_PHI_ZOOM_TOTAL]
 Cached part of the deltaT calculation.
 
Double_t offAxisDelays [NUM_POL][NUM_COMBOS][NUM_BINS_PHI_ZOOM_TOTAL]
 Off-axis delays for fine binned images.
 
Double_t thetaWaves [NUM_BINS_THETA]
 Cached theta for image.
 
Double_t phiWaveLookup [NUM_BINS_PHI *NUM_PHI]
 Cached phi for image.
 
AnitaPol::AnitaPol_t threadPol
 Polarization to use in thread functions.
 
UInt_t threadL3TrigPattern
 l3TrigPattern to use in thread functions.
 
Int_t threadPhiSector
 phi-sector to use in thread functions.
 
Double_t threadImagePeak [NUM_THREADS]
 Store image peaks found by different threads.
 
Double_t threadPeakPhiDeg [NUM_THREADS]
 Store phi of image peaks found by different threads.
 
Double_t threadPeakThetaDeg [NUM_THREADS]
 Store theta of image peaks found by different threads.
 
std::vector< TThread * > mapThreads
 TThreads for doing interferometric map making.
 
std::vector< TThread * > corrThreads
 TThreads for doing cross correlations.
 
std::vector< TThread * > upsampledCorrThreads
 TThreads for doing upsampled cross correlations.
 
Int_t kOnlyThisCombo
 For debugging, only fill histograms with one particular antenna pair.
 
Int_t kDeltaPhiSect
 Specifies how many phi-sectors around peak use in reconstruction.
 
Int_t kUseOffAxisDelay
 Flag for whether or not to apply off axis delay to deltaT expected.
 
Double_t maxDPhiDeg
 Variable for testing how wide an off axis angle is used in reconstruction.
 
Int_t kDoSimpleSatelliteFiltering
 Does a simple 52MHz wide notch at 260 if flag is greater than 0.
 

Detailed Description

A class to take in UsefulAnitaEvents and get interferometric maps with a single function.

Does all the heavy lifting: gets waveforms from a UsefulAnitaEvent, cross correlates them, and produces interferometric maps.

Definition at line 94 of file CrossCorrelator.h.

Member Function Documentation

void CrossCorrelator::correlateEvent ( UsefulAnitaEvent *  usefulEvent)

Correlate the event.

First step in interferometry is to pass the pointer to the UsefulAnitaEvent in here. This populates the internal arrays of normalized, interpolated waveforms and set of cross correlations. These data are then used as look up tables for generating interferometic images.

Parameters
usefulEventis the event to process.

Definition at line 689 of file CrossCorrelator.cxx.

void CrossCorrelator::correlateEvent ( UsefulAnitaEvent *  usefulEvent,
AnitaPol::AnitaPol_t  pol 
)

Correlate the event.

First step in interferometry is to pass the pointer to the UsefulAnitaEvent in here. This populates the internal arrays of normalized, interpolated waveforms and set of cross correlations. These data are then used as look up tables for generating interferometic images.

Parameters
usefulEventis the event to process.
poltells CrossCorrelator to only do this polarization.

Definition at line 710 of file CrossCorrelator.cxx.

void CrossCorrelator::deleteAllWaveforms ( AnitaPol::AnitaPol_t  pol)

Deletes the waveform TGraphs in memory and removes dangling pointers.

Parameters
polis the polarization to delete.

Definition at line 2039 of file CrossCorrelator.cxx.

Int_t CrossCorrelator::directlyInsertGeometry ( TString  pathToLindasFile,
AnitaPol::AnitaPol_t  pol 
)
static

Used to insert phase center geometry files from Linda.

Parameters
pathToLindasFileis the relative path to Linda's file.
polis the polarization of the channels under test.
Returns
0 if everything went without a problem, 1 if there was a problem.

Definition at line 2067 of file CrossCorrelator.cxx.

void CrossCorrelator::do5PhiSectorCombinatorics ( )

Function to index all possible antenna pairs for use in reconstuction.

In order to avoid using separate regions of memory many of the interals rely on knowing NUM_COMBOS. This function counts up numCombos and expects it to equal NUM_COMBOS. This class will probably break if they are not equal (especially if numCombos > NUM_COMBOS). Prints a warning if they are not equal.

Definition at line 1185 of file CrossCorrelator.cxx.

void CrossCorrelator::doAllCrossCorrelationsThreaded ( AnitaPol::AnitaPol_t  pol)

Wrapper function which launches the threads for generating all the cross correlations.

Parameters
poltells CrossCorrelator to only do this polarization.

Definition at line 736 of file CrossCorrelator.cxx.

void CrossCorrelator::doFFTs ( AnitaPol::AnitaPol_t  pol)

Takes FFTs of the normalized, evenly resampled waveforms and puts them in memory.

Parameters
polis which polarization to process

Now also creates the zero padded FFTs used for upsampled cross-correlations.

Definition at line 367 of file CrossCorrelator.cxx.

void * CrossCorrelator::doSomeCrossCorrelationsThreaded ( void *  voidPtrArgs)
static

Static member function which generates the coarsely binned set of cross correlations from the FFTs held in memory.

Parameters
voidPtrArgscontains a pointer to a CrossCorrelator::threadArgs struct

Definition at line 860 of file CrossCorrelator.cxx.

void * CrossCorrelator::doSomeUpsampledCrossCorrelationsThreaded ( void *  voidPtrArgs)
static

Static member function which generates the finely binned set of cross correlations from the FFTs held in memory.

Parameters
voidPtrArgscontains a pointer to a CrossCorrelator::threadArgs struct

Definition at line 774 of file CrossCorrelator.cxx.

void CrossCorrelator::doUpsampledCrossCorrelationsThreaded ( AnitaPol::AnitaPol_t  pol,
Int_t  phiSector 
)

Static member function which generates the finely binned set of cross correlations from the FFTs held in memory.

Parameters
poltells CrossCorrelator to only do this polarization.
phiSectoris used to figure out which finely binned cross correlations are required.

Definition at line 911 of file CrossCorrelator.cxx.

void CrossCorrelator::findPeakValues ( AnitaPol::AnitaPol_t  pol,
Int_t  numPeaks,
Double_t *  peakValues,
Double_t *  phiDegs,
Double_t *  thetaDegs 
)

Goes through the coarseMap and finds the top N values.

Parameters
polis the polarization of interest.
numPeaksis the number of peaks you wish to find, and the assumed size arrays pointed to by the following 3 variables.
peakValuesis a pointer to the first element of an array of length numPeaks and will be filled with the values of the coarse map at the peaks.
phiDegsis a pointer to the first element of an array of length numPeaks and will be filled with the values of phi (degrees relative to ADU5-aft-fore) at the peaks.
thetaDegsis a pointer to the first element of an array of length numPeaks and will be filled with the values of theta (degrees relative to ADU5-aft-fore) at the peaks.

Assumes the event has been correlated and reconstructed. These peaks must be separated by the PEAK_PHI_DEG_RANGE in phi (Degrees) and PEAK_THETA_DEG_RANGE in theta (Degrees)

Definition at line 501 of file CrossCorrelator.cxx.

Double_t CrossCorrelator::getBin0PhiDeg ( )

Single function to get the angle of the first bin of the interferometric histogram.

Returns
position of antenna 0 in ADU5Pat coordinates, offset by half a phi-sector.

Definition at line 128 of file CrossCorrelator.cxx.

void CrossCorrelator::getCoarsePeakInfo ( AnitaPol::AnitaPol_t  pol,
Int_t  peakIndex,
Double_t &  value,
Double_t &  phiDeg,
Double_t &  thetaDeg 
)

Gets the results from the coarse reconstruction.

Parameters
polis the polarization of interest
peakIndexruns from 0 to MAX_NUM_PEAKS and indexes the peak (0 is the largest).
valueis the bin content of the image peak.
phiDegis the phi coordinate in degrees.
thetaDegis the theta coordinate in degrees.

Definition at line 623 of file CrossCorrelator.cxx.

TGraph * CrossCorrelator::getCrossCorrelationGraph ( AnitaPol::AnitaPol_t  pol,
Int_t  ant1,
Int_t  ant2 
)

Turns internal correlation arrays into TGraphs to be seen by humans.

Parameters
polis the polarization.
ant1is the first antenna.
ant2is the second antenna.
Returns
the cross-correlation TGraph.

Definition at line 2196 of file CrossCorrelator.cxx.

TGraph * CrossCorrelator::getCrossCorrelationGraphWorker ( Int_t  numSamps,
AnitaPol::AnitaPol_t  pol,
Int_t  ant1,
Int_t  ant2 
)

Called by wrapper functions. Turns internal correlation arrays into TGraphs to be seen by humans.

Parameters
numSampstells this function whether to use the interpolated or un-interpolated correlations.
polis the polarization.
ant1is the first antenna.
ant2is the second antenna.
Returns
the cross-correlation TGraph.

Definition at line 2138 of file CrossCorrelator.cxx.

Double_t CrossCorrelator::getDeltaTExpected ( AnitaPol::AnitaPol_t  pol,
Int_t  ant1,
Int_t  ant2,
Double_t  phiWave,
Double_t  thetaWave 
)

Function to calculate the time taken by a plane wave to cross the payload.

Parameters
polis the polarization of the antennas
ant1is the first antenna
ant2is the second antenna
phiWaveis the phi direction of the incoming wave in radians (relative to the ADU5)
thetaWaveis the theta direction of the incoming wave in radians (relative to the ADU5)
Returns
time at ant2 - time at ant1 in ns.

Definition at line 1126 of file CrossCorrelator.cxx.

void CrossCorrelator::getFinePeakInfo ( AnitaPol::AnitaPol_t  pol,
Int_t  peakIndex,
Double_t &  value,
Double_t &  phiDeg,
Double_t &  thetaDeg 
)

Gets the results from the fine reconstruction.

Parameters
polis the polarization of interest
peakIndexruns from 0 to MAX_NUM_PEAKS and indexes the peak (0 is the largest).
valueis the bin content of the image peak.
phiDegis the phi coordinate in degrees.
thetaDegis the theta coordinate in degrees.

Definition at line 656 of file CrossCorrelator.cxx.

Double_t CrossCorrelator::getInterpolatedUpsampledCorrelationValue ( AnitaPol::AnitaPol_t  pol,
Int_t  combo,
Double_t  deltaT 
)

Linearly interpolates between upsampled correlation points.

Parameters
polis polarization of the antenna pair.
combois the index of the antenna pair.
deltaTis the time to interpolate the correlation values at.
Returns
the interpolated upsampled correlation value.

Definition at line 1403 of file CrossCorrelator.cxx.

TH2D * CrossCorrelator::getMap ( AnitaPol::AnitaPol_t  pol,
Double_t &  peakValue,
Double_t &  peakPhiDeg,
Double_t &  peakThetaDeg,
UShort_t  l3TrigPattern = ALL_PHI_TRIGS 
)

Gets an actual histogram of the zoomed in map.

Parameters
polis the polarization
peakValueis the bin content of the image peak.
peakPhiDegis the phi coordinate in degrees.
peakThetaDegis the theta coordinate in degrees.
l3TrigPatternis a bit mask of the phi-sectors to use in reconstruct, default value is ALL_PHI_TRIGS (=0xffff).
Returns
the TH2D histogram

Definition at line 1442 of file CrossCorrelator.cxx.

void CrossCorrelator::getMaxCorrelationTimeValue ( AnitaPol::AnitaPol_t  pol,
Int_t  combo,
Double_t &  time,
Double_t &  value 
)

Get the maximum correlation time and value from a polarization and antenna combo index.

Parameters
polis the polarization of the antenna combo
combois the index of the combination (see comboIndices[NUM_SEAVEYS][NUM_SEAVEYS])
timeis reference variable, updated with the maximum correlation time.
valueis a reference variable, updated with the correlation coefficient at time.

You probably want to call getMaxCorrelationTimeValue(AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2, Double_t& time, Double_t& value) instead.

Definition at line 954 of file CrossCorrelator.cxx.

void CrossCorrelator::getMaxCorrelationTimeValue ( AnitaPol::AnitaPol_t  pol,
Int_t  ant1,
Int_t  ant2,
Double_t &  time,
Double_t &  value 
)

Get the maximum correlation time and value from a polarization and pair of antennas.

Parameters
polis the polarization of the antenna combo
ant1is the first antenna
ant2is the second antenna
timeis reference variable, updated with the maximum correlation time.
valueis a reference variable, updated with the correlation coefficient at time.

Definition at line 977 of file CrossCorrelator.cxx.

void CrossCorrelator::getMaxUpsampledCorrelationTimeValue ( AnitaPol::AnitaPol_t  pol,
Int_t  combo,
Double_t &  time,
Double_t &  value 
)

Get the maximum upsampled correlation time and value from a polarization and antenna combo index.

Parameters
polis the polarization of the antenna combo
combois the index of the combination (see comboIndices[NUM_SEAVEYS][NUM_SEAVEYS])
timeis reference variable, updated with the maximum correlation time.
valueis a reference variable, updated with the correlation coefficient at time.

Definition at line 996 of file CrossCorrelator.cxx.

void CrossCorrelator::getMaxUpsampledCorrelationTimeValue ( AnitaPol::AnitaPol_t  pol,
Int_t  ant1,
Int_t  ant2,
Double_t &  time,
Double_t &  value 
)

Get the maximum upsampled correlation time and value from a polarization and pair of antennas.

Parameters
polis the polarization of the antenna combo
ant1is the first antenna
ant2is the second antenna
timeis reference variable, updated with the maximum correlation time.
valueis a reference variable, updated with the correlation coefficient at time.

Definition at line 1019 of file CrossCorrelator.cxx.

void CrossCorrelator::getNormalizedInterpolatedTGraphs ( UsefulAnitaEvent *  usefulEvent,
AnitaPol::AnitaPol_t  pol 
)

Makes evenly re-sampled, normalized waveform graphs from the UsefulAnitaEvent.

Parameters
usefulEventpoints to the UsefulAnitaEvent of interest.
polis the polarization of interest.

Definition at line 296 of file CrossCorrelator.cxx.

Int_t CrossCorrelator::getPhiSectorOfAntennaClosestToPhiDeg ( AnitaPol::AnitaPol_t  pol,
Double_t  phiDeg 
)

Finds the phi-sector closest to a particular phi direction.

Parameters
polis the polarization.
phiDegis the azimuthal direction (Degrees) relative to ADU5 aft-fore.
Returns
the phiSector (0->15)

Definition at line 2229 of file CrossCorrelator.cxx.

TGraph * CrossCorrelator::getUpsampledCrossCorrelationGraph ( AnitaPol::AnitaPol_t  pol,
Int_t  ant1,
Int_t  ant2 
)

Turns internal upsampled correlation arrays into TGraphs to be seen by humans.

Parameters
polis the polarization.
ant1is the first antenna.
ant2is the second antenna.
Returns
the cross-correlation TGraph.

Definition at line 2213 of file CrossCorrelator.cxx.

TH2D * CrossCorrelator::getZoomMap ( AnitaPol::AnitaPol_t  pol)

Gets an actual histogram of the zoomed in map.

Parameters
polis the polarization
Returns
the TH2D histogram

Definition at line 1502 of file CrossCorrelator.cxx.

TH2D * CrossCorrelator::initializeNewCombinatorics ( )

Function to loop over the coarse map and check which antenna pairs we should use

Returns
a map of the normalization as a function of angle.

Definition at line 145 of file CrossCorrelator.cxx.

TGraph * CrossCorrelator::interpolateWithStartTimeAndZeroMean ( TGraph *  grIn,
Double_t  startTime,
Double_t  dt,
Int_t  nSamp 
)

Creates an interpolated TGraph with zero mean.

Parameters
grInis a TGraph containing the waveform to interpolate / pad
startTimeis the time to begin the interpolation
dtis the step size to interpolate with
nSampis the number of samples to pad to.
Returns
a new TGraph containing the zero meaned, interpolated TGraph.

Definition at line 233 of file CrossCorrelator.cxx.

TGraph * CrossCorrelator::makeCoherentlySummedWaveform ( AnitaPol::AnitaPol_t  pol,
Double_t  phiDeg,
Double_t  thetaDeg,
Int_t  maxDeltaPhiSect,
Double_t &  snr 
)

Creates the coherently summed waveform from the FFTs held in memory.

Parameters
polis the polarization
phiDegis the incoming phi direction (Degrees) relative to the ADU5 aft-fore.
thetaDegis the incoming theta direction (Degrees).
maxDeltaPhiSectis the number of phi-sectors to contribute either side of the incoming phi-direction.
snris an estimate of the signal-to-noise ratio of the coherently summed waveform, using the local max-to-min of the coherent waveform and the rms of the first few ns of the contributing uninterpolated waveforms.
Returns
the coherently summed waveform made from the (non-padded) ffts.

Definition at line 2275 of file CrossCorrelator.cxx.

TGraph * CrossCorrelator::makeCoherentWorker ( AnitaPol::AnitaPol_t  pol,
Double_t  phiDeg,
Double_t  thetaDeg,
Int_t  maxDeltaPhiSect,
Double_t &  snr,
Int_t  nSamp 
)

Worker function to create the coherently summed waveform from either the regular ffts or the padded ffts.

Parameters
polis the polarization
phiDegis the incoming phi direction (Degrees) relative to the ADU5 aft-fore.
thetaDegis the incoming theta direction (Degrees).
maxDeltaPhiSectis the number of phi-sectors to contribute either side of the incoming phi-direction.
snris an estimate of the signal-to-noise ratio of the coherently summed waveform, using the local max-to-min of the coherent waveform and the rms of the first few ns of the contributing uninterpolated waveforms.
nSampis the number of samples in the time domain of the ffts (numSamples or numSamplesUpsampled)
Returns
the coherently summed waveform.

Definition at line 2296 of file CrossCorrelator.cxx.

TH2D * CrossCorrelator::makeGlobalImage ( AnitaPol::AnitaPol_t  pol,
Double_t &  imagePeak,
Double_t &  peakPhiDeg,
Double_t &  peakThetaDeg 
)

Creates an interferometric map using plane wave deltaTs and antenna pairs from all phi-sectors.

Parameters
polis the polarization.
imagePeakis the maximum value.
peakPhiDegis azimuth of the maximum value (Degrees) relative to the ADU5 aft-fore.
peakThetaDegis the elevation of the maximum value (Degrees).
Returns
the interferometric map.

Definition at line 1544 of file CrossCorrelator.cxx.

TH2D * CrossCorrelator::makeGlobalImage ( AnitaPol::AnitaPol_t  pol)

Creates an interferometric map using plane wave deltaTs and antenna pairs from all phi-sectors.

Parameters
polis the polarization.
Returns
the interferometric map.

Definition at line 1565 of file CrossCorrelator.cxx.

void * CrossCorrelator::makeSomeOfImageThreaded ( void *  voidPtrArgs)
static

Static member function which fills the interferometric maps.

Parameters
voidPtrArgscontains a pointer to a CrossCorrelator::threadArgs struct

This function contains the meat and bones of this class. I've really tried to optimize this for speed, which means it's not very readable, sorry.

Definition at line 1752 of file CrossCorrelator.cxx.

void * CrossCorrelator::makeSomeOfZoomImageThreaded ( void *  voidPtrArgs)
static

Static member function which fills the interferometric maps.

Parameters
voidPtrArgscontains a pointer to a CrossCorrelator::threadArgs struct

This function contains the meat and bones of this class. I've really tried to optimize this for speed, which means it's not very readable, sorry.

Definition at line 1922 of file CrossCorrelator.cxx.

TH2D * CrossCorrelator::makeTriggeredImage ( AnitaPol::AnitaPol_t  pol,
Double_t &  imagePeak,
Double_t &  peakPhiDeg,
Double_t &  peakThetaDeg,
UShort_t  l3TrigPattern 
)

Creates an interferometric map using plane wave deltaTs and l3Triggered pairs from all phi-sectors.

Parameters
polis the polarization.
imagePeakis the maximum value.
peakPhiDegis azimuth of the maximum value (Degrees) relative to the ADU5 aft-fore.
peakThetaDegis the elevation of the maximum value (Degrees).
l3TrigPatternis the L3 trigger pattern, determines what antenna pairs to use in the recontruction.
Returns
the interferometric map.

Definition at line 1585 of file CrossCorrelator.cxx.

TGraph * CrossCorrelator::makeUpsampledCoherentlySummedWaveform ( AnitaPol::AnitaPol_t  pol,
Double_t  phiDeg,
Double_t  thetaDeg,
Int_t  maxDeltaPhiSect,
Double_t &  snr 
)

Creates the coherently summed waveform from the zero padded FFTs held in memory.

Parameters
polis the polarization
phiDegis the incoming phi direction (Degrees) relative to the ADU5 aft-fore.
thetaDegis the incoming theta direction (Degrees).
maxDeltaPhiSectis the number of phi-sectors to contribute either side of the incoming phi-direction.
snris an estimate of the signal-to-noise ratio of the coherently summed waveform, using the local max-to-min of the coherent waveform and the rms of the first few ns of the contributing uninterpolated waveforms.
Returns
the upsampled coherently summed waveform made from the zero padded ffts.

Definition at line 2255 of file CrossCorrelator.cxx.

TH2D * CrossCorrelator::makeZoomedImage ( AnitaPol::AnitaPol_t  pol,
UShort_t  l3TrigPattern,
Double_t  zoomCenterPhiDeg,
Double_t  zoomCenterThetaDeg 
)

Creates an interferometric map using plane wave deltaTs centered around a particular phi/theta.

Parameters
polis the polarization.
l3TrigPatternis the L3 trig pattern, determines what antenna pairs to use in the recontruction.
zoomCenterPhiDegis azimuth to center the zoomed image on (Degrees) relative to the ADU5 aft-fore.
zoomCenterThetaDegis the elevation to center the zoomed image on (Degrees).
Returns
the interferometric map.

Definition at line 1667 of file CrossCorrelator.cxx.

TH2D * CrossCorrelator::makeZoomedImage ( AnitaPol::AnitaPol_t  pol,
Double_t &  imagePeak,
Double_t &  peakPhiDeg,
Double_t &  peakThetaDeg,
UShort_t  l3TrigPattern,
Double_t  zoomCenterPhiDeg,
Double_t  zoomCenterThetaDeg 
)

Creates an interferometric map using plane wave deltaTs centered around a particular phi/theta.

Parameters
polis the polarization.
imagePeakis the maximum value.
peakPhiDegis azimuth of the maximum value (Degrees) relative to the ADU5 aft-fore.
peakThetaDegis the elevation of the maximum value (Degrees).
l3TrigPatternis the L3 trig pattern, determines what antenna pairs to use in the recontruction.
zoomCenterPhiDegis azimuth to center the zoomed image on (Degrees) relative to the ADU5 aft-fore.
zoomCenterThetaDegis the elevation to center the zoomed image on (Degrees).
Returns
the interferometric map.

Definition at line 1641 of file CrossCorrelator.cxx.

TH2D * CrossCorrelator::makeZoomedImage ( AnitaPol::AnitaPol_t  pol,
Double_t &  imagePeak,
Double_t &  peakPhiDeg,
Double_t &  peakThetaDeg,
Double_t  zoomCenterPhiDeg,
Double_t  zoomCenterThetaDeg 
)

Creates an interferometric map using plane wave deltaTs centered around a particular phi/theta.

Parameters
polis the polarization.
imagePeakis the maximum value.
peakPhiDegis azimuth of the maximum value (Degrees) relative to the ADU5 aft-fore.
peakThetaDegis the elevation of the maximum value (Degrees).
zoomCenterPhiDegis azimuth to center the zoomed image on (Degrees) relative to the ADU5 aft-fore.
zoomCenterThetaDegis the elevation to center the zoomed image on (Degrees).
Returns
the interferometric map.

Definition at line 1612 of file CrossCorrelator.cxx.

void CrossCorrelator::reconstruct ( AnitaPol::AnitaPol_t  pol,
Double_t &  imagePeak,
Double_t &  peakPhiDeg,
Double_t &  peakThetaDeg 
)

Wrapper function which launches the threaded functions, which fill the interferometric maps.

Parameters
polis the polarization.
imagePeakis the maximum value.
peakPhiDegis azimuth of the maximum value (Degrees) relative to the ADU5 aft-fore.
peakThetaDegis the elevation of the maximum value (Degrees).

This function is also responsible for merging the peak finding results of each of the threads.

Definition at line 1698 of file CrossCorrelator.cxx.

void CrossCorrelator::reconstructEvent ( UsefulAnitaEvent *  usefulEvent,
Int_t  numFinePeaks = MAX_NUM_PEAKS,
Int_t  numCoarsePeaks = MAX_NUM_PEAKS 
)

Reconstruct event.

Parameters
usefulEventis the event to process
numFinePeaksis the number of fine peaks to reconstruct (should be >= numCoarsePeaks but < MAX_NUM_PEAKS)
numCoarsePeaksis the number of coarse peaks to reconstruct (should < MAX_NUM_PEAKS)

Wraps the key reconstruction algorithms and puts the results in internal memory.

Definition at line 577 of file CrossCorrelator.cxx.

void CrossCorrelator::reconstructZoom ( AnitaPol::AnitaPol_t  pol,
Double_t &  imagePeak,
Double_t &  peakPhiDeg,
Double_t &  peakThetaDeg,
Double_t  zoomCenterPhiDeg = 0,
Double_t  zoomCenterThetaDeg = 0 
)

Wrapper function which launches the threaded functions, which fill the zoomed maps.

Parameters
polis the polarization.
imagePeakis the maximum value.
peakPhiDegis azimuth of the maximum value (Degrees) relative to the ADU5 aft-fore.
peakThetaDegis the elevation of the maximum value (Degrees).
zoomCenterPhiDegshould be the phi (deg) of the coarse map to reconstruct around.
zoomCenterThetaDegshould be the theta (deg) of the coarse map to reconstruct around.

This function is also responsible for merging the peak finding results of each of the threads.

Definition at line 1843 of file CrossCorrelator.cxx.

Double_t CrossCorrelator::relativeOffAxisDelay ( AnitaPol::AnitaPol_t  pol,
Int_t  ant1,
Int_t  ant2,
Double_t  phiDeg 
)

Get the relative off-axis delay between an antenna pair.

Parameters
polis the polarization of the plane wave.
ant1is the first antenna.
ant2is the second antenna.
phiDegis the angle of the planewave in Degrees relative to ADU5-aft-fore.
Returns
the difference between the off-axis delays of the two antennas.

Definition at line 1088 of file CrossCorrelator.cxx.

void CrossCorrelator::renormalizeFourierDomain ( AnitaPol::AnitaPol_t  pol,
Int_t  ant 
)

Scales the fft such that the inverse fft would have mean=0 and rms=1. For use after notching.

Parameters
polis the polarization of interest
antis the antenna to filter

Definition at line 460 of file CrossCorrelator.cxx.

void CrossCorrelator::simple260MHzSatelliteNotch ( AnitaPol::AnitaPol_t  pol,
Int_t  ant 
)

Applies a 52MHz wide notch centered at 260 MHz to filter the most problematic satellite frequency.

Parameters
polis the polarization of interest
antis the antenna to filter

Definition at line 400 of file CrossCorrelator.cxx.

void CrossCorrelator::simple370MHzSatelliteNotch ( AnitaPol::AnitaPol_t  pol,
Int_t  ant 
)

Applies a 40MHz wide notch centered at 370 MHz to filter another satellite frequency.

Parameters
polis the polarization of interest
antis the antenna to filter

Definition at line 415 of file CrossCorrelator.cxx.

void CrossCorrelator::simpleNotch ( AnitaPol::AnitaPol_t  pol,
Int_t  ant,
Double_t  notchLowEdgeMHz,
Double_t  notchHighEdgeMHz 
)

Applies a simple notch between the given frequencies.

Parameters
polis the polarization of interest
antis the antenna to filter
notchLowEdgeMHzis the low edge of the notch in MHz
notchHighEdgeMHzis the high edge of the notch in MHz

Definition at line 433 of file CrossCorrelator.cxx.

Double_t CrossCorrelator::singleAntennaOffAxisDelay ( Double_t  deltaPhiDeg)

Get the off-axis delay for an off boresight angle.

Parameters
deltaPhiDegis the angle (Degrees) of the plane wave relative to an antenna boresight.
Returns
the delay relative to boresight in nano-seconds.

Definition at line 1036 of file CrossCorrelator.cxx.

Bool_t CrossCorrelator::useCombo ( Int_t  ant1,
Int_t  ant2,
Int_t  phiSector,
Int_t  deltaPhiSect 
)

This function encodes whether a pair of antennas should be used in a particular phi sector.

Parameters
ant1is the first antenna
ant2is the second antenna
phiSectoris the phi-sector being considered
deltaPhiSectis the range of phi-sectors to allow in the reconstruction. Note that deltaPhiSect < 0 implies that one antenna must be in phiSector, but allows a range out to abs(deltaPhiSect).

This function gets used when comparing different reconstruction strategies by member variable kDeltaPhiSect.

Definition at line 1339 of file CrossCorrelator.cxx.


The documentation for this class was generated from the following files: