Ignore:
Timestamp:
11/15/05 11:36:17 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtools/MTFillMatrix.cc

    r7130 r7401  
    1818!   Author(s): Thomas Bretz, 12/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2003
     20!   Copyright: MAGIC Software Development, 2000-2005
    2121!
    2222!
     
    8181#include <TFile.h>
    8282
     83// environment
    8384#include "MHMatrix.h"
    8485
     
    8687#include "MLogManip.h"
    8788
     89// eventloop
    8890#include "MParList.h"
    8991#include "MTaskList.h"
    9092#include "MEvtLoop.h"
    9193
     94// tasks
    9295#include "MRead.h"
    9396#include "MFillH.h"
    9497#include "MContinue.h"
     98
     99// filters
     100#include "MF.h"
    95101#include "MFilterList.h"
    96102#include "MFEventSelector.h"
     
    174180        delete fReference;
    175181}
     182
     183//------------------------------------------------------------------------
     184//
     185// Add a cut which is used to fill the matrix, eg "MMcEvt.fOartId<1.5"
     186// (The rule is applied, nit inverted: The matrix is filled with
     187// the events fullfilling the condition)
     188//
     189void MTFillMatrix::AddPreCut(const char *rule)
     190{
     191    MFilter *f = new MF(rule);
     192    f->SetBit(kCanDelete);
     193    AddPreCut(f);
     194}
     195
     196//------------------------------------------------------------------------
     197//
     198// Add a cut which is used to fill the matrix. If kCanDelete is set
     199// MJOptimize takes the ownership.
     200//
     201void MTFillMatrix::AddPreCut(MFilter *f)
     202{
     203    fPreCuts.Add(f);
     204}
     205
    176206
    177207// --------------------------------------------------------------------------
     
    236266
    237267    //
     268    // Continue for PreCuts
     269    //
     270    MFilterList list;
     271    list.SetName("PreCuts");
     272    if (!list.AddToList(fPreCuts))
     273        *fLog << err << "ERROR - Calling MFilterList::AddToList for fPreCuts failed!" << endl;
     274
     275    MContinue cont0(&list);
     276    cont0.SetInverted();
     277
     278    //
    238279    // Continue for all events which are not (SetInverted())
    239280    // selected by the 'selector'
     
    268309    // entries in MTaskList
    269310    tlist.AddToList(fReader);        // Read events
     311    if (fPreCuts.GetEntries()>0)
     312        tlist.AddToList(&cont0);     // PreCuts
    270313    if (fReference && selector)
    271314        tlist.AddToList(&cont);      // select a sample of events
Note: See TracChangeset for help on using the changeset viewer.