Changeset 7046 for trunk


Ignore:
Timestamp:
05/17/05 13:27:33 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mfilter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mfilter/MFCosmics.cc

    r7043 r7046  
    3838//       fMinAcceptedFraction.
    3939//    b) check the ratio of events which were rejected against
    40 //       fMaxExcludedFraction.
     40//       fMaxAcceptedFraction.
    4141//
    4242//  Input Containers:
     
    8282    : fPedestals(NULL), fSignals(NULL), fBadPixels(NULL), fRawEvt(NULL),
    8383    fNamePedestalCam(fgNamePedestalCam), fMaxEmptyPixels(0.2),
    84     fMinAcceptedFraction(0), fMaxExcludedFraction(1)
     84    fMinAcceptedFraction(0), fMaxAcceptedFraction(1)
    8585{
    8686    fName  = name  ? name  : "MFCosmics";
     
    214214//       fMinAcceptedFraction.
    215215//    b) check the ratio of events which were rejected against
    216 //       fMaxExcludedFraction.
     216//       fMaxAcceptedFraction.
    217217//
    218218//   return failure (kFALSE) if condition is not fullfilled.
     
    238238    *fLog << endl;
    239239
    240     const Float_t min = fMinAcceptedFraction*n;
    241     const Float_t max = fMaxExcludedFraction*n;
    242     if (fCut[0]<min)
    243     {
    244         *fLog << err << "ERROR - Fraction of accepted events " << min*100;
     240    if (fCut[0]<fMinAcceptedFraction*n)
     241    {
     242        *fLog << err << "ERROR - Fraction of accepted events " << Form("%.1f", fCut[0]*100./n);
    245243        *fLog << "% underrun " << fMinAcceptedFraction*100 << "%... abort." << endl;
    246244        return kFALSE;
    247245    }
    248     if (fCut[1]>max)
    249     {
    250         *fLog << err << "ERROR - Fraction of excluded events " << max*100;
    251         *fLog << "% exceeded " << fMaxExcludedFraction*100 << "%... abort." << endl;
     246    if (fCut[0]>fMaxAcceptedFraction*n)
     247    {
     248        *fLog << err << "ERROR - Fraction of accepted events " << Form("%.1f", fCut[0]*100./n);
     249        *fLog << "% exceeded " << fMaxAcceptedFraction*100 << "%... abort." << endl;
    252250        return kFALSE;
    253251    }
     
    260258// Read the setup from a TEnv, eg:
    261259//   MFCosmics.MaxEmptyPixels:    0.2
    262 //   MFCosmics.MaxExcludedFraction: 1
     260//   MFCosmics.MaxAcceptedFraction: 1
    263261//   MFCosmics.MinAcceptedFraction: 0
    264262//
     
    271269        SetMaxEmptyPixels(GetEnvValue(env, prefix, "MaxEmptyPixels", fMaxEmptyPixels));
    272270    }
    273     if (IsEnvDefined(env, prefix, "MaxExcludedFraction", print))
     271    if (IsEnvDefined(env, prefix, "MaxAcceptedFraction", print))
    274272    {
    275273        rc = kTRUE;
    276         SetMaxExcludedFraction(GetEnvValue(env, prefix, "MaxExcludedFraction", fMaxExcludedFraction));
     274        SetMaxAcceptedFraction(GetEnvValue(env, prefix, "MaxAcceptedFraction", fMaxAcceptedFraction));
    277275    }
    278276    if (IsEnvDefined(env, prefix, "MinAcceptedFraction", print))
  • trunk/MagicSoft/Mars/mfilter/MFCosmics.h

    r7043 r7046  
    3232
    3333    Float_t fMinAcceptedFraction;      // return error if exceeded
    34     Float_t fMaxExcludedFraction;      // return error if exceeded
     34    Float_t fMaxAcceptedFraction;      // return error if exceeded
    3535
    3636    // MFCosmics
     
    5353    Float_t GetMaxEmptyPixels() const          { return fMaxEmptyPixels; }
    5454
    55     void    SetMaxExcludedFraction(const Float_t n) { fMaxExcludedFraction = n;    }
     55    void    SetMaxAcceptedFraction(const Float_t n) { fMaxAcceptedFraction = n;    }
    5656    void    SetMinAcceptedFraction(const Float_t n) { fMinAcceptedFraction = n;    }
    5757
Note: See TracChangeset for help on using the changeset viewer.