-
Notifications
You must be signed in to change notification settings - Fork 14
Filtering pad signals
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.
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.
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
This filter simply divides each trace by the divisor set by the user.