Correlator.h
1 #ifndef UCORRELATOR_CORRELATOR_H
2 #define UCORRELATOR_CORRELATOR_H
3 
4 
5 #include "AnitaConventions.h"
6 #include "TH2.h"
7 
8 class FilteredAnitaEvent;
9 class AnalysisWaveform;
10 
11 #define NANTENNAS NUM_SEAVEYS
12 
13 namespace UCorrelator
14 {
15 
16  class TrigCache;
17 
18  //This is just to hide the OpenMP stuff from cling
19  class CorrelatorLocks;
20 
22  class Correlator
23  {
24  public:
26  Correlator(int nphi, double phimin, double phimax, int ntheta, double theta_lowest, double theta_highest, bool use_bin_center = false, bool scale_by_cos_theta = false, double baseline_weight = 0, double gain_sigma = 0);
27 
29  void compute(const FilteredAnitaEvent * event, AnitaPol::AnitaPol_t pol);
30 
32  const TH2D * getHist() const { return hist; }
33 
35  const TH2D * getNorm() const { return norm; }
36 
37 
39  TH2D* computeZoomed(double phi, double theta, int nphi, double dphi, int ntheta, double dtheta, int nant = 0, TH2D * useme = 0);
40 
42  void setDisallowedAntennas(ULong64_t disallowed) { disallowed_antennas = disallowed; }
43 
45  void setAllowedAntennas(ULong64_t allowed) { disallowed_antennas = ~allowed; }
46 
48  void setMaxAntennaMaxPhiDistance(double max_ant_phi) { max_phi = max_ant_phi; max_phi2 = max_phi * max_phi; }
49 
51  void setGroupDelayFlag(bool flag) { groupDelayFlag = flag; }
52 
53 
55  const AnalysisWaveform * getCorrelationGraph(int ant1, int ant2) { return getCorrelation(ant1,ant2); }
56 
58  void setPadFactor(int pad) { pad_factor = pad; }
59 
61  void dumpDeltaTs(const char * file) const;
62  virtual ~Correlator();
63 
64  private:
65  AnalysisWaveform* padded_waveforms[NANTENNAS];
66  AnalysisWaveform* correlations[NANTENNAS][NANTENNAS];
67 
68  TH2D *hist;
69  TH2D *norm;
70 
71  std::vector<TH2D*> hists;
72  std::vector<TH2D*> norms;
73 
74 #ifndef NUM_ANITAS
75 #define NUM_ANITAS 4
76 #endif
77  TrigCache * trigcache[NUM_ANITAS+1];
78  double rms[NANTENNAS];
79 
80  double max_phi, max_phi2;
81  ULong64_t disallowed_antennas;
82  int pad_factor;
83  const FilteredAnitaEvent * ev;
85  bool groupDelayFlag;
86  bool use_bin_center;
87  bool scale_cos_theta;
88  double baselineWeight;
89  double gainSigma;
90 
91  AnalysisWaveform * getCorrelation(int ant1, int ant2);
92  void doAntennas(int ant1, int ant2, TH2D ** hist, TH2D ** norm, const UCorrelator::TrigCache * tc, const double * center_point = 0);
93  void reset();
94 
95  CorrelatorLocks * locks;
96  };
97 
98 
99 
100 }
101 
102 
103 
104 #endif
void dumpDeltaTs(const char *file) const
Definition: Correlator.cc:784
TH2D * computeZoomed(double phi, double theta, int nphi, double dphi, int ntheta, double dtheta, int nant=0, TH2D *useme=0)
Definition: Correlator.cc:341
Correlator(int nphi, double phimin, double phimax, int ntheta, double theta_lowest, double theta_highest, bool use_bin_center=false, bool scale_by_cos_theta=false, double baseline_weight=0, double gain_sigma=0)
Definition: Correlator.cc:131
void setDisallowedAntennas(ULong64_t disallowed)
Definition: Correlator.h:42
void setGroupDelayFlag(bool flag)
Definition: Correlator.h:51
void setPadFactor(int pad)
Definition: Correlator.h:58
const TH2D * getHist() const
Definition: Correlator.h:32
const TH2D * getNorm() const
Definition: Correlator.h:35
void setAllowedAntennas(ULong64_t allowed)
Definition: Correlator.h:45
const AnalysisWaveform * getCorrelationGraph(int ant1, int ant2)
Definition: Correlator.h:55
void setMaxAntennaMaxPhiDistance(double max_ant_phi)
Definition: Correlator.h:48
This class is intended to store all the necessary data about an ANITA event for filtering and analysi...
void compute(const FilteredAnitaEvent *event, AnitaPol::AnitaPol_t pol)
Definition: Correlator.cc:660
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 ...