Ignore:
Timestamp:
12/27/04 13:13:32 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mfbase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mfbase/MFEventSelector2.cc

    r5667 r5690  
    116116#include "MH3.h"            // MH3
    117117#include "MRead.h"          // MRead
    118 //#include "MProgressBar.h"   //
    119118#include "MEvtLoop.h"       // MEvtLoop
    120119#include "MTaskList.h"      // MTaskList
     
    158157//     events outside these ranges won't be accepted).
    159158//
     159//  Set default name of filter to be applied when determining the original
     160//  distribution for all data on the input file to "FilterSelector2"
     161//
    160162MFEventSelector2::MFEventSelector2(MH3 &hist, const char *name, const char *title)
    161 : fHistOrig(NULL), fHistNom(&hist), fHistRes(NULL),
    162   fDataX(hist.GetRule('x')), fDataY(hist.GetRule('y')),
    163   fDataZ(hist.GetRule('z')), fNumMax(-1), fHistIsProbability(kFALSE),
    164   fUseOrigDist(kTRUE)
     163    : fHistOrig(NULL), fHistNom(&hist), fHistRes(NULL),
     164    fDataX(hist.GetRule('x')), fDataY(hist.GetRule('y')),
     165    fDataZ(hist.GetRule('z')), fNumMax(-1), fCanvas(0),
     166    fFilterName("FilterSelector2"), fHistIsProbability(kFALSE),
     167    fUseOrigDist(kTRUE)
    165168{
    166169    fName  = name  ? (TString)name  : gsDefName;
    167170    fTitle = title ? (TString)title : gsDefTitle;
    168 
    169     // name of filter to be applied when determining the original distribution
    170     // for all data on the input file
    171     fFilterName = "FilterSelector2";
    172171}
    173172
     
    216215    }
    217216
    218     *fLog << inf << underline << endl;
    219     *fLog << "MFEventSelector2::ReadDistribution:" << endl;
    220     *fLog << "**********************" << endl;
    221     *fLog << " - Start of eventloop to generate the original distribution..."
    222           << endl;
     217    *fLog << inf;
     218    fLog->Separator("MFEventSelector2::ReadDistribution");
     219    *fLog << " - Start of eventloop to generate the original distribution..." << endl;
    223220
    224221    if (filter != NULL)
    225     {
    226       *fLog << "                      filter used : " << filter->GetName()
    227             << endl;
    228     }
     222        *fLog << " - filter used: " << filter->GetDescriptor() << endl;
    229223
    230224
    231225    MEvtLoop run("ReadDistribution");
    232     //MProgressBar bar;
    233     //run.SetProgressBar(&bar);
    234226
    235227    MParList plist;
     
    264256    if (!run.Eventloop())
    265257    {
    266         *fLog << err << dbginf
    267               << "Evtloop in MFEventSelector2::ReadDistribution failed."
    268               << endl;
    269         return kFALSE;
    270     }
    271 
    272     tlist.PrintStatistics(0, kTRUE);
     258        *fLog << err << dbginf << "Evtloop failed... abort." << endl;
     259        return kFALSE;
     260    }
     261
     262    tlist.PrintStatistics();
    273263
    274264    *fLog << inf;
    275265    *fLog << "MFEventSelector2::ReadDistribution:" << endl;
    276     *fLog << " - Original distribution has "
    277           << fHistOrig->GetHist().GetEntries() << " entries." << endl;
    278     *fLog << " - End of eventloop to generate the original distribution."
    279           << endl;
    280     *fLog << "**********************" << endl;
     266    *fLog << " - Original distribution has " << fHistOrig->GetHist().GetEntries() << " entries." << endl;
     267    *fLog << " - End of eventloop to generate the original distribution." << endl;
     268    fLog->Separator();
    281269
    282270    return read.Rewind();
     
    447435    if (!read)
    448436    {
    449         *fLog << err << "MRead not found... abort." << endl;
     437        *fLog << err << "MRead not found in tasklist... abort." << endl;
    450438        return kFALSE;
    451439    }
    452440
    453441    MFilter *filter = (MFilter*)tasklist->FindObject(fFilterName);
    454     if (!filter)
    455     {
    456       *fLog << inf
    457             << "No filter will be used when making the original distribution"
    458             << endl;
    459       filter = NULL;
    460     }
    461 
     442    if (!filter || !filter->InheritsFrom(MFilter::Class()))
     443    {
     444        *fLog << inf << "No filter will be used when making the original distribution" << endl;
     445        filter = NULL;
     446    }
    462447
    463448    if (!ReadDistribution(*read, filter))
    464449        return kFALSE;
    465 
    466450
    467451    // Prepare histograms and arrays for selection
    468452    PrepareHistograms();
    469453
    470     *fLog << "MFEventSelector2::PreProcess; call PreProcess() for read and filter object again"
    471           << endl;
    472     Int_t rcr = read->CallPreProcess(parlist);
    473     Int_t rcf = filter->CallPreProcess(parlist);
    474 
    475     *fLog << "rcr, rcf = " << rcr << ",  " << rcf << endl;
    476 
    477     return rcf*rcr;
     454    *fLog << all << "PreProcess..." << flush;
     455    const Int_t rcf = filter->CallPreProcess(parlist);
     456    if (rcf!=kTRUE)
     457        return rcf;
     458
     459    const Int_t rcr = read->CallPreProcess(parlist);
     460    return rcr;
    478461}
    479462
  • trunk/MagicSoft/Mars/mfbase/MFEventSelector2.h

    r5667 r5690  
    4141    TCanvas   *fCanvas;   //! canvas for online display
    4242
    43     TString    fFilterName; // name of the MFilter object to be used
    44                             // when determining the original distribution
     43    TString    fFilterName; // name of the MFilter object to be used when determining the original distribution
    4544
    4645    Bool_t fResult;
    4746    Bool_t fHistIsProbability;
    48     Bool_t fUseOrigDist;    // flag indicating that in the selection the
    49                             // original distribution is not changed
     47    Bool_t fUseOrigDist;    // flag indicating that in the selection the original distribution is not changed
    5048
    5149    Int_t  fCounter[3];
Note: See TracChangeset for help on using the changeset viewer.