Ignore:
Timestamp:
06/08/08 13:55:36 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mtrigger
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.cc

    r8903 r8929  
    9393    }
    9494
     95    memset(fCounter, 0, sizeof(fCounter));
     96
    9597    return kTRUE;
    9698}
     
    103105// If any bit matches the fMasDenied* mask fResult is forced to be false.
    104106//
    105 Int_t MFTriggerPattern::Process()
     107Int_t MFTriggerPattern::Eval() const
    106108{
    107109    const Byte_t p = fPattern->GetPrescaled();
     
    109111    if (p==0 && u==0)
    110112    {
    111         fResult = fDefault;
    112         return kTRUE;
     113        return fDefault;
    113114    }
    114115
    115     fResult = kFALSE;
     116    Bool_t rc = kFALSE;
    116117
    117118    // Check whether all the bits required are ON
    118119    if ( ((p & fMaskRequiredPrescaled)   == fMaskRequiredPrescaled) &&
    119120         ((u & fMaskRequiredUnprescaled) == fMaskRequiredUnprescaled))
    120       fResult = kTRUE;
     121      rc = kTRUE;
    121122
    122123    // Now overwrite the result if one of the bits is denied
    123124    if ( (p & fMaskDeniedPrescaled) || (u & fMaskDeniedUnprescaled) )
    124       fResult = kFALSE;
     125        return kFALSE;
     126
     127    return rc;
     128}
     129
     130// --------------------------------------------------------------------------
     131//
     132// If Prescaled and Unprescaled pattern is 0 return default.
     133// If all bits of the fMaskRequired* mask are found in the pattern set
     134// fResult to true.
     135// If any bit matches the fMasDenied* mask fResult is forced to be false.
     136//
     137Int_t MFTriggerPattern::Process()
     138{
     139    fResult = Eval();
     140    fCounter[fResult ? 0 : 1]++;
     141
     142    return kTRUE;
     143}
     144
     145// --------------------------------------------------------------------------
     146//
     147Int_t MFTriggerPattern::PostProcess()
     148{
     149    const UInt_t n = GetNumExecutions();
     150    if (n==0)
     151        return kTRUE;
     152
     153    *fLog << inf << endl;
     154    *fLog << GetDescriptor() << " execution statistics:" << endl;
     155    *fLog << dec << setfill(' ');
     156
     157    *fLog << " " << setw(7) << fCounter[0] << " (" << setw(3) ;
     158    *fLog << (int)(fCounter[0]*100/n);
     159    *fLog << "%) Accepted trigger pattern." << endl;
     160
     161    *fLog << " " << setw(7) << fCounter[1] << " (" << setw(3) ;
     162    *fLog << (int)(fCounter[1]*100/n);
     163    *fLog << "%) Rejected trigger pattern!" << endl;
     164    *fLog << endl;
    125165
    126166    return kTRUE;
  • trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.h

    r8903 r8929  
    2929
    3030  Bool_t fDefault;                  // Default which is used if trigger pattern has default value (p==0&&u==0)
     31
    3132  Bool_t fResult;                   //! Calculated result to be returned by IsExpressionTrue
     33  Int_t  fCounter[2];               //! Counter for results
    3234
    3335  // MFTriggerPattern
     
    3638  void Allow(const Byte_t mask, Prescale_t prescaled=kUnPrescaled);
    3739
     40  Int_t Eval() const;
     41
    3842  // MTask
    3943  Int_t PreProcess(MParList *pList);
    4044  Int_t Process();
     45  Int_t PostProcess();
    4146
    4247  // MFilter
Note: See TracChangeset for help on using the changeset viewer.