source: tags/Mars-V0.5/mbase/MReadTree.h

Last change on this file was 1035, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 2.0 KB
Line 
1#ifndef MARS_MReadTree
2#define MARS_MReadTree
3
4#ifndef MARS_MTask
5#include "MTask.h"
6#endif
7
8class TChain;
9class TBranch;
10class TGProgressBar;
11
12class MReadTree : public MTask
13{
14private:
15 TChain *fChain; // Pointer to tree
16
17 UInt_t fNumEntry; // Number of actual entry
18 UInt_t fNumEntries; // Number of Events in Tree
19
20 Bool_t fBranchChoosing; // Flag for branch choosing method
21 Bool_t fAutoEnable; // Flag for auto enabeling scheme
22
23 TOrdCollection *fVetoList; // List of Branches which are not allowed to get enabled
24 TOrdCollection *fNotify; // List of TObjects to notify when switching files
25
26 TGProgressBar *fProgress; // Possible display of status
27
28 void SetBranchStatus(const TOrdCollection *list, Bool_t status);
29 void SetBranchStatus(TObject *branch, Bool_t status);
30
31 void DisableSubBranches(TBranch *b);
32 void EnableBranches(MParList *plist);
33 void EnableBranchChoosing();
34
35 enum { kIsOwner = BIT(14) };
36
37public:
38 MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL);
39 ~MReadTree();
40
41 void DisableAutoScheme() { fAutoEnable = kFALSE; }
42 void EnableBranch(const char *name);
43 void VetoBranch(const char *name);
44
45 void SetProgressBar(TGProgressBar *bar) { fProgress = bar; }
46
47 Bool_t GetEvent();
48
49 Bool_t DecEventNum(UInt_t dec=1); // decrease number of event (position in tree)
50 Bool_t IncEventNum(UInt_t inc=1); // increase number of event (position in tree)
51 Bool_t SetEventNum(UInt_t nr); // set number of event (position in tree)
52
53 UInt_t GetEventNum() const { return fNumEntry; }
54 UInt_t GetEntries() const { return fNumEntries; }
55
56 const char *GetFileName() const;
57
58 virtual void AddNotify(TObject *obj);
59 virtual void SetOwner(Bool_t flag=kTRUE);
60
61 virtual Int_t AddFile(const char *fname);
62
63 virtual Bool_t PreProcess(MParList *pList);
64 virtual Bool_t Process();
65
66 virtual Bool_t Notify();
67
68 ClassDef(MReadTree, 0) // Reads a tree from file(s)
69};
70
71#endif
Note: See TracBrowser for help on using the repository browser.