Ignore:
Timestamp:
04/21/04 15:38:08 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mfbase
Files:
2 edited

Legend:

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

    r3682 r3788  
    3838// invert the meaning of a filter, by eg:
    3939//
    40 //   MF anyfilter("MHillas.fAlpha");
    41 //
    42 //   MFilterList alist;
    43 //   alist.AddToList(&anyfilter);
    44 //
    45 //   alist.SetInverted();
     40//    MF anyfilter("MHillas.fAlpha");
     41//
     42//    MFilterList alist;
     43//    alist.AddToList(&anyfilter);
     44//
     45//    alist.SetInverted();
     46//
     47//  or do
     48//
     49//    MFilterList alist(&anyfilter);
     50//
    4651//
    4752// Adding the filterlist to the eventloop will process all contained filters.
     
    7277// --------------------------------------------------------------------------
    7378//
    74 //   Constructor.
     79// Wrapper to simplify constructors.
     80//
     81void MFilterList::Init(const char *name, const char *title)
     82{
     83    fName  = name  ? name  : gsDefName.Data();
     84    fTitle = title ? title : gsDefTitle.Data();
     85
     86    gROOT->GetListOfCleanups()->Add(&fFilters);
     87    fFilters.SetBit(kMustCleanup);
     88
     89    fFilterType = kEAnd;
     90}
     91
     92// --------------------------------------------------------------------------
     93//
     94//   Default Constructor.
    7595//
    7696//   Specify the boolean operation which is used to evaluate the
     
    91111MFilterList::MFilterList(const char *type, const char *name, const char *title)
    92112{
    93     fName  = name  ? name  : gsDefName.Data();
    94     fTitle = title ? title : gsDefTitle.Data();
    95 
    96     gROOT->GetListOfCleanups()->Add(&fFilters);
    97     fFilters.SetBit(kMustCleanup);
    98 
    99     fFilterType = kEAnd;
     113    Init(name, title);
    100114
    101115    TString str(type);
     
    113127// --------------------------------------------------------------------------
    114128//
     129//   Constructor.
     130//
     131// Setup an '&&' filter list, adds the filter to the list and
     132// call MFilterList::SetInverted()
     133//
     134// To be used as a logical NOT.
     135//
     136MFilterList::MFilterList(MFilter *f, const char *name, const char *title)
     137{
     138    Init(name, title);
     139
     140    SetInverted();
     141    AddToList(f);
     142}
     143
     144// --------------------------------------------------------------------------
     145//
    115146//   CopyConstructor
    116147//
  • trunk/MagicSoft/Mars/mfbase/MFilterList.h

    r3573 r3788  
    3131    void StreamPrimitive(ofstream &out) const;
    3232
     33    void Init(const char *name, const char *title);
     34
    3335public:
    3436    MFilterList(const char *type="&&", const char *name=NULL, const char *title=NULL);
     37    MFilterList(MFilter *f, const char *name=NULL, const char *title=NULL);
    3538    MFilterList(MFilterList &ts);
    3639    ~MFilterList()
Note: See TracChangeset for help on using the changeset viewer.