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

Abstract base class for getting current through deconvolution. More...

#include <AtPSADeconv.h>

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

Classes

struct  ZHitData
 Struct for storing Z and Q hit data used by getZandQ function. More...
 

Public Member Functions

 AtPSADeconv ()
 
 AtPSADeconv (AtPSADeconv &&obj)=default
 
AtPSADeconvoperator= (AtPSADeconv &&obj)=default
 
 AtPSADeconv (const AtPSADeconv &obj)
 
 ~AtPSADeconv ()=default
 
virtual std::unique_ptr< AtPSAClone () override
 
virtual HitVector AnalyzePad (AtPad *pad) override
 
void SetFilterOrder (int order)
 
void SetCutoffFreq (int freq)
 
void SetUseSimCharge (bool val)
 
int GetFilterOrder ()
 
int GetCutoffFreq ()
 
void SetResponse (AtRawEvent response)
 
void SetResponse (ResponseFunc response)
 
AtPadGetResponse (int padNum)
 Get the AtPad describing the response of the electronics. More...
 
const AtPadFFTGetResponseFFT (int padNum)
 Get the fourier transform describing the response of the electronics. More...
 
const AtPadFFTGetResponseFilter (int padNum)
 Get the filter in fourier space describing the response of the electronics. More...
 
- Public Member Functions inherited from AtPSA
 AtPSA ()=default
 
virtual ~AtPSA ()=default
 
virtual void Init ()
 
void SetThreshold (Int_t threshold)
 
void SetThresholdLow (Int_t thresholdlow)
 
int GetThreshold ()
 
int GetThresholdLow ()
 
void SetSimulatedEvent (TClonesArray *MCSimPointArray)
 
AtEvent Analyze (AtRawEvent &rawEvent)
 
virtual void Analyze (AtRawEvent *rawEvent, AtEvent *event)
 

Protected Types

using ResponseFunc = std::function< double(int, double)>
 
using HitData = std::vector< ZHitData >
 Data structure for Z loc (TB), Z variance (TB), Charge (arb), Charge variance (arb) More...
 
- Protected Types inherited from AtPSA
using HitVector = std::vector< std::unique_ptr< AtHit > >
 

Protected Member Functions

AtPadcreateResponsePad (int padNum)
 
virtual HitVector chargeToHits (AtPad &charge, std::string qName)
 
virtual HitData getZandQ (const AtPad::trace &charge)
 
virtual double getZhitVariance (double zLoc, double zLocVar) const override
 
void initFFTs ()
 
void initFilter ()
 Update all "filter" augments in fEventResponse with the new parameters. More...
 
void updateFilter (const AtPadFFT &fft, AtPadFFT *filter)
 
double getFilterKernel (int freq)
 
HitVector AnalyzeFFTpad (AtPad &pad)
 Assumes that the pad has it's fourier transform information filled. More...
 
- Protected Member Functions inherited from AtPSA
void TrackMCPoints (std::multimap< Int_t, std::size_t > &map, AtHit &hit)
 
Double_t CalculateZ (Double_t peakIdx)
 Calculate z position in mm using the peak index. More...
 
Double_t CalculateZGeo (Double_t peakIdx)
 
Double_t getThreshold (int padSize=-1)
 
virtual std::pair< double, double > getXYhitVariance () const
 

Protected Attributes

AtRawEvent fEventResponse
 
ResponseFunc fResponse {nullptr}
 
std::unique_ptr< TVirtualFFT > fFFT {nullptr}
 
std::unique_ptr< TVirtualFFT > fFFTbackward {nullptr}
 
int fFilterOrder {0}
 
int fCutoffFreq {-1}
 
bool fUseSimulatedCharge {false}
 
- Protected Attributes inherited from AtPSA
TClonesArray * fMCSimPointArray {}
 
Bool_t fUsingLowThreshold {false}
 
Double_t fBField {}
 
Double_t fEField {}
 
Int_t fTB0 {}
 
Int_t fNumTbs {512}
 
Int_t fTBTime {}
 
Int_t fEntTB {}
 
Double_t fDriftVelocity {}
 
Double_t fZk {}
 

Detailed Description

Abstract base class for getting current through deconvolution.

This PSA method calculates the charge collected over a pad. It operates as a base class where specific PSA methods can be implemented on top of this class to convert the current into hits in 3D space.

