Pixie16 Analysis Software Suite
Analysis code for processing of .ldf files
Event Processing - DetectorDriver

This page describes the aspects of DetectorDriver.cpp used for the RawEvent which remain consistent between experiments and includes five different main functions

  • Init() - initialize the detector driver
  • ProcessEvent() - processes a complete event passed from ScanList()
  • ThreshAndCal() - check threshold and calibrate the raw channel energies
  • PlotRaw() - plot raw experimental energies
  • PlotCal() - plot calibrated energies

Initialization

The DetectorDriver initialization routine (DetectorDriver::Init()) is called with the detector types that have been identified from the event. It then initializes the necessary Analyzers and Processors, reads in the energy Calibration and the Walk correction, and finally initializes the Correlator. The Init methods for the Analyzers and Processors are contained in their own codes.

ReadCal

The calibrations are read in during the detector driver initialization (DetectorDriver::ReadCal()) from the file Config.xml. Please see XML Based Configuration File Configuration for detailed information.

For each channel with a calibration the type of calibration, and the calibration parameters are read. They are then added to the list of calibrations. If there is no calibration, then any calls for this channel to calibrate the energy returns the energy.

ProcessEvent

ProcessEvent() accesses the global RawEvent and processes it. It first plots the raw and calibrated energy along with performing the calibration and threshold. It then performs two loops over the data.

The first loop is the PreProcees loop. This loop will call the PreProcess method for each of the used processors. The work done in the PreProcess methods should not depend on the results of other Processors.

The second loop calls the main "Process" method for each of the Processors. The work done in these methods may depend on the results from other Processors. This is where the main work of the Processors will be done.

ThreshAndCal

ThreshAndCal() receives a pointer to the current channel event. It then proceeds to set values that are calculated from the traces (qdc, phase, etc.). This is also the point at which the energyContraction is applied to the energies. Finally, it applies the energy calibration and walk corrections.

Trace

If a trace is included with the channel object then the trace analysis is invoked through the TraceAnalyzer.

PlotRaw

The raw energy from the channel is plotted into the appropriate damm spectra as long as it was created in DeclareHistogram.cpp

PlotCal

The calibrated energy from the channel is plotted into the appropriate damm spectrum if it was created in DeclareHistogram.cpp