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

Last change on this file since 5468 was 5160, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 2.6 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 static Byte_t IsFileValid(const char *name);
54
55 virtual void SortFiles();
56
57 void DisableAutoScheme() { fAutoEnable = kFALSE; }
58 void EnableBranch(const char *name);
59 void VetoBranch(const char *name);
60
61 Bool_t GetEvent();
62
63 Bool_t DecEventNum(UInt_t dec=1); // decrease number of event (position in tree)
64 Bool_t IncEventNum(UInt_t inc=1); // increase number of event (position in tree)
65 Bool_t SetEventNum(UInt_t nr); // set number of event (position in tree)
66
67 UInt_t GetNumEntry() const { return fNumEntry; }
68 UInt_t GetEntries();
69
70 TString GetFileName() const;
71 Int_t GetFileIndex() const;
72
73 virtual void AddNotify(TObject *obj);
74 virtual void SetOwner(Bool_t flag=kTRUE);
75
76 virtual Int_t AddFile(const char *fname, Int_t entries=-1);
77 virtual Int_t AddFiles(const MReadTree &read);
78 Int_t AddFiles(MDirIter &dir) { return MRead::AddFiles(dir); }
79
80 Int_t PreProcess(MParList *pList);
81 Int_t Process();
82 Int_t PostProcess();
83
84 Bool_t Notify();
85 Bool_t Rewind() { SetEventNum(0); return kTRUE; }
86 void Print(Option_t *opt="") const;
87
88 ClassDef(MReadTree, 1) // Reads a tree from file(s)
89};
90
91#endif
Note: See TracBrowser for help on using the repository browser.