Mathmatically what this class does is take in an electronic response function r(TB), and stores the FFT of that response function R(k). For the trace recorded in each pad s(TB), we then calculate the FFT of that trace S(k), and divide by R(k). We then apply a low-pass Buttersworth filter of even order n with cuttoff frequency w_c (both specified by the user). This, transformed back into the time domain, should give the input current over the pad.

It saves the reconstruced charge as an augment (AtPadArray with name "Qreco") to the pad in the input event

Author
A.K. Anthony

Definition at line 38 of file AtPSADeconv.h.

Member Typedef Documentation

◆ HitData

using AtPSADeconv::HitData = std::vector<ZHitData>
protected

Data structure for Z loc (TB), Z variance (TB), Charge (arb), Charge variance (arb)

Definition at line 109 of file AtPSADeconv.h.

◆ ResponseFunc

using AtPSADeconv::ResponseFunc = std::function<double(int, double)>
protected

Definition at line 41 of file AtPSADeconv.h.

Constructor & Destructor Documentation

◆ AtPSADeconv() [1/3]

AtPSADeconv::AtPSADeconv ( )

Definition at line 28 of file AtPSADeconv.cxx.

◆ AtPSADeconv() [2/3]

AtPSADeconv::AtPSADeconv ( AtPSADeconv &&  obj)
default

◆ AtPSADeconv() [3/3]

AtPSADeconv::AtPSADeconv ( const AtPSADeconv obj)

Definition at line 33 of file AtPSADeconv.cxx.

◆ ~AtPSADeconv()

AtPSADeconv::~AtPSADeconv ( )
default

Member Function Documentation

◆ AnalyzeFFTpad()

AtPSADeconv::HitVector AtPSADeconv::AnalyzeFFTpad ( AtPad pad)
protected

Assumes that the pad has it's fourier transform information filled.

Definition at line 176 of file AtPSADeconv.cxx.

◆ AnalyzePad()

AtPSADeconv::HitVector AtPSADeconv::AnalyzePad ( AtPad pad)
overridevirtual

Implements AtPSA.

Reimplemented in AtPSAIterDeconv.

Definition at line 216 of file AtPSADeconv.cxx.

◆ chargeToHits()

AtPSADeconv::HitVector AtPSADeconv::chargeToHits ( AtPad charge,
std::string  qName 
)
protectedvirtual

Takes a pad with charge information and returns a list of hits to add to the event.

Definition at line 235 of file AtPSADeconv.cxx.

◆ Clone()

virtual std::unique_ptr<AtPSA> AtPSADeconv::Clone ( )
inlineoverridevirtual

Implements AtPSA.

Reimplemented in AtPSADeconvFit.

Definition at line 73 of file AtPSADeconv.h.

◆ createResponsePad()

AtPad * AtPSADeconv::createResponsePad ( int  padNum)
protected

Definition at line 135 of file AtPSADeconv.cxx.

◆ GetCutoffFreq()

int AtPSADeconv::GetCutoffFreq ( )
inline

Definition at line 81 of file AtPSADeconv.h.

◆ getFilterKernel()

double AtPSADeconv::getFilterKernel ( int  freq)
protected
Parameters
[in]freqThe frequency compnent
Returns
The kernel of the low pass filter as set at that frequency
Todo:
: Precompute once and save with the transformed response function

Definition at line 155 of file AtPSADeconv.cxx.

◆ GetFilterOrder()

int AtPSADeconv::GetFilterOrder ( )
inline

Definition at line 80 of file AtPSADeconv.h.

◆ GetResponse()

AtPad & AtPSADeconv::GetResponse ( int  padNum)

Get the AtPad describing the response of the electronics.

If the pad is not in fEventResponse it will be added.

Definition at line 70 of file AtPSADeconv.cxx.

◆ GetResponseFFT()

const AtPadFFT & AtPSADeconv::GetResponseFFT ( int  padNum)

Get the fourier transform describing the response of the electronics.

If the pad is not in fEventResponse it will be added, and if needed the fft will be calcualted and added as an augment with the name "fft".

Definition at line 86 of file AtPSADeconv.cxx.

◆ GetResponseFilter()

const AtPadFFT & AtPSADeconv::GetResponseFilter ( int  padNum)

Get the filter in fourier space describing the response of the electronics.

