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

Last change on this file since 2117 was 2117, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 2.3 KB
Line 
1#ifndef MARS_MReadTree
2#define MARS_MReadTree
3
4#ifndef MARS_MRead
5#include "MRead.h"
6#endif
7
8class MChain;
9class TBranch;
10
11class MReadTree : public MRead
12{
13private:
14 MChain *fChain; // Pointer to tree
15
16 UInt_t fNumEntry; // Number of actual entry in chain
17 UInt_t fNumEntries; // Number of Events in chain
18
19 Bool_t fBranchChoosing; // Flag for branch choosing method
20 Bool_t fAutoEnable; // Flag for auto enabeling scheme
21
22 TList *fVetoList; // List of Branches which are not allowed to get enabled
23 TList *fNotify; // List of TObjects to notify when switching files
24
25 enum { kChainWasChanged = BIT(14) };
26
27private:
28 void SetBranchStatus(const TList *list, Bool_t status);
29 void SetBranchStatus(TObject *branch, Bool_t status);
30 void SetBranchStatus(const char *name, Bool_t status);
31
32 void DisableSubBranches(TBranch *b);
33 void EnableBranches(MParList *plist);
34 void EnableBranchChoosing();
35
36 virtual void SetReadyToSave(Bool_t flag=kTRUE);
37 virtual void StreamPrimitive(ofstream &out) const;
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 Bool_t GetEvent();
51
52 Bool_t DecEventNum(UInt_t dec=1); // decrease number of event (position in tree)
53 Bool_t IncEventNum(UInt_t inc=1); // increase number of event (position in tree)
54 Bool_t SetEventNum(UInt_t nr); // set number of event (position in tree)
55
56 UInt_t GetNumEntry() const { return fNumEntry; }
57 UInt_t GetEntries();
58
59 TString GetFileName() const;
60 Int_t GetFileIndex() const;
61
62 virtual void AddNotify(TObject *obj);
63 virtual void SetOwner(Bool_t flag=kTRUE);
64
65 virtual Int_t AddFile(const char *fname, Int_t entries=-1);
66 virtual Int_t AddFiles(const MReadTree &read);
67
68 Bool_t PreProcess(MParList *pList);
69 Bool_t Process();
70 Bool_t PostProcess();
71
72 Bool_t Notify();
73 Bool_t Rewind() { SetEventNum(0); return kTRUE; }
74 void Print(Option_t *opt="") const;
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.