A a glorified ring buffer of frequency amplitudes with a TSpectrum to look for CW spikes. More...
#include <FourierBuffer.h>
Public Types | |
enum | SummaryOption_t { None, Chisquare, ReducedChisquare, NDF, RayleighAmplitude, Prob } |
Public Member Functions | |
virtual | ~FourierBuffer () |
Destructor. | |
FourierBuffer (Int_t theBufferSize=1000) | |
Constructor for FourierBuffer. More... | |
size_t | add (const FilteredAnitaEvent *fEv) |
Adds an event to the FourierBuffer. More... | |
Double_t | getProb (AnitaPol::AnitaPol_t pol, Int_t ant, Int_t freqBin) const |
Double_t | getBackgroundSpectrumAmp (AnitaPol::AnitaPol_t pol, Int_t ant, Int_t freqBin) const |
const std::vector< double > & | getPowerRingBufferBack (AnitaPol::AnitaPol_t pol, int ant) |
const RayleighHist * | getRayleighDistribution (Int_t ant, AnitaPol::AnitaPol_t pol, Int_t freqBin) const |
unsigned | getN (int ant, AnitaPol::AnitaPol_t pol) const |
TGraphFB * | getAvePowSpec_dB (Int_t ant, AnitaPol::AnitaPol_t pol, int lastNEvents=-1) const |
TGraphFB * | getAvePowSpec (Int_t ant, AnitaPol::AnitaPol_t pol, int lastNEvents=-1) const |
TGraphFB * | getBackground_dB (Int_t ant, AnitaPol::AnitaPol_t pol, int lastNEvents=-1) const |
TGraphFB * | getBackground (Int_t ant, AnitaPol::AnitaPol_t pol, int lastNEvents=-1) const |
TGraphFB * | getReducedChiSquaresOfRayelighDistributions (Int_t ant, AnitaPol::AnitaPol_t pol) const |
void | drawSummary (TPad *pad, SummaryOption_t) const |
unsigned | getCurrentBufferSize () const |
const std::vector< double > & | getChiSquares (int ant, AnitaPol::AnitaPol_t pol) const |
const std::vector< double > & | getChiSquaresRelativeToSpectrum (int ant, AnitaPol::AnitaPol_t pol) const |
const std::vector< int > & | getNDFs (int ant, AnitaPol::AnitaPol_t pol) const |
const std::vector< double > & | getRayleighAmplitudes (int ant, AnitaPol::AnitaPol_t pol) const |
const std::vector< double > & | getBackgroundSpectrumAmplitudes (int ant, AnitaPol::AnitaPol_t pol) const |
const std::vector< double > & | getProbabilities (int ant, AnitaPol::AnitaPol_t pol) const |
const std::vector< double > & | getChanChiSquares (int ant, AnitaPol::AnitaPol_t pol) const |
TH1D * | makeChanChisquareHist (AnitaPol::AnitaPol_t pol, Int_t ant, TPad *pad, const char *drawOpt) const |
Histogram the event frequency bin amplitudes squared, divided by the rayleigh distribution amplitude squared. More... | |
void | getMeanVarChanChiSquares (int ant, AnitaPol::AnitaPol_t pol, double mean, double var) const |
int | getNumEventsInBuffer () const |
void | setForceLoadHistory (bool f) const |
bool | isAlfaBandpassed (int ant, AnitaPol::AnitaPol_t pol) const |
Protected Member Functions | |
Int_t | removeOld () |
Remove data from the dequeues while their size is greater than the buffer size. More... | |
void | initVectors (int n, double df) |
Initialise all internal vectors. More... | |
void | initGraphAndVector (std::vector< double > vec[][NUM_SEAVEYS], std::vector< TGraphFB > *gr, int n, double df, double defaultVal) |
Initialise an internal vector and TGraphFB with with an appropriate set of default values. | |
TGraphFB * | getSelectedGraphForSummary (SummaryOption_t choice, int ant, AnitaPol::AnitaPol_t pol) const |
void | automagicallyLoadHistory (const FilteredAnitaEvent *fEv) |
Function which loops through old events so that the FourierBuffer is filled. More... | |
void | getBackgroundSpectrum (double *y, int n) const |
Protected Attributes | |
Int_t | bufferSize |
std::deque< UInt_t > | eventNumbers |
std::deque< Int_t > | runs |
std::deque< std::vector< double > > | powerRingBuffers [AnitaPol::kNotAPol][NUM_SEAVEYS] |
std::vector< double > | sumPowers [AnitaPol::kNotAPol][NUM_SEAVEYS] |
std::vector< RayleighHist * > | hRays [AnitaPol::kNotAPol][NUM_SEAVEYS] |
std::vector< double > | chiSquares [AnitaPol::kNotAPol][NUM_SEAVEYS] |
std::vector< double > | chiSquaresRelativeToSpectrum [AnitaPol::kNotAPol][NUM_SEAVEYS] |
std::vector< int > | ndfs [AnitaPol::kNotAPol][NUM_SEAVEYS] |
std::vector< double > | fitAmplitudes [AnitaPol::kNotAPol][NUM_SEAVEYS] |
std::vector< double > | spectrumAmplitudes [AnitaPol::kNotAPol][NUM_SEAVEYS] |
std::vector< double > | lastAmps [AnitaPol::kNotAPol][NUM_SEAVEYS] |
std::vector< double > | probs [AnitaPol::kNotAPol][NUM_SEAVEYS] |
std::vector< double > | chanChiSquares [AnitaPol::kNotAPol][NUM_SEAVEYS] |
double | meanChanChiSquare [AnitaPol::kNotAPol][NUM_SEAVEYS] |
double | varChanChiSquare [AnitaPol::kNotAPol][NUM_SEAVEYS] |
TF1 * | fRay |
Int_t | fNumSkipped |
Incremented when skipping a payload blast or SURF saturation event, currently only for debugging. | |
bool | doneVectorInit |
Do we need to allocate a bunch of memory? (Do this dynamically to avoid MagicDisplay being slow) | |
bool | fCurrentlyLoadingHistory |
bool | fForceLoadHistory |
int | eventsInBuffer |
double | df |
double | fMinFitFreq |
double | fMaxFitFreq |
TSpectrum * | fSpectrum |
double | fMinSpecFreq |
double | fMaxSpecFreq |
TPad * | summaryPads [NUM_SEAVEYS] |
std::vector< TGraphFB > | grReducedChiSquares [AnitaPol::kNotAPol] |
std::vector< TGraphFB > | grChiSquares [AnitaPol::kNotAPol] |
std::vector< TGraphFB > | grChiSquaresRelativeToSpectrum [AnitaPol::kNotAPol] |
std::vector< TGraphFB > | grReducedChiSquaresRelativeToSpectrum [AnitaPol::kNotAPol] |
std::vector< TGraphFB > | grNDFs [AnitaPol::kNotAPol] |
std::vector< TGraphFB > | grSpectrumAmplitudes [AnitaPol::kNotAPol] |
std::vector< TGraphFB > | grAmplitudes [AnitaPol::kNotAPol] |
std::vector< TGraphFB > | grLastAmps [AnitaPol::kNotAPol] |
std::vector< TGraphFB > | grProbs [AnitaPol::kNotAPol] |
Friends | |
class | RayleighHist |
A a glorified ring buffer of frequency amplitudes with a TSpectrum to look for CW spikes.
More specifically, it holds an array of specialised histograms (RayleighHist), one for each channel. Each of those histograms has an internal RingBuffer, the histogram is updated as events are added/removed. The RayleighHists can try to fit a Rayleigh distribution, or can quantify how well the distribution matches a given frequency,
Definition at line 42 of file FourierBuffer.h.
|
explicit |
Constructor for FourierBuffer.
theBufferSize | is the number of events to average over |
Definition at line 32 of file FourierBuffer.cxx.
size_t Acclaim::FourierBuffer::add | ( | const FilteredAnitaEvent * | fEv | ) |
Adds an event to the FourierBuffer.
This is the workhorse function... Finds all the frequency bin amplitudes for each channel in the event, and adds them to the approprate RayleighHist. Maybe tells the RayleighHists to fit for the rayleigh amplitude. Generates a bunch of goodness of fit (chi-square) measures for the event.
fEv | is the event to add |
Definition at line 209 of file FourierBuffer.cxx.
|
protected |
Function which loops through old events so that the FourierBuffer is filled.
fEv |
Definition at line 500 of file FourierBuffer.cxx.
|
protected |
Initialise all internal vectors.
n | is the number of frequency bins |
df | is the width of the frequench bins in GHz |
Definition at line 96 of file FourierBuffer.cxx.
TH1D * Acclaim::FourierBuffer::makeChanChisquareHist | ( | AnitaPol::AnitaPol_t | pol, |
Int_t | ant, | ||
TPad * | pad, | ||
const char * | drawOpt | ||
) | const |
Histogram the event frequency bin amplitudes squared, divided by the rayleigh distribution amplitude squared.
Creates a histogram of the chi-square distribution of the event rayleigh amplitude squared, divided by the rayleigh distribution amplitude squared. This give a chi-square distribution with two degrees of freedom due to the two underlying gaussian distributed d.o.f. in the rayleigh distribution. This is assuming that the underlying gaussian distributions have a mean of zero, which is a good assumption given that even the CW bins are well described by a rayleigh distribution
pol | is the polarisation of the amplitudes to histogram |
ant | is the antenna of the amplitudes to histogram |
pad | is a pointer to the TPad to draw on |
drawOpt | is the ROOT draw option |
Definition at line 443 of file FourierBuffer.cxx.
|
protected |
Remove data from the dequeues while their size is greater than the buffer size.
Definition at line 471 of file FourierBuffer.cxx.