musrfit  1.9.2
PRunAsymmetry Class Reference

#include <PRunAsymmetry.h>

Inheritance diagram for PRunAsymmetry:
Collaboration diagram for PRunAsymmetry:

Public Member Functions

 PRunAsymmetry ()
 
 PRunAsymmetry (PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag, Bool_t theoAsData)
 
virtual ~PRunAsymmetry ()
 
virtual Double_t CalcChiSquare (const std::vector< Double_t > &par)
 
virtual Double_t CalcChiSquareExpected (const std::vector< Double_t > &par)
 
virtual Double_t CalcMaxLikelihood (const std::vector< Double_t > &par)
 
virtual void CalcTheory ()
 
virtual UInt_t GetNoOfFitBins ()
 
virtual void SetFitRangeBin (const TString fitRange)
 
virtual Int_t GetStartTimeBin ()
 
virtual Int_t GetEndTimeBin ()
 
virtual Int_t GetPacking ()
 
virtual void CalcNoOfFitBins ()
 
- Public Member Functions inherited from PRunBase
 PRunBase ()
 
 PRunBase (PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag)
 
virtual ~PRunBase ()
 
virtual void SetFitRange (PDoublePairVector fitRange)
 
virtual UInt_t GetRunNo ()
 returns the number of runs of the msr-file More...
 
virtual PRunDataGetData ()
 returns the data to be fitted More...
 
virtual void CleanUp ()
 
virtual Bool_t IsValid ()
 returns if the state is valid More...
 

Protected Member Functions

virtual Bool_t PrepareData ()
 
virtual Bool_t PrepareFitData ()
 
virtual Bool_t PrepareViewData (PRawRunData *runData, UInt_t histoNo[2])
 
virtual Bool_t PrepareRRFViewData (PRawRunData *runData, UInt_t histoNo[2])
 
- Protected Member Functions inherited from PRunBase
virtual void CalculateKaiserFilterCoeff (Double_t wc, Double_t A, Double_t dw)
 
virtual void FilterTheo ()
 

Private Member Functions

Bool_t SubtractFixBkg ()
 
Bool_t SubtractEstimatedBkg ()
 
virtual Bool_t GetProperT0 (PRawRunData *runData, PMsrGlobalBlock *globalBlock, PUIntVector &forwardHisto, PUIntVector &backwardHistoNo)
 
virtual Bool_t GetProperDataRange (PRawRunData *runData, UInt_t histoNo[2])
 
virtual void GetProperFitRange (PMsrGlobalBlock *globalBlock)
 

Private Attributes

UInt_t fAlphaBetaTag
 $ 1 \to \alpha = \beta = 1$; $ 2 \to \alpha \neq 1, \beta = 1$; $ 3 \to \alpha = 1, \beta \neq 1$; $ 4 \to \alpha \neq 1, \beta \neq 1$. More...
 
UInt_t fNoOfFitBins
 number of bins to be be fitted More...
 
Int_t fPacking
 packing for this particular run. Either given in the RUN- or GLOBAL-block. More...
 
Bool_t fTheoAsData
 true=only calculate the theory points at the data points, false=calculate more points for the theory as compared to data are calculated which lead to 'nicer' Fouriers More...
 
PDoubleVector fForward
 forward histo data More...
 
PDoubleVector fForwardErr
 forward histo errors More...
 
PDoubleVector fBackward
 backward histo data More...
 
PDoubleVector fBackwardErr
 backward histo errors More...
 
Int_t fGoodBins [4]
 keep first/last good bins. 0=fgb, 1=lgb (forward); 2=fgb, 3=lgb (backward) More...
 
Int_t fStartTimeBin
 bin at which the fit starts More...
 
Int_t fEndTimeBin
 bin at which the fit ends More...
 

Additional Inherited Members

- Protected Attributes inherited from PRunBase
Bool_t fValid
 flag showing if the state of the class is valid More...
 
EPMusrHandleTag fHandleTag
 tag telling whether this is used for fit, view, ... More...
 
Int_t fRunNo
 number of the run within the msr-file More...
 
PMsrHandlerfMsrInfo
 msr-file handler More...
 
PMsrRunBlockfRunInfo
 run info used to filter out needed infos of a run More...
 
PRunDataHandlerfRawData
 holds the raw run data More...
 
