RdChannelNoisePowerAnalyser.h
Go to the documentation of this file.
1 #ifndef _RdChannelNoisePowerAnalyser_h_
2 #define _RdChannelNoisePowerAnalyser_h_
3 
4 #include <string>
5 #include <revt/Station.h>
6 #include <utl/UTCDateTime.h>
7 
8 #include <fwk/VModule.h>
9 
10 #include "TProfile.h"
11 #include "TProfile2D.h"
12 #include "TFile.h"
13 #include "TH2D.h"
14 #include "THnSparse.h"
15 
16 // you should assign your module to a namespace
17 
19 
30  std::vector<double> SNRs;
31  std::vector<int> GPSsecods;
32  long unsigned int numberOfPulses; // the number of traces that had a pulse above noise threshold
33  long unsigned int numberOfTraces; // the number of traces that has been read in
34  double totalSignalSerachWindow; // the sum of the signal search window of all condidered traces
35 
37  numberOfPulses(0),
38  numberOfTraces(0),
40  {}
41 };
42 
43 typedef boost::tuple<int, int, int> Key;
44 typedef boost::tuple<int, int, int, int> KeyYearMonth;
45 
46 enum InfoLevel {
47  eNone = 0, eFinal = 1, eIntermediate = 2, eObscure = 3, eDebug = 4
48  };
49 
51 
52 public:
53  enum Month {
54  eJan = 1,
55  eFeb = 2,
56  eMar = 3,
57  eApr = 4,
58  eMay = 5,
59  eJun = 6,
60  eJul = 7,
61  eAug = 8,
62  eSep = 9,
63  eOct = 10,
64  eNov = 11,
65  eDec = 12
66  };
67  // If you define a constructor, you MUST provide an implementation
68  // for it, otherwise the REGISTER_MODULE macro will not register
69  // your module. (Here, implementation is in RdChannelNoisePowerAnalyser.cc)
71  //virtual ~RdChannelNoisePowerAnalyser();
72 
76 
77 private:
78 
79  static bool IsLeapYear(const int year)
80  { return (!(year%4) && (year%100)) || !(year%400); }
81 
82  static
83  int
84  NumberOfDaysInMonth(const int year, const int month)
85  {
86  switch (month) {
87  case eJan:
88  case eMar:
89  case eMay:
90  case eJul:
91  case eAug:
92  case eOct:
93  case eDec:
94  return 31;
95  case eFeb:
96  return IsLeapYear(year) ? 29 : 28;
97  case eApr:
98  case eJun:
99  case eSep:
100  case eNov:
101  return 30;
102  default:
103  return 0;
104  }
105  }
106 
107  double FindPulse(revt::Station& station);
108  double GPSSecToLSTHourAuger(const unsigned long gps);
109 
115 
116  std::string fOutputPath;
117  std::string fOutputFilename;
120  const int fMinimumChannelId;
121  const int fMaximumChannelId;
122 
123  const double fLocalSiderealDay;
126 
128 
129  std::vector<double> fFrequencies;
130 
131  TFile *fRootOut;
132 // std::map<Key, TProfile* > fProfileAmplitudeMap;
133 // std::map<Key, TProfile* > fProfilePowerMap;
134  std::map<Key, THnSparseF*> fHistogramPowerMap;
135  std::map<Key, THnSparseF*> fHistogramPowerMapLinear;
136 
137  std::map<KeyYearMonth, TProfile2D*> fDynamicPowerSpectrum;
139 
140  std::ofstream fOfs;
141  std::ofstream fOfs_freqs;
142 
143  // The REGISTER_MODULE macro makes the framework aware of your module.
144  // You need to put this macro at the very end of your module class definition.
145  // Give your module a name (first argument) and specify its
146  // class name (second argument). In the ModuleSequenceExample.xml file,
147  // you can see this module being refered to by the name we give it here.
148 
149  REGISTER_MODULE("RdChannelNoisePowerAnalyser", RdChannelNoisePowerAnalyser);
150 
151 };
152 
153 }
154 
155 #endif
156 
157 // Configure (x)emacs for this file ...
158 // Local Variables:
159 // mode:c++
160 // compile-command: "make -k"
161 // End:
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
class to hold data at the radio Station level.
static int NumberOfDaysInMonth(const int year, const int month)
REGISTER_MODULE("RdChannelNoisePowerAnalyser", RdChannelNoisePowerAnalyser)
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
boost::tuple< int, int, int > Key
Module interface.
Definition: VModule.h:53
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
boost::tuple< int, int, int, int > KeyYearMonth
Module which determines the frequency and amplitude of noise pulses on channel level.
const double year
Definition: GalacticUnits.h:22

, generated on Tue Sep 26 2023.