ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
AtFilterFFT Class Reference

#include <AtFilterFFT.h>

Inheritance diagram for AtFilterFFT:
Inheritance graph
[legend]
Collaboration diagram for AtFilterFFT:
Collaboration graph
[legend]

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 FreqRangesGetFreqRanges ()
 
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)
 
- Public Member Functions inherited from AtFilter
virtual ~AtFilter ()=default
 
virtual AtRawEventConstructOutputEvent (TClonesArray *outputEventArray, AtRawEvent *inputEvent)
 Construct output event from input event array. More...
 

Protected Member Functions

virtual std::unique_ptr< AtPadFFTapplyFrequencyCutsAndSetInverseFFT ()
 

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}
 
AtRawEventfInputEvent {nullptr}
 

Static Protected Attributes

static constexpr Int_t fTransformSize = 512
 

Detailed Description

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.

Member Typedef Documentation

◆ FreqRanges

using AtFilterFFT::FreqRanges = std::vector<AtFreqRange>

Definition at line 45 of file AtFilterFFT.h.

Constructor & Destructor Documentation

◆ AtFilterFFT()

AtFilterFFT::AtFilterFFT ( )
default

◆ ~AtFilterFFT()

AtFilterFFT::~AtFilterFFT ( )
default

Member Function Documentation

◆ AddFreqRange()

bool AtFilterFFT::AddFreqRange ( AtFreqRange  range)

Definition at line 39 of file AtFilterFFT.cxx.

◆ applyFrequencyCutsAndSetInverseFFT()

std::unique_ptr< AtPadFFT > AtFilterFFT::applyFrequencyCutsAndSetInverseFFT ( )
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.

◆ DumpFactors()

void AtFilterFFT::DumpFactors ( )

Definition at line 179 of file AtFilterFFT.cxx.

◆ Filter()

void AtFilterFFT::Filter ( AtPad pad,
AtPadReference padReference 
)
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.

◆ GetFreqRanges()

const FreqRanges& AtFilterFFT::GetFreqRanges ( )
inline

Definition at line 72 of file AtFilterFFT.h.

◆ GetSaveTransform()

bool AtFilterFFT::GetSaveTransform ( )
inline

Definition at line 69 of file AtFilterFFT.h.

◆ GetSubtractBackground()

bool AtFilterFFT::GetSubtractBackground ( )
inline

Definition at line 70 of file AtFilterFFT.h.

◆ Init()

void AtFilterFFT::Init ( )
overridevirtual

Called at the init stage of the AtFilterTask.

Implements AtFilter.

Definition at line 56 of file AtFilterFFT.cxx.

◆ InitEvent()

void AtFilterFFT::InitEvent ( AtRawEvent inputEvent = nullptr)
overridevirtual

Called once for each event at the start of the Exec phase.

Implements AtFilter.

Definition at line 69 of file AtFilterFFT.cxx.

◆ IsGoodEvent()

bool AtFilterFFT::IsGoodEvent ( )
inlineoverridevirtual

Called at the end of an event. Returns if filtering was successful.

Implements AtFilter.

Definition at line 78 of file AtFilterFFT.h.

◆ SetLowPass()

void AtFilterFFT::SetLowPass ( int  order,
int  cuttoff 
)

Definition at line 18 of file AtFilterFFT.cxx.

◆ SetSaveTransform()

void AtFilterFFT::SetSaveTransform ( bool  saveTransform)
inline

Definition at line 66 of file AtFilterFFT.h.

◆ SetSubtractBackground()

void AtFilterFFT::SetSubtractBackground ( bool  subtractBackground)
inline

Definition at line 67 of file AtFilterFFT.h.

Member Data Documentation

◆ fFactors

std::map<Int_t, Double_t> AtFilterFFT::fFactors
protected

Definition at line 49 of file AtFilterFFT.h.

◆ fFFT

std::unique_ptr<TVirtualFFT> AtFilterFFT::fFFT {nullptr}
protected

Definition at line 51 of file AtFilterFFT.h.

◆ fFFTbackward

std::unique_ptr<TVirtualFFT> AtFilterFFT::fFFTbackward {nullptr}
protected

Definition at line 52 of file AtFilterFFT.h.

◆ fFreqRanges

FreqRanges AtFilterFFT::fFreqRanges
protected

Definition at line 48 of file AtFilterFFT.h.

◆ fInputEvent

AtRawEvent* AtFilterFFT::fInputEvent {nullptr}
protected

Definition at line 57 of file AtFilterFFT.h.

◆ fSaveTransform

Bool_t AtFilterFFT::fSaveTransform {false}
protected

Definition at line 54 of file AtFilterFFT.h.

◆ fSubtractBackground

Bool_t AtFilterFFT::fSubtractBackground {true}
protected

Definition at line 55 of file AtFilterFFT.h.

◆ fTransformSize

constexpr Int_t AtFilterFFT::fTransformSize = 512
staticconstexprprotected

Definition at line 59 of file AtFilterFFT.h.


The documentation for this class was generated from the following files: