laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.

A class for creating a RooFit-based slave process for simultaneous/combined fits. More...

#include <LauRooFitSlave.hh>

Inheritance diagram for LauRooFitSlave:
LauSimFitSlave LauFitObject

Public Member Functions

 LauRooFitSlave (RooAbsPdf &model, const Bool_t extended, const RooArgSet &vars, const TString &weightVarName="")
 Constructor. More...
 
virtual ~LauRooFitSlave ()
 Destructor. More...
 
virtual void initialise ()
 Initialise the fit model. More...
 
virtual void setParsFromMinuit (Double_t *par, Int_t npar)
 This function sets the parameter values from Minuit. More...
 
virtual Double_t getTotNegLogLikelihood ()
 Calculates the total negative log-likelihood. More...
 
- Public Member Functions inherited from LauSimFitSlave
 LauSimFitSlave ()
 Constructor. More...
 
virtual ~LauSimFitSlave ()
 Destructor. More...
 
UInt_t nSlaves () const
 Obtain the number of slaves. More...
 
UInt_t slaveId () const
 Obtain the ID number of this slave. More...
 
virtual void runSlave (const TString &dataFileName, const TString &dataTreeName, const TString &histFileName, const TString &tableFileName="", const TString &addressMaster="localhost", const UInt_t portMaster=9090)
 Start the slave process for simultaneous fitting. More...
 
- Public Member Functions inherited from LauFitObject
virtual ~LauFitObject ()
 Destructor. More...
 
void useAsymmFitErrors (Bool_t useAsymmErrors)
 Turn on or off the computation of asymmetric errors (e.g. MINOS routine in Minuit) More...
 
Bool_t useAsymmFitErrors () const
 Report whether or not calculation of asymmetric errors is enabled. More...
 
void twoStageFit (Bool_t doTwoStageFit)
 Turn on or off the two stage fit. More...
 
Bool_t twoStageFit () const
 Report whether the two-stage fit is enabled. More...
 
virtual void withinAsymErrorCalc (const Bool_t inAsymErrCalc)
 Mark that the fit is calculating asymmetric errors. More...
 
Bool_t withinAsymErrorCalc () const
 Query whether the fit is calculating the asymmetric errors. 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 addConstraint (const TString &formula, const std::vector< TString > &pars, const Double_t mean, const Double_t width)
 Store constraint information for fit parameters. More...
 

Protected Member Functions

virtual void prepareInitialParArray (TObjArray &array)
 Package the initial fit parameters for transmission to the master. More...
 
LauParameterconvertToLauParameter (const RooRealVar *rooParameter) const
 Convert a RooRealVar into a LauParameter. More...
 
std::vector< std::pair
< RooRealVar *, LauParameter * > > 
convertToLauParameters (const RooFormulaVar *rooFormula) const
 Convert a RooFormulaVar into LauParameters. More...
 
virtual void finaliseExperiment (const LauAbsFitter::FitStatus &fitStat, const TObjArray *parsFromMaster, const TMatrixD *covMat, TObjArray &parsToMaster)
 Perform all finalisation actions. More...
 
virtual Bool_t verifyFitData (const TString &dataFileName, const TString &dataTreeName)
 Open the input file and verify that all required variables are present. More...
 
virtual UInt_t readExperimentData ()
 Read in the data for the current experiment. More...
 
virtual void cacheInputFitVars ()
 Cache the input data values to calculate the likelihood during the fit. More...
 
- Protected Member Functions inherited from LauSimFitSlave
const LauFitNtuplefitNtuple () const
 Const access to the fit ntuple. More...
 
LauFitNtuplefitNtuple ()
 Access to the fit ntuple. More...
 
void connectToMaster (const TString &addressMaster, const UInt_t portMaster)
 Establish the connection to the master process. More...
 
void processMasterRequests ()
 Listen for requests from the master and act accordingly. More...
 
virtual void setupResultsOutputs (const TString &histFileName, const TString &tableFileName)
 Setup saving of fit results to ntuple/LaTeX table etc. More...
 
virtual void writeOutAllFitResults ()
 Write out any fit results. More...
 
- Protected Member Functions inherited from LauFitObject
 LauFitObject ()
 Constructor. More...
 
const std::vector
< StoreConstraints > & 
constraintsStore () const
 Const access to the constraints store. More...
 
std::vector< StoreConstraints > & constraintsStore ()
 Access to the constraints store. More...
 
