Changeset 1936


Ignore:
Timestamp:
04/10/03 10:43:24 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1935 r1936  
    99   * mbase/MTaskList.[h,cc]:
    1010     - added RemoveFromList-function
     11
     12   * merpp.cc:
     13     - fixed typo
     14     
     15   * mbase/MFilter.[h,cc]:
     16     - removed unnecessary base functions for Pre//PostProcess
     17   
     18   * mbase/MTask.cc, mfileio/MCT1ReadPreProc.cc, mfileio/MReadTree.cc,
     19     mfilter/MF.cc, mfilter/MFilterList.cc
     20     - implemented IsConditionalTrue to support inverted filters
     21
     22   * mhist/MHHadronness.cc:
     23     - removed unnecessary check
    1124
    1225
  • trunk/MagicSoft/Mars/mbase/MFilter.cc

    r1524 r1936  
    7272ClassImp(MFilter);
    7373
    74 MFilter::MFilter(const char *name, const char *title)
     74MFilter::MFilter(const char *name, const char *title) : fInverted(kFALSE)
    7575{
    7676    fName  = name  ? name  : "MFilter";
    7777    fTitle = title ? title : "Base Class for a filter";
    78 }
    79 
    80 // --------------------------------------------------------------------------
    81 //
    82 Bool_t MFilter::PreProcess(MParList *pList)
    83 {
    84     return kTRUE;
    85 }
    86 
    87 // --------------------------------------------------------------------------
    88 //
    89 Bool_t MFilter::Process()
    90 {
    91     return kTRUE;
    92 }
    93 
    94 // --------------------------------------------------------------------------
    95 //
    96 Bool_t MFilter::PostProcess()
    97 {
    98     return kTRUE;
    9978}
    10079
  • trunk/MagicSoft/Mars/mbase/MFilter.h

    r1668 r1936  
    1111{
    1212private:
    13     virtual Bool_t PreProcess(MParList *pList);
    14     virtual Bool_t Process();
    15     virtual Bool_t PostProcess();
     13    Bool_t fInverted;
     14
     15    virtual Bool_t IsExpressionTrue() const = 0;
    1616
    1717public:
    1818    MFilter(const char *name=NULL, const char *title=NULL);
    1919
    20     virtual Bool_t IsExpressionTrue() const = 0;
    2120    virtual TString GetRule() const;
     21
     22    Bool_t IsConditionTrue() const { return fInverted ? !IsExpressionTrue() : IsExpressionTrue(); }
     23
     24    void SetInverted(Bool_t i) { fInverted=i; }
     25    Bool_t IsInverted() const  { return fInverted; }
    2226
    2327    ClassDef(MFilter, 0)                // Abstract base class for the filters
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r1657 r1936  
    198198    // this task.
    199199    //
    200     const Bool_t exec = fFilter ? fFilter->IsExpressionTrue() : kTRUE;
     200    const Bool_t exec = fFilter ? fFilter->IsConditionTrue() : kTRUE;
    201201
    202202    if (!exec)
  • trunk/MagicSoft/Mars/merpp.cc

    r1330 r1936  
    131131
    132132    //
    133     // create the looping object and thell it about the parameters to use
     133    // create the looping object and tell it about the parameters to use
    134134    // and the tasks to execute
    135135    //
  • trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc

    r1905 r1936  
    10681068        // Skip Event
    10691069        //
    1070         if (!GetSelector()->IsExpressionTrue())
     1070        if (!GetSelector()->IsConditionTrue())
    10711071        {
    10721072            fIn->seekg(sizeof(struct eventrecord), ios::cur);
  • trunk/MagicSoft/Mars/mfileio/MReadTree.cc

    r1836 r1936  
    732732        // Skip Event
    733733        //
    734         if (!GetSelector()->IsExpressionTrue())
     734        if (!GetSelector()->IsConditionTrue())
    735735        {
    736736            fNumEntry++;
  • trunk/MagicSoft/Mars/mfilter/MF.cc

    r1863 r1936  
    449449Bool_t MF::IsExpressionTrue() const
    450450{
    451     return fF->IsExpressionTrue();
     451    return fF->IsConditionTrue();
    452452}
    453453
  • trunk/MagicSoft/Mars/mfilter/MFilterList.cc

    r1668 r1936  
    105105        return kTRUE;
    106106
    107     Bool_t rc = filter->IsExpressionTrue();
     107    Bool_t rc = filter->IsConditionTrue();
    108108
    109109    //
     
    114114    case kEAnd:
    115115        while ((filter=(MFilter*)Next()))
    116             rc &= filter->IsExpressionTrue();
     116            rc &= filter->IsConditionTrue();
    117117        break;
    118118
    119119    case kEOr:
    120120        while ((filter=(MFilter*)Next()))
    121             rc |= filter->IsExpressionTrue();
     121            rc |= filter->IsConditionTrue();
    122122        break;
    123123
    124124    case kEXor:
    125125        while ((filter=(MFilter*)Next()))
    126             rc ^= filter->IsExpressionTrue();
     126            rc ^= filter->IsConditionTrue();
    127127        break;
    128128
    129129    case kELAnd:
    130130        while ((filter=(MFilter*)Next()))
    131             rc = (rc && filter->IsExpressionTrue());
     131            rc = (rc && filter->IsConditionTrue());
    132132        break;
    133133
    134134    case kELOr:
    135135        while ((filter=(MFilter*)Next()))
    136             rc = (rc || filter->IsExpressionTrue());
     136            rc = (rc || filter->IsConditionTrue());
    137137        break;
    138138    }
  • trunk/MagicSoft/Mars/mhist/MHHadronness.cc

    r1931 r1936  
    270270    for (Int_t i=1; i<=n; i++)
    271271    {
    272         const Stat_t ip = sump!=0 ? fPhness->Integral(1, i) : 0;
    273         const Stat_t ig = sumg!=0 ? fGhness->Integral(1, i) : 0;
     272        const Stat_t ip = fPhness->Integral(1, i);
     273        const Stat_t ig = fGhness->Integral(1, i);
    274274
    275275        fIntPhness->SetBinContent(i, ip);
Note: See TracChangeset for help on using the changeset viewer.