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

Last change on this file was 1114, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 2.2 KB
Line 
1#ifndef MARS_MReadTree
2#define MARS_MReadTree
3
4#ifndef MARS_MTask
5#include "MTask.h"
6#endif
7
8class MChain;
9class TBranch;
10class TGProgressBar;
11
12class MReadTree : public MTask
13{
14private:
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
26private:
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
39 enum { kIsOwner = BIT(14) };
40
41public:
42 MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL);
43 ~MReadTree();
44
45 void DisableAutoScheme() { fAutoEnable = kFALSE; }
46 void EnableBranch(const char *name);
47 void VetoBranch(const char *name);
48
49 void SetProgressBar(TGProgressBar *bar) { fProgress = bar; }
50
51 Bool_t GetEvent();
52
53 Bool_t DecEventNum(UInt_t dec=1); // decrease number of event (position in tree)
54 Bool_t IncEventNum(UInt_t inc=1); // increase number of event (position in tree)
55 Bool_t SetEventNum(UInt_t nr); // set number of event (position in tree)
56
57 UInt_t GetEventNum() const { return fNumEntry; }
58 UInt_t GetEntries() const { return fNumEntries; }
59
60 const char *GetFileName() const;
61
62 virtual void AddNotify(TObject *obj);
63 virtual void SetOwner(Bool_t flag=kTRUE);
64 virtual void Print(Option_t *opt="") const;
65
66 virtual Int_t AddFile(const char *fname);
67
68 virtual Bool_t PreProcess(MParList *pList);
69 virtual Bool_t Process();
70
71 virtual Bool_t Notify();
72
73 ClassDef(MReadTree, 0) // Reads a tree from file(s)
74};
75
76#endif
Note: See TracBrowser for help on using the repository browser.