#include <CalcBeaconRefPhase.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 | |
CalcBeaconRefPhase () | |
fwk::VModule::ResultFlag | Finish () |
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 () |
Initialize: invoked at beginning of run (NOT beginning of event) More... | |
void | InitTiming () |
fwk::VModule::ResultFlag | Run (evt::Event &) |
Run: invoked once per event. More... | |
ResultFlag | RunWithTiming (evt::Event &event) |
virtual | ~CalcBeaconRefPhase () |
Static Public Member Functions | |
static std::string | GetResultFlagByName (const ResultFlag flag) |
Private Types | |
enum | InfoLevel { eNone = 0, eFinal = 1, eIntermediate = 2, eObscure = 3, eMinuit = 4, eDebug = 5 } |
Private Member Functions | |
std::map< int, std::pair < double, double > > | calculateReferencePhases (std::map< int, std::vector< double > >) |
Method for calculation of reference phase difference and the corresponding RMS for each station. More... | |
void | matchStationTimeStamps (revt::REvent &) const |
REGISTER_MODULE ("CalcBeaconRefPhase", CalcBeaconRefPhase) | |
void | writeFileForDatabase (void) |
Write script to transfer reference phases into database. More... | |
void | writeReferencePhasesFile (void) |
Write reference phases into ASCII file. More... | |
Private Attributes | |
std::vector< double > | fBeaconFrequencies |
Vector of frequencies emitted by the beacon. More... | |
double | fConvergenceLimit |
Convergence limit for iterative calculation of reference phases. More... | |
std::string | fDBServer |
Name of the mysql db server. More... | |
unsigned int | fEventCounter |
Counts "successfull" events usable for reference phases. More... | |
std::map< int, int > | fEventsPerStation |
Number of events read in for each station. More... | |
std::set< unsigned int > | fExistingStationIDs |
Set of all station IDs present in the reference phases. More... | |
int | fInfoLevel |
xml settings: info level (verbosity) More... | |
unsigned int | fMaxNumberEvents |
maximum number of events, after which module sequence is stopped, and reference phases are calculated More... | |
std::string | fOutputRefPhaseFile |
Name of file for ASCII output of phases (not needed for normal analysis) More... | |
std::map< double,std::map< int,std::vector < double > > > | fPhaseDifferences |
phase differences: BeaconFreq, Station, vector of individual phase differences (one per event) More... | |
int | fReferenceChannel |
Reference channel (ususally 1 = NS, high gain) More... | |
std::vector< std::map< int, std::pair< double, double > > > | fReferencePhases |
Internal storage of reference phases: VectorCounter:,nBeaconFreq, Key: StationID, Value: RefPhase,RMS. More... | |
int | fReferenceStation |
ID of reference station. More... | |
unsigned int | fStationWithZeroPhase |
Station which is set to a reference phase of 0 (exploits freedom of global constant) More... | |
Definition at line 33 of file CalcBeaconRefPhase.h.
|
private |
Enumerator | |
---|---|
eNone | |
eFinal | |
eIntermediate | |
eObscure | |
eMinuit | |
eDebug |
Definition at line 47 of file CalcBeaconRefPhase.h.
|
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 |
CalcBeaconRefPhase::CalcBeaconRefPhase::CalcBeaconRefPhase | ( | ) |
Definition at line 45 of file CalcBeaconRefPhase.cc.
|
virtual |
Definition at line 60 of file CalcBeaconRefPhase.cc.
|
private |
Method for calculation of reference phase difference and the corresponding RMS for each station.
Definition at line 378 of file CalcBeaconRefPhase.cc.
References utl::abs(), fConvergenceLimit, utl::kPi, utl::kTwoPi, and sqrt().
Referenced by Finish().
|
virtual |
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 261 of file CalcBeaconRefPhase.cc.
References calculateReferencePhases(), fwk::VModule::eFailure, ERROR, fwk::VModule::eSuccess, fBeaconFrequencies, fEventsPerStation, fExistingStationIDs, fOutputRefPhaseFile, fPhaseDifferences, fReferencePhases, fStationWithZeroPhase, INFO, utl::kPi, utl::kTwoPi, utl::megahertz, WARNING, writeFileForDatabase(), and writeReferencePhasesFile().
|
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().
|
virtual |
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 66 of file CalcBeaconRefPhase.cc.
References eDebug, fwk::VModule::eFailure, ERROR, fwk::VModule::eSuccess, fBeaconFrequencies, fDBServer, fInfoLevel, fMaxNumberEvents, fOutputRefPhaseFile, fReferenceChannel, fReferenceStation, fStationWithZeroPhase, utl::Branch::GetChild(), utl::Branch::GetData(), utl::Branch::GetTopBranch(), and INFO.
|
inlineinherited |
Definition at line 95 of file VModule.h.
References fwk::VModule::fStopwatch, and utl::Stopwatch::Reset().
|
private |
Internal storage of amplitude: for each beacon frequency one phase for each station + channel shifts all traces in time, such that they match the time stamp of the first station
Definition at line 352 of file CalcBeaconRefPhase.cc.
References revt::REvent::CandidateStationsBegin(), revt::REvent::CandidateStationsEnd(), revt::Station::ChannelsBegin(), revt::Station::ChannelsEnd(), revt::Channel::GetFFTDataContainer(), revt::Station::GetId(), revt::StationRecData::GetParameter(), revt::Station::GetRecData(), and revt::StationRecData::SetParameter().
Referenced by Run().
|
private |
|
virtual |
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}
Implements fwk::VModule.
Definition at line 98 of file CalcBeaconRefPhase.cc.
References revt::REvent::CandidateStationsBegin(), revt::REvent::CandidateStationsEnd(), fwk::VModule::eBreakLoop, fwk::VModule::eContinueLoop, eDebug, fwk::VModule::eFailure, eObscure, ERROR, fwk::VModule::eSuccess, fBeaconFrequencies, fEventCounter, fEventsPerStation, fInfoLevel, fMaxNumberEvents, fPhaseDifferences, fReferenceChannel, fReferenceStation, utl::Trace< T >::GetBinning(), revt::Station::GetChannel(), revt::Channel::GetChannelFrequencySpectrum(), revt::Channel::GetFrequencyOfBin(), revt::Channel::GetId(), revt::Station::GetId(), utl::Trace< T >::GetSize(), revt::REvent::GetStation(), revt::Channel::GetStationId(), evt::Event::HasREvent(), INFO, matchStationTimeStamps(), max, utl::megahertz, 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 script to transfer reference phases into database.
Definition at line 431 of file CalcBeaconRefPhase.cc.
References fBeaconFrequencies, fExistingStationIDs, fOutputRefPhaseFile, fReferencePhases, and INFO.
Referenced by Finish().
|
private |
Write reference phases into ASCII file.
Definition at line 465 of file CalcBeaconRefPhase.cc.
References fBeaconFrequencies, fExistingStationIDs, fOutputRefPhaseFile, fReferencePhases, INFO, and utl::megahertz.
Referenced by Finish().
|
private |
Vector of frequencies emitted by the beacon.
Definition at line 60 of file CalcBeaconRefPhase.h.
Referenced by Finish(), Init(), Run(), writeFileForDatabase(), and writeReferencePhasesFile().
|
private |
Convergence limit for iterative calculation of reference phases.
Definition at line 78 of file CalcBeaconRefPhase.h.
Referenced by calculateReferencePhases().
|
private |
Name of the mysql db server.
Definition at line 66 of file CalcBeaconRefPhase.h.
Referenced by Init().
|
private |
Counts "successfull" events usable for reference phases.
Definition at line 84 of file CalcBeaconRefPhase.h.
Referenced by Run().
|
private |
Number of events read in for each station.
Definition at line 90 of file CalcBeaconRefPhase.h.
|
private |
Set of all station IDs present in the reference phases.
Definition at line 81 of file CalcBeaconRefPhase.h.
Referenced by Finish(), writeFileForDatabase(), and writeReferencePhasesFile().
|
private |
xml settings: info level (verbosity)
Definition at line 57 of file CalcBeaconRefPhase.h.
|
private |
maximum number of events, after which module sequence is stopped, and reference phases are calculated
Definition at line 87 of file CalcBeaconRefPhase.h.
|
private |
Name of file for ASCII output of phases (not needed for normal analysis)
Definition at line 63 of file CalcBeaconRefPhase.h.
Referenced by Finish(), Init(), writeFileForDatabase(), and writeReferencePhasesFile().
|
private |
phase differences: BeaconFreq, Station, vector of individual phase differences (one per event)
Definition at line 93 of file CalcBeaconRefPhase.h.
|
private |
Reference channel (ususally 1 = NS, high gain)
Definition at line 72 of file CalcBeaconRefPhase.h.
|
private |
Internal storage of reference phases: VectorCounter:,nBeaconFreq, Key: StationID, Value: RefPhase,RMS.
Definition at line 96 of file CalcBeaconRefPhase.h.
Referenced by Finish(), writeFileForDatabase(), and writeReferencePhasesFile().
|
private |
ID of reference station.
Definition at line 69 of file CalcBeaconRefPhase.h.
|
private |
Station which is set to a reference phase of 0 (exploits freedom of global constant)
Definition at line 75 of file CalcBeaconRefPhase.h.