Changeset 1035 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 11/06/01 13:44:26 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r1018 r1035 35 35 36 36 #pragma link C++ class MReadTree+; 37 #pragma link C++ class MReadMarsFile+; 37 38 38 39 #pragma link C++ class MRootFileBranch+; -
trunk/MagicSoft/Mars/mbase/MReadTree.cc
r1032 r1035 54 54 #include <fstream.h> 55 55 56 #include <TFile.h> // TFile::GetName 56 57 #include <TChain.h> 57 58 #include <TGProgressBar.h> … … 86 87 fVetoList->SetOwner(); 87 88 89 fNotify = new TOrdCollection; 90 88 91 // 89 92 // open the input stream 90 93 // 91 94 fChain = new TChain(tname); 95 fChain->SetNotify(this); 92 96 93 97 if (fname) … … 115 119 // 116 120 delete fChain; 121 delete fNotify; 117 122 delete fVetoList; 123 } 124 125 void MReadTree::SetOwner(Bool_t flag) 126 { 127 flag ? fNotify->SetBit(kIsOwner) : fNotify->ResetBit(kIsOwner); 128 } 129 130 Bool_t MReadTree::Notify() 131 { 132 fNotify->ForEach(TObject, Notify)(); 133 return kTRUE; 118 134 } 119 135 … … 464 480 fVetoList->Add(branch); 465 481 } 482 483 const char *MReadTree::GetFileName() const 484 { 485 return fChain->GetFile()->GetName(); 486 } 487 488 void MReadTree::AddNotify(TObject *obj) 489 { 490 fNotify->Add(obj); 491 } -
trunk/MagicSoft/Mars/mbase/MReadTree.h
r1030 r1035 22 22 23 23 TOrdCollection *fVetoList; // List of Branches which are not allowed to get enabled 24 TOrdCollection *fNotify; // List of TObjects to notify when switching files 24 25 25 26 TGProgressBar *fProgress; // Possible display of status … … 32 33 void EnableBranchChoosing(); 33 34 34 Bool_t PreProcess(MParList *pList); 35 Bool_t Process(); 36 35 enum { kIsOwner = BIT(14) }; 36 37 37 public: 38 38 MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL); 39 39 ~MReadTree(); 40 40 41 Int_t AddFile(const char *fname);42 41 void DisableAutoScheme() { fAutoEnable = kFALSE; } 43 42 void EnableBranch(const char *name); … … 55 54 UInt_t GetEntries() const { return fNumEntries; } 56 55 56 const char *GetFileName() const; 57 58 virtual void AddNotify(TObject *obj); 59 virtual void SetOwner(Bool_t flag=kTRUE); 60 61 virtual Int_t AddFile(const char *fname); 62 63 virtual Bool_t PreProcess(MParList *pList); 64 virtual Bool_t Process(); 65 66 virtual Bool_t Notify(); 67 57 68 ClassDef(MReadTree, 0) // Reads a tree from file(s) 58 69 }; -
trunk/MagicSoft/Mars/mbase/Makefile
r1018 r1035 40 40 MEvtLoop.cc \ 41 41 MReadTree.cc \ 42 MReadMarsFile.cc \ 42 43 MWriteFile.cc \ 43 44 MWriteAsciiFile.cc \
Note:
See TracChangeset
for help on using the changeset viewer.