PRunData fData
 data to be fitted, viewed, i.e. binned data More...
 
Double_t fTimeResolution
 time resolution in (us) More...
 
PMetaData fMetaData
 keeps the meta data from the data file like field, temperature, energy, ... More...
 
PDoubleVector fT0s
 all t0 bins of a run! The derived classes will handle it. More...
 
std::vector< PDoubleVectorfAddT0s
 all t0 bins of all addrun's of a run! The derived classes will handle it. More...
 
Double_t fFitStartTime
 fit start time More...
 
Double_t fFitEndTime
 fit end time More...
 
PDoubleVector fFuncValues
 is keeping the values of the functions from the FUNCTIONS block More...
 
std::unique_ptr< PTheoryfTheory
 theory needed to calculate chi-square More...
 
PDoubleVector fKaiserFilter
 stores the Kaiser filter vector (needed for the RRF). More...
 

Detailed Description

Class handling the asymmetry fit.

Definition at line 39 of file PRunAsymmetry.h.

Constructor & Destructor Documentation

◆ PRunAsymmetry() [1/2]

PRunAsymmetry::PRunAsymmetry ( )

Constructor

Definition at line 55 of file PRunAsymmetry.cpp.

References fEndTimeBin, fGoodBins, fNoOfFitBins, fPacking, fStartTimeBin, and fTheoAsData.

◆ PRunAsymmetry() [2/2]

PRunAsymmetry::PRunAsymmetry ( PMsrHandler msrInfo,
PRunDataHandler rawData,
UInt_t  runNo,
EPMusrHandleTag  tag,
Bool_t  theoAsData 
)

Constructor

Parameters
msrInfopointer to the msr-file handler
rawDataraw run data
runNonumber of the run within the msr-file
tagtag showing what shall be done: kFit == fitting, kView == viewing

Definition at line 81 of file PRunAsymmetry.cpp.

References fAlphaBetaTag, fEndTimeBin, fGoodBins, PRunBase::fMsrInfo, fPacking, PRunBase::fRunInfo, fStartTimeBin, PRunBase::fValid, PMsrRunBlock::GetAlphaParamNo(), PMsrRunBlock::GetBetaParamNo(), PMsrHandler::GetMsrGlobal(), PMsrHandler::GetMsrParamList(), PMsrHandler::GetNoOfFuncs(), PMsrGlobalBlock::GetPacking(), PMsrRunBlock::GetPacking(), MSR_PARAM_FUN_OFFSET, and PrepareData().

◆ ~PRunAsymmetry()

PRunAsymmetry::~PRunAsymmetry ( )
virtual

Destructor.

Definition at line 176 of file PRunAsymmetry.cpp.

References fBackward, fBackwardErr, fForward, and fForwardErr.

Member Function Documentation

◆ CalcChiSquare()

◆ CalcChiSquareExpected()

Double_t PRunAsymmetry::CalcChiSquareExpected ( const std::vector< Double_t > &  par)
virtual

Calculate expected chi-square. Currently not implemented since not clear what to be done.

return:

  • chisq value == 0.0
Parameters
parparameter vector iterated by minuit2

Definition at line 297 of file PRunAsymmetry.cpp.

◆ CalcMaxLikelihood()

Double_t PRunAsymmetry::CalcMaxLikelihood ( const std::vector< Double_t > &  par)
virtual

NOT IMPLEMENTED!!

Parameters
parparameter vector iterated by minuit2

Implements PRunBase.

Definition at line 310 of file PRunAsymmetry.cpp.

◆ CalcNoOfFitBins()

void PRunAsymmetry::CalcNoOfFitBins ( )
virtual

◆ CalcTheory()

◆ GetEndTimeBin()

virtual Int_t PRunAsymmetry::GetEndTimeBin ( )
inlinevirtual

Definition at line 56 of file PRunAsymmetry.h.

References fEndTimeBin.

◆ GetNoOfFitBins()

UInt_t PRunAsymmetry::GetNoOfFitBins ( )
virtual

Calculate the number of fitted bins for the current fit range.

return: number of fitted bins.

Definition at line 325 of file PRunAsymmetry.cpp.

References CalcNoOfFitBins(), and fNoOfFitBins.

◆ GetPacking()

