Ignore:
Timestamp:
11/13/02 17:03:19 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mfilter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mfilter/MFEventSelector.cc

    r1589 r1600  
    4040// To get around 2000 events from all events use (Remark: This will only
    4141// work if the parlist has an entry called MTaskList which has a task
    42 // MRTeadTree inheriting from MReadTree):
     42// MRead inheriting from MRead):
    4343//   MFEventSelector sel;
    44 //   sel.SetNumSelectEvents(2000);
     44//   sel.SetNumSelectEvts(2000);
    4545//   MFillH filler(...);
    4646//   filler.SetFilter(&sel);
     
    4848//   tlist.AddToList(&filler);
    4949//
    50 // If you don't have MReadTree available you have to set the number of
     50// If you don't have MRead available you have to set the number of
    5151// total events manually, using sel.SetNumTotalEvts(10732);
    5252//
     
    6767#include "MParList.h"
    6868#include "MTaskList.h"
    69 #include "MReadTree.h"
     69#include "MRead.h"
    7070
    7171#include "MLog.h"
     
    127127            return kFALSE;
    128128        }
    129         MReadTree *read = (MReadTree*)tlist->FindObject("MReadTree");
    130         if (!read)
    131             read = (MReadTree*)tlist->FindObject("MReadMarsFile");
     129        MRead *read = (MRead*)tlist->FindObject("MRead");
    132130        if (!read)
    133131        {
    134             *fLog << err << dbginf << "Sorry can't determin total number of events from 'MReadTree/MReadMarsFile'." << endl;
     132            *fLog << err << dbginf << "Sorry can't determin total number of events from 'MRead'." << endl;
    135133            return kFALSE;
    136134        }
    137135        fNumTotalEvts = read->GetEntries();
     136
     137        SetBit(kNumTotalFromFile);
    138138    }
    139139
     
    166166Bool_t MFEventSelector::PostProcess()
    167167{
     168    if (TestBit(kNumTotalFromFile))
     169        fNumTotalEvts = -1;
    168170    return kTRUE;
    169171}
  • trunk/MagicSoft/Mars/mfilter/MFEventSelector.h

    r1588 r1600  
    2727    void StreamPrimitive(ofstream &out) const;
    2828
     29    enum { kNumTotalFromFile = BIT(14) };
    2930    /*
    3031     enum { kUseFixedRatio=BIT(14) }
     
    3839    Bool_t IsExpressionTrue() const { return fResult; }
    3940
    40     void SetNumTotalEvts(Int_t n) { fNumTotalEvts = n; }
     41    void SetNumTotalEvts(Int_t n) { fNumTotalEvts = n; ResetBit(kNumTotalFromFile); }
    4142    void SetNumSelectEvts(Int_t n) { fNumSelectEvts = n; }
    4243    void SetSelectionRatio(Float_t f) { fSelRatio = f; }
Note: See TracChangeset for help on using the changeset viewer.