REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDetectorDaqChannelSwitchingProcess.h
1 
12 #ifndef RestCore_TRestDetectorDaqChannelSwitchingProcess
13 #define RestCore_TRestDetectorDaqChannelSwitchingProcess
14 
15 #include <TH1D.h>
16 #include <TRestDetectorGas.h>
17 #include <TRestDetectorHitsEvent.h>
18 #include <TRestDetectorReadout.h>
19 #include <TRestDetectorSignalEvent.h>
20 
21 #include "TRestEventProcess.h"
22 
24  private:
25  TRestEvent* fEvent;
26  TRestDetectorReadout* fReadout;
27 
28  std::map<int, int> fFirstDaqChannelDef; //[module id, first daq id]
29  bool fIgnoreUndefinedModules;
30 
31  void InitFromConfigFile() override;
32 
33  void Initialize() override;
34 
35  public:
36  RESTValue GetInputEvent() const override { return fEvent; }
37  RESTValue GetOutputEvent() const override { return fEvent; }
38 
39  void InitProcess() override;
40  TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
41  void EndProcess() override;
42 
43  void PrintMetadata() override {
45 
46  RESTMetadata << "module's daq channel re-definition: " << RESTendl;
47  auto iter = fFirstDaqChannelDef.begin();
48  while (iter != fFirstDaqChannelDef.end()) {
49  RESTMetadata << "module id: " << iter->first << " first daq channel: " << iter->second
50  << RESTendl;
51  iter++;
52  }
53  RESTMetadata << RESTendl;
54 
55  EndPrintProcess();
56  }
57 
60 
61  ClassDefOverride(TRestDetectorDaqChannelSwitchingProcess, 1);
62 };
63 #endif
void EndProcess() override
To be executed at the end of the run (outside event loop)
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
Process one event.
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
void InitProcess() override
To be executed at the beginning of the run (outside event loop)
A metadata class to generate/store a readout description.
A base class for any REST event process.
void BeginPrintProcess()
[name, cut range]
A base class for any REST event.
Definition: TRestEvent.h:38
endl_t RESTendl
Termination flag object for TRestStringOutput.