Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Acclaim::AnalysisFlow Class Reference

High level interface to join up the various bits of the analysis. More...

#include <AnalysisFlow.h>

Public Types

enum  selection { kAll, kWaisPulser, kDecimated }
 A human readable method of selecting the set of events to process, this can be expanded as required,. More...
 

Public Member Functions

 AnalysisFlow (CmdLineArgs *args, FilterStrategy *filterStrat=NULL)
 Preferred constructor. More...
 
 ~AnalysisFlow ()
 Destructor.
 
void doAnalysis (Long64_t startAtThisEntry=-1)
 
AnitaEventSummarydoEntry (Long64_t entry)
 
AnitaEventSummarydoEvent (UInt_t eventNumber)
 
AnalysisRecogetReco ()
 
FilteredAnitaEventgetEvent ()
 
const AnitaDatasetgetData ()
 
Long64_t firstEntry ()
 
Long64_t lastEntry ()
 
Int_t GetDebug () const
 Get the value of fDebug.
 
void SetDebug (Int_t val)
 Set the value of fDebug.
 
Int_t GetDoAll () const
 Get the value of fDoAll.
 
void SetDoAll (Int_t val)
 Set the value of fDoAll.
 
Int_t GetBlindStrat () const
 Get the value of fBlindStrat as an integer. More...
 
AnitaDataset::BlindingStrategy GetEnumBlindStrat () const
 Get the value of fBlindStrat as AnalysisFlow::selection enum. More...
 
void SetBlindStrat (Int_t val)
 Set the value of fBlindStrat from an integer value. More...
 
void SetBlindStrat (AnitaDataset::BlindingStrategy val)
 Set the value of fBlindStrat from an enum value. More...
 
Double_t GetNoiseTimeScaleSeconds () const
 Get the value of fNoiseTimeScaleSeconds. More...
 
void SetNoiseTimeScaleSeconds (Double_t val)
 Set the value of fNoiseTimeScaleSeconds. More...
 
Int_t GetNoiseEvenWaveforms () const
 Get the value of fNoiseEvenWaveforms. More...
 
void SetNoiseEvenWaveforms (Int_t val)
 Set the value of fNoiseEvenWaveforms. More...
 
Int_t GetOutFileCompressionLevel () const
 Get the value of fOutFileCompressionLevel. More...
 
void SetOutFileCompressionLevel (Int_t val)
 Set the value of fOutFileCompressionLevel. More...
 
Int_t GetOutFileCompressionAlgo () const
 Get the value of fOutFileCompressionAlgo. More...
 
void SetOutFileCompressionAlgo (Int_t val)
 Set the value of fOutFileCompressionAlgo. More...
 
 ClassDef (AnalysisFlow, 0)
 Required for ROOT awareness of getter/setter functions. More...
 

Static Public Member Functions

static const char * selectionAsString (selection sel)
 

Protected Member Functions

void prepareDataSet ()
 Create the data set if not already done. More...
 
void prepareOutputFiles ()
 Coax the OutputConvention class into creating appropriately named output files. More...
 
Bool_t shouldIDoThisEvent (RawAnitaHeader *header, UsefulAdu5Pat *usefulPat)
 Applies high level event selection. More...
 
Bool_t isPulserWAIS (RawAnitaHeader *header, UsefulAdu5Pat *usefulPat)
 
Bool_t isPulserLDB (RawAnitaHeader *header, UsefulAdu5Pat *usefulPat)
 
void setPulserFlags (RawAnitaHeader *header, UsefulAdu5Pat *usefulPat, AnitaEventSummary *sum)
 
void prepareEverything (const char *preferredSettingsFileName=NULL)
 Initialize all input and output objects.
 
Bool_t checkForSgeTaskId ()
 Look for an environmental variable called SGE_TASK_ID for running on the hoffman2 cluster. More...
 

Protected Attributes

selection fSelection
 Which event selection is applied? More...
 
int fRun
 Which run in the data set should be is being processed?
 
int fNumDivisions
 For parallel processing the run is divided into this many portions.
 
int fDivision
 Which portion of the run to process (runs from 0 to fNumDivisions)
 
AnitaDatasetfData
 Rootified data handler.
 
Long64_t fFirstEntry
 The first entry to process (derived from fDivision and fNumDivisions)
 
