AnalysisFlow.h
1 /* -*- C++ -*-.*********************************************************************************************
2  Author: Ben Strutt
3  Email: strutt@physics.ucla.edu
4 
5  Description:
6  Applies the analysis in sequence
7 ***********************************************************************************************************/
8 
9 
10 #ifndef ANALYSIS_FLOW_H
11 #define ANALYSIS_FLOW_H
12 
13 #include "AnitaDataset.h"
14 #include "AnalysisReco.h"
15 #include "AnalysisSettings.h"
16 #include "TFile.h"
17 #include "FilterStrategy.h"
18 
19 class AnitaEventSummary;
20 class NoiseMonitor;
21 
22 namespace Acclaim
23 {
24 
25  class CmdLineArgs;
26 
27 
34  class AnalysisFlow : public TObject{
35 
36  public:
37 
42  enum selection{
43  kAll,
44  kWaisPulser,
45  kDecimated
46  };
47 
48 
56  static const char* selectionAsString(selection sel){
57  switch(sel){
58  case kAll: return "all";
59  case kWaisPulser: return "wais";
60  case kDecimated: return "decimated";
61  }
62  }
63 
64 
75  AnalysisFlow(CmdLineArgs* args, FilterStrategy* filterStrat=NULL);
76 
77 
81  ~AnalysisFlow();
82 
83 
89  void doAnalysis(Long64_t startAtThisEntry=-1);
90 
91 
99  AnitaEventSummary* doEntry(Long64_t entry);
100 
108  AnitaEventSummary* doEvent(UInt_t eventNumber);
109 
115 
121 
126  const AnitaDataset* getData(){return fData;}
127 
132  Long64_t firstEntry(){return fFirstEntry;}
133 
140  Long64_t lastEntry(){return fLastEntry;}
141 
142  protected:
143 
145  int fRun;
147  int fDivision;
148 
150  Long64_t fFirstEntry;
151  Long64_t fLastEntry;
152 
160 
162  TFile* fOutFile;
163  TTree* fSumTree;
164 
170  void prepareDataSet();
171 
172 
179  void prepareOutputFiles();
180 
191  Bool_t shouldIDoThisEvent(RawAnitaHeader* header, UsefulAdu5Pat* usefulPat);
192 
193 
194 
203  Bool_t isPulserWAIS(RawAnitaHeader* header, UsefulAdu5Pat* usefulPat);
204 
205 
206 
215  Bool_t isPulserLDB(RawAnitaHeader* header, UsefulAdu5Pat* usefulPat);
216 
217 
225  void setPulserFlags(RawAnitaHeader* header, UsefulAdu5Pat* usefulPat, AnitaEventSummary* sum);
226 
227 
231  void prepareEverything(const char* preferredSettingsFileName = NULL);
232 
242  Bool_t checkForSgeTaskId();
243 
244 
258  ANALYSIS_SETTING(Int_t, Debug);
259 
260 
274  ANALYSIS_SETTING(Int_t, DoAll);
275 
276 
302  ENUM_ANALYSIS_SETTING(AnitaDataset::BlindingStrategy, BlindStrat);
303 
304 
320  ANALYSIS_SETTING(Double_t, NoiseTimeScaleSeconds);
321 
322 
338  ANALYSIS_SETTING(Int_t, NoiseEvenWaveforms);
339 
340 
356  ANALYSIS_SETTING(Int_t, OutFileCompressionLevel);
357 
373  ANALYSIS_SETTING(Int_t, OutFileCompressionAlgo);
374 
375 
381  };
382 
383 }
384 
385 
386 #endif
Bool_t checkForSgeTaskId()
Look for an environmental variable called SGE_TASK_ID for running on the hoffman2 cluster...
Bool_t isPulserWAIS(RawAnitaHeader *header, UsefulAdu5Pat *usefulPat)
void prepareDataSet()
Create the data set if not already done.
selection fSelection
Which event selection is applied?
Definition: AnalysisFlow.h:144
int fRun
Which run in the data set should be is being processed?
Definition: AnalysisFlow.h:145
ClassDef(AnalysisFlow, 0)
Required for ROOT awareness of getter/setter functions.
selection
A human readable method of selecting the set of events to process, this can be expanded as required...
Definition: AnalysisFlow.h:42
void setPulserFlags(RawAnitaHeader *header, UsefulAdu5Pat *usefulPat, AnitaEventSummary *sum)
Does the event reconstruction, and produces a summary of it.
Definition: AnalysisReco.h:30
AnalysisFlow(CmdLineArgs *args, FilterStrategy *filterStrat=NULL)
Preferred constructor.
UInt_t fLastEventConsidered
Tracks the event numbers processed by the class.
Definition: AnalysisFlow.h:159
~AnalysisFlow()
Destructor.
void prepareOutputFiles()
Coax the OutputConvention class into creating appropriately named output files.
AnalysisReco * fReco
The reconstruction class, fills an AnitaEventSummary.
Definition: AnalysisFlow.h:153
static const char * selectionAsString(selection sel)
Definition: AnalysisFlow.h:56
Bool_t isPulserLDB(RawAnitaHeader *header, UsefulAdu5Pat *usefulPat)
A filter strategy defines the sets of filters that are used and provides some introspection abilities...
High level interface to join up the various bits of the analysis.
Definition: AnalysisFlow.h:34
RawAnitaHeader – The Raw ANITA Event Header.
FilteredAnitaEvent * getEvent()
Definition: AnalysisFlow.h:120
Long64_t fFirstEntry
The first entry to process (derived from fDivision and fNumDivisions)
Definition: AnalysisFlow.h:150
int fNumDivisions
For parallel processing the run is divided into this many portions.
Definition: AnalysisFlow.h:146
A simple command line option parser.
Namespace which wraps everything in the library.
AnitaDataset * fData
Rootified data handler.
Definition: AnalysisFlow.h:149
const AnitaDataset * getData()
Definition: AnalysisFlow.h:126
FilteredAnitaEvent * fEv
The most recently produced FilteredAnitaEvent, updated after each event processed.
Definition: AnalysisFlow.h:157
TTree * fSumTree
The produced TTree of AnitaEventSummary.
Definition: AnalysisFlow.h:163
AnalysisSettings * fSettings
Contains configurable numbers parsed from an Acclaim analysis settings file.
Definition: AnalysisFlow.h:155
AnalysisReco * getReco()
Definition: AnalysisFlow.h:114
TFile * fOutFile
the output file, will contain TTree of AnitaEventSummary
Definition: AnalysisFlow.h:162
TString fOutFileBaseName
The meat of the output file name.
Definition: AnalysisFlow.h:161
As UsefulAnitaEvent is to RawAnitaEvent, UsefulAdu5Pat is to Adu5Pat. Well not quite as useful but yo...
Definition: UsefulAdu5Pat.h:39
int fDivision
Which portion of the run to process (runs from 0 to fNumDivisions)
Definition: AnalysisFlow.h:147
FilterStrategy * fFilterStrat
Which filter strategy is applied to the events.
Definition: AnalysisFlow.h:154
void doAnalysis(Long64_t startAtThisEntry=-1)
Common analysis format between UCorrelator and Acclaim.
AnitaEventSummary * doEvent(UInt_t eventNumber)
Long64_t fLastEntry
The final entry to process (derived from fDivision and fNumDivisions)
Definition: AnalysisFlow.h:151
Bool_t shouldIDoThisEvent(RawAnitaHeader *header, UsefulAdu5Pat *usefulPat)
Applies high level event selection.
void prepareEverything(const char *preferredSettingsFileName=NULL)
Initialize all input and output objects.
AnitaEventSummary * doEntry(Long64_t entry)
This class is intended to store all the necessary data about an ANITA event for filtering and analysi...
NoiseMonitor * fNoiseMonitor
Measures the noise.
Definition: AnalysisFlow.h:158
AnitaEventSummary * fEventSummary
The most recently filled AnitaEventSummary, updated after each event processed.
Definition: AnalysisFlow.h:156