RadioFileAERAroot.h
Go to the documentation of this file.
1 #ifndef _io_RadioFileAERAroot_h_
2 #define _io_RadioFileAERAroot_h_
3 
4 //#include <TFile.h>
5 #include <io/VROOTFile.h>
6 #include <RadioFileIO.h>
7 #include <TBranch.h>
8 #include <string>
9 
10 
11 namespace io {
12 
21  class RadioFileAERAroot : public VROOTFile {
22 
23  public:
24  RadioFileAERAroot() = default;
25 
26  RadioFileAERAroot(const std::string& filename, const Mode mode = eRead, utl::Branch* const b = nullptr)
27  { Open(filename, mode, b); }
28 
29  virtual ~RadioFileAERAroot() = default;
30 
31  void Open(const std::string& filename, const Mode mode = eRead, utl::Branch* const b = nullptr) override;
32 
33  void Close() override;
34 
35  void Print();
36 
37  Status Read(evt::Event& event) override;
38  void Write(const evt::Event& event) override;
40  Status FindEvent(const unsigned int eventId) override;
41  Status GotoPosition(const unsigned int position) override;
42  int GetNEvents() override;
43 
44  private:
45  int fCurrentEvent = -1;
46  int fCountEvent = - 1;
47  RadioFileIO* fRadioFileIO = nullptr;
48  TTree* fIOLibTree = nullptr;
49  TBranch* fIObranch = nullptr;
50  bool fHasFileOpen = false;
51  bool fIsFirstevent = true;
52  std::string fSourceFileName;
53  };
54 
55 }
56 
57 
58 #endif
Status Read(evt::Event &event) override
read current event advance cursor by 1
Mode
Available open modes.
Definition: IoCodes.h:16
void Open(const std::string &filename, const Mode mode=eRead, utl::Branch *const b=nullptr) override
Class representing a document branch.
Definition: Branch.h:107
Status
Return code for seek operation.
Definition: IoCodes.h:24
void Write(const evt::Event &event) override
virtual ~RadioFileAERAroot()=default
RadioFileAERAroot(const std::string &filename, const Mode mode=eRead, utl::Branch *const b=nullptr)
Status GotoPosition(const unsigned int position) override
goto by position in the file
Status FindEvent(const unsigned int eventId) override
seek Event id set cursor there
char * filename
Definition: dump1090.h:266
RadioFileIO * fRadioFileIO
RadioFileAERAroot()=default

, generated on Tue Sep 26 2023.