Long64_t fLastEntry
 The final entry to process (derived from fDivision and fNumDivisions)
 
AnalysisRecofReco
 The reconstruction class, fills an AnitaEventSummary.
 
FilterStrategyfFilterStrat
 Which filter strategy is applied to the events.
 
AnalysisSettingsfSettings
 Contains configurable numbers parsed from an Acclaim analysis settings file.
 
AnitaEventSummaryfEventSummary
 The most recently filled AnitaEventSummary, updated after each event processed.
 
FilteredAnitaEventfEv
 The most recently produced FilteredAnitaEvent, updated after each event processed.
 
NoiseMonitorfNoiseMonitor
 Measures the noise.
 
UInt_t fLastEventConsidered
 Tracks the event numbers processed by the class.
 
TString fOutFileBaseName
 The meat of the output file name.
 
TFile * fOutFile
 the output file, will contain TTree of AnitaEventSummary
 
TTree * fSumTree
 The produced TTree of AnitaEventSummary.
 
Int_t fDebug
 Controls the printing of debug info, feel free to wrap noisy stderr messages with if(fDebug),. More...
 
Int_t fDoAll
 Process all events (that won't crash the analysis software) regardless of quality. More...
 
AnitaDataset::BlindingStrategy fBlindStrat
 The blinding strategy with which to initialize fData. More...
 
Double_t fNoiseTimeScaleSeconds
 The N value for SNR measurements, comes from waveform RMS in nearby min-bias triggers, this variable controls how long to average over in seconds. More...
 
Int_t fNoiseEvenWaveforms
 Derived the noise value for RMS from the even or the uneven waveforms? Which choice is sensible will depend on the filter strategy, fFilterStrat. More...
 
Int_t fOutFileCompressionLevel
 What compression level for the ROOT output files? There's no reason not to set this to the maximum possible value. More...
 
Int_t fOutFileCompressionAlgo
 Which compression algorithm for the ROOT output files? More...
 

Detailed Description

High level interface to join up the various bits of the analysis.

AnalysisFlow takes care of event selection, loading input data, saving output data, and contains a template function to loop over said data while performing the analysis reconstruction

Definition at line 34 of file AnalysisFlow.h.

Inheritance diagram for Acclaim::AnalysisFlow:
Inheritance graph
[legend]
Collaboration diagram for Acclaim::AnalysisFlow:
Collaboration graph
[legend]

Member Enumeration Documentation

A human readable method of selecting the set of events to process, this can be expanded as required,.

See also
shouldIDoThisEvent(RawAnitaHeader* header, UsefulAdu5Pat* usefulPat) where the logic lives

Definition at line 42 of file AnalysisFlow.h.

Constructor & Destructor Documentation

Acclaim::AnalysisFlow::AnalysisFlow ( Acclaim::CmdLineArgs args,
FilterStrategy filterStrat = NULL 
)

Preferred constructor.

Also searches for the environment variable SGE_TASK_ID, which indicates this code is running on the hoffman2 cluster. If this is the case, then some of the passed variables (fRun, fDivision, fNumDivisions) are overwritten with information endoded in SGE_TASK_ID. This allows for easy cluster scripting.

Parameters
argscontains the command line arguments
filterStratis the filter stragtegy to use

Definition at line 15 of file AnalysisFlow.cxx.

Member Function Documentation

Bool_t Acclaim::AnalysisFlow::checkForSgeTaskId ( )
protected

Look for an environmental variable called SGE_TASK_ID for running on the hoffman2 cluster.

If it is found this function overrides the fRun, fDivision, fNumDivision members. A task array on the hoffman2 cluster gives each process a different SGE_TASK_ID so this is useful to make the analysis run in parallel.

Returns
true if the variable is present.

Definition at line 53 of file AnalysisFlow.cxx.

Acclaim::AnalysisFlow::ClassDef ( AnalysisFlow  ,
 
)

Required for ROOT awareness of getter/setter functions.

See also
AnalysisSettings
void Acclaim::AnalysisFlow::doAnalysis ( Long64_t  startAtThisEntry = -1)

Does the main analysis loop for all specified events

Parameters
startAtThisEntryoptional, (default = -1), if you wish force the analysis loop to start at a specific tree entry

Definition at line 443 of file AnalysisFlow.cxx.

AnitaEventSummary * Acclaim::AnalysisFlow::doEntry ( Long64_t  entry)

Does my analysis on a single event in AnitaDataset member fData trees, referenced by entry

Parameters
entryis the entry to process
Returns
the generated AnitaEventSummary, it is the caller's responsibility to delete this.

Definition at line 388 of file AnalysisFlow.cxx.

AnitaEventSummary * Acclaim::AnalysisFlow::doEvent ( UInt_t  eventNumber)

Does my analysis on a single event in AnitaDataset member fData trees, referenced by RawAnitaHeader::eventNumber

Parameters
eventNumberis the event to process, must be in the run and event selection!
Returns
the generated AnitaEventSummary, it is the caller's responsibility to delete this.

Definition at line 381 of file AnalysisFlow.cxx.

Long64_t Acclaim::AnalysisFlow::firstEntry ( )
inline

Get the first entry to be fetched in the fData

Returns
the value of fFirstEntry

Definition at line 132 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::GetBlindStrat ( ) const
inline

Get the value of fBlindStrat as an integer.

See also
AnalysisSettings

Definition at line 302 of file AnalysisFlow.h.

const AnitaDataset* Acclaim::AnalysisFlow::getData ( )
inline

Get a pointer to the contained AnitaDataset fData member

Returns
pointer to fData

Definition at line 126 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::GetEnumBlindStrat ( ) const
inline

Get the value of fBlindStrat as AnalysisFlow::selection enum.

See also
AnalysisSettings

Definition at line 302 of file AnalysisFlow.h.

FilteredAnitaEvent* Acclaim::AnalysisFlow::getEvent ( )
inline

Get a pointer to the FilteredAnitaEvent, fEv (this is mostly for MagicDisplay)

Returns
A poiner to the fEv

Definition at line 120 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::GetNoiseEvenWaveforms ( ) const
inline

Get the value of fNoiseEvenWaveforms.

See also
AnalysisSettings

Definition at line 338 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::GetNoiseTimeScaleSeconds ( ) const
inline

Get the value of fNoiseTimeScaleSeconds.

See also
AnalysisSettings

Definition at line 320 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::GetOutFileCompressionAlgo ( ) const
inline

Get the value of fOutFileCompressionAlgo.

See also
AnalysisSettings

Definition at line 373 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::GetOutFileCompressionLevel ( ) const
inline

Get the value of fOutFileCompressionLevel.

See also
AnalysisSettings

Definition at line 356 of file AnalysisFlow.h.

AnalysisReco* Acclaim::AnalysisFlow::getReco ( )
inline

Get a pointer to the AnalysisReco member, fReco, which does the hard work of event reconstruction

Returns
pointer to fData

Definition at line 114 of file AnalysisFlow.h.

Bool_t Acclaim::AnalysisFlow::isPulserLDB ( RawAnitaHeader header,
UsefulAdu5Pat usefulPat 
)
protected

Applies Linda's LDB pulser selection from the thesis(!) version of my analysis. Should still work, but I've not tested this in a while.

Parameters
headeris the event header
usefulPatis a usefulAdu5Pat object
Returns
true if the event matches the timing criteria

Definition at line 282 of file AnalysisFlow.cxx.

Bool_t Acclaim::AnalysisFlow::isPulserWAIS ( RawAnitaHeader header,
UsefulAdu5Pat usefulPat 
)
protected

Applies my WAIS pulser selection, which works for ANITA-3.

Parameters
headeris the event header
usefulPatis a usefulAdu5Pat object
Returns
true if the event matches the timing criteria

Definition at line 259 of file AnalysisFlow.cxx.

Long64_t Acclaim::AnalysisFlow::lastEntry ( )
inline

Get the final entry to be processed in the fData

This is not the last proccessed entry, but the final entry to be processed in fData.

Returns
the value of fLastEntry

Definition at line 140 of file AnalysisFlow.h.

void Acclaim::AnalysisFlow::prepareDataSet ( )
protected

Create the data set if not already done.

Creates an instance of the AnitaDataset class and finds the first/last entries to process using the division/numDivision member variables.

Definition at line 142 of file AnalysisFlow.cxx.

void Acclaim::AnalysisFlow::prepareOutputFiles ( )
protected

Coax the OutputConvention class into creating appropriately named output files.

The OutputConvention class was written some time ago to convert the cpp default main arguments (argc/argv) into an output file with a helpful name. This function dances around the original implementation intention to generate some fake argc/argv variables and pass them to an OutputConvention object.

Definition at line 166 of file AnalysisFlow.cxx.

static const char* Acclaim::AnalysisFlow::selectionAsString ( selection  sel)
inlinestatic

Translate the AnalysisFlow::selection enum to a descriptive string

Parameters
selis the AnalysisFlow event selection
Returns
c-style string, pointer to const char* array

Definition at line 56 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::SetBlindStrat ( AnitaDataset::BlindingStrategy  val)
inline

Set the value of fBlindStrat from an enum value.

See also
AnalysisSettings

Definition at line 302 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::SetBlindStrat ( Int_t  val)
inline

Set the value of fBlindStrat from an integer value.

See also
AnalysisSettings

Definition at line 302 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::SetNoiseEvenWaveforms ( Int_t  val)
inline

Set the value of fNoiseEvenWaveforms.

See also
AnalysisSettings

Definition at line 338 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::SetNoiseTimeScaleSeconds ( Double_t  val)
inline

Set the value of fNoiseTimeScaleSeconds.

See also
AnalysisSettings

Definition at line 320 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::SetOutFileCompressionAlgo ( Int_t  val)
inline

Set the value of fOutFileCompressionAlgo.

See also
AnalysisSettings

Definition at line 373 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::SetOutFileCompressionLevel ( Int_t  val)
inline

Set the value of fOutFileCompressionLevel.

See also
AnalysisSettings

Definition at line 356 of file AnalysisFlow.h.

void Acclaim::AnalysisFlow::setPulserFlags ( RawAnitaHeader header,
UsefulAdu5Pat usefulPat,
AnitaEventSummary sum 
)
protected

Set the pulser flags in the passed AnitaEventSummary

Parameters
headeris the event header
usefulPatis the ANITA gps data
sumis the AnitaEventSummary in which to set the flag

Definition at line 319 of file AnalysisFlow.cxx.

Bool_t Acclaim::AnalysisFlow::shouldIDoThisEvent ( RawAnitaHeader header,
UsefulAdu5Pat usefulPat 
)
protected

Applies high level event selection.

Look at the (useful) GPS and header information and implement the event selection logic for the AnalysisFlow::selection enum.

Parameters
headeris the RawAnitaHeader for this event
usefulPatis the UsefulAdu5Pat for the event
Returns
true is event satisfies selection criteria, false otherwise

Definition at line 226 of file AnalysisFlow.cxx.

Member Data Documentation

Acclaim::AnalysisFlow::fBlindStrat
protected

The blinding strategy with which to initialize fData.

See also
AnalysisSettings

Definition at line 302 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::fDebug
protected

Controls the printing of debug info, feel free to wrap noisy stderr messages with if(fDebug),.

See also
AnalysisSettings

Definition at line 258 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::fDoAll
protected

Process all events (that won't crash the analysis software) regardless of quality.

See also
AnalysisSettings

Definition at line 274 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::fNoiseEvenWaveforms
protected

Derived the noise value for RMS from the even or the uneven waveforms? Which choice is sensible will depend on the filter strategy, fFilterStrat.

See also
AnalysisSettings

Definition at line 338 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::fNoiseTimeScaleSeconds
protected

The N value for SNR measurements, comes from waveform RMS in nearby min-bias triggers, this variable controls how long to average over in seconds.

See also
AnalysisSettings

Definition at line 320 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::fOutFileCompressionAlgo
protected

Which compression algorithm for the ROOT output files?

See also
AnalysisSettings

Definition at line 373 of file AnalysisFlow.h.

Acclaim::AnalysisFlow::fOutFileCompressionLevel
protected

What compression level for the ROOT output files? There's no reason not to set this to the maximum possible value.

See also
AnalysisSettings

Definition at line 356 of file AnalysisFlow.h.

selection Acclaim::AnalysisFlow::fSelection
protected

Which event selection is applied?

See also
AnalysisFlow::selection

Definition at line 144 of file AnalysisFlow.h.


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