virtual Int_t PRunAsymmetry::GetPacking ( )
inlinevirtual

Definition at line 57 of file PRunAsymmetry.h.

References fPacking.

◆ GetProperDataRange()

Bool_t PRunAsymmetry::GetProperDataRange ( PRawRunData runData,
UInt_t  histoNo[2] 
)
privatevirtual

Get the proper data range, i.e. first/last good bin (fgb/lgb).

  1. get fgb/lgb from the RUN block
  2. if fgb/lgb still undefined, try to get it from the GLOBAL block
  3. if fgb/lgb still undefined, try to estimate them.
Parameters
runDataraw run data needed to perform some crosschecks
histoNohistogram number (within a run). histoNo[0]: forward histogram number, histNo[1]: backward histogram number

return:

  • true if everthing went smooth
  • false, otherwise.

Definition at line 1868 of file PRunAsymmetry.cpp.

References fGoodBins, PRunBase::fMsrInfo, PRunBase::fRunInfo, PRunBase::fT0s, PRunBase::fTimeResolution, PRawRunData::GetDataBin(), PMsrGlobalBlock::GetDataRange(), PMsrRunBlock::GetDataRange(), PMsrHandler::GetMsrGlobal(), and PMsrRunBlock::SetDataRange().

Referenced by PrepareData().

◆ GetProperFitRange()

void PRunAsymmetry::GetProperFitRange ( PMsrGlobalBlock globalBlock)
privatevirtual

Get the proper fit range. There are two possible fit range commands: fit <start> <end> given in (usec), or fit fgb+offset_0 lgb-offset_1 given in (bins), therefore it works the following way:

  1. get fit range assuming given in time from RUN block
  2. if fit range in RUN block is given in bins, replace start/end
  3. if fit range is NOT given yet, try fit range assuming given in time from GLOBAL block
  4. if fit range in GLOBAL block is given in bins, replace start/end
  5. if still no fit range is given, use fgb/lgb.
Parameters
globalBlockpointer to the GLOBAL block information form the msr-file.

Definition at line 1996 of file PRunAsymmetry.cpp.

References PRunBase::fFitEndTime, PRunBase::fFitStartTime, fGoodBins, PRunBase::fRunInfo, PRunBase::fT0s, PRunBase::fTimeResolution, PMsrGlobalBlock::GetFitRange(), PMsrRunBlock::GetFitRange(), PMsrGlobalBlock::GetFitRangeOffset(), PMsrRunBlock::GetFitRangeOffset(), PMsrGlobalBlock::IsFitRangeInBin(), PMsrRunBlock::IsFitRangeInBin(), PMUSR_UNDEFINED, PMsrGlobalBlock::SetFitRange(), and PMsrRunBlock::SetFitRange().

Referenced by PrepareData().

◆ GetProperT0()

Bool_t PRunAsymmetry::GetProperT0 ( PRawRunData runData,
PMsrGlobalBlock globalBlock,
PUIntVector forwardHistoNo,
PUIntVector backwardHistoNo 
)
privatevirtual

Get the proper t0 for the single histogram run.

  1. the t0 vector size = number of detectors (grouping) for forward + backward.
  2. initialize t0's with -1
  3. fill t0's from RUN block
  4. if t0's are missing (i.e. t0 == -1), try to fill from the GLOBAL block.
  5. if t0's are missing, try t0's from the data file
  6. if t0's are missing, try to estimate them
Parameters
runDatapointer to the current RUN block entry from the msr-file
globalBlockpointer to the GLOBLA block entry from the msr-file
forwardHistoNohistogram number vector of forward; forwardHistoNo = msr-file forward + redGreen_offset - 1
backwardHistoNohistogram number vector of backwardward; backwardHistoNo = msr-file backward + redGreen_offset - 1

return:

  • true if everthing went smooth
  • false, otherwise.

Definition at line 1693 of file PRunAsymmetry.cpp.

References PRunBase::fAddT0s, PRunBase::fRawData, PRunBase::fRunInfo, PRunBase::fT0s, PMsrRunBlock::GetAddT0Bin(), PMsrRunBlock::GetAddT0BinSize(), PRawRunData::GetDataBin(), PRunDataHandler::GetRunData(), PMsrRunBlock::GetRunName(), PMsrRunBlock::GetRunNameSize(), PRawRunData::GetT0Bin(), PMsrGlobalBlock::GetT0Bin(), PMsrRunBlock::GetT0Bin(), PRawRunData::GetT0BinEstimated(), PMsrGlobalBlock::GetT0BinSize(), PMsrRunBlock::GetT0BinSize(), PMsrRunBlock::SetAddT0Bin(), and PMsrRunBlock::SetT0Bin().

