CalcBeaconRefPhase.h
Go to the documentation of this file.
1 #ifndef _UserModule_h_
2 #define _UserModule_h_
3 
4 #include <string>
5 #include <set>
6 
7 #include <fwk/VModule.h>
8 
9 
10 namespace evt {
11  class Event;
12 }
13 
14 namespace revt {
15  class Channel;
16  class REvent;
17 }
18 
19 
20 // you should assign your module to a namespace
21 
22 namespace CalcBeaconRefPhase {
23 
34 
35  public:
36  // If you define a constructor, you MUST provide an implementation
37  // for it, otherwise the REGISTER_MODULE macro will not register
38  // your module. (Here, implementation is in UserModuleCalcRefPhase.cc)
40  virtual ~CalcBeaconRefPhase();
41 
45 
46  private:
47  enum InfoLevel {
48  eNone = 0,
49  eFinal = 1,
51  eObscure = 3,
52  eMinuit = 4,
53  eDebug = 5
54  };
55 
58 
60  std::vector<double> fBeaconFrequencies;
61 
63  std::string fOutputRefPhaseFile;
64 
66  std::string fDBServer;
67 
70 
73 
75  unsigned int fStationWithZeroPhase;
76 
79 
81  std::set<unsigned int> fExistingStationIDs;
82 
84  unsigned int fEventCounter;
85 
87  unsigned int fMaxNumberEvents;
88 
90  std::map<int, int> fEventsPerStation;
91 
93  std::map<double ,std::map<int ,std::vector<double> > > fPhaseDifferences;
94 
96  std::vector<std::map<int, std::pair<double, double> > > fReferencePhases;
97 
101 
103  std::map<int,std::pair<double, double> > calculateReferencePhases(std::map<int,std::vector<double> >);
104 
106  void writeFileForDatabase(void);
107 
109  void writeReferencePhasesFile(void);
110 
111 
112  // The REGISTER_MODULE macro makes the framework aware of your module.
113  // You need to put this macro at the very end of your module class definition.
114  // Give your module a name (first argument) and specify its
115  // class name (second argument). In the ModuleSequenceExample.xml file,
116  // you can see this module being refered to by the name we give it here.
117 
118  REGISTER_MODULE("CalcBeaconRefPhase", CalcBeaconRefPhase);
119 
120  };
121 
122 }
123 
124 
125 #endif
126 
127 // Configure (x)emacs for this file ...
128 // Local Variables:
129 // mode:c++
130 // compile-command: "make -k"
131 // End:
std::vector< std::map< int, std::pair< double, double > > > fReferencePhases
Internal storage of reference phases: VectorCounter:,nBeaconFreq, Key: StationID, Value: RefPhase...
std::map< int, int > fEventsPerStation
Number of events read in for each station.
Interface class to access to the Radio part of an event.
Definition: REvent.h:42
int fReferenceStation
ID of reference station.
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...
double fConvergenceLimit
Convergence limit for iterative calculation of reference phases.
std::string fDBServer
Name of the mysql db server.
REGISTER_MODULE("CalcBeaconRefPhase", CalcBeaconRefPhase)
void writeReferencePhasesFile(void)
Write reference phases into ASCII file.
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
void matchStationTimeStamps(revt::REvent &) const
Calculate the reference phases.
unsigned int fMaxNumberEvents
maximum number of events, after which module sequence is stopped, and reference phases are calculated...
std::set< unsigned int > fExistingStationIDs
Set of all station IDs present in the reference phases.
std::map< double,std::map< int,std::vector< double > > > fPhaseDifferences
phase differences: BeaconFreq, Station, vector of individual phase differences (one per event) ...
Module interface.
Definition: VModule.h:53
std::string fOutputRefPhaseFile
Name of file for ASCII output of phases (not needed for normal analysis)
int fReferenceChannel
Reference channel (ususally 1 = NS, high gain)
std::vector< double > fBeaconFrequencies
Vector of frequencies emitted by the beacon.
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
int fInfoLevel
xml settings: info level (verbosity)
unsigned int fEventCounter
Counts &quot;successfull&quot; events usable for reference phases.
Class that holds the data associated to an individual radio channel.
unsigned int fStationWithZeroPhase
Station which is set to a reference phase of 0 (exploits freedom of global constant) ...
fwk::VModule::ResultFlag Run(evt::Event &)
Run: invoked once per event.
void writeFileForDatabase(void)
Write script to transfer reference phases into database.

, generated on Tue Sep 26 2023.