Changeset 13003


Ignore:
Timestamp:
03/07/12 16:28:14 (13 years ago)
Author:
tbretz
Message:
Improved the possible combinations of how to extract the leading edge or position of maximum and the intgeral or amplitude.
Location:
trunk/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mextralgo/MExtralgoSpline.cc

    r9226 r13003  
    289289        return 0;
    290290
    291     if (fExtractionType == kAmplitude)
     291    if (!(fExtractionType&kIntegral))
    292292    {
    293293        const Int_t   pos = gRandom->Integer(fNum-1);
     
    320320    // --- End NEW ---
    321321
    322     if (fExtractionType == kAmplitude)
    323     {
    324         fTime      = maxpos;
    325         fTimeDev   = 0;
     322    if (fExtractionType&kIntegral)
     323    {
     324        fSignal    = CalcIntegral(maxpos);
     325        fSignalDev = 0;  // means: is valid
     326    }
     327    else
     328    {
    326329        fSignal    = fHeight;
    327330        fSignalDev = 0;  // means: is valid
    328         return;
    329     }
    330 
    331     fSignal    = CalcIntegral(maxpos);
    332     fSignalDev = 0;  // means: is valid
    333 
    334     if (fExtractionType==kIntegralRel && fHeightTm<0)
    335     {
    336         fTime = maxpos;
     331    }
     332
     333    // Position of maximum
     334    if (((fExtractionType&kTimeRel) && fHeightTm<0) || (fExtractionType&kMaximum))
     335    {
     336        fTime    = maxpos;
    337337        fTimeDev = 0;
    338338        return;
    339339    }
    340340
    341     const Float_t h = fExtractionType==kIntegralAbs ? fHeightTm : fHeight*fHeightTm;
     341    // Position of fraction height or absolute height
     342    const Float_t h = (fExtractionType&kTimeRel) ? fHeight*fHeightTm : fHeightTm;
    342343
    343344    // Search downwards for fHeight/2
  • trunk/Mars/mextralgo/MExtralgoSpline.h

    r9229 r13003  
    1212{
    1313public: 
    14     enum ExtractionType_t { kAmplitude, kIntegralRel, kIntegralAbs };    //! Possible time and charge extraction types
     14    enum ExtractionType_t
     15    {
     16        kIntegral = BIT(0),
     17        kTimeRel  = BIT(1),
     18        kMaximum  = BIT(2),
     19
     20        // For backward compatibility
     21        kAmplitudeAbs = 0,                   // Height of maximum, absolute height leading edge
     22        kAmplitudeRel = kTimeRel,            // Height of maximum, relative height leading edge
     23        kAmplitude    = kMaximum,            // Position and height of maximum
     24        kIntegralAbs  = kIntegral,           // Integral, absolute height leading edge
     25        kIntegralRel  = kIntegral|kTimeRel,  // Integral, relative height leading edge
     26    };
    1527
    1628private:
  • trunk/Mars/msignal/MExtractTimeAndChargeSpline.cc

    r12629 r13003  
    225225  {
    226226  case MExtralgoSpline::kAmplitude:
     227  case MExtralgoSpline::kAmplitudeRel:
     228  case MExtralgoSpline::kAmplitudeAbs:
    227229      SetResolutionPerPheHiGain(0.053);
    228230      SetResolutionPerPheLoGain(0.016);
     
    303305    {
    304306    case MExtralgoSpline::kAmplitude:
     307    case MExtralgoSpline::kAmplitudeRel:
     308    case MExtralgoSpline::kAmplitudeAbs:
    305309        fNumHiGainSamples  = 1.;
    306310        fNumLoGainSamples  = fLoGainLast ? 1. : 0.;
  • trunk/Mars/msignal/MExtractTimeAndChargeSpline.h

    r11568 r13003  
    8282    }
    8383
     84    void SetHeightTm(const Double_t h) { fHeightTm = h; }
     85
    8486    void SetLoGainStretch(const Float_t f=fgLoGainStretch) { fLoGainStretch = f;   }
    8587
Note: See TracChangeset for help on using the changeset viewer.