If the pad is not in fEventResponse it will be added, and if needed the fft and filter will be calculated and added as augments with the names "fft" and "filter", respectivley.

Definition at line 109 of file AtPSADeconv.cxx.

◆ getZandQ()

AtPSADeconv::HitData AtPSADeconv::getZandQ ( const AtPad::trace charge)
protectedvirtual

Returns the salient data from the charge distribution: Hit charge/location in Z and their std. deviation. Called by chargeToHits. By default it returns the weighted average of the charge and it's variance.

Reimplemented in AtPSADeconvFit.

Definition at line 263 of file AtPSADeconv.cxx.

◆ getZhitVariance()

double AtPSADeconv::getZhitVariance ( double  zLoc,
double  zLocVar 
) const
overrideprotectedvirtual

Returns a vector populated with the variance of the hit according the the diffusion coefficients in the parameter file.

Parameters
[in]zLocLocation of hit in TB
[in]zLocVarVariance of hit in TB^2
Returns
variance of hit location in mm^2
Todo:
Implement the function so it doesn't return all zeros...

Reimplemented from AtPSA.

Definition at line 285 of file AtPSADeconv.cxx.

◆ initFFTs()

void AtPSADeconv::initFFTs ( )
protected

Definition at line 54 of file AtPSADeconv.cxx.

◆ initFilter()

void AtPSADeconv::initFilter ( )
protected

Update all "filter" augments in fEventResponse with the new parameters.

Definition at line 165 of file AtPSADeconv.cxx.

◆ operator=()

AtPSADeconv& AtPSADeconv::operator= ( AtPSADeconv &&  obj)
default

◆ SetCutoffFreq()

void AtPSADeconv::SetCutoffFreq ( int  freq)

Definition at line 48 of file AtPSADeconv.cxx.

◆ SetFilterOrder()

void AtPSADeconv::SetFilterOrder ( int  order)

Definition at line 40 of file AtPSADeconv.cxx.

◆ SetResponse() [1/2]

void AtPSADeconv::SetResponse ( AtRawEvent  response)
inline

Copy an AtRawEvent to use as the response function. If the pad number requested does not exist in the AtRawEvent it will use the callable object stored in fResponse.

Definition at line 87 of file AtPSADeconv.h.

◆ SetResponse() [2/2]

void AtPSADeconv::SetResponse ( ResponseFunc  response)
inline

Response function to use if the AtRawEvent representation of the response function does not contain the pad we are looking for. When this is used to get the response function, it is cached in the internal fEventResponse.

Definition at line 93 of file AtPSADeconv.h.

◆ SetUseSimCharge()

void AtPSADeconv::SetUseSimCharge ( bool  val)
inline

Definition at line 78 of file AtPSADeconv.h.

◆ updateFilter()

void AtPSADeconv::updateFilter ( const AtPadFFT fft,
AtPadFFT filter 
)
protected

Definition at line 122 of file AtPSADeconv.cxx.

Member Data Documentation

◆ fCutoffFreq

int AtPSADeconv::fCutoffFreq {-1}
protected

Definition at line 63 of file AtPSADeconv.h.

◆ fEventResponse

AtRawEvent AtPSADeconv::fEventResponse
protected

AtRawEvent holding the response function and filter for every pad. If there is only a single response being used for the entire detector, than always use pad 0.

Each pad in this event must have two augments. An AtPadFFT of the name "fft" which holds the FFT of the response, and an AtPadFFT with the name "filter" which holds the FFT of the response multiplied by the low pass filter in use. When a pad is accessed, it will check for the existance of these two augments and add them if necessary.

Definition at line 52 of file AtPSADeconv.h.

◆ fFFT

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

Definition at line 59 of file AtPSADeconv.h.

◆ fFFTbackward

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

Definition at line 60 of file AtPSADeconv.h.

◆ fFilterOrder

int AtPSADeconv::fFilterOrder {0}
protected

Definition at line 62 of file AtPSADeconv.h.

◆ fResponse

ResponseFunc AtPSADeconv::fResponse {nullptr}
protected

Callable object representing the response function of the detecotor. Will be used to fill fEventResponse if the pad does not already exist within that event.

Definition at line 57 of file AtPSADeconv.h.

◆ fUseSimulatedCharge

bool AtPSADeconv::fUseSimulatedCharge {false}
protected

Definition at line 64 of file AtPSADeconv.h.


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