musrfit  1.9.2
PMsrHandler Class Reference

#include <PMsrHandler.h>

Collaboration diagram for PMsrHandler:

Public Member Functions

 PMsrHandler (const Char_t *fileName, PStartupOptions *startupOptions=0, const Bool_t fourierOnly=false)
 
virtual ~PMsrHandler ()
 
virtual Int_t ReadMsrFile ()
 
virtual Int_t WriteMsrLogFile (const Bool_t messages=true)
 
virtual Int_t WriteMsrFile (const Char_t *filename, std::map< UInt_t, TString > *commentsPAR=0, std::map< UInt_t, TString > *commentsTHE=0, std::map< UInt_t, TString > *commentsFUN=0, std::map< UInt_t, TString > *commentsRUN=0)
 
virtual TString * GetMsrTitle ()
 
virtual PMsrParamListGetMsrParamList ()
 
virtual PMsrLinesGetMsrTheory ()
 
virtual PMsrLinesGetMsrFunctions ()
 
virtual PMsrGlobalBlockGetMsrGlobal ()
 
virtual PMsrRunListGetMsrRunList ()
 
virtual PMsrLinesGetMsrCommands ()
 
virtual PMsrFourierStructureGetMsrFourierList ()
 
virtual PMsrPlotListGetMsrPlotList ()
 
virtual PMsrStatisticStructureGetMsrStatistic ()
 
virtual TString * GetMsrFileDirectoryPath ()
 
virtual UInt_t GetNoOfRuns ()
 
virtual UInt_t GetNoOfParams ()
 
virtual const TString & GetFileName () const
 
virtual void SetMsrTitle (const TString &title)
 
virtual Bool_t SetMsrParamValue (UInt_t i, Double_t value)
 
virtual Bool_t SetMsrParamStep (UInt_t i, Double_t value)
 
virtual Bool_t SetMsrParamPosErrorPresent (UInt_t i, Bool_t value)
 
virtual Bool_t SetMsrParamPosError (UInt_t i, Double_t value)
 
virtual void SetMsrT0Entry (UInt_t runNo, UInt_t idx, Double_t bin)
 
virtual void SetMsrAddT0Entry (UInt_t runNo, UInt_t addRunIdx, UInt_t histoIdx, Double_t bin)
 
virtual void SetMsrDataRangeEntry (UInt_t runNo, UInt_t idx, Int_t bin)
 
virtual void SetMsrBkgRangeEntry (UInt_t runNo, UInt_t idx, Int_t bin)
 
virtual void CopyMsrStatisticBlock ()
 
virtual void SetMsrStatisticConverged (Bool_t converged)
 
virtual void SetMsrStatisticMin (Double_t min)
 
virtual void SetMsrStatisticNdf (UInt_t ndf)
 
virtual Int_t GetNoOfFuncs ()
 
virtual UInt_t GetFuncNo (Int_t idx)
 
virtual UInt_t GetFuncIndex (Int_t funNo)
 
virtual Bool_t CheckMapAndParamRange (UInt_t mapSize, UInt_t paramSize)
 
virtual Double_t EvalFunc (UInt_t i, std::vector< Int_t > map, std::vector< Double_t > param, PMetaData metaData)
 
virtual UInt_t GetNoOfFitParameters (UInt_t idx)
 
virtual Int_t ParameterInUse (UInt_t paramNo)
 
virtual Bool_t CheckRunBlockIntegrity ()
 
virtual Bool_t CheckUniquenessOfParamNames (UInt_t &parX, UInt_t &parY)
 
virtual Bool_t CheckMaps ()
 
virtual Bool_t CheckFuncs ()
 
virtual Bool_t CheckHistoGrouping ()
 
virtual Bool_t CheckAddRunParameters ()
 
virtual Bool_t CheckRRFSettings ()
 
virtual void CheckMaxLikelihood ()
 
virtual void GetGroupingString (Int_t runNo, TString detector, TString &groupingStr)
 
virtual Bool_t EstimateN0 ()
 

Private Member Functions

virtual Bool_t HandleFitParameterEntry (PMsrLines &line)
 
virtual Bool_t HandleTheoryEntry (PMsrLines &line)
 
virtual Bool_t HandleFunctionsEntry (PMsrLines &line)
 
virtual Bool_t HandleGlobalEntry (PMsrLines &line)
 
virtual Bool_t HandleRunEntry (PMsrLines &line)
 
virtual Bool_t HandleCommandsEntry (PMsrLines &line)
 
virtual Bool_t HandleFourierEntry (PMsrLines &line)
 
virtual Bool_t HandlePlotEntry (PMsrLines &line)
 
virtual Bool_t HandleStatisticEntry (PMsrLines &line)
 
virtual void FillParameterInUse (PMsrLines &theory, PMsrLines &funcs, PMsrLines &run)
 
virtual void InitFourierParameterStructure (PMsrFourierStructure &fourier)
 
virtual void RemoveComment (const TString &str, TString &truncStr)
 
virtual Bool_t ParseFourierPhaseValueVector (PMsrFourierStructure &fourier, const TString &str, Bool_t &error)
 
virtual Bool_t ParseFourierPhaseParVector (PMsrFourierStructure &fourier, const TString &str, Bool_t &error)
 
virtual Bool_t ParseFourierPhaseParIterVector (PMsrFourierStructure &fourier, const TString &str, Bool_t &error)
 
virtual Bool_t FilterNumber (TString str, const Char_t *filter, Int_t offset, Int_t &no)
 
virtual UInt_t NeededPrecision (Double_t dval, UInt_t precLimit=13)
 
virtual UInt_t LastSignificant (Double_t dval, UInt_t precLimit=6)
 
virtual void MakeDetectorGroupingString (TString str, PIntVector &group, TString &result, Bool_t includeDetector=true)
 
