Filtering pad signals - ATTPC/ATTPCROOTv2 GitHub Wiki

The code supports filtering raw data before the pulse shape analysis task is done. This is done with the task AtFilterTask. The behavior of the filter is defined by a class that extends the interface AtFilter. This task will read the branch "AtRawEvent" and create a clone of each event in the branch "AtRawEventFiltered" filtering every non-aux pad based on the desired filter.

AtFilter interface

The interface, AtFilter that defines a filter must implement three functions

  • void Init() which is called during the Init stage of analysis
  • void Filter(Int_t *rawADC) which defines the filter's effect on the raw ADC channels in a pad
  • void Filter(Double_t *Adc) which defines the filter's effect on the baseline subtracted ADC values in a pad

While these functions must all be defined, they can be left empty. For example, if you only want to apply the filter to the raw ADC values you can make the second Filter function a no-op.

Usage

To filter data, in your analysis macro you need to

  • Create an instance of the filter you want to use and define any relevant parameters defined by that filter.
  • Create the filter task
  • Register the filter task with the analysis run
AtFilterDivide *filter = new AtFilterDivide(); //Create the filter
filter->SetDivisor(2); //Set relevant parameters
AtFilterTask *filterTask = new AtFilterTask(filter); //Create the task
filterTask->SetPersistence(true); //Set task parameters
run->AddTask(filterTask); //Add the task to the run

Implemented filters

AtFilterDivide

This filter simply divides each trace by the divisor set by the user.