All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
WaveformCombiner.h
1 #ifndef UCORRELATOR_WAVEFORM_COMBINER_H
2 #define UCORRELATOR_WAVEFORM_COMBINER_H
3 
9 #include "AnalysisWaveform.h"
10 #include "AnitaConventions.h"
11 #include "FilterStrategy.h"
12 #include <vector>
13 
14 
15 class FilteredAnitaEvent;
16 
17 namespace AnitaResponse
18 {
19  class ResponseManager;
20 
21 }
22 
23 namespace UCorrelator
24 {
25 
26  class WaveformCombiner
27  {
28 
29  public:
30 
31  WaveformCombiner(int nantennas = 15, int npad = 3, bool useUnfiltered = true, bool deconvolve = false, const AnitaResponse::ResponseManager * response = 0, bool enableALFAHack=true);
32 
38  void setResponseManager(const AnitaResponse::ResponseManager * rm) { responses = rm;}
39 
40  virtual ~WaveformCombiner();
41 
43  void combine(double phi, double theta, const FilteredAnitaEvent * event, AnitaPol::AnitaPol_t pol,
44  ULong64_t disallowed = 0, double t0 = 0, double t1 = 100,
45  double * avg_of_peaks =0, bool use_hilbert = true);
46 
47  const AnalysisWaveform * getCoherent() const { return &coherent; }
48  const AnalysisWaveform * getDeconvolved() const;
49  const TGraph * getCoherentAvgSpectrum() const { return &coherent_avg_spectrum; }
50  const TGraph * getDeconvolvedAvgSpectrum() const { return &deconvolved_avg_spectrum; }
51  void setNPad(int new_npad) { npad = new_npad; }
52  void setNAntennas(int n) { nant = n; antennas.resize(n); }
53  void setDeconvolve(bool deconvolve) {do_deconvolution = deconvolve ;}
54  void setUseUnfiltered(bool raw_opt) {use_raw = raw_opt;}
55  void setGroupDelayFlag(bool opt) { enable_group_delay = opt; }
56  void setRTimeShiftFlag(bool opt) { enable_r_time_shift = opt; }
57  void setSimulationTimeShiftFlag(bool opt) { enable_simulation_time_shift = opt; }
58  bool wasAlfaFiltered() { return alfa_hack; }
59 
60  int getNAntennas() const { return nant; }
61  const int * getUsedAntennas() const { return &antennas[0]; }
62 
63  /* setBottomFirst():
64  getClosestAntennas() returns the closest antenna in phi, which could be on any ring.
65  this will force the bottom antenna (largest ant#) to be the seed waveform so things don't jump as much
66  default is false (like it was before)
67  */
68  void setBottomFirst(bool opt) { bottom_first = opt; }
69 
70  /* setDelayToCenter();
71  changes the delays in combining from being to the first antenna in the array, to being towards the centerpoint
72  of the instrument (0,0,0) */
73  void setDelayToCenter(bool opt) {delay_to_center = opt; }
74 
76  static double combineWaveforms(int nwf, const AnalysisWaveform * wfs, const double * delays, const double * scales = 0, AnalysisWaveform * output = 0, double t0 = 0, double t1 = 100, int checkvpp = 0);
77 
79  void setExtraFilters(FilterStrategy* extra);
82  void setCheckVpp(int opt) { check_vpp = opt; }
83 
84  double getMaxAntennaVpp() { return max_vpp; }
85 
86  private:
87 
88 
89  AnalysisWaveform coherent;
90  AnalysisWaveform deconvolved;
91  TGraphAligned coherent_avg_spectrum;
92  TGraphAligned deconvolved_avg_spectrum;
93 
94 
95  const AnalysisWaveform * wf(const FilteredAnitaEvent*, int ant, AnitaPol::AnitaPol_t pol);
96  const AnitaResponse::ResponseManager * responses;
97  int npad;
98  int nant;
99  bool use_raw;
100  bool do_deconvolution;
101  bool enable_group_delay;
102  bool alfa_hack;
103  bool bottom_first;
104  bool delay_to_center;
105  bool enable_r_time_shift;
106  bool enable_simulation_time_shift;
107  int check_vpp;
108  std::vector<int> antennas;
109  FilterStrategy* extra_filters;
110  FilterStrategy* extra_filters_deconvolved;
111  double max_vpp;
112  };
113 
114 }
115 
116 #endif
void setResponseManager(const AnitaResponse::ResponseManager *rm)
static double combineWaveforms(int nwf, const AnalysisWaveform *wfs, const double *delays, const double *scales=0, AnalysisWaveform *output=0, double t0=0, double t1=100, int checkvpp=0)
A filter strategy defines the sets of filters that are used and provides some introspection abilities...
void combine(double phi, double theta, const FilteredAnitaEvent *event, AnitaPol::AnitaPol_t pol, ULong64_t disallowed=0, double t0=0, double t1=100, double *avg_of_peaks=0, bool use_hilbert=true)
void setExtraFilters(FilterStrategy *extra)
void setExtraFiltersDeconvolved(FilterStrategy *extra)
This class is intended to store all the necessary data about an ANITA event for filtering and analysi...
enum AnitaPol::EAnitaPol AnitaPol_t
Polarisation enumeration.
This class is intended to be the main storage vessel for ANITA waveforms. It is similar in principle ...