RdStationRejector.h
Go to the documentation of this file.
1 #ifndef _RdStationRejector_RdStationRejector_h_
2 #define _RdStationRejector_RdStationRejector_h_
3 
4 #include <fwk/VModule.h>
5 
6 #include <utl/TimeStamp.h>
7 #include <revt/Station.h>
8 
9 #include <map>
10 
11 
12 namespace RdStationRejector {
13 
24 
25  public:
26  fwk::VModule::ResultFlag Init() override;
27  fwk::VModule::ResultFlag Run(evt::Event& event) override;
29 
30  private:
31  bool fExcludeStations = true;
33  std::vector<int> fStationList;
34 
35  bool fExcludeNlStations = true;
36 
37  bool fUseBadPeriodDB = false;
38  unsigned long long int fBadPeriodReasons = 0;
39 
40  typedef std::multimap<utl::TimeStamp, std::pair<utl::TimeStamp, size_t>> ParentMap;
41 
42  class TimeRangeMap : public ParentMap {
43  public:
44 
45  typedef std::vector<size_t> IdCollection;
46 
48  GetBadStations(const utl::TimeStamp& time) const
49  {
50  ParentMap::const_iterator it = upper_bound(time); // first key larger than time
51  if (it == begin())
52  return IdCollection();
53 
54  IdCollection ids;
55  do {
56  --it;
57  if (it->first <= time && time <= it->second.first)
58  ids.push_back(it->second.second);
59  } while (it != begin());
60 
61  return ids;
62  }
63  };
65 
66  void ExcludeOrRejectStation(revt::Station& station, unsigned long long int reason);
67 
68  REGISTER_MODULE("RdStationRejector", RdStationRejector);
69  };
70 
71 }
72 
73 #endif
REGISTER_MODULE("RdStationRejector", RdStationRejector)
fwk::VModule::ResultFlag Init() override
Initialize: invoked at beginning of run (NOT beginning of event)
std::multimap< utl::TimeStamp, std::pair< utl::TimeStamp, size_t > > ParentMap
fwk::VModule::ResultFlag Finish() override
Finish: invoked at end of the run (NOT end of the event)
fwk::VModule::ResultFlag Run(evt::Event &event) override
Run: invoked once per event.
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
class to hold data at the radio Station level.
IdCollection GetBadStations(const utl::TimeStamp &time) const
const double second
Definition: GalacticUnits.h:32
Module interface.
Definition: VModule.h:53
void ExcludeOrRejectStation(revt::Station &station, unsigned long long int reason)
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
unsigned long long int fBadPeriodReasons

, generated on Tue Sep 26 2023.