Changeset 8308 for trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.cc
- Timestamp:
- 02/06/07 09:10:59 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.cc
r8165 r8308 126 126 x = x3; 127 127 128 return x<0 ? - 1: x+i;128 return x<0 ? -2 : x+i; 129 129 } 130 130 … … 132 132 // 133 133 // Search analytically downward for the value y of the spline, starting 134 // at x, until x==0. If y is not found - 1is returned.134 // at x, until x==0. If y is not found -2 is returned. 135 135 // 136 136 Double_t MExtralgoSpline::SearchY(Float_t x, Float_t y) const … … 142 142 Double_t rc = FindY(i, y, 0, x-i); 143 143 while (--i>=0 && rc<0) 144 rc = FindY(i, y); 145 146 return rc; 147 } 148 149 Double_t MExtralgoSpline::SearchYup(Float_t x, Float_t y) const 150 { 151 if (x<0) 152 x = 0.0001; 153 154 Int_t i = TMath::FloorNint(x); 155 Double_t rc = FindY(i, y, x-i, 1.); 156 while (i++<fNum-1 && rc<0) 144 157 rc = FindY(i, y); 145 158 … … 227 240 } 228 241 229 void MExtralgoSpline::Extract(Byte_t sat, Int_t maxbin )242 void MExtralgoSpline::Extract(Byte_t sat, Int_t maxbin, Bool_t width) 230 243 { 231 244 fSignal = 0; 232 245 fTime = 0; 246 fWidth = 0; 233 247 fSignalDev = -1; 234 248 fTimeDev = -1; 249 fWidthDev = -1; 235 250 236 251 if (fNum<2) … … 381 396 }*/ 382 397 383 Float_t maxpos , maxval;398 Float_t maxpos; 384 399 // FIXME: Check the default if no maximum found!!! 385 GetMaxAroundI(maxbin, maxpos, maxval);400 GetMaxAroundI(maxbin, maxpos, fHeight); 386 401 387 402 // --- End NEW --- … … 391 406 fTime = maxpos; 392 407 fTimeDev = 0; 393 fSignal = maxval;408 fSignal = fHeight; 394 409 fSignalDev = 0; // means: is valid 395 410 return; 396 411 } 397 412 398 // Search downwards for maxval/2 413 const Float_t h = fExtractionType==kIntegralAbs ? fHeightTm : fHeight*fHeightTm; 414 415 // Search downwards for fHeight/2 399 416 // By doing also a search upwards we could extract the pulse width 400 const Double_t x1 = SearchY(maxpos, maxval/2); 401 402 fTime = x1; 417 fTime = SearchY(maxpos, h); 403 418 fTimeDev = 0; 419 if (width) 420 { 421 fWidth = SearchYup(maxpos, h)-fTime; 422 fWidthDev = 0; 423 } 404 424 fSignal = CalcIntegral(maxpos); 405 425 fSignalDev = 0; // means: is valid
Note:
See TracChangeset
for help on using the changeset viewer.