Changeset 2123
- Timestamp:
- 05/20/03 10:19:41 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2120 r2123 1 1 -*-*- END OF LINE -*-*- 2 2003/05/20: Thomas Bretz 3 4 * mbase/MLog.h: 5 - added Separator member function 6 7 * mfileio/MReadMarsFile.cc: 8 - moved output in Notify to MReadTree::Notify 9 - call MReadTree:Notify in Notify 10 11 * mfileio/MReadTree.[h,cc]: 12 - do not try to delete a Baddress if it is NULL ("*") 13 - added CheckBranchSize member function 14 - added the size consistency check to Notify 15 16 * mfileio/MWriteRootFile.cc: 17 - mini changes to Print-output 18 19 * mfilter/MF.[h,cc]: 20 - added Print-function 21 22 * mraw/MRawEvtPixelIter.h: 23 - removed wrong EOL characters 24 25 26 2 27 2003/05/19: Thomas Bretz 28 29 * mgui/MCamDisplay.cc: 30 - removed an unused variable. 31 32 * Makefile.rules: 33 - fixed Mr.Proper 3 34 4 35 * mbase/MEvtLoop.cc, mbase/MParList.cc, mbase/MTaskList.cc, -
trunk/MagicSoft/Mars/mbase/MLog.h
r2121 r2123 171 171 void SetNoColors(Bool_t flag=kTRUE) { flag ? SetBit(eNoColors) : ResetBit(eNoColors); } 172 172 173 void Separator(TString str="", int outlvl=0) 174 { 175 if (!str.IsNull()) 176 { 177 const Int_t l = (78-str.Length())/2-3; 178 str.Prepend("={ "); 179 str.Prepend('-', l); 180 str.Append(" }="); 181 str.Append('-', l); 182 } 183 if (str.Length()<78) 184 str.Append('-', 78-str.Length()); 185 186 const int save = fOutputLevel; 187 SetOutputLevel(outlvl); 188 (*this) << str << endl; 189 fOutputLevel = save; 190 } 191 173 192 ClassDef(MLog, 0) // This is what we call 'The logging system' 174 193 }; -
trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc
r1965 r2123 142 142 } 143 143 144 *fLog << inf << "MReadMarsFile: Switching to #" << GetFileIndex(); 145 *fLog << " '" << GetFileName() << "' (before event #"; 146 *fLog << GetNumEntry()-1 << ")" << endl; 144 if (!MReadTree::Notify()) 145 return kFALSE; 147 146 148 147 if (fDisplay) -
trunk/MagicSoft/Mars/mfileio/MReadTree.cc
r2120 r2123 138 138 TChainElement *element = NULL; 139 139 while ((element=(TChainElement*)Next())) 140 delete (MParContainer**)element->GetBaddress(); 140 if (element->GetBaddress()) 141 delete (MParContainer**)element->GetBaddress(); 141 142 142 143 // … … 155 156 // -------------------------------------------------------------------------- 156 157 // 158 // This check whether all branches in the tree have the same size. If 159 // this is not the case the events in the different branches cannot 160 // be ordered correctly. 161 // 162 Bool_t MReadTree::CheckBranchSize() 163 { 164 TArrayI entries(fChain->GetStatus()->GetSize()); 165 Int_t num=0; 166 167 // Loop over all branches which have a corresponding container 168 TIter Next(fChain->GetStatus()); 169 170 TChainElement *element = NULL; 171 while ((element=(TChainElement*)Next())) 172 { 173 // Get branch name and find pointer to corresponding branch 174 const TString name = element->GetName(); 175 const TBranch *b = fChain->FindBranch(name); 176 177 // Skip element without corresponding branches (like "*") 178 if (!b) 179 continue; 180 181 entries[num++] = (Int_t)b->GetEntries(); 182 } 183 184 // Check the number of entries of the branches pair-wise 185 for (int i=0; i<num; i++) 186 for (int j=i; j<num; j++) 187 { 188 if (entries[i]==entries[j]) 189 continue; 190 191 *fLog << err << "ERROR - File corrupttion detected:" << endl; 192 *fLog << " Due to several circumstances (such at a bug in MReadTree or wrong" << endl; 193 *fLog << " usage of the file UPDATE mode) you may have produced a file in which" << endl; 194 *fLog << " at least two branches in the same tree (" << fChain->GetName() << ") have different" << endl; 195 *fLog << " number of entries. Sorry, but this file (" << GetFileName() << ")" << endl; 196 *fLog << " is unusable." << endl; 197 return kFALSE; 198 } 199 200 return kTRUE; 201 } 202 203 // -------------------------------------------------------------------------- 204 // 157 205 // If the owner flag is set all TObjects which are scheduled via 158 206 // AddNotify are deleted by the destructor of MReadTree … … 171 219 Bool_t MReadTree::Notify() 172 220 { 173 *fLog << inf << GetDescriptor() << ": Notify '" << fChain->GetName(); 174 *fLog << "' (before processing event #" << GetNumEntry()-1 << ")" << endl; 221 // 222 // Do a consistency check for all branches 223 // 224 if (!CheckBranchSize()) 225 return kFALSE; 226 227 *fLog << inf << GetDescriptor() << ": Switching to #" << GetFileIndex(); 228 *fLog << " '" << GetFileName() << "' (before event #"; 229 *fLog << GetNumEntry()-1 << ")" << endl; 175 230 176 231 //fNotify->Notify(); … … 542 597 543 598 Int_t num=0; 599 544 600 // 545 601 // loop over all tasks for processing … … 622 678 623 679 // 680 // Do a consistency check for all branches 681 // 682 // if (!CheckBranchSize()) 683 // return kFALSE; 684 685 // 624 686 // If auto enabling scheme isn't disabled, do auto enabling 625 687 // -
trunk/MagicSoft/Mars/mfileio/MReadTree.h
r2117 r2123 33 33 void EnableBranches(MParList *plist); 34 34 void EnableBranchChoosing(); 35 36 Bool_t CheckBranchSize(); 35 37 36 38 virtual void SetReadyToSave(Bool_t flag=kTRUE); -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
r2120 r2123 140 140 void MWriteRootFile::Print(Option_t *) const 141 141 { 142 *fLog << all << underline << "File: " << GetFileName() << ":" << endl; 142 *fLog << all << underline << "File: " << GetFileName() << endl; 143 144 if (fTrees.GetEntries()==0) 145 { 146 *fLog << " No contents." << endl; 147 return; 148 } 143 149 144 150 TTree *t = NULL; 145 151 TIter Next(&fTrees); 146 152 while ((t=(TTree*)Next())) 147 *fLog << t->GetName() << ": \t" << t->GetEntries() << " entries." << endl;153 *fLog << " " << t->GetName() << ": \t" << t->GetEntries() << " entries." << endl; 148 154 *fLog << endl; 149 155 } -
trunk/MagicSoft/Mars/mfilter/MF.cc
r1936 r2123 473 473 } 474 474 475 void MF::Print(Option_t *opt) const 476 { 477 *fLog << all << underline << GetDescriptor() << endl; 478 fF->Print(); 479 *fLog << endl << endl; 480 } -
trunk/MagicSoft/Mars/mfilter/MF.h
r1846 r2123 41 41 Bool_t PostProcess(); 42 42 43 void Print(Option_t *opt="") const; 44 43 45 ClassDef(MF, 0) // A Filter for cuts in any data member 44 46 };
Note:
See TracChangeset
for help on using the changeset viewer.