Changeset 9315
- Timestamp:
- 02/11/09 12:08:23 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
r9302 r9315 291 291 // Delete the file. This'll also close the file (if open) 292 292 // 293 *fLog << inf3 << "Closing file " << fOut->GetName() << "." << endl; 293 294 delete fOut; 294 295 … … 299 300 // - Branches are automatically deleted by the tree destructor 300 301 // 301 *fLog << inf << "Output File closed and object deleted." << endl;302 302 } 303 303 … … 325 325 *fLog << all << underline << "File: " << GetFileName() << dec << endl; 326 326 327 if (fTrees.GetEntries()==0) 328 { 329 *fLog << " No contents." << endl; 330 return; 331 } 327 Bool_t cont = kFALSE; 332 328 333 329 TObject *obj; … … 347 343 348 344 *fLog << " + " << name.Strip(TString::kTrailing, '.') << ": \t" << (ULong_t)branch->GetEntries() << " entries." << endl; 345 cont = kTRUE; 349 346 } 350 347 … … 353 350 while ((t=(TTree*)NextTree())) 354 351 if (t->TestBit(kIsNewTree)) 352 { 355 353 *fLog << " + " << t->GetName() << ": \t" << (ULong_t)t->GetEntries() << " entries." << endl; 354 cont = kTRUE; 355 } 356 356 357 357 TIter NextKey(fOut->GetList()); 358 358 359 while ((obj=NextKey())) 359 360 { … … 365 366 366 367 *fLog << " - " << obj->GetName() << ": \t" << (ULong_t)((TTree*)obj)->GetEntries() << " entries." << endl; 367 } 368 cont = kTRUE; 369 } 370 371 if (!cont) 372 *fLog << " No contents." << endl; 373 368 374 *fLog << endl; 369 375 } … … 822 828 823 829 // Close/delete the old file (keys already written above) 830 *fLog << inf3 << "Closing file " << fOut->GetName() << "." << endl; 824 831 delete fOut; 825 832 826 833 // Replace current with new file 827 834 fOut = newfile; … … 912 919 *fLog << inf << out << flush; 913 920 914 TTree *clone=t.CloneTree(); 915 clone->Write(); 916 delete clone; 921 // When a new file has been opened the old clone (if existing) has 922 // been moved to the new file. We could now use CopyTree but then 923 // we would have to unpack all data and repack it. Instead 924 // we delete the moved old tree. 925 // FIXME: In priciple we could delete a "wrong" tree with the same name. 926 // Should we flag the clones and delete them in ChangeFile? 927 TObject *old = fOut->GetList()->Remove(fOut->GetList()->FindObject(t.GetName())); 928 delete old; 929 930 // Now we clone the tree without unpacking and repacking. 931 // When it has not been moved it will be deleted in the TFile destructor 932 /*TTree *clone =*/ t.CloneTree(-1, "fast"); 933 //clone->Write(); 934 //delete clone; 917 935 918 936 *fLog << "done." << endl; -
trunk/MagicSoft/Mars/mfilter/MFDeltaT.cc
r7005 r9315 119 119 Int_t i=0; 120 120 121 if (GetNumExecutions()> 0)121 if (GetNumExecutions()>1) 122 122 { 123 123 if (*fTime-fLastTime>fUpperLimit) -
trunk/MagicSoft/Mars/mhbase/MFillH.cc
r9302 r9315 566 566 // fCanvas->cd(); 567 567 568 fH->SetNumExecutions(GetNumExecutions()); 568 569 const Int_t rc = fH->Fill(fParContainer, fWeight?fWeight->GetVal():1); 569 fH->SetNumExecutions(GetNumExecutions()+1);570 570 571 571 // if (save && fCanvas) -
trunk/MagicSoft/Mars/mhbase/MH.cc
r9312 r9315 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.4 4 2009-02-10 20:00:09tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.45 2009-02-11 12:08:23 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 1508 1508 void MH::PrintSkipped(UInt_t n, const char *str) 1509 1509 { 1510 *fLog << " " << setw(7) << n << " ("; 1511 *fLog << MString::Format("%5.1f", 100.*n/GetNumExecutions()); 1512 *fLog << "%) Evts skipped: " << str << endl; 1510 *fLog << " " << setw(7) << n; 1511 if (GetNumExecutions()>0) 1512 { 1513 *fLog << " (" << MString::Format("%5.1f", 100.*n/GetNumExecutions()); 1514 *fLog << "%)" << str << endl; 1515 } 1516 *fLog << " Evts skipped: " << str << endl; 1513 1517 } 1514 1518
Note:
See TracChangeset
for help on using the changeset viewer.