void resetFitCounters ()
 Reset the good/bad fit counters. More...
 
void setCurrentExperiment (const UInt_t curExpt)
 Set the ID of the current experiment. More...
 
void startNewFit (const UInt_t nPars, const UInt_t nFreePars)
 Indicate the start of a new fit. More...
 
void eventsPerExpt (UInt_t nEvents)
 Set the number of events in the current experiment. More...
 
Double_t worstLogLike () const
 Access the worst log likelihood found so far. More...
 
void worstLogLike (const Double_t newWorstLogLike)
 Set a new value for the worst log likelihood. More...
 
void storeFitStatus (const LauAbsFitter::FitStatus &status, const TMatrixD &covMatrix)
 Store fit status information. More...
 
UInt_t nTotParams () const
 Access the total number of fit parameters. More...
 
UInt_t nFreeParams () const
 Access the total number of fit parameters. More...
 
const LauAbsFitter::FitStatusfitStatus () const
 Access the fit status information. More...
 
Double_t nll () const
 Access the current NLL value. More...
 
Double_t edm () const
 Access the current EDM value. More...
 
Int_t statusCode () const
 Access the fit status code. More...
 
const TMatrixD & covarianceMatrix () const
 Access the fit covariance matrix. More...
 
UInt_t numberOKFits () const
 Access the number of successful fits. More...
 
UInt_t numberBadFits () const
 Access the number of failed fits. More...
 

Private Member Functions

void cleanData ()
 Cleanup the data. More...
 
 LauRooFitSlave (const LauRooFitSlave &rhs)
 Copy constructor (not implemented) More...
 
LauRooFitSlaveoperator= (const LauRooFitSlave &rhs)
 Copy assignment operator (not implemented) More...
 
 ClassDef (LauRooFitSlave, 0)
 

Private Attributes

RooAbsPdf & model_
 The model. More...
 
RooArgSet dataVars_
 The dataset variables. More...
 
TString weightVarName_
 The name of the (optional) weight variable in the dataset. More...
 
TFile * dataFile_
 The data file. More...
 
TTree * dataTree_
 The data tree. More...
 
RooAbsData * exptData_
 The data for the current experiment. More...
 
const Bool_t extended_
 Is the PDF extended? More...
 
RooCategory iExptCat_
 The experiment category variable. More...
 
RooNLLVar * nllVar_
 The NLL variable. More...
 
