Skip to content

Commit

Permalink
Use other overload of ROOT::Minuit2VariableMetricMinimizer::Minimize
Browse files Browse the repository at this point in the history
The overload that was currently used was recently removed to keep the
interface clean:
root-project/root#16443

Also, remove unused code.
  • Loading branch information
guitargeek committed Sep 20, 2024
1 parent 866ea0d commit 325c9e3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
3 changes: 1 addition & 2 deletions OnlineDB/CSCCondDB/src/CSCFitAFEBThr.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "Minuit2/VariableMetricMinimizer.h"
#include "Minuit2/FunctionMinimum.h"

#include <OnlineDB/CSCCondDB/interface/CSCFitAFEBThr.h>
Expand Down Expand Up @@ -130,7 +129,7 @@ bool CSCFitAFEBThr::ThresholdNoise(const std::vector<float>& inputx,
// <<" "<<ery[i]<<std::endl;

/// Fit as 1D, <=500 iterations, edm=10**-5 (->0.1)
FunctionMinimum fmin = theFitter->Minimize(*theOBJfun, parinit, erparinit, 1, 500, 0.1);
FunctionMinimum fmin = theFitter->Minimize(*theOBJfun, {parinit, erparinit}, MnStrategy{1}, 500, 0.1);

status = fmin.IsValid();

Expand Down
2 changes: 0 additions & 2 deletions RecoVertex/BeamSpotProducer/interface/BSFitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ ________________________________________________________________**/
// ROOT
#include "TMatrixD.h"
#include "TMath.h"
#include "Minuit2/VariableMetricMinimizer.h"
#include "TH1F.h"

// C++ standard
Expand Down Expand Up @@ -87,7 +86,6 @@ class BSFitter {
TH1F *GetVzHisto() { return h1z; }

private:
ROOT::Minuit2::ModularFunctionMinimizer *theFitter;
//BSzFcn* theGausszFcn;
BSpdfsFcn *thePDF;

Expand Down
8 changes: 0 additions & 8 deletions RecoVertex/BeamSpotProducer/src/BSFitter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
________________________________________________________________**/

#include "Minuit2/VariableMetricMinimizer.h"
#include "Minuit2/FunctionMinimum.h"
#include "Minuit2/MnPrint.h"
#include "Minuit2/MnMigrad.h"
Expand Down Expand Up @@ -70,11 +69,6 @@ BSFitter::BSFitter(const std::vector<BSTrkParameters> &BSvector) {
//if (theGausszFcn == 0 ) {
thePDF = new BSpdfsFcn();

//}
//if (theFitter == 0 ) {

theFitter = new VariableMetricMinimizer();

//}

fapplyd0cut = false;
Expand All @@ -95,7 +89,6 @@ BSFitter::BSFitter(const std::vector<BSTrkParameters> &BSvector) {
BSFitter::~BSFitter() {
//delete fBSvector;
delete thePDF;
delete theFitter;
}

//______________________________________________________________________
Expand Down Expand Up @@ -271,7 +264,6 @@ reco::BeamSpot BSFitter::Fit_z_likelihood(double *inipar) {
thePDF->SetData(fBSvector);
//std::cout << "data loaded"<< std::endl;

//FunctionMinimum fmin = theFitter->Minimize(*theGausszFcn, par, err, 1, 500, 0.1);
MnUserParameters upar;
upar.Add("X0", 0., 0.);
upar.Add("Y0", 0., 0.);
Expand Down

0 comments on commit 325c9e3

Please sign in to comment.