laura is hosted by Hepforge, IPPP Durham
Laura++  v3r2
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauRooFitSlave.hh
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2016 - 2017.
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 
21 #ifndef LAU_ROO_FIT_SLAVE
22 #define LAU_ROO_FIT_SLAVE
23 
24 #include <utility>
25 #include <vector>
26 
27 #include "RooAbsPdf.h"
28 #include "RooAbsData.h"
29 #include "RooCategory.h"
30 #include "RooNLLVar.h"
31 #include "TMatrixDfwd.h"
32 #include "TString.h"
33 
34 #include "LauSimFitSlave.hh"
35 
36 class LauParameter;
37 
38 
40 
41  public:
43  LauRooFitSlave( RooAbsPdf& model, const Bool_t extended, const RooArgSet& vars, const TString& weightVarName = "" );
44 
46  virtual ~LauRooFitSlave();
47 
49  virtual void initialise();
50 
52 
56  virtual void setParsFromMinuit(Double_t* par, Int_t npar);
57 
59  virtual Double_t getTotNegLogLikelihood();
60 
61  protected:
62 
64 
67  virtual void prepareInitialParArray( TObjArray& array );
68 
70 
74  LauParameter* convertToLauParameter( const RooRealVar* rooParameter ) const;
75 
77 
81  std::vector< std::pair<RooRealVar*,LauParameter*> > convertToLauParameters( const RooFormulaVar* rooFormula ) const;
82 
84 
94  virtual void finaliseExperiment( const LauAbsFitter::FitStatus& fitStat, const TObjArray* parsFromMaster, const TMatrixD* covMat, TObjArray& parsToMaster );
95 
97 
101  virtual Bool_t verifyFitData(const TString& dataFileName, const TString& dataTreeName);
102 
104 
107  virtual UInt_t readExperimentData();
108 
110  virtual void cacheInputFitVars();
111 
112  private:
114  void cleanData();
115 
117  LauRooFitSlave(const LauRooFitSlave& rhs);
118 
121 
123  RooAbsPdf& model_;
124 
126  RooArgSet dataVars_;
127 
129  TString weightVarName_;
130 
132  TFile* dataFile_;
133 
135  TTree* dataTree_;
136 
138  RooAbsData* exptData_;
139 
141  const Bool_t extended_;
142 
144  RooCategory iExptCat_;
145 
147  RooNLLVar* nllVar_;
148 
150  std::vector<RooRealVar*> fitVars_;
151 
153  std::vector<LauParameter*> fitPars_;
154 
156 };
157 
158 #endif
virtual void finaliseExperiment(const LauAbsFitter::FitStatus &fitStat, const TObjArray *parsFromMaster, const TMatrixD *covMat, TObjArray &parsToMaster)
Perform all finalisation actions.
TFile * dataFile_
The data file.
RooNLLVar * nllVar_
The NLL variable.
virtual Double_t getTotNegLogLikelihood()
Calculates the total negative log-likelihood.
virtual void prepareInitialParArray(TObjArray &array)
Package the initial fit parameters for transmission to the master.
LauRooFitSlave & operator=(const LauRooFitSlave &rhs)
Copy assignment operator (not implemented)
RooAbsPdf & model_
The model.
void cleanData()
Cleanup the data.
LauParameter * convertToLauParameter(const RooRealVar *rooParameter) const
Convert a RooRealVar into a LauParameter.
RooArgSet dataVars_
The dataset variables.
std::vector< LauParameter * > fitPars_
The fit parameters (as LauParameter&#39;s)
A class for creating a RooFit-based slave process for simultaneous/combined fits. ...
std::vector< std::pair< RooRealVar *, LauParameter * > > convertToLauParameters(const RooFormulaVar *rooFormula) const
Convert a RooFormulaVar into LauParameters.
virtual void cacheInputFitVars()
Cache the input data values to calculate the likelihood during the fit.
LauRooFitSlave(RooAbsPdf &model, const Bool_t extended, const RooArgSet &vars, const TString &weightVarName="")
Constructor.
virtual ~LauRooFitSlave()
Destructor.
Struct to store fit status information.
Definition: LauAbsFitter.hh:41
TTree * dataTree_
The data tree.
virtual UInt_t readExperimentData()
Read in the data for the current experiment.
Class for defining the fit parameter objects.
Definition: LauParameter.hh:35
std::vector< RooRealVar * > fitVars_
The fit parameters (as RooRealVar&#39;s)
virtual void setParsFromMinuit(Double_t *par, Int_t npar)
This function sets the parameter values from Minuit.
File containing declaration of LauSimFitSlave class.
virtual Bool_t verifyFitData(const TString &dataFileName, const TString &dataTreeName)
Open the input file and verify that all required variables are present.
RooCategory iExptCat_
The experiment category variable.
The base class for any slave process for simultaneous/combined fits.
const Bool_t extended_
Is the PDF extended?
virtual void initialise()
Initialise the fit model.
ClassDef(LauRooFitSlave, 0)
RooAbsData * exptData_
The data for the current experiment.
TString weightVarName_
The name of the (optional) weight variable in the dataset.