RdChannelBeaconTimingCalibrator.h
Go to the documentation of this file.
1 #ifndef _RdChannelBeaconTimingCalibrator_RdChannelBeaconTimingCalibrator_h_
2 #define _RdChannelBeaconTimingCalibrator_RdChannelBeaconTimingCalibrator_h_
3 
4 #include <fwk/VModule.h>
5 #include <utl/TimeStamp.h>
6 
7 #include <set>
8 
9 
10 namespace evt {
11  class Event;
12 }
13 
14 namespace revt {
15  class REvent;
16  class Channel;
17 }
18 
19 namespace utl {
20  class FFTDataContainerAlgorithm;
21  class TimeStamp;
22 }
23 
25 
36 
37  public:
38  fwk::VModule::ResultFlag Init() override;
39  fwk::VModule::ResultFlag Run(evt::Event& event) override;
41 
42  private:
44  bool fFirstModuleCall = true;
45 
47  std::vector<double> fBeaconFrequencies;
48 
51 
54 
56  unsigned int fNoiseFilterSize = 1;
57 
59  unsigned int fMinSNR = 50;
60 
62  double fMaxTimeDifference = 80.;
63 
65  double fEpsilon = 0.8;
66 
68  unsigned int fMinGoodFreqs = 3;
69 
72 
74  std::string fInputPhaseFile;
75 
77  std::set<int> fDebugStationIds;
78 
80  std::string fDebugOutputFile;
81 
83  bool fOverwriteDebugFile = false;
84 
87 
90 
93 
96 
98  std::vector<double> fBeaconPosition;
99 
102 
104  std::map<int, int> fBeaconCorrectionSuccesses;
105 
107  std::map<int, int> fBeaconCorrectionFailures;
108 
110  std::map<int, std::map<int,double> > fBeaconSNRs;
111 
113  std::map<int, int > fBeaconSNRcounter;
114 
117 
119  std::vector<std::map<int, double> > getReferencePhases(std::vector<double> beaconFrequencies);
120 
123 
125  bool writeDebugFile(const int&,
126  const std::map<int,double>&,
127  const std::map<int,double>&,
128  const utl::TimeStamp&) const;
129 
130  REGISTER_MODULE("RdChannelBeaconTimingCalibrator", RdChannelBeaconTimingCalibrator);
131 
132  };
133 
134 }
135 
136 
137 #endif
std::vector< std::map< int, double > > getReferencePhases(std::vector< double > beaconFrequencies)
Get reference phases from database (as preliminary version from text file)
std::vector< double > fBeaconPosition
Postion of the beacon UTM(WGS84)
int fReferenceChannel
Reference channel (ususally 1 = NS, high gain)
std::map< int, int > fBeaconCorrectionSuccesses
Number of events for which beacon correction was successful for a paticular station.
std::vector< double > fBeaconFrequencies
Vector of beacon frequencies, if specified in XML file.
REGISTER_MODULE("RdChannelBeaconTimingCalibrator", RdChannelBeaconTimingCalibrator)
Interface class to access to the Radio part of an event.
Definition: REvent.h:42
double fEpsilon
This defines the epsilon neigborhood in which the shifts of one channel are trusted.
unsigned int fMinSNR
Number of spectral bins to calculate the noise level around.
std::map< int, int > fBeaconSNRcounter
Counter for later normalization of mean signal to noise ratios.
int fFixedReferenceStationID
ID for fixed reference station, or negative value to chose station with best signal-to-noise ratio...
bool fRejectIfNoRefPhaseAvailable
Reject stations if no reference phase is available.
fwk::VModule::ResultFlag Finish() override
Finish: invoked at end of the run (NOT end of the event)
double fBeaconTimeCalibrationUncertainty
total timing uncertainty after beacon correction in ns (Auger base unit)
bool fEqualizeStationTimeStamps
Compensate time stamp differences (adjust all station time stamps to the same)
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
bool fUseBeaconDistanceInsteadOfDatabaseValues
Calculate correction based on distance to beacon.
std::set< int > fDebugStationIds
List of station IDs which will be included into debugging file.
bool fRejectIfCorrectionFailed
Reject stations if beacon correction failed.
Module interface.
Definition: VModule.h:53
bool fUseCrossCorrelationMethod
Calculate correction by maximizing cross-correlation of beacon beat.
bool writeDebugFile(const int &, const std::map< int, double > &, const std::map< int, double > &, const utl::TimeStamp &) const
Write debug output to file.
void matchStationTimeStamps(revt::REvent &) const
Shifts all traces in time, such that they match the time stamp of the first station.
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
Makes the fine tuning time calibration using the reference signal of the beacon.
std::string fInputPhaseFile
Name of file for ASCII input of reference phases.
std::map< int, std::map< int, double > > fBeaconSNRs
Mean signal to noise ratio per station and beacon frequency (for monitoring, debugging, etc.)
fwk::VModule::ResultFlag Run(evt::Event &event) override
Run: invoked once per event.
std::map< int, int > fBeaconCorrectionFailures
Number of events for which beacon correction was unsuccessful for a paticular station.
unsigned int fMinGoodFreqs
Minimum number of beacon signals which have to pass the SNR cut.
fwk::VModule::ResultFlag Init() override
Initialize: invoked at beginning of run (NOT beginning of event)
unsigned int fNoiseFilterSize
Number of spectral bins to calculate the noise level around.

, generated on Tue Sep 26 2023.