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

The master process for simultaneous/combined fits. More...

#include <LauSimFitMaster.hh>

Inheritance diagram for LauSimFitMaster:
LauFitObject

Public Member Functions

 LauSimFitMaster (UInt_t numSlaves, UInt_t port=9090)
 Constructor. More...
 
virtual ~LauSimFitMaster ()
 Destructor. More...
 
void runSimFit (const TString &fitNtupleFileName, UInt_t nExpt, UInt_t firstExpt=0, Bool_t useAsymmErrors=kFALSE, Bool_t twoStageFit=kFALSE)
 Run the fit. More...
 
virtual void withinAsymErrorCalc (Bool_t inAsymErrCalc)
 Mark that the fit is calculating asymmetric errors. More...
 
virtual void setParsFromMinuit (Double_t *par, Int_t npar)
 This function sets the parameter values from Minuit. More...
 
virtual Double_t getTotNegLogLikelihood ()
 Calculate the new value of the negative log likelihood. More...
 
- Public Member Functions inherited from LauFitObject
virtual ~LauFitObject ()
 Destructor. More...
 

Protected Member Functions

void printParInfo () const
 Print information on the parameters. More...
 
void initialise ()
 Initialise. More...
 
void initSockets ()
 Initialise socket connections for the slaves. More...
 
void getParametersFromSlaves ()
 Determine/update the parameter initial values from all slaves. More...
 
void getParametersFromSlavesFirstTime ()
 Determine the parameter names and initial values from all slaves. More...
 
void updateParametersFromSlaves ()
 Update and verify the parameter initial values from all slaves. More...
 
void checkParameter (const LauParameter *param, UInt_t index) const
 Check for compatibility between two same-named parameters, which should therefore be identical. More...
 
Bool_t readData ()
 Instruct the slaves to read the input data for the given experiment. More...
 
Bool_t cacheInputData ()
 Instruct the slaves to perform the caching. More...
 
void fitExpt (Bool_t useAsymmErrors, Bool_t twoStageFit)
 Perform the fit for the current experiment. More...
 
void checkInitFitParams ()
 Instruct the slaves to update the initial fit parameter values, if required. More...
 
Bool_t finalise ()
 Return the final parameters to the slaves and instruct them to perform their finalisation. More...
 
Bool_t writeOutResults ()
 Instruct the slaves to write out the fit results. More...
 
- Protected Member Functions inherited from LauFitObject
 LauFitObject ()
 Constructor. More...
 

Private Member Functions

 ClassDef (LauSimFitMaster, 0)
 

Private Attributes

const UInt_t nSlaves_
 The number of slaves. More...
 
const UInt_t reqPort_
 The requested port. More...
 
UInt_t nParams_
 The number of fit parameters. More...
 
UInt_t nFreeParams_
 The number of free fit parameters. More...
 
Bool_t withinAsymErrorCalc_
 Flag to indicate if the asymmetric error calculation (e.g. MINOS) is currently running. More...
 
UInt_t numberOKFits_
 The number of successful fits. More...
 
UInt_t numberBadFits_
 The number of fit failures. More...
 
Int_t fitStatus_
 The status of the current fit. More...
 
UInt_t iExpt_
 The experiment number of the current fit. More...
 
Double_t NLL_
 The negative log-likelihood. More...
 
TMatrixD covMatrix_
 The fit covariance matrix. More...
 
std::vector< TMatrixD > covMatrices_
 The covariance sub-matrices for each slave. More...
 
TMonitor * socketMonitor_
 Parallel setup monitor. More...
 
std::vector< TSocket * > sSlaves_
 Sockets for each of the slaves. More...
 
std::vector< TMessage * > messagesToSlaves_
 Messages to slaves. More...
 
TMessage * messageFromSlave_
 Message from slaves to the master. More...
 
std::map< TString, UInt_t > parIndices_
 Map of parameter names to index in the values vector. More...
 
std::map< UInt_t, TString > parNames_
 Reverse map of index in the values vector to parameter names. More...
 
std::vector< LauParameter * > params_
 Parameters. More...
 
std::vector< Double_t > parValues_
 Parameter values. More...
 
std::vector< std::vector
< UInt_t > > 
slaveIndices_
 Lists of indices for each slave. More...
 
std::vector< Double_t * > vectorPar_
 Parameter values to send to the slaves. More...
 
std::vector< Double_t > vectorRes_
 Likelihood values returned from the slaves. More...
 
TStopwatch timer_
 The fit timer. More...
 
