Changeset 19665 for trunk/Mars


Ignore:
Timestamp:
09/23/19 18:18:58 (5 years ago)
Author:
tbretz
Message:
PulsePos is in naoseconds -- therefore the conversion is wrong: fixed, the trigger position is now in nanoseconds.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/msimcamera/MSimTrigger.cc

    r19624 r19665  
    492492    const Double_t freq    = fRunHeader->GetFreqSampling()/1000.;
    493493    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)
    497515    const Float_t min = fCamera->GetValidRangeMin()+pulspos;
    498516    const Float_t max = fCamera->GetValidRangeMax()-(nsamp-pulspos);
     
    588606        const Double_t offset = fElectronicNoise ? (*fElectronicNoise)[i].GetPedestal() : 0;
    589607        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
    590612        ttls.AddAt(
    591613                    (*patches)[i].Discriminate(
     
    736758    // FIXME: Store triggers! (+ Reversed pixels?)
    737759
    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());
    739763
    740764    // No trigger issued. Go on.
     
    749773    // Coincidence signals emitted. (If the total number is higher than
    750774    // the number of triggers either some triggers had to be removed or
    751     // or a patch has emitted more than one trigger signal)
     775    // a patch has emitted more than one trigger signal)
    752776    // FIXME: inf2?
    753777    *fLog << inf << GetNumExecutions() << ": ";
    754778    *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";
    756780    *fLog << endl;
    757781
Note: See TracChangeset for help on using the changeset viewer.