musrfit  1.9.2
PFourier Class Reference

#include <PFourier.h>

Public Member Functions

 PFourier (TH1F *data, Int_t unitTag, Double_t startTime=0.0, Double_t endTime=0.0, Bool_t dcCorrected=false, UInt_t zeroPaddingPower=0)
 
virtual ~PFourier ()
 
virtual void Transform (UInt_t apodizationTag=0)
 
virtual const char * GetDataTitle ()
 
virtual const Int_t GetUnitTag ()
 
virtual Double_t GetResolution ()
 
virtual Double_t GetMaxFreq ()
 
virtual TH1F * GetRealFourier (const Double_t scale=1.0)
 
virtual TH1F * GetImaginaryFourier (const Double_t scale=1.0)
 
virtual TH1F * GetPowerFourier (const Double_t scale=1.0)
 
virtual TH1F * GetPhaseFourier (const Double_t scale=1.0)
 
virtual Bool_t IsValid ()
 

Static Public Member Functions

static TH1F * GetPhaseOptRealFourier (const TH1F *re, const TH1F *im, std::vector< Double_t > &phase, const Double_t scale=1.0, const Double_t min=-1.0, const Double_t max=-1.0)
 

Private Member Functions

virtual void PrepareFFTwInputData (UInt_t apodizationTag)
 
virtual void ApodizeData (Int_t apodizationTag)
 

Private Attributes

TH1F * fData
 data histogram to be Fourier transformed. More...
 
Bool_t fValid
 true = all boundary conditions fullfilled and hence a Fourier transform can be performed. More...
 
Int_t fUnitTag
 1=Field Units (G), 2=Field Units (T), 3=Frequency Units (MHz), 4=Angular Frequency Units (Mc/s) More...
 
Int_t fApodization
 0=none, 1=weak, 2=medium, 3=strong More...
 
Double_t fTimeResolution
 time resolution of the data histogram in (us) More...
 
Double_t fStartTime
 start time of the data histogram More...
 
Double_t fEndTime
 end time of the data histogram More...
 
Bool_t fDCCorrected
 if true, removed DC offset from signal before Fourier transformation, otherwise not More...
 
UInt_t fZeroPaddingPower
 power for zero padding, if set < 0 no zero padding will be done More...
 
Double_t fResolution
 Fourier resolution (field, frequency, or angular frequency) More...
 
UInt_t fNoOfData
 number of bins in the time interval between fStartTime and fStopTime More...
 
UInt_t fNoOfBins
 number of bins to be Fourier transformed. Might be different to fNoOfData due to zero padding More...
 
fftw_plan fFFTwPlan
 fftw plan (see FFTW3 User Manual) More...
 
fftw_complex * fIn
 real part of the Fourier transform More...
 
fftw_complex * fOut
 imaginary part of the Fourier transform More...
 

Detailed Description

muSR Fourier class.

Definition at line 97 of file PFourier.h.

Constructor & Destructor Documentation

◆ PFourier()

PFourier::PFourier ( TH1F *  data,
Int_t  unitTag,
Double_t  startTime = 0.0,
Double_t  endTime = 0.0,
Bool_t  dcCorrected = false,
UInt_t  zeroPaddingPower = 0 
)

Constructor.

Parameters
datadata histogram
unitTagtag telling in which units the Fourier transform shall be represented. Possible tags are: FOURIER_UNIT_GAUSS, FOURIER_UNIT_TESLA, FOURIER_UNIT_FREQ, FOURIER_UNIT_CYCLES
startTimestart time of the data time window
endTimeend time of the data time window
dcCorrectedif true, removed DC offset from signal before Fourier transformation, otherwise not
zeroPaddingPowerif set to values > 0, there will be zero padding up to 2^zeroPaddingPower

Definition at line 284 of file PFourier.cpp.

References F_APODIZATION_NONE, fApodization, fData, fEndTime, fFFTwPlan, fIn, fNoOfBins, fNoOfData, FOURIER_UNIT_CYCLES, FOURIER_UNIT_FREQ, FOURIER_UNIT_GAUSS, FOURIER_UNIT_TESLA, fOut, fResolution, fStartTime, fTimeResolution, fUnitTag, fValid, fZeroPaddingPower, GAMMA_BAR_MUON, and PI.

◆ ~PFourier()

PFourier::~PFourier ( )
virtual

Destructor

Definition at line 377 of file PFourier.cpp.

References fFFTwPlan, fIn, and fOut.

Member Function Documentation

◆ ApodizeData()

void PFourier::ApodizeData ( Int_t  apodizationTag)
privatevirtual

Carries out the appodization of the data.

Parameters
apodizationTagapodization tag. Possible are currently: F_APODIZATION_NONE = no apodization, F_APODIZATION_WEAK = weak apodization, F_APODIZATION_MEDIUM = intermediate apodization, F_APODIZATION_STRONG = strong apodization