std::vector< RooRealVar * > fitVars_
 The fit parameters (as RooRealVar's) More...
 
std::vector< LauParameter * > fitPars_
 The fit parameters (as LauParameter's) More...
 

Detailed Description

A class for creating a RooFit-based slave process for simultaneous/combined fits.

Implementation of the JFit method described in arXiv:1409.5080 [physics.data-an].

Definition at line 53 of file LauRooFitSlave.hh.

Constructor & Destructor Documentation

LauRooFitSlave::LauRooFitSlave ( RooAbsPdf &  model,
const Bool_t  extended,
const RooArgSet &  vars,
const TString &  weightVarName = "" 
)

Constructor.

Definition at line 47 of file LauRooFitSlave.cc.

LauRooFitSlave::~LauRooFitSlave ( )
virtual

Destructor.

Definition at line 61 of file LauRooFitSlave.cc.

LauRooFitSlave::LauRooFitSlave ( const LauRooFitSlave rhs)
private

Copy constructor (not implemented)

Member Function Documentation

void LauRooFitSlave::cacheInputFitVars ( )
protectedvirtual

Cache the input data values to calculate the likelihood during the fit.

Implements LauSimFitSlave.

Definition at line 332 of file LauRooFitSlave.cc.

LauRooFitSlave::ClassDef ( LauRooFitSlave  ,
 
)
private
void LauRooFitSlave::cleanData ( )
private

Cleanup the data.

Definition at line 67 of file LauRooFitSlave.cc.

LauParameter * LauRooFitSlave::convertToLauParameter ( const RooRealVar *  rooParameter) const
protected

Convert a RooRealVar into a LauParameter.

Parameters
[in]rooParameterthe RooRealVar to be converted
Returns
the newly created LauParameter

Definition at line 222 of file LauRooFitSlave.cc.

std::vector< std::pair< RooRealVar *, LauParameter * > > LauRooFitSlave::convertToLauParameters ( const RooFormulaVar *  rooFormula) const
protected

Convert a RooFormulaVar into LauParameters.

Parameters
[in]rooFormulathe RooFormulaVar to be converted
Returns
the vector of pointers to the RooRealVars and newly created LauParameters

Definition at line 227 of file LauRooFitSlave.cc.

void LauRooFitSlave::finaliseExperiment ( const LauAbsFitter::FitStatus fitStat,
const TObjArray *  parsFromMaster,
const TMatrixD *  covMat,
TObjArray &  parsToMaster 
)
protectedvirtual

Perform all finalisation actions.

  • Receive the results of the fit from the master
  • Perform any finalisation routines
  • Package the finalised fit parameters for transmission back to the master
Parameters
[in]fitStatthe status of the fit, e.g. status code, EDM, NLL
[in]parsFromMasterthe parameters at the fit minimum
[in]covMatthe fit covariance matrix
[out]parsToMasterthe array to be filled with the finalised LauParameter objects

Implements LauSimFitSlave.

Definition at line 341 of file LauRooFitSlave.cc.

Double_t LauRooFitSlave::getTotNegLogLikelihood ( )
virtual

Calculates the total negative log-likelihood.

Implements LauSimFitSlave.

Definition at line 266 of file LauRooFitSlave.cc.

void LauRooFitSlave::initialise ( )
virtual

Initialise the fit model.

Implements LauSimFitSlave.

Definition at line 79 of file LauRooFitSlave.cc.

LauRooFitSlave& LauRooFitSlave::operator= ( const LauRooFitSlave rhs)
private

Copy assignment operator (not implemented)

void LauRooFitSlave::prepareInitialParArray ( TObjArray &  array)
protectedvirtual

Package the initial fit parameters for transmission to the master.

Parameters
[out]arraythe array to be filled with the LauParameter objects

Implements LauSimFitSlave.

Definition at line 157 of file LauRooFitSlave.cc.

UInt_t LauRooFitSlave::readExperimentData ( )
protectedvirtual

Read in the data for the current experiment.

Returns
the number of events read in

Implements LauSimFitSlave.

Definition at line 302 of file LauRooFitSlave.cc.

void LauRooFitSlave::setParsFromMinuit ( Double_t *  par,
Int_t  npar 
)
virtual

This function sets the parameter values from Minuit.

Parameters
[in]paran array storing the various parameter values
[in]nparthe number of free parameters

Implements LauSimFitSlave.

Definition at line 272 of file LauRooFitSlave.cc.

Bool_t LauRooFitSlave::verifyFitData ( const TString &  dataFileName,
const TString &  dataTreeName 
)
protectedvirtual

Open the input file and verify that all required variables are present.

Parameters
[in]dataFileNamethe name of the input file
[in]dataTreeNamethe name of the input tree

Implements LauSimFitSlave.

Definition at line 100 of file LauRooFitSlave.cc.

Member Data Documentation

TFile* LauRooFitSlave::dataFile_
private

The data file.

Definition at line 146 of file LauRooFitSlave.hh.

TTree* LauRooFitSlave::dataTree_
private

The data tree.

Definition at line 149 of file LauRooFitSlave.hh.

RooArgSet LauRooFitSlave::dataVars_
private

The dataset variables.

Definition at line 140 of file LauRooFitSlave.hh.

RooAbsData* LauRooFitSlave::exptData_
private

The data for the current experiment.

Definition at line 152 of file LauRooFitSlave.hh.

const Bool_t LauRooFitSlave::extended_
private

Is the PDF extended?

Definition at line 155 of file LauRooFitSlave.hh.

std::vector<LauParameter*> LauRooFitSlave::fitPars_
private

The fit parameters (as LauParameter's)

Definition at line 167 of file LauRooFitSlave.hh.

std::vector<RooRealVar*> LauRooFitSlave::fitVars_
private

The fit parameters (as RooRealVar's)

Definition at line 164 of file LauRooFitSlave.hh.

RooCategory LauRooFitSlave::iExptCat_
private

The experiment category variable.

Definition at line 158 of file LauRooFitSlave.hh.

RooAbsPdf& LauRooFitSlave::model_
private

The model.

Definition at line 137 of file LauRooFitSlave.hh.

RooNLLVar* LauRooFitSlave::nllVar_
private

The NLL variable.

Definition at line 161 of file LauRooFitSlave.hh.

TString LauRooFitSlave::weightVarName_
private

The name of the (optional) weight variable in the dataset.

Definition at line 143 of file LauRooFitSlave.hh.


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