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