Definition at line 788 of file PFourier.cpp.

References F_APODIZATION_MEDIUM, F_APODIZATION_NONE, F_APODIZATION_STRONG, F_APODIZATION_WEAK, fIn, and fNoOfData.

Referenced by PrepareFFTwInputData().

◆ GetDataTitle()

virtual const char* PFourier::GetDataTitle ( )
inlinevirtual

Definition at line 107 of file PFourier.h.

References fData.

◆ GetImaginaryFourier()

TH1F * PFourier::GetImaginaryFourier ( const Double_t  scale = 1.0)
virtual

returns the imaginary part Fourier as a histogram.

Parameters
scalenormalisation factor

Definition at line 594 of file PFourier.cpp.

References fData, fNoOfBins, fOut, fResolution, and fValid.

Referenced by PMusrCanvas::HandleDifferenceFourier(), and PMusrCanvas::HandleFourier().

◆ GetMaxFreq()

Double_t PFourier::GetMaxFreq ( )
virtual

returns the maximal frequency in units choosen, i.e. Gauss, Tesla, MHz, Mc/s

Definition at line 433 of file PFourier.cpp.

References fNoOfBins, and fResolution.

◆ GetPhaseFourier()

TH1F * PFourier::GetPhaseFourier ( const Double_t  scale = 1.0)
virtual

returns the Fourier phase spectrum as a histogram.

Parameters
scalenormalisation factor

Definition at line 678 of file PFourier.cpp.

References fData, fNoOfBins, fOut, fResolution, fValid, PI, and PI_HALF.

Referenced by PMusrCanvas::HandleDifferenceFourier(), and PMusrCanvas::HandleFourier().

◆ GetPhaseOptRealFourier()

TH1F * PFourier::GetPhaseOptRealFourier ( const TH1F *  re,
const TH1F *  im,
std::vector< Double_t > &  phase,
const Double_t  scale = 1.0,
const Double_t  min = -1.0,
const Double_t  max = -1.0 
)
static

returns the phase corrected real Fourier transform.

Returns
the TH1F histo of the phase 'optimzed' real Fourier transform.
Parameters
rereal part Fourier histogram
imimaginary part Fourier histogram
phasereturn value of the optimal phase dispersion phase[0]+phase[1]*i/N
scalenormalisation factor
minminimal freq / field from which to optimise. Given in the choosen unit.
maxmaximal freq / field up to which to optimise. Given in the choosen unit.

Definition at line 500 of file PFourier.cpp.

References PFTPhaseCorrection::GetPhaseCorrectionParam(), PFTPhaseCorrection::IsValid(), and PFTPhaseCorrection::Minimize().

Referenced by PMusrCanvas::CalcPhaseOptReFT().

◆ GetPowerFourier()

TH1F * PFourier::GetPowerFourier ( const Double_t  scale = 1.0)
virtual

returns the Fourier power spectrum as a histogram.

Parameters
scalenormalisation factor

Definition at line 636 of file PFourier.cpp.

References fData, fNoOfBins, fOut, fResolution, and fValid.

Referenced by PMusrCanvas::HandleDifferenceFourier(), and PMusrCanvas::HandleFourier().

◆ GetRealFourier()

TH1F * PFourier::GetRealFourier ( const Double_t  scale = 1.0)
virtual

returns the real part Fourier as a histogram.

Parameters
scalenormalisation factor

Definition at line 452 of file PFourier.cpp.

References fData, fNoOfBins, fOut, fResolution, and fValid.

Referenced by PMusrCanvas::HandleDifferenceFourier(), and PMusrCanvas::HandleFourier().

◆ GetResolution()

virtual Double_t PFourier::GetResolution ( )
inlinevirtual

Definition at line 109 of file PFourier.h.

References fResolution.

◆ GetUnitTag()

virtual const Int_t PFourier::GetUnitTag ( )
inlinevirtual

Definition at line 108 of file PFourier.h.

References fUnitTag.

◆ IsValid()

virtual Bool_t PFourier::IsValid ( )
inlinevirtual

Definition at line 120 of file PFourier.h.

References fValid.

Referenced by PMusrCanvas::HandleDifferenceFourier(), and PMusrCanvas::HandleFourier().

◆ PrepareFFTwInputData()

void PFourier::PrepareFFTwInputData ( UInt_t  apodizationTag)
privatevirtual

Feeds the Fourier data and apply the apodization.

Parameters
apodizationTagapodization tag. Possible are currently: F_APODIZATION_NONE = no apodization, F_APODIZATION_WEAK = weak apodization, F_APODIZATION_MEDIUM = intermediate apodization, F_APODIZATION_STRONG = strong apodization

Definition at line 739 of file PFourier.cpp.

References ApodizeData(), fData, fDCCorrected, fIn, fNoOfBins, fNoOfData, fStartTime, and fTimeResolution.

