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

Last change on this file since 3167 was 2556, checked in by tbretz, 21 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{
13 friend class MReadReports;
14
15private:
16 MChain *fChain; // Pointer to tree
17
18 UInt_t fNumEntry; // Number of actual entry in chain
19 UInt_t fNumEntries; // Number of Events in chain
20
21 Bool_t fBranchChoosing; // Flag for branch choosing method
22 Bool_t fAutoEnable; // Flag for auto enabeling scheme
23
24 TList *fVetoList; // List of Branches which are not allowed to get enabled
25 TList *fNotify; // List of TObjects to notify when switching files
26
27 enum { kChainWasChanged = BIT(14) };
28
29private:
30 void SetBranchStatus(const TList *list, Bool_t status);
31 void SetBranchStatus(TObject *branch, Bool_t status);
32 void SetBranchStatus(const char *name, Bool_t status);
33
34 void DisableSubBranches(TBranch *b);
35 void EnableBranches(MParList *plist);
36 void EnableBranchChoosing();
37
38 Bool_t CheckBranchSize();
39
40 virtual void SetReadyToSave(Bool_t flag=kTRUE);
41 virtual void StreamPrimitive(ofstream &out) const;
42
43 enum { kIsOwner = BIT(14) };
44
45public:
46 MReadTree();
47 MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL);
48 ~MReadTree();
49
50 void DisableAutoScheme() { fAutoEnable = kFALSE; }
51 void EnableBranch(const char *name);
52 void VetoBranch(const char *name);
53
54 Bool_t GetEvent();
55
56 Bool_t DecEventNum(UInt_t dec=1); // decrease number of event (position in tree)
57 Bool_t IncEventNum(UInt_t inc=1); // increase number of event (position in tree)
58 Bool_t SetEventNum(UInt_t nr); // set number of event (position in tree)
59
60 UInt_t GetNumEntry() const { return fNumEntry; }
61 UInt_t GetEntries();
62
63 TString GetFileName() const;
64 Int_t GetFileIndex() const;
65
66 virtual void AddNotify(TObject *obj);
67 virtual void SetOwner(Bool_t flag=kTRUE);
68
69 virtual Int_t AddFile(const char *fname, Int_t entries=-1);
70 virtual Int_t AddFiles(const MReadTree &read);
71
72 Int_t PreProcess(MParList *pList);
73 Int_t Process();
74 Int_t PostProcess();
75
76 Bool_t Notify();
77 Bool_t Rewind() { SetEventNum(0); return kTRUE; }
78 void Print(Option_t *opt="") const;
79
80 ClassDef(MReadTree, 1) // Reads a tree from file(s)
81};
82
83#endif
Note: See TracBrowser for help on using the repository browser.