Skip to content

Commit ea0fd48

Browse files
authored
Merge pull request #46079 from guitargeek/minuit2_fix
Follow up on recent Minuit 2 code changes
2 parents ab58733 + 43574ba commit ea0fd48

File tree

7 files changed

+3
-63
lines changed

7 files changed

+3
-63
lines changed

OnlineDB/CSCCondDB/interface/CSCThrTurnOnFcn.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111

1212
#include "Minuit2/FCNBase.h"
1313
#include <vector>
14-
#include <RVersion.h>
15-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
16-
#include <span>
17-
#endif
1814

1915
class CSCThrTurnOnFcn : public ROOT::Minuit2::FCNBase {
2016
private:
@@ -43,11 +39,7 @@ class CSCThrTurnOnFcn : public ROOT::Minuit2::FCNBase {
4339
void setNorm(float n) { norm = n; };
4440

4541
/// Provide the chi-squared function for the given data
46-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
47-
double operator()(std::span<const double>) const override;
48-
#else
4942
double operator()(const std::vector<double>&) const override;
50-
#endif
5143

5244
///@@ What?
5345
double Up() const override { return 1.; }

OnlineDB/CSCCondDB/src/CSCFitAFEBThr.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,9 @@ bool CSCFitAFEBThr::ThresholdNoise(const std::vector<float>& inputx,
130130
// <<" "<<ery[i]<<std::endl;
131131

132132
/// Fit as 1D, <=500 iterations, edm=10**-5 (->0.1)
133-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
134-
FunctionMinimum fmin = theFitter->Minimize(
135-
*theOBJfun, {std::span<double>(parinit), std::span<double>(erparinit)}, MnStrategy{1}, 500, 0.1);
136-
#else
137-
FunctionMinimum fmin = theFitter->Minimize(*theOBJfun, parinit, erparinit, 1, 500, 0.1);
138-
#endif
133+
FunctionMinimum fmin =
134+
theFitter->Minimize(*theOBJfun, MnUserParameterState{parinit, erparinit}, MnStrategy{1}, 500, 0.1);
135+
139136
status = fmin.IsValid();
140137

141138
if (status) {

OnlineDB/CSCCondDB/src/CSCThrTurnOnFcn.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
#include <vector>
66
#include "TMath.h"
77

8-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
9-
double CSCThrTurnOnFcn::operator()(std::span<const double> par) const {
10-
#else
118
double CSCThrTurnOnFcn::operator()(const std::vector<double>& par) const {
12-
#endif
139
double x, y, er, fn;
1410
double N = norm;
1511
double chi2 = 0.;

RecoVertex/BeamSpotProducer/interface/BSpdfsFcn.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ ________________________________________________________________**/
1818

1919
#include <iostream>
2020
#include <string>
21-
#include <RVersion.h>
22-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
23-
#include <span>
24-
#endif
2521

2622
class BSpdfsFcn : public ROOT::Minuit2::FCNBase {
2723
public:
@@ -30,25 +26,14 @@ class BSpdfsFcn : public ROOT::Minuit2::FCNBase {
3026
// define pdfs to use
3127
void SetPDFs(std::string usepdfs) { fusepdfs = usepdfs; }
3228

33-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
34-
double operator()(std::span<const double>) const override;
35-
#else
3629
double operator()(const std::vector<double>&) const override;
37-
#endif
3830
double Up() const override { return 1.; }
3931

4032
private:
41-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
42-
double PDFGauss_d(double z, double d, double sigmad, double phi, std::span<const double> parms) const;
43-
double PDFGauss_d_resolution(double z, double d, double phi, double pt, std::span<const double> parms) const;
44-
45-
double PDFGauss_z(double z, double sigmaz, std::span<const double> parms) const;
46-
#else
4733
double PDFGauss_d(double z, double d, double sigmad, double phi, const std::vector<double>& parms) const;
4834
double PDFGauss_d_resolution(double z, double d, double phi, double pt, const std::vector<double>& parms) const;
4935

5036
double PDFGauss_z(double z, double sigmaz, const std::vector<double>& parms) const;
51-
#endif
5237

5338
std::string fusepdfs;
5439
std::vector<BSTrkParameters> fBSvector;

RecoVertex/BeamSpotProducer/interface/FcnBeamSpotFitPV.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include "Minuit2/FCNBase.h"
1919

2020
#include <vector>
21-
#include <span>
22-
#include <RVersion.h>
2321

2422
class FcnBeamSpotFitPV : public ROOT::Minuit2::FCNBase {
2523
public:
@@ -31,11 +29,7 @@ class FcnBeamSpotFitPV : public ROOT::Minuit2::FCNBase {
3129
// deltaFcn for definition of the uncertainty
3230
double Up() const override { return errorDef_; }
3331
// -2lnL value based on vector of parameters
34-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
35-
double operator()(std::span<const double>) const override;
36-
#else
3732
double operator()(const std::vector<double>&) const override;
38-
#endif
3933
// vertex count used for the fit (after selection)
4034
unsigned int nrOfVerticesUsed() const;
4135

RecoVertex/BeamSpotProducer/src/BSpdfsFcn.cc

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,9 @@ ________________________________________________________________**/
1515

1616
#include <cmath>
1717
#include <vector>
18-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
19-
#include <span>
20-
#endif
2118

2219
//______________________________________________________________________
23-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
24-
double BSpdfsFcn::PDFGauss_d(double z, double d, double sigmad, double phi, std::span<const double> parms) const {
25-
#else
2620
double BSpdfsFcn::PDFGauss_d(double z, double d, double sigmad, double phi, const std::vector<double>& parms) const {
27-
#endif
2821
//---------------------------------------------------------------------------
2922
// PDF for d0 distribution. This PDF is a simple gaussian in the
3023
// beam reference frame.
@@ -42,12 +35,8 @@ double BSpdfsFcn::PDFGauss_d(double z, double d, double sigmad, double phi, cons
4235
}
4336

4437
//______________________________________________________________________
45-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
46-
double BSpdfsFcn::PDFGauss_d_resolution(double z, double d, double phi, double pt, std::span<const double> parms) const {
47-
#else
4838
double BSpdfsFcn::PDFGauss_d_resolution(
4939
double z, double d, double phi, double pt, const std::vector<double>& parms) const {
50-
#endif
5140
//---------------------------------------------------------------------------
5241
// PDF for d0 distribution. This PDF is a simple gaussian in the
5342
// beam reference frame. The IP resolution is parametrize by a linear
@@ -68,12 +57,7 @@ double BSpdfsFcn::PDFGauss_d_resolution(
6857
}
6958

7059
//______________________________________________________________________
71-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
72-
double BSpdfsFcn::PDFGauss_z(double z, double sigmaz, std::span<const double> parms) const {
73-
#else
7460
double BSpdfsFcn::PDFGauss_z(double z, double sigmaz, const std::vector<double>& parms) const {
75-
#endif
76-
7761
//---------------------------------------------------------------------------
7862
// PDF for z-vertex distribution. This distribution
7963
// is parametrized by a simple normalized gaussian distribution.
@@ -89,11 +73,7 @@ double BSpdfsFcn::PDFGauss_z(double z, double sigmaz, const std::vector<double>&
8973
}
9074

9175
//______________________________________________________________________
92-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
93-
double BSpdfsFcn::operator()(const std::span<const double> params) const {
94-
#else
9576
double BSpdfsFcn::operator()(const std::vector<double>& params) const {
96-
#endif
9777
double f = 0.0;
9878

9979
//std::cout << "fusepdfs=" << fusepdfs << " params.size="<<params.size() << std::endl;

RecoVertex/BeamSpotProducer/src/FcnBeamSpotFitPV.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ unsigned int FcnBeamSpotFitPV::nrOfVerticesUsed() const {
5151
return nVtx;
5252
}
5353

54-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1)
55-
double FcnBeamSpotFitPV::operator()(std::span<const double> pars) const {
56-
#else
5754
double FcnBeamSpotFitPV::operator()(const std::vector<double>& pars) const {
58-
#endif
5955
//
6056
// fit parameters
6157
//

0 commit comments

Comments
 (0)