virtual TString BeautifyFourierPhaseParameterString ()
 
virtual void CheckLegacyLifetimecorrection ()
 

Private Attributes

Bool_t fFourierOnly
 flag indicating if Fourier transform only is wished. If yes, some part of the msr-file blocks are not needed. More...
 
PStartupOptionsfStartupOptions
 contains information about startup options from the musrfit_startup.xml More...
 
TString fFileName
 file name of the msr-file More...
 
TString fMsrFileDirectoryPath
 msr-file directory path More...
 
TString fTitle
 holds the title string of the msr-file More...
 
PMsrParamList fParam
 holds a list of the fit parameters More...
 
PMsrLines fTheory
 holds the theory definition More...
 
PMsrLines fFunctions
 holds the user defined functions More...
 
PMsrGlobalBlock fGlobal
 holds the information of the global section More...
 
PMsrRunList fRuns
 holds a list of run information More...
 
PMsrLines fCommands
 holds a list of the minuit commands More...
 
PMsrFourierStructure fFourier
 holds the parameters used for the Fourier transform More...
 
PMsrPlotList fPlots
 holds a list of the plot input parameters More...
 
PMsrStatisticStructure fStatistic
 holds the statistic info More...
 
Int_t fMsrBlockCounter
 used to select the proper msr-block More...
 
std::unique_ptr< PFunctionHandlerfFuncHandler
 needed to parse functions More...
 
PIntVector fParamInUse
 array holding the information if a particular parameter is used at all, i.e. if the theory is using it (perhaps via maps or functions) More...
 
Bool_t fCopyStatisticsBlock
 flag, if true: just copy to old statistics block (musrt0), otherwise write a new one (musrfit) More...
 

Detailed Description

This class provides the routines needed to handle msr-files, i.e. reading, writing, parsing, etc.

Definition at line 47 of file PMsrHandler.h.

Constructor & Destructor Documentation

◆ PMsrHandler()

PMsrHandler::PMsrHandler ( const Char_t *  fileName,
PStartupOptions startupOptions = 0,
const Bool_t  fourierOnly = false 
)

◆ ~PMsrHandler()

Member Function Documentation

◆ BeautifyFourierPhaseParameterString()

TString PMsrHandler::BeautifyFourierPhaseParameterString ( )
privatevirtual

