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

Last change on this file since 1568 was 1568, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 2.4 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
26 enum { kChainWasChanged = BIT(14) };
27
28private:
29 TGProgressBar *fProgress; //! Possible display of status
30
31 void SetBranchStatus(const TList *list, Bool_t status);
32 void SetBranchStatus(TObject *branch, Bool_t status);
33 void SetBranchStatus(const char *name, Bool_t status);
34
35 void DisableSubBranches(TBranch *b);
36 void EnableBranches(MParList *plist);
37 void EnableBranchChoosing();
38
39 virtual void SetReadyToSave(Bool_t flag=kTRUE);
40 virtual void StreamPrimitive(ofstream &out) const;
41
42 enum { kIsOwner = BIT(14) };
43
44public:
45 MReadTree();
46 MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL);
47 ~MReadTree();
48
49 void DisableAutoScheme() { fAutoEnable = kFALSE; }
50 void EnableBranch(const char *name);
51 void VetoBranch(const char *name);
52
53 void SetProgressBar(TGProgressBar *bar) { fProgress = bar; }
54
55 Bool_t GetEvent();
56
57 Bool_t DecEventNum(UInt_t dec=1); // decrease number of event (position in tree)
58 Bool_t IncEventNum(UInt_t inc=1); // increase number of event (position in tree)
59 Bool_t SetEventNum(UInt_t nr); // set number of event (position in tree)
60
61 UInt_t GetEventNum() const { return fNumEntry; }
62 UInt_t GetEntries();
63
64 TString GetFileName() const;
65 Int_t GetFileIndex() const;
66
67 virtual void AddNotify(TObject *obj);
68 virtual void SetOwner(Bool_t flag=kTRUE);
69 virtual void Print(Option_t *opt="") const;
70
71 virtual Int_t AddFile(const char *fname);
72 virtual Int_t AddFiles(const MReadTree &read);
73
74 virtual Bool_t PreProcess(MParList *pList);
75 virtual Bool_t Process();
76
77 virtual Bool_t Notify();
78
79 ClassDef(MReadTree, 1) // Reads a tree from file(s)
80};
81
82#endif
Note: See TracBrowser for help on using the repository browser.