ATLAS Offline Software
TreeReader.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TreeReader_h
6 #define TreeReader_h
7 
9 //
10 // Class TreeReader
11 // TreeReader.h
12 //
13 // Class for Tree reading through TFomula
15 
16 #include "TTree.h"
17 #include "TTreeFormula.h"
18 #include "TTreeFormulaManager.h"
19 #include "TString.h"
20 #include <map>
21 #include <vector>
22 /*
23 class std::vector<double>;
24 class std::vector<int>;
25 class std::vector<std::vector<double> >;
26 class std::vector<std::vector<int> >;*/
27 
29 class TreeReader //: public TTreeFormulaManager
30 {
31  private:
32 
33  TTree* m_tree;
34  int m_currentEntry = 0; // current ntuple entry stored in buffer
35  int m_entries; // total number of entries
36  bool m_isChain = false;
37  int m_currentTree = 0;
38  std::map<std::string, TTreeFormula*> m_formulae; // known formulae
39 
40  public:
41 
42  TreeReader(); // Default ctor
43  virtual ~TreeReader(); // dtor
44 
45  TreeReader(TTree* n); // ctor with ntuple
46 
47  void SetTree(TTree* n); //
48  double GetVariable(const char* c, int entry=-2); // return variable s for a given entry (<0 -> current entry)
49  int GetEntry(int entry=-1); // Read a given entry in the buffer (-1 -> next entry);
50  int GetEntries() { return m_entries ; }
51  TTree* GetTree() { return m_tree ; }
52  void Restart() {m_currentEntry = -1;}
53 
54  ClassDef(TreeReader,1) // Integrate this class into ROOT (must be the last member)
55 
56 };
57 
58 #endif
TreeReader::m_entries
int m_entries
Definition: TreeReader.h:35
TreeReader::~TreeReader
virtual ~TreeReader()
Definition: TreeReader.cxx:36
TreeReader::SetTree
void SetTree(TTree *n)
Definition: TreeReader.cxx:53
TreeReader::GetEntry
int GetEntry(int entry=-1)
Definition: TreeReader.cxx:102
TreeReader
Definition: TreeReader.h:30
beamspotman.n
n
Definition: beamspotman.py:731
TreeReader::m_formulae
std::map< std::string, TTreeFormula * > m_formulae
Definition: TreeReader.h:38
TreeReader::TreeReader
TreeReader()
Definition: TreeReader.cxx:26
TreeReader::m_currentEntry
int m_currentEntry
Definition: TreeReader.h:34
TreeReader::m_tree
TTree * m_tree
Definition: TreeReader.h:33
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
TreeReader::m_isChain
bool m_isChain
Definition: TreeReader.h:36
TreeReader::GetVariable
double GetVariable(const char *c, int entry=-2)
Definition: TreeReader.cxx:69
TreeReader::Restart
void Restart()
Definition: TreeReader.h:52
TreeReader::GetTree
TTree * GetTree()
Definition: TreeReader.h:51
TreeReader::m_currentTree
int m_currentTree
Definition: TreeReader.h:37
TreeReader::GetEntries
int GetEntries()
Definition: TreeReader.h:50
python.compressB64.c
def c
Definition: compressB64.py:93