laura is hosted by Hepforge, IPPP Durham
Laura++  v3r1
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauSimFitSlave.hh
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2013 - 2015.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 // Authors:
7 // Thomas Latham
8 // John Back
9 // Paul Harrison
10 
24 #ifndef LAU_SIM_FIT_SLAVE
25 #define LAU_SIM_FIT_SLAVE
26 
27 #include "TMatrixDfwd.h"
28 
29 #include "LauFitObject.hh"
30 
31 class TMessage;
32 class TSocket;
33 class TString;
34 
35 
37 
38  public:
41 
43  virtual ~LauSimFitSlave();
44 
46  UInt_t nSlaves() const {return nSlaves_;}
47 
49  UInt_t slaveId() const {return slaveId_;}
50 
52 
56  virtual void setParsFromMinuit(Double_t* par, Int_t npar) = 0;
57 
59  virtual Double_t getTotNegLogLikelihood() = 0;
60 
61  protected:
63 
67  void connectToMaster( const TString& addressMaster, const UInt_t portMaster );
68 
70  void processMasterRequests();
71 
73 
76  virtual void prepareInitialParArray( TObjArray& array ) = 0;
77 
79 
90  virtual void finaliseResults( const Int_t fitStat, const Double_t NLL, const TObjArray* parsFromMaster, const TMatrixD* covMat, TObjArray& parsToMaster ) = 0;
91 
93 
97  virtual UInt_t readExperimentData( const UInt_t exptIndex ) = 0;
98 
100  virtual void cacheInputFitVars() = 0;
101 
103  virtual void writeOutAllFitResults() = 0;
104 
105  private:
107  LauSimFitSlave(const LauSimFitSlave& rhs);
108 
111 
113  TSocket* sMaster_;
114 
117 
119  UInt_t slaveId_;
120 
122  UInt_t nSlaves_;
123 
125  UInt_t nParams_;
126 
128  Double_t* parValues_;
129 
131 };
132 
133 #endif
134 
LauSimFitSlave()
Constructor.
LauSimFitSlave & operator=(const LauSimFitSlave &rhs)
Copy assignment operator (not implemented)
UInt_t slaveId_
Slave id number.
void processMasterRequests()
Listen for requests from the master and act accordingly.
virtual ~LauSimFitSlave()
Destructor.
UInt_t nParams_
The total number of fit parameters.
ClassDef(LauSimFitSlave, 0)
void connectToMaster(const TString &addressMaster, const UInt_t portMaster)
Establish the connection to the master process.
TSocket * sMaster_
A socket to enable parallel setup.
virtual void prepareInitialParArray(TObjArray &array)=0
Package the initial fit parameters for transmission to the master.
TMessage * messageFromMaster_
Message from master to the slaves.
virtual void setParsFromMinuit(Double_t *par, Int_t npar)=0
This function sets the parameter values from Minuit.
UInt_t slaveId() const
Obtain the ID number of this slave.
File containing declaration of LauFitObject class.
virtual Double_t getTotNegLogLikelihood()=0
Calculates the total negative log-likelihood.
UInt_t nSlaves() const
Obtain the number of slaves.
The base class for any slave process for simultaneous/combined fits.
virtual void cacheInputFitVars()=0
Cache the input data values to calculate the likelihood during the fit.
virtual UInt_t readExperimentData(const UInt_t exptIndex)=0
Read in the data for the specified experiment.
UInt_t nSlaves_
The total number of slaves.
Double_t * parValues_
Parameter values array (for reading from the master)
virtual void writeOutAllFitResults()=0
Write out any fit results.
virtual void finaliseResults(const Int_t fitStat, const Double_t NLL, const TObjArray *parsFromMaster, const TMatrixD *covMat, TObjArray &parsToMaster)=0
Perform all finalisation actions.