Returns the Fourier phase string if the phase is either of type phase parX0 sep ... sep parXn where sep = ',' or phase par(X0, offset, #param)

Returns
Fourier phase parameter string if phase parameter(s) is(are) given, "??" otherwise

Definition at line 6676 of file PMsrHandler.cpp.

References fFourier, PMsrFourierStructure::fPhaseParamNo, and PMsrFourierStructure::fPhaseRef.

Referenced by WriteMsrFile(), and WriteMsrLogFile().

◆ CheckAddRunParameters()

Bool_t PMsrHandler::CheckAddRunParameters ( )
virtual

In case addrun is present check that if addt0's are given there are as many addt0's than addrun's.

return:

  • true if either no addt0 present, or # of addrun's == # of addt0's.
  • false otherwise

Definition at line 6356 of file PMsrHandler.cpp.

References fRuns.

Referenced by ReadMsrFile().

◆ CheckFuncs()

Bool_t PMsrHandler::CheckFuncs ( )
virtual

Checks if fun entries found in the theory- and run-block are also present in the functions-block.

return:

  • true if fun entries or present in the FUNCTIONS block
  • false otherwise

Definition at line 6216 of file PMsrHandler.cpp.

References fFourierOnly, fFunctions, FilterNumber(), fRuns, fTheory, and MSR_PARAM_FUN_OFFSET.

Referenced by ReadMsrFile().

◆ CheckHistoGrouping()

Bool_t PMsrHandler::CheckHistoGrouping ( )
virtual

Checks if histogram grouping makes any sense.

return:

  • true if histogram grouping seems OK
  • false otherwise

Definition at line 6310 of file PMsrHandler.cpp.

References fRuns.

Referenced by ReadMsrFile().

◆ CheckLegacyLifetimecorrection()

void PMsrHandler::CheckLegacyLifetimecorrection ( )
privatevirtual

Checks for lifetimecorrection flags in the RUN-blocks and if present, transfer it to the PLOT-blocks. This is needed since originally the lifetimecorrection was (miss)placed in the RUN-blocks rather than in the PLOT-blocks where it most naturally would have been expected.

Definition at line 6744 of file PMsrHandler.cpp.

References fPlots, and fRuns.

Referenced by ReadMsrFile().

◆ CheckMapAndParamRange()

virtual Bool_t PMsrHandler::CheckMapAndParamRange ( UInt_t  mapSize,
UInt_t  paramSize 
)
inlinevirtual

Definition at line 96 of file PMsrHandler.h.

References fFuncHandler.

Referenced by PRunBase::PRunBase().

◆ CheckMaps()

Bool_t PMsrHandler::CheckMaps ( )
virtual

Checks if map entries found in the theory- or function-block are also present in the run-block.

return:

  • true if maps or OK
  • false otherwise

Definition at line 6106 of file PMsrHandler.cpp.

References fFunctions, FilterNumber(), fRuns, fTheory, and MSR_PARAM_MAP_OFFSET.

Referenced by ReadMsrFile().

◆ CheckMaxLikelihood()

void PMsrHandler::CheckMaxLikelihood ( )
virtual

If log max likelihood is requested, make sure that all run blocks are of single histogram type. If this is not the case, fall back to chisq, since for asymmetry/non-muSR fit, log max likelihood is not defined.

Definition at line 6386 of file PMsrHandler.cpp.

References PMsrStatisticStructure::fChisq, fGlobal, fRuns, fStatistic, PMsrGlobalBlock::GetFitType(), MSR_FITTYPE_MU_MINUS, and MSR_FITTYPE_SINGLE_HISTO.

Referenced by ReadMsrFile().

◆ CheckRRFSettings()

Bool_t PMsrHandler::CheckRRFSettings ( )
virtual

◆ CheckRunBlockIntegrity()

Bool_t PMsrHandler::CheckRunBlockIntegrity ( )
virtual

◆ CheckUniquenessOfParamNames()

Bool_t PMsrHandler::CheckUniquenessOfParamNames ( UInt_t &  parX,
UInt_t &  parY 
)
virtual

Checks if all the fit parameters are unique. If not parX, parY will show the first occurence of equal fit parameter names.

return:

  • true if the fit parameter names are unique.
  • false otherwise
Parameters
parXindex of the 1st fit parameter name for which there is a counter part.
parYindex of the counter part fit parameter name.

Definition at line 6077 of file PMsrHandler.cpp.

References fParam.

Referenced by ReadMsrFile().

◆ CopyMsrStatisticBlock()

virtual void PMsrHandler::CopyMsrStatisticBlock ( )
inlinevirtual

Definition at line 88 of file PMsrHandler.h.

References fCopyStatisticsBlock.

◆ EstimateN0()

Bool_t PMsrHandler::EstimateN0 ( )
virtual

returns if N0 shall be estimated

Definition at line 6535 of file PMsrHandler.cpp.

References PStartupOptions::estimateN0, and fStartupOptions.

Referenced by PRunSingleHisto::PrepareFitData().

◆ EvalFunc()

◆ FillParameterInUse()

void PMsrHandler::FillParameterInUse ( PMsrLines theory,
PMsrLines funcs,
PMsrLines run 
)
privatevirtual

Fills the fParamInUse vector. An element of the vector will be 0 if the fit parameter is not used at all, otherwise it will be > 0.

Parameters
theorymsr-file THEROY block lines
funcsmsr-file FUNCTIONS block lines
runmsr-file RUN blocks lines

Definition at line 5386 of file PMsrHandler.cpp.

References FilterNumber(), fParam, fParamInUse, MSR_PARAM_FUN_OFFSET, MSR_PARAM_MAP_OFFSET, and ParameterInUse().

Referenced by ReadMsrFile().

◆ FilterNumber()

Bool_t PMsrHandler::FilterNumber ( TString  str,
const Char_t *  filter,
Int_t  offset,
Int_t &  no 
)
privatevirtual

Used to filter numbers from a string of the structure strX, where X is a number. The filter string is used to define the offset to X. It is used to filter strings like: map1 or fun4. At the moment only the filter strings 'map', 'fun', and 'par' are supported.

return:

  • true if successful
  • false otherwise
Parameters
strinput string
filterfilter string
offsetit is used to offset to found number, e.g. strX -> no = X+offset
nofiltered number

Definition at line 3841 of file PMsrHandler.cpp.

Referenced by CheckFuncs(), CheckMaps(), FillParameterInUse(), HandlePlotEntry(), HandleRunEntry(), and WriteMsrLogFile().

◆ GetFileName()

virtual const TString& PMsrHandler::GetFileName ( ) const
inlinevirtual

Definition at line 74 of file PMsrHandler.h.

References fFileName.

Referenced by PFitter::ExecuteSave().

◆ GetFuncIndex()

virtual UInt_t PMsrHandler::GetFuncIndex ( Int_t  funNo)
inlinevirtual

Definition at line 95 of file PMsrHandler.h.

References fFuncHandler.

Referenced by PTheory::PTheory(), and WriteMsrLogFile().

◆ GetFuncNo()

◆ GetGroupingString()

void PMsrHandler::GetGroupingString ( Int_t  runNo,
TString  detector,
TString &  groupingStr 
)
virtual

returns the forward/backward grouping string.

Parameters
runNomsr-file run block number
detectortag telling which set to be used. Possible are: 'forward' and 'backward'
groupingStrcompressed grouping information.

Definition at line 6509 of file PMsrHandler.cpp.

References fRuns, and MakeDetectorGroupingString().

Referenced by PMusrCanvas::UpdateInfoPad().

◆ GetMsrCommands()

virtual PMsrLines* PMsrHandler::GetMsrCommands ( )
inlinevirtual

◆ GetMsrFileDirectoryPath()

virtual TString* PMsrHandler::GetMsrFileDirectoryPath ( )
inlinevirtual

Definition at line 69 of file PMsrHandler.h.

References fMsrFileDirectoryPath.

Referenced by PRunDataHandler::FileExistsCheck().

◆ GetMsrFourierList()

virtual PMsrFourierStructure* PMsrHandler::GetMsrFourierList ( )
inlinevirtual

Definition at line 65 of file PMsrHandler.h.

References fFourier.

Referenced by PMusrCanvas::CalcPhaseOptReFT(), and PMusrCanvas::SetMsrHandler().

◆ GetMsrFunctions()

virtual PMsrLines* PMsrHandler::GetMsrFunctions ( )
inlinevirtual

Definition at line 61 of file PMsrHandler.h.

References fFunctions.

Referenced by PFitter::GetParFromFun(), and PMusrCanvas::UpdateParamTheoryPad().

◆ GetMsrGlobal()

◆ GetMsrParamList()

◆ GetMsrPlotList()

◆ GetMsrRunList()

◆ GetMsrStatistic()

virtual PMsrStatisticStructure* PMsrHandler::GetMsrStatistic ( )
inlinevirtual

◆ GetMsrTheory()

virtual PMsrLines* PMsrHandler::GetMsrTheory ( )
inlinevirtual

◆ GetMsrTitle()

virtual TString* PMsrHandler::GetMsrTitle ( )
inlinevirtual

Definition at line 58 of file PMsrHandler.h.

References fTitle.

◆ GetNoOfFitParameters()

UInt_t PMsrHandler::GetNoOfFitParameters ( UInt_t  idx)
virtual

Calculate the number of fit parameters.

Parameters
idxrun block index

Definition at line 5189 of file PMsrHandler.cpp.

References fFunctions, fParam, fRuns, fTheory, MSR_PARAM_FUN_OFFSET, and status.

Referenced by PFitter::DoFit(), PFitter::ExecuteSave(), and PFitter::PrepareSector().

◆ GetNoOfFuncs()

◆ GetNoOfParams()

virtual UInt_t PMsrHandler::GetNoOfParams ( )
inlinevirtual

Definition at line 73 of file PMsrHandler.h.

References fParam.

Referenced by PFitter::GetPhaseParams(), and PRunBase::PRunBase().

◆ GetNoOfRuns()

virtual UInt_t PMsrHandler::GetNoOfRuns ( )
inlinevirtual

Definition at line 71 of file PMsrHandler.h.

References fRuns.

Referenced by PFitter::CheckCommands().

◆ HandleCommandsEntry()

Bool_t PMsrHandler::HandleCommandsEntry ( PMsrLines lines)
privatevirtual

Just copies the COMMAND block lines.

return:

  • true
Parameters
linesis a list of lines containing the command block

Definition at line 3880 of file PMsrHandler.cpp.

References fCommands, and fFourierOnly.

Referenced by ReadMsrFile().

◆ HandleFitParameterEntry()

Bool_t PMsrHandler::HandleFitParameterEntry ( PMsrLines lines)
privatevirtual

The routine analyze a parameter line and, if the possible parameter list is OK (what this means see below), it adds the parameter to the parameter list.

Possible cases:

No Name Value Step/Neg_Error Pos_Error Boundary_Low Boundary_High
x x x x x x x -> 7 Parameters, e.g. after a MINOS fit
x x x x x -> 5 Parameters, e.g. after a MINOS fit
without boundaries
x x x x -> 4 Parameters, e.g. after MIGRAD fit
without boundaries, or
when starting

return:

  • true is fit parameter lines are OK.
  • false otherwise
Parameters
linesis a list of lines containing the fitparameter block

Definition at line 2691 of file PMsrHandler.cpp.

References PMsrParamStructure::fLowerBoundary, PMsrParamStructure::fLowerBoundaryPresent, PMsrParamStructure::fName, PMsrParamStructure::fNo, PMsrParamStructure::fNoOfParams, fParam, PMsrParamStructure::fPosError, PMsrParamStructure::fPosErrorPresent, PMsrParamStructure::fStep, PMsrParamStructure::fUpperBoundary, PMsrParamStructure::fUpperBoundaryPresent, and PMsrParamStructure::fValue.

Referenced by ReadMsrFile().

◆ HandleFourierEntry()

◆ HandleFunctionsEntry()

Bool_t PMsrHandler::HandleFunctionsEntry ( PMsrLines lines)
privatevirtual

Parses the FUNCTIONS block of the msr-file.

return:

  • true if the parsing was successful.
  • false otherwise
Parameters
linesis a list of lines containing the functions block

Definition at line 2927 of file PMsrHandler.cpp.

References fFourierOnly, fFuncHandler, and fFunctions.

Referenced by ReadMsrFile().

◆ HandleGlobalEntry()

◆ HandlePlotEntry()

◆ HandleRunEntry()

◆ HandleStatisticEntry()

Bool_t PMsrHandler::HandleStatisticEntry ( PMsrLines lines)
privatevirtual

Handles the STATISTIC block of a msr-file.

return:

  • true if successful
  • false otherwise
Parameters
linesis a list of lines containing the statistic block

Definition at line 5083 of file PMsrHandler.cpp.

References PMsrStatisticStructure::fDate, fFourierOnly, PMsrStatisticStructure::fMin, PMsrStatisticStructure::fMinExpected, PMsrStatisticStructure::fNdf, fStatistic, PMsrStatisticStructure::fStatLines, PMsrStatisticStructure::fValid, and status.

Referenced by ReadMsrFile().

◆ HandleTheoryEntry()

Bool_t PMsrHandler::HandleTheoryEntry ( PMsrLines lines)
privatevirtual

Just stores the THEORY block lines.

return:

  • true always
Parameters
linesis a list of lines containing the theory block

Definition at line 2903 of file PMsrHandler.cpp.

References fFourierOnly, and fTheory.

Referenced by ReadMsrFile().

◆ InitFourierParameterStructure()

◆ LastSignificant()

UInt_t PMsrHandler::LastSignificant ( Double_t  dval,
UInt_t  precLimit = 6 
)
privatevirtual

Gets the last significant digit down to precLimit.

Parameters
dvalvalue for which the last signigicant digit shall be found
precLimitprecision limit

return: last significant digit down to precLimit

Definition at line 6587 of file PMsrHandler.cpp.

Referenced by WriteMsrFile(), and WriteMsrLogFile().

◆ MakeDetectorGroupingString()

void PMsrHandler::MakeDetectorGroupingString ( TString  str,
PIntVector group,
TString &  result,
Bool_t  includeDetector = true 
)
privatevirtual

encodes the detector grouping vector.

Parameters
str'forward' or 'backward'
groupdetector grouping vector to be encoded
resultencoded detector grouping string
includeDetectorif true, the detector information is included

Definition at line 6629 of file PMsrHandler.cpp.

Referenced by GetGroupingString(), and WriteMsrLogFile().

◆ NeededPrecision()

UInt_t PMsrHandler::NeededPrecision ( Double_t  dval,
UInt_t  precLimit = 13 
)
privatevirtual

Calculates the needed precision of Double_t values for WriteMsrLogFile and WriteMsrFile of the fit range. If a precision of > precLimit decimal places is needed, a warning is placed and a value of precLimit is returned.

Parameters
dvalvalue for which the precision has to be estimated
precLimitprecision limit

return: needed precision

Definition at line 6555 of file PMsrHandler.cpp.

Referenced by WriteMsrLogFile().

◆ ParameterInUse()

Int_t PMsrHandler::ParameterInUse ( UInt_t  paramNo)
virtual

Needed for the following purpose: if minuit is minimizing, it varies all the parameters of the parameter list (if not fixed), even if a particular parameter is NOT used at all. This is stupid! Hence one has to check if the parameter is used at all and if not, it has to be fixed.

return:

  • 0 if the parameter is not used.
  • a value > 0 if the parameter is used.
Parameters
paramNoparameter number

Definition at line 2658 of file PMsrHandler.cpp.

References fParam, and fParamInUse.

Referenced by PFitter::ExecuteMinos(), PFitter::ExecuteSave(), FillParameterInUse(), and PFitter::SetParameters().

◆ ParseFourierPhaseParIterVector()

Bool_t PMsrHandler::ParseFourierPhaseParIterVector ( PMsrFourierStructure fourier,
const TString &  str,
Bool_t &  error 
)
privatevirtual

examines if str has the form 'phase par(X0, offset, #params)' or 'phase parR(X0, offset, #params)'. If this form is found, fill in parX0 ... parXN to fourier.fPhaseParamNo, and in case of 'parR' also set the fourier.fPhaseRef accordingly.

Parameters
fouriermsr-file Fourier structure
strstring to be analyzed
errorflag needed to propagate a fatal error
Returns
true if a phase parameter iterator form is found, otherwise return false

Definition at line 4117 of file PMsrHandler.cpp.

References PMsrFourierStructure::fPhaseParamNo, and PMsrFourierStructure::fPhaseRef.

Referenced by HandleFourierEntry().

◆ ParseFourierPhaseParVector()

Bool_t PMsrHandler::ParseFourierPhaseParVector ( PMsrFourierStructure fourier,
const TString &  str,
Bool_t &  error 
)
privatevirtual

examines if str has the form 'phase parX0 [sep parX1 ... sep parXN]'. Also allowed is that instead of parXn only one of the parameters could have the form parRn which markes a reference phase for relative phase fittings. If this form is found, fill in parX0 ... parXN to fourier.fPhaseParamNo, and in case a parR is present, set the fourier.fPhaseRef accordingly.

Parameters
fouriermsr-file Fourier structure
strstring to be analyzed
errorflag needed to propagate a fatal error
Returns
true if a phase parameter form is found, otherwise return false

Definition at line 4020 of file PMsrHandler.cpp.

References PMsrFourierStructure::fPhaseParamNo, and PMsrFourierStructure::fPhaseRef.

Referenced by HandleFourierEntry().

◆ ParseFourierPhaseValueVector()

Bool_t PMsrHandler::ParseFourierPhaseValueVector ( PMsrFourierStructure fourier,
const TString &  str,
Bool_t &  error 
)
privatevirtual

examines if str has the form 'phase val0 [sep val1 ... sep valN]'. If this form is found, fill in val0 ... valN to fFourier.fPhase vector.

Parameters
fouriermsr-file Fourier structure
strstring to be analyzed
errorflag needed to propagate a fatal error
Returns
true if a phase value form is found, otherwise return false

Definition at line 3961 of file PMsrHandler.cpp.

References PMsrFourierStructure::fPhase.

Referenced by HandleFourierEntry().

◆ ReadMsrFile()

◆ RemoveComment()

void PMsrHandler::RemoveComment ( const TString &  str,
TString &  truncStr 
)
privatevirtual

Removes a potentially present comment from str and returns the truncated string in truncStr. A comment starts with '#'

Parameters
stroriginal string which might contain a comment
truncStrstring from which the comment has been removed

Definition at line 3936 of file PMsrHandler.cpp.

Referenced by HandleFourierEntry().

◆ SetMsrAddT0Entry()

void PMsrHandler::SetMsrAddT0Entry ( UInt_t  runNo,
UInt_t  addRunIdx,
UInt_t  histoIdx,
Double_t  bin 
)
virtual

Sets a t0 value for an addrun entry.

Parameters
runNomsr-file run number
addRunIdxmsr-file addrun index, e.g. if 2 addruns are present addRunIdx can take the values 0 or 1.
histoIdxmsr-file histogram index for an addrun.
bint0 bin value.

Definition at line 2578 of file PMsrHandler.cpp.

References fRuns.

Referenced by PMusrT0::SetEstimatedT0Channel(), and PMusrT0::SetT0Channel().

◆ SetMsrBkgRangeEntry()

void PMsrHandler::SetMsrBkgRangeEntry ( UInt_t  runNo,
UInt_t  idx,
Int_t  bin 
)
virtual

Sets the background range entries for a given runNo and a given histogram index idx.

Parameters
runNomsr-file run number
idx0=start bin index, 1=end bin index
binbackground range bin value

Definition at line 2632 of file PMsrHandler.cpp.

References fRuns.

Referenced by PMusrT0::SetBkgFirstChannel(), and PMusrT0::SetBkgLastChannel().

◆ SetMsrDataRangeEntry()

void PMsrHandler::SetMsrDataRangeEntry ( UInt_t  runNo,
UInt_t  idx,
Int_t  bin 
)
virtual

Sets the data range entries for a given runNo and a given histogram index idx.

Parameters
runNomsr-file run number
idx0=start bin index, 1=end bin index
bindata range bin value

Definition at line 2611 of file PMsrHandler.cpp.

References fRuns.

Referenced by PMusrT0::SetDataFirstChannel(), and PMusrT0::SetDataLastChannel().

◆ SetMsrParamPosError()

Bool_t PMsrHandler::SetMsrParamPosError ( UInt_t  idx,
Double_t  value 
)
virtual

Sets the fit parameter positive error value at positon idx.

return:

  • true if idx is within range
  • false if idx is larger than the fit parameter vector.
Parameters
idxindex fo the fit parameter positive error value
valuefit parameter positive error value to be set.

Definition at line 2526 of file PMsrHandler.cpp.

References fParam.

Referenced by PFitter::ExecuteMinos().

◆ SetMsrParamPosErrorPresent()

Bool_t PMsrHandler::SetMsrParamPosErrorPresent ( UInt_t  idx,
Bool_t  value 
)
virtual

Sets the flag whether the fit parameter positive error value is persent. This at positon idx.

return:

  • true if idx is within range
  • false if idx is larger than the fit parameter vector.
Parameters
idxindex fo the fit parameter positive error value
valuefit parameter positive error value present.

Definition at line 2500 of file PMsrHandler.cpp.

References fParam.

Referenced by PFitter::DoFit(), PFitter::ExecuteHesse(), PFitter::ExecuteMigrad(), PFitter::ExecuteMinimize(), PFitter::ExecuteMinos(), and PFitter::ExecuteSimplex().

◆ SetMsrParamStep()

Bool_t PMsrHandler::SetMsrParamStep ( UInt_t  idx,
Double_t  value 
)
virtual

Sets the fit parameter step value (initial step size for minuit2) at positon idx. After a successful fit, the negative error will be writen.

return:

  • true if idx is within range
  • false if idx is larger than the fit parameter vector.
Parameters
idxindex fo the fit parameter step value
valuefit parameter step value to be set.

Definition at line 2474 of file PMsrHandler.cpp.

References fParam.

Referenced by PRunSingleHisto::EstimateN0(), PFitter::ExecuteHesse(), PFitter::ExecuteMigrad(), PFitter::ExecuteMinimize(), PFitter::ExecuteMinos(), and PFitter::ExecuteSimplex().

◆ SetMsrParamValue()

Bool_t PMsrHandler::SetMsrParamValue ( UInt_t  idx,
Double_t  value 
)
virtual

Sets the fit parameter value at position idx.

return:

  • true if idx is within range
  • false if idx is larger than the fit parameter vector.
Parameters
idxindex of the fit parameter value.
valuefit parameter value to be set.

Definition at line 2447 of file PMsrHandler.cpp.

References fParam.

Referenced by PRunSingleHisto::EstimateN0(), PFitter::ExecuteMigrad(), PFitter::ExecuteMinimize(), and PFitter::ExecuteSimplex().

◆ SetMsrStatisticConverged()

virtual void PMsrHandler::SetMsrStatisticConverged ( Bool_t  converged)
inlinevirtual

Definition at line 89 of file PMsrHandler.h.

References fStatistic, and PMsrStatisticStructure::fValid.

◆ SetMsrStatisticMin()

virtual void PMsrHandler::SetMsrStatisticMin ( Double_t  min)
inlinevirtual

◆ SetMsrStatisticNdf()

virtual void PMsrHandler::SetMsrStatisticNdf ( UInt_t  ndf)
inlinevirtual

◆ SetMsrT0Entry()

void PMsrHandler::SetMsrT0Entry ( UInt_t  runNo,
UInt_t  idx,
Double_t  bin 
)
virtual

Sets the t0 entries for a given runNo and a given histogram index idx.

Parameters
runNomsr-file run number
idxmsr-file histogram index
bint0 bin value

Definition at line 2550 of file PMsrHandler.cpp.

References fRuns.

Referenced by PMusrT0::SetEstimatedT0Channel(), and PMusrT0::SetT0Channel().

◆ SetMsrTitle()

virtual void PMsrHandler::SetMsrTitle ( const TString &  title)
inlinevirtual

Definition at line 76 of file PMsrHandler.h.

References fTitle.

◆ WriteMsrFile()

Int_t PMsrHandler::WriteMsrFile ( const Char_t *  filename,
std::map< UInt_t, TString > *  commentsPAR = 0,
std::map< UInt_t, TString > *  commentsTHE = 0,
std::map< UInt_t, TString > *  commentsFUN = 0,
std::map< UInt_t, TString > *  commentsRUN = 0 
)
virtual

Writes a msr-file from the internal data structures

return:

  • PMUSR_SUCCESS everything is OK
  • PMUSR_MSR_FILE_WRITE_ERROR msr output file couldn't be opened
Parameters
filenameThe name of the output file.

Definition at line 1562 of file PMsrHandler.cpp.

References BeautifyFourierPhaseParameterString(), PMsrFourierStructure::fApodization, PMsrStatisticStructure::fChisq, fCommands, fFourier, PMsrFourierStructure::fFourierBlockPresent, PMsrFourierStructure::fFourierPower, fFunctions, fGlobal, PMsrStatisticStructure::fMin, PMsrStatisticStructure::fNdf, FOURIER_APOD_MEDIUM, FOURIER_APOD_NONE, FOURIER_APOD_STRONG, FOURIER_APOD_WEAK, FOURIER_PLOT_IMAG, FOURIER_PLOT_PHASE, FOURIER_PLOT_PHASE_OPT_REAL, FOURIER_PLOT_POWER, FOURIER_PLOT_REAL, FOURIER_PLOT_REAL_AND_IMAG, FOURIER_UNIT_CYCLES, FOURIER_UNIT_FREQ, FOURIER_UNIT_GAUSS, FOURIER_UNIT_TESLA, fParam, PMsrFourierStructure::fPhase, PMsrFourierStructure::fPhaseParamNo, PMsrFourierStructure::fPlotRange, fPlots, PMsrFourierStructure::fPlotTag, PMsrFourierStructure::fRangeForPhaseCorrection, fRuns, fStatistic, fTheory, fTitle, PMsrFourierStructure::fUnits, PMsrStatisticStructure::fValid, PMsrGlobalBlock::GetAddT0Bin(), PMsrGlobalBlock::GetAddT0BinEntries(), PMsrGlobalBlock::GetAddT0BinSize(), PMsrGlobalBlock::GetDataRange(), PMsrGlobalBlock::GetFitRange(), PMsrGlobalBlock::GetFitRangeOffset(), PMsrGlobalBlock::GetFitType(), PMsrGlobalBlock::GetPacking(), PMsrGlobalBlock::GetRRFFreq(), PMsrGlobalBlock::GetRRFPacking(), PMsrGlobalBlock::GetRRFPhase(), PMsrGlobalBlock::GetRRFUnit(), PMsrGlobalBlock::GetT0Bin(), PMsrGlobalBlock::GetT0BinSize(), PMsrGlobalBlock::IsFitRangeInBin(), PMsrGlobalBlock::IsPresent(), LastSignificant(), MSR_FITTYPE_ASYM, MSR_FITTYPE_ASYM_RRF, MSR_FITTYPE_BNMR, MSR_FITTYPE_MU_MINUS, MSR_FITTYPE_NON_MUSR, MSR_FITTYPE_SINGLE_HISTO, MSR_FITTYPE_SINGLE_HISTO_RRF, MSR_PARAM_FUN_OFFSET, MSR_PLOT_ASYM, MSR_PLOT_ASYM_RRF, MSR_PLOT_BNMR, MSR_PLOT_MU_MINUS, MSR_PLOT_NON_MUSR, MSR_PLOT_SINGLE_HISTO, MSR_PLOT_SINGLE_HISTO_RRF, PMUSR_MSR_FILE_WRITE_ERROR, PMUSR_SUCCESS, PMUSR_UNDEFINED, RRF_UNIT_G, RRF_UNIT_kHz, RRF_UNIT_Mcs, RRF_UNIT_MHz, and RRF_UNIT_T.

◆ WriteMsrLogFile()

Int_t PMsrHandler::WriteMsrLogFile ( const Bool_t  messages = true)
virtual

Writes a mlog-file.

return:

  • PMUSR_SUCCESS everything is OK
  • PMUSR_MSR_LOG_FILE_WRITE_ERROR msr-/mlog-file couldn't be opened
  • PMUSR_MSR_SYNTAX_ERROR a syntax error has been encountered
Parameters
messagesif true some additional messages concerning the statistic block are written. When using musrt0, messages will be set to false.

Definition at line 356 of file PMsrHandler.cpp.

References BeautifyFourierPhaseParameterString(), PMsrFourierStructure::fApodization, PMsrStatisticStructure::fChisq, PMsrFourierStructure::fDCCorrected, fFileName, fFourier, PMsrFourierStructure::fFourierPower, fFuncHandler, fGlobal, FilterNumber(), PMsrStatisticStructure::fMin, PMsrStatisticStructure::fMinExpected, PMsrStatisticStructure::fMinExpectedPerHisto, PMsrStatisticStructure::fMinPerHisto, PMsrStatisticStructure::fNdf, PMsrStatisticStructure::fNdfPerHisto, FOURIER_APOD_MEDIUM, FOURIER_APOD_NONE, FOURIER_APOD_STRONG, FOURIER_APOD_WEAK, FOURIER_PLOT_IMAG, FOURIER_PLOT_PHASE, FOURIER_PLOT_PHASE_OPT_REAL, FOURIER_PLOT_POWER, FOURIER_PLOT_REAL, FOURIER_PLOT_REAL_AND_IMAG, FOURIER_UNIT_CYCLES, FOURIER_UNIT_FREQ, FOURIER_UNIT_GAUSS, FOURIER_UNIT_TESLA, fParam, PMsrFourierStructure::fPhase, PMsrFourierStructure::fPhaseParamNo, PMsrFourierStructure::fPlotRange, fPlots, PMsrFourierStructure::fPlotTag, PMsrFourierStructure::fRangeForPhaseCorrection, fRuns, fStartupOptions, fStatistic, fTheory, fTitle, PMsrFourierStructure::fUnits, PMsrStatisticStructure::fValid, PMsrGlobalBlock::GetAddT0Bin(), PMsrGlobalBlock::GetAddT0BinSize(), PMsrGlobalBlock::GetDataRange(), PMsrGlobalBlock::GetFitRange(), PMsrGlobalBlock::GetFitRangeOffset(), PMsrGlobalBlock::GetFitType(), GetFuncIndex(), PMsrGlobalBlock::GetPacking(), PMsrGlobalBlock::GetRRFFreq(), PMsrGlobalBlock::GetRRFPacking(), PMsrGlobalBlock::GetRRFPhase(), PMsrGlobalBlock::GetRRFUnit(), PMsrGlobalBlock::GetT0Bin(), PMsrGlobalBlock::GetT0BinSize(), PMsrGlobalBlock::IsFitRangeInBin(), LastSignificant(), MakeDetectorGroupingString(), MSR_FITTYPE_ASYM, MSR_FITTYPE_ASYM_RRF, MSR_FITTYPE_BNMR, MSR_FITTYPE_MU_MINUS, MSR_FITTYPE_NON_MUSR, MSR_FITTYPE_SINGLE_HISTO, MSR_FITTYPE_SINGLE_HISTO_RRF, MSR_PARAM_FUN_OFFSET, MSR_PLOT_ASYM, MSR_PLOT_ASYM_RRF, MSR_PLOT_BNMR, MSR_PLOT_MU_MINUS, MSR_PLOT_NON_MUSR, MSR_PLOT_SINGLE_HISTO, MSR_PLOT_SINGLE_HISTO_RRF, MSR_TAG_COMMANDS, MSR_TAG_FITPARAMETER, MSR_TAG_FOURIER, MSR_TAG_FUNCTIONS, MSR_TAG_GLOBAL, MSR_TAG_PLOT, MSR_TAG_RUN, MSR_TAG_STATISTIC, MSR_TAG_THEORY, MSR_TAG_TITLE, NeededPrecision(), PMUSR_MSR_LOG_FILE_WRITE_ERROR, PMUSR_MSR_SYNTAX_ERROR, PMUSR_SUCCESS, PMUSR_UNDEFINED, and PStartupOptions::writeExpectedChisq.

Member Data Documentation

◆ fCommands

PMsrLines PMsrHandler::fCommands
private

holds a list of the minuit commands

Definition at line 126 of file PMsrHandler.h.

Referenced by GetMsrCommands(), HandleCommandsEntry(), ReadMsrFile(), WriteMsrFile(), and ~PMsrHandler().

◆ fCopyStatisticsBlock

Bool_t PMsrHandler::fCopyStatisticsBlock
private

flag, if true: just copy to old statistics block (musrt0), otherwise write a new one (musrfit)

Definition at line 137 of file PMsrHandler.h.

Referenced by CopyMsrStatisticBlock(), and PMsrHandler().

◆ fFileName

TString PMsrHandler::fFileName
private

file name of the msr-file

Definition at line 118 of file PMsrHandler.h.

Referenced by GetFileName(), PMsrHandler(), ReadMsrFile(), and WriteMsrLogFile().

◆ fFourier

PMsrFourierStructure PMsrHandler::fFourier
private

holds the parameters used for the Fourier transform

Definition at line 127 of file PMsrHandler.h.

Referenced by BeautifyFourierPhaseParameterString(), GetMsrFourierList(), HandleFourierEntry(), ReadMsrFile(), WriteMsrFile(), and WriteMsrLogFile().

◆ fFourierOnly

Bool_t PMsrHandler::fFourierOnly
private

flag indicating if Fourier transform only is wished. If yes, some part of the msr-file blocks are not needed.

Definition at line 115 of file PMsrHandler.h.

Referenced by CheckFuncs(), CheckRunBlockIntegrity(), HandleCommandsEntry(), HandleFunctionsEntry(), HandleRunEntry(), HandleStatisticEntry(), HandleTheoryEntry(), and ReadMsrFile().

◆ fFuncHandler

std::unique_ptr<PFunctionHandler> PMsrHandler::fFuncHandler
private

needed to parse functions

Definition at line 133 of file PMsrHandler.h.

Referenced by CheckMapAndParamRange(), EvalFunc(), GetFuncIndex(), GetFuncNo(), GetNoOfFuncs(), HandleFunctionsEntry(), and WriteMsrLogFile().

◆ fFunctions

PMsrLines PMsrHandler::fFunctions
private

holds the user defined functions

Definition at line 123 of file PMsrHandler.h.

Referenced by CheckFuncs(), CheckMaps(), GetMsrFunctions(), GetNoOfFitParameters(), HandleFunctionsEntry(), WriteMsrFile(), and ~PMsrHandler().

◆ fGlobal

PMsrGlobalBlock PMsrHandler::fGlobal
private

holds the information of the global section

Definition at line 124 of file PMsrHandler.h.

Referenced by CheckMaxLikelihood(), CheckRRFSettings(), CheckRunBlockIntegrity(), GetMsrGlobal(), HandleGlobalEntry(), WriteMsrFile(), and WriteMsrLogFile().

◆ fMsrBlockCounter

Int_t PMsrHandler::fMsrBlockCounter
private

used to select the proper msr-block

Definition at line 131 of file PMsrHandler.h.

Referenced by PMsrHandler(), and ReadMsrFile().

◆ fMsrFileDirectoryPath

TString PMsrHandler::fMsrFileDirectoryPath
private

msr-file directory path

Definition at line 119 of file PMsrHandler.h.

Referenced by GetMsrFileDirectoryPath(), and PMsrHandler().

◆ fParam

◆ fParamInUse

PIntVector PMsrHandler::fParamInUse
private

array holding the information if a particular parameter is used at all, i.e. if the theory is using it (perhaps via maps or functions)

Definition at line 135 of file PMsrHandler.h.

Referenced by FillParameterInUse(), ParameterInUse(), and ~PMsrHandler().

◆ fPlots

PMsrPlotList PMsrHandler::fPlots
private

holds a list of the plot input parameters

Definition at line 128 of file PMsrHandler.h.

Referenced by CheckLegacyLifetimecorrection(), GetMsrPlotList(), HandlePlotEntry(), ReadMsrFile(), WriteMsrFile(), WriteMsrLogFile(), and ~PMsrHandler().

◆ fRuns

◆ fStartupOptions

PStartupOptions* PMsrHandler::fStartupOptions
private

contains information about startup options from the musrfit_startup.xml

Definition at line 116 of file PMsrHandler.h.

Referenced by EstimateN0(), and WriteMsrLogFile().

◆ fStatistic

◆ fTheory

PMsrLines PMsrHandler::fTheory
private

holds the theory definition

Definition at line 122 of file PMsrHandler.h.

Referenced by CheckFuncs(), CheckMaps(), GetMsrTheory(), GetNoOfFitParameters(), HandleTheoryEntry(), WriteMsrFile(), WriteMsrLogFile(), and ~PMsrHandler().

◆ fTitle

TString PMsrHandler::fTitle
private

holds the title string of the msr-file

Definition at line 120 of file PMsrHandler.h.

Referenced by GetMsrTitle(), PMsrHandler(), ReadMsrFile(), SetMsrTitle(), WriteMsrFile(), and WriteMsrLogFile().


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