Changeset 9315 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
02/11/09 12:08:23 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc

    r9302 r9315  
    291291        // Delete the file. This'll also close the file (if open)
    292292        //
     293        *fLog << inf3 << "Closing file " << fOut->GetName() << "." << endl;
    293294        delete fOut;
    294295
     
    299300        // - Branches are automatically deleted by the tree destructor
    300301        //
    301         *fLog << inf << "Output File closed and object deleted." << endl;
    302302    }
    303303
     
    325325    *fLog << all << underline << "File: " << GetFileName() << dec << endl;
    326326
    327     if (fTrees.GetEntries()==0)
    328     {
    329         *fLog << "  No contents." << endl;
    330         return;
    331     }
     327    Bool_t cont = kFALSE;
    332328
    333329    TObject *obj;
     
    347343
    348344        *fLog << " + " << name.Strip(TString::kTrailing, '.') << ": \t" << (ULong_t)branch->GetEntries() << " entries." << endl;
     345        cont = kTRUE;
    349346    }
    350347
     
    353350    while ((t=(TTree*)NextTree()))
    354351        if (t->TestBit(kIsNewTree))
     352        {
    355353            *fLog << " + " << t->GetName() << ": \t" << (ULong_t)t->GetEntries() << " entries." << endl;
     354            cont = kTRUE;
     355        }
    356356
    357357    TIter NextKey(fOut->GetList());
     358   
    358359    while ((obj=NextKey()))
    359360    {
     
    365366
    366367        *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
    368374    *fLog << endl;
    369375}
     
    822828
    823829    // Close/delete the old file (keys already written above)
     830    *fLog << inf3 << "Closing file " << fOut->GetName() << "." << endl;
    824831    delete fOut;
    825 
     832 
    826833    // Replace current with new file
    827834    fOut = newfile;
     
    912919    *fLog << inf << out << flush;
    913920
    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;
    917935
    918936    *fLog << "done." << endl;
  • trunk/MagicSoft/Mars/mfilter/MFDeltaT.cc

    r7005 r9315  
    119119    Int_t i=0;
    120120
    121     if (GetNumExecutions()>0)
     121    if (GetNumExecutions()>1)
    122122    {
    123123        if (*fTime-fLastTime>fUpperLimit)
  • trunk/MagicSoft/Mars/mhbase/MFillH.cc

    r9302 r9315  
    566566//        fCanvas->cd();
    567567
     568    fH->SetNumExecutions(GetNumExecutions());
    568569    const Int_t rc = fH->Fill(fParContainer, fWeight?fWeight->GetVal():1);
    569     fH->SetNumExecutions(GetNumExecutions()+1);
    570570
    571571//    if (save && fCanvas)
  • trunk/MagicSoft/Mars/mhbase/MH.cc

    r9312 r9315  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.44 2009-02-10 20:00:09 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.45 2009-02-11 12:08:23 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    15081508void MH::PrintSkipped(UInt_t n, const char *str)
    15091509{
    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;
    15131517}
    15141518
Note: See TracChangeset for help on using the changeset viewer.