1 | #ifndef MARS_MReadTree
|
---|
2 | #define MARS_MReadTree
|
---|
3 |
|
---|
4 | #ifndef MARS_MRead
|
---|
5 | #include "MRead.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class MChain;
|
---|
9 | class TBranch;
|
---|
10 |
|
---|
11 | class MReadTree : public MRead
|
---|
12 | {
|
---|
13 | private:
|
---|
14 | MChain *fChain; // Pointer to tree
|
---|
15 |
|
---|
16 | UInt_t fNumEntry; // Number of actual entry in chain
|
---|
17 | UInt_t fNumEntries; // Number of Events in chain
|
---|
18 |
|
---|
19 | Bool_t fBranchChoosing; // Flag for branch choosing method
|
---|
20 | Bool_t fAutoEnable; // Flag for auto enabeling scheme
|
---|
21 |
|
---|
22 | TList *fVetoList; // List of Branches which are not allowed to get enabled
|
---|
23 | TList *fNotify; // List of TObjects to notify when switching files
|
---|
24 |
|
---|
25 | enum { kChainWasChanged = BIT(14) };
|
---|
26 |
|
---|
27 | private:
|
---|
28 | void SetBranchStatus(const TList *list, Bool_t status);
|
---|
29 | void SetBranchStatus(TObject *branch, Bool_t status);
|
---|
30 | void SetBranchStatus(const char *name, Bool_t status);
|
---|
31 |
|
---|
32 | void DisableSubBranches(TBranch *b);
|
---|
33 | void EnableBranches(MParList *plist);
|
---|
34 | void EnableBranchChoosing();
|
---|
35 |
|
---|
36 | Bool_t CheckBranchSize();
|
---|
37 |
|
---|
38 | virtual void SetReadyToSave(Bool_t flag=kTRUE);
|
---|
39 | virtual void StreamPrimitive(ofstream &out) const;
|
---|
40 |
|
---|
41 | enum { kIsOwner = BIT(14) };
|
---|
42 |
|
---|
43 | public:
|
---|
44 | MReadTree();
|
---|
45 | MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL);
|
---|
46 | ~MReadTree();
|
---|
47 |
|
---|
48 | void DisableAutoScheme() { fAutoEnable = kFALSE; }
|
---|
49 | void EnableBranch(const char *name);
|
---|
50 | void VetoBranch(const char *name);
|
---|
51 |
|
---|
52 | Bool_t GetEvent();
|
---|
53 |
|
---|
54 | Bool_t DecEventNum(UInt_t dec=1); // decrease number of event (position in tree)
|
---|
55 | Bool_t IncEventNum(UInt_t inc=1); // increase number of event (position in tree)
|
---|
56 | Bool_t SetEventNum(UInt_t nr); // set number of event (position in tree)
|
---|
57 |
|
---|
58 | UInt_t GetNumEntry() const { return fNumEntry; }
|
---|
59 | UInt_t GetEntries();
|
---|
60 |
|
---|
61 | TString GetFileName() const;
|
---|
62 | Int_t GetFileIndex() const;
|
---|
63 |
|
---|
64 | virtual void AddNotify(TObject *obj);
|
---|
65 | virtual void SetOwner(Bool_t flag=kTRUE);
|
---|
66 |
|
---|
67 | virtual Int_t AddFile(const char *fname, Int_t entries=-1);
|
---|
68 | virtual Int_t AddFiles(const MReadTree &read);
|
---|
69 |
|
---|
70 | Int_t PreProcess(MParList *pList);
|
---|
71 | Int_t Process();
|
---|
72 | Int_t PostProcess();
|
---|
73 |
|
---|
74 | Bool_t Notify();
|
---|
75 | Bool_t Rewind() { SetEventNum(0); return kTRUE; }
|
---|
76 | void Print(Option_t *opt="") const;
|
---|
77 |
|
---|
78 | ClassDef(MReadTree, 1) // Reads a tree from file(s)
|
---|
79 | };
|
---|
80 |
|
---|
81 | #endif
|
---|