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