RecDataWriter.h
Go to the documentation of this file.
1 #ifndef _RecDataWriter_h_
2 #define _RecDataWriter_h_
3 
4 #include <fwk/VModule.h>
5 #include <fwk/CentralConfig.h>
6 #include <utl/CoordinateSystemPtr.h>
7 #include <utl/config.h>
8 #include <sevt/Station.h>
9 
10 #include <adst/FdRecLevel.h>
11 #include <adst/SdRecLevel.h>
12 #include <adst/TraceType.h>
13 #include <adst/RecEventFile.h>
14 
15 #include <string>
16 #include <fstream>
17 
18 
19 class RecEvent;
20 class GenShower;
21 class FDEvent;
22 class SDEvent;
23 class Detector;
24 class FileInfo;
25 class DetectorGeometry;
26 class RdEvent;
27 
28 namespace utl {
29  class Branch;
30 };
31 
32 namespace evt {
33  class Event;
34  class ShowerFRecData;
35 }
36 
37 namespace fevt {
38  class Eye;
39  class Pixel;
40  class EyeRecData;
41  class Telescope;
42  class TelescopeRecData;
43 }
44 
45 #ifdef INCLUDE_HAS
46 namespace HASTools {
47  class MuonProfile;
48  class VTankResponse;
49  class EMComponent;
50 }
51 #endif
52 
53 namespace revt {
54  class REvent;
55 }
56 
57 namespace ADST {
58  class AsciiConverter;
59 };
60 
61 namespace otoa {
62  class Offline2ADST;
63 };
64 
65 
66 namespace RecDataWriterNG {
67 
68  class FOVCalculator;
69 
70 
80  class RecDataWriter : public fwk::VModule {
81 
82  public:
83  RecDataWriter();
84  virtual ~RecDataWriter();
85 
86  fwk::VModule::ResultFlag Init() override;
87  fwk::VModule::ResultFlag Run(evt::Event& event) override;
89 
90  private:
91  // Methods related to configuration reading
92  bool ReadConfig(); //< Does all the accessing of CentralConfig
93  bool ReadRootConfig(utl::Branch& topB); //< Reads just the config for ROOT streaming
94  bool ReadAsciiConfig(utl::Branch& topB); //< Reads just the config for ASCII streaming
95 
96  // Methods related to initializing the converters / output related members
97  bool PrepareAsciiFile();
99 
100  // Data and configuration related to ADST ROOT writing
101  std::string fRootOutputFileName;
103  bool fWriteROOT = false;
104  RecEventFile* fRecEventFile = nullptr;
106 
107  // Data and configuration related to ADST ASCII writing
108  std::string fAsciiOutputFileName;
110  bool fWriteASCII = false;
111  std::string fAsciiDataMode;
112  ADST::AsciiConverter* fAsciiConverter = nullptr;
113  int fAsciiMinFdRecLevel = 0; //< minimum FD reconstruction level to store data in ASCII
114  int fAsciiMinSdRecLevel = 0; //< minimum SD reconstruction level to store data in ASCII
115 
116  int fVerbosity = 0;
117 
118  int fNWritten = 0;
122 
123  RecEvent* fRecEvent = nullptr;
124 
125  REGISTER_MODULE("RecDataWriterNG", RecDataWriter);
126 
127  };
128 
129 }
130 
131 
132 #endif
RecEventFile::Mode fAsciiOutputFileMode
fwk::VModule::ResultFlag Finish() override
Finish: invoked at end of the run (NOT end of the event)
Mode
Available open modes.
Definition: IoCodes.h:16
Read Only access.
Definition: IoCodes.h:18
otoa::Offline2ADST * fADSTConverter
Class representing a document branch.
Definition: Branch.h:107
REGISTER_MODULE("RecDataWriterNG", RecDataWriter)
RecEventFile::Mode fRootOutputFileMode
Module interface.
Definition: VModule.h:53
ADST::AsciiConverter * fAsciiConverter
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
fwk::VModule::ResultFlag Run(evt::Event &event) override
Run: invoked once per event.
fwk::VModule::ResultFlag Init() override
Initialize: invoked at beginning of run (NOT beginning of event)
Module to write a Root Tree (or ASCII table) for FD and SD data.
Definition: RecDataWriter.h:80
bool ReadRootConfig(utl::Branch &topB)
bool ReadAsciiConfig(utl::Branch &topB)
Converts an Offline event to ADST.
Definition: Offline2ADST.h:27

, generated on Tue Sep 26 2023.