Referenced by Transform().

◆ Transform()

void PFourier::Transform ( UInt_t  apodizationTag = 0)
virtual

Carries out the Fourier transform. It is assumed that fStartTime is the time zero for the Fourier frame. Hence if fStartTime != 0.0 the phase shift will be corrected.

Parameters
apodizationTag0=no apod., 1=weak apod., 2=medium apod., 3=strong apod.

Definition at line 398 of file PFourier.cpp.

References fData, fFFTwPlan, fNoOfBins, fOut, fStartTime, fTimeResolution, fValid, PI, and PrepareFFTwInputData().

Referenced by PMusrCanvas::HandleDifferenceFourier(), and PMusrCanvas::HandleFourier().

Member Data Documentation

◆ fApodization

Int_t PFourier::fApodization
private

0=none, 1=weak, 2=medium, 3=strong

Definition at line 128 of file PFourier.h.

Referenced by PFourier().

◆ fData

TH1F* PFourier::fData
private

data histogram to be Fourier transformed.

Definition at line 123 of file PFourier.h.

Referenced by GetDataTitle(), GetImaginaryFourier(), GetPhaseFourier(), GetPowerFourier(), GetRealFourier(), PFourier(), PrepareFFTwInputData(), and Transform().

◆ fDCCorrected

Bool_t PFourier::fDCCorrected
private

if true, removed DC offset from signal before Fourier transformation, otherwise not

Definition at line 133 of file PFourier.h.

Referenced by PrepareFFTwInputData().

◆ fEndTime

Double_t PFourier::fEndTime
private

end time of the data histogram

Definition at line 132 of file PFourier.h.

Referenced by PFourier().

◆ fFFTwPlan

fftw_plan PFourier::fFFTwPlan
private

fftw plan (see FFTW3 User Manual)

Definition at line 139 of file PFourier.h.

Referenced by PFourier(), Transform(), and ~PFourier().

◆ fIn

fftw_complex* PFourier::fIn
private

real part of the Fourier transform

Definition at line 140 of file PFourier.h.

Referenced by ApodizeData(), PFourier(), PrepareFFTwInputData(), and ~PFourier().

◆ fNoOfBins

UInt_t PFourier::fNoOfBins
private

number of bins to be Fourier transformed. Might be different to fNoOfData due to zero padding

Definition at line 138 of file PFourier.h.

Referenced by GetImaginaryFourier(), GetMaxFreq(), GetPhaseFourier(), GetPowerFourier(), GetRealFourier(), PFourier(), PrepareFFTwInputData(), and Transform().

◆ fNoOfData

UInt_t PFourier::fNoOfData
private

number of bins in the time interval between fStartTime and fStopTime

Definition at line 137 of file PFourier.h.

Referenced by ApodizeData(), PFourier(), and PrepareFFTwInputData().

◆ fOut

fftw_complex* PFourier::fOut
private

imaginary part of the Fourier transform

Definition at line 141 of file PFourier.h.

Referenced by GetImaginaryFourier(), GetPhaseFourier(), GetPowerFourier(), GetRealFourier(), PFourier(), Transform(), and ~PFourier().

◆ fResolution

Double_t PFourier::fResolution
private

Fourier resolution (field, frequency, or angular frequency)

Definition at line 135 of file PFourier.h.

Referenced by GetImaginaryFourier(), GetMaxFreq(), GetPhaseFourier(), GetPowerFourier(), GetRealFourier(), GetResolution(), and PFourier().

◆ fStartTime

Double_t PFourier::fStartTime
private

start time of the data histogram

Definition at line 131 of file PFourier.h.

Referenced by PFourier(), PrepareFFTwInputData(), and Transform().

◆ fTimeResolution

Double_t PFourier::fTimeResolution
private

time resolution of the data histogram in (us)

Definition at line 130 of file PFourier.h.

Referenced by PFourier(), PrepareFFTwInputData(), and Transform().

◆ fUnitTag

Int_t PFourier::fUnitTag
private

1=Field Units (G), 2=Field Units (T), 3=Frequency Units (MHz), 4=Angular Frequency Units (Mc/s)

Definition at line 126 of file PFourier.h.

Referenced by GetUnitTag(), and PFourier().

◆ fValid

Bool_t PFourier::fValid
private

true = all boundary conditions fullfilled and hence a Fourier transform can be performed.

Definition at line 125 of file PFourier.h.

Referenced by GetImaginaryFourier(), GetPhaseFourier(), GetPowerFourier(), GetRealFourier(), IsValid(), PFourier(), and Transform().

◆ fZeroPaddingPower

UInt_t PFourier::fZeroPaddingPower
private

power for zero padding, if set < 0 no zero padding will be done

Definition at line 134 of file PFourier.h.

Referenced by PFourier().


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