#include <RdChannelBeaconTimingCalibrator.h>
Public Types | |
enum | ResultFlag { eSuccess, eFailure, eBreakLoop, eContinueLoop } |
Flag returned by module methods to the RunController. More... | |
enum | VersionInfoType { eFilename = 1, eRevisionNumber = 2, eDate = 3, eTime = 4, eLastEditor = 5 } |
Different types of version info that can be retrieved from GetVersionInfo. More... | |
Public Member Functions | |
fwk::VModule::ResultFlag | Finish () override |
Finish: invoked at end of the run (NOT end of the event) More... | |
utl::Stopwatch & | GetStopwatch () |
const utl::Stopwatch & | GetStopwatch () const |
std::string | GetVersionInfo (const VersionInfoType v) const |
Retrieve different sorts of module version info. More... | |
fwk::VModule::ResultFlag | Init () override |
Initialize: invoked at beginning of run (NOT beginning of event) More... | |
void | InitTiming () |
fwk::VModule::ResultFlag | Run (evt::Event &event) override |
Run: invoked once per event. More... | |
ResultFlag | RunWithTiming (evt::Event &event) |
Static Public Member Functions | |
static std::string | GetResultFlagByName (const ResultFlag flag) |
Protected Types | |
enum | InfoLevel { eInfoNone = 0, eInfoFinal = 1, eInfoIntermediate = 2, eInfoDebug = 3 } |
Protected Attributes | |
int | fInfoLevel = 0 |
Private Member Functions | |
std::vector< std::map< int, double > > | getReferencePhases (std::vector< double > beaconFrequencies) |
Get reference phases from database (as preliminary version from text file) More... | |
void | matchStationTimeStamps (revt::REvent &) const |
Shifts all traces in time, such that they match the time stamp of the first station. More... | |
REGISTER_MODULE ("RdChannelBeaconTimingCalibrator", RdChannelBeaconTimingCalibrator) | |
bool | writeDebugFile (const int &, const std::map< int, double > &, const std::map< int, double > &, const utl::TimeStamp &) const |
Write debug output to file. More... | |
Private Attributes | |
std::map< int, int > | fBeaconCorrectionFailures |
Number of events for which beacon correction was unsuccessful for a paticular station. More... | |
std::map< int, int > | fBeaconCorrectionSuccesses |
Number of events for which beacon correction was successful for a paticular station. More... | |
std::vector< double > | fBeaconFrequencies |
Vector of beacon frequencies, if specified in XML file. More... | |
std::vector< double > | fBeaconPosition |
Postion of the beacon UTM(WGS84) More... | |
std::map< int, int > | fBeaconSNRcounter |
Counter for later normalization of mean signal to noise ratios. More... | |
std::map< int, std::map< int, double > > | fBeaconSNRs |
Mean signal to noise ratio per station and beacon frequency (for monitoring, debugging, etc.) More... | |
double | fBeaconTimeCalibrationUncertainty = 2 |
total timing uncertainty after beacon correction in ns (Auger base unit) More... | |
std::string | fDebugOutputFile |
Name of file for debugging output. More... | |
std::set< int > | fDebugStationIds |
List of station IDs which will be included into debugging file. More... | |
double | fEpsilon = 0.8 |
This defines the epsilon neigborhood in which the shifts of one channel are trusted. More... | |
bool | fEqualizeStationTimeStamps = false |
Compensate time stamp differences (adjust all station time stamps to the same) More... | |
bool | fFirstModuleCall = true |
first call of module? More... | |
int | fFixedReferenceStationID = -1 |
ID for fixed reference station, or negative value to chose station with best signal-to-noise ratio. More... | |
std::string | fInputPhaseFile |
Name of file for ASCII input of reference phases. More... | |
double | fMaxTimeDifference = 80. |
Maximum time difference to correct for. More... | |
unsigned int | fMinGoodFreqs = 3 |
Minimum number of beacon signals which have to pass the SNR cut. More... | |
unsigned int | fMinSNR = 50 |
Number of spectral bins to calculate the noise level around. More... | |
unsigned int | fNoiseFilterSize = 1 |
Number of spectral bins to calculate the noise level around. More... | |
bool | fOverwriteDebugFile = false |
Overwrite debug file if already existing. More... | |
int | fReferenceChannel = 1 |
Reference channel (ususally 1 = NS, high gain) More... | |
bool | fRejectIfCorrectionFailed = true |
Reject stations if beacon correction failed. More... | |
bool | fRejectIfNoRefPhaseAvailable = true |
Reject stations if no reference phase is available. More... | |
utl::TimeStamp | fStartingDateTimeForBeaconCorrection |
skip events before this time More... | |
bool | fUseBeaconDistanceInsteadOfDatabaseValues = false |
Calculate correction based on distance to beacon. More... | |
bool | fUseCrossCorrelationMethod = false |
Calculate correction by maximizing cross-correlation of beacon beat. More... | |
Definition at line 35 of file RdChannelBeaconTimingCalibrator.h.
|
protectedinherited |
|
inherited |
Flag returned by module methods to the RunController.
Enumerator | |
---|---|
eSuccess |
Report success to RunController. |
eFailure |
Report failure to RunController, causing RunController to terminate execution. |
eBreakLoop |
Break current loop. It works for nested loops too! |
eContinueLoop |
Skip remaining modules in the current loop and continue with next iteration of the loop. |
|
inherited |
|
overridevirtual |
Finish: invoked at end of the run (NOT end of the event)
This method is for things that should be done at the end of the run (for example, closing files or writing out histograms) {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 824 of file RdChannelBeaconTimingCalibrator.cc.
References io::eSuccess, INFO, and INFOFinal.
|
private |
Get reference phases from database (as preliminary version from text file)
Definition at line 851 of file RdChannelBeaconTimingCalibrator.cc.
References ERROR, INFO, and utl::megahertz.
|
staticinherited |
Definition at line 8 of file VModule.cc.
References fwk::VModule::eBreakLoop, fwk::VModule::eContinueLoop, fwk::VModule::eFailure, and fwk::VModule::eSuccess.
Referenced by fwk::RunController::DoNextInSequence(), fwk::RunController::FinishBranch(), and fwk::RunController::InitBranch().
|
inlineinherited |
Definition at line 106 of file VModule.h.
References fwk::VModule::fStopwatch.
|
inlineinherited |
Definition at line 107 of file VModule.h.
References fwk::VModule::fStopwatch.
|
inherited |
Retrieve different sorts of module version info.
Definition at line 26 of file VModule.cc.
Referenced by fwk::CentralConfig::GetConfig(), ThresholdCalculatorKG::ThresholdCalculator::Init(), fdDoubleBumpFinder::FdDoubleBumpFinder::Init(), LaserGeneratorNA::LaserGenerator::Init(), LaserLightSimulatorNA::LaserLightSimulator::Init(), FdElectronicsSimulatorOG::FdElectronicsSimulator::Init(), TelescopeSimulatorKG::TelescopeSimulator::Init(), TelescopeSimulatorKG2::TelescopeSimulator::Init(), SdSimpleSimKG::SdSimpleSim::Init(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::Init(), and testRunController::testModuleVersionInfo().
|
overridevirtual |
Initialize: invoked at beginning of run (NOT beginning of event)
This method is for things that should be done once at the beginning of a run (for example, booking histograms, performing calculations that need to be done only once, initializing parameters) {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 65 of file RdChannelBeaconTimingCalibrator.cc.
References ERROR, io::eSuccess, utl::Branch::GetChild(), utl::Branch::GetData(), fwk::CentralConfig::GetInstance(), and fwk::CentralConfig::GetTopBranch().
|
inlineinherited |
Definition at line 95 of file VModule.h.
References fwk::VModule::fStopwatch, and utl::Stopwatch::Reset().
|
private |
Shifts all traces in time, such that they match the time stamp of the first station.
Definition at line 934 of file RdChannelBeaconTimingCalibrator.cc.
References revt::Station::ChannelsBegin(), revt::Station::ChannelsEnd(), revt::Channel::GetFFTDataContainer(), revt::StationRecData::GetParameter(), revt::Station::GetRecData(), revt::StationRecData::SetParameter(), revt::REvent::StationsBegin(), and revt::REvent::StationsEnd().
|
private |
|
overridevirtual |
Run: invoked once per event.
This method is for things that should be done once per event {You must override this method in your concrete module}
Phases of the event
Phases of the event - reference phases
Time differences for each beacon frequency and station
SNR for each beacon frequency and station
Calculated time offset of station using predefined reference phases
Uncertainty of time offset estimated by spread of individual frequency results around mean
Implements fwk::VModule.
Definition at line 106 of file RdChannelBeaconTimingCalibrator.cc.
References utl::abs(), revt::eBeaconCorrectionFailed, ERROR, io::eSuccess, rdet::RDetector::GetBeaconFrequencies(), rdet::RDetector::GetBeaconReferencePhase(), revt::Station::GetChannel(), revt::Channel::GetChannelFrequencySpectrum(), revt::Channel::GetFrequencyOfBin(), revt::REvent::GetHeader(), revt::Header::GetId(), revt::Channel::GetId(), revt::Station::GetId(), revt::REvent::GetNumberOfStations(), revt::StationRecData::GetParameter(), rdet::Station::GetPosition(), det::Detector::GetRDetector(), revt::Station::GetRecData(), det::Detector::GetReferenceCoordinateSystem(), rdet::RDetector::GetStation(), revt::Channel::GetStationId(), revt::Header::GetTime(), evt::Event::HasREvent(), revt::REvent::HasStation(), INFO, utl::kPi, utl::kTwoPi, max, utl::megahertz, utl::nanosecond, utl::Trace< T >::PushBack(), revt::StationRecData::SetParameter(), revt::StationRecData::SetParameterError(), revt::Station::SetRejectedReason(), speedOfLight, sqrt(), revt::REvent::StationsBegin(), revt::REvent::StationsEnd(), and WARNING.
|
inlineinherited |
Definition at line 98 of file VModule.h.
References fwk::VModule::fStopwatch, fwk::VModule::Run(), utl::Stopwatch::Start(), and utl::Stopwatch::Stop().
Referenced by fwk::RunController::DoNextInSequence().
|
private |
Write debug output to file.
Definition at line 964 of file RdChannelBeaconTimingCalibrator.cc.
References ERROR, utl::TimeStamp::GetGPSNanoSecond(), and utl::TimeStamp::GetGPSSecond().
|
private |
Number of events for which beacon correction was unsuccessful for a paticular station.
Definition at line 107 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Number of events for which beacon correction was successful for a paticular station.
Definition at line 104 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Vector of beacon frequencies, if specified in XML file.
Definition at line 47 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Postion of the beacon UTM(WGS84)
Definition at line 98 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Counter for later normalization of mean signal to noise ratios.
Definition at line 113 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Mean signal to noise ratio per station and beacon frequency (for monitoring, debugging, etc.)
Definition at line 110 of file RdChannelBeaconTimingCalibrator.h.
|
private |
total timing uncertainty after beacon correction in ns (Auger base unit)
Definition at line 101 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Name of file for debugging output.
Definition at line 80 of file RdChannelBeaconTimingCalibrator.h.
|
private |
List of station IDs which will be included into debugging file.
Definition at line 77 of file RdChannelBeaconTimingCalibrator.h.
|
private |
This defines the epsilon neigborhood in which the shifts of one channel are trusted.
Definition at line 65 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Compensate time stamp differences (adjust all station time stamps to the same)
Definition at line 71 of file RdChannelBeaconTimingCalibrator.h.
|
private |
first call of module?
Definition at line 44 of file RdChannelBeaconTimingCalibrator.h.
|
private |
ID for fixed reference station, or negative value to chose station with best signal-to-noise ratio.
Definition at line 53 of file RdChannelBeaconTimingCalibrator.h.
|
protectedinherited |
Definition at line 123 of file VModule.h.
Referenced by RdChannelASCIINoiseImporterRD::RdChannelASCIINoiseImporterRD::Init(), Rd2dLDFFitter::Rd2dLDFFitter::Init(), RdChannelNoiseImporter_AERA::RdChannelNoiseImporter_AERA::Init(), and Rd2dLDFFitter::Rd2dLDFFitter::Run().
|
private |
Name of file for ASCII input of reference phases.
Definition at line 74 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Maximum time difference to correct for.
Definition at line 62 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Minimum number of beacon signals which have to pass the SNR cut.
Definition at line 68 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Number of spectral bins to calculate the noise level around.
Definition at line 59 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Number of spectral bins to calculate the noise level around.
Definition at line 56 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Overwrite debug file if already existing.
Definition at line 83 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Reference channel (ususally 1 = NS, high gain)
Definition at line 50 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Reject stations if beacon correction failed.
Definition at line 89 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Reject stations if no reference phase is available.
Definition at line 86 of file RdChannelBeaconTimingCalibrator.h.
|
private |
skip events before this time
Definition at line 116 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Calculate correction based on distance to beacon.
Definition at line 95 of file RdChannelBeaconTimingCalibrator.h.
|
private |
Calculate correction by maximizing cross-correlation of beacon beat.
Definition at line 92 of file RdChannelBeaconTimingCalibrator.h.