musrfit
1.9.2
|
#include <PRunAsymmetryRRF.h>
Public Member Functions | |
PRunAsymmetryRRF () | |
PRunAsymmetryRRF (PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag, Bool_t theoAsData) | |
virtual | ~PRunAsymmetryRRF () |
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 void | CalcNoOfFitBins () |
![]() | |
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 PRunData * | GetData () |
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 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 |
![]() ![]() ![]() ![]() | |
UInt_t | fNoOfFitBins |
number of bins to be be fitted More... | |
Int_t | fRRFPacking |
RRF packing for this particular run. Given in the 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 | |
![]() | |
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... | |
PMsrHandler * | fMsrInfo |
msr-file handler More... | |
PMsrRunBlock * | fRunInfo |
run info used to filter out needed infos of a run More... | |
PRunDataHandler * | fRawData |
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< PDoubleVector > | fAddT0s |
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< PTheory > | fTheory |
theory needed to calculate chi-square More... | |
PDoubleVector | fKaiserFilter |
stores the Kaiser filter vector (needed for the RRF). More... | |
Class handling the asymmetry fit.
Definition at line 39 of file PRunAsymmetryRRF.h.
PRunAsymmetryRRF::PRunAsymmetryRRF | ( | ) |
Constructor
Definition at line 56 of file PRunAsymmetryRRF.cpp.
References fGoodBins, fNoOfFitBins, fRRFPacking, and fTheoAsData.
PRunAsymmetryRRF::PRunAsymmetryRRF | ( | PMsrHandler * | msrInfo, |
PRunDataHandler * | rawData, | ||
UInt_t | runNo, | ||
EPMusrHandleTag | tag, | ||
Bool_t | theoAsData | ||
) |
Constructor
msrInfo | pointer to the msr-file handler |
rawData | raw run data |
runNo | number of the run within the msr-file |
tag | tag showing what shall be done: kFit == fitting, kView == viewing |
Definition at line 79 of file PRunAsymmetryRRF.cpp.
References fAlphaBetaTag, fGoodBins, PRunBase::fMsrInfo, fRRFPacking, PRunBase::fRunInfo, PRunBase::fValid, PMsrRunBlock::GetAlphaParamNo(), PMsrRunBlock::GetBetaParamNo(), PMsrHandler::GetMsrGlobal(), PMsrHandler::GetMsrParamList(), PMsrGlobalBlock::GetRRFPacking(), and PrepareData().
|
virtual |
Destructor.
Definition at line 158 of file PRunAsymmetryRRF.cpp.
References fBackward, fBackwardErr, fForward, and fForwardErr.
|
virtual |
Calculate chi-square.
return:
par | parameter vector iterated by minuit2 |
Implements PRunBase.
Definition at line 177 of file PRunAsymmetryRRF.cpp.
References PMsrHandler::EvalFunc(), fAlphaBetaTag, PRunBase::fData, fEndTimeBin, PRunBase::fFuncValues, PRunBase::fMetaData, PRunBase::fMsrInfo, PRunBase::fRunInfo, fStartTimeBin, PRunBase::fTheory, PMsrRunBlock::GetAlphaParamNo(), PMsrRunBlock::GetBetaParamNo(), PRunData::GetDataTimeStart(), PRunData::GetDataTimeStep(), PRunData::GetError(), PMsrHandler::GetFuncNo(), PMsrRunBlock::GetMap(), PMsrHandler::GetNoOfFuncs(), PRunData::GetValue(), and MSR_PARAM_FUN_OFFSET.
|
virtual |
Calculate expected chi-square. Currently not implemented since not clear what to be done.
return:
par | parameter vector iterated by minuit2 |
Definition at line 279 of file PRunAsymmetryRRF.cpp.
|
virtual |
NOT IMPLEMENTED!!
par | parameter vector iterated by minuit2 |
Implements PRunBase.
Definition at line 292 of file PRunAsymmetryRRF.cpp.
|
virtual |
Calculate the number of fitted bins for the current fit range.
Definition at line 410 of file PRunAsymmetryRRF.cpp.
References PRunBase::fData, fEndTimeBin, PRunBase::fFitEndTime, PRunBase::fFitStartTime, fNoOfFitBins, fStartTimeBin, PRunData::GetDataTimeStart(), PRunData::GetDataTimeStep(), and PRunData::GetValue().
Referenced by GetNoOfFitBins(), PrepareFitData(), and PrepareViewData().
|
virtual |
Calculate theory for a given set of fit-parameters.
Implements PRunBase.
Definition at line 432 of file PRunAsymmetryRRF.cpp.
References PRunData::AppendTheoryValue(), PMsrHandler::EvalFunc(), fAlphaBetaTag, PRunBase::fData, PRunBase::fFuncValues, PRunBase::fMetaData, PRunBase::fMsrInfo, PRunBase::fRunInfo, PRunBase::fTheory, PMsrRunBlock::GetAlphaParamNo(), PMsrRunBlock::GetBetaParamNo(), PRunData::GetDataTimeStart(), PRunData::GetDataTimeStep(), PMsrHandler::GetFuncNo(), PMsrRunBlock::GetMap(), PMsrHandler::GetMsrParamList(), PMsrHandler::GetNoOfFuncs(), PRunData::GetValue(), and MSR_PARAM_FUN_OFFSET.
|
inlinevirtual |
Definition at line 56 of file PRunAsymmetryRRF.h.
References fEndTimeBin.
|
virtual |
Calculate the number of fitted bins for the current fit range.
return: number of fitted bins.
Definition at line 307 of file PRunAsymmetryRRF.cpp.
References CalcNoOfFitBins(), and fNoOfFitBins.
|
privatevirtual |
Get the proper data range, i.e. first/last good bin (fgb/lgb).
runData | raw run data needed to perform some crosschecks |
histoNo | histogram number (within a run). histoNo[0]: forward histogram number, histNo[1]: backward histogram number |
return:
Definition at line 1449 of file PRunAsymmetryRRF.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().
|
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:
globalBlock | pointer to the GLOBAL block information form the msr-file. |
Definition at line 1577 of file PRunAsymmetryRRF.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().
|
privatevirtual |
Get the proper t0 for the single histogram run.
runData | pointer to the current RUN block entry from the msr-file |
globalBlock | pointer to the GLOBLA block entry from the msr-file |
forwardHistoNo | histogram number vector of forward; forwardHistoNo = msr-file forward + redGreen_offset - 1 |
backwardHistoNo | histogram number vector of backwardward; backwardHistoNo = msr-file backward + redGreen_offset - 1 |
return:
Definition at line 1274 of file PRunAsymmetryRRF.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().
|
inlinevirtual |
Definition at line 55 of file PRunAsymmetryRRF.h.
References fStartTimeBin.
|
protectedvirtual |
Prepare data for fitting or viewing. What is already processed at this stage:
Error propagation for :
return:
Implements PRunBase.
Definition at line 532 of file PRunAsymmetryRRF.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(), PRawRunData::GetNoOfTemperatures(), GetProperDataRange(), GetProperFitRange(), GetProperT0(), PRunDataHandler::GetRunData(), PMsrRunBlock::GetRunName(), PMsrRunBlock::GetRunNameSize(), PRawRunData::GetTemperature(), PRawRunData::GetTimeResolution(), PRawRunData::IsPresent(), kFit, kView, PMUSR_UNDEFINED, PrepareFitData(), PrepareViewData(), PMsrRunBlock::SetBkgRange(), status, SubtractEstimatedBkg(), and SubtractFixBkg().
Referenced by PRunAsymmetryRRF().
|
protectedvirtual |
Take the pre-processed data (i.e. grouping and addrun are preformed, background correction already carried out) and form the asymmetry for fitting.
Definition at line 905 of file PRunAsymmetryRRF.cpp.
References PRunData::AppendErrorValue(), PRunData::AppendValue(), CalcNoOfFitBins(), fBackward, fBackwardErr, PRunBase::fData, fForward, fForwardErr, fGoodBins, PRunBase::fMsrInfo, fRRFPacking, PRunBase::fT0s, PRunBase::fTimeResolution, PMsrHandler::GetMsrGlobal(), PMsrGlobalBlock::GetRRFFreq(), PMsrGlobalBlock::GetRRFPhase(), PRunData::SetDataTimeStart(), and PRunData::SetDataTimeStep().
Referenced by PrepareData().
|
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:
runData | raw run data needed to perform some crosschecks |
histoNo | histogram number (within a run). histoNo[0]: forward histogram number, histNo[1]: backward histogram number |
Definition at line 1021 of file PRunAsymmetryRRF.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, fRRFPacking, PRunBase::fRunInfo, PRunBase::fT0s, fTheoAsData, PRunBase::fTheory, PRunBase::fTimeResolution, PMsrRunBlock::GetAlphaParamNo(), PMsrRunBlock::GetBetaParamNo(), PRawRunData::GetDataBin(), PRunData::GetDataTimeStart(), PRunData::GetDataTimeStep(), PMsrHandler::GetFuncNo(), PMsrRunBlock::GetMap(), PMsrHandler::GetMsrGlobal(), PMsrHandler::GetMsrParamList(), PMsrHandler::GetNoOfFuncs(), PMsrGlobalBlock::GetRRFFreq(), PMsrGlobalBlock::GetRRFPhase(), PRunData::GetTheoryTimeStart(), PRunData::GetTheoryTimeStep(), MSR_PARAM_FUN_OFFSET, PRunData::SetDataTimeStart(), PRunData::SetDataTimeStep(), PRunData::SetTheoryTimeStart(), and PRunData::SetTheoryTimeStep().
Referenced by PrepareData().
|
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.
fitRange | string containing the necessary information. |
Definition at line 328 of file PRunAsymmetryRRF.cpp.
References PRunBase::fFitEndTime, PRunBase::fFitStartTime, fGoodBins, PRunBase::fRunNo, PRunBase::fT0s, and PRunBase::fTimeResolution.
|
private |
Subtracts the background which is estimated from a given interval (typically before t0).
The background corrected histogramms are: , where
is the raw data histogram,
the background estimate, and
background corrected histogram. The error on
is
The background error is
where is the number of bins over which the background is formed.
return:
Definition at line 798 of file PRunAsymmetryRRF.cpp.
References ACCEL_PERIOD_PSI, ACCEL_PERIOD_RAL, ACCEL_PERIOD_TRIUMF, fBackward, fBackwardErr, fForward, fForwardErr, PRunBase::fRunInfo, PRunBase::fTimeResolution, PMsrRunBlock::GetBkgRange(), PMsrRunBlock::GetInstitute(), and PMsrRunBlock::SetBkgEstimated().
Referenced by PrepareData().
|
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. .
Error propagation:
where is the background corrected histogram,
the raw histogram and
the fix given background.
return:
Definition at line 754 of file PRunAsymmetryRRF.cpp.
References fBackward, fBackwardErr, fForward, fForwardErr, PRunBase::fRunInfo, and PMsrRunBlock::GetBkgFix().
Referenced by PrepareData().
|
private |
;
;
;
.
Definition at line 66 of file PRunAsymmetryRRF.h.
Referenced by CalcChiSquare(), CalcTheory(), PrepareViewData(), and PRunAsymmetryRRF().
|
private |
backward histo data
Definition at line 73 of file PRunAsymmetryRRF.h.
Referenced by PrepareData(), PrepareFitData(), PrepareViewData(), SubtractEstimatedBkg(), SubtractFixBkg(), and ~PRunAsymmetryRRF().
|
private |
backward histo errors
Definition at line 74 of file PRunAsymmetryRRF.h.
Referenced by PrepareFitData(), PrepareViewData(), SubtractEstimatedBkg(), SubtractFixBkg(), and ~PRunAsymmetryRRF().
|
private |
bin at which the fit ends
Definition at line 79 of file PRunAsymmetryRRF.h.
Referenced by CalcChiSquare(), CalcNoOfFitBins(), and GetEndTimeBin().
|
private |
forward histo data
Definition at line 71 of file PRunAsymmetryRRF.h.
Referenced by PrepareData(), PrepareFitData(), PrepareViewData(), SubtractEstimatedBkg(), SubtractFixBkg(), and ~PRunAsymmetryRRF().
|
private |
forward histo errors
Definition at line 72 of file PRunAsymmetryRRF.h.
Referenced by PrepareFitData(), PrepareViewData(), SubtractEstimatedBkg(), SubtractFixBkg(), and ~PRunAsymmetryRRF().
|
private |
keep first/last good bins. 0=fgb, 1=lgb (forward); 2=fgb, 3=lgb (backward)
Definition at line 76 of file PRunAsymmetryRRF.h.
Referenced by GetProperDataRange(), GetProperFitRange(), PrepareFitData(), PrepareViewData(), PRunAsymmetryRRF(), and SetFitRangeBin().
|
private |
number of bins to be be fitted
Definition at line 67 of file PRunAsymmetryRRF.h.
Referenced by CalcNoOfFitBins(), GetNoOfFitBins(), and PRunAsymmetryRRF().
|
private |
RRF packing for this particular run. Given in the GLOBAL-block.
Definition at line 68 of file PRunAsymmetryRRF.h.
Referenced by PrepareFitData(), PrepareViewData(), and PRunAsymmetryRRF().
|
private |
bin at which the fit starts
Definition at line 78 of file PRunAsymmetryRRF.h.
Referenced by CalcChiSquare(), CalcNoOfFitBins(), and GetStartTimeBin().
|
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 69 of file PRunAsymmetryRRF.h.
Referenced by PrepareViewData(), and PRunAsymmetryRRF().