source: trunk/MagicSoft/Mars/mbase/MReadTree.h@ 1104

Last change on this file since 1104 was 1086, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 2.1 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 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 TGProgressBar *fProgress; //! Possible display of status
27
28 void SetBranchStatus(const TList *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 virtual void SetReadyToSave(Bool_t flag=kTRUE);
36
37 enum { kIsOwner = BIT(14) };
38
39public:
40 MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL);
41 ~MReadTree();
42
43 void DisableAutoScheme() { fAutoEnable = kFALSE; }
44 void EnableBranch(const char *name);
45 void VetoBranch(const char *name);
46
47 void SetProgressBar(TGProgressBar *bar) { fProgress = bar; }
48
49 Bool_t GetEvent();
50
51 Bool_t DecEventNum(UInt_t dec=1); // decrease number of event (position in tree)
52 Bool_t IncEventNum(UInt_t inc=1); // increase number of event (position in tree)
53 Bool_t SetEventNum(UInt_t nr); // set number of event (position in tree)
54
55 UInt_t GetEventNum() const { return fNumEntry; }
56 UInt_t GetEntries() const { return fNumEntries; }
57
58 const char *GetFileName() const;
59
60 virtual void AddNotify(TObject *obj);
61 virtual void SetOwner(Bool_t flag=kTRUE);
62 virtual void Print(Option_t *opt="") const;
63
64 virtual Int_t AddFile(const char *fname);
65
66 virtual Bool_t PreProcess(MParList *pList);
67 virtual Bool_t Process();
68
69 virtual Bool_t Notify();
70
71 ClassDef(MReadTree, 0) // Reads a tree from file(s)
72};
73
74#endif
Note: See TracBrowser for help on using the repository browser.