[Halld-online] Changes to Df125PulseIntegral and Df250PulseIntegral

David Lawrence davidl at jlab.org
Thu Dec 4 19:49:53 EST 2014


Hi again All,

  I got a couple of e-mails expressing some confusion over my example. This comes from
my poor choice of “single_sample_ped” which maybe should have been named something
like “Nsample_ped”.  Here’s the deal:

Currently, both the f125 and f250 report a pedestal that is the average of 4 samples. Since it
is the average, it really does represent the pedestal of a single sample (thus, the name).  This
is why nsamples_pedestal is always set to “1”.

However, we have left open the possibility with the fADC125 firmware to have it report a pedestal
sum that is not actually an average, but not a straight sum either. For example, a sum of 16 samples
divided by 4. This will allow us to report the pedestal with greater precision, but still stay within
our bit budget. So, for that example, “pedestal” would represent the equivalent of 4 samples and
nsamples_pedestal would be set to “4”.  Therefore, by multiplying by the ratio of nsamples_integral
to nsamples_pedestal, we get the pedestal value that should be subtracted from the integral.

If we write the code now to handle this, then when a new firmware version is deployed in the future,
the reconstruction code won’t need to be changed and it will work with both new and old data.

I hope that makes things a little clearer. Let me know if it doesn’t.

Regards,
-David

On Dec 4, 2014, at 5:43 PM, David Lawrence <davidl at jlab.org> wrote:

> Hi All,
> 
>   I have just checked in some changes to the commissioning branch that will hopefully help
> improve the situation regarding number of samples used to calculate pedestals to be subtracted
> from integrals. These include:
> 
> 1.) Adding nsamples_integral and nsamples_pedestal fields to the Df125PulseIntegral class as
>    well as the DCDCDigiHit and DFDCCathodeDigiHit classes.
> 
> 2.) Fixed the problem where the value of samples_pedestal was always set to 4 for the Df250PulseIntegral
>    objects. Now it is set to 1.
> 
> 3.) The value of nsamples_integral in both the Df1250PulseIntegral and Df250PulseIntegral objects
>    are now set automatically to NSA_NSB iff the values came from mode7 data and a config. object
>    was found in the data stream. Otherwise, it is set to what was used in emulation so in all cases, it should
>    be valid.
> 
> 
> So, for people implementing code that performs pedestal subtraction, you should do something like
> the following:
> 
> double integral          = (double)pulse_integral->integral;
> double single_sample_ped = (double)pulse_integral->pedestal;
> double nsamples_integral = (double)pulse_integral->nsamples_integral;
> double nsamples_pedestal = (double)pulse_integral->nsamples_pedestal;
> double pedestal          = single_sample_ped * nsamples_integral/nsamples_pedestal;
> double dE = gain * (integral - pedestal);
> 
> 
> i.e. you should no longer reference the NSA_NSB from the config objects directly. This mechanism should
> work for both emulated and non-emulated pulse integral objects. Let me know if anyone sees any issues.
> 
> Regards,
> -David
> _______________________________________________
> Halld-online mailing list
> Halld-online at jlab.org
> https://mailman.jlab.org/mailman/listinfo/halld-online

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.jlab.org/pipermail/halld-online/attachments/20141204/8957afa4/attachment.html 


More information about the Halld-online mailing list