diff --git a/OnlineDB/CSCCondDB/interface/CSCThrTurnOnFcn.h b/OnlineDB/CSCCondDB/interface/CSCThrTurnOnFcn.h index a114a62208369..340543eff74b0 100644 --- a/OnlineDB/CSCCondDB/interface/CSCThrTurnOnFcn.h +++ b/OnlineDB/CSCCondDB/interface/CSCThrTurnOnFcn.h @@ -11,6 +11,10 @@ #include "Minuit2/FCNBase.h" #include +#include +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1) +#include +#endif class CSCThrTurnOnFcn : public ROOT::Minuit2::FCNBase { private: @@ -39,7 +43,11 @@ class CSCThrTurnOnFcn : public ROOT::Minuit2::FCNBase { void setNorm(float n) { norm = n; }; /// Provide the chi-squared function for the given data +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1) + double operator()(std::span) const override; +#else double operator()(const std::vector&) const override; +#endif ///@@ What? double Up() const override { return 1.; } diff --git a/OnlineDB/CSCCondDB/src/CSCFitAFEBThr.cc b/OnlineDB/CSCCondDB/src/CSCFitAFEBThr.cc index e71f97e64008a..b3d188f27a5f5 100644 --- a/OnlineDB/CSCCondDB/src/CSCFitAFEBThr.cc +++ b/OnlineDB/CSCCondDB/src/CSCFitAFEBThr.cc @@ -130,8 +130,12 @@ bool CSCFitAFEBThr::ThresholdNoise(const std::vector& inputx, // <<" "<0.1) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1) + FunctionMinimum fmin = + theFitter->Minimize(*theOBJfun, std::span(parinit), std::span(erparinit), 1, 500, 0.1); +#else FunctionMinimum fmin = theFitter->Minimize(*theOBJfun, parinit, erparinit, 1, 500, 0.1); - +#endif status = fmin.IsValid(); if (status) { diff --git a/OnlineDB/CSCCondDB/src/CSCThrTurnOnFcn.cc b/OnlineDB/CSCCondDB/src/CSCThrTurnOnFcn.cc index ae8d5b94d15c9..721f3a0a7b80b 100644 --- a/OnlineDB/CSCCondDB/src/CSCThrTurnOnFcn.cc +++ b/OnlineDB/CSCCondDB/src/CSCThrTurnOnFcn.cc @@ -5,7 +5,11 @@ #include #include "TMath.h" +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1) +double CSCThrTurnOnFcn::operator()(std::span par) const { +#else double CSCThrTurnOnFcn::operator()(const std::vector& par) const { +#endif double x, y, er, fn; double N = norm; double chi2 = 0.; diff --git a/RecoVertex/BeamSpotProducer/interface/BSpdfsFcn.h b/RecoVertex/BeamSpotProducer/interface/BSpdfsFcn.h index 6e431e29080e2..ca33384094dd5 100644 --- a/RecoVertex/BeamSpotProducer/interface/BSpdfsFcn.h +++ b/RecoVertex/BeamSpotProducer/interface/BSpdfsFcn.h @@ -18,6 +18,10 @@ ________________________________________________________________**/ #include #include +#include +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 32, 4) +#include +#endif class BSpdfsFcn : public ROOT::Minuit2::FCNBase { public: @@ -26,14 +30,25 @@ class BSpdfsFcn : public ROOT::Minuit2::FCNBase { // define pdfs to use void SetPDFs(std::string usepdfs) { fusepdfs = usepdfs; } +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1) + double operator()(std::span) const override; +#else double operator()(const std::vector&) const override; +#endif double Up() const override { return 1.; } private: +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1) + double PDFGauss_d(double z, double d, double sigmad, double phi, std::span parms) const; + double PDFGauss_d_resolution(double z, double d, double phi, double pt, std::span parms) const; + + double PDFGauss_z(double z, double sigmaz, std::span parms) const; +#else double PDFGauss_d(double z, double d, double sigmad, double phi, const std::vector& parms) const; double PDFGauss_d_resolution(double z, double d, double phi, double pt, const std::vector& parms) const; double PDFGauss_z(double z, double sigmaz, const std::vector& parms) const; +#endif std::string fusepdfs; std::vector fBSvector; diff --git a/RecoVertex/BeamSpotProducer/interface/FcnBeamSpotFitPV.h b/RecoVertex/BeamSpotProducer/interface/FcnBeamSpotFitPV.h index bb38fa870f368..e39584257832d 100644 --- a/RecoVertex/BeamSpotProducer/interface/FcnBeamSpotFitPV.h +++ b/RecoVertex/BeamSpotProducer/interface/FcnBeamSpotFitPV.h @@ -18,6 +18,8 @@ #include "Minuit2/FCNBase.h" #include +#include +#include class FcnBeamSpotFitPV : public ROOT::Minuit2::FCNBase { public: @@ -29,7 +31,11 @@ class FcnBeamSpotFitPV : public ROOT::Minuit2::FCNBase { // deltaFcn for definition of the uncertainty double Up() const override { return errorDef_; } // -2lnL value based on vector of parameters +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 32, 4) + double operator()(std::span) const override; +#else double operator()(const std::vector&) const override; +#endif // vertex count used for the fit (after selection) unsigned int nrOfVerticesUsed() const; diff --git a/RecoVertex/BeamSpotProducer/src/BSpdfsFcn.cc b/RecoVertex/BeamSpotProducer/src/BSpdfsFcn.cc index d7556fd42b25a..d1295e4fd8eb8 100644 --- a/RecoVertex/BeamSpotProducer/src/BSpdfsFcn.cc +++ b/RecoVertex/BeamSpotProducer/src/BSpdfsFcn.cc @@ -15,9 +15,16 @@ ________________________________________________________________**/ #include #include +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 33, 1) +#include +#endif //______________________________________________________________________ +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 32, 4) +double BSpdfsFcn::PDFGauss_d(double z, double d, double sigmad, double phi, std::span parms) const { +#else double BSpdfsFcn::PDFGauss_d(double z, double d, double sigmad, double phi, const std::vector& parms) const { +#endif //--------------------------------------------------------------------------- // PDF for d0 distribution. This PDF is a simple gaussian in the // beam reference frame. @@ -35,8 +42,12 @@ double BSpdfsFcn::PDFGauss_d(double z, double d, double sigmad, double phi, cons } //______________________________________________________________________ +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 32, 4) +double BSpdfsFcn::PDFGauss_d_resolution(double z, double d, double phi, double pt, std::span parms) const { +#else double BSpdfsFcn::PDFGauss_d_resolution( double z, double d, double phi, double pt, const std::vector& parms) const { +#endif //--------------------------------------------------------------------------- // PDF for d0 distribution. This PDF is a simple gaussian in the // beam reference frame. The IP resolution is parametrize by a linear @@ -57,7 +68,12 @@ double BSpdfsFcn::PDFGauss_d_resolution( } //______________________________________________________________________ +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 32, 4) +double BSpdfsFcn::PDFGauss_z(double z, double sigmaz, std::span parms) const { +#else double BSpdfsFcn::PDFGauss_z(double z, double sigmaz, const std::vector& parms) const { +#endif + //--------------------------------------------------------------------------- // PDF for z-vertex distribution. This distribution // is parametrized by a simple normalized gaussian distribution. @@ -73,7 +89,11 @@ double BSpdfsFcn::PDFGauss_z(double z, double sigmaz, const std::vector& } //______________________________________________________________________ +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 32, 4) +double BSpdfsFcn::operator()(const std::span params) const { +#else double BSpdfsFcn::operator()(const std::vector& params) const { +#endif double f = 0.0; //std::cout << "fusepdfs=" << fusepdfs << " params.size="<= ROOT_VERSION(6, 33, 1) +double FcnBeamSpotFitPV::operator()(std::span pars) const { +#else double FcnBeamSpotFitPV::operator()(const std::vector& pars) const { +#endif // // fit parameters //