Changeset 19665 for trunk/Mars
- Timestamp:
- 09/23/19 18:18:58 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/msimcamera/MSimTrigger.cc
r19624 r19665 492 492 const Double_t freq = fRunHeader->GetFreqSampling()/1000.; 493 493 const Float_t nsamp = fRunHeader->GetNumSamplesHiGain(); 494 const Float_t pulspos = fPulsePos->GetVal()/freq; 495 496 // Valid range in units of bins 494 495 // The trigger position in the readout window 496 // FIXME: This currently corresponds to the start of the spline! 497 const Float_t pulspos = fPulsePos->GetVal()*freq; 498 499 // Valid range in units of bins for the trigger 500 // 501 // GetValidRangeMin/Max contains the earliest and latest 502 // reasonable sample. The earliest is determined by the 503 // the fact that at least a full pulse must fit in front. 504 // The latest ends with the full sampling range. 505 // 506 // As the first trigger can only be initiated by the first 507 // photon from the shower, the valid range for triggers 508 // starts the pulsewidth before the trigger position, 509 // i.e. ValidRangeMin+triggerposition 510 // 511 // If the last photon triggers, then there must at least 512 // be sampling window minus trigger position samples left. 513 // Therefore, the last trigger must be at 514 // ValidRangeMax-(window-triggerpositon) 497 515 const Float_t min = fCamera->GetValidRangeMin()+pulspos; 498 516 const Float_t max = fCamera->GetValidRangeMax()-(nsamp-pulspos); … … 588 606 const Double_t offset = fElectronicNoise ? (*fElectronicNoise)[i].GetPedestal() : 0; 589 607 const Double_t gain = fGain ? (*fGain)[i].GetPedestal() : 1; 608 // FIXME: fCableDelay not taken into account when calculating the 609 // valid range, therefore, fCableDelay must be smaller than the pulse width 610 // FIXME: Start seraching at pulsepos is faster, but breaks things like 611 // ratescans triggering on noise events 590 612 ttls.AddAt( 591 613 (*patches)[i].Discriminate( … … 736 758 // FIXME: Store triggers! (+ Reversed pixels?) 737 759 738 SetTrigger(triggers.GetFirstTrigger(), triggers.GetFirstIndex()); 760 // Shift the trigger such that the pulse position X=0 coincides with the 761 // the trigger position in the readout window 762 SetTrigger(triggers.GetFirstTrigger()/freq, triggers.GetFirstIndex()); 739 763 740 764 // No trigger issued. Go on. … … 749 773 // Coincidence signals emitted. (If the total number is higher than 750 774 // the number of triggers either some triggers had to be removed or 751 // ora patch has emitted more than one trigger signal)775 // a patch has emitted more than one trigger signal) 752 776 // FIXME: inf2? 753 777 *fLog << inf << GetNumExecutions() << ": "; 754 778 *fLog << setw(3) << triggers.GetNumSignals() << " triggers left out of "; 755 *fLog << setw(3) << cnt << " (" << rmlo << "/" << rmhi << " trigger out of valid range), T=" << fTrigger->GetVal() ;779 *fLog << setw(3) << cnt << " (" << rmlo << "/" << rmhi << " trigger out of valid range), T=" << fTrigger->GetVal()-fCamera->GetValidRangeMin()/freq << "ns"; 756 780 *fLog << endl; 757 781
Note:
See TracChangeset
for help on using the changeset viewer.