Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Acclaim::FourierBuffer Class Reference

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 RayleighHistgetRayleighDistribution (Int_t ant, AnitaPol::AnitaPol_t pol, Int_t freqBin) const
 
unsigned getN (int ant, AnitaPol::AnitaPol_t pol) const
 
TGraphFBgetAvePowSpec_dB (Int_t ant, AnitaPol::AnitaPol_t pol, int lastNEvents=-1) const
 
TGraphFBgetAvePowSpec (Int_t ant, AnitaPol::AnitaPol_t pol, int lastNEvents=-1) const
 
TGraphFBgetBackground_dB (Int_t ant, AnitaPol::AnitaPol_t pol, int lastNEvents=-1) const
 
TGraphFBgetBackground (Int_t ant, AnitaPol::AnitaPol_t pol, int lastNEvents=-1) const
 
TGraphFBgetReducedChiSquaresOfRayelighDistributions (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.
 
TGraphFBgetSelectedGraphForSummary (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< TGraphFBgrReducedChiSquares [AnitaPol::kNotAPol]
 
std::vector< TGraphFBgrChiSquares [AnitaPol::kNotAPol]
 
std::vector< TGraphFBgrChiSquaresRelativeToSpectrum [AnitaPol::kNotAPol]
 
std::vector< TGraphFBgrReducedChiSquaresRelativeToSpectrum [AnitaPol::kNotAPol]
 
std::vector< TGraphFBgrNDFs [AnitaPol::kNotAPol]
 
std::vector< TGraphFBgrSpectrumAmplitudes [AnitaPol::kNotAPol]
 
std::vector< TGraphFBgrAmplitudes [AnitaPol::kNotAPol]
 
std::vector< TGraphFBgrLastAmps [AnitaPol::kNotAPol]
 
std::vector< TGraphFBgrProbs [AnitaPol::kNotAPol]
 

Friends

class RayleighHist
 

Detailed Description

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.

Collaboration diagram for Acclaim::FourierBuffer:
Collaboration graph
[legend]

Constructor & Destructor Documentation

Acclaim::FourierBuffer::FourierBuffer ( Int_t  theBufferSize = 1000)
explicit

Constructor for FourierBuffer.

Parameters
theBufferSizeis the number of events to average over

Definition at line 32 of file FourierBuffer.cxx.

Member Function Documentation

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.

Parameters
fEvis the event to add
Returns
the number of events in the FourierBuffer

Definition at line 209 of file FourierBuffer.cxx.

void Acclaim::FourierBuffer::automagicallyLoadHistory ( const FilteredAnitaEvent fEv)
protected

Function which loops through old events so that the FourierBuffer is filled.

Parameters
fEv

Definition at line 500 of file FourierBuffer.cxx.

void Acclaim::FourierBuffer::initVectors ( int  n,
double  df 
)
protected

Initialise all internal vectors.

Parameters
nis the number of frequency bins
dfis 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

Parameters
polis the polarisation of the amplitudes to histogram
antis the antenna of the amplitudes to histogram
padis a pointer to the TPad to draw on
drawOptis the ROOT draw option
Returns
the created histogram

Definition at line 443 of file FourierBuffer.cxx.

Int_t Acclaim::FourierBuffer::removeOld ( )
protected

Remove data from the dequeues while their size is greater than the buffer size.

Returns
the number of events removed

Definition at line 471 of file FourierBuffer.cxx.


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