musrfit
1.9.2
|
#include <PRunMuMinus.h>
Public Member Functions | |
PRunMuMinus () | |
PRunMuMinus (PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag, Bool_t theoAsData) | |
virtual | ~PRunMuMinus () |
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 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 (PRawRunData *runData, const UInt_t histoNo) |
virtual Bool_t | PrepareRawViewData (PRawRunData *runData, const UInt_t histoNo) |
Protected Member Functions inherited from PRunBase | |
virtual void | CalculateKaiserFilterCoeff (Double_t wc, Double_t A, Double_t dw) |
virtual void | FilterTheo () |
Private Member Functions | |
virtual Bool_t | GetProperT0 (PRawRunData *runData, PMsrGlobalBlock *globalBlock, PUIntVector &histoNo) |
virtual Bool_t | GetProperDataRange () |
virtual void | GetProperFitRange (PMsrGlobalBlock *globalBlock) |
Private Attributes | |
UInt_t | fNoOfFitBins |
number of bins to 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... | |
Int_t | fGoodBins [2] |
keep first/last good bins. 0=fgb, 1=lgb More... | |
PDoubleVector | fForward |
forward histo data 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... | |
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... | |
Will eventually handle the fitting etc.
Definition at line 38 of file PRunMuMinus.h.
PRunMuMinus::PRunMuMinus | ( | ) |
Constructor
Definition at line 52 of file PRunMuMinus.cpp.
References fEndTimeBin, fGoodBins, PRunBase::fHandleTag, fNoOfFitBins, fPacking, fStartTimeBin, fTheoAsData, and kEmpty.
PRunMuMinus::PRunMuMinus | ( | 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 80 of file PRunMuMinus.cpp.
References fEndTimeBin, fGoodBins, PRunBase::fMsrInfo, fNoOfFitBins, fPacking, PRunBase::fRunInfo, fStartTimeBin, PRunBase::fValid, PMsrHandler::GetMsrGlobal(), PMsrGlobalBlock::GetPacking(), PMsrRunBlock::GetPacking(), and PrepareData().
|
virtual |
|
virtual |
Calculate chi-square.
return:
par | parameter vector iterated by minuit2 |
Implements PRunBase.
Definition at line 135 of file PRunMuMinus.cpp.
References PMsrHandler::EvalFunc(), PRunBase::fData, fEndTimeBin, PRunBase::fFuncValues, PRunBase::fMetaData, PRunBase::fMsrInfo, PRunBase::fRunInfo, fStartTimeBin, PRunBase::fTheory, PRunData::GetDataTimeStart(), PRunData::GetDataTimeStep(), PRunData::GetError(), PMsrHandler::GetFuncNo(), PMsrRunBlock::GetMap(), PMsrHandler::GetNoOfFuncs(), and PRunData::GetValue().
|
virtual |
Calculate expected chi-square.
return:
par | parameter vector iterated by minuit2 |
Definition at line 182 of file PRunMuMinus.cpp.
References PMsrHandler::EvalFunc(), PRunBase::fData, fEndTimeBin, PRunBase::fFuncValues, PRunBase::fMetaData, PRunBase::fMsrInfo, PRunBase::fRunInfo, fStartTimeBin, PRunBase::fTheory, PRunData::GetDataTimeStart(), PRunData::GetDataTimeStep(), PMsrHandler::GetFuncNo(), PMsrRunBlock::GetMap(), PMsrHandler::GetNoOfFuncs(), and PRunData::GetValue().
|
virtual |
Calculate log max-likelihood. See http://pdg.lbl.gov/index.html
return:
par | parameter vector iterated by minuit2 |
Implements PRunBase.
Definition at line 231 of file PRunMuMinus.cpp.
References PMsrHandler::EvalFunc(), PRunBase::fData, fEndTimeBin, PRunBase::fFuncValues, PRunBase::fMetaData, PRunBase::fMsrInfo, PRunBase::fRunInfo, fStartTimeBin, PRunBase::fTheory, PRunData::GetDataTimeStart(), PRunData::GetDataTimeStep(), PMsrHandler::GetFuncNo(), PMsrRunBlock::GetMap(), PMsrHandler::GetNoOfFuncs(), and PRunData::GetValue().
|
virtual |
Calculate the number of fitted bins for the current fit range.
Definition at line 392 of file PRunMuMinus.cpp.
References PRunBase::fData, fEndTimeBin, PRunBase::fFitEndTime, PRunBase::fFitStartTime, fNoOfFitBins, fStartTimeBin, PRunData::GetDataTimeStart(), PRunData::GetDataTimeStep(), and PRunData::GetValue().
Referenced by GetNoOfFitBins(), PrepareFitData(), and PrepareRawViewData().
|
virtual |
Calculate theory for a given set of fit-parameters.
Implements PRunBase.
Definition at line 414 of file PRunMuMinus.cpp.
References PRunData::AppendTheoryValue(), PMsrHandler::EvalFunc(), PRunBase::fData, PRunBase::fFuncValues, PRunBase::fMetaData, PRunBase::fMsrInfo, PRunBase::fRunInfo, PRunBase::fTheory, PRunData::GetDataTimeStart(), PRunData::GetDataTimeStep(), PMsrHandler::GetFuncNo(), PMsrRunBlock::GetMap(), PMsrHandler::GetMsrParamList(), PMsrHandler::GetNoOfFuncs(), and PRunData::GetValue().
|
inlinevirtual |
Definition at line 55 of file PRunMuMinus.h.
References fEndTimeBin.
|
virtual |
Calculate the number of fitted bins for the current fit range.
return: number of fitted bins.
Definition at line 289 of file PRunMuMinus.cpp.
References CalcNoOfFitBins(), and fNoOfFitBins.
|
inlinevirtual |
Definition at line 56 of file PRunMuMinus.h.
References fPacking.
|
privatevirtual |
Get the proper data range, i.e. first/last good bin (fgb/lgb).
return:
Definition at line 937 of file PRunMuMinus.cpp.
References fForward, fGoodBins, PRunBase::fMsrInfo, PRunBase::fRunInfo, PRunBase::fT0s, PRunBase::fTimeResolution, 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 1012 of file PRunMuMinus.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.
histoNo | histogram number vector of forward; histoNo = msr-file forward + redGreen_offset - 1 |
return:
Definition at line 806 of file PRunMuMinus.cpp.
References PRunBase::fAddT0s, PRunBase::fRawData, PRunBase::fRunInfo, PRunBase::fT0s, PMsrRunBlock::GetAddT0Bin(), PRawRunData::GetDataBin(), PMsrRunBlock::GetForwardHistoNoSize(), 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 54 of file PRunMuMinus.h.
References fStartTimeBin.
|
protectedvirtual |
Prepare data for fitting or viewing. What is already processed at this stage:
return:
Implements PRunBase.
Definition at line 457 of file PRunMuMinus.cpp.
References PRunBase::fAddT0s, PMetaData::fEnergy, PMetaData::fField, fForward, PRunBase::fHandleTag, PRunBase::fMetaData, PRunBase::fMsrInfo, PRunBase::fRawData, PRunBase::fRunInfo, PRunBase::fT0s, PMetaData::fTemp, PRunBase::fTimeResolution, PRunBase::fValid, 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, PrepareFitData(), and PrepareRawViewData().
Referenced by PRunMuMinus().
|
protectedvirtual |
Take the pre-processed data (i.e. grouping and addrun are preformed) and form the histogram for fitting. The following steps are preformed:
return:
runData | raw run data handler |
histoNo | forward histogram number |
Definition at line 601 of file PRunMuMinus.cpp.
References PRunData::AppendErrorValue(), PRunData::AppendValue(), CalcNoOfFitBins(), PRunBase::fData, fForward, fGoodBins, fPacking, PRunBase::fT0s, PRunBase::fTimeResolution, PRunData::SetDataTimeStart(), and PRunData::SetDataTimeStep().
Referenced by PrepareData().
|
protectedvirtual |
Take the pre-processed data (i.e. grouping and addrun are preformed) and form the histogram for viewing without any life time correction.
The following steps are preformed:
return:
runData | raw run data handler |
histoNo | forward histogram number |
Definition at line 659 of file PRunMuMinus.cpp.
References PRunData::AppendErrorValue(), PRunData::AppendTheoryValue(), PRunData::AppendValue(), CalcNoOfFitBins(), PMsrHandler::EvalFunc(), PRunBase::fData, PRunBase::fFitEndTime, PRunBase::fFitStartTime, fForward, PRunBase::fFuncValues, fGoodBins, PRunBase::fMetaData, PRunBase::fMsrInfo, fPacking, PRunBase::fRunInfo, PRunBase::fT0s, fTheoAsData, PRunBase::fTheory, PRunBase::fTimeResolution, PMsrRunBlock::GetDataRange(), PRunData::GetDataTimeStart(), PRunData::GetDataTimeStep(), PMsrRunBlock::GetFitRangeOffset(), PMsrHandler::GetFuncNo(), PMsrRunBlock::GetMap(), PMsrHandler::GetMsrParamList(), PMsrHandler::GetMsrPlotList(), PMsrHandler::GetNoOfFuncs(), PRunData::GetTheoryTimeStart(), PRunData::GetTheoryTimeStep(), PMsrRunBlock::IsFitRangeInBin(), 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 310 of file PRunMuMinus.cpp.
References PRunBase::fFitEndTime, PRunBase::fFitStartTime, fGoodBins, PRunBase::fRunNo, PRunBase::fT0s, and PRunBase::fTimeResolution.
|
private |
bin at which the fit ends
Definition at line 75 of file PRunMuMinus.h.
Referenced by CalcChiSquare(), CalcChiSquareExpected(), CalcMaxLikelihood(), CalcNoOfFitBins(), GetEndTimeBin(), and PRunMuMinus().
|
private |
forward histo data
Definition at line 72 of file PRunMuMinus.h.
Referenced by GetProperDataRange(), PrepareData(), PrepareFitData(), PrepareRawViewData(), and ~PRunMuMinus().
|
private |
keep first/last good bins. 0=fgb, 1=lgb
Definition at line 70 of file PRunMuMinus.h.
Referenced by GetProperDataRange(), GetProperFitRange(), PrepareFitData(), PrepareRawViewData(), PRunMuMinus(), and SetFitRangeBin().
|
private |
number of bins to be fitted
Definition at line 66 of file PRunMuMinus.h.
Referenced by CalcNoOfFitBins(), GetNoOfFitBins(), and PRunMuMinus().
|
private |
packing for this particular run. Either given in the RUN- or GLOBAL-block.
Definition at line 67 of file PRunMuMinus.h.
Referenced by GetPacking(), PrepareFitData(), PrepareRawViewData(), and PRunMuMinus().
|
private |
bin at which the fit starts
Definition at line 74 of file PRunMuMinus.h.
Referenced by CalcChiSquare(), CalcChiSquareExpected(), CalcMaxLikelihood(), CalcNoOfFitBins(), GetStartTimeBin(), and PRunMuMinus().
|
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 68 of file PRunMuMinus.h.
Referenced by PrepareRawViewData(), and PRunMuMinus().