Ignore:
Timestamp:
01/06/09 13:07:00 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r8795 r9212  
    1818!   Author(s): Markus Gaug 09/2004 <mailto:markus@ifae.es>
    1919!
    20 !   Copyright: MAGIC Software Development, 2002-2007
     20!   Copyright: MAGIC Software Development, 2002-2008
    2121!
    2222!
     
    4747//   (Note that the variables fDer are not real first derivative coefficients.)
    4848//
     49//   Note, this spline is not optimized to be evaluated many many times, but
     50//   it is optimized to be initialized very fast with new values again and
     51//   again.
     52//
    4953//////////////////////////////////////////////////////////////////////////////
    5054#include "MExtralgoSpline.h"
     
    179183// at x, until x==0. If y is not found -2 is returned.
    180184//
    181 Double_t MExtralgoSpline::SearchY(Float_t x, Float_t y) const
     185Double_t MExtralgoSpline::SearchYdn(Float_t x, Float_t y) const
    182186{
    183187    if (x>=fNum-1)
     
    185189
    186190    Int_t i = TMath::FloorNint(x);
     191    if (i<0)
     192        return -2;
     193
    187194    Double_t rc = FindY(i, kTRUE, y, 0, x-i);
    188195    while (--i>=0 && rc<0)
     
    198205
    199206    Int_t i = TMath::FloorNint(x);
     207    if (i>fNum-2)
     208        return -2;
     209
    200210    Double_t rc = FindY(i, kFALSE, y, x-i, 1.);
    201     while (i++<fNum-1 && rc<0)
     211    while (++i<fNum-1 && rc<0)
    202212        rc = FindY(i, kFALSE, y);
    203213
     
    287297    // Search downwards for fHeight/2
    288298    // By doing also a search upwards we could extract the pulse width
    289     fTime      = SearchY(maxpos, h);
     299    fTime      = SearchYdn(maxpos, h);
    290300    fTimeDev   = 0;
    291301    if (width)
Note: See TracChangeset for help on using the changeset viewer.