Changeset 5149


Ignore:
Timestamp:
09/30/04 13:40:10 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5148 r5149  
    1919
    2020                                                 -*-*- END OF LINE -*-*-
     21
     22 2004/09/30: Hendrik Bartko, Markus Gaug
     23 
     24   * msignal/MExtractFixedWindowSpline.cc
     25     - corrected a small bug for the case that the high-gain extraction
     26       window ranges into the low-gain
     27
    2128
    2229 2004/09/29: Hendrik Bartko, Diego Tescaro, Markus Gaug
  • trunk/MagicSoft/Mars/msignal/MExtractFixedWindowSpline.cc

    r4899 r5149  
    271271  else
    272272    {
     273
     274      //
     275      // There are two overlap slices which we have to treat sepatately
     276      //
     277      // First, the last high-gain slice as center
     278      //
    273279      summ += *ptr;
    274280      i++;
     
    278284      fHiGainFirstDeriv [i] = *(logain) - 2.* *(ptr) + *(ptr-1);
    279285      fHiGainFirstDeriv [i] = (6.0*fHiGainFirstDeriv[i]-fHiGainFirstDeriv[i-1])/pp;
    280 
    281       end    = logain + fHiLoLast - 1;
    282 
    283       while (logain<end)
     286     
     287      if (fHiLoLast == 1)
    284288        {
    285 
     289          sum += (Float_t)*logain/2;
     290          fHiGainSecondDeriv[++i] = 0.;
     291          if (*logain >= fSaturationLimit)
     292            sat++;
     293        }
     294      else
     295        {
     296          //
     297          // Second, the first low-gain slice as center
     298          //
    286299          summ += *logain;
    287300          i++;
     
    289302          pp = fHiGainSecondDeriv[i-1] + 4.;
    290303          fHiGainSecondDeriv[i] = -1.0/pp;
    291           fHiGainFirstDeriv [i] = *(logain+1) - 2.* *(logain) + *(ptr-1);
     304          fHiGainFirstDeriv [i] = *(logain+1) - 2.* *(logain) + *(ptr);
    292305          fHiGainFirstDeriv [i] = (6.0*fHiGainFirstDeriv[i]-fHiGainFirstDeriv[i-1])/pp;
    293 
     306         
    294307          if (*logain++ >= fSaturationLimit)
    295308            sat++;
    296309         
     310          end  = logain + fHiLoLast - 2;
     311         
     312          while (logain<end)
     313            {
     314             
     315              summ += *logain;
     316              i++;
     317             
     318              pp = fHiGainSecondDeriv[i-1] + 4.;
     319              fHiGainSecondDeriv[i] = -1.0/pp;
     320              fHiGainFirstDeriv [i] = *(logain+1) - 2.* *(logain) + *(logain-1);
     321              fHiGainFirstDeriv [i] = (6.0*fHiGainFirstDeriv[i]-fHiGainFirstDeriv[i-1])/pp;
     322             
     323              if (*logain++ >= fSaturationLimit)
     324                sat++;
     325             
     326            }
     327          sum += (Float_t)*logain/2;
     328          fHiGainSecondDeriv[++i] = 0.;
    297329        }
    298       sum += (Float_t)*logain/2;
    299       fHiGainSecondDeriv[++i] = 0.;
    300     }
    301 
     330    }
     331 
    302332  for (Int_t k=range-2;k>0;k--)
    303333    {
Note: See TracChangeset for help on using the changeset viewer.