RdVirtualStationNoiseImporter.h
Go to the documentation of this file.
1 #ifndef _RdVirtualStationNoiseImporter_RdVirtualStationNoiseImporter_h_
2 #define _RdVirtualStationNoiseImporter_RdVirtualStationNoiseImporter_h_
3 
4 #include <fwk/VModule.h>
5 
6 #include <revt/Channel.h>
7 #include <revt/Station.h>
8 #include <rdet/Station.h>
9 
10 #include <utl/RandomEngine.h>
11 #include <utl/TimeStamp.h>
12 #include <utl/UTCDateTime.h>
13 #include <utl/AugerUnits.h>
14 
15 #include <RadioFileIO.h>
16 
17 #include <string>
18 
19 namespace evt {
20  class Event;
21 }
22 
23 namespace revt {
24  class Channel;
25 }
26 
28 
40 
41  public:
42  fwk::VModule::ResultFlag Init() override;
43  fwk::VModule::ResultFlag Run(evt::Event& event) override;
45 
46  private:
47  // switches controlling noise file selection
48  std::string fNoiseFileSelection;
49  std::string fNoiseFilePath;
50  bool fExpectSubDirectories = false;
51  std::string fFilenamePrefix;
52  std::string fFilenameSuffix;
53  std::string fTimeIntervalInFile;
54  bool fTraceShifting = true;
55  bool fReplaceDataWithNoise = false;
56  std::vector<int> fStationIDList;
59 
60  // switches controlling the reading of noise from a selected file
61  std::string fEvtSelInNoiseFile;
62  //int fNoiseEvtNr = -1; // unused. LN.
64  bool fCheckTimeWindow = false;
66  double fGainFactor = 0;
67 
69 
70  // bool IsCompatible(const revt::Station& testStation, const rdet::Station& replacementStation);
72  void RemovePedestal(std::vector<int>& timeSeries);
73  bool GetNoiseFileNameAtTime(const utl::UTCDateTime& dateTime, const utl::UTCDateTime& startingDay,
74  std::string& NoiseImportfilename);
75  std::vector<int> EventHasStations(std::vector<int> stationID, AERAevent* const aeraevent,
76  const rdet::RDetector& rDetector);
77 
78  // following is taken from RdStationRejector
79  typedef std::multimap<utl::TimeStamp, std::pair<utl::TimeStamp, size_t> > ParentMap;
80 
81  class TimeRangeMap : public ParentMap {
82  public:
83  typedef std::vector<size_t> IdCollection;
84 
86  GetBadStations(const utl::TimeStamp& time)
87  const
88  {
89  ParentMap::const_iterator it = upper_bound(time); // first key larger than time
90 
91  if (it == begin())
92  return IdCollection();
93 
95  do {
96  --it;
97  if (it->first <= time && time <= it->second.first)
98  ids.push_back(it->second.second);
99  } while (it != begin());
100  return ids;
101  }
102  };
103 
105 
106 
107  REGISTER_MODULE("RdVirtualStationNoiseImporter", RdVirtualStationNoiseImporter);
108 
109  };
110 
111 }
112 
113 
114 #endif
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
Detector description interface for RDetector-related data.
Definition: RDetector.h:46
fwk::VModule::ResultFlag Finish() override
Finish: invoked at end of the run (NOT end of the event)
const double second
Definition: GalacticUnits.h:32
std::vector< int > EventHasStations(std::vector< int > stationID, AERAevent *const aeraevent, const rdet::RDetector &rDetector)
Module interface.
Definition: VModule.h:53
constexpr double minute
Definition: AugerUnits.h:149
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
REGISTER_MODULE("RdVirtualStationNoiseImporter", RdVirtualStationNoiseImporter)
CLHEP::HepRandomEngine RandomEngineType
Definition: RandomEngine.h:30
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
bool GetNoiseFileNameAtTime(const utl::UTCDateTime &dateTime, const utl::UTCDateTime &startingDay, std::string &NoiseImportfilename)

, generated on Tue Sep 26 2023.