Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion interpreter/cling/tools/plugins/clad/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ if (DEFINED CLAD_SOURCE_DIR)
list(APPEND _clad_extra_settings SOURCE_DIR ${CLAD_SOURCE_DIR})
else()
list(APPEND _clad_extra_settings GIT_REPOSITORY https://github.com/vgvassilev/clad.git)
list(APPEND _clad_extra_settings GIT_TAG v2.2)
list(APPEND _clad_extra_settings GIT_TAG master)
endif()

## list(APPEND _clad_patches_list "patch1.patch" "patch2.patch")
Expand Down
36 changes: 25 additions & 11 deletions roofit/histfactory/test/testHistFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@
#include <RooFitHS3/JSONIO.h>
#include <RooFitHS3/RooJSONFactoryWSTool.h>

#include <RooFit/Detail/NormalizationHelpers.h>
#include <RooDataHist.h>
#include <RooWorkspace.h>
#include <RooArgSet.h>
#include <RooSimultaneous.h>
#include <RooRealSumPdf.h>
#include <RooRealVar.h>
#include <RooHelpers.h>
#include <RooDataHist.h>
#include <RooEvaluatorWrapper.h>
#include <RooFit/Detail/NormalizationHelpers.h>
#include <RooFit/Evaluator.h>
#include <RooFitResult.h>
#include <RooHelpers.h>
#include <RooMinimizer.h>
#include <RooPlot.h>
#include <RooFit/Evaluator.h>
#include <RooRealSumPdf.h>
#include <RooRealVar.h>
#include <RooSimultaneous.h>
#include <RooWorkspace.h>

#include <TROOT.h>
#include <TFile.h>
Expand Down Expand Up @@ -618,9 +620,21 @@ TEST_P(HFFixtureFit, Fit)
}

using namespace RooFit;
std::unique_ptr<RooFitResult> fitResult{simPdf->fitTo(*data, evalBackend, Optimize(constTermOptimization),
GlobalObservables(*mc->GetGlobalObservables()), Save(),
PrintLevel(verbose ? 1 : -1))};
std::unique_ptr<RooAbsReal> nll{simPdf->createNLL(*data, evalBackend, Optimize(constTermOptimization),
GlobalObservables(*mc->GetGlobalObservables()))};
RooMinimizer::Config cfg;
if (evalBackend == RooFit::EvalBackend::Codegen()) {
// Make sure we use both analytical gradient and Hessian
static_cast<RooFit::Experimental::RooEvaluatorWrapper &>(*nll).generateGradient();
static_cast<RooFit::Experimental::RooEvaluatorWrapper &>(*nll).generateHessian();
cfg.useGradient = true;
cfg.useHessian = true;
}
RooMinimizer minim{*nll, cfg};
minim.setPrintLevel(verbose ? 1 : -1);
minim.minimize("Minuit2", "Migrad");
minim.hesse();
std::unique_ptr<RooFitResult> fitResult{minim.save()};
ASSERT_NE(fitResult, nullptr);
if (verbose)
fitResult->Print("v");
Expand Down
12 changes: 10 additions & 2 deletions roofit/roofitcore/test/testRooFuncWrapper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,16 @@
std::unique_ptr<RooHelpers::LocalChangeMsgLevel> _changeMsgLvl;
};

std::unique_ptr<RooFitResult> runMinimizer(RooAbsReal &absReal, bool useGradient = true)
std::unique_ptr<RooFitResult> runMinimizer(RooAbsReal &absReal, bool useAD = true)
{
RooMinimizer::Config cfg;
cfg.useGradient = useGradient;
cfg.useGradient = useAD;
cfg.useHessian = useAD;
RooMinimizer m{absReal, cfg};
m.setPrintLevel(-1);
m.setStrategy(0);
m.minimize("Minuit2");
m.hesse(); // to use the analytical Hessian for error estimation
return std::unique_ptr<RooFitResult>{m.save()};
}

Expand Down Expand Up @@ -164,6 +166,9 @@
// We want to use the generated code also for the nominal likelihood. Like
// this, we make sure to validate also the NLL values of the generated code.
static_cast<RooFit::Experimental::RooEvaluatorWrapper &>(*nllFunc).setUseGeneratedFunctionCode(true);
// Let's also validate the Hessian
static_cast<RooFit::Experimental::RooEvaluatorWrapper&>(*nllFunc).generateHessian();
static_cast<RooFit::Experimental::RooEvaluatorWrapper&>(*nllFunc).writeDebugMacro(_params._name);

double tol = _params._fitResultTolerance;

Expand Down Expand Up @@ -214,6 +219,9 @@
// because for very small correlations it's usually not the same within the
// relative tolerance because you would compare two small values that are
// only different from zero because of noise.
// The error tolerance is also quite large, because the analytical Hessian
// gives numerically quite different results.
double errorTol = 0.1;

Check failure on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / debian13 dev=ON, CMAKE_CXX_FLAGS=-Wsuggest-override

unused variable ‘errorTol’ [-Werror=unused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / alma10 benchmark build CMAKE_CXX_STANDARD=20

unused variable ‘errorTol’ [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / alma9 modules_off CMAKE_CXX_STANDARD=20

unused variable ‘errorTol’ [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / alma10

unused variable ‘errorTol’ [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / rawhide Fedora pydebug CMAKE_CXX_STANDARD=23

unused variable ‘errorTol’ [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / fedora43

unused variable ‘errorTol’ [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / ubuntu2604

unused variable ‘errorTol’ [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / fedora44

unused variable ‘errorTol’ [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / opensuse15 march_native

unused variable ‘errorTol’ [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / alma8

unused variable ‘errorTol’ [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / alma10 clang Ninja builtin CMAKE_CXX_STANDARD=20

unused variable 'errorTol' [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / mac14 X64 CMAKE_CXX_STANDARD=20

unused variable 'errorTol' [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / alma10 arm64 CMAKE_BUILD_TYPE=RelWithDebInfo, builtin_zlib=ON, builtin_zstd=ON, CMAKE_CXX_STANDARD=20

unused variable ‘errorTol’ [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / ubuntu22 imt=Off, CMAKE_BUILD_TYPE=Debug

unused variable ‘errorTol’ [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / alma9 CMAKE_BUILD_TYPE=Debug

unused variable ‘errorTol’ [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / mac15 ARM64 CMAKE_CXX_STANDARD=23

unused variable 'errorTol' [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / ubuntu2404 CMAKE_BUILD_TYPE=Debug

unused variable ‘errorTol’ [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / mac26 ARM64

unused variable 'errorTol' [-Wunused-variable]

Check warning on line 224 in roofit/roofitcore/test/testRooFuncWrapper.cxx

View workflow job for this annotation

GitHub Actions / mac-beta ARM64

unused variable 'errorTol' [-Wunused-variable]
EXPECT_TRUE(result->isIdenticalNoCov(*resultRef, tol, tol));
EXPECT_TRUE(resultAd->isIdenticalNoCov(*resultRef, tol, tol));
}
Expand Down
Loading