Changeset 9212 for trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.h
- Timestamp:
- 01/06/09 13:07:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.h
r8928 r9212 58 58 59 59 // Evaluate first derivative of spline in the interval i with x=[0;1[ 60 inline Double_t EvalDeriv1(const Float_t x, const Int_t i) const60 inline Double_t EvalDeriv1(const Int_t i, const Float_t x) const 61 61 { 62 62 // x := [0; 1[ … … 64 64 const Double_t difder = fDer2[i+1]-fDer2[i]; 65 65 66 return 3*difder*x*x + 6*fDer2[i]*x - 2*fDer2[i] - fDer2[i+1] + difval; 66 //return 3*difder*x*x + 6*fDer2[i]*x - 2*fDer2[i] - fDer2[i+1] + difval; 67 return 3*difder*x*x + (6*x - 2)*fDer2[i] - fDer2[i+1] + difval; 67 68 } 68 69 69 70 // Evaluate second derivative of spline in the interval i with x=[0;1[ 70 inline Double_t EvalDeriv2(const Float_t x, const Int_t i) const71 inline Double_t EvalDeriv2(const Int_t i, const Float_t x) const 71 72 { 72 73 // x := [0; 1[ … … 75 76 76 77 Double_t FindY(Int_t i, Bool_t downwards, Double_t y=0, Double_t min=0, Double_t max=1) const; 77 Double_t SearchY(Float_t maxpos, Float_t y) const;78 Double_t SearchYup(Float_t maxpos, Float_t y) const;79 78 80 79 Int_t EvalDerivEq0(const Int_t i, Double_t &x1, Double_t &x2) const; … … 141 140 142 141 // Calculate the intgeral of the Eval-function in 143 // bin i from a=[0;1[ to b=[0;1[142 // bin i from 0 <= a < b < 1 144 143 inline Double_t EvalInteg(Int_t i, Float_t a, Float_t b) const 145 144 { … … 268 267 return kFALSE; 269 268 270 const Bool_t ismax1 = x1>=min && x1<max && EvalDeriv2( x1, i)<0;271 const Bool_t ismax2 = x2>=min && x2<max && EvalDeriv2( x2, i)<0;269 const Bool_t ismax1 = x1>=min && x1<max && EvalDeriv2(i, x1)<0; 270 const Bool_t ismax2 = x2>=min && x2<max && EvalDeriv2(i, x2)<0; 272 271 273 272 if (!ismax1 && !ismax2) … … 323 322 324 323 Float_t EvalAt(const Float_t x) const; 324 Float_t Deriv1(const Float_t x) const; 325 326 Double_t SearchYdn(Float_t maxpos, Float_t y) const; 327 Double_t SearchYup(Float_t maxpos, Float_t y) const; 328 329 Double_t SearchYdn(Float_t y) const { return SearchYdn(fNum, y); } 330 Double_t SearchYup(Float_t y) const { return SearchYup(0, y); } 325 331 }; 326 332 … … 335 341 } 336 342 343 inline Float_t MExtralgoSpline::Deriv1(const Float_t x) const 344 { 345 Int_t i = TMath::FloorNint(x); 346 Float_t f = x-i; 347 348 Align(i, f); 349 350 return EvalDeriv1(i, f); 351 } 352 337 353 #endif
Note:
See TracChangeset
for help on using the changeset viewer.