- Timestamp:
- 02/04/13 10:00:19 (12 years ago)
- Location:
- trunk/Mars/mextralgo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mextralgo/MExtralgoSpline.cc
r13003 r14854 263 263 } 264 264 265 Float_t MExtralgoSpline::CalcIntegral(Float_t beg, Float_t width) const 266 { 267 Float_t end = beg + width; 268 269 if (beg<0) 270 { 271 end -= beg; 272 beg = 0; 273 } 274 275 if (end>fNum-1) 276 { 277 beg -= (end-fNum-1); 278 end = fNum-1; 279 } 280 281 return EvalInteg(beg, end); 282 } 283 265 284 MArrayF MExtralgoSpline::GetIntegral(bool norm) const 266 285 { … … 320 339 // --- End NEW --- 321 340 341 //kDynWidth = kTimeRel|kDynWidth, // Integrate between leading edge and falling edge 342 // kFixedWidth = kTimeRel|kFixedWidth, // Integrate between leading edge and edge plus fRiseTime+fFallTime 343 322 344 if (fExtractionType&kIntegral) 323 345 { … … 325 347 fSignalDev = 0; // means: is valid 326 348 } 327 else 349 350 if (!(fExtractionType&kIntegralDyn) && !(fExtractionType&kIntegralFixed)) 328 351 { 329 352 fSignal = fHeight; … … 346 369 fTime = SearchYdn(maxpos, h); 347 370 fTimeDev = 0; 348 if (width )371 if (width || fExtractionType&kIntegralDyn) 349 372 { 350 373 fWidth = SearchYup(maxpos, h)-fTime; 351 374 fWidthDev = 0; 352 375 } 353 } 376 377 if (fExtractionType&kIntegralDyn) 378 { 379 fSignal = CalcIntegral(fTime, fWidth); 380 fSignalDev = 0; 381 } 382 if (fExtractionType&kIntegralFixed) 383 { 384 fSignal = CalcIntegral(fTime-fRiseTime, fRiseTime+fFallTime); 385 fSignalDev = 0; 386 } 387 } -
trunk/Mars/mextralgo/MExtralgoSpline.h
r13003 r14854 14 14 enum ExtractionType_t 15 15 { 16 kIntegral = BIT(0), 17 kTimeRel = BIT(1), 18 kMaximum = BIT(2), 16 kIntegral = BIT(0), 17 kTimeRel = BIT(1), 18 kMaximum = BIT(2), 19 kDynWidth = BIT(3), 20 kFixedWidth = BIT(4), 19 21 20 22 // For backward compatibility 21 kAmplitudeAbs = 0, // Height of maximum, absolute height leading edge 22 kAmplitudeRel = kTimeRel, // Height of maximum, relative height leading edge 23 kAmplitude = kMaximum, // Position and height of maximum 24 kIntegralAbs = kIntegral, // Integral, absolute height leading edge 25 kIntegralRel = kIntegral|kTimeRel, // Integral, relative height leading edge 23 kAmplitudeAbs = 0, // Height of maximum, absolute height leading edge 24 kAmplitudeRel = kTimeRel, // Height of maximum, relative height leading edge 25 kAmplitude = kMaximum, // Position and height of maximum 26 kIntegralAbs = kIntegral, // Integral, absolute height leading edge 27 kIntegralRel = kIntegral|kTimeRel, // Integral, relative height leading edge 28 kIntegralDyn = kTimeRel|kDynWidth, // Integrate between leading edge and falling edge 29 kIntegralFixed = kTimeRel|kFixedWidth, // Integrate between leading edge minus fRiseTime and plus fFallTime 26 30 }; 27 31 … … 311 315 void InitDerivatives() const; 312 316 Float_t CalcIntegral(Float_t start) const; 317 Float_t CalcIntegral(Float_t beg, Float_t width) const; 313 318 314 319 public:
Note:
See TracChangeset
for help on using the changeset viewer.