Line | |
---|
1 | #ifndef ExRootTreeReader_h
|
---|
2 | #define ExRootTreeReader_h
|
---|
3 |
|
---|
4 | /** \class ExRootTreeReader
|
---|
5 | *
|
---|
6 | * Class simplifying access to ROOT tree branches
|
---|
7 | *
|
---|
8 | * $Date: 2008-11-04 10:32:26 $
|
---|
9 | * $Revision: 1.1 $
|
---|
10 | *
|
---|
11 | *
|
---|
12 | * \author S. Ovyn - UCL, Louvain-la-Neuve
|
---|
13 | *
|
---|
14 | */
|
---|
15 |
|
---|
16 | #include "TROOT.h"
|
---|
17 | #include "TChain.h"
|
---|
18 | #include "TFile.h"
|
---|
19 |
|
---|
20 | #include <map>
|
---|
21 |
|
---|
22 | class ExRootTreeReader
|
---|
23 | {
|
---|
24 | public :
|
---|
25 |
|
---|
26 | ExRootTreeReader(TTree *tree);
|
---|
27 | ~ExRootTreeReader();
|
---|
28 |
|
---|
29 | Long64_t GetEntries() const { return fChain ? static_cast<Long64_t>(fChain->GetEntries()) : 0; }
|
---|
30 | Bool_t ReadEntry(Long64_t entry);
|
---|
31 |
|
---|
32 | TClonesArray *UseBranch(const TString &branchName);
|
---|
33 |
|
---|
34 | private:
|
---|
35 |
|
---|
36 | void Init();
|
---|
37 | void Notify();
|
---|
38 |
|
---|
39 | TTree *fChain; // pointer to the analyzed TTree or TChain
|
---|
40 | Int_t fCurrentTree; // current Tree number in a TChain
|
---|
41 |
|
---|
42 | Bool_t fIsInitDone;
|
---|
43 |
|
---|
44 | typedef std::map<TString, std::pair<TBranch*, TClonesArray*> > TBranchMap;
|
---|
45 |
|
---|
46 | TBranchMap fBranchMap;
|
---|
47 | };
|
---|
48 |
|
---|
49 | #endif // ExRootTreeReader_h
|
---|
Note:
See
TracBrowser
for help on using the repository browser.