Skip to content

Commit

Permalink
remove unused headers and use RooMinimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodozov committed Jul 13, 2021
1 parent 12039d5 commit 374b4ff
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "RooPolynomial.h"
#include "RooCBShape.h"
#include "RooChi2Var.h"
#include "RooFitLegacy/RooMinuit.h"
#include "RooMinimizer.h"
#include "RooBreitWigner.h"
#include "RooFFTConvPdf.h"

Expand Down Expand Up @@ -126,7 +126,7 @@ class FitWithRooFit {
// Fit with chi^2
else {
std::cout << "FITTING WITH CHI^2" << std::endl;
RooMinuit m(chi2);
RooMinimizer m(chi2);
m.migrad();
m.hesse();
// RooFitResult* r_chi2_wgt = m.save();
Expand Down
22 changes: 10 additions & 12 deletions PhysicsTools/TagAndProbe/src/TagProbeFitter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "RooLinkedListIter.h"
#include "RooMappedCategory.h"
#include "RooMinimizer.h"
#include "RooFitLegacy/RooMinuit.h"
#include "RooMsgService.h"
#include "RooMultiCategory.h"
#include "RooNLLVar.h"
Expand Down Expand Up @@ -584,9 +583,8 @@ void TagProbeFitter::doFitEfficiency(RooWorkspace* w, string pdfName, RooRealVar
RooAbsReal* simNLL = w->pdf("simPdf")->createNLL(*data, Extended(true), NumCPU(numCPU));

RooMinimizer minimizer(*simNLL); // we are going to use this for 'scan'
RooMinuit minuit(*simNLL);
minuit.setStrategy(1);
minuit.setProfile(true);
minimizer.setStrategy(1);
minimizer.setProfile(true);
RooProfileLL profileLL("simPdfNLL", "", *simNLL, *w->var("efficiency"));

//******* The block of code below is to make the fit converge faster.
Expand Down Expand Up @@ -618,17 +616,17 @@ void TagProbeFitter::doFitEfficiency(RooWorkspace* w, string pdfName, RooRealVar
varFixer(w, true);
//do fit
minimizer.minimize("Minuit2", "Scan");
minuit.migrad();
minuit.hesse();
minimizer.migrad();
minimizer.hesse();
//minuit.minos();
//w->pdf("simPdf")->fitTo(*data, Save(true), Extended(true), NumCPU(numCPU), Strategy(2),
//PrintLevel(quiet?-1:1), PrintEvalErrors(quiet?-1:1), Warnings(!quiet));
//release vars
varFixer(w, false);
//do fit
minimizer.minimize("Minuit2", "Scan");
minuit.migrad();
minuit.hesse();
minimizer.migrad();
minimizer.hesse();
//minuit.minos();
//w->pdf("simPdf")->fitTo(*data, Save(true), Extended(true), NumCPU(numCPU), Strategy(2),
//PrintLevel(quiet?-1:1), PrintEvalErrors(quiet?-1:1), Warnings(!quiet));
Expand All @@ -643,8 +641,8 @@ void TagProbeFitter::doFitEfficiency(RooWorkspace* w, string pdfName, RooRealVar

//do fit
minimizer.minimize("Minuit2", "Scan");
minuit.migrad();
minuit.hesse();
minimizer.migrad();
minimizer.hesse();
// initialize the profile likelihood
profileLL.getVal();
RooMinimizer* profMinuit = profileLL.minimizer();
Expand All @@ -665,8 +663,8 @@ void TagProbeFitter::doFitEfficiency(RooWorkspace* w, string pdfName, RooRealVar

//do fit
minimizer.minimize("Minuit2", "Scan");
minuit.migrad();
minuit.hesse();
minimizer.migrad();
minimizer.hesse();
res.reset(w->pdf("simPdf")->fitTo(*data,
Save(true),
Extended(true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "RooGaussian.h"
#include "RooNLLVar.h"
#include "RooConstVar.h"
#include "RooFitLegacy/RooMinuit.h"
#include "RooFitResult.h"
#include "RooExponential.h"
#include "RooFFTConvPdf.h"
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/TagAndProbe/test/utilities/ZeeBkgFit.C
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "RooGaussian.h"
#include "RooNLLVar.h"
#include "RooConstVar.h"
#include "RooFitLegacy/RooMinuit.h"
#include "RooFitResult.h"
#include "RooExponential.h"
#include "RooFFTConvPdf.h"
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/TagAndProbe/test/utilities/fitZCat.C
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "RooGaussian.h"
#include "RooNLLVar.h"
#include "RooConstVar.h"
#include "RooFitLegacy/RooMinuit.h"
#include "RooFitResult.h"
#include "RooExponential.h"

Expand Down

0 comments on commit 374b4ff

Please sign in to comment.