LauRooFitSlave.cc
Go to the documentation of this file.
33 LauRooFitSlave::LauRooFitSlave( RooAbsPdf& model, const Bool_t extended, const RooArgSet& vars, const TString& weightVarName ) :
79 std::cerr << "ERROR in LauRooFitSlave::initialise : The set of data variables does not contain the weighting variable \"" << weightVarName_ << std::endl;
96 std::cerr << "ERROR in LauRooFitSlave::verifyFitData : Problem opening data file \"" << dataFileName << "\"" << std::endl;
103 std::cerr << "ERROR in LauRooFitSlave::verifyFitData : Problem retrieving tree \"" << dataTreeName << "\" from data file \"" << dataFileName << "\"" << std::endl;
118 std::cerr << "ERROR in LauRooFitSlave::verifyFitData : The data tree does not contain a branch for fit variable \"" << name << std::endl;
129 std::cout << "WARNING in LauRooFitSlave::verifyFitData : Cannot find branch \"iExpt\" in the tree, will treat all data as being from a single experiment" << std::endl;
147 std::cerr << "ERROR in LauRooFitSlave::prepareInitialParArray : NLL var not initialised" << std::endl;
151 // If we already prepared the entries in the fitPars_ vector then we only need to add the contents to the array
153 for ( std::vector<LauParameter*>::iterator iter = fitPars_.begin(); iter != fitPars_.end(); ++iter ) {
182 std::cerr << "ERROR in LauRooFitSlave::prepareInitialParArray : The parameter is neither a RooRealVar nor a RooFormulaVar, don't know what to do" << std::endl;
185 std::vector< std::pair<RooRealVar*,LauParameter*> > lpars = this->convertToLauParameters( rfvar );
186 for ( std::vector< std::pair<RooRealVar*,LauParameter*> >::iterator iter = lpars.begin(); iter != lpars.end(); ++iter ) {
210 return new LauParameter( rooParameter->GetName(), rooParameter->getVal(), rooParameter->getMin(), rooParameter->getMax(), rooParameter->isConstant() );
213 std::vector< std::pair<RooRealVar*,LauParameter*> > LauRooFitSlave::convertToLauParameters( const RooFormulaVar* rooFormula ) const
237 std::vector< std::pair<RooRealVar*,LauParameter*> > lpars = this->convertToLauParameters( rfvar );
238 for ( std::vector< std::pair<RooRealVar*,LauParameter*> >::iterator iter = lpars.begin(); iter != lpars.end(); ++iter ) {
245 std::cerr << "ERROR in LauRooFitSlave::convertToLauParameters : One of the parameters is not a RooRealVar nor a RooFormulaVar, it is a: " << rabsarg->ClassName() << std::endl;
268 std::cerr << "ERROR in LauRooFitSlave::setParsFromMinuit : Unexpected number of free parameters: " << npar << ".\n";
293 std::cerr << "ERROR in LauRooFitSlave::readExperimentData : Invalid experiment number " << exptIndex << ", data contains only one experiment" << std::endl;
296 std::cerr << "ERROR in LauRooFitSlave::readExperimentData : Invalid experiment number " << exptIndex << std::endl;
305 exptData_ = new RooDataSet( TString::Format("expt%dData",exptIndex), "", dataTree_, dataVars_, "", (weightVarName_ != "") ? weightVarName_.Data() : 0 );
309 exptData_ = new RooDataSet( TString::Format("expt%dData",exptIndex), "", exptTree, dataVars_, "", (weightVarName_ != "") ? weightVarName_.Data() : 0 );
327 void LauRooFitSlave::finaliseExperiment( const LauAbsFitter::FitStatus& fitStat, const TObjArray* parsFromMaster, const TMatrixD* covMat, TObjArray& parsToMaster )
336 std::cerr << "ERROR in LauRooFitSlave::finaliseExperiment : Unexpected number of parameters received from master" << std::endl;
344 std::cerr << "ERROR in LauRooFitSlave::finaliseExperiment : Error reading parameter from master" << std::endl;
349 std::cerr << "ERROR in LauRooFitSlave::finaliseExperiment : Error reading parameter from master" << std::endl;
363 for ( std::vector<LauParameter*>::iterator iter = fitPars_.begin(); iter != fitPars_.end(); ++iter ) {
virtual void finaliseExperiment(const LauAbsFitter::FitStatus &fitStat, const TObjArray *parsFromMaster, const TMatrixD *covMat, TObjArray &parsToMaster) Perform all finalisation actions. Definition: LauRooFitSlave.cc:327 Bool_t fixed() const Check whether the parameter is fixed or floated. Definition: LauParameter.hh:214 Bool_t withinAsymErrorCalc() const Query whether the fit is calculating the asymmetric errors. Definition: LauFitObject.hh:74 virtual Double_t getTotNegLogLikelihood() Calculates the total negative log-likelihood. Definition: LauRooFitSlave.cc:252 ClassImp(LauAbsCoeffSet) virtual void prepareInitialParArray(TObjArray &array) Package the initial fit parameters for transmission to the master. Definition: LauRooFitSlave.cc:143 File containing declaration of LauRooFitSlave class. LauParameter * convertToLauParameter(const RooRealVar *rooParameter) const Convert a RooRealVar into a LauParameter. Definition: LauRooFitSlave.cc:208 const LauFitNtuple * fitNtuple() const Const access to the fit ntuple. Definition: LauSimFitSlave.hh:84 void storeFitStatus(const LauAbsFitter::FitStatus &status, const TMatrixD &covMatrix) Store fit status information. Definition: LauFitObject.cc:56 std::vector< LauParameter * > fitPars_ The fit parameters (as LauParameter's) Definition: LauRooFitSlave.hh:153 UInt_t nFreeParams() const Access the total number of fit parameters. Definition: LauFitObject.hh:189 A class for creating a RooFit-based slave process for simultaneous/combined fits. ... Definition: LauRooFitSlave.hh:39 std::vector< std::pair< RooRealVar *, LauParameter * > > convertToLauParameters(const RooFormulaVar *rooFormula) const Convert a RooFormulaVar into LauParameters. Definition: LauRooFitSlave.cc:213 void storeCorrMatrix(const UInt_t iExpt, const LauAbsFitter::FitStatus &fitStatus, const TMatrixD &covMatrix) Store the correlation matrix and other fit information. Definition: LauFitNtuple.cc:60 virtual void cacheInputFitVars() Cache the input data values to calculate the likelihood during the fit. Definition: LauRooFitSlave.cc:318 UInt_t eventsPerExpt() const Obtain the total number of events in the current experiment. Definition: LauFitObject.hh:87 File containing declaration of LauParameter class. virtual UInt_t readExperimentData() Read in the data for the current experiment. Definition: LauRooFitSlave.cc:288 const TMatrixD & covarianceMatrix() const Access the fit covariance matrix. Definition: LauFitObject.hh:204 std::vector< RooRealVar * > fitVars_ The fit parameters (as RooRealVar's) Definition: LauRooFitSlave.hh:150 virtual void setParsFromMinuit(Double_t *par, Int_t npar) This function sets the parameter values from Minuit. Definition: LauRooFitSlave.cc:258 File containing declaration of LauSimFitSlave class. void storeParsAndErrors(const std::vector< LauParameter * > &fitVars, const std::vector< LauParameter > &extraVars) Store parameters and their errors. Definition: LauFitNtuple.cc:186 virtual Bool_t verifyFitData(const TString &dataFileName, const TString &dataTreeName) Open the input file and verify that all required variables are present. Definition: LauRooFitSlave.cc:86 The base class for any slave process for simultaneous/combined fits. Definition: LauSimFitSlave.hh:37 void startNewFit(const UInt_t nPars, const UInt_t nFreePars) Indicate the start of a new fit. Definition: LauFitObject.cc:46 const LauAbsFitter::FitStatus & fitStatus() const Access the fit status information. Definition: LauFitObject.hh:192 TString weightVarName_ The name of the (optional) weight variable in the dataset. Definition: LauRooFitSlave.hh:129 File containing declaration of LauFitNtuple class. Generated by 1.8.5 |