RdChannelNoiseImporter_AERA.h
Go to the documentation of this file.
1 #ifndef _RdChannelNoiseImporter_AERA_RdChannelNoiseImporter_AERA_h_
2 #define _RdChannelNoiseImporter_AERA_RdChannelNoiseImporter_AERA_h_
3 
4 #include <fwk/VModule.h>
5 
6 #include <evt/Event.h>
7 #include <revt/Channel.h>
8 
9 #include <utl/AugerUnits.h>
10 #include <utl/RandomEngine.h>
11 #include <utl/TimeStamp.h>
12 #include <utl/UTCDateTime.h>
13 
14 #include <rdet/Channel.h>
15 
16 #include <TBranch.h>
17 #include <TTree.h>
18 
19 #include <RadioFileIO.h>
20 #include <string>
21 
22 namespace evt {
23  class Event;
24 }
25 
26 namespace revt {
27  class Channel;
28 }
29 
31 
41 
42  public:
43  fwk::VModule::ResultFlag Init() override;
44  fwk::VModule::ResultFlag Run(evt::Event& event) override;
46 
47  private:
48  // switches controlling noise file selection
49  std::string fNoiseFileSelection;
50  std::string fNoiseFilePath;
51  bool fExpectSubDirectories = false;
52  std::string fFilenamePrefix;
53  std::string fFilenameSuffix;
54  std::string fTimeIntervalInFile;
56  bool fReplaceDataWithNoise = false;
59 
60  // switches controlling the reading of noise from a selected file
61  std::string fEvtSelInNoiseFile;
62  int fNoiseEvtNr = -1;
65 
67 
68  fwk::VModule::ResultFlag checkSetup(); //check the setup given by the init-file for consistency
69 
70  std::string GetNoiseFileName(const utl::UTCDateTime& eventTime, utl::TimeStamp& noiseTimeStamp);
71  bool GetNoiseFileNameAtTime(const utl::UTCDateTime& dateTime,
72  const utl::UTCDateTime& startingDay,
73  std::string& NoiseImportfilename);
74  int GetNoiseEventNumber(evt::Event& event, RadioFileIO* RadioFileIORead,
75  TBranch* const evtSecBranch, TTree* const IOLibTree,
76  unsigned int NumberEvents, utl::UTCDateTime eventTime);
77  bool CheckMatchingChannel(const rdet::Channel& detChannel, const rdet::Channel& replacementChannel);
78 
80  void RemovePedestal(std::vector<int>& timeSeries);
81 
82  REGISTER_MODULE("RdChannelNoiseImporter_AERA", RdChannelNoiseImporter_AERA);
83  };
84 
85 }
86 
87 #endif
bool CheckMatchingChannel(const rdet::Channel &detChannel, const rdet::Channel &replacementChannel)
bool GetNoiseFileNameAtTime(const utl::UTCDateTime &dateTime, const utl::UTCDateTime &startingDay, std::string &NoiseImportfilename)
Detector description interface for Channel-related data.
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
Add measured noise traces to simulated radio pulsed.
int GetNoiseEventNumber(evt::Event &event, RadioFileIO *RadioFileIORead, TBranch *const evtSecBranch, TTree *const IOLibTree, unsigned int NumberEvents, utl::UTCDateTime eventTime)
fwk::VModule::ResultFlag Run(evt::Event &event) override
Run: invoked once per event.
fwk::VModule::ResultFlag Finish() override
Finish: invoked at end of the run (NOT end of the event)
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
void RemovePedestal(revt::ChannelADCTimeSeries &timeSeries)
CLHEP::HepRandomEngine RandomEngineType
Definition: RandomEngine.h:30
std::string GetNoiseFileName(const utl::UTCDateTime &eventTime, utl::TimeStamp &noiseTimeStamp)
REGISTER_MODULE("RdChannelNoiseImporter_AERA", RdChannelNoiseImporter_AERA)
fwk::VModule::ResultFlag Init() override
Initialize: invoked at beginning of run (NOT beginning of event)

, generated on Tue Sep 26 2023.