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

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