• No results found

Chapter 3 Detector Design and Construction

3.9 Data Processing Tools

The binary data written to disk by the primary DAQ system is in either 8 bit or 12 bit format. In the binary files, the pulses are written back to back, so it is necessary to know what the sampling window from the DAQ was in order to correctly separate the binary file into pulses. In the first data processing programme, the data is first split into pulses, and each pulse waveform is converted into a ROOT [108] TH1I object, with one histogram bin per sample. The TH1I histograms form a branch of a TTree. If two channels are being simultaneously written to disk, the histograms are sorted into separate branches. Since the amplitude of the pulses is all relative to the number of bits (256 bins, or 4096 bins), the amplitude is scaled to the range on the DAQ system, which makes the amplitude scale comparable between different sampling ranges. This code also has the functionality to reverse the polarity of the pulses, for ease of analysis.

In the second data processing programme the ROOT histograms are used to calculate characteristic parameters of each pulse. Firstly, the pulses are smoothed, using a moving average filter. Since the first and last few bins cannot be averaged, they are flagged as being unsmoothed. Different pulse parameters are calculated de- pending on whether the input pulses are from a charge or voltage-sensitive preampli- fier, since the parameters have different physical meanings in each case (see section 2.3.5).

Firstly the baseline is calculated, by averaging the first 5% of the sampling window, excluding the initial unsmoothed bins. If the baseline is higher than a defined threshold, the pulse is flagged as a failed pulse.

The highest value bin in the sample is taken to be the position, and the pulse amplitude is calculated by subtracting its value from the baseline. If this is in the unsmoothed bins, it is flagged up as a failed pulse, similarly if the amplitude is very small, this is flagged as having low signal to noise.

For multiple channels, the amplitude values are added together to make a summed-amplitude parameter.

The onset of the pulse is the first bin which has 30% of the amplitude of the pulse. The risetime is then calculated as the time between 30% and 70% of the pulse height. If the onset is found to be after the position, this is flagged as a failed pulse.

The decay time of the pulse is taken as the time between the position of the pulse, and the bin at which the value equals twice the exponential decay time: amplitude×e−2.

For charge pulses, the average induced voltage can be calculated, by calcu- lating the gradient of the risetime.

For voltage pulses, the integral of the pulse can be calculated, which is equal to the charge collected, for some types of voltage preamplifier as discussed in section 2.3.5. This is the sum of all of the bins between the onset and the end of the decaytime. Where the integral of the pulse is negative, the pulse is flagged as a failed pulse. As mentioned previously, this code has been developed to deal with a single polarity of pulse - inversion is possible in the primary conversion stage, if necessary. The risetime of the charge is also calculated, as the sum of all of the bins between the onset and the position.

In spite of some of these parameters having no physical meaning with respect to the output of the different preamplifiers, they can be useful for differentiating between pulse populations.

These parameters are calculated for each pulse, and the values put into pa- rameter histograms in a branch of a TTree object. For multiple channels, the pa- rameter histograms are all in the same branch, but are labelled according to channel (i.e. baseline0, baseline1). This is the most logical structure to incorporate multi pulse cuts and the summed amplitude parameter in the two channel case, although for larger numbers of channels it would be better to have a tree for each channel and use a TFriend object to link the trees.

The pulse waveform data output from the initial data processing programme is also included in this histogram, which makes it possible to view pulses after cuts have been applied, and visually identify the characteristics of different pulse populations.

The waveform pulses, and the parameter histograms are viewed and analysed using ROOT. A summary of the functions of these parameters is shown in table 3.5. In addition to the parameter calculation, a pulse fitter has been applied

from a data sample, containing any number of different pulse populations. The pulse template is created by applying harsh cuts to a data sample to select a small number of pulses with the desired appearance.

This fitter code takes a ROOT file containing a TTree of TH1I template pulse histograms, and averages these to create a pulse template. It then takes the ROOT file containing TH1I data pulse histograms, and relates each data pulse to the template pulse, and outputting the fit parameters, as described below.

For each TH1I pulse, the fitter iteratively compares the template. The scale factor for the amplitude of the pulse is determined, using a least-squares fit. The scale factor, and the mean square deviation from the template are the fitter results. In the context of pulse comparison, the logarithm of the deviation from the pulse template is more useful, therefore it is calculated and output. Vector objects are filled with the pulse values for each of the outputs, which are stored in a TNtupleD. These two parameters are examined alongside the parameter histograms de- scribed above, and used for making data cuts. A summary of the pulse fitter outputs is included in table 3.5.

Table 3.5: The calculated pulse parameters, and their functions.

Parameter Description Charge or Voltage

baseline average of first 5% of sampling window (excluding unsmoothed bins)

Charge and Voltage amplitude value of highest value bin with baseline

subtracted

Charge and Voltage summedamplitude amplitude of all channels summed Charge and Voltage position bin number of highest value bin Charge and Voltage

onset first bin number at which value is 30% of amplitude

Charge and Voltage risetime number of bins between and the bins with

30% (onset) and 70% of amplitude

Charge and Voltage decaytime number of bins before the bin value is

amplitude e2 .

Charge and Voltage chargeamplitude sum of values of all of the bins between

onset and bin with height amplitudee2 .

Voltage chargerisetime sum of values of all bins between onset and

end of risetime

Voltage

voltage the gradient of the risetime Charge

failflag present (1) for bad pulses with: high baseline

low amplitude to baseline ratio position in unsmoothed bins position before onset

0 value otherwise

Charge and Voltage

scaleresult the pulse fitter scale result Charge and Voltage logms the log mean square deviation of the pulse

from the template