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

#include <CalcBeaconRefPhase.h>

Inheritance diagram for CalcBeaconRefPhase::CalcBeaconRefPhase:
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

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

Detailed Description

Definition at line 33 of file CalcBeaconRefPhase.h.

Member Enumeration Documentation

enum CalcBeaconRefPhase::CalcBeaconRefPhase::InfoLevel
private
Enumerator
eNone 
eFinal 
eIntermediate 
eObscure 
eMinuit 
eDebug 

Definition at line 47 of file CalcBeaconRefPhase.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.

Constructor & Destructor Documentation

CalcBeaconRefPhase::CalcBeaconRefPhase::CalcBeaconRefPhase ( )

Definition at line 45 of file CalcBeaconRefPhase.cc.

CalcBeaconRefPhase::CalcBeaconRefPhase::~CalcBeaconRefPhase ( )
virtual

Definition at line 60 of file CalcBeaconRefPhase.cc.

Member Function Documentation

map< int, pair< double, double > > CalcBeaconRefPhase::CalcBeaconRefPhase::calculateReferencePhases ( std::map< int, std::vector< double > >  phaseDifferences)
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().

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

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 CalcBeaconRefPhase::CalcBeaconRefPhase::Init ( )
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.

void fwk::VModule::InitTiming ( )
inlineinherited

Definition at line 95 of file VModule.h.

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

void CalcBeaconRefPhase::CalcBeaconRefPhase::matchStationTimeStamps ( revt::REvent rEvent) const
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().

CalcBeaconRefPhase::CalcBeaconRefPhase::REGISTER_MODULE ( "CalcBeaconRefPhase"  ,
CalcBeaconRefPhase   
)
private
VModule::ResultFlag CalcBeaconRefPhase::CalcBeaconRefPhase::Run ( evt::Event event)
virtual
ResultFlag fwk::VModule::RunWithTiming ( evt::Event event)
inlineinherited
void CalcBeaconRefPhase::CalcBeaconRefPhase::writeFileForDatabase ( void  )
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().

void CalcBeaconRefPhase::CalcBeaconRefPhase::writeReferencePhasesFile ( void  )
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().

Member Data Documentation

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

Vector of frequencies emitted by the beacon.

Definition at line 60 of file CalcBeaconRefPhase.h.

Referenced by Finish(), Init(), Run(), writeFileForDatabase(), and writeReferencePhasesFile().

double CalcBeaconRefPhase::CalcBeaconRefPhase::fConvergenceLimit
private

Convergence limit for iterative calculation of reference phases.

Definition at line 78 of file CalcBeaconRefPhase.h.

Referenced by calculateReferencePhases().

std::string CalcBeaconRefPhase::CalcBeaconRefPhase::fDBServer
private

Name of the mysql db server.

Definition at line 66 of file CalcBeaconRefPhase.h.

Referenced by Init().

unsigned int CalcBeaconRefPhase::CalcBeaconRefPhase::fEventCounter
private

Counts "successfull" events usable for reference phases.

Definition at line 84 of file CalcBeaconRefPhase.h.

Referenced by Run().

std::map<int, int> CalcBeaconRefPhase::CalcBeaconRefPhase::fEventsPerStation
private

Number of events read in for each station.

Definition at line 90 of file CalcBeaconRefPhase.h.

Referenced by Finish(), and Run().

std::set<unsigned int> CalcBeaconRefPhase::CalcBeaconRefPhase::fExistingStationIDs
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().

int CalcBeaconRefPhase::CalcBeaconRefPhase::fInfoLevel
private

xml settings: info level (verbosity)

Definition at line 57 of file CalcBeaconRefPhase.h.

Referenced by Init(), and Run().

unsigned int CalcBeaconRefPhase::CalcBeaconRefPhase::fMaxNumberEvents
private

maximum number of events, after which module sequence is stopped, and reference phases are calculated

Definition at line 87 of file CalcBeaconRefPhase.h.

Referenced by Init(), and Run().

std::string CalcBeaconRefPhase::CalcBeaconRefPhase::fOutputRefPhaseFile
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().

std::map<double ,std::map<int ,std::vector<double> > > CalcBeaconRefPhase::CalcBeaconRefPhase::fPhaseDifferences
private

phase differences: BeaconFreq, Station, vector of individual phase differences (one per event)

Definition at line 93 of file CalcBeaconRefPhase.h.

Referenced by Finish(), and Run().

int CalcBeaconRefPhase::CalcBeaconRefPhase::fReferenceChannel
private

Reference channel (ususally 1 = NS, high gain)

Definition at line 72 of file CalcBeaconRefPhase.h.

Referenced by Init(), and Run().

std::vector<std::map<int, std::pair<double, double> > > CalcBeaconRefPhase::CalcBeaconRefPhase::fReferencePhases
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().

int CalcBeaconRefPhase::CalcBeaconRefPhase::fReferenceStation
private

ID of reference station.

Definition at line 69 of file CalcBeaconRefPhase.h.

Referenced by Init(), and Run().

unsigned int CalcBeaconRefPhase::CalcBeaconRefPhase::fStationWithZeroPhase
private

Station which is set to a reference phase of 0 (exploits freedom of global constant)

Definition at line 75 of file CalcBeaconRefPhase.h.

Referenced by Finish(), and Init().


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

, generated on Tue Sep 26 2023.