[Halld-offline] Fwd: Some problems with f250 algorithms?

Michael Staib mstaib at andrew.cmu.edu
Fri Aug 28 11:27:36 EDT 2015


Hi All,

Something I have been working through is the negative energy hits in the BCAL. This is understood to be caused by hits late in the event where the correct number of pedestal samples are not subtracted from the integral. We do see that effect, but there were also some highly negative hits showing up at times where the full integration window should have been available. The cause is incorrect times being assigned to small pulses late in the window. See discussion that follows. Now we just have to think about implementing a fix. It will probably have to wait until David gets back since the most natural place will be in the DAQ library. It turns out this probably affects every subsystem since it is a “feature” of the algorithm. I haven’t checked if this got ported over to the 125 firmware as well.

The fix is to require that (peak height - per event pedestal) / 2 > threshold. This essentially doubles the threshold to have a hit, which might not be an acceptable solution. For now just be aware that pulse heights less than two times the threshold value may not have a reasonable time assigned to them in mode 7. 

Best Regards,
Mike

Begin forwarded message:

> From: Ed Jastrzembski <jastrzem at jlab.org>
> Subject: Re: Some problems with f250 algorithms?
> Date: August 27, 2015 at 6:43:00 PM EDT
> To: Michael Staib <mstaib at andrew.cmu.edu>
> Cc: hdong at jlab.org, David Lawrence <davidl at jlab.org>, William McGinley <wmcginle at andrew.cmu.edu>
> 
> Hi,
> We believe we understand the data you see.  It is a problem with the time calculation, where hits in the latter half of the window are mistakenly assigned earlier times.  It can ONLY happen (as you suggested) when V_mid is below V_threshold.  Since you set V_threshold very close to the baseline, the erroneous times can occur only for very small pulses.  We believe that the time calculation is CORRECT whenever V_mid > V_threshold.  You can use this criterion to filter your data with negligible losses.
> 
> The first event you printed out is used here to explain how this error can occur: 
> The hit in channel 6 has an integral = 2336, so based on your scatterplot it probably had an actual time of about 5200 (sample 83).  Since you allow only 1 hit, it is the earliest sample in the window that was above threshold.  V_peak = 107 is just above the threshold of 105.  Pedestal = 100, so V_mid = 103.5.  Since it is the first hit in the window, the current timing algorithm begins at sample 5 (because the pedestal uses the first 4) and continues towards the peak (sample 83) trying to find the first sample that is greater than V_mid.  If a fluctuation in the baseline occurs that is greater than V_mid, that sample defines (erroneously) the coarse time.  In this event the pulse time = 816 (sample 13), so the fluctuation occurred there.  Note that if V_mid > V_threshold, this mistaken assignment cannot occur because the baseline fluctuation would itself become the first pulse in the window.  
> 
> In retrospect, it would have been better to search backwards from the peak to find the sample with value crossing V_mid.  Hai's new timing algorithm uses this approach. 
> 
> Ed, Hai
> 
> 
> On 8/20/2015 2:04 PM, Michael Staib wrote:
>> Hi,
>> 
>> The threshold is set to 105 ADC counts, the baseline is set to be ~100 ADC counts. The firmware revision is 0x00223. This is from a run where the number of peaks reported is only one so no need to cut on that. Here is a scatter plot of the plus integral Vs Time and the same in color:
>> 
>>  
>> 
>> Most of the events that show the unusually small integrals also show a very low pulse peak, hinting towards a problem with the timing when V_mid is below V_Threshold. This plot is only events where the pedestal subtracted integral is negative:
>> 
>> 
>> 
>> Here are a few events, I can get more if you need. All of these show a pulse peak just over the threshold for the offending channel:
>> 
>> ======================================================================
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---: Parsing word: 81840101
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---:       Encountered module type: 1 (=FADC250)
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Block Header: slot=6
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Event Header: itrigger=1 (objs=0x0, last_itrigger=4294967294, rocid=38, slot=6)
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---:       9ba2a134 FADC250 Trigger Time: t=10658100
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---:       bb000920 FADC250 Pulse Integral: chan=6 pulse_number=0 sum=2336
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---:       be800862 FADC250 Pulse Integral: chan=13 pulse_number=0 sum=2146
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---:       c3000330 FADC250 Pulse Time: chan=6 pulse_number=0 pulse_time=816
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---:       d306406b FADC250 Pulse Pedestal chan=6 pulse_number=0 pedestal=100 pulse_peak=107
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---:       c68009a0 FADC250 Pulse Time: chan=13 pulse_number=0 pulse_time=2464
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---:       d686506a FADC250 Pulse Pedestal chan=13 pulse_number=0 pedestal=101 pulse_peak=106
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Event Trailer, Data not Valid, or Filler word (15)
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Block Trailer
>> Thu Aug 20 13:11:39 2015 # thr=140512417244928 # --- EVIO ---: Finished parsing (last word: 8980000c)
>> 
>> =======================================================================================
>> 
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---: Parsing word: 81840401
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       Encountered module type: 1 (=FADC250)
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Block Header: slot=6
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Event Header: itrigger=4 (objs=0x0, last_itrigger=4294967294, rocid=38, slot=6)
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       9ba3a415 FADC250 Trigger Time: t=10724373
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       bb8005f8 FADC250 Pulse Integral: chan=7 pulse_number=0 sum=1528
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       bd000aa0 FADC250 Pulse Integral: chan=10 pulse_number=0 sum=2720
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       bd80180c FADC250 Pulse Integral: chan=11 pulse_number=0 sum=6156
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       c38006e0 FADC250 Pulse Time: chan=7 pulse_number=0 pulse_time=1760
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       d386406b FADC250 Pulse Pedestal chan=7 pulse_number=0 pedestal=100 pulse_peak=107
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       c500022d FADC250 Pulse Time: chan=10 pulse_number=0 pulse_time=557
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       d506406a FADC250 Pulse Pedestal chan=10 pulse_number=0 pedestal=100 pulse_peak=106
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       c5800a8c FADC250 Pulse Time: chan=11 pulse_number=0 pulse_time=2700
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       d586706e FADC250 Pulse Pedestal chan=11 pulse_number=0 pedestal=103 pulse_peak=110
>> Thu Aug 20 13:18:02 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Block Trailer
>> 
>> =========================================================================================
>> 
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---: Parsing word: 81040501
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       Encountered module type: 1 (=FADC250)
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Block Header: slot=4
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Event Header: itrigger=5 (objs=0x0, last_itrigger=4294967294, rocid=40, slot=4)
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       9ba3eab7 FADC250 Trigger Time: t=10742455
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       ba000d10 FADC250 Pulse Integral: chan=4 pulse_number=0 sum=3344
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       c200036a FADC250 Pulse Time: chan=4 pulse_number=0 pulse_time=874
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       d206506a FADC250 Pulse Pedestal chan=4 pulse_number=0 pedestal=101 pulse_peak=106
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Block Trailer
>> 
>> =========================================================================================
>> 
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---: Parsing word: 82040501
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       Encountered module type: 1 (=FADC250)
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Block Header: slot=8
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Event Header: itrigger=5 (objs=0x0, last_itrigger=4294967294, rocid=38, slot=8)
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       9ba3eab6 FADC250 Trigger Time: t=10742454
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       ba0013b7 FADC250 Pulse Integral: chan=4 pulse_number=0 sum=5047
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       c2000240 FADC250 Pulse Time: chan=4 pulse_number=0 pulse_time=576
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       d206406a FADC250 Pulse Pedestal chan=4 pulse_number=0 pedestal=100 pulse_peak=106
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Block Trailer
>> 
>> ==========================================================================================
>> 
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---: Parsing word: 82040501
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       Encountered module type: 1 (=FADC250)
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Block Header: slot=8
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Event Header: itrigger=5 (objs=0x0, last_itrigger=4294967294, rocid=41, slot=8)
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       9ba3eab6 FADC250 Trigger Time: t=10742454
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       bb8012ef FADC250 Pulse Integral: chan=7 pulse_number=0 sum=4847
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       c38002b5 FADC250 Pulse Time: chan=7 pulse_number=0 pulse_time=693
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       d386306a FADC250 Pulse Pedestal chan=7 pulse_number=0 pedestal=99 pulse_peak=106
>> Thu Aug 20 13:20:36 2015 # thr=140512417244928 # --- EVIO ---:       FADC250 Block Trailer
>> 
>> 
>> Thanks,
>> Mike
>> 
>> On Aug 20, 2015, at 12:10 PM, Ed Jastrzembski <jastrzem at jlab.org> wrote:
>> 
>>> Hi,
>>> 
>>> Hai and I are currently discussing your results.  It would be useful if you can print out data for at least 20 of the anomalous events (e.g. integral < 4000).  (Just the channel in question, not the entire board/crate.) 
>>> 
>>> We would like to see a scatterplot of pulse integral vs time (with no cuts on time).  To make things clearer, create a 2nd such scatterplot with events that report only ONE integral and ONE time (i.e. one pulse). 
>>> 
>>> In terms of the integration:  The integration continues to NSA samples after TC.  The exception is when that would take it beyond the window end.  In that case, the integration stops at the last sample of the window.
>>> 
>>> Please give us the firmware versions of the FPGAs.
>>> 
>>> How many counts above the baseline is the threshold set?
>>>  
>>> - Ed J.
>>> 
>>> 
>>> On 8/18/2015 10:52 AM, Michael Staib wrote:
>>>> Hi Ed, Hai,
>>>> 
>>>> I have been looking at comparing some of our results in Hall D using the f250 algorithms in mode 8 and mode 7. Mode 7 is showing some peculiar behavior, particularly with respect to the integral returned from the flash algorithms. I have been looking at data where the window was 100 samples long, NSB is 5 and NSA is 55. In regions of time where I expect the full integration window to be available within the sample window, the integral of the signal is often lower than it should be. The baseline is ~100 ADC counts so the integral over the full window of 60 samples should be ~6000. I see some integral values as low as 1100 even at times when I expect 60 samples to be available. This leads me to believe one of two things is happening in the mode 7 data:
>>>> 
>>>> The integral calculation is bailing due to some condition and not returning an associated error. Does the integration window always continue to NSA after TC or can it be cut off by some condition and bail?
>>>> The time reported is wrong.
>>>> 
>>>> As for number 2, I was wondering where the search for V_mid begins in the search for the first pulse? Does it begin at the beginning of the window or does it begin NSB samples before TC? If it starts at the beginning of the window, one can imagine a problem when V_mid is less than V_threshold for small pulses coming late in the window. V_mid may occur very early while the threshold crossing was much later. I have been able to qualitatively reproduce what we are seeing below by emulating problems like 1 and 2 above using the raw data in mode 8, but it will probably be easier to track this down directly from the source. I have looked through the algorithm description document, and haven’t found the answers I am looking for.
>>>> 
>>>> Hopefully you guys have some input?
>>>> 
>>>> Thanks,
>>>> Mike Staib
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jlab.org/pipermail/halld-offline/attachments/20150828/5cd1c120/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mail Attachment.png
Type: image/png
Size: 120894 bytes
Desc: not available
URL: <https://mailman.jlab.org/pipermail/halld-offline/attachments/20150828/5cd1c120/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mail Attachment.png
Type: image/png
Size: 279565 bytes
Desc: not available
URL: <https://mailman.jlab.org/pipermail/halld-offline/attachments/20150828/5cd1c120/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mail Attachment.png
Type: image/png
Size: 103864 bytes
Desc: not available
URL: <https://mailman.jlab.org/pipermail/halld-offline/attachments/20150828/5cd1c120/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2205 bytes
Desc: not available
URL: <https://mailman.jlab.org/pipermail/halld-offline/attachments/20150828/5cd1c120/attachment-0001.p7s>


More information about the Halld-offline mailing list