Referenced by PrepareData().

◆ GetStartTimeBin()

virtual Int_t PRunAsymmetry::GetStartTimeBin ( )
inlinevirtual

Definition at line 55 of file PRunAsymmetry.h.

References fStartTimeBin.

◆ PrepareData()

Bool_t PRunAsymmetry::PrepareData ( )
protectedvirtual

Prepare data for fitting or viewing. What is already processed at this stage:

  • get all needed forward/backward histograms
  • get time resolution
  • get start/stop fit time
  • get t0's and perform necessary cross checks (e.g. if t0 of msr-file (if present) are consistent with t0 of the data files, etc.)
  • add runs (if addruns are present)
  • group histograms (if grouping is present)
  • subtract background

Error propagation for $ A_i = (f_i^{\rm c}-b_i^{\rm c})/(f_i^{\rm c}+b_i^{\rm c})$:

\[ \Delta A_i = \pm\frac{2}{(f_i^{\rm c}+b_i^{\rm c})^2}\left[ (b_i^{\rm c})^2 (\Delta f_i^{\rm c})^2 + (\Delta b_i^{\rm c})^2 (f_i^{\rm c})^2\right]^{1/2}\]

return:

  • true if everthing went smooth
  • false, otherwise.

Implements PRunBase.

Definition at line 550 of file PRunAsymmetry.cpp.

References PRunBase::fAddT0s, fBackward, PMetaData::fEnergy, PMetaData::fField, fForward, PRunBase::fHandleTag, PRunBase::fMetaData, PRunBase::fMsrInfo, PRunBase::fRawData, PRunBase::fRunInfo, PRunBase::fT0s, PMetaData::fTemp, PRunBase::fTimeResolution, PRunBase::fValid, PMsrRunBlock::GetBackwardHistoNo(), PMsrRunBlock::GetBackwardHistoNoSize(), PMsrRunBlock::GetBkgFix(), PMsrRunBlock::GetBkgRange(), PRawRunData::GetDataBin(), PRawRunData::GetEnergy(), PRawRunData::GetField(), PMsrRunBlock::GetForwardHistoNo(), PMsrRunBlock::GetForwardHistoNoSize(), PMsrHandler::GetMsrGlobal(), PMsrHandler::GetMsrPlotList(), PRawRunData::GetNoOfTemperatures(), GetProperDataRange(), GetProperFitRange(), GetProperT0(), PRunDataHandler::GetRunData(), PMsrRunBlock::GetRunName(), PMsrRunBlock::GetRunNameSize(), PRawRunData::GetTemperature(), PRawRunData::GetTimeResolution(), PRawRunData::IsPresent(), kFit, kView, PMUSR_UNDEFINED, PrepareFitData(), PrepareRRFViewData(), PrepareViewData(), PMsrRunBlock::SetBkgRange(), status, SubtractEstimatedBkg(), and SubtractFixBkg().

Referenced by PRunAsymmetry().

◆ PrepareFitData()

Bool_t PRunAsymmetry::PrepareFitData ( )
protectedvirtual

Take the pre-processed data (i.e. grouping and addrun are preformed) and form the asymmetry for fitting. Before forming the asymmetry, the following checks will be performed:

  1. check if data range is given, if not try to estimate one.
  2. check that if a data range is present, that it makes any sense.
  3. check that 'first good bin'-'t0' is the same for forward and backward histogram. If not adjust it.
  4. pack data (rebin).
  5. if packed forward size != backward size, truncate the longer one such that an asymmetry can be formed.
  6. calculate the asymmetry: $ A_i = (f_i^c-b_i^c)/(f_i^c+b_i^c) $
  7. calculate the asymmetry errors: $ \delta A_i = 2 \sqrt{(b_i^c)^2 (\delta f_i^c)^2 + (\delta b_i^c)^2 (f_i^c)^2}/(f_i^c+b_i^c)^2$

