laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauRooFitSlave.hh
Go to the documentation of this file.
1 
2 /*
3 Copyright 2017 University of Warwick
4 
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8 
9  http://www.apache.org/licenses/LICENSE-2.0
10 
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 */
17 
18 /*
19 Laura++ package authors:
20 John Back
21 Paul Harrison
22 Thomas Latham
23 */
24 
35 #ifndef LAU_ROO_FIT_SLAVE
36 #define LAU_ROO_FIT_SLAVE
37 
38 #include <utility>
39 #include <vector>
40 
41 #include "RooAbsPdf.h"
42 #include "RooAbsData.h"
43 #include "RooCategory.h"
44 #include "RooNLLVar.h"
45 #include "TMatrixDfwd.h"
46 #include "TString.h"
47 
48 #include "LauSimFitSlave.hh"
49 
50 class LauParameter;
51 
52 
54 
55  public:
57  LauRooFitSlave( RooAbsPdf& model, const Bool_t extended, const RooArgSet& vars, const TString& weightVarName = "" );
58 
60  virtual ~LauRooFitSlave();
61 
63  virtual void initialise();
64 
66 
70  virtual void setParsFromMinuit(Double_t* par, Int_t npar);
71 
73  virtual Double_t getTotNegLogLikelihood();
74 
75  protected:
76 
78 
81  virtual void prepareInitialParArray( TObjArray& array );
82 
84 
88  LauParameter* convertToLauParameter( const RooRealVar* rooParameter ) const;
89 
91 
95  std::vector< std::pair<RooRealVar*,LauParameter*> > convertToLauParameters( const RooFormulaVar* rooFormula ) const;
96 
98 
108  virtual void finaliseExperiment( const LauAbsFitter::FitStatus& fitStat, const TObjArray* parsFromMaster, const TMatrixD* covMat, TObjArray& parsToMaster );
109 
111 
115  virtual Bool_t verifyFitData(const TString& dataFileName, const TString& dataTreeName);
116 
118 
121  virtual UInt_t readExperimentData();
122 
124  virtual void cacheInputFitVars();
125 
126  private:
128  void cleanData();
129 
131  LauRooFitSlave(const LauRooFitSlave& rhs);
132 
135 
137  RooAbsPdf& model_;
138 
140  RooArgSet dataVars_;
141 
143  TString weightVarName_;
144 
146  TFile* dataFile_;
147 
149  TTree* dataTree_;
150 
152  RooAbsData* exptData_;
153 
155  const Bool_t extended_;
156 
158  RooCategory iExptCat_;
159 
161  RooNLLVar* nllVar_;
162 
164  std::vector<RooRealVar*> fitVars_;
165 
167  std::vector<LauParameter*> fitPars_;
168 
170 };
171 
172 #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:55
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:49
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.