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

Last change on this file since 1472 was 1472, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 2.3 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();
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 TString GetFileName() const;
62 Int_t GetFileIndex() const;
63
64 virtual void AddNotify(TObject *obj);
65 virtual void SetOwner(Bool_t flag=kTRUE);
66 virtual void Print(Option_t *opt="") const;
67
68 virtual Int_t AddFile(const char *fname);
69
70 virtual Bool_t PreProcess(MParList *pList);
71 virtual Bool_t Process();
72
73 virtual Bool_t Notify();
74 virtual void SavePrimitive(ofstream &out, Option_t *o="");
75
76 ClassDef(MReadTree, 1) // Reads a tree from file(s)
77};
78
79#endif
Note: See TracBrowser for help on using the repository browser.