Changeset 5496 for trunk


Ignore:
Timestamp:
11/28/04 19:19:06 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc

    r5489 r5496  
    274274        " raising from " << windows << " to " << flush;
    275275      windows += 1;
    276       *fLog << windows+1 << "!" << endl;
     276      *fLog << windows << "!" << endl;
    277277      rc = kFALSE;
    278278    }
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc

    r5374 r5496  
    160160const Byte_t  MExtractTimeAndChargeSpline::fgLoGainLast   = 14;
    161161const Float_t MExtractTimeAndChargeSpline::fgResolution   = 0.01;
    162 const Float_t MExtractTimeAndChargeSpline::fgRiseTime     = 2.0;
    163 const Float_t MExtractTimeAndChargeSpline::fgFallTime     = 4.0;
     162const Float_t MExtractTimeAndChargeSpline::fgRiseTime     = 1.5;
     163const Float_t MExtractTimeAndChargeSpline::fgFallTime     = 4.5;
    164164// --------------------------------------------------------------------------
    165165//
     
    412412    }
    413413 
     414  Float_t pp;
     415
     416  fHiGainSecondDeriv[0] = 0.;
     417  fHiGainFirstDeriv[0]  = 0.;
     418
     419  for (Int_t i=1;i<range-1;i++)
     420    {
     421      pp = fHiGainSecondDeriv[i-1] + 4.;
     422      fHiGainSecondDeriv[i] = -1.0/pp;
     423      fHiGainFirstDeriv [i] = fHiGainSignal[i+1] - fHiGainSignal[i] - fHiGainSignal[i] + fHiGainSignal[i-1];
     424      fHiGainFirstDeriv [i] = (6.0*fHiGainFirstDeriv[i]-fHiGainFirstDeriv[i-1])/pp;
     425    }
     426
     427  fHiGainSecondDeriv[range-1] = 0.;
     428
     429  for (Int_t k=range-2;k>=0;k--)
     430    fHiGainSecondDeriv[k] = fHiGainSecondDeriv[k]*fHiGainSecondDeriv[k+1] + fHiGainFirstDeriv[k];
     431  for (Int_t k=range-2;k>=0;k--)
     432    fHiGainSecondDeriv[k] /= 6.;
     433 
     434  if (IsNoiseCalculation() && IsExtractionType(kAmplitude))
     435    {
     436      //
     437      // Take the spline value at the middle of the third slice (to avoid egde effects)
     438      //
     439      sum = 0.5*fHiGainSignal[2]
     440          + 0.5*fHiGainSignal[3]
     441          + (-0.375)*fHiGainSecondDeriv[2]
     442          + (-0.375)*fHiGainSecondDeriv[3];
     443      return;
     444    }
     445
    414446  //
    415447  // Allow no saturated slice
     
    417449  // Don't start if the maxpos is too close to the left limit.
    418450  //
    419   if (sat || maxpos < 2)
     451  if ((sat || maxpos < 2))
    420452    {
    421453      time =  IsExtractionType(kMaximum)
     
    427459    }
    428460     
    429   Float_t pp;
    430 
    431   fHiGainSecondDeriv[0] = 0.;
    432   fHiGainFirstDeriv[0]  = 0.;
    433 
    434   for (Int_t i=1;i<range-1;i++)
    435     {
    436       pp = fHiGainSecondDeriv[i-1] + 4.;
    437       fHiGainSecondDeriv[i] = -1.0/pp;
    438       fHiGainFirstDeriv [i] = fHiGainSignal[i+1] - fHiGainSignal[i] - fHiGainSignal[i] + fHiGainSignal[i-1];
    439       fHiGainFirstDeriv [i] = (6.0*fHiGainFirstDeriv[i]-fHiGainFirstDeriv[i-1])/pp;
    440     }
    441 
    442   fHiGainSecondDeriv[range-1] = 0.;
    443 
    444   for (Int_t k=range-2;k>=0;k--)
    445     fHiGainSecondDeriv[k] = fHiGainSecondDeriv[k]*fHiGainSecondDeriv[k+1] + fHiGainFirstDeriv[k];
    446   for (Int_t k=range-2;k>=0;k--)
    447     fHiGainSecondDeriv[k] /= 6.;
    448  
    449461  //
    450462  // Now find the maximum 
Note: See TracChangeset for help on using the changeset viewer.