musrfit  1.9.2
PRunMuMinus Class Reference

#include <PRunMuMinus.h>

Inheritance diagram for PRunMuMinus:
Collaboration diagram for PRunMuMinus:

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 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 (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...
 
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

Will eventually handle the $\mu^{-}$ fitting etc.

Definition at line 38 of file PRunMuMinus.h.

Constructor & Destructor Documentation

◆ PRunMuMinus() [1/2]

PRunMuMinus::PRunMuMinus ( )

Constructor

Definition at line 52 of file PRunMuMinus.cpp.

References fEndTimeBin, fGoodBins, PRunBase::fHandleTag, fNoOfFitBins, fPacking, fStartTimeBin, fTheoAsData, and kEmpty.

◆ PRunMuMinus() [2/2]

PRunMuMinus::PRunMuMinus ( 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 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().

◆ ~PRunMuMinus()

PRunMuMinus::~PRunMuMinus ( )
virtual

Destructor

Definition at line 119 of file PRunMuMinus.cpp.

References fForward.

Member Function Documentation

◆ CalcChiSquare()

Double_t PRunMuMinus::CalcChiSquare ( const std::vector< Double_t > &  par)
virtual

◆ CalcChiSquareExpected()

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

◆ CalcMaxLikelihood()

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

◆ CalcNoOfFitBins()

void PRunMuMinus::CalcNoOfFitBins ( )
virtual

◆ CalcTheory()

◆ GetEndTimeBin()

virtual Int_t PRunMuMinus::GetEndTimeBin ( )
inlinevirtual

Definition at line 55 of file PRunMuMinus.h.

References fEndTimeBin.

◆ GetNoOfFitBins()

UInt_t PRunMuMinus::GetNoOfFitBins ( )
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.

◆ GetPacking()

virtual Int_t PRunMuMinus::GetPacking ( )
inlinevirtual

Definition at line 56 of file PRunMuMinus.h.

References fPacking.

◆ GetProperDataRange()

Bool_t PRunMuMinus::GetProperDataRange ( )
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.

return:

  • true if everthing went smooth
  • false, otherwise.

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().

◆ GetProperFitRange()

void PRunMuMinus::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 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().

◆ GetProperT0()

Bool_t PRunMuMinus::GetProperT0 ( PRawRunData runData,
PMsrGlobalBlock globalBlock,
PUIntVector histoNo 
)
privatevirtual

Get the proper t0 for the single histogram run.

  1. the t0 vector size = number of detectors (grouping) for forward.
  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
histoNohistogram number vector of forward; histoNo = msr-file forward + redGreen_offset - 1

return:

  • true if everthing went smooth
  • false, otherwise.

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().

◆ GetStartTimeBin()

virtual Int_t PRunMuMinus::GetStartTimeBin ( )
inlinevirtual

Definition at line 54 of file PRunMuMinus.h.

References fStartTimeBin.

◆ PrepareData()

Bool_t PRunMuMinus::PrepareData ( )
protectedvirtual

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

  1. get proper raw run data
  2. get all needed forward histograms
  3. get time resolution
  4. 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.)
  5. add runs (if addruns are present)
  6. group histograms (if grouping is present)

return:

  • true if everthing went smooth
  • false, otherwise.

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().

◆ PrepareFitData()

Bool_t PRunMuMinus::PrepareFitData ( PRawRunData runData,
const UInt_t  histoNo 
)
protectedvirtual

Take the pre-processed data (i.e. grouping and addrun are preformed) and form the histogram for fitting. The following steps are preformed:

  1. get fit start/stop time
  2. check that 'first good data bin', 'last good data bin', and 't0' make any sense
  3. packing (i.e rebinning)

return:

  • true, if everything went smooth
  • false, otherwise
Parameters
runDataraw run data handler
histoNoforward 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().

◆ PrepareRawViewData()

Bool_t PRunMuMinus::PrepareRawViewData ( PRawRunData runData,
const UInt_t  histoNo 
)
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:

  1. check if view packing is whished.
  2. check that 'first good data bin', 'last good data bin', and 't0' makes any sense
  3. packing (i.e. rebinnig)
  4. calculate theory

return:

  • true, if everything went smooth
  • false, otherwise.
Parameters
runDataraw run data handler
histoNoforward 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().

◆ SetFitRangeBin()

void PRunMuMinus::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 310 of file PRunMuMinus.cpp.

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

Member Data Documentation

◆ fEndTimeBin

Int_t PRunMuMinus::fEndTimeBin
private

bin at which the fit ends

Definition at line 75 of file PRunMuMinus.h.

Referenced by CalcChiSquare(), CalcChiSquareExpected(), CalcMaxLikelihood(), CalcNoOfFitBins(), GetEndTimeBin(), and PRunMuMinus().

◆ fForward

PDoubleVector PRunMuMinus::fForward
private

forward histo data

Definition at line 72 of file PRunMuMinus.h.

Referenced by GetProperDataRange(), PrepareData(), PrepareFitData(), PrepareRawViewData(), and ~PRunMuMinus().

◆ fGoodBins

Int_t PRunMuMinus::fGoodBins[2]
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().

◆ fNoOfFitBins

UInt_t PRunMuMinus::fNoOfFitBins
private

number of bins to be fitted

Definition at line 66 of file PRunMuMinus.h.

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

◆ fPacking

Int_t PRunMuMinus::fPacking
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().

◆ fStartTimeBin

Int_t PRunMuMinus::fStartTimeBin
private

bin at which the fit starts

Definition at line 74 of file PRunMuMinus.h.

Referenced by CalcChiSquare(), CalcChiSquareExpected(), CalcMaxLikelihood(), CalcNoOfFitBins(), GetStartTimeBin(), and PRunMuMinus().

◆ fTheoAsData

Bool_t PRunMuMinus::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 68 of file PRunMuMinus.h.

Referenced by PrepareRawViewData(), and PRunMuMinus().


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