List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes | Private Member Functions | Private Attributes
RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator Class Reference

#include <RdChannelBeaconTimingCalibrator.h>

Inheritance diagram for RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator:
Inheritance graph
[legend]

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::StopwatchGetStopwatch ()
 
const utl::StopwatchGetStopwatch () 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...
 

Detailed Description

Definition at line 35 of file RdChannelBeaconTimingCalibrator.h.

Member Enumeration Documentation

enum fwk::VModule::InfoLevel
protectedinherited
Enumerator
eInfoNone 
eInfoFinal 
eInfoIntermediate 
eInfoDebug 

Definition at line 125 of file VModule.h.

enum fwk::VModule::ResultFlag
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.

Definition at line 60 of file VModule.h.

Different types of version info that can be retrieved from GetVersionInfo.

Enumerator
eFilename 
eRevisionNumber 
eDate 
eTime 
eLastEditor 

Definition at line 110 of file VModule.h.

Member Function Documentation

VModule::ResultFlag RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::Finish ( )
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.

std::vector< std::map< int, double > > RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::getReferencePhases ( std::vector< double >  beaconFrequencies)
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.

std::string fwk::VModule::GetResultFlagByName ( const ResultFlag  flag)
staticinherited
utl::Stopwatch& fwk::VModule::GetStopwatch ( )
inlineinherited

Definition at line 106 of file VModule.h.

References fwk::VModule::fStopwatch.

const utl::Stopwatch& fwk::VModule::GetStopwatch ( ) const
inlineinherited

Definition at line 107 of file VModule.h.

References fwk::VModule::fStopwatch.

std::string fwk::VModule::GetVersionInfo ( const VersionInfoType  v) const
inherited
VModule::ResultFlag RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::Init ( )
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().

void fwk::VModule::InitTiming ( )
inlineinherited

Definition at line 95 of file VModule.h.

References fwk::VModule::fStopwatch, and utl::Stopwatch::Reset().

void RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::matchStationTimeStamps ( revt::REvent rEvent) const
private
RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::REGISTER_MODULE ( "RdChannelBeaconTimingCalibrator"  ,
RdChannelBeaconTimingCalibrator   
)
private
VModule::ResultFlag RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::Run ( evt::Event event)
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.

ResultFlag fwk::VModule::RunWithTiming ( evt::Event event)
inlineinherited
bool RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::writeDebugFile ( const int &  refStationID,
const std::map< int, double > &  timeOffsets,
const std::map< int, double > &  timeUncertainties,
const utl::TimeStamp eventGPStimeStamp 
) const
private

Write debug output to file.

Definition at line 964 of file RdChannelBeaconTimingCalibrator.cc.

References ERROR, utl::TimeStamp::GetGPSNanoSecond(), and utl::TimeStamp::GetGPSSecond().

Member Data Documentation

std::map<int, int> RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fBeaconCorrectionFailures
private

Number of events for which beacon correction was unsuccessful for a paticular station.

Definition at line 107 of file RdChannelBeaconTimingCalibrator.h.

std::map<int, int> RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fBeaconCorrectionSuccesses
private

Number of events for which beacon correction was successful for a paticular station.

Definition at line 104 of file RdChannelBeaconTimingCalibrator.h.

std::vector<double> RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fBeaconFrequencies
private

Vector of beacon frequencies, if specified in XML file.

Definition at line 47 of file RdChannelBeaconTimingCalibrator.h.

std::vector<double> RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fBeaconPosition
private

Postion of the beacon UTM(WGS84)

Definition at line 98 of file RdChannelBeaconTimingCalibrator.h.

std::map<int, int > RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fBeaconSNRcounter
private

Counter for later normalization of mean signal to noise ratios.

Definition at line 113 of file RdChannelBeaconTimingCalibrator.h.

std::map<int, std::map<int,double> > RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fBeaconSNRs
private

Mean signal to noise ratio per station and beacon frequency (for monitoring, debugging, etc.)

Definition at line 110 of file RdChannelBeaconTimingCalibrator.h.

double RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fBeaconTimeCalibrationUncertainty = 2
private

total timing uncertainty after beacon correction in ns (Auger base unit)

Definition at line 101 of file RdChannelBeaconTimingCalibrator.h.

std::string RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fDebugOutputFile
private

Name of file for debugging output.

Definition at line 80 of file RdChannelBeaconTimingCalibrator.h.

std::set<int> RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fDebugStationIds
private

List of station IDs which will be included into debugging file.

Definition at line 77 of file RdChannelBeaconTimingCalibrator.h.

double RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fEpsilon = 0.8
private

This defines the epsilon neigborhood in which the shifts of one channel are trusted.

Definition at line 65 of file RdChannelBeaconTimingCalibrator.h.

bool RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fEqualizeStationTimeStamps = false
private

Compensate time stamp differences (adjust all station time stamps to the same)

Definition at line 71 of file RdChannelBeaconTimingCalibrator.h.

bool RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fFirstModuleCall = true
private

first call of module?

Definition at line 44 of file RdChannelBeaconTimingCalibrator.h.

int RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fFixedReferenceStationID = -1
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.

int fwk::VModule::fInfoLevel = 0
protectedinherited
std::string RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fInputPhaseFile
private

Name of file for ASCII input of reference phases.

Definition at line 74 of file RdChannelBeaconTimingCalibrator.h.

double RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fMaxTimeDifference = 80.
private

Maximum time difference to correct for.

Definition at line 62 of file RdChannelBeaconTimingCalibrator.h.

unsigned int RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fMinGoodFreqs = 3
private

Minimum number of beacon signals which have to pass the SNR cut.

Definition at line 68 of file RdChannelBeaconTimingCalibrator.h.

unsigned int RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fMinSNR = 50
private

Number of spectral bins to calculate the noise level around.

Definition at line 59 of file RdChannelBeaconTimingCalibrator.h.

unsigned int RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fNoiseFilterSize = 1
private

Number of spectral bins to calculate the noise level around.

Definition at line 56 of file RdChannelBeaconTimingCalibrator.h.

bool RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fOverwriteDebugFile = false
private

Overwrite debug file if already existing.

Definition at line 83 of file RdChannelBeaconTimingCalibrator.h.

int RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fReferenceChannel = 1
private

Reference channel (ususally 1 = NS, high gain)

Definition at line 50 of file RdChannelBeaconTimingCalibrator.h.

bool RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fRejectIfCorrectionFailed = true
private

Reject stations if beacon correction failed.

Definition at line 89 of file RdChannelBeaconTimingCalibrator.h.

bool RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fRejectIfNoRefPhaseAvailable = true
private

Reject stations if no reference phase is available.

Definition at line 86 of file RdChannelBeaconTimingCalibrator.h.

utl::TimeStamp RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fStartingDateTimeForBeaconCorrection
private

skip events before this time

Definition at line 116 of file RdChannelBeaconTimingCalibrator.h.

bool RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fUseBeaconDistanceInsteadOfDatabaseValues = false
private

Calculate correction based on distance to beacon.

Definition at line 95 of file RdChannelBeaconTimingCalibrator.h.

bool RdChannelBeaconTimingCalibrator::RdChannelBeaconTimingCalibrator::fUseCrossCorrelationMethod = false
private

Calculate correction by maximizing cross-correlation of beacon beat.

Definition at line 92 of file RdChannelBeaconTimingCalibrator.h.


The documentation for this class was generated from the following files:

, generated on Tue Sep 26 2023.