Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F7876937
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
13 KB
Subscribers
None
View Options
diff --git a/t/CMakeLists.txt b/t/CMakeLists.txt
index 49d0c9a..aa25a75 100644
--- a/t/CMakeLists.txt
+++ b/t/CMakeLists.txt
@@ -1,394 +1,394 @@
set(tst_dir "${CMAKE_CURRENT_SOURCE_DIR}")
set(tst_ME_data_dir "${tst_dir}/ME_data")
# small library for common test functions
add_library(hej_test SHARED hej_test.cc)
target_include_directories(hej_test PUBLIC ${tst_dir})
target_link_libraries(hej_test HEJ)
# test event classification
# test explicit configurations
add_executable(test_classify ${tst_dir}/test_classify.cc)
target_compile_options(test_classify PRIVATE "-O0") # avoid compiler optimisation
target_link_libraries(test_classify HEJ hej_test)
add_test(
NAME t_classify
COMMAND test_classify
)
# test against reference data
add_executable(test_classify_ref ${tst_dir}/test_classify_ref.cc)
target_link_libraries(test_classify_ref HEJ hej_test)
add_test(
NAME t_classify_ref
COMMAND test_classify_ref ${tst_dir}/classify_ref ${tst_dir}/classify.lhe.gz
)
add_test(
NAME t_classify_ref_4j
COMMAND test_classify_ref ${tst_dir}/classify_ref_4j ${tst_dir}/4j.lhe.gz
)
add_test(
NAME t_classify_ref_W4j
COMMAND test_classify_ref ${tst_dir}/classify_ref_W4j ${tst_dir}/MGemnubar4j_unweighted.lhe.gz
)
# test for valid W decays
add_executable(test_decay ${tst_dir}/test_decay.cc)
target_link_libraries(test_decay HEJ hej_test)
add_test(
NAME t_valid_decay
COMMAND test_decay
)
# test valid jet cuts on tagging jets
add_executable(test_jet_cuts ${tst_dir}/test_jet_cuts.cc)
target_link_libraries(test_jet_cuts HEJ hej_test)
add_test(
NAME t_jet_cuts
COMMAND test_jet_cuts
)
# test phase space point
add_executable(test_psp ${tst_dir}/test_psp.cc)
target_link_libraries(test_psp HEJ hej_test)
add_test(
NAME t_psp
COMMAND test_psp ${tst_dir}/psp_gen.lhe.gz
)
# test importing analyses
get_target_property(ANALYSIS_PATH AnalysisTemplate_lib BINARY_DIR)
get_target_property(ANALYSIS_LIB AnalysisTemplate_lib OUTPUT_NAME)
set(ANALYSIS_PARAMETERS "")
configure_file( ${tst_dir}/analysis_config.yml.in
${PROJECT_BINARY_DIR}/t/analysis_config_simple.yml @ONLY )
add_test(
NAME t_analysis_simple
COMMAND $<TARGET_FILE:HEJ_main>
${PROJECT_BINARY_DIR}/t/analysis_config_simple.yml
${tst_dir}/2j.lhe.gz
)
get_target_property(ANALYSIS_PATH AnalysisPrint_lib BINARY_DIR)
get_target_property(ANALYSIS_LIB AnalysisPrint_lib OUTPUT_NAME)
set(ANALYSIS_PARAMETERS " output: ana_output")
configure_file( ${tst_dir}/analysis_config.yml.in
${PROJECT_BINARY_DIR}/t/analysis_config_print.yml @ONLY )
add_test(
NAME t_analysis_print
COMMAND $<TARGET_FILE:HEJ_main>
${PROJECT_BINARY_DIR}/t/analysis_config_print.yml
${tst_dir}/2j.lhe.gz
)
# test importing scales (from examples/softestptScale)
add_executable(test_scale_import ${tst_dir}/test_scale_import)
target_link_libraries(test_scale_import HEJ)
get_target_property(SCALE_PATH softestptScale_lib BINARY_DIR)
get_target_property(SCALE_LIB softestptScale_lib OUTPUT_NAME)
set(SCALE_NAME "softest_jet_pt")
configure_file( ${tst_dir}/jet_config_with_import.yml.in
${PROJECT_BINARY_DIR}/t/jet_config_with_import.yml @ONLY )
add_test(
NAME t_scale_import
COMMAND test_scale_import ${PROJECT_BINARY_DIR}/t/jet_config_with_import.yml
)
# test scale arithmetic (e.g. 2*H_T/4)
add_executable(test_scale_arithmetics ${tst_dir}/test_scale_arithmetics)
target_link_libraries(test_scale_arithmetics HEJ hej_test)
add_test(
NAME t_scale_arithmetics
COMMAND test_scale_arithmetics ${tst_dir}/jet_config.yml ${tst_dir}/2j.lhe.gz
)
# test "ParameterDescription"
add_executable(test_descriptions ${tst_dir}/test_descriptions)
target_link_libraries(test_descriptions HEJ hej_test)
add_test(
NAME t_descriptions
COMMAND test_descriptions
)
# test "EventParameters*Weight"
add_executable(test_parameters ${tst_dir}/test_parameters)
target_link_libraries(test_parameters HEJ hej_test)
add_test(
NAME test_parameters
COMMAND test_parameters
)
# test unweighting
add_executable(test_unweighter ${tst_dir}/test_unweighter)
target_link_libraries(test_unweighter HEJ hej_test)
add_test(
NAME test_unweighter
COMMAND test_unweighter ${tst_dir}/4j.lhe.gz
)
# test colour generation
add_executable(test_colours ${tst_dir}/test_colours)
target_link_libraries(test_colours HEJ hej_test)
add_test(
NAME t_colour_flow
COMMAND test_colours
)
# test matrix elements
add_executable(test_ME_generic ${tst_dir}/test_ME_generic.cc)
target_link_libraries(test_ME_generic HEJ hej_test)
add_test(
NAME t_ME_j
COMMAND test_ME_generic ${tst_ME_data_dir}/config_mtinf.yml ${tst_ME_data_dir}/ME_jets_tree.dat ${tst_ME_data_dir}/PSP_jets.lhe.gz
)
add_test(
NAME t_ME_j_virt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_mtinf.yml ${tst_ME_data_dir}/ME_jets_tree_virt.dat ${tst_ME_data_dir}/PSP_jets.lhe.gz
)
add_test(
NAME t_ME_h
COMMAND test_ME_generic ${tst_ME_data_dir}/config_mtinf.yml ${tst_ME_data_dir}/ME_h_mtinf_tree.dat ${tst_ME_data_dir}/PSP_h.lhe.gz
)
add_test(
NAME t_ME_h_virt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_mtinf.yml ${tst_ME_data_dir}/ME_h_mtinf_virt.dat ${tst_ME_data_dir}/PSP_h.lhe.gz
)
if(QCDloop_FOUND)
add_test(
NAME t_ME_h_mt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_mt.yml ${tst_ME_data_dir}/ME_h_mt_tree.dat ${tst_ME_data_dir}/PSP_h.lhe.gz
)
add_test(
NAME t_ME_h_mtmb
COMMAND test_ME_generic ${tst_ME_data_dir}/config_mtmb.yml ${tst_ME_data_dir}/ME_h_mtmb_tree.dat ${tst_ME_data_dir}/PSP_h.lhe.gz
)
endif()
add_test(
NAME t_ME_j_subl
COMMAND test_ME_generic ${tst_ME_data_dir}/config_pure.yml ${tst_ME_data_dir}/ME_jets_subl_tree.dat ${tst_ME_data_dir}/PSP_jets_subl.lhe.gz
)
add_test(
NAME t_ME_j_subl_virt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_pure.yml ${tst_ME_data_dir}/ME_jets_subl_tree_virt.dat ${tst_ME_data_dir}/PSP_jets_subl.lhe.gz
)
add_test(
NAME t_ME_j_subl_new
COMMAND test_ME_generic ${tst_ME_data_dir}/config_pure.yml ${tst_ME_data_dir}/ME_jets_subl_tree_new.dat ${tst_dir}/4j.lhe.gz
)
add_test(
NAME t_ME_j_subl_new_virt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_pure.yml ${tst_ME_data_dir}/ME_jets_subl_tree_new_virt.dat ${tst_dir}/4j.lhe.gz
)
add_test(
NAME t_ME_w_FKL
COMMAND test_ME_generic ${tst_ME_data_dir}/config_w_ME.yml ${tst_ME_data_dir}/ME_w_FKL_tree.dat ${tst_ME_data_dir}/PSP_w_FKL.lhe.gz
)
add_test(
NAME t_ME_w_FKL_virt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_w_ME.yml ${tst_ME_data_dir}/ME_w_FKL_virt.dat ${tst_ME_data_dir}/PSP_w_FKL.lhe.gz
)
add_test(
NAME t_ME_Wp
COMMAND test_ME_generic ${tst_ME_data_dir}/config_w_ME.yml ${tst_ME_data_dir}/ME_Wp.dat ${tst_ME_data_dir}/PSP_Wp.lhe.gz
)
add_test(
NAME t_ME_Wp_virt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_w_ME.yml ${tst_ME_data_dir}/ME_Wp_virt.dat ${tst_ME_data_dir}/PSP_Wp.lhe.gz
)
add_test(
NAME t_ME_Wm
COMMAND test_ME_generic ${tst_ME_data_dir}/config_w_ME.yml ${tst_ME_data_dir}/ME_Wm.dat ${tst_ME_data_dir}/PSP_Wm.lhe.gz
)
add_test(
NAME t_ME_Wm_virt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_w_ME.yml ${tst_ME_data_dir}/ME_Wm_virt.dat ${tst_ME_data_dir}/PSP_Wm.lhe.gz
)
# test main executable
-file(COPY "${tst_dir}/jet_config.yml" DESTINATION "${CMAKE_BINARY_DIR}")
-set(test_config "${CMAKE_BINARY_DIR}/jet_config.yml")
+file(COPY "${tst_dir}/jet_config.yml" DESTINATION "${PROJECT_BINARY_DIR}")
+set(test_config "${PROJECT_BINARY_DIR}/jet_config.yml")
if(HighFive_FOUND)
file(READ ${test_config} config)
file(WRITE ${test_config} "${config} - tst.hdf5\n")
endif()
if(HepMC3_FOUND)
file(READ ${test_config} config)
file(WRITE ${test_config} "${config} - tst.hepmc\n")
endif()
if(HepMC_FOUND)
file(READ ${test_config} config)
file(WRITE ${test_config} "${config} - tst.hepmc2\n")
endif()
if(rivet_FOUND)
file(READ ${test_config} config)
file(WRITE ${test_config} "${config}\nanalysis:\n rivet: MC_XS\n output: tst\n")
endif()
set(test_cmd_main "$<TARGET_FILE:HEJ_main>\\\;${test_config}\\\;${tst_dir}/2j.lhe.gz")
# check that HepMC3 output is correct
if(HepMC3_FOUND)
add_executable(check_hepmc ${tst_dir}/check_hepmc.cc)
target_link_libraries(check_hepmc HEJ ${HEPMC3_LIBRARIES})
target_include_directories(check_hepmc PRIVATE ${HEPMC3_INCLUDE_DIR})
set(test_cmd_hepmc "$<TARGET_FILE:check_hepmc>\\\;tst.hepmc")
else()
set(test_cmd_hepmc "")
endif()
# check that LHEF output is correct
add_executable(check_lhe ${tst_dir}/check_lhe.cc)
target_link_libraries(check_lhe HEJ hej_test)
set(test_cmd_lhe "$<TARGET_FILE:check_lhe>\\\;tst.lhe")
# check that rivet interface is consistent with naive rivet
if(rivet_FOUND)
# this assumes "rivet" and "yodadiff" are found in PATH
if(rivet_USE_HEPMC3)
set(hepmc_file "tst.hepmc")
else()
set(hepmc_file "tst.hepmc2")
endif()
if(rivet_USE_HEPMC3 OR (rivet_VERSION VERSION_LESS 3))
set(histo_exclude "")
else()
# rivet 3 with HepMC 2 is inconsistent in order of weights
# -> interface != direct call (by permutation)
# REQUIRES Yoda 1.7.5
set(histo_exclude "-M\\\;\\\\d")
endif()
set(test_cmd_rivet "rivet\\\;-a\\\;MC_XS\\\;${hepmc_file}\\\;-o\\\;tst_direct.yoda\
\;yodadiff\\\;${histo_exclude}\\\;tst.yoda\\\;tst_direct.yoda")
else()
set(test_cmd_rivet "")
endif()
# Run dependent tests in one command to ensure correct execution order
# Note: The commands are concatenated with "\;" to escape CMake lists.
# Thus arguments have to be escaped twice "\\\;".
# e.g. "cmd1\;cmd2\\\;arg1\\\;arg2" is executed like "cmd1 && cmd2 arg1 arg2"
add_test(
NAME t_main
COMMAND ${CMAKE_COMMAND}
-DCMDS=${test_cmd_main}\;${test_cmd_hepmc}\;${test_cmd_lhe}\;${test_cmd_rivet}
-P ${PROJECT_SOURCE_DIR}/cmake/run_multiple_tests.cmake
)
# check HDF5 reader & writer
if(HighFive_FOUND)
add_executable(test_hdf5 ${tst_dir}/test_hdf5.cc)
target_link_libraries(test_hdf5 HEJ)
add_test(
NAME t_hdf5
COMMAND test_hdf5 ${tst_dir}/Wm9-g4-repack.hdf5
)
add_executable(test_hdf5_write ${tst_dir}/test_hdf5_write.cc)
target_link_libraries(test_hdf5_write HEJ)
add_test(
NAME t_hdf5_write
COMMAND test_hdf5_write ${tst_dir}/Wm9-g4-repack.hdf5
)
endif()
# check rivet interface
if(RIVET_FOUND)
add_executable(check_rivet ${tst_dir}/check_rivet.cc)
target_link_libraries(check_rivet HEJ rivet::rivet)
add_test(
NAME t_rivet
COMMAND check_rivet
)
endif()
# test boson reconstruction
add_executable(cmp_events ${tst_dir}/cmp_events.cc)
target_link_libraries(cmp_events HEJ)
add_test(
NAME t_epnu_2j_noW
COMMAND cmp_events ${tst_dir}/epnu2jLOFKL_unweight.lhe.tar.gz ${tst_dir}/epnu2jLOFKL_unweight_noW.lhe.gz
)
# test resummed result
add_executable(check_res ${tst_dir}/check_res.cc)
target_link_libraries(check_res HEJ hej_test)
if(TEST_ALL) # deactivate long tests by default
add_test(
NAME t_2j
COMMAND check_res ${tst_dir}/2j.lhe.gz 3.49391e+07 419684
)
add_test(
NAME t_3j
COMMAND check_res ${tst_dir}/3j.lhe.gz 2.37902e+06 25746.6
)
add_test(
NAME t_3j_unof
COMMAND check_res ${tst_dir}/3j.lhe.gz 133399 4688.83 unof
)
add_test(
NAME t_3j_unob
COMMAND check_res ${tst_dir}/3j.lhe.gz 105247 3449.45 unob
)
add_test(
NAME t_3j_splitf
COMMAND check_res ${tst_dir}/3j.lhe.gz 97659.9 2748.65 splitf
)
add_test(
NAME t_3j_splitb
COMMAND check_res ${tst_dir}/3j.lhe.gz 107150 2799.8 splitb
)
add_test(
NAME t_4j
COMMAND check_res ${tst_dir}/4j.lhe.gz 603713 72822.6
)
add_test(
NAME t_4j_qqxmid
COMMAND check_res ${tst_dir}/4j.lhe.gz 21866.7 1716.96 qqxmid
)
add_test(
NAME t_h_3j
COMMAND check_res ${tst_dir}/h_3j.lhe.gz 0.821622 0.0220334
)
add_test(
NAME t_h_3j_unof
COMMAND check_res ${tst_dir}/h_3j_uno.lhe.gz 0.0127362 0.000271555 unof
)
add_test(
NAME t_h_3j_unob
COMMAND check_res ${tst_dir}/h_3j_uno.lhe.gz 0.0130615 0.000224793 unob
)
add_test(
NAME t_epnu_2j
COMMAND check_res ${tst_dir}/epnu2jLOFKL_unweight.lhe.tar.gz 262.7 3
)
add_test(
NAME t_MGepnu_3j
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted.lhe.gz 38.9512 1
)
add_test(
NAME t_MGemnubar_3j
COMMAND check_res ${tst_dir}/MGemnubar3j_unweighted.lhe.gz 24.1575 1
)
add_test(
NAME t_MGepnu_3j_unof
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted.lhe.gz 9.63702 0.128355 unof
)
add_test(
NAME t_MGepnu_3j_unob
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted.lhe.gz 9.70119 0.108436 unob
)
add_test(
NAME t_MGepnu_3j_splitf
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted.lhe.gz 2.91995 0.0463182 splitf
)
add_test(
NAME t_MGepnu_3j_splitb
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted.lhe.gz 3.40708 0.0550975 splitb
)
add_test(
NAME t_MGepnu_4j
COMMAND check_res ${tst_dir}/MGepnu4j_unweighted.lhe.gz 10.2542 0.135106
)
add_test(
NAME t_MGemnubar_4j
COMMAND check_res ${tst_dir}/MGemnubar4j_unweighted.lhe.gz 5.57909 0.0300496
)
add_test(
NAME t_MGepnu_4j_qqxmid
COMMAND check_res ${tst_dir}/MGepnu4j_unweighted.lhe.gz 0.732084 0.005 qqxmid
)
endif()
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Nov 19, 2:40 PM (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3804778
Default Alt Text
(13 KB)
Attached To
rHEJ HEJ
Event Timeline
Log In to Comment