MantisBT - Hall D Offline
View Issue Details
0000430Hall D OfflineGeneralpublic2014-12-03 16:142014-12-04 20:08
davidl 
davidl 
normalminoralways
resolvedfixed 
0000430: Number of pedestal samples reported by emulation is 4 when it should be 1
It appears that the number of samples being reported in the Digi Hit objects when generated from emulated data is 4 when it should be 1. Simon pointed this out when looking at ST data.
No tags attached.
Issue History
2014-12-03 16:14davidlNew Issue
2014-12-04 20:08davidlNote Added: 0000622
2014-12-04 20:08davidlStatusnew => resolved
2014-12-04 20:08davidlResolutionopen => fixed
2014-12-04 20:08davidlAssigned To => davidl

Notes
(0000622)
davidl   
2014-12-04 20:08   
This was fixed in svn revision 16752. Here is the e-mail announcing it:

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