Changeset 7895


Ignore:
Timestamp:
08/21/06 14:38:52 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7894 r7895  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2006/08/21 Thomas Bretz
     21
     22   * msignal/MExtractTimeAndChargeDigitalFilter.[h,cc]:
     23     - there are three cases in which the digital filter algorithm
     24       cannot run to the end (eg. division by zero). For this cases
     25       more correct return values are set.
     26     - made sure that the fHiGainFirst is not added a second time
     27       through fTimeShiftHiGain
     28     - made sure that the case is handled correctly in which the sliding
     29       DF either couldn't slide at all or the maximum is below zero
     30
     31   * msignal/MExtractTimeAndChargeSpline.[h,cc]:
     32     - made sure that dsum is always set correctly
     33
     34
     35
    2036 2006/08/20 Thomas Bretz
    2137
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc

    r7885 r7895  
    239239    // here for speed reason. The low-gain has a changing extraction offset,
    240240    // so it will be added at every event (in FindTimeAndChargeLoGain)
    241     fTimeShiftHiGain = 0.5 + 1./fBinningResolutionHiGain + fHiGainFirst;
     241    fTimeShiftHiGain = 0.5 + 1./fBinningResolutionHiGain;
    242242    fTimeShiftLoGain = 0.5 + 1./fBinningResolutionLoGain;
    243243
     
    404404 
    405405  Float_t time_sum  = 0.;
    406   Float_t fmax      = 0.;
     406  Float_t fmax      = -FLT_MAX;
    407407  Float_t ftime_max = 0.;
    408   Int_t   max_p     = 0;
     408  Int_t   max_p     = -1;
    409409 
    410410  //
     
    436436    } /*   for (Int_t i=0;i<range-fWindowSizeHiGain+1;i++) */
    437437
     438  if (max_p<0)
     439  {
     440      sum = 0;
     441      time = -1;
     442      dsum = -1;
     443      dtime = -1;
     444      return;
     445  }
     446
    438447  if (fmax==0)
     448  {
     449      sum = 0;
     450      time = -1;
     451      dsum = 0;
     452      dtime = 0;
    439453      return;
     454  }
    440455
    441456  ftime_max        /= fmax;
     
    479494
    480495  if (sum == 0)
     496  {
     497      time = -1;
     498      dsum = 0;
     499      dtime = 0;
    481500      return;
     501  }
    482502
    483503  // here, the first high-gain slice is already included in the fTimeShiftHiGain
     
    544564
    545565  Float_t time_sum  = 0.;
    546   Float_t fmax      = 0.;
     566  Float_t fmax      = -FLT_MAX;
    547567  Float_t ftime_max = 0.;
    548   Int_t   max_p     = 0;
     568  Int_t   max_p     = -1;
    549569 
    550570  //
     
    576596    } /*   for (Int_t i=0;i<range-fWindowSizeLoGain+1;i++) */
    577597
    578   time = 0;
     598  if (max_p<0)
     599  {
     600      sum = 0;
     601      time = -1;
     602      dsum = -1;
     603      dtime = -1;
     604      return;
     605  }
     606
    579607  if (fmax==0)
     608  {
     609      sum = 0;
     610      time = -1;
     611      dsum = 0;
     612      dtime = 0;
    580613      return;
     614  }
    581615
    582616  ftime_max        /= fmax;
     
    617651
    618652  if (sum == 0)
     653  {
     654      time = -1;
     655      dsum = 0;
     656      dtime = 0;
    619657      return;
     658  }
    620659
    621660  time = max_p + fTimeShiftLoGain + (Float_t)fLoGainFirst /* this shifts the time to the start of the rising edge */
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc

    r7876 r7895  
    374374
    375375  sat = 0;
     376  dsum = 0; // In all cases the extracted signal is valid
    376377
    377378  const Float_t pedes  = ped.GetPedestal();
     
    741742  Int_t  max    = -9999;
    742743
     744  dsum = 0; // In all cases the extracted signal is valid
     745
    743746  //
    744747  // Check for saturation in all other slices
Note: See TracChangeset for help on using the changeset viewer.