Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F7879770
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
16 KB
Subscribers
None
View Options
diff --git a/t/CMakeLists.txt b/t/CMakeLists.txt
index c8e4bf3..ecbb528 100644
--- a/t/CMakeLists.txt
+++ b/t/CMakeLists.txt
@@ -1,505 +1,505 @@
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 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 classify_ref
COMMAND test_classify_ref ${tst_dir}/classify_ref ${tst_dir}/classify.lhe.gz
)
add_test(
NAME classify_ref_4j
COMMAND test_classify_ref ${tst_dir}/classify_ref_4j ${tst_dir}/4j.lhe.gz
)
add_test(
NAME classify_ref_W4j
COMMAND test_classify_ref
${tst_dir}/classify_ref_W4j
${tst_dir}/MGemnubar4j_unweighted.lhe.gz
)
add_test(
NAME t_classify_ref_Z4j
COMMAND test_classify_ref
${tst_dir}/classify_ref_Z4j
${tst_dir}/Z_4j.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 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 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 PhaseSpace
COMMAND test_psp ${tst_dir}/psp_gen.lhe.gz
)
# test importing analyses
file(COPY "${tst_dir}/analysis_config.yml" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
set(test_config "${CMAKE_CURRENT_BINARY_DIR}/analysis_config.yml")
get_target_property(ANALYSIS_PATH AnalysisTemplate_lib BINARY_DIR)
get_target_property(ANALYSIS_LIB AnalysisTemplate_lib OUTPUT_NAME)
set(ANALYSIS_PARAMETERS "")
file(READ ${test_config} config)
file(WRITE ${test_config} "${config} - plugin: ${ANALYSIS_PATH}/lib${ANALYSIS_LIB}.so\n ${ANALYSIS_PARAMETERS}\n")
configure_file( ${tst_dir}/analysis_config_single.yml.in
analysis_config_simple.yml @ONLY )
add_test(
NAME analysis_simple
COMMAND $<TARGET_FILE:HEJ_main>
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")
file(READ ${test_config} config)
file(WRITE ${test_config} "${config} - plugin: ${ANALYSIS_PATH}/lib${ANALYSIS_LIB}.so\n ${ANALYSIS_PARAMETERS}\n")
configure_file( ${tst_dir}/analysis_config_single.yml.in
analysis_config_print.yml @ONLY )
add_test(
NAME analysis_print
COMMAND $<TARGET_FILE:HEJ_main>
analysis_config_print.yml
${tst_dir}/2j.lhe.gz
)
if(ROOT_FOUND)
get_target_property(ANALYSIS_PATH AnalysisROOT_lib BINARY_DIR)
get_target_property(ANALYSIS_LIB AnalysisROOT_lib OUTPUT_NAME)
set(ANALYSIS_PARAMETERS "")
file(READ ${test_config} config)
file(WRITE ${test_config} "${config} - plugin: ${ANALYSIS_PATH}/lib${ANALYSIS_LIB}.so\n ${ANALYSIS_PARAMETERS}\n")
configure_file( ${tst_dir}/analysis_config_single.yml.in
analysis_config_root.yml @ONLY )
add_test(
NAME analysis_root
COMMAND $<TARGET_FILE:HEJ_main>
analysis_config_root.yml
${tst_dir}/2j.lhe.gz
)
endif()
if(RIVET_FOUND)
file(READ ${test_config} config)
file(WRITE ${test_config} "${config} - rivet: MC_XS\n output: ana_rivet\n")
endif()
add_test(
NAME analysis_all
COMMAND $<TARGET_FILE:HEJ_main>
${test_config}
${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
jet_config_with_import.yml @ONLY )
add_test(
NAME scale_import
COMMAND test_scale_import 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 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 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 parameters
COMMAND test_parameters
)
# test Particle IDs
add_executable(test_pid ${tst_dir}/test_pid)
target_link_libraries(test_pid HEJ hej_test)
add_test(
NAME pid
COMMAND test_pid
)
# test EW constants
add_executable(test_EWConstants ${tst_dir}/test_EWConstants)
target_link_libraries(test_EWConstants HEJ hej_test)
add_test(
NAME EWConstants
COMMAND test_EWConstants
)
# test unweighting
add_executable(test_unweighter ${tst_dir}/test_unweighter)
target_link_libraries(test_unweighter HEJ hej_test)
add_test(
NAME 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 colour_flow
COMMAND test_colours
)
add_executable(test_colours2 ${tst_dir}/test_colours2)
target_link_libraries(test_colours2 HEJ hej_test)
add_test(
NAME colour_flow2
COMMAND test_colours2
)
# 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 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 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 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 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 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 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 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 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 ME_j_subl_4j
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 ME_j_subl_4j_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 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 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 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 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 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 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
)
add_test(
NAME t_ME_Z_FKL
COMMAND test_ME_generic ${tst_ME_data_dir}/config_Z_ME.yml
${tst_ME_data_dir}/ME_Z_FKL_tree.dat ${tst_ME_data_dir}/PSP_Z_FKL.lhe.gz
)
add_test(
NAME t_ME_Z_FKL_virt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_Z_ME.yml
${tst_ME_data_dir}/ME_Z_FKL_virt.dat ${tst_ME_data_dir}/PSP_Z_FKL.lhe.gz
)
add_test(
NAME t_ME_Z_uno
COMMAND test_ME_generic ${tst_ME_data_dir}/config_Z_ME.yml
${tst_ME_data_dir}/ME_Z_uno_tree.dat ${tst_ME_data_dir}/PSP_Z_uno.lhe.gz
)
add_test(
NAME t_ME_Z_uno_virt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_Z_ME.yml
${tst_ME_data_dir}/ME_Z_uno_virt.dat ${tst_ME_data_dir}/PSP_Z_uno.lhe.gz
)
# test main executable
file(COPY "${tst_dir}/jet_config.yml" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
set(test_config "${CMAKE_CURRENT_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 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
)
add_test(
NAME main_example
COMMAND $<TARGET_FILE:HEJ_main> ${PROJECT_SOURCE_DIR}/config.yml ${tst_dir}/h_3j.lhe.gz
)
# check that Sherpas LHE input can be read
add_executable(check_lhe_sherpa ${tst_dir}/check_lhe_sherpa.cc)
target_link_libraries(check_lhe_sherpa HEJ hej_test)
add_test(
NAME sherpa_reader
COMMAND check_lhe_sherpa ${tst_dir}/SherpaLHE.lhe 1.62624e+08
)
# 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 hdf5_read
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 hej_test)
add_test(
NAME hdf5_write
COMMAND test_hdf5_write ${tst_dir}/Wm9-g4-repack.hdf5 output.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 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 reconstruct_W
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 xs_2j
COMMAND check_res ${tst_dir}/2j.lhe.gz 3.49391e+07 419684
)
add_test(
NAME xs_3j
COMMAND check_res ${tst_dir}/3j.lhe.gz 2.37902e+06 25746.6
)
add_test(
NAME xs_3j_unof
COMMAND check_res ${tst_dir}/3j.lhe.gz 133399 4688.83 unof
)
add_test(
NAME xs_3j_unob
COMMAND check_res ${tst_dir}/3j.lhe.gz 105247 3449.45 unob
)
add_test(
NAME xs_3j_splitf
COMMAND check_res ${tst_dir}/3j.lhe.gz 97659.9 2748.65 splitf
)
add_test(
NAME xs_3j_splitb
COMMAND check_res ${tst_dir}/3j.lhe.gz 107150 2799.8 splitb
)
add_test(
NAME xs_4j
COMMAND check_res ${tst_dir}/4j.lhe.gz 603713 72822.6
)
add_test(
NAME xs_4j_qqbar_mid
COMMAND check_res ${tst_dir}/4j.lhe.gz 21866.7 1716.96 qqbar_mid
)
add_test(
NAME xs_h_3j
- COMMAND check_res ${tst_dir}/h_3j.lhe.gz 0.821622 0.0220334
+ COMMAND check_res ${tst_dir}/h_3j.lhe.gz 0.667678 0.0126859
)
add_test(
NAME xs_h_3j_unof
COMMAND check_res ${tst_dir}/h_3j_uno.lhe.gz 0.0110041 0.000274214 unof
)
add_test(
NAME xs_h_3j_unob
COMMAND check_res ${tst_dir}/h_3j_uno.lhe.gz 0.0116516 0.000376737 unob
)
add_test(
NAME xs_epnu_2j
COMMAND check_res ${tst_dir}/epnu2jLOFKL_unweight.lhe.tar.gz 262.7 3
)
add_test(
NAME xs_epnu_3j
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted.lhe.gz 38.9512 1
)
add_test(
NAME xs_emnubar_3j
COMMAND check_res ${tst_dir}/MGemnubar3j_unweighted.lhe.gz 24.1575 1
)
add_test(
NAME xs_epnu_3j_unof
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted.lhe.gz 9.63702 0.128355 unof
)
add_test(
NAME xs_epnu_3j_unob
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted.lhe.gz 9.70119 0.108436 unob
)
add_test(
NAME xs_epnu_3j_splitf
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted.lhe.gz 2.91995 0.0463182 splitf
)
add_test(
NAME xs_epnu_3j_splitb
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted.lhe.gz 3.40708 0.0550975 splitb
)
add_test(
NAME xs_epnu_4j
COMMAND check_res ${tst_dir}/MGepnu4j_unweighted.lhe.gz 10.2542 0.135106
)
add_test(
NAME xs_emnubar_4j
COMMAND check_res ${tst_dir}/MGemnubar4j_unweighted.lhe.gz 5.73282 0.0583738
)
add_test(
NAME xs_epnu_4j_qqbar_mid
COMMAND check_res ${tst_dir}/MGepnu4j_unweighted.lhe.gz 0.802603 0.0126908 qqbar_mid
)
endif()
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Nov 19, 8:56 PM (1 d, 2 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3806181
Default Alt Text
(16 KB)
Attached To
rHEJ HEJ
Event Timeline
Log In to Comment