|
Laura++
v1r1p1
A maximum likelihood fitting package for performing Dalitz-plot analysis.
|
Abstract interface to the fitting and toy MC model.
More...
#include <LauAbsFitModel.hh>
|
| LauAbsFitModel () |
| Constructor. More...
|
|
virtual | ~LauAbsFitModel () |
| Destructor. More...
|
|
Bool_t | useDP () const |
| Is the Dalitz plot term in the likelihood. More...
|
|
void | useDP (Bool_t usingDP) |
| Switch on/off the Dalitz plot term in the Likelihood (allows fits to other quantities, e.g. B mass) More...
|
|
Bool_t | doSFit () const |
| Return the flag to store the status of using an sFit or not. More...
|
|
void | doSFit (const TString &sWeightBranchName, Double_t scaleFactor=1.0) |
| Do an sFit (use sWeights to isolate signal decays rather than using background histograms) More...
|
|
Bool_t | doEMLFit () const |
| Determine whether an extended maximum likelihood fit it being performed. More...
|
|
void | doEMLFit (Bool_t emlFit) |
| Choice to perform an extended maximum likelihood fit. More...
|
|
Bool_t | doPoissonSmearing () const |
| Determine whether Poisson smearing is enabled for the toy MC generation. More...
|
|
void | doPoissonSmearing (Bool_t poissonSmear) |
| Turn Poisson smearing (for the toy MC generation) on or off. More...
|
|
Bool_t | enableEmbedding () const |
| Determine whether embedding of events is enabled in the generation. More...
|
|
void | enableEmbedding (Bool_t enable) |
| Turn on or off embedding of events in the generation. More...
|
|
Bool_t | twoStageFit () const |
| Determine whether the two-stage fit is enabled. More...
|
|
void | twoStageFit (Bool_t doTwoStageFit) |
| Turn on or off the two stage fit. More...
|
|
Bool_t | useAsymmFitErrors () const |
| Determine whether calculation of asymmetric errors is enabled. More...
|
|
void | useAsymmFitErrors (Bool_t useAsymmErrors) |
| Turn on or off the computation of asymmetric errors (e.g. MINOS routine in Minuit) More...
|
|
Bool_t | writeLatexTable () const |
| Determine whether writing out of the latex table is enabled. More...
|
|
void | writeLatexTable (Bool_t writeTable) |
| Turn on or off the writing out of the latex table. More...
|
|
void | writeSPlotData (const TString &fileName, const TString &treeName, Bool_t storeDPEfficiency, const TString &verbosity="q") |
| Set up the sPlot ntuple. More...
|
|
Bool_t | writeSPlotData () const |
| Determine whether the sPlot data is to be written out. More...
|
|
Bool_t | storeDPEff () const |
| Determine whether the efficiency information should be stored in the sPlot ntuple. More...
|
|
Bool_t | useRandomInitFitPars () const |
| Determine whether the initial values of the fit parameters, in particular the isobar coefficient parameters, are to be randomised. More...
|
|
void | useRandomInitFitPars (Bool_t boolean) |
| Randomise the initial values of the fit parameters, in particular the isobar coefficient parameters. More...
|
|
void | setNExpts (UInt_t nExperiments, UInt_t firstExperiment=0) |
| Set the number of experiments and the first experiment. More...
|
|
UInt_t | eventsPerExpt () const |
| Obtain the total number of events in the current experiment. More...
|
|
UInt_t | nExpt () const |
| Obtain the number of experiments. More...
|
|
UInt_t | firstExpt () const |
| Obtain the number of the first experiment. More...
|
|
UInt_t | iExpt () const |
| Obtain the number of the current experiment. More...
|
|
virtual void | setBkgndClassNames (const std::vector< TString > &names) |
| Setup the background class names. More...
|
|
UInt_t | nBkgndClasses () const |
| Returns the number of background classes. More...
|
|
virtual void | setNSigEvents (LauParameter *nSigEvents)=0 |
| Set the number of signal events. More...
|
|
virtual void | setNBkgndEvents (LauParameter *nBkgndEvents)=0 |
| Set the number of background events. More...
|
|
void | compareFitData (UInt_t toyMCScale=10, const TString &mcFileName="fitToyMC.root", const TString &tableFileName="fitToyMCTable.tex", Bool_t poissonSmearing=kTRUE) |
| Specify that a toy MC sample should be created for a successful fit to an experiment. More...
|
|
virtual void | weightEvents (const TString &dataFileName, const TString &dataTreeName)=0 |
| Reweighting - allows e.g. MC events to be weighted by the DP model. More...
|
|
void | run (const TString &applicationCode, const TString &dataFileName="", const TString &dataTreeName="", const TString &histFileName="", const TString &tableFileName="") |
| Start the toy generation / fitting. More...
|
|
void | runMaster (const TString &applicationCode, const TString &dataFileName="", const TString &dataTreeName="", const TString &histFileName="", const TString &tableFileName="", const UInt_t nSlaves=0) |
| Start the master process for the generation / fitting. More...
|
|
void | runSlave (const TString &applicationCode, const TString &dataFileName="", const TString &dataTreeName="", const TString &histFileName="", const TString &tableFileName="", const TString &addressMaster="") |
| Start the slave process for the generation / fitting. More...
|
|
virtual void | setParsFromMinuit (Double_t *par, Int_t npar) |
| This function sets the parameter values from Minuit. More...
|
|
Double_t | calculateLogLike (Int_t npar, Double_t *par, Int_t iflag) |
| Calculate the new value of the negative log likelihood. More...
|
|
|
void | initSockets () |
| Initialise socket connections for the slaves. More...
|
|
void | clearFitParVectors () |
| Clear the vectors containing fit parameters. More...
|
|
void | clearExtraVarVectors () |
| Clear the vectors containing extra ntuple variables. More...
|
|
virtual void | generate (const TString &dataFileName, const TString &dataTreeName, const TString &histFileName, const TString &tableFileNameBase) |
| Generate toy MC. More...
|
|
virtual Bool_t | genExpt ()=0 |
| The method that actually generates the toy MC events for the given experiment. More...
|
|
void | fit (const TString &dataFileName, const TString &dataTreeName, const TString &histFileName, const TString &tableFileNameBase) |
| Perform the total fit. More...
|
|
void | fitMaster (const TString &dataFileName, const TString &dataTreeName, const TString &histFileName, const TString &tableFileNameBase) |
| Master fit used when simultaneous fit is required. More...
|
|
void | fitSlave (const TString &dataFileName, const TString &dataTreeName) |
| Slaves required when performing a simultaneous fit. More...
|
|
void | fitExpt () |
| Routine to perform the actual fit for a given experiment. More...
|
|
Bool_t | runMinimisation () |
| Routine to perform the minimisation. More...
|
|
void | createFitToyMC (const TString &mcFileName, const TString &tableFileName) |
| Create a toy MC sample from the fitted parameters. More...
|
|
Bool_t | cacheFitData (const TString &dataFileName, const TString &dataTreeName) |
| Store variables from the input file into the internal data storage. More...
|
|
virtual void | cacheInputFitVars ()=0 |
| Cache the input data values to calculate the likelihood during the fit. More...
|
|
virtual void | cacheInputSWeights () |
| Cache the value of the sWeights to be used in the sFit. More...
|
|
virtual void | initialise ()=0 |
| Initialise the fit par vectors. More...
|
|
virtual void | initialiseDPModels ()=0 |
| Initialise the DP models. More...
|
|
virtual void | updateCoeffs ()=0 |
|
virtual void | propagateParUpdates ()=0 |
| This function (specific to each model) calculates anything that depends on the fit parameter values. More...
|
|
Double_t | getTotNegLogLikelihood () |
| Retrieves the total negative log-likelihood. More...
|
|
Double_t | getLogLikelihood (UInt_t iStart, UInt_t iEnd) |
| Calculate the sum of the log-likelihood over the specified events. More...
|
|
virtual Double_t | getTotEvtLikelihood (UInt_t iEvt)=0 |
| Calculates the likelihood for a given event. More...
|
|
virtual Double_t | getEventSum () const =0 |
| Returns the sum of the expected events over all hypotheses; used in the EML fit scenario. More...
|
|
virtual void | printEventInfo (UInt_t iEvt) const |
| Prints the values of all the fit variables for the specified event - useful for diagnostics. More...
|
|
virtual void | printVarsInfo () const |
| Same as printEventInfo, but printing out the values of the variables in the fit. More...
|
|
virtual void | checkInitFitParams ()=0 |
| Update initial fit parameters if required. More...
|
|
virtual void | finaliseFitResults (const TString &tableFileName)=0 |
| Write the results of the fit into the ntuple. More...
|
|
virtual void | writeOutTable (const TString &outputFile)=0 |
| Write the latex table. More...
|
|
virtual void | storePerEvtLlhds ()=0 |
| Store the per-event likelihood values. More...
|
|
virtual void | writeOutAllFitResults () |
| Write out any fit results. More...
|
|
virtual void | calculateSPlotData () |
| Calculate the sPlot data. More...
|
|
void | setGenValues () |
| Make sure all parameters hold their genValue as the current value. More...
|
|
virtual void | setupBkgndVectors ()=0 |
| Method to set up the storage for background-related quantities called by setBkgndClassNames. More...
|
|
Bool_t | validBkgndClass (const TString &className) const |
| Check if the given background class is in the list. More...
|
|
UInt_t | bkgndClassID (const TString &className) const |
| The number assigned to a background class. More...
|
|
const TString & | bkgndClassName (UInt_t classID) const |
| Get the name of a background class from the number. More...
|
|
void | eventsPerExpt (UInt_t nEvents) |
| Set the number of events in the current experiment. More...
|
|
virtual void | setupGenNtupleBranches ()=0 |
| Setup the generation ntuple branches. More...
|
|
virtual void | addGenNtupleIntegerBranch (const TString &name) |
| Add a branch to the gen tree for storing an integer. More...
|
|
virtual void | addGenNtupleDoubleBranch (const TString &name) |
| Add a branch to the gen tree for storing a double. More...
|
|
virtual void | setGenNtupleIntegerBranchValue (const TString &name, Int_t value) |
| Set the value of an integer branch in the gen tree. More...
|
|
virtual void | setGenNtupleDoubleBranchValue (const TString &name, Double_t value) |
| Set the value of a double branch in the gen tree. More...
|
|
virtual Int_t | getGenNtupleIntegerBranchValue (const TString &name) const |
| Get the value of an integer branch in the gen tree. More...
|
|
virtual Double_t | getGenNtupleDoubleBranchValue (const TString &name) const |
| Get the value of a double branch in the gen tree. More...
|
|
virtual void | fillGenNtupleBranches () |
| Fill the gen tuple branches. More...
|
|
virtual void | setupSPlotNtupleBranches ()=0 |
| Setup the branches of the sPlot tuple. More...
|
|
virtual void | addSPlotNtupleIntegerBranch (const TString &name) |
| Add a branch to the sPlot tree for storing an integer. More...
|
|
virtual void | addSPlotNtupleDoubleBranch (const TString &name) |
| Add a branch to the sPlot tree for storing a double. More...
|
|
virtual void | setSPlotNtupleIntegerBranchValue (const TString &name, Int_t value) |
| Set the value of an integer branch in the sPlot tree. More...
|
|
virtual void | setSPlotNtupleDoubleBranchValue (const TString &name, Double_t value) |
| Set the value of a double branch in the sPlot tree. More...
|
|
virtual void | fillSPlotNtupleBranches () |
| Fill the sPlot tuple. More...
|
|
virtual LauSPlot::NameSet | variableNames () const =0 |
| Returns the names of all variables in the fit. More...
|
|
virtual LauSPlot::NumbMap | freeSpeciesNames () const =0 |
| Returns the names and yields of species that are free in the fit. More...
|
|
virtual LauSPlot::NumbMap | fixdSpeciesNames () const =0 |
| Returns the names and yields of species that are fixed in the fit. More...
|
|
virtual LauSPlot::TwoDMap | twodimPDFs () const =0 |
| Returns the species and variables for all 2D PDFs in the fit. More...
|
|
virtual Bool_t | splitSignal () const =0 |
| Check if the signal is split into well-reconstructed and mis-reconstructed types. More...
|
|
virtual Bool_t | scfDPSmear () const =0 |
| Check if the mis-reconstructed signal is to be smeared in the DP. More...
|
|
UInt_t | addFitParameters (LauPdfList &pdfList) |
| Add parameters of the PDFs in the list to the list of all fit parameters. More...
|
|
void | printFitParameters (const LauPdfList &pdfList, std::ostream &fout) const |
| Print the fit parameters for all PDFs in the list. More...
|
|
void | updateFitParameters (LauPdfList &pdfList) |
| Update the fit parameters for all PDFs in the list. More...
|
|
void | cacheInfo (LauPdfList &pdfList, const LauFitDataTree &theData) |
| Have all PDFs in the list cache the data. More...
|
|
Double_t | prodPdfValue (LauPdfList &pdfList, UInt_t iEvt) |
| Calculate the product of the per-event likelihoods of the PDFs in the list. More...
|
|
Bool_t | pdfsDependOnDP () const |
| Do any of the PDFs have a dependence on the DP? More...
|
|
void | pdfsDependOnDP (Bool_t dependOnDP) |
| Do any of the PDFs have a dependence on the DP? More...
|
|
const LauParameterPList & | fitPars () const |
| Access the fit variables. More...
|
|
LauParameterPList & | fitPars () |
|
const LauParameterList & | extraPars () const |
| Access the extra variables. More...
|
|
LauParameterList & | extraPars () |
|
const LauFitNtuple * | fitNtuple () const |
| Access the fit ntuple. More...
|
|
LauFitNtuple * | fitNtuple () |
|
const LauGenNtuple * | genNtuple () const |
| Access the gen ntuple. More...
|
|
LauGenNtuple * | genNtuple () |
|
const LauGenNtuple * | sPlotNtuple () const |
| Access the sPlot ntuple. More...
|
|
LauGenNtuple * | sPlotNtuple () |
|
const LauFitDataTree * | fitData () const |
| Access the data store. More...
|
|
LauFitDataTree * | fitData () |
|
Double_t | nll () const |
| Access the current NLL value. More...
|
|
Int_t | fitStatus () const |
| Access the fit status information. More...
|
|
Abstract interface to the fitting and toy MC model.
Abstract interface to the fitting and toy MC model
Any class inheriting from this must implement the following functions:
Definition at line 71 of file LauAbsFitModel.hh.
LauAbsFitModel::LauAbsFitModel |
( |
| ) |
|
LauAbsFitModel::~LauAbsFitModel |
( |
| ) |
|
|
virtual |
UInt_t LauAbsFitModel::addFitParameters |
( |
LauPdfList & |
pdfList | ) |
|
|
protected |
Add parameters of the PDFs in the list to the list of all fit parameters.
- Parameters
-
[in] | pdfList | a list of Pdfs |
- Returns
- the number of parameters added
Definition at line 1246 of file LauAbsFitModel.cc.
void LauAbsFitModel::addGenNtupleDoubleBranch |
( |
const TString & |
name | ) |
|
|
protectedvirtual |
Add a branch to the gen tree for storing a double.
- Parameters
-
[in] | name | the name of the branch |
Definition at line 493 of file LauAbsFitModel.cc.
void LauAbsFitModel::addGenNtupleIntegerBranch |
( |
const TString & |
name | ) |
|
|
protectedvirtual |
Add a branch to the gen tree for storing an integer.
- Parameters
-
[in] | name | the name of the branch |
Definition at line 488 of file LauAbsFitModel.cc.
void LauAbsFitModel::addSPlotNtupleDoubleBranch |
( |
const TString & |
name | ) |
|
|
protectedvirtual |
Add a branch to the sPlot tree for storing a double.
- Parameters
-
[in] | name | the name of the branch |
Definition at line 528 of file LauAbsFitModel.cc.
void LauAbsFitModel::addSPlotNtupleIntegerBranch |
( |
const TString & |
name | ) |
|
|
protectedvirtual |
Add a branch to the sPlot tree for storing an integer.
- Parameters
-
[in] | name | the name of the branch |
Definition at line 523 of file LauAbsFitModel.cc.
UInt_t LauAbsFitModel::bkgndClassID |
( |
const TString & |
className | ) |
const |
|
protected |
The number assigned to a background class.
- Parameters
-
[in] | className | the name of the class to check |
- Returns
- the background class ID number
Definition at line 348 of file LauAbsFitModel.cc.
const TString & LauAbsFitModel::bkgndClassName |
( |
UInt_t |
classID | ) |
const |
|
protected |
Get the name of a background class from the number.
- Parameters
-
[in] | classID | the ID number of the background class |
- Returns
- the class name
Definition at line 366 of file LauAbsFitModel.cc.
Bool_t LauAbsFitModel::cacheFitData |
( |
const TString & |
dataFileName, |
|
|
const TString & |
dataTreeName |
|
) |
| |
|
protected |
Store variables from the input file into the internal data storage.
- Parameters
-
[in] | dataFileName | the name of the input file |
[in] | dataTreeName | the name of the input tree |
Definition at line 761 of file LauAbsFitModel.cc.
Have all PDFs in the list cache the data.
- Parameters
-
[in] | pdfList | the list of pdfs |
[in] | theData | the data from the fit |
Definition at line 1294 of file LauAbsFitModel.cc.
virtual void LauAbsFitModel::cacheInputFitVars |
( |
| ) |
|
|
protectedpure virtual |
void LauAbsFitModel::cacheInputSWeights |
( |
| ) |
|
|
protectedvirtual |
Cache the value of the sWeights to be used in the sFit.
Definition at line 777 of file LauAbsFitModel.cc.
Double_t LauAbsFitModel::calculateLogLike |
( |
Int_t |
npar, |
|
|
Double_t * |
par, |
|
|
Int_t |
iflag |
|
) |
| |
Calculate the new value of the negative log likelihood.
This function has to be public since it is called from the global FCN. It should not be called otherwise!
- Parameters
-
[in] | npar | the number of free parameters |
[in] | par | an array of all of the fit parameter values |
[in] | iflag | a Minuit flag |
Definition at line 1328 of file LauAbsFitModel.cc.
void LauAbsFitModel::calculateSPlotData |
( |
| ) |
|
|
protectedvirtual |
virtual void LauAbsFitModel::checkInitFitParams |
( |
| ) |
|
|
protectedpure virtual |
void LauAbsFitModel::clearExtraVarVectors |
( |
| ) |
|
|
protected |
Clear the vectors containing extra ntuple variables.
Definition at line 384 of file LauAbsFitModel.cc.
void LauAbsFitModel::clearFitParVectors |
( |
| ) |
|
|
protected |
void LauAbsFitModel::compareFitData |
( |
UInt_t |
toyMCScale = 10 , |
|
|
const TString & |
mcFileName = "fitToyMC.root" , |
|
|
const TString & |
tableFileName = "fitToyMCTable.tex" , |
|
|
Bool_t |
poissonSmearing = kTRUE |
|
) |
| |
Specify that a toy MC sample should be created for a successful fit to an experiment.
Generation uses the fitted parameters so that the user can compare the fit to the data
- Parameters
-
[in] | toyMCScale | the scale factor to get the number of events to generate |
[in] | mcFileName | the file name where the toy sample will be stored |
[in] | tableFileName | name of the output tex file |
[in] | poissonSmearing | turn smearing on or off |
Definition at line 1025 of file LauAbsFitModel.cc.
void LauAbsFitModel::createFitToyMC |
( |
const TString & |
mcFileName, |
|
|
const TString & |
tableFileName |
|
) |
| |
|
protected |
Create a toy MC sample from the fitted parameters.
- Parameters
-
[in] | mcFileName | the file name where the toy sample will be stored |
[in] | tableFileName | name of the output tex file |
Definition at line 1034 of file LauAbsFitModel.cc.
Bool_t LauAbsFitModel::doEMLFit |
( |
| ) |
const |
|
inline |
Determine whether an extended maximum likelihood fit it being performed.
Definition at line 100 of file LauAbsFitModel.hh.
void LauAbsFitModel::doEMLFit |
( |
Bool_t |
emlFit | ) |
|
|
inline |
Choice to perform an extended maximum likelihood fit.
- Parameters
-
[in] | emlFit | boolean specifying whether or not to perform the EML |
Definition at line 106 of file LauAbsFitModel.hh.
Bool_t LauAbsFitModel::doPoissonSmearing |
( |
| ) |
const |
|
inline |
Determine whether Poisson smearing is enabled for the toy MC generation.
Definition at line 109 of file LauAbsFitModel.hh.
void LauAbsFitModel::doPoissonSmearing |
( |
Bool_t |
poissonSmear | ) |
|
|
inline |
Turn Poisson smearing (for the toy MC generation) on or off.
- Parameters
-
[in] | poissonSmear | boolean specifying whether or not to do Poisson smearing |
Definition at line 115 of file LauAbsFitModel.hh.
Bool_t LauAbsFitModel::doSFit |
( |
| ) |
const |
|
inline |
Return the flag to store the status of using an sFit or not.
Definition at line 90 of file LauAbsFitModel.hh.
void LauAbsFitModel::doSFit |
( |
const TString & |
sWeightBranchName, |
|
|
Double_t |
scaleFactor = 1.0 |
|
) |
| |
Do an sFit (use sWeights to isolate signal decays rather than using background histograms)
- Parameters
-
[in] | sWeightBranchName | name of the branch of the tree containing the sWeights |
[in] | scaleFactor | scaling factor to get the uncertainties correct |
Definition at line 304 of file LauAbsFitModel.cc.
Bool_t LauAbsFitModel::enableEmbedding |
( |
| ) |
const |
|
inline |
Determine whether embedding of events is enabled in the generation.
Definition at line 118 of file LauAbsFitModel.hh.
void LauAbsFitModel::enableEmbedding |
( |
Bool_t |
enable | ) |
|
|
inline |
Turn on or off embedding of events in the generation.
- Parameters
-
[in] | enable | boolean specifying whether to embed events |
Definition at line 124 of file LauAbsFitModel.hh.
UInt_t LauAbsFitModel::eventsPerExpt |
( |
| ) |
const |
|
inline |
Obtain the total number of events in the current experiment.
Definition at line 188 of file LauAbsFitModel.hh.
void LauAbsFitModel::eventsPerExpt |
( |
UInt_t |
nEvents | ) |
|
|
inlineprotected |
Set the number of events in the current experiment.
Definition at line 495 of file LauAbsFitModel.hh.
void LauAbsFitModel::fillGenNtupleBranches |
( |
| ) |
|
|
protectedvirtual |
void LauAbsFitModel::fillSPlotNtupleBranches |
( |
| ) |
|
|
protectedvirtual |
virtual void LauAbsFitModel::finaliseFitResults |
( |
const TString & |
tableFileName | ) |
|
|
protectedpure virtual |
Write the results of the fit into the ntuple.
- Parameters
-
[in] | tableFileName | the structure containing the results of the fit |
Implemented in LauCPFitModel, and LauSimpleFitModel.
UInt_t LauAbsFitModel::firstExpt |
( |
| ) |
const |
|
inline |
void LauAbsFitModel::fit |
( |
const TString & |
dataFileName, |
|
|
const TString & |
dataTreeName, |
|
|
const TString & |
histFileName, |
|
|
const TString & |
tableFileNameBase |
|
) |
| |
|
protected |
Perform the total fit.
- Parameters
-
[in] | dataFileName | the name of the data file |
[in] | dataTreeName | the name of the tree containing the data |
[in] | histFileName | the name of the histogram output file |
[in] | tableFileNameBase | the name the of latex output file |
Definition at line 548 of file LauAbsFitModel.cc.
void LauAbsFitModel::fitExpt |
( |
| ) |
|
|
protected |
Routine to perform the actual fit for a given experiment.
Definition at line 801 of file LauAbsFitModel.cc.
void LauAbsFitModel::fitMaster |
( |
const TString & |
dataFileName, |
|
|
const TString & |
dataTreeName, |
|
|
const TString & |
histFileName, |
|
|
const TString & |
tableFileNameBase |
|
) |
| |
|
protected |
Master fit used when simultaneous fit is required.
- Parameters
-
[in] | dataFileName | the name of the data file |
[in] | dataTreeName | the name of the tree containing the data |
[in] | histFileName | the name of the histogram output file |
[in] | tableFileNameBase | the name the of output file |
Definition at line 676 of file LauAbsFitModel.cc.
void LauAbsFitModel::fitSlave |
( |
const TString & |
dataFileName, |
|
|
const TString & |
dataTreeName |
|
) |
| |
|
protected |
Slaves required when performing a simultaneous fit.
- Parameters
-
[in] | dataFileName | the name of the data file |
[in] | dataTreeName | the name of the tree containing the data |
Definition at line 681 of file LauAbsFitModel.cc.
Int_t LauAbsFitModel::fitStatus |
( |
| ) |
const |
|
inlineprotected |
void LauAbsFitModel::generate |
( |
const TString & |
dataFileName, |
|
|
const TString & |
dataTreeName, |
|
|
const TString & |
histFileName, |
|
|
const TString & |
tableFileNameBase |
|
) |
| |
|
protectedvirtual |
Generate toy MC.
- Parameters
-
[in] | dataFileName | the name of the file where the generated events are stored |
[in] | dataTreeName | the name of the tree used to store the variables |
[in] | histFileName | the name of the histogram output file (currently not used) |
[in] | tableFileNameBase | the name the latex output file |
Definition at line 416 of file LauAbsFitModel.cc.
virtual Bool_t LauAbsFitModel::genExpt |
( |
| ) |
|
|
protectedpure virtual |
The method that actually generates the toy MC events for the given experiment.
- Returns
- the success/failure flag of the generation procedure
Implemented in LauCPFitModel, and LauSimpleFitModel.
virtual Double_t LauAbsFitModel::getEventSum |
( |
| ) |
const |
|
protectedpure virtual |
Double_t LauAbsFitModel::getGenNtupleDoubleBranchValue |
( |
const TString & |
name | ) |
const |
|
protectedvirtual |
Get the value of a double branch in the gen tree.
- Parameters
-
[in] | name | the name of the branch |
- Returns
- the value of the parameter
Definition at line 513 of file LauAbsFitModel.cc.
Int_t LauAbsFitModel::getGenNtupleIntegerBranchValue |
( |
const TString & |
name | ) |
const |
|
protectedvirtual |
Get the value of an integer branch in the gen tree.
- Parameters
-
[in] | name | the name of the branch |
- Returns
- the value of the parameter
Definition at line 508 of file LauAbsFitModel.cc.
Double_t LauAbsFitModel::getLogLikelihood |
( |
UInt_t |
iStart, |
|
|
UInt_t |
iEnd |
|
) |
| |
|
protected |
Calculate the sum of the log-likelihood over the specified events.
- Parameters
-
[in] | iStart | the event number of the first event to be considered |
[in] | iEnd | the event number of the final event to be considered |
Definition at line 1176 of file LauAbsFitModel.cc.
virtual Double_t LauAbsFitModel::getTotEvtLikelihood |
( |
UInt_t |
iEvt | ) |
|
|
protectedpure virtual |
Double_t LauAbsFitModel::getTotNegLogLikelihood |
( |
| ) |
|
|
protected |
UInt_t LauAbsFitModel::iExpt |
( |
| ) |
const |
|
inline |
virtual void LauAbsFitModel::initialise |
( |
| ) |
|
|
protectedpure virtual |
Initialise the fit par vectors.
Each class that inherits from this one must implement this sensibly for all vectors specified in clearFitParVectors, i.e. specify parameter names, initial, min, max and fixed values
Implemented in LauCPFitModel, and LauSimpleFitModel.
virtual void LauAbsFitModel::initialiseDPModels |
( |
| ) |
|
|
protectedpure virtual |
void LauAbsFitModel::initSockets |
( |
| ) |
|
|
protected |
UInt_t LauAbsFitModel::nBkgndClasses |
( |
| ) |
const |
|
inline |
UInt_t LauAbsFitModel::nExpt |
( |
| ) |
const |
|
inline |
Double_t LauAbsFitModel::nll |
( |
| ) |
const |
|
inlineprotected |
Bool_t LauAbsFitModel::pdfsDependOnDP |
( |
| ) |
const |
|
inlineprotected |
Do any of the PDFs have a dependence on the DP?
- Returns
- the flag to indicated if there is a DP dependence
Definition at line 631 of file LauAbsFitModel.hh.
void LauAbsFitModel::pdfsDependOnDP |
( |
Bool_t |
dependOnDP | ) |
|
|
inlineprotected |
Do any of the PDFs have a dependence on the DP?
- Parameters
-
[in] | dependOnDP | the flag to indicated if there is a DP dependence |
Definition at line 637 of file LauAbsFitModel.hh.
void LauAbsFitModel::printEventInfo |
( |
UInt_t |
iEvt | ) |
const |
|
protectedvirtual |
Prints the values of all the fit variables for the specified event - useful for diagnostics.
- Parameters
-
Definition at line 1311 of file LauAbsFitModel.cc.
void LauAbsFitModel::printFitParameters |
( |
const LauPdfList & |
pdfList, |
|
|
std::ostream & |
fout |
|
) |
| const |
|
protected |
Print the fit parameters for all PDFs in the list.
- Parameters
-
[in] | pdfList | a list of Pdfs |
[in] | fout | the output stream to write to |
Definition at line 1273 of file LauAbsFitModel.cc.
void LauAbsFitModel::printVarsInfo |
( |
| ) |
const |
|
protectedvirtual |
Same as printEventInfo, but printing out the values of the variables in the fit.
Definition at line 1320 of file LauAbsFitModel.cc.
Double_t LauAbsFitModel::prodPdfValue |
( |
LauPdfList & |
pdfList, |
|
|
UInt_t |
iEvt |
|
) |
| |
|
protected |
Calculate the product of the per-event likelihoods of the PDFs in the list.
- Parameters
-
[in] | pdfList | the list of pdfs |
[in] | iEvt | the event number |
Definition at line 1301 of file LauAbsFitModel.cc.
virtual void LauAbsFitModel::propagateParUpdates |
( |
| ) |
|
|
protectedpure virtual |
This function (specific to each model) calculates anything that depends on the fit parameter values.
Implemented in LauCPFitModel, and LauSimpleFitModel.
void LauAbsFitModel::run |
( |
const TString & |
applicationCode, |
|
|
const TString & |
dataFileName = "" , |
|
|
const TString & |
dataTreeName = "" , |
|
|
const TString & |
histFileName = "" , |
|
|
const TString & |
tableFileName = "" |
|
) |
| |
Start the toy generation / fitting.
- Parameters
-
[in] | applicationCode | specifies what to do, perform a fit ("fit") or generate toy MC ("gen") |
[in] | dataFileName | the name of the input data file |
[in] | dataTreeName | the name of the tree containing the data |
[in] | histFileName | the file name for the output histograms |
[in] | tableFileName | the file name for the latex output file |
Definition at line 123 of file LauAbsFitModel.cc.
void LauAbsFitModel::runMaster |
( |
const TString & |
applicationCode, |
|
|
const TString & |
dataFileName = "" , |
|
|
const TString & |
dataTreeName = "" , |
|
|
const TString & |
histFileName = "" , |
|
|
const TString & |
tableFileName = "" , |
|
|
const UInt_t |
nSlaves = 0 |
|
) |
| |
Start the master process for the generation / fitting.
- Parameters
-
[in] | applicationCode | specifies what to do, perform a fit ("fit") or generate toy MC ("gen") |
[in] | dataFileName | the name of the input data file |
[in] | dataTreeName | the name of the tree containing the data |
[in] | histFileName | the file name for the output histograms |
[in] | tableFileName | the file name for the latex output file |
[in] | nSlaves | the number of slave processes to be used |
Definition at line 167 of file LauAbsFitModel.cc.
Bool_t LauAbsFitModel::runMinimisation |
( |
| ) |
|
|
protected |
Routine to perform the minimisation.
- Returns
- the success/failure flag of the fit
Definition at line 931 of file LauAbsFitModel.cc.
void LauAbsFitModel::runSlave |
( |
const TString & |
applicationCode, |
|
|
const TString & |
dataFileName = "" , |
|
|
const TString & |
dataTreeName = "" , |
|
|
const TString & |
histFileName = "" , |
|
|
const TString & |
tableFileName = "" , |
|
|
const TString & |
addressMaster = "" |
|
) |
| |
Start the slave process for the generation / fitting.
- Parameters
-
[in] | applicationCode | specifies what to do, perform a fit ("fit") or generate toy MC ("gen") |
[in] | dataFileName | the name of the input data file |
[in] | dataTreeName | the name of the tree containing the data |
[in] | histFileName | the file name for the output histograms |
[in] | tableFileName | the file name for the latex output file |
[in] | addressMaster | the hostname of the machine running the master process |
Definition at line 225 of file LauAbsFitModel.cc.
virtual Bool_t LauAbsFitModel::scfDPSmear |
( |
| ) |
const |
|
protectedpure virtual |
void LauAbsFitModel::setBkgndClassNames |
( |
const std::vector< TString > & |
names | ) |
|
|
virtual |
Setup the background class names.
- Parameters
-
[in] | names | a vector of all the background names |
Definition at line 316 of file LauAbsFitModel.cc.
void LauAbsFitModel::setGenNtupleDoubleBranchValue |
( |
const TString & |
name, |
|
|
Double_t |
value |
|
) |
| |
|
protectedvirtual |
Set the value of a double branch in the gen tree.
- Parameters
-
[in] | name | the name of the branch |
[in] | value | the value to be stored |
Definition at line 503 of file LauAbsFitModel.cc.
void LauAbsFitModel::setGenNtupleIntegerBranchValue |
( |
const TString & |
name, |
|
|
Int_t |
value |
|
) |
| |
|
protectedvirtual |
Set the value of an integer branch in the gen tree.
- Parameters
-
[in] | name | the name of the branch |
[in] | value | the value to be stored |
Definition at line 498 of file LauAbsFitModel.cc.
void LauAbsFitModel::setGenValues |
( |
| ) |
|
|
protected |
Make sure all parameters hold their genValue as the current value.
Definition at line 390 of file LauAbsFitModel.cc.
virtual void LauAbsFitModel::setNBkgndEvents |
( |
LauParameter * |
nBkgndEvents | ) |
|
|
pure virtual |
Set the number of background events.
The name of the parameter must be that of the corresponding background category (so that it can be correctly assigned)
- Parameters
-
[in] | nBkgndEvents | contains the name, yield and option to fix the yield of the background |
Implemented in LauCPFitModel, and LauSimpleFitModel.
void LauAbsFitModel::setNExpts |
( |
UInt_t |
nExperiments, |
|
|
UInt_t |
firstExperiment = 0 |
|
) |
| |
|
inline |
Set the number of experiments and the first experiment.
- Parameters
-
[in] | nExperiments | the number of experiments |
[in] | firstExperiment | the number of the first experiment |
Definition at line 182 of file LauAbsFitModel.hh.
virtual void LauAbsFitModel::setNSigEvents |
( |
LauParameter * |
nSigEvents | ) |
|
|
pure virtual |
Set the number of signal events.
- Parameters
-
[in] | nSigEvents | contains the signal yield and option to fix it |
Implemented in LauCPFitModel, and LauSimpleFitModel.
void LauAbsFitModel::setParsFromMinuit |
( |
Double_t * |
par, |
|
|
Int_t |
npar |
|
) |
| |
|
virtual |
This function sets the parameter values from Minuit.
This function has to be public since it is called from the global FCN. It should not be called otherwise!
- Parameters
-
[in] | par | an array storing the various parameter values |
[in] | npar | the number of free parameters |
Definition at line 1216 of file LauAbsFitModel.cc.
void LauAbsFitModel::setSPlotNtupleDoubleBranchValue |
( |
const TString & |
name, |
|
|
Double_t |
value |
|
) |
| |
|
protectedvirtual |
Set the value of a double branch in the sPlot tree.
- Parameters
-
[in] | name | the name of the branch |
[in] | value | the value to be stored |
Definition at line 538 of file LauAbsFitModel.cc.
void LauAbsFitModel::setSPlotNtupleIntegerBranchValue |
( |
const TString & |
name, |
|
|
Int_t |
value |
|
) |
| |
|
protectedvirtual |
Set the value of an integer branch in the sPlot tree.
- Parameters
-
[in] | name | the name of the branch |
[in] | value | the value to be stored |
Definition at line 533 of file LauAbsFitModel.cc.
virtual void LauAbsFitModel::setupBkgndVectors |
( |
| ) |
|
|
protectedpure virtual |
virtual void LauAbsFitModel::setupGenNtupleBranches |
( |
| ) |
|
|
protectedpure virtual |
virtual void LauAbsFitModel::setupSPlotNtupleBranches |
( |
| ) |
|
|
protectedpure virtual |
virtual Bool_t LauAbsFitModel::splitSignal |
( |
| ) |
const |
|
protectedpure virtual |
Bool_t LauAbsFitModel::storeDPEff |
( |
| ) |
const |
|
inline |
Determine whether the efficiency information should be stored in the sPlot ntuple.
Definition at line 169 of file LauAbsFitModel.hh.
virtual void LauAbsFitModel::storePerEvtLlhds |
( |
| ) |
|
|
protectedpure virtual |
Bool_t LauAbsFitModel::twoStageFit |
( |
| ) |
const |
|
inline |
void LauAbsFitModel::twoStageFit |
( |
Bool_t |
doTwoStageFit | ) |
|
|
inline |
Turn on or off the two stage fit.
The two-stage fit allows certain parameters to be fixed in one stage and floated in another stage of the fit. Can be used, for example, in a CP fit where the CP-parameters are fixed to zero in the first stage (while the CP-average parameters are determined), then floated in the second.
- Parameters
-
[in] | doTwoStageFit | boolean specifying whether or not the two-stage fit should be enabled |
Definition at line 136 of file LauAbsFitModel.hh.
virtual void LauAbsFitModel::updateCoeffs |
( |
| ) |
|
|
protectedpure virtual |
For each amp in the fit this function takes its particular parameters and from them calculates the single complex number that is its coefficient. The vector of these coeffs can then be passed to the signal dynamics.
Implemented in LauCPFitModel, and LauSimpleFitModel.
void LauAbsFitModel::updateFitParameters |
( |
LauPdfList & |
pdfList | ) |
|
|
protected |
Update the fit parameters for all PDFs in the list.
- Parameters
-
[in] | pdfList | a list of Pdfs |
Definition at line 1266 of file LauAbsFitModel.cc.
Bool_t LauAbsFitModel::useAsymmFitErrors |
( |
| ) |
const |
|
inline |
Determine whether calculation of asymmetric errors is enabled.
Definition at line 139 of file LauAbsFitModel.hh.
void LauAbsFitModel::useAsymmFitErrors |
( |
Bool_t |
useAsymmErrors | ) |
|
|
inline |
Turn on or off the computation of asymmetric errors (e.g. MINOS routine in Minuit)
- Parameters
-
[in] | useAsymmErrors | boolean specifying whether or not the computation of asymmetric errors is enabled |
Definition at line 145 of file LauAbsFitModel.hh.
Bool_t LauAbsFitModel::useDP |
( |
| ) |
const |
|
inline |
void LauAbsFitModel::useDP |
( |
Bool_t |
usingDP | ) |
|
|
inline |
Switch on/off the Dalitz plot term in the Likelihood (allows fits to other quantities, e.g. B mass)
- Parameters
-
[in] | usingDP | the boolean flag |
Definition at line 87 of file LauAbsFitModel.hh.
Bool_t LauAbsFitModel::useRandomInitFitPars |
( |
| ) |
const |
|
inline |
Determine whether the initial values of the fit parameters, in particular the isobar coefficient parameters, are to be randomised.
Definition at line 172 of file LauAbsFitModel.hh.
void LauAbsFitModel::useRandomInitFitPars |
( |
Bool_t |
boolean | ) |
|
|
inline |
Randomise the initial values of the fit parameters, in particular the isobar coefficient parameters.
Definition at line 175 of file LauAbsFitModel.hh.
Bool_t LauAbsFitModel::validBkgndClass |
( |
const TString & |
className | ) |
const |
|
protected |
Check if the given background class is in the list.
- Parameters
-
[in] | className | the name of the class to check |
- Returns
- true or false
Definition at line 331 of file LauAbsFitModel.cc.
virtual void LauAbsFitModel::weightEvents |
( |
const TString & |
dataFileName, |
|
|
const TString & |
dataTreeName |
|
) |
| |
|
pure virtual |
Reweighting - allows e.g. MC events to be weighted by the DP model.
- Parameters
-
[in] | dataFileName | the name of the data file |
[in] | dataTreeName | the name of the tree containing the data |
Implemented in LauCPFitModel, and LauSimpleFitModel.
Bool_t LauAbsFitModel::writeLatexTable |
( |
| ) |
const |
|
inline |
Determine whether writing out of the latex table is enabled.
Definition at line 148 of file LauAbsFitModel.hh.
void LauAbsFitModel::writeLatexTable |
( |
Bool_t |
writeTable | ) |
|
|
inline |
Turn on or off the writing out of the latex table.
- Parameters
-
[in] | writeTable | boolean specifying whether or not the latex table should be written out |
Definition at line 154 of file LauAbsFitModel.hh.
void LauAbsFitModel::writeOutAllFitResults |
( |
| ) |
|
|
protectedvirtual |
virtual void LauAbsFitModel::writeOutTable |
( |
const TString & |
outputFile | ) |
|
|
protectedpure virtual |
void LauAbsFitModel::writeSPlotData |
( |
const TString & |
fileName, |
|
|
const TString & |
treeName, |
|
|
Bool_t |
storeDPEfficiency, |
|
|
const TString & |
verbosity = "q" |
|
) |
| |
Set up the sPlot ntuple.
- Parameters
-
[in] | fileName | the sPlot file name |
[in] | treeName | the sPlot tree name |
[in] | storeDPEfficiency | whether or not to store the efficiency information too |
[in] | verbosity | define the level of output |
Definition at line 399 of file LauAbsFitModel.cc.
Bool_t LauAbsFitModel::writeSPlotData |
( |
| ) |
const |
|
inline |
Determine whether the sPlot data is to be written out.
Definition at line 166 of file LauAbsFitModel.hh.
Bool_t LauAbsFitModel::compareFitData_ |
|
private |
Option to make toy from 1st successful experiment.
Definition at line 676 of file LauAbsFitModel.hh.
TStopwatch LauAbsFitModel::cumulTimer_ |
|
private |
Bool_t LauAbsFitModel::doSFit_ |
|
private |
Bool_t LauAbsFitModel::emlFit_ |
|
private |
Bool_t LauAbsFitModel::enableEmbedding_ |
|
private |
UInt_t LauAbsFitModel::evtsPerExpt_ |
|
private |
Extra variables that aren't in the fit but are stored in the ntuple.
Definition at line 713 of file LauAbsFitModel.hh.
UInt_t LauAbsFitModel::firstExpt_ |
|
private |
Int_t LauAbsFitModel::fitStatus_ |
|
private |
TString LauAbsFitModel::fitToyMCFileName_ |
|
private |
Bool_t LauAbsFitModel::fitToyMCPoissonSmear_ |
|
private |
UInt_t LauAbsFitModel::fitToyMCScale_ |
|
private |
TString LauAbsFitModel::fitToyMCTableName_ |
|
private |
UInt_t LauAbsFitModel::iExpt_ |
|
private |
TMessage* LauAbsFitModel::messageFromMaster_ |
|
private |
TMessage* LauAbsFitModel::messageFromSlave_ |
|
private |
UInt_t LauAbsFitModel::nExpt_ |
|
private |
UInt_t LauAbsFitModel::nFreeParams_ |
|
private |
Double_t LauAbsFitModel::NLL_ |
|
private |
UInt_t LauAbsFitModel::nParams_ |
|
private |
UInt_t LauAbsFitModel::nSlaves_ |
|
private |
const TString LauAbsFitModel::nullString_ |
|
private |
UInt_t LauAbsFitModel::numberBadFits_ |
|
private |
UInt_t LauAbsFitModel::numberOKFits_ |
|
private |
Bool_t LauAbsFitModel::pdfsDependOnDP_ |
|
private |
Bool_t LauAbsFitModel::poissonSmear_ |
|
private |
Bool_t LauAbsFitModel::randomFit_ |
|
private |
Option to randomise the initial values of the fit parameters.
Definition at line 684 of file LauAbsFitModel.hh.
UInt_t LauAbsFitModel::slaveId_ |
|
private |
TSocket* LauAbsFitModel::sMaster_ |
|
private |
TMonitor* LauAbsFitModel::socketMonitor_ |
|
private |
TString LauAbsFitModel::sPlotFileName_ |
|
private |
TString LauAbsFitModel::sPlotTreeName_ |
|
private |
TString LauAbsFitModel::sPlotVerbosity_ |
|
private |
std::vector<TSocket*> LauAbsFitModel::sSlaves_ |
|
private |
Sockets for each of the slaves to communicate with the master.
Definition at line 796 of file LauAbsFitModel.hh.
Bool_t LauAbsFitModel::storeDPEff_ |
|
private |
Option to store DP efficiencies in the sPlot ntuple.
Definition at line 682 of file LauAbsFitModel.hh.
TString LauAbsFitModel::sWeightBranchName_ |
|
private |
std::vector<Double_t> LauAbsFitModel::sWeights_ |
|
private |
Double_t LauAbsFitModel::sWeightScaleFactor_ |
|
private |
TStopwatch LauAbsFitModel::timer_ |
|
private |
Bool_t LauAbsFitModel::twoStageFit_ |
|
private |
Bool_t LauAbsFitModel::useAsymmFitErrors_ |
|
private |
Bool_t LauAbsFitModel::usingDP_ |
|
private |
TVectorD* LauAbsFitModel::vectorPar_ |
|
private |
TVectorD* LauAbsFitModel::vectorRes_ |
|
private |
Bool_t LauAbsFitModel::withinMINOS_ |
|
private |
Double_t LauAbsFitModel::worstLogLike_ |
|
private |
Bool_t LauAbsFitModel::writeLatexTable_ |
|
private |
Bool_t LauAbsFitModel::writeSPlotData_ |
|
private |
The documentation for this class was generated from the following files:
|