TStopwatch cumulTimer_
 The total fit timer. More...
 
LauFitNtuplefitNtuple_
 The fit results ntuple. More...
 

Detailed Description

The master process for simultaneous/combined fits.

The interface between the slave processes and the minimiser.

Definition at line 42 of file LauSimFitMaster.hh.

Constructor & Destructor Documentation

LauSimFitMaster::LauSimFitMaster ( UInt_t  numSlaves,
UInt_t  port = 9090 
)

Constructor.

Parameters
[in]numSlavesthe number of slaves processes to expect connections from
[in]portthe port on which to listen for connections from the slaves

Definition at line 38 of file LauSimFitMaster.cc.

LauSimFitMaster::~LauSimFitMaster ( )
virtual

Destructor.

Definition at line 59 of file LauSimFitMaster.cc.

Member Function Documentation

Bool_t LauSimFitMaster::cacheInputData ( )
protected

Instruct the slaves to perform the caching.

Returns
success/failure of the caching operations

Definition at line 515 of file LauSimFitMaster.cc.

void LauSimFitMaster::checkInitFitParams ( )
protected

Instruct the slaves to update the initial fit parameter values, if required.

Definition at line 558 of file LauSimFitMaster.cc.

void LauSimFitMaster::checkParameter ( const LauParameter param,
UInt_t  index 
) const
protected

Check for compatibility between two same-named parameters, which should therefore be identical.

Definition at line 364 of file LauSimFitMaster.cc.

LauSimFitMaster::ClassDef ( LauSimFitMaster  ,
 
)
private
Bool_t LauSimFitMaster::finalise ( )
protected

Return the final parameters to the slaves and instruct them to perform their finalisation.

Definition at line 682 of file LauSimFitMaster.cc.

void LauSimFitMaster::fitExpt ( Bool_t  useAsymmErrors,
Bool_t  twoStageFit 
)
protected

Perform the fit for the current experiment.

Definition at line 564 of file LauSimFitMaster.cc.

void LauSimFitMaster::getParametersFromSlaves ( )
protected

Determine/update the parameter initial values from all slaves.

Definition at line 188 of file LauSimFitMaster.cc.

void LauSimFitMaster::getParametersFromSlavesFirstTime ( )
protected

Determine the parameter names and initial values from all slaves.

Definition at line 272 of file LauSimFitMaster.cc.

Double_t LauSimFitMaster::getTotNegLogLikelihood ( )
virtual

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!

Implements LauFitObject.

Definition at line 640 of file LauSimFitMaster.cc.

void LauSimFitMaster::initialise ( )
protected

Initialise.

Definition at line 392 of file LauSimFitMaster.cc.

void LauSimFitMaster::initSockets ( )
protected

Initialise socket connections for the slaves.

Definition at line 87 of file LauSimFitMaster.cc.

void LauSimFitMaster::printParInfo ( ) const
protected

Print information on the parameters.

Definition at line 341 of file LauSimFitMaster.cc.

Bool_t LauSimFitMaster::readData ( )
protected

Instruct the slaves to read the input data for the given experiment.

Returns
success/failure of the reading operations

Definition at line 469 of file LauSimFitMaster.cc.

void LauSimFitMaster::runSimFit ( const TString &  fitNtupleFileName,
UInt_t  nExpt,
UInt_t  firstExpt = 0,
Bool_t  useAsymmErrors = kFALSE,
Bool_t  twoStageFit = kFALSE 
)

Run the fit.

Parameters
[in]fitNtupleFileNamethe file to which the ntuple containing the fit results should be written
[in]nExptthe number of experiments to be fitted
[in]firstExptthe ID of the first experiment to be fitted
[in]useAsymmErrorsshould asymmetric errors be calculated or not
[in]twoStageFitshould the fit be performed in two stages or not

Definition at line 397 of file LauSimFitMaster.cc.

void LauSimFitMaster::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]paran array storing the various parameter values
[in]nparthe number of free parameters

Implements LauFitObject.

Definition at line 616 of file LauSimFitMaster.cc.

void LauSimFitMaster::updateParametersFromSlaves ( )
protected

Update and verify the parameter initial values from all slaves.

Definition at line 202 of file LauSimFitMaster.cc.

virtual void LauSimFitMaster::withinAsymErrorCalc ( Bool_t  inAsymErrCalc)
inlinevirtual

Mark that the fit is calculating asymmetric errors.

This function has to be public since it is called by the fitter interface to mark when entering and exiting the asymmetric error calculation. It should not be called otherwise!

