f) L2pedAlgo (barrel and endcap pedestal monitor)


This algorithm records the ADC values from the ETOW and BTOW for pedestal studies.

This algorithm reads in 5 ints from run control:

[i0] ped subtraction flag

[i1] speed factor

[i2] 'save binary' flag

[i3] debug

[i4] prescale for accept


The logic used is as follows:

Each event, ADCs from 1/i1 (where i1 is rounded off to be 1,2,4,8,16,32,64, or 192) of the barrel and endcap are histogrammed by rdo.  The selected regions roll, so that [0,1/i1] is histogrammed the first event, [1/i1,2/i1] the next, etc.

If i0>0, instead of histogramming the raw ADC, the pedestal is subtracted first, allowing the residual to be seen.

if i2>0 the entire histogram is saved at the end of the run rather than just keeping [-10,100] ADC.

If the prescale for accept is set greater than zero, then the algorithm no longer fills histograms, and simply does the following for every event:

    if((rand()>>4) % par_prescAccept ) return false;

    return true;

This is NOT the same as the procedure for the Random Accept Prescale.

If debug>0 debug messages are printed.