Definition at line 953 of file PRunAsymmetry.cpp.

References PRunData::AppendErrorValue(), PRunData::AppendValue(), CalcNoOfFitBins(), fBackward, fBackwardErr, PRunBase::fData, fForward, fForwardErr, fGoodBins, fPacking, PRunBase::fT0s, PRunBase::fTimeResolution, PRunData::GetError(), PRunData::GetValue(), PRunData::SetDataTimeStart(), and PRunData::SetDataTimeStep().

Referenced by PrepareData().

◆ PrepareRRFViewData()

Bool_t PRunAsymmetry::PrepareRRFViewData ( PRawRunData runData,
UInt_t  histoNo[2] 
)
protectedvirtual

Prepares the RRF data set for visual representation. This is done the following way:

  1. make all necessary checks
  2. build the asymmetry, $ A(t) $, WITHOUT packing.
  3. $ A_R(t) = A(t) \cdot 2 \cos(\omega_R t + \phi_R) $
  4. do the packing of $ A_R(t) $
  5. calculate theory, $ T(t) $, as close as possible to the time resolution [compatible with the RRF frequency]
  6. $ T_R(t) = T(t) \cdot 2 \cos(\omega_R t + \phi_R) $
  7. do the packing of $ T_R(t) $
  8. calculate the Kaiser FIR filter coefficients
  9. filter $ T_R(t) $.
Parameters
runDataraw run data needed to perform some crosschecks
histoNoarray of the histo numbers form which to build the asymmetry

Definition at line 1356 of file PRunAsymmetry.cpp.

References PRunData::AppendErrorValue(), PRunData::AppendTheoryValue(), PRunData::AppendValue(), PRunBase::CalculateKaiserFilterCoeff(), PMsrHandler::EvalFunc(), fAlphaBetaTag, fBackward, fBackwardErr, PRunBase::fData, fForward, fForwardErr, PRunBase::fFuncValues, fGoodBins, PRunBase::FilterTheo(), PRunBase::fMetaData, PRunBase::fMsrInfo, PRunBase::fRunInfo, PRunBase::fT0s, PRunBase::fTheory, PRunBase::fTimeResolution, GAMMA_BAR_MUON, PMsrRunBlock::GetAlphaParamNo(), PMsrRunBlock::GetBetaParamNo(), PRawRunData::GetDataBin(), PRunData::GetDataTimeStart(), PMsrHandler::GetFuncNo(), PMsrRunBlock::GetMap(), PMsrHandler::GetMsrParamList(), PMsrHandler::GetMsrPlotList(), PMsrHandler::GetNoOfFuncs(), PRunData::GetTheory(), PRunData::GetTheoryTimeStart(), PRunData::GetTheoryTimeStep(), MSR_PARAM_FUN_OFFSET, PRunData::ReplaceTheory(), RRF_UNIT_G, RRF_UNIT_kHz, RRF_UNIT_Mcs, RRF_UNIT_MHz, RRF_UNIT_T, PRunData::SetDataTimeStart(), PRunData::SetDataTimeStep(), PRunData::SetTheoryTimeStart(), and PRunData::SetTheoryTimeStep().

Referenced by PrepareData().

◆ PrepareViewData()

Bool_t PRunAsymmetry::PrepareViewData ( PRawRunData runData,
UInt_t  histoNo[2] 
)
protectedvirtual

Take the pre-processed data (i.e. grouping and addrun are preformed) and form the asymmetry for view representation. Before forming the asymmetry, the following checks will be performed:

  1. check if view packing is whished.
  2. check if data range is given, if not try to estimate one.
  3. check that data range is present, that it makes any sense.
  4. check that 'first good bin'-'t0' is the same for forward and backward histogram. If not adjust it.
  5. pack data (rebin).
  6. if packed forward size != backward size, truncate the longer one such that an asymmetry can be formed.
  7. calculate the asymmetry: $ A_i = (\alpha f_i^c-b_i^c)/(\alpha \beta f_i^c+b_i^c) $
  8. calculate the asymmetry errors: $ \delta A_i = 2 \sqrt{(b_i^c)^2 (\delta f_i^c)^2 + (\delta b_i^c)^2 (f_i^c)^2}/(f_i^c+b_i^c)^2$
  9. calculate the theory vector.
