Skip to content

Commit

Permalink
[RF] Move vectorised PDF tests from roottest to roofit
Browse files Browse the repository at this point in the history
These useful tests are relatively short (runtime 28 seconds in total)
and test lower-level RooFit functionality.

Moving them from roottest to roofit has the following benefits:

 * Faster RooFit development experience: it's not necessary anymore to
   also add and compile all of `roottest`, if you want to make sure
   locally that the vectorized pdf tests always compile and pass.

 * The vectorized pdf tests will be able to consider the RooFit-internal
   preprocessor macros at build time, like `ROOFIT_CUDA` and
   `ROOFIT_LEGACY_EVAL_BACKEND`. Like this we can ensure that the tests
   will pass no matter how RooFit was configured at compile time. This
   is for me personally the strongest reason and was the motivator for
   this commit.

 * Avoid code repetition in `root` and `roottest`, because now the
   vectorized PDF tests will be able to re-use private code from RooFit.

 * If you want to build standalone RooFit with all tests, you won't have
   to stitch together the two repositories.
  • Loading branch information
guitargeek committed Oct 22, 2024
1 parent d26214e commit 103a4e0
Show file tree
Hide file tree
Showing 29 changed files with 2,895 additions and 0 deletions.
2 changes: 2 additions & 0 deletions roofit/roofit/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ else()
ROOT_EXECUTABLE(testRooFit testRooFit.cxx LIBRARIES RooFit)
ROOT_ADD_TEST(test-fit-testRooFit COMMAND testRooFit)
endif()

add_subdirectory(vectorisedPDFs)
67 changes: 67 additions & 0 deletions roofit/roofit/test/vectorisedPDFs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
if(CMAKE_CXX_COMPILER_ID STREQUAL Intel)
if(DEFINED ENV{VTUNE_AMPLIFIER_2019_DIR})
set(VTUNE_DIR ENV{VTUNE_AMPLIFIER_2019_DIR})
elseif(DEFINED ENV{VTUNE_PROFILER_2020_DIR})
set(VTUNE_DIR ENV{VTUNE_PROFILER_2020_DIR})
endif()
# To be able to start/stop the vtune profiler, ittnotify must be available.
target_include_directories(VectorisedPDFTests PUBLIC "${VTUNE_DIR}/include/")
target_link_libraries(VectorisedPDFTests INTERFACE "${VTUNE_DIR}/lib64/libittnotify.a")
endif()

add_library(VectorisedPDFTests STATIC VectorisedPDFTests.cxx)
target_link_libraries(VectorisedPDFTests PUBLIC gtest ROOT::Gpad ROOT::RooFitCore ROOT::RooFit)

ROOT_ADD_GTEST(testCompatMode testCompatMode.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testGauss testGauss.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testPoisson testPoisson.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testAddPdf testAddPdf.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testExponential testExponential.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testNestedPDFs testNestedPDFs.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testProductPdf testProductPdf.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testJohnson testJohnson.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testLandau testLandau.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testBukin testBukin.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testChebychev testChebychev.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testPolynomial testPolynomial.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testBernstein testBernstein.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testArgusBG testArgusBG.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testBifurGauss testBifurGauss.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testBreitWigner testBreitWigner.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testCBShape testCBShape.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testGamma testGamma.cxx
LIBRARIES VectorisedPDFTests)
if(ROOT_mathmore_FOUND)
ROOT_ADD_GTEST(testLegendre testLegendre.cxx
LIBRARIES VectorisedPDFTests ROOT::RooFitMore)
endif()
ROOT_ADD_GTEST(testChiSquarePdf testChiSquarePdf.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testDstD0BG testDstD0BG.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testLognormal testLognormal.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testNovosibirsk testNovosibirsk.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testVoigtian testVoigtian.cxx
LIBRARIES VectorisedPDFTests)
ROOT_ADD_GTEST(testGaussBinned testGaussBinned.cxx
LIBRARIES ROOT::Gpad ROOT::RooFitCore ROOT::RooFit)

Loading

0 comments on commit 103a4e0

Please sign in to comment.