SdBadStationRejector.h
Go to the documentation of this file.
1 
9 #ifndef _SdBadStationRejectorKG_SdBadStationRejector_h_
10 #define _SdBadStationRejectorKG_SdBadStationRejector_h_
11 
12 #include <fwk/VModule.h>
13 #include <utl/TimeStamp.h>
14 #include <map>
15 #include <utility>
16 
17 namespace evt {
18  class Event;
19 }
20 
21 namespace utl {
22  class TimeStamp;
23 }
24 
25 namespace SdBadStationRejectorKG {
26 
37 
38  public:
42 
43  private:
44 
45  typedef std::multimap< utl::TimeStamp, std::pair< utl::TimeStamp, size_t > > ParentMap;
46 
47  class TimeRangeMap : public ParentMap
48  {
49  public:
50  typedef std::vector< size_t > IdCollection;
51 
53  GetBadStations(const utl::TimeStamp& time)
54  const
55  {
56  ParentMap::const_iterator it = upper_bound(time); // first key larger than time
57 
58  if (it == begin())
59  return IdCollection();
60 
62  do {
63  --it;
64  if (it->first <= time && time <= it->second.first)
65  ids.push_back(it->second.second);
66  } while (it!=begin());
67  return ids;
68  }
69  };
70 
72 
73  REGISTER_MODULE("SdBadStationRejectorKG", SdBadStationRejector);
74 
75  };
76 
77 }
78 
79 
80 #endif
81 
82 // Configure (x)emacs for this file ...
83 // Local Variables:
84 // mode: c++
85 // End:
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
const double second
Definition: GalacticUnits.h:32
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
Module interface.
Definition: VModule.h:53
std::multimap< utl::TimeStamp, std::pair< utl::TimeStamp, size_t > > ParentMap
REGISTER_MODULE("SdBadStationRejectorKG", SdBadStationRejector)
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)

, generated on Tue Sep 26 2023.