Parameters
runDataraw run data needed to perform some crosschecks
histoNohistogram number (within a run). histoNo[0]: forward histogram number, histNo[1]: backward histogram number

Definition at line 1072 of file PRunAsymmetry.cpp.

References PRunData::AppendErrorValue(), PRunData::AppendTheoryValue(), PRunData::AppendValue(), CalcNoOfFitBins(), PMsrHandler::EvalFunc(), fAlphaBetaTag, fBackward, fBackwardErr, PRunBase::fData, fForward, fForwardErr, PRunBase::fFuncValues, fGoodBins, PRunBase::fMetaData, PRunBase::fMsrInfo, fPacking, PRunBase::fRunInfo, PRunBase::fT0s, fTheoAsData, PRunBase::fTheory, PRunBase::fTimeResolution, PMsrRunBlock::GetAlphaParamNo(), PMsrRunBlock::GetBetaParamNo(), PRawRunData::GetDataBin(), PRunData::GetDataTimeStart(), PRunData::GetDataTimeStep(), PRunData::GetError(), PMsrHandler::GetFuncNo(), PMsrRunBlock::GetMap(), PMsrHandler::GetMsrParamList(), PMsrHandler::GetMsrPlotList(), PMsrHandler::GetNoOfFuncs(), PRunData::GetTheoryTimeStart(), PRunData::GetTheoryTimeStep(), PRunData::GetValue(), MSR_PARAM_FUN_OFFSET, PRunData::SetDataTimeStart(), PRunData::SetDataTimeStep(), PRunData::SetTheoryTimeStart(), and PRunData::SetTheoryTimeStep().

Referenced by PrepareData().

◆ SetFitRangeBin()

void PRunAsymmetry::SetFitRangeBin ( const TString  fitRange)
virtual

Allows to change the fit range on the fly. Used in the COMMAND block. The syntax of the string is: FIT_RANGE fgb[+n00] lgb[-n01] [fgb[+n10] lgb[-n11] ... fgb[+nN0] lgb[-nN1]]. If only one pair of fgb/lgb is given, it is used for all runs in the RUN block section. If multiple fgb/lgb's are given, the number N has to be the number of RUN blocks in the msr-file.

nXY are offsets which can be used to shift, limit the fit range.

Parameters
fitRangestring containing the necessary information.

Definition at line 346 of file PRunAsymmetry.cpp.

References PRunBase::fFitEndTime, PRunBase::fFitStartTime, fGoodBins, PRunBase::fRunNo, PRunBase::fT0s, and PRunBase::fTimeResolution.

◆ SubtractEstimatedBkg()

Bool_t PRunAsymmetry::SubtractEstimatedBkg ( )
private

Subtracts the background which is estimated from a given interval (typically before t0).

The background corrected histogramms are: $ f_i^{\rm c} = f_i - \mathrm{bkg} $, where $ f_i $ is the raw data histogram, $ \mathrm{bkg} $ the background estimate, and $ f_i^{\rm c} $ background corrected histogram. The error on $ f_i^{\rm c} $ is

\[ \Delta f_i^{\rm c} = \pm \sqrt{ (\Delta f_i)^2 + (\Delta \mathrm{bkg})^2 } = \pm \sqrt{f_i + (\Delta \mathrm{bkg})^2} \]

The background error $ \Delta \mathrm{bkg} $ is

\[ \Delta \mathrm{bkg} = \pm\frac{1}{N}\left[\sum_{i=0}^N (\Delta f_i)^2\right]^{1/2} = \pm\frac{1}{N}\left[\sum_{i=0}^N f_i \right]^{1/2},\]

where $N$ is the number of bins over which the background is formed.

return:

  • true

Definition at line 837 of file PRunAsymmetry.cpp.

References ACCEL_PERIOD_PSI, ACCEL_PERIOD_RAL, ACCEL_PERIOD_TRIUMF, fBackward, fBackwardErr, fForward, fForwardErr, fPacking, PRunBase::fRunInfo, PRunBase::fTimeResolution, PMsrRunBlock::GetBkgRange(), PMsrRunBlock::GetInstitute(), and PMsrRunBlock::SetBkgEstimated().

Referenced by PrepareData().

◆ SubtractFixBkg()

Bool_t PRunAsymmetry::SubtractFixBkg ( )
private

