Changeset 19917 for trunk/Mars/mbase
- Timestamp:
- 12/17/19 17:26:49 (5 years ago)
- Location:
- trunk/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mbase/MSpline3.cc
r19128 r19917 234 234 } 235 235 236 return TMath::TwoPi()*MSpline3(x.GetArray(), y.GetArray(), n).Integral(); 237 } 236 return MSpline3(x.GetArray(), y.GetArray(), n).Integral(); 237 } 238 239 MSpline3 MSpline3::GetIntegralSpline() const 240 { 241 const Int_t n = GetNp(); 242 243 MArrayD x(n+2); 244 MArrayD y(n+2); 245 246 GetKnot(0, x[0], y[0]); 247 248 y[0] = 0; 249 250 GetKnot(0, x[1], y[1]); 251 252 y[1] = 0; 253 254 for (int i=0; i<n-1; i++) 255 { 256 GetKnot(i+1, x[i+2], y[i+2]); 257 y[i+2] = y[i+1]+IntegralBin(i, x[i+2]); 258 } 259 260 for (int i=2; i<=n; i++) 261 y[i] /= y[n]; 262 263 y[n+1] = 1; 264 265 x[0] = x[1] -(x[2]-x[1]); 266 x[n+1] = x[n] +(x[n]-x[n-1]); 267 268 return MSpline3(x.GetArray(), y.GetArray(), n+2, "b1 e1"); 269 } 270 238 271 239 272 -
trunk/Mars/mbase/MSpline3.h
r19128 r19917 64 64 Double_t IntegralSolidAngle() const; 65 65 66 MSpline3 GetIntegralSpline() const; 67 66 68 void Scale(double=1); 67 69
Note:
See TracChangeset
for help on using the changeset viewer.