Ignore:
Timestamp:
08/27/04 16:57:55 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mfileio
Files:
3 edited

Legend:

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

    r4183 r4766  
    113113}
    114114
     115// --------------------------------------------------------------------------
     116//
     117// Return the number of entries in all trees.
     118//
     119UInt_t MReadReports::GetEntries()
     120{
     121    UInt_t n=0;
     122
     123    TIter NextT(fTrees->GetList());
     124    MReadTree *tree=0;
     125    while ((tree=(MReadTree*)NextT()))
     126        n += tree->GetEntries();
     127
     128    return n;
     129}
     130
     131// --------------------------------------------------------------------------
     132//
     133// In case of a Master Tree GetFileName() of the MReadMarsFile is returned.
     134// If no master is available "<MReadReports>" is returned.
     135//
     136TString MReadReports::GetFileName() const
     137{
     138    if (!TestBit(kHasMaster))
     139        return "<MReadReports>";
     140
     141    TIter NextT(fTrees->GetList());
     142    MReadTree *tree=0;
     143    while ((tree=(MReadTree*)NextT()))
     144        if (tree->InheritsFrom("MReadMarsFile"))
     145            return tree->GetFileName();
     146
     147    return "<n/a>";
     148
     149}
     150
    115151void MReadReports::AddToBranchList(const char *name)
    116152{
     
    150186    t->SetTitle(time?time:"");
    151187    if (master)
    152         t->SetBit(kHasMaster);
     188        SetBit(kHasMaster);
    153189
    154190    if (!fEnableAutoScheme)
  • trunk/MagicSoft/Mars/mfileio/MReadReports.h

    r4746 r4766  
    3030    Int_t   FindNextTime();
    3131
    32     UInt_t  GetEntries() { return 0; }
    33     TString GetFileName() const { return "<MReadReports>"; };
     32    UInt_t  GetEntries();
     33    TString GetFileName() const;
    3434
    3535    Int_t   PreProcess(MParList *plist);
     
    3737    Int_t   PostProcess();
    3838
    39     //Bool_t  Notify();
    40 
    4139    enum {
    42         //MReadTree::kChainWasChanged = BIT(14)
    43         kHasMaster = BIT(15)
     40        kHasMaster = BIT(14)
    4441    };
    4542
  • trunk/MagicSoft/Mars/mfileio/MReadTree.cc

    r4756 r4766  
    566566        ResetBit(kChainWasChanged);
    567567    }
    568     return fNumEntries;
     568    return fNumEntries==TChain::kBigNumber ? 0 : fNumEntries;
    569569}
    570570
     
    616616    //
    617617    fChain->ResetTree();
     618    // Maybe this would be enough, but the above might be safer...
     619    //if (fChain->GetTreeNumber()==0)
     620    //    fChain->ResetTree();
    618621
    619622    //
Note: See TracChangeset for help on using the changeset viewer.