CONEXFile.h
Go to the documentation of this file.
1 #ifndef _io_CONEXFile_h_
2 #define _io_CONEXFile_h_
3 
4 #include <io/CONEXIOException.h>
5 #include <io/VEventFile.h>
6 #include <io/CONEXStructures.h>
7 
8 #include <vector>
9 
10 
11 namespace evt {
12  class Event;
13 }
14 
15 // root forward-decl
16 class TFile;
17 class TTree;
18 
19 namespace io {
20 
21  class CONEXHeader;
22  class CONEXShower;
23  class CONEXLeadingParticles;
24 
25 
36  class CONEXFile : public VEventFile {
37 
38  public:
39  CONEXFile() { }
40  CONEXFile(const std::string& fileName, const Mode mode = eRead, utl::Branch* const b = nullptr);
41  virtual ~CONEXFile();
42 
43  void Open(const std::string& fileName, const Mode mode = eRead, utl::Branch* const b = nullptr) override;
44  void Close() override;
45  Status Read(evt::Event& event) override;
46  void Write(const evt::Event& event) override;
47  Status FindEvent(const unsigned int eventId) override;
48  Status GotoPosition(const unsigned int position) override;
49  int GetNEvents() override;
50 
51  private:
52  CONEXFile(const CONEXFile&);
53  CONEXFile& operator=(const CONEXFile&);
54 
55  void MapHeader(const float version);
56  void MapShower(const float version);
57 
58  virtual int NextEntry();
59 
60  TFile* fFile = nullptr;
61  TTree* fShowerTree = nullptr;
62  TTree* fHeaderTree = nullptr;
63 
64  CONEXShower* fShower = nullptr;
65  CONEXHeader* fHeader = nullptr;
66  std::vector<io::CONEXLeadingParticles> fLPvector;
67  double fFirstGrammageBin = 0;
68 
69  float fVersion = 0;
70  float fROOTVersion = 0;
71 
72  unsigned int fCurrentPosition = 0;
73 
74  };
75 
76 }
77 
78 
79 #endif
CONEXFile & operator=(const CONEXFile &)
float fVersion
Definition: CONEXFile.h:69
Wrapper for CONEX header information.
Read profiles from CONEX.
Definition: CONEXFile.h:36
void Close() override
Definition: CONEXFile.cc:55
Wrapper for CONEX header shower profile data.
CONEXHeader * fHeader
Definition: CONEXFile.h:65
virtual ~CONEXFile()
Definition: CONEXFile.cc:39
Status GotoPosition(const unsigned int position) override
goto by position in the file
Definition: CONEXFile.cc:245
void Write(const evt::Event &event) override
Definition: CONEXFile.cc:228
void Open(const std::string &fileName, const Mode mode=eRead, utl::Branch *const b=nullptr) override
Definition: CONEXFile.cc:71
Mode
Available open modes.
Definition: IoCodes.h:16
CONEXShower * fShower
Definition: CONEXFile.h:64
virtual int NextEntry()
Definition: CONEXFile.cc:257
TFile * fFile
Definition: CONEXFile.h:60
Status FindEvent(const unsigned int eventId) override
seek Event id set cursor there
Definition: CONEXFile.cc:237
TTree * fHeaderTree
Definition: CONEXFile.h:62
Class representing a document branch.
Definition: Branch.h:107
void MapHeader(const float version)
Definition: CONEXFile.cc:278
Status
Return code for seek operation.
Definition: IoCodes.h:24
void MapShower(const float version)
Definition: CONEXFile.cc:305
unsigned int fCurrentPosition
Definition: CONEXFile.h:72
Status Read(evt::Event &event) override
read current event advance cursor by 1
Definition: CONEXFile.cc:167
double fFirstGrammageBin
Definition: CONEXFile.h:67
float fROOTVersion
Definition: CONEXFile.h:70
TTree * fShowerTree
Definition: CONEXFile.h:61
int GetNEvents() override
Definition: CONEXFile.cc:265
std::vector< io::CONEXLeadingParticles > fLPvector
Definition: CONEXFile.h:66

, generated on Tue Sep 26 2023.