Parameters
[in]inAsymErrCalcboolean marking that the fit is calculating the asymmetric errors

Implements LauFitObject.

Definition at line 74 of file LauSimFitMaster.hh.

Bool_t LauSimFitMaster::writeOutResults ( )
protected

Instruct the slaves to write out the fit results.

Definition at line 847 of file LauSimFitMaster.cc.

Member Data Documentation

std::vector<TMatrixD> LauSimFitMaster::covMatrices_
private

The covariance sub-matrices for each slave.

Definition at line 175 of file LauSimFitMaster.hh.

TMatrixD LauSimFitMaster::covMatrix_
private

The fit covariance matrix.

Definition at line 172 of file LauSimFitMaster.hh.

TStopwatch LauSimFitMaster::cumulTimer_
private

The total fit timer.

Definition at line 214 of file LauSimFitMaster.hh.

LauFitNtuple* LauSimFitMaster::fitNtuple_
private

The fit results ntuple.

Definition at line 217 of file LauSimFitMaster.hh.

Int_t LauSimFitMaster::fitStatus_
private

The status of the current fit.

Definition at line 163 of file LauSimFitMaster.hh.

UInt_t LauSimFitMaster::iExpt_
private

The experiment number of the current fit.

Definition at line 166 of file LauSimFitMaster.hh.

TMessage* LauSimFitMaster::messageFromSlave_
private

Message from slaves to the master.

Definition at line 187 of file LauSimFitMaster.hh.

std::vector<TMessage*> LauSimFitMaster::messagesToSlaves_
private

Messages to slaves.

Definition at line 184 of file LauSimFitMaster.hh.

UInt_t LauSimFitMaster::nFreeParams_
private

The number of free fit parameters.

Definition at line 151 of file LauSimFitMaster.hh.

Double_t LauSimFitMaster::NLL_
private

The negative log-likelihood.

Definition at line 169 of file LauSimFitMaster.hh.

UInt_t LauSimFitMaster::nParams_
private

The number of fit parameters.

Definition at line 148 of file LauSimFitMaster.hh.

const UInt_t LauSimFitMaster::nSlaves_
private

The number of slaves.

Definition at line 142 of file LauSimFitMaster.hh.

UInt_t LauSimFitMaster::numberBadFits_
private

The number of fit failures.

Definition at line 160 of file LauSimFitMaster.hh.

UInt_t LauSimFitMaster::numberOKFits_
private

The number of successful fits.

Definition at line 157 of file LauSimFitMaster.hh.

std::vector<LauParameter*> LauSimFitMaster::params_
private

Parameters.

Definition at line 196 of file LauSimFitMaster.hh.

std::map< TString, UInt_t > LauSimFitMaster::parIndices_
private

Map of parameter names to index in the values vector.

Definition at line 190 of file LauSimFitMaster.hh.

std::map< UInt_t, TString > LauSimFitMaster::parNames_
private

Reverse map of index in the values vector to parameter names.

Definition at line 193 of file LauSimFitMaster.hh.

std::vector<Double_t> LauSimFitMaster::parValues_
private

Parameter values.

Definition at line 199 of file LauSimFitMaster.hh.

const UInt_t LauSimFitMaster::reqPort_
private

The requested port.

Definition at line 145 of file LauSimFitMaster.hh.

std::vector< std::vector<UInt_t> > LauSimFitMaster::slaveIndices_
private

Lists of indices for each slave.

Definition at line 202 of file LauSimFitMaster.hh.

TMonitor* LauSimFitMaster::socketMonitor_
private

Parallel setup monitor.

Definition at line 178 of file LauSimFitMaster.hh.

std::vector<TSocket*> LauSimFitMaster::sSlaves_
private

Sockets for each of the slaves.

Definition at line 181 of file LauSimFitMaster.hh.

TStopwatch LauSimFitMaster::timer_
private

The fit timer.

Definition at line 211 of file LauSimFitMaster.hh.

std::vector<Double_t*> LauSimFitMaster::vectorPar_
private

Parameter values to send to the slaves.

Definition at line 205 of file LauSimFitMaster.hh.

std::vector<Double_t> LauSimFitMaster::vectorRes_
private

Likelihood values returned from the slaves.

Definition at line 208 of file LauSimFitMaster.hh.

Bool_t LauSimFitMaster::withinAsymErrorCalc_
private

Flag to indicate if the asymmetric error calculation (e.g. MINOS) is currently running.

Definition at line 154 of file LauSimFitMaster.hh.


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