ATTPCROOT
0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
|
#include <AtFilterFFT.h>
Classes | |
struct | AtFreqRange |
Public Types | |
using | FreqRanges = std::vector< AtFreqRange > |
Public Member Functions | |
AtFilterFFT ()=default | |
~AtFilterFFT ()=default | |
bool | AddFreqRange (AtFreqRange range) |
void | SetSaveTransform (bool saveTransform) |
void | SetSubtractBackground (bool subtractBackground) |
bool | GetSaveTransform () |
bool | GetSubtractBackground () |
const FreqRanges & | GetFreqRanges () |
void | DumpFactors () |
void | Init () override |
Called at the init stage of the AtFilterTask. More... | |
void | InitEvent (AtRawEvent *event=nullptr) override |
Called once for each event at the start of the Exec phase. More... | |
void | Filter (AtPad *pad, AtPadReference *padReference) override |
bool | IsGoodEvent () override |
Called at the end of an event. Returns if filtering was successful. More... | |
void | SetLowPass (int order, int cuttoff) |
![]() | |
virtual | ~AtFilter ()=default |
virtual AtRawEvent * | ConstructOutputEvent (TClonesArray *outputEventArray, AtRawEvent *inputEvent) |
Construct output event from input event array. More... | |
Protected Member Functions | |
virtual std::unique_ptr< AtPadFFT > | applyFrequencyCutsAndSetInverseFFT () |
Protected Attributes | |
FreqRanges | fFreqRanges |
std::map< Int_t, Double_t > | fFactors |
std::unique_ptr< TVirtualFFT > | fFFT {nullptr} |
std::unique_ptr< TVirtualFFT > | fFFTbackward {nullptr} |
Bool_t | fSaveTransform {false} |
Bool_t | fSubtractBackground {true} |
AtRawEvent * | fInputEvent {nullptr} |
Static Protected Attributes | |
static constexpr Int_t | fTransformSize = 512 |
Filter for applying a FFT to data, and multiplying the transformed data by some factor. The factor is determined by a series of FreqRanges that define a start and stop frequency and associated factor at the start/stop. It then linearly interpelates the factor between the two frequencies. By default the factor is 1 (i.e. no adjustment to the transformed data). For alternative behavior, extend the class and override the protected function applyFreqCuts().
The output of this filter is an AtRawEvent where the fPadList is filled with pads of the type AtPadFFT so the fourier-space representation of the filtered data is saved. If you wish to save the unfiltered data with the fourier-space represetation, the set the flag fSaveTransform and the input branch will be modified to contain AtPadFFTs.
Adam Anthony 4/20/22
Definition at line 33 of file AtFilterFFT.h.
using AtFilterFFT::FreqRanges = std::vector<AtFreqRange> |
Definition at line 45 of file AtFilterFFT.h.
|
default |
|
default |
bool AtFilterFFT::AddFreqRange | ( | AtFreqRange | range | ) |
Definition at line 39 of file AtFilterFFT.cxx.
|
protectedvirtual |
Sets the C2R (inverse) FFT after applying the frequency cuts and returns a AtPadFFT object that contains the frequency information used to set the C2R fft.
Definition at line 157 of file AtFilterFFT.cxx.
void AtFilterFFT::DumpFactors | ( | ) |
Definition at line 179 of file AtFilterFFT.cxx.
|
overridevirtual |
If save transform is set, will replace the pad in the input AtRawEvent with an AtPadFFT that stores the result of the FFT before any filtering. The output event will also contain AtPadFFTs with the transformed waveforms after the filter on magnitude has been applied. Will multiply each complex fourier component by a number defined in the frequency ranges, and store the resultant waveform in the filtered raw event.
Implements AtFilter.
Definition at line 81 of file AtFilterFFT.cxx.
|
inline |
Definition at line 72 of file AtFilterFFT.h.
|
inline |
Definition at line 69 of file AtFilterFFT.h.
|
inline |
Definition at line 70 of file AtFilterFFT.h.
|
overridevirtual |
Called at the init stage of the AtFilterTask.
Implements AtFilter.
Definition at line 56 of file AtFilterFFT.cxx.
|
overridevirtual |
Called once for each event at the start of the Exec phase.
Implements AtFilter.
Definition at line 69 of file AtFilterFFT.cxx.
|
inlineoverridevirtual |
Called at the end of an event. Returns if filtering was successful.
Implements AtFilter.
Definition at line 78 of file AtFilterFFT.h.
void AtFilterFFT::SetLowPass | ( | int | order, |
int | cuttoff | ||
) |
Definition at line 18 of file AtFilterFFT.cxx.
|
inline |
Definition at line 66 of file AtFilterFFT.h.
|
inline |
Definition at line 67 of file AtFilterFFT.h.
|
protected |
Definition at line 49 of file AtFilterFFT.h.
|
protected |
Definition at line 51 of file AtFilterFFT.h.
|
protected |
Definition at line 52 of file AtFilterFFT.h.
|
protected |
Definition at line 48 of file AtFilterFFT.h.
|
protected |
Definition at line 57 of file AtFilterFFT.h.
|
protected |
Definition at line 54 of file AtFilterFFT.h.
|
protected |
Definition at line 55 of file AtFilterFFT.h.
|
staticconstexprprotected |
Definition at line 59 of file AtFilterFFT.h.