source: trunk/MagicSoft/Mars/mfileio/MReadTree.h@ 1381

Last change on this file since 1381 was 1381, checked in by tbretz, 22 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 TString GetFileName() const;
61 Int_t GetFileIndex() 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
Note: See TracBrowser for help on using the repository browser.