Changeset 17857
- Timestamp:
- 05/14/14 20:39:52 (11 years ago)
- Location:
- trunk/Mars/mextralgo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mextralgo/MExtralgoSpline.cc
r17148 r17857 54 54 #include "MExtralgoSpline.h" 55 55 56 #include <iostream> 56 57 #include <TRandom.h> 57 58 … … 337 338 GetMaxAroundI(maxbin, maxpos, fHeight); 338 339 339 // --- End NEW --- 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 344 if (fExtractionType&kIntegral) 345 { 340 const Float_t h = (fExtractionType&kTimeRel) ? fHeight*fHeightTm : fHeightTm; 341 342 switch (fExtractionType) 343 { 344 case kAmplitude: 345 fSignal = fHeight; 346 fTime = maxpos; 347 fSignalDev = 0; // means: is valid 348 fTimeDev = 0; 349 break; 350 351 case kAmplitudeAbs: 352 case kAmplitudeRel: 353 fSignal = fHeight; 354 fTime = SearchYdn(maxpos, h); 355 fSignalDev = 0; // means: is valid 356 fTimeDev = 0; 357 break; 358 359 case kIntegralAbs: 360 case kIntegralRel: 346 361 fSignal = CalcIntegral(maxpos); 362 fTime = SearchYdn(maxpos, h); 347 363 fSignalDev = 0; // means: is valid 348 } 349 350 if (!(fExtractionType&kIntegralDyn) && !(fExtractionType&kIntegralFixed)) 351 { 352 fSignal = fHeight; 353 fSignalDev = 0; // means: is valid 354 } 355 356 // Position of maximum 357 if (((fExtractionType&kTimeRel) && fHeightTm<0) || (fExtractionType&kMaximum)) 358 { 359 fTime = maxpos; 360 fTimeDev = 0; 361 return; 362 } 363 364 // Position of fraction height or absolute height 365 const Float_t h = (fExtractionType&kTimeRel) ? fHeight*fHeightTm : fHeightTm; 366 367 // Search downwards for fHeight/2 368 // By doing also a search upwards we could extract the pulse width 369 fTime = SearchYdn(maxpos, h); 370 fTimeDev = 0; 371 if (width || fExtractionType&kIntegralDyn) 372 { 373 fWidth = SearchYup(maxpos, h)-fTime; 374 fWidthDev = 0; 375 } 376 377 if (fExtractionType&kIntegralDyn) 378 { 364 fTimeDev = 0; 365 break; 366 367 case kIntegralDyn: 368 fTime = SearchYdn(maxpos, h); 369 fWidth = SearchYup(maxpos, h)-fTime; 379 370 fSignal = CalcIntegral(fTime, fWidth); 371 fTimeDev = 0; 372 fWidthDev = 0; 380 373 fSignalDev = 0; 381 } 382 if (fExtractionType&kIntegralFixed)383 {374 375 case kIntegralFixed: 376 fTime = SearchYdn(maxpos, h); 384 377 fSignal = CalcIntegral(fTime-fRiseTime, fRiseTime+fFallTime); 378 fTimeDev = 0; 385 379 fSignalDev = 0; 386 380 } -
trunk/Mars/mextralgo/MExtralgoSpline.h
r17148 r17857 11 11 class MExtralgoSpline 12 12 { 13 p ublic:14 enum ExtractionType_t13 private: 14 enum 15 15 { 16 16 kIntegral = BIT(0), … … 19 19 kDynWidth = BIT(3), 20 20 kFixedWidth = BIT(4), 21 21 }; 22 public: 23 enum ExtractionType_t 24 { 22 25 // For backward compatibility 23 26 kAmplitudeAbs = 0, // Height of maximum, absolute height leading edge
Note:
See TracChangeset
for help on using the changeset viewer.