Changeset 5213 for trunk/MagicSoft/Mars
- Timestamp:
- 10/09/04 12:21:26 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/msignal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc
r5207 r5213 60 60 const Byte_t MExtractTimeAndChargeSpline::fgLoGainFirst = 3; 61 61 const Byte_t MExtractTimeAndChargeSpline::fgLoGainLast = 14; 62 const Float_t MExtractTimeAndChargeSpline::fgResolution = 0.001; 63 const Float_t MExtractTimeAndChargeSpline::fgRatioMax2Fall = 0.05; 62 const Float_t MExtractTimeAndChargeSpline::fgResolution = 0.001; 63 const Float_t MExtractTimeAndChargeSpline::fgRiseTime = 2.0; 64 const Float_t MExtractTimeAndChargeSpline::fgFallTime = 4.0; 64 65 // -------------------------------------------------------------------------- 65 66 // … … 85 86 86 87 SetResolution(); 87 SetRatioMax2Fall(); 88 SetRiseTime(); 89 SetFallTime(); 90 91 SetTimeType(); 92 SetChargeType(); 93 88 94 SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast); 89 90 95 91 96 fNumHiGainSamples = 1.; … … 201 206 const Byte_t *end = first + range; 202 207 Byte_t *p = first; 203 Byte_t max = 0;204 Byte_t maxpos = 0;205 208 Int_t count = 0; 206 209 … … 212 215 PedMean[1] = pedes - ABoffs; 213 216 217 fAbMax = 0.; 218 fAbMaxPos = 0.; 219 Byte_t maxpos = 0; 220 214 221 // 215 222 // Check for saturation in all other slices … … 219 226 220 227 const Int_t ids = fHiGainFirst + count ; 221 fHiGainSignal[count] = (Float_t)*p - PedMean[(ids+abflag) & 0x1]; 222 223 if (*p > max) 224 { 225 max = *p; 228 const Float_t signal = (Float_t)*p - PedMean[(ids+abflag) & 0x1]; 229 fHiGainSignal[count] = signal; 230 231 if (signal > fAbMax) 232 { 233 fAbMax = signal; 226 234 maxpos = p-first; 227 235 } 228 236 229 if (*p ++>= fSaturationLimit)237 if (*p >= fSaturationLimit) 230 238 sat++; 231 239 240 p++; 232 241 count++; 233 242 } … … 242 251 243 252 const Int_t ids = fHiGainFirst + range ; 244 fHiGainSignal[range] = (Float_t)*logain - PedMean[(ids+abflag) & 0x1]; 253 const Float_t signal = (Float_t)*logain - PedMean[(ids+abflag) & 0x1]; 254 fHiGainSignal[range] = signal; 245 255 range++; 246 256 247 if ( *logain > max)248 { 249 max = *logain;257 if (signal > fAbMax) 258 { 259 fAbMax = signal; 250 260 maxpos = logain-first; 251 261 } 252 262 253 if (*logain ++>= fSaturationLimit)263 if (*logain >= fSaturationLimit) 254 264 sat++; 255 265 256 } 257 } 258 259 // 260 // allow no saturated slice 261 // 262 if (sat) 263 return; 264 265 // 266 logain++; 267 } 268 } 269 270 // 271 // Allow no saturated slice 272 // and 266 273 // Don't start if the maxpos is too close to the left limit. 267 274 // 268 if (maxpos < 1) 269 return; 270 275 if (sat || maxpos < 2) 276 { 277 time = IsTimeType(kMaximum) 278 ? (Float_t)(fHiGainFirst + maxpos) 279 : (Float_t)(fHiGainFirst + maxpos - 1); 280 return; 281 } 282 271 283 Float_t pp; 272 284 … … 292 304 Float_t lower = (Float_t)maxpos-1.; 293 305 Float_t upper = (Float_t)maxpos; 306 fAbMaxPos = upper; 294 307 Float_t x = lower; 295 308 Float_t y = 0.; … … 298 311 Int_t klo = maxpos-1; 299 312 Int_t khi = maxpos; 300 fAbMax = fHiGainSignal[khi];301 fAbMaxPos = upper;302 313 303 314 // … … 439 450 } 440 451 441 fHalfMax = fAbMax/2.; 442 443 // 444 // Now, loop from the maximum bin leftward down in order to find the position of the half maximum. 445 // First, find the right FADC slice: 446 // 447 klo = maxpos; 448 while (klo > maxpos-3) 449 { 450 if (fHiGainSignal[klo] < fHalfMax) 451 break; 452 klo--; 453 } 454 455 // 456 // Loop from the beginning of the slice upwards to reach the fHalfMax: 457 // With means of bisection: 458 // 459 x = (Float_t)klo; 460 a = 1.; 461 b = 0.; 462 463 step = 0.5; 464 Bool_t back = kFALSE; 465 466 while (step > fResolution) 467 { 468 469 if (back) 470 { 471 x -= step; 472 a += step; 473 b -= step; 474 } 475 else 476 { 477 x += step; 478 a -= step; 479 b += step; 480 } 481 482 y = a*fHiGainSignal[klo] 483 + b*fHiGainSignal[khi] 484 + (a*a*a-a)*fHiGainSecondDeriv[klo] 485 + (b*b*b-b)*fHiGainSecondDeriv[khi]; 486 487 if (y > fHalfMax) 488 back = kTRUE; 489 else 490 back = kFALSE; 491 492 // *fLog << inf << x << " " << y << " " << fHalfMax << endl; 493 494 step /= 2.; 495 } 496 497 498 time = (Float_t)fHiGainFirst + fAbMaxPos; 499 // *fLog << inf << time << endl; 500 // time = (Float_t)fHiGainFirst + x; 501 dtime = fResolution; 502 sum = fAbMax; 503 504 #if 0 505 // 506 // Now integrate the whole thing! 507 // 508 Int_t startslice = (Int_t)(x - 0.75); 509 Int_t lastslice = (Int_t)(fAbMaxPos + fRatioMax2Fall*fAbMax); 510 Int_t coverage = lastslice-startslice; 511 512 // 513 // make them even 514 // 515 if (coverage != (coverage & ~1)) 516 lastslice++; 517 518 if (startslice < 0) 519 { 452 if (IsTimeType(kMaximum)) 453 { 454 time = (Float_t)fHiGainFirst + fAbMaxPos; 455 dtime = 0.02; 456 } 457 else 458 { 459 fHalfMax = fAbMax/2.; 460 461 // 462 // Now, loop from the maximum bin leftward down in order to find the position of the half maximum. 463 // First, find the right FADC slice: 464 // 465 klo = maxpos - 1; 466 while (klo >= 0) 467 { 468 if (fHiGainSignal[klo] < fHalfMax) 469 break; 470 klo--; 471 } 472 473 // 474 // Loop from the beginning of the slice upwards to reach the fHalfMax: 475 // With means of bisection: 476 // 477 x = (Float_t)klo; 478 a = 1.; 479 b = 0.; 480 481 step = 0.5; 482 Bool_t back = kFALSE; 483 484 Int_t maxcnt = 1000; 485 Int_t cnt = 0; 486 487 while (TMath::Abs(y-fHalfMax) > fResolution) 488 { 489 490 if (back) 491 { 492 x -= step; 493 a += step; 494 b -= step; 495 } 496 else 497 { 498 x += step; 499 a -= step; 500 b += step; 501 } 502 503 y = a*fHiGainSignal[klo] 504 + b*fHiGainSignal[khi] 505 + (a*a*a-a)*fHiGainSecondDeriv[klo] 506 + (b*b*b-b)*fHiGainSecondDeriv[khi]; 507 508 if (y > fHalfMax) 509 back = kTRUE; 510 else 511 back = kFALSE; 512 513 if (++cnt > maxcnt) 514 { 515 *fLog << inf << x << " " << y << " " << fHalfMax << endl; 516 break; 517 } 518 519 step /= 2.; 520 } 521 522 time = (Float_t)fHiGainFirst + x; 523 dtime = fResolution; 524 } 525 526 if (IsChargeType(kAmplitude)) 527 { 528 sum = fAbMax; 520 529 return; 521 // gLog << warn << GetDescriptor() 522 // << ": High Gain Bounce against left border, your range is too limited! " << endl; 523 startslice = 0; 524 } 525 526 if (lastslice > range-1) 527 { 528 return; 529 // gLog << warn << GetDescriptor() 530 // << ": High Gain Bounce against right border, your range is too limited! " << endl; 531 lastslice = range-1; 532 } 533 534 Int_t i = startslice; 535 sum = 0.5*fHiGainSignal[i] + 0.75*fHiGainSecondDeriv[i]; 536 537 for (i=startslice+1; i<lastslice; i++) 538 sum += fHiGainSignal[i] + 1.5*fHiGainSecondDeriv[i]; 539 540 sum += 0.5*fHiGainSignal[lastslice] + 0.75*fHiGainSecondDeriv[lastslice]; 541 #endif 530 } 531 532 if (IsChargeType(kIntegral)) 533 { 534 // 535 // Now integrate the whole thing! 536 // 537 Int_t startslice = (Int_t)(fAbMaxPos - fRiseTime); 538 Int_t lastslice = (Int_t)(fAbMaxPos + fFallTime); 539 540 if (startslice < 0) 541 { 542 lastslice -= startslice; 543 startslice = 0; 544 } 545 546 Int_t i = startslice; 547 sum = 0.5*fHiGainSignal[i]; 548 549 for (i=startslice+1; i<lastslice; i++) 550 sum += fHiGainSignal[i] + 1.5*fHiGainSecondDeriv[i]; 551 552 sum += 0.5*fHiGainSignal[lastslice]; 553 } 554 542 555 } 543 556 … … 552 565 { 553 566 554 constInt_t range = fLoGainLast - fLoGainFirst + 1;567 Int_t range = fLoGainLast - fLoGainFirst + 1; 555 568 const Byte_t *end = first + range; 556 Byte_t *p = first; 557 Byte_t max = 0; 558 Byte_t maxpos = 0; 559 Int_t count = 0; 569 Byte_t *p = first; 570 Int_t count = 0; 560 571 561 572 Float_t pedes = ped.GetPedestal(); 562 573 const Float_t ABoffs = ped.GetPedestalABoffset(); 574 563 575 Float_t PedMean[2]; 564 576 PedMean[0] = pedes + ABoffs; 565 577 PedMean[1] = pedes - ABoffs; 566 578 579 fAbMax = 0.; 580 fAbMaxPos = 0.; 581 Byte_t maxpos = 0; 582 567 583 // 568 584 // Check for saturation in all other slices 569 585 // 570 while (++p<end) 571 { 572 573 const Int_t ids = fLoGainFirst + count ; 574 fLoGainSignal[count] = (Float_t)*p - PedMean[(ids+abflag) & 0x1]; 575 576 if (*p > max) 577 { 578 max = *p; 586 while (p<end) 587 { 588 589 const Int_t ids = fLoGainFirst + count ; 590 const Float_t signal = (Float_t)*p - PedMean[(ids+abflag) & 0x1]; 591 fLoGainSignal[count] = signal; 592 593 if (signal > fAbMax) 594 { 595 fAbMax = signal; 579 596 maxpos = p-first; 580 597 } 581 598 582 599 if (*p >= fSaturationLimit) 583 { 584 sat++; 585 break; 586 } 587 count++; 588 } 589 590 if (sat) 591 return; 592 593 if (maxpos < 2) 594 return; 595 600 sat++; 601 602 p++; 603 count++; 604 } 605 606 // 607 // Allow no saturated slice 608 // and 609 // Don't start if the maxpos is too close to the left limit. 610 // 611 if (sat || maxpos < 2) 612 { 613 time = IsTimeType(kMaximum) 614 ? (Float_t)(fLoGainFirst + maxpos) 615 : (Float_t)(fLoGainFirst + maxpos - 1); 616 return; 617 } 618 596 619 Float_t pp; 597 620 598 p = first;599 621 fLoGainSecondDeriv[0] = 0.; 600 622 fLoGainFirstDeriv[0] = 0.; … … 606 628 fLoGainFirstDeriv [i] = fLoGainSignal[i+1] - fLoGainSignal[i] - fLoGainSignal[i] + fLoGainSignal[i-1]; 607 629 fLoGainFirstDeriv [i] = (6.0*fLoGainFirstDeriv[i]-fLoGainFirstDeriv[i-1])/pp; 608 p++;609 630 } 610 631 … … 616 637 // Now find the maximum 617 638 // 618 Float_t step = 0.2; // start with step size of 1ns and loop again with the smaller one 619 Float_t lower = (Float_t)maxpos-1.; 620 Float_t upper = (Float_t)maxpos; 621 Float_t x = lower; 622 Float_t y = 0.; 623 Float_t a = 1.; 624 Float_t b = 0.; 625 Int_t klo = maxpos-1; 626 Int_t khi = maxpos; 627 Float_t klocont = fLoGainSignal[klo]; 628 Float_t khicont = fLoGainSignal[khi]; 629 fAbMax = klocont; 630 fAbMaxPos = lower; 631 632 633 // 634 // Search for the maximum, starting in interval maxpos-1. If no maximum is found, go to 635 // interval maxpos+1. 636 // 637 while (x<upper-0.1) 639 Float_t step = 0.2; // start with step size of 1ns and loop again with the smaller one 640 Float_t lower = (Float_t)maxpos-1.; 641 Float_t upper = (Float_t)maxpos; 642 fAbMaxPos = upper; 643 Float_t x = lower; 644 Float_t y = 0.; 645 Float_t a = 1.; 646 Float_t b = 0.; 647 Int_t klo = maxpos-1; 648 Int_t khi = maxpos; 649 650 // 651 // Search for the maximum, starting in interval maxpos-1 in steps of 0.2 till maxpos-0.2. 652 // If no maximum is found, go to interval maxpos+1. 653 // 654 while ( x < upper - 0.3 ) 638 655 { 639 656 … … 642 659 b += step; 643 660 644 y = a* klocont645 + b* khicont661 y = a*fLoGainSignal[klo] 662 + b*fLoGainSignal[khi] 646 663 + (a*a*a-a)*fLoGainSecondDeriv[klo] 647 664 + (b*b*b-b)*fLoGainSecondDeriv[khi]; … … 649 666 if (y > fAbMax) 650 667 { 651 fAbMax = y;668 fAbMax = y; 652 669 fAbMaxPos = x; 653 670 } 654 671 655 } 656 657 if (fAbMaxPos < lower+0.1) 658 { 659 660 upper = (Float_t)maxpos-1.; 661 lower = (Float_t)maxpos-2.; 662 x = lower; 663 a = 1.; 664 b = 0.; 665 khi = maxpos-1; 666 klo = maxpos-2; 667 klocont = fLoGainSignal[klo]; 668 khicont = fLoGainSignal[khi]; 669 670 while (x<upper-0.1) 672 // *fLog << err << x << " " << y << " " << fAbMaxPos<< endl; 673 } 674 675 // 676 // Test the possibility that the absolute maximum has not been found before the 677 // maxpos and search from maxpos to maxpos+1 in steps of 0.2 678 // 679 if (fAbMaxPos > upper-0.1) 680 { 681 682 upper = (Float_t)maxpos+1.; 683 lower = (Float_t)maxpos; 684 x = lower; 685 a = 1.; 686 b = 0.; 687 khi = maxpos+1; 688 klo = maxpos; 689 690 while (x<upper-0.3) 671 691 { 672 692 … … 675 695 b += step; 676 696 677 y = a* klocont678 + b* khicont697 y = a*fLoGainSignal[klo] 698 + b*fLoGainSignal[khi] 679 699 + (a*a*a-a)*fLoGainSecondDeriv[klo] 680 700 + (b*b*b-b)*fLoGainSecondDeriv[khi]; 681 701 682 702 if (y > fAbMax) 683 703 { … … 685 705 fAbMaxPos = x; 686 706 } 707 // *fLog << inf << x << " " << y << " " << fAbMaxPos << endl; 708 687 709 } 688 710 } 689 690 const Float_t up = fAbMaxPos+step-0.035; 691 const Float_t lo = fAbMaxPos-step+0.035; 692 const Float_t maxpossave = fAbMaxPos; 693 711 712 713 // 714 // Now, the time, abmax and khicont and klocont are set correctly within the previous precision. 715 // Try a better precision. 716 // 717 const Float_t up = fAbMaxPos+step-0.055; 718 const Float_t lo = fAbMaxPos-step+0.055; 719 const Float_t maxpossave = fAbMaxPos; 720 694 721 x = fAbMaxPos; 695 722 a = upper - x; 696 723 b = x - lower; 697 698 step = 0.02 5; // step size of 165ps699 724 725 step = 0.02; // step size of 42 ps 726 700 727 while (x<up) 701 728 { … … 705 732 b += step; 706 733 707 y = a* klocont708 + b* khicont734 y = a*fLoGainSignal[klo] 735 + b*fLoGainSignal[khi] 709 736 + (a*a*a-a)*fLoGainSecondDeriv[klo] 710 737 + (b*b*b-b)*fLoGainSecondDeriv[khi]; … … 715 742 fAbMaxPos = x; 716 743 } 717 718 } 719 744 // *fLog << inf << x << " " << y << " " << fAbMaxPos << endl; 745 } 746 747 // 748 // Second, try from time down to time-0.2 in steps of 0.04. 749 // 720 750 x = maxpossave; 751 752 // 753 // Test the possibility that the absolute maximum has not been found between 754 // maxpos and maxpos+0.02, then we have to look between maxpos-0.02 and maxpos 755 // which requires new setting of klocont and khicont 756 // 757 if (x < klo + 0.02) 758 { 759 klo--; 760 khi--; 761 upper--; 762 lower--; 763 } 764 721 765 a = upper - x; 722 766 b = x - lower; 723 767 724 768 while (x>lo) 725 769 { … … 729 773 b -= step; 730 774 731 y = a* klocont732 + b* khicont775 y = a*fLoGainSignal[klo] 776 + b*fLoGainSignal[khi] 733 777 + (a*a*a-a)*fLoGainSecondDeriv[klo] 734 778 + (b*b*b-b)*fLoGainSecondDeriv[khi]; … … 739 783 fAbMaxPos = x; 740 784 } 741 742 } 743 744 fHalfMax = fAbMax/2.; 745 746 // 747 // Now, loop from the maximum bin leftward down in order to find the position of the half maximum. 748 // First, find the right FADC slice: 749 // 750 klo = maxpos -1; 751 while (klo > maxpos-4) 752 { 753 if (*(first+klo) < (Byte_t)fHalfMax) 754 break; 755 klo--; 756 } 757 758 // 759 // Loop from the beginning of the slice upwards to reach the fHalfMax: 760 // With means of bisection: 761 // 762 x = (Float_t)klo; 763 a = 1.; 764 b = 0.; 765 klocont = fLoGainSignal[klo]; 766 khicont = fLoGainSignal[klo+1]; 767 time = x; 768 769 step = 0.5; 770 Bool_t back = kFALSE; 771 772 while (step > fResolution) 773 { 774 775 if (back) 776 { 777 x -= step; 778 a += step; 779 b -= step; 780 } 781 else 782 { 783 x += step; 784 a -= step; 785 b += step; 786 } 787 788 y = a*klocont 789 + b*khicont 790 + (a*a*a-a)*fLoGainSecondDeriv[klo] 791 + (b*b*b-b)*fLoGainSecondDeriv[khi]; 792 793 if (y >= fHalfMax) 794 back = kTRUE; 795 else 796 back = kFALSE; 797 798 step /= 2.; 799 } 800 801 time = (Float_t)fLoGainFirst + x; 802 dtime = fResolution; 803 804 // 805 // Now integrate the whole thing! 806 // 807 Int_t startslice = (Int_t)(time - 1.5); 808 Int_t lastslice = (Int_t)(fAbMaxPos + 2.*fRatioMax2Fall*fAbMax-1.); 809 Int_t coverage = lastslice-startslice; 810 811 // 812 // make them even 813 // 814 if (coverage != (coverage & ~1)) 815 lastslice++; 816 817 if (startslice < 0) 818 { 819 // gLog << warn << GetDescriptor() 820 // << ": Low Gain Bounce against left border, your range is too limited! " << endl; 821 sum = 0.; 785 // *fLog << warn << x << " " << y << " " << fAbMaxPos << endl; 786 } 787 788 if (IsTimeType(kMaximum)) 789 { 790 time = (Float_t)fLoGainFirst + fAbMaxPos; 791 dtime = 0.02; 792 } 793 else 794 { 795 fHalfMax = fAbMax/2.; 796 797 // 798 // Now, loop from the maximum bin leftward down in order to find the position of the half maximum. 799 // First, find the right FADC slice: 800 // 801 klo = maxpos - 1; 802 while (klo >= 0) 803 { 804 if (fLoGainSignal[klo] < fHalfMax) 805 break; 806 klo--; 807 } 808 809 // 810 // Loop from the beginning of the slice upwards to reach the fHalfMax: 811 // With means of bisection: 812 // 813 x = (Float_t)klo; 814 a = 1.; 815 b = 0.; 816 817 step = 0.5; 818 Bool_t back = kFALSE; 819 820 Int_t maxcnt = 1000; 821 Int_t cnt = 0; 822 823 while (TMath::Abs(y-fHalfMax) > fResolution) 824 { 825 826 if (back) 827 { 828 x -= step; 829 a += step; 830 b -= step; 831 } 832 else 833 { 834 x += step; 835 a -= step; 836 b += step; 837 } 838 839 y = a*fLoGainSignal[klo] 840 + b*fLoGainSignal[khi] 841 + (a*a*a-a)*fLoGainSecondDeriv[klo] 842 + (b*b*b-b)*fLoGainSecondDeriv[khi]; 843 844 if (y > fHalfMax) 845 back = kTRUE; 846 else 847 back = kFALSE; 848 849 if (++cnt > maxcnt) 850 { 851 *fLog << inf << x << " " << y << " " << fHalfMax << endl; 852 break; 853 } 854 855 step /= 2.; 856 } 857 858 time = (Float_t)fLoGainFirst + x; 859 dtime = fResolution; 860 } 861 862 if (IsChargeType(kAmplitude)) 863 { 864 sum = fAbMax; 822 865 return; 823 startslice = 0; 824 } 825 826 if (lastslice > range-1) 827 { 828 sum = 0.; 829 return; 830 // gLog << warn << GetDescriptor() 831 // << ": Low Gain Bounce against right border, your range is too limited! " << endl; 832 lastslice = range-1; 833 } 834 835 Int_t i = startslice; 836 sum = 0.5*fLoGainSignal[i] + 0.75*fLoGainSecondDeriv[i]; 837 838 for (i=startslice+1; i<lastslice; i++) 839 sum += fLoGainSignal[i] + 1.5*fLoGainSecondDeriv[i]; 840 841 842 sum += 0.5*fLoGainSignal[lastslice] + 0.75*fLoGainSecondDeriv[lastslice]; 843 // 844 // subtract the pedestal 845 // 846 // sum -= pedes*(lastslice-startslice); 847 848 // sig.SetNumLoGainSlices(fNumLoGainSamples); 866 } 867 868 if (IsChargeType(kIntegral)) 869 { 870 // 871 // Now integrate the whole thing! 872 // 873 Int_t startslice = (Int_t)(fAbMaxPos - fRiseTime); 874 Int_t lastslice = (Int_t)(fAbMaxPos + fFallTime); 875 876 if (startslice < 0) 877 { 878 lastslice -= startslice; 879 startslice = 0; 880 } 881 882 Int_t i = startslice; 883 sum = 0.5*fLoGainSignal[i]; 884 885 for (i=startslice+1; i<lastslice; i++) 886 sum += fLoGainSignal[i] + 1.5*fLoGainSecondDeriv[i]; 887 888 sum += 0.5*fLoGainSignal[lastslice]; 889 } 890 849 891 850 892 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.h
r5205 r5213 12 12 private: 13 13 14 static const Byte_t fgHiGainFirst; // Default for fHiGainFirst (now set to: 2) 15 static const Byte_t fgHiGainLast; // Default for fHiGainLast (now set to: 14) 16 static const Byte_t fgLoGainFirst; // Default for fLOGainFirst (now set to: 3) 17 static const Byte_t fgLoGainLast; // Default for fLoGainLast (now set to: 14) 18 static const Float_t fgResolution; // Default for fResolution (now set to: 0.003) 19 static const Float_t fgRatioMax2Fall; // Default ratio signal maximum to fall time (now set to: 0.03) 14 static const Byte_t fgHiGainFirst; //! Default for fHiGainFirst (now set to: 2) 15 static const Byte_t fgHiGainLast; //! Default for fHiGainLast (now set to: 14) 16 static const Byte_t fgLoGainFirst; //! Default for fLOGainFirst (now set to: 3) 17 static const Byte_t fgLoGainLast; //! Default for fLoGainLast (now set to: 14) 18 static const Float_t fgResolution; //! Default for fResolution (now set to: 0.003) 19 static const Float_t fgRiseTime; //! Default for fRiseTime (now set to: 1.5) 20 static const Float_t fgFallTime; //! Default for fFallTime (now set to: 4.5) 20 21 21 Float_t *fHiGainSignal; //! Need fast access to the signals in a float way22 Float_t *fLoGainSignal; //! Store them in separate arrays23 Float_t *fHiGainFirstDeriv; //!24 Float_t *fLoGainFirstDeriv; //!25 Float_t *fHiGainSecondDeriv; //!26 Float_t *fLoGainSecondDeriv; //!22 Float_t *fHiGainSignal; //! Need fast access to the signals in a float way 23 Float_t *fLoGainSignal; //! Store them in separate arrays 24 Float_t *fHiGainFirstDeriv; //! 25 Float_t *fLoGainFirstDeriv; //! 26 Float_t *fHiGainSecondDeriv; //! 27 Float_t *fLoGainSecondDeriv; //! 27 28 28 Float_t fResolution; // The time resolution in FADC units 29 Float_t fRatioMax2Fall; // Relation fall time to maximum slice content 29 Float_t fResolution; // The time resolution in FADC units 30 Float_t fRiseTime; // The usual rise time of the pulse 31 Float_t fFallTime; // The usual fall time of the pulse 30 32 31 Float_t fAbMax; 32 Float_t fAbMaxPos; 33 Float_t fHalfMax; 33 Float_t fAbMax; // Current maximum of the spline 34 Float_t fAbMaxPos; // Current position of the maximum of the spline 35 Float_t fHalfMax; // Current half maximum of the spline 36 37 Byte_t fTimeFlags; // Flag to hold the time extraction type 38 Byte_t fChargeFlags; // Flag to hold the charge extraction type 34 39 35 40 Int_t PreProcess(MParList *pList); … … 45 50 public: 46 51 52 enum TimeType_t { kMaximum, kHalfMaximum }; //! Possible time extraction types 53 enum ChargeType_t { kAmplitude, kIntegral }; //! Possible charge extraction types 54 55 private: 56 57 Bool_t IsTimeType ( TimeType_t typ ) { return TESTBIT(fTimeFlags , typ); } 58 Bool_t IsChargeType( ChargeType_t typ ) { return TESTBIT(fChargeFlags, typ); } 59 60 public: 61 47 62 MExtractTimeAndChargeSpline(const char *name=NULL, const char *title=NULL); 48 63 ~MExtractTimeAndChargeSpline(); 49 50 void SetResolution ( Float_t f=fgResolution ) { fResolution = f; } 51 void SetRatioMax2Fall ( Float_t f=fgRatioMax2Fall ) { fRatioMax2Fall = f; } 64 65 void SetResolution ( Float_t f=fgResolution ) { fResolution = f; } 66 void SetRiseTime ( Float_t f=fgRiseTime ) { fRiseTime = f; } 67 void SetFallTime ( Float_t f=fgFallTime ) { fFallTime = f; } 68 69 void SetTimeType ( TimeType_t typ=kMaximum ) { fTimeFlags = 0; SETBIT(fTimeFlags,typ); } 70 void SetChargeType ( ChargeType_t typ=kAmplitude) { fChargeFlags = 0; SETBIT(fChargeFlags,typ);} 52 71 53 ClassDef(MExtractTimeAndChargeSpline, 0) // Task to Extract the Arrival Times using a FastSpline72 ClassDef(MExtractTimeAndChargeSpline, 0) // Task to Extract Arrival Times and Charges using a Fast Cubic Spline 54 73 }; 55 74
Note:
See TracChangeset
for help on using the changeset viewer.