Subtracts a fixed background from the raw data. The background is given in units of (1/bin); for the Asymmetry representation (1/ns) doesn't make too much sense. The error propagation is done the following way: it is assumed that the error of the background is Poisson like, i.e. $\Delta\mathrm{bkg} = \sqrt{\mathrm{bkg}}$.

Error propagation:

\[ \Delta f_i^{\rm c} = \pm\left[ (\Delta f_i)^2 + (\Delta \mathrm{bkg})^2 \right]^{1/2} = \pm\left[ f_i + \mathrm{bkg} \right]^{1/2}, \]

where $ f_i^{\rm c} $ is the background corrected histogram, $ f_i $ the raw histogram and $ \mathrm{bkg} $ the fix given background.

return:

  • true

Definition at line 779 of file PRunAsymmetry.cpp.

References fBackward, fBackwardErr, fForward, fForwardErr, PRunBase::fRunInfo, PMsrRunBlock::GetBkgFix(), and PMUSR_UNDEFINED.

Referenced by PrepareData().

Member Data Documentation

◆ fAlphaBetaTag

UInt_t PRunAsymmetry::fAlphaBetaTag
private

$ 1 \to \alpha = \beta = 1$; $ 2 \to \alpha \neq 1, \beta = 1$; $ 3 \to \alpha = 1, \beta \neq 1$; $ 4 \to \alpha \neq 1, \beta \neq 1$.

Definition at line 68 of file PRunAsymmetry.h.

Referenced by CalcChiSquare(), CalcTheory(), PrepareRRFViewData(), PrepareViewData(), and PRunAsymmetry().

◆ fBackward

PDoubleVector PRunAsymmetry::fBackward
private

◆ fBackwardErr

PDoubleVector PRunAsymmetry::fBackwardErr
private

backward histo errors

Definition at line 76 of file PRunAsymmetry.h.

Referenced by PrepareFitData(), PrepareRRFViewData(), PrepareViewData(), SubtractEstimatedBkg(), SubtractFixBkg(), and ~PRunAsymmetry().

◆ fEndTimeBin

Int_t PRunAsymmetry::fEndTimeBin
private

bin at which the fit ends

Definition at line 81 of file PRunAsymmetry.h.

Referenced by CalcChiSquare(), CalcNoOfFitBins(), GetEndTimeBin(), and PRunAsymmetry().

◆ fForward

PDoubleVector PRunAsymmetry::fForward
private

◆ fForwardErr

PDoubleVector PRunAsymmetry::fForwardErr
private

◆ fGoodBins

Int_t PRunAsymmetry::fGoodBins[4]
private

keep first/last good bins. 0=fgb, 1=lgb (forward); 2=fgb, 3=lgb (backward)

Definition at line 78 of file PRunAsymmetry.h.

Referenced by GetProperDataRange(), GetProperFitRange(), PrepareFitData(), PrepareRRFViewData(), PrepareViewData(), PRunAsymmetry(), and SetFitRangeBin().

◆ fNoOfFitBins

UInt_t PRunAsymmetry::fNoOfFitBins
private

number of bins to be be fitted

Definition at line 69 of file PRunAsymmetry.h.

Referenced by CalcNoOfFitBins(), GetNoOfFitBins(), and PRunAsymmetry().

◆ fPacking

Int_t PRunAsymmetry::fPacking
private

packing for this particular run. Either given in the RUN- or GLOBAL-block.

Definition at line 70 of file PRunAsymmetry.h.

Referenced by GetPacking(), PrepareFitData(), PrepareViewData(), PRunAsymmetry(), and SubtractEstimatedBkg().

◆ fStartTimeBin

Int_t PRunAsymmetry::fStartTimeBin
private

bin at which the fit starts

Definition at line 80 of file PRunAsymmetry.h.

Referenced by CalcChiSquare(), CalcNoOfFitBins(), GetStartTimeBin(), and PRunAsymmetry().

◆ fTheoAsData

Bool_t PRunAsymmetry::fTheoAsData
private

true=only calculate the theory points at the data points, false=calculate more points for the theory as compared to data are calculated which lead to 'nicer' Fouriers

Definition at line 71 of file PRunAsymmetry.h.

Referenced by PrepareViewData(), and PRunAsymmetry().


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