AnalysisReco.h
1 #ifndef ANALYSIS_RECO_H
2 #define ANALYSIS_RECO_H
3 
4 #include "AnitaEventReconstructor.h"
5 #include "InterferometricMap.h"
6 #include "InterferometryCache.h"
7 #include "CrossCorrelator.h"
8 #include "AnalysisSettings.h"
9 #include <list>
10 
11 namespace AnitaResponse {
12  class DeconvolutionMethod;
13  class ResponseManager;
14 }
15 class NoiseMonitor;
16 class TruthAnitaEvent;
17 
18 namespace Acclaim
19 {
20 
21  class InterferometryCache;
22 
30  class AnalysisReco : public TObject {
31 
32  public:
33  friend class InterferometryCache;
34 
35  enum DrawDomain{
36  kTimeDomain = 0,
37  kFreqDomain = 1,
38  kStokesParams = 2,
39  };
40 
47  AnalysisReco();
48 
52  virtual ~AnalysisReco();
53 
62  void process(const FilteredAnitaEvent * fEv, AnitaEventSummary * sum, NoiseMonitor* noiseMonitor=NULL, TruthAnitaEvent* truth = NULL);
63 
77  Double_t getDeltaTExpected(AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2, Double_t phiWave, Double_t thetaWave) const;
78 
79 
92  Double_t getDeltaTExpected(AnitaPol::AnitaPol_t pol, Int_t ant, Double_t phiWave, Double_t thetaWave) const;
93 
104  Double_t relativeOffAxisDelay(AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2, Double_t phiDeg) const;
105 
113  Double_t singleAntennaOffAxisDelay(Double_t deltaPhiDeg) const;
114 
123  void drawSummary(TPad* wholePad, AnitaPol::AnitaPol_t pol);
124 
136 
148  InterferometricMap* getZoomMap(AnitaPol::AnitaPol_t pol, UInt_t peakInd=0);
149 
156  void reconstruct(AnitaPol::AnitaPol_t pol, const Adu5Pat* pat = NULL);
157 
167  void reconstructZoom(AnitaPol::AnitaPol_t pol, Int_t peakIndex, Double_t zoomCenterPhiDeg, Double_t zoomCenterThetaDeg, const Adu5Pat* pat = NULL);
168 
169 
183  AnalysisWaveform* coherentlySum(const FilteredAnitaEvent* fEv, AnitaPol::AnitaPol_t pol, const std::vector<Int_t>& theAnts, Double_t peakPhiDeg, Double_t peakThetaDeg, Double_t* biggestPeakToPeak=NULL ,double* forceT0 = NULL);
184 
185 
195  AnalysisWaveform* coherentlySum(std::vector<const AnalysisWaveform*>& waves, std::vector<Double_t>& dts, const double* forceT0 = NULL);
196 
197 
198 
211  static Int_t directlyInsertGeometry(TString pathToLindasFile, AnitaPol::AnitaPol_t pol);
212 
221 
232  AnalysisWaveform* getCoherentFiltered(AnitaPol::AnitaPol_t pol, Int_t peakInd=0, bool xPol=false);
233 
234 
245  AnalysisWaveform* getCoherent(AnitaPol::AnitaPol_t pol, Int_t peakInd=0, bool xPol=false);
246 
247 
258  AnalysisWaveform* getDeconvolved(AnitaPol::AnitaPol_t pol, Int_t peakInd=0, bool xPol=false);
259 
260 
271  AnalysisWaveform* getDeconvolvedFiltered(AnitaPol::AnitaPol_t pol, Int_t peakInd=0, bool xPol=false);
272 
273 
281 
282 
290 
291 
299 
300 
312  void directionAndAntennasToDeltaTs(const std::vector<Int_t>& theAnts, AnitaPol::AnitaPol_t pol,
313  Double_t peakPhiDeg, Double_t peakThetaDeg, std::vector<double>& dts);
314 
315 
316 
325  static void setTriggerInfoFromPeakPhi(const RawAnitaHeader* header, AnitaPol::AnitaPol_t pol,
326  Int_t peakPhiSector, AnitaEventSummary::PointingHypothesis& peak);
327 
328 
329 
339  static void fillChannelInfo(const FilteredAnitaEvent* fEv, AnitaEventSummary* sum);
340 
341 
349 
350 
361  const std::vector<int>& phiSectorToCoherentAnts(int peakPhiSector){return fPhiSectorToAnts[peakPhiSector];}
362 
363 
375  void wavesInCoherent(std::vector<const AnalysisWaveform*>& waves, std::vector<Double_t>& dts, std::vector<TGraphAligned*>& grs);
376 
377 
384 
391 
392  protected:
393 
397  void initializeInternals();
398 
400  InterferometricMap* fineMaps[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol];
401 
402 
411  size_t checkWavesAndDtsMatch(std::vector<const AnalysisWaveform*>& waves, std::vector<Double_t>& dts);
412 
425  AnalysisWaveform** waveStore, InterferometricMap* h, NoiseMonitor* noiseMonitor,
426  std::vector<double>& I, std::vector<double>& Q, std::vector<double>& U, std::vector<double>& V);
427 
428 
434  void chooseAntennasForCoherentlySumming(int coherentDeltaPhi);
435 
440 
441 
442  std::vector<Double_t> fRArray[AnitaPol::kNotAPol];
443  std::vector<Double_t> fPhiArrayDeg[AnitaPol::kNotAPol];
444  std::vector<Double_t> fZArray[AnitaPol::kNotAPol];
445 
446  AnalysisWaveform* fCoherentFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol][AnitaPol::kNotAPol];
447  AnalysisWaveform* fCoherent[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol][AnitaPol::kNotAPol] ;
448  AnalysisWaveform* fDeconvolved[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol][AnitaPol::kNotAPol];
449  AnalysisWaveform* fDeconvolvedFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol][AnitaPol::kNotAPol];
450  std::vector<Int_t> fPhiSectorToAnts[NUM_PHI];
451 
456 
459 
463 
465  Int_t fCurrentRun;
466 
467  std::vector<double> f_dICoherentFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol];
468  std::vector<double> f_dQCoherentFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol];
469  std::vector<double> f_dUCoherentFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol];
470  std::vector<double> f_dVCoherentFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol];
471  std::vector<double> f_dIDeconvolvedFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol];
472  std::vector<double> f_dQDeconvolvedFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol];
473  std::vector<double> f_dUDeconvolvedFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol];
474  std::vector<double> f_dVDeconvolvedFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol];
475 
489  ANALYSIS_SETTING(Int_t, Debug);
490 
504  ANALYSIS_SETTING(Int_t, CoherentDeltaPhi);
505  Int_t fLastCoherentDeltaPhi;
506 
507 
521  ANALYSIS_SETTING(Int_t, WhichResponseDir);
522 
536  ANALYSIS_SETTING(Int_t, UseOffAxisDelay);
537 
538 
552  ANALYSIS_SETTING(Int_t, ResponseNPad);
553 
569  ANALYSIS_SETTING(Int_t, NumPeaks);
570 
584  ANALYSIS_SETTING(Double_t, CoherentDtNs);
585 
599  ANALYSIS_SETTING(Double_t, SlopeFitStartFreqGHz);
600 
614  ANALYSIS_SETTING(Double_t, SlopeFitEndFreqGHz);
615 
616 
630  ANALYSIS_SETTING(Double_t, MeanPowerFlagLowFreqGHz);
631 
645  ANALYSIS_SETTING(Double_t, MeanPowerFlagHighFreqGHz);
646 
660  ANALYSIS_SETTING(Int_t, FillChannelInfo);
661 
675  ANALYSIS_SETTING(Int_t, FillSpectrumInfo);
676 
690  ANALYSIS_SETTING(Int_t, FillUnfiltered);
691 
692 
706  ANALYSIS_SETTING(Int_t, InstantaneousStokes);
707 
708 
709 
710 
711 
712 
713 
714 
715 
716 
717 
739  ANALYSIS_SETTING(Int_t, DrawNPeaks)
740 
741 
742 
767  ENUM_ANALYSIS_SETTING(DrawDomain, DrawDomain)
768 
769 
784  ANALYSIS_SETTING(Int_t, DrawCoherent)
785 
786 
801  ANALYSIS_SETTING(Int_t, DrawDedispersed)
802 
803 
818  ANALYSIS_SETTING(Int_t, DrawXPol)
819 
820 
835  ANALYSIS_SETTING(Int_t, DrawXPolDedispersed)
836 
837 
838 
839 
840 
841  ClassDef(AnalysisReco, 0)
842 
843  };
844 
845 }
846 
847 
848 #endif
AnalysisWaveform * getCoherentFiltered(AnitaPol::AnitaPol_t pol, Int_t peakInd=0, bool xPol=false)
Coherently summed filtered (un-deconvolved) waveform accessor for external processes. Only works once per event processed as ownership is transferred to the function caller.
const std::vector< int > & phiSectorToCoherentAnts(int peakPhiSector)
Get a list of antenna indices (in a std::vector) for a coherently averaged waveform based from the ph...
Definition: AnalysisReco.h:361
void process(const FilteredAnitaEvent *fEv, AnitaEventSummary *sum, NoiseMonitor *noiseMonitor=NULL, TruthAnitaEvent *truth=NULL)
static Int_t directlyInsertGeometry(TString pathToLindasFile, AnitaPol::AnitaPol_t pol)
FilterStrategy * fMinDecoFilter
Minimum filter with an appended deconvolution filter.
Definition: AnalysisReco.h:458
std::vector< Double_t > fPhiArrayDeg[AnitaPol::kNotAPol]
Local copies of the antenna azimuth positions (in degrees) from AnitaGeomTool.
Definition: AnalysisReco.h:443
FilteredAnitaEvent * fEvMinDeco
Filtered event produced with the fMinDecoFilter.
Definition: AnalysisReco.h:461
AnalysisWaveform * fCoherentFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol][AnitaPol::kNotAPol]
Copies of the coherently summed waveforms from the most recently processed event. ...
Definition: AnalysisReco.h:446
void directionAndAntennasToDeltaTs(const std::vector< Int_t > &theAnts, AnitaPol::AnitaPol_t pol, Double_t peakPhiDeg, Double_t peakThetaDeg, std::vector< double > &dts)
From a list of antennas, get a set of dts relative to the first antenna.
AnalysisWaveform * getCoherent(AnitaPol::AnitaPol_t pol, Int_t peakInd=0, bool xPol=false)
Coherently summed (un-filtered, un-deconvolved) waveform accessor for external processes. Only works once per event processed as ownership is transferred to the function caller.
std::vector< double > f_dIDeconvolvedFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol]
Instantaneous I for each source direction for the dedispersed filtered waveform.
Definition: AnalysisReco.h:471
std::vector< Double_t > fZArray[AnitaPol::kNotAPol]
Local copies of the antenna z positions (metres) from AnitaGeomTool.
Definition: AnalysisReco.h:444
Adu5Pat – The ADU5 Position and Attitude Data.
Definition: Adu5Pat.h:26
std::vector< double > f_dQDeconvolvedFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol]
Instantaneous Q for each source direction for the dedispersed filtered waveform.
Definition: AnalysisReco.h:472
CrossCorrelator * fCrossCorr
CrossCorrelator generates the set of cross-correlations required to make an InterferometricMap.
Definition: AnalysisReco.h:453
InterferometryCache fDtCache
Caches antenna delays as a function of incoming angle, for quickly making an Interferometric map...
Definition: AnalysisReco.h:455
Does the event reconstruction, and produces a summary of it.
Definition: AnalysisReco.h:30
std::vector< double > f_dVDeconvolvedFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol]
Instantaneous V for each source direction for the dedispersed filtered waveform.
Definition: AnalysisReco.h:474
void fillPowerFlags(const FilteredAnitaEvent *fEv, AnitaEventSummary::EventFlags &flags)
Double_t relativeOffAxisDelay(AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2, Double_t phiDeg) const
Get the off axis delay between two antennas for a given phi angle.
static void setTriggerInfoFromPeakPhi(const RawAnitaHeader *header, AnitaPol::AnitaPol_t pol, Int_t peakPhiSector, AnitaEventSummary::PointingHypothesis &peak)
Calculate and fill the info the AnitaEventSummary relating the compatibility of the hardware trigger ...
std::vector< double > f_dVCoherentFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol]
Instantaneous V for each source direction for the coherent filtered waveform.
Definition: AnalysisReco.h:470
std::vector< double > f_dUCoherentFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol]
Instantaneous U for each source direction for the coherent filtered waveform.
Definition: AnalysisReco.h:469
InterferometricMap * getZoomMap(AnitaPol::AnitaPol_t pol, UInt_t peakInd=0)
Get a pointer to a finely binned interferometric map stored in memory, once called, you own this InterferometricMap and must delete it.
void reconstructZoom(AnitaPol::AnitaPol_t pol, Int_t peakIndex, Double_t zoomCenterPhiDeg, Double_t zoomCenterThetaDeg, const Adu5Pat *pat=NULL)
produce and store a finely binned interferometric map, (overwrites fineMaps)
A filter strategy defines the sets of filters that are used and provides some introspection abilities...
Double_t getDeltaTExpected(AnitaPol::AnitaPol_t pol, Int_t ant1, Int_t ant2, Double_t phiWave, Double_t thetaWave) const
Get the expected delay between antenna pairs for a given direction.
AnalysisWaveform * getDeconvolved(AnitaPol::AnitaPol_t pol, Int_t peakInd=0, bool xPol=false)
Coherently summed (un-filtered) deconvolved waveform accessor for external processes. Only works once per event processed as ownership is transferred to the function caller.
RawAnitaHeader – The Raw ANITA Event Header.
AnitaEventSummary fSummary
A copy of the AnitaEventSummary from the most recently processed event.
Definition: AnalysisReco.h:452
static void fillChannelInfo(const FilteredAnitaEvent *fEv, AnitaEventSummary *sum)
Calculate and fill the numbers for Peng&#39;s ChannelInfo object.
Namespace which wraps everything in the library.
USeful in for loops.
AnalysisReco()
Constructor.
FilteredAnitaEvent * fEvMin
Filtered event produced with the fMinFilter.
Definition: AnalysisReco.h:460
void reconstruct(AnitaPol::AnitaPol_t pol, const Adu5Pat *pat=NULL)
produce and store the coarsely binned interferometric map, (overwrites coarseMaps) ...
Double_t singleAntennaOffAxisDelay(Double_t deltaPhiDeg) const
const AnitaEventSummary & lastSummary()
Definition: AnalysisReco.h:390
AnalysisWaveform * fDeconvolved[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol][AnitaPol::kNotAPol]
Copies of the dedispersed, unfiltered coherently summed waveform from the most recently processed eve...
Definition: AnalysisReco.h:448
size_t checkWavesAndDtsMatch(std::vector< const AnalysisWaveform *> &waves, std::vector< Double_t > &dts)
Bounds checking for coherent averaging. Checks input vectors are the same length and zero pads/trims ...
AnalysisWaveform * fCoherent[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol][AnitaPol::kNotAPol]
Copies of the unfiltered, coherently summed waveform from the most recently processed event...
Definition: AnalysisReco.h:447
FilteredAnitaEvent * getEvMinDeco()
UInt_t fCurrentEventNumber
Assigned at the start of process(), helpful for printing warning/info messages.
Definition: AnalysisReco.h:464
void initializeInternals()
Sets default values and zeros pointers for dynamically initialised heap members.
void fillWaveformInfo(AnitaPol::AnitaPol_t pol, Int_t peakInd, AnitaEventSummary::WaveformInfo &info, const FilteredAnitaEvent *fEv, AnalysisWaveform **waveStore, InterferometricMap *h, NoiseMonitor *noiseMonitor, std::vector< double > &I, std::vector< double > &Q, std::vector< double > &U, std::vector< double > &V)
std::vector< Double_t > fRArray[AnitaPol::kNotAPol]
Local copies of the antenna radial positions (metres) from AnitaGeomTool.
Definition: AnalysisReco.h:442
FilterStrategy * fMinFilter
Minimum set of filters (no filers, or just ALFA filters for ANITA-3)
Definition: AnalysisReco.h:457
AnalysisWaveform * fDeconvolvedFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol][AnitaPol::kNotAPol]
Copies of the dedispersed, filtered coherently summed waveform from the most recently processed event...
Definition: AnalysisReco.h:449
bool fSpawnedCrossCorrelator
Did I initialize a CrossCorrelator for fCrossCorr, or was I given a CrossCorrelator initialized by so...
Definition: AnalysisReco.h:454
FilteredAnitaEvent * fEvDeco
FilteredEvent produced by appending a deconvolution filter to the filter strategy passed to process()...
Definition: AnalysisReco.h:462
TruthAnitaEvent – The Truth ANITA Event.
virtual ~AnalysisReco()
Destructor.
Stores information about a coherently summed waveform (filtered/unfiltered/deconvolved) The coherent ...
void drawSummary(TPad *wholePad, AnitaPol::AnitaPol_t pol)
Draw everything interesting onto a TPad.
AnalysisWaveform * coherentlySum(const FilteredAnitaEvent *fEv, AnitaPol::AnitaPol_t pol, const std::vector< Int_t > &theAnts, Double_t peakPhiDeg, Double_t peakThetaDeg, Double_t *biggestPeakToPeak=NULL, double *forceT0=NULL)
Make a coherently summed waveform for a given polarization, set of antennas in a particular direction...
FilteredAnitaEvent * getEvDeco()
void nicelyDeleteInternalFilteredEvents()
does NULL pointer checking deletion on the internally generated FilteredAnitaEvents, fEvMin, fEvMinDeco, fEvDeco
std::vector< double > f_dQCoherentFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol]
Instantaneous Q for each source direction for the coherent filtered waveform.
Definition: AnalysisReco.h:468
A class to take in FiteredAnitaEvents and cross-correlate nearby channels.
std::vector< double > f_dUDeconvolvedFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol]
Instantaneous U for each source direction for the dedispersed filtered waveform.
Definition: AnalysisReco.h:473
InterferometricMap * coarseMaps[AnitaPol::kNotAPol]
The coarsely binned InterferometricMap from the most recently processed event.
Definition: AnalysisReco.h:399
Class to cache the deltaTs or parts of their calculation for fast map making.
void chooseAntennasForCoherentlySumming(int coherentDeltaPhi)
Generate a set of antennas to use to generate the coherent waveform.
Int_t fLastCoherentDeltaPhi
Used to figure out if we need to recalculate the cached values related to coherently summing waveform...
Definition: AnalysisReco.h:504
void wavesInCoherent(std::vector< const AnalysisWaveform *> &waves, std::vector< Double_t > &dts, std::vector< TGraphAligned *> &grs)
Generate a new set of TGraphAligned such that the peaks are aligned,.
AnalysisWaveform * getDeconvolvedFiltered(AnitaPol::AnitaPol_t pol, Int_t peakInd=0, bool xPol=false)
Coherently summed filtered deconvolved waveform accessor for external processes. Only works once per ...
Common analysis format between UCorrelator and Acclaim.
std::vector< Int_t > fPhiSectorToAnts[NUM_PHI]
Which antennas to use to make coherently summed waveforms depending on the phi-sector of the peak...
Definition: AnalysisReco.h:450
InterferometricMap * getMap(AnitaPol::AnitaPol_t pol)
Get a pointer to the coarsely binned interferometric map stored in memory, once called, you own this InterferometricMap and must delete it.
void insertPhotogrammetryGeometry()
Inserts the photogrammetry geometry from AnitaGeomTool into this classes copy of the antenna position...
This class is intended to store all the necessary data about an ANITA event for filtering and analysi...
CrossCorrelator * getCrossCorrelator()
Definition: AnalysisReco.h:383
FilteredAnitaEvent * getEvMin()
enum AnitaPol::EAnitaPol AnitaPol_t
Polarisation enumeration.
std::vector< double > f_dICoherentFiltered[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol]
Instantaneous I for each source direction for the coherent filtered waveform.
Definition: AnalysisReco.h:467
Int_t fCurrentRun
Assigned at the start of process(), helpful for printing warning/info messages.
Definition: AnalysisReco.h:465
This class is intended to be the main storage vessel for ANITA waveforms. It is similar in principle ...
InterferometricMap * fineMaps[AnitaPol::kNotAPol][AnitaEventSummary::maxDirectionsPerPol]
The finely binned InterferometricMap from the most recently processed event.
Definition: AnalysisReco.h:400