Ignore:
Timestamp:
05/16/07 16:30:29 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r8354 r8522  
    5959    }
    6060
    61     /*
    62     inline Float_t EvalAt(const Float_t x) const
    63     {
    64         Int_t i = TMath::FloorNint(x);
    65 
    66         // handle under- and overflow of the array-range by extrapolation
    67         if (i<0)
    68             i=0;
    69         if (i>fNum-2)
    70             i = fNum-2;
    71 
    72         return Eval(i, x-i);
    73     }
    74     */
    75 
    7661    // Evaluate first derivative of spline in the interval i with x=[0;1[
    7762    inline Double_t EvalDeriv1(const Float_t x, const Int_t i) const
     
    184169    inline Double_t EvalInteg(Int_t i, Float_t a=0, Float_t b=1) const
    185170    {
    186         // This is to make sure that we never access invalid
    187         // memory, even if this should never happen.
    188         // If it happens anyhow we extraolate the spline
    189         Align(i, a);
    190         Align(i, b);
    191 
    192171        return EvalPrimitive(i, b)-EvalPrimitive(i, a);
    193172    }
     
    471450    Float_t ExtractNoise(/*Int_t iter*/);
    472451    void Extract(Byte_t sat, Int_t maxpos, Bool_t width=kFALSE);
     452
     453    Float_t EvalAt(const Float_t x) const;
    473454};
    474455
     456inline Float_t MExtralgoSpline::EvalAt(const Float_t x) const
     457{
     458    Int_t   i = TMath::FloorNint(x);
     459    Float_t f = x-i;
     460
     461    Align(i, f);
     462
     463    return Eval(i, f);
     464}
     465
    475466#endif
Note: See TracChangeset for help on using the changeset viewer.