Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F7879395
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
26 KB
Subscribers
None
View Options
diff --git a/t/CMakeLists.txt b/t/CMakeLists.txt
index 1ee1ec2..57f7765 100644
--- a/t/CMakeLists.txt
+++ b/t/CMakeLists.txt
@@ -1,624 +1,630 @@
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_subl
COMMAND test_ME_generic ${tst_ME_data_dir}/config_mtinf.yml
${tst_ME_data_dir}/ME_h_subl_mtinf_tree.dat ${tst_ME_data_dir}/PSP_h_subl.lhe.gz
)
add_test(
NAME ME_hj
COMMAND test_ME_generic ${tst_ME_data_dir}/config_mtinf.yml
${tst_ME_data_dir}/ME_hj_mtinf_tree.dat ${tst_ME_data_dir}/PSP_hj.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
)
add_test(
NAME ME_hj_virt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_mtinf.yml
${tst_ME_data_dir}/ME_hj_mtinf_virt.dat ${tst_ME_data_dir}/PSP_hj.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
)
add_test(
NAME ME_h_subl_mtmb
COMMAND test_ME_generic ${tst_ME_data_dir}/config_mtmb.yml
${tst_ME_data_dir}/ME_h_subl_mtmb_tree.dat ${tst_ME_data_dir}/PSP_h_subl.lhe.gz
)
add_test(
NAME ME_hj_mt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_mt.yml
${tst_ME_data_dir}/ME_hj_mt_tree.dat ${tst_ME_data_dir}/PSP_hj.lhe.gz
)
add_test(
NAME ME_hj_mtmb
COMMAND test_ME_generic ${tst_ME_data_dir}/config_mtmb.yml
${tst_ME_data_dir}/ME_hj_mtmb_tree.dat ${tst_ME_data_dir}/PSP_hj.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 ME_Z
COMMAND test_ME_generic ${tst_ME_data_dir}/config_Z_ME.yml
${tst_ME_data_dir}/ME_Z.dat ${tst_ME_data_dir}/PSP_Z.lhe.gz
)
add_test(
NAME ME_Z_virt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_Z_ME.yml
${tst_ME_data_dir}/ME_Z_virt.dat ${tst_ME_data_dir}/PSP_Z.lhe.gz
)
add_test(
NAME 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 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
)
add_test(
NAME ME_WpWp
COMMAND test_ME_generic ${tst_ME_data_dir}/config_ww_ME.yml
${tst_ME_data_dir}/ME_WpWp.dat ${tst_ME_data_dir}/PSP_WpWp.lhe.gz
)
add_test(
NAME ME_WpWp_virt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_ww_ME.yml
${tst_ME_data_dir}/ME_WpWp_virt.dat ${tst_ME_data_dir}/PSP_WpWp.lhe.gz
)
add_test(
NAME ME_WmWm
COMMAND test_ME_generic ${tst_ME_data_dir}/config_ww_ME.yml
${tst_ME_data_dir}/ME_WmWm.dat ${tst_ME_data_dir}/PSP_WmWm.lhe.gz
)
add_test(
NAME ME_WmWm_virt
COMMAND test_ME_generic ${tst_ME_data_dir}/config_ww_ME.yml
${tst_ME_data_dir}/ME_WmWm_virt.dat ${tst_ME_data_dir}/PSP_WmWm.lhe.gz
)
# HEJ@NLO Virtuals
add_test(
NAME ME_WmWm_hejnlo
COMMAND test_ME_generic ${tst_ME_data_dir}/config_ww_ME_hejnlo.yml
${tst_ME_data_dir}/ME_WmWm_virt_hejnlo.dat ${tst_ME_data_dir}/PSP_WmWm.lhe.gz
)
add_test(
NAME ME_WpWp_hejnlo
COMMAND test_ME_generic ${tst_ME_data_dir}/config_ww_ME_hejnlo.yml
${tst_ME_data_dir}/ME_WpWp_virt_hejnlo.dat ${tst_ME_data_dir}/PSP_WpWp.lhe.gz
)
add_test(
NAME ME_Wp_hejnlo
COMMAND test_ME_generic ${tst_ME_data_dir}/config_wzhpure_ME_hejnlo.yml
${tst_ME_data_dir}/ME_Wp_virt_hejnlo.dat ${tst_ME_data_dir}/PSP_Wp.lhe.gz
)
add_test(
NAME ME_Wm_hejnlo
COMMAND test_ME_generic ${tst_ME_data_dir}/config_wzhpure_ME_hejnlo.yml
${tst_ME_data_dir}/ME_Wm_virt_hejnlo.dat ${tst_ME_data_dir}/PSP_Wm.lhe.gz
)
add_test(
NAME ME_Z_hejnlo
COMMAND test_ME_generic ${tst_ME_data_dir}/config_wzhpure_ME_hejnlo.yml
${tst_ME_data_dir}/ME_Z_virt_hejnlo.dat ${tst_ME_data_dir}/PSP_Z.lhe.gz
)
add_test(
NAME ME_jets_hejnlo
COMMAND test_ME_generic ${tst_ME_data_dir}/config_wzhpure_ME_hejnlo.yml
${tst_ME_data_dir}/ME_jets_virt_hejnlo.dat ${tst_ME_data_dir}/PSP_jets.lhe.gz
)
add_test(
NAME ME_h_hejnlo
COMMAND test_ME_generic ${tst_ME_data_dir}/config_wzhpure_ME_hejnlo.yml
${tst_ME_data_dir}/ME_h_virt_hejnlo.dat ${tst_ME_data_dir}/PSP_h.lhe.gz
)
add_test(
NAME ME_j_log_corr
COMMAND test_ME_generic ${tst_ME_data_dir}/config_log_corr.yml
${tst_ME_data_dir}/ME_jets_log_corr.dat ${tst_ME_data_dir}/PSP_jets.lhe.gz
)
add_test(
NAME ME_j_lambda
COMMAND test_ME_generic ${tst_ME_data_dir}/config_lambda.yml
${tst_ME_data_dir}/ME_jets_lambda.dat ${tst_ME_data_dir}/PSP_jets.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)
+add_executable(check_res_lowpt ${tst_dir}/check_res_lowpt.cc)
+target_link_libraries(check_res_lowpt HEJ hej_test)
add_test(
NAME xs_h_1j
COMMAND check_res ${tst_dir}/h_1j.lhe.gz 4.97087 0.0302519
)
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.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_3j
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted.lhe.gz 84394.7 3770.35
)
add_test(
NAME xs_emnubar_3j
COMMAND check_res ${tst_dir}/MGemnubar3j_unweighted.lhe.gz 53489.1 977.234
)
add_test(
NAME xs_epnu_4j
COMMAND check_res ${tst_dir}/MGepnu4j_unweighted.lhe.gz 19616.2 774.336
)
add_test(
NAME xs_emnubar_4j
COMMAND check_res ${tst_dir}/MGemnubar4j_unweighted.lhe.gz 10169.6 248.741
)
+add_test(
+ NAME xs_2j_lowpt
+ COMMAND check_res_lowpt ${tst_dir}/2j.lhe.gz 45890.2 5325.62
+ )
if(TEST_ALL) # deactivate long tests by default
add_test(
NAME xs_h_1j_long
COMMAND check_res ${tst_dir}/h_1j_large.lhe.gz 4.70112 0.00415353
)
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_long
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted_large.lhe.gz 38.9512 1
)
add_test(
NAME xs_emnubar_3j_long
COMMAND check_res ${tst_dir}/MGemnubar3j_unweighted_large.lhe.gz 24.1575 1
)
add_test(
NAME xs_epnu_3j_unof
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted_large.lhe.gz 9.63702 0.128355 unof
)
add_test(
NAME xs_epnu_3j_unob
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted_large.lhe.gz 9.70119 0.108436 unob
)
add_test(
NAME xs_epnu_3j_splitf
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted_large.lhe.gz 2.91995 0.0463182 splitf
)
add_test(
NAME xs_epnu_3j_splitb
COMMAND check_res ${tst_dir}/MGepnu3j_unweighted_large.lhe.gz 3.40708 0.0550975 splitb
)
add_test(
NAME xs_epnu_4j_long
COMMAND check_res ${tst_dir}/MGepnu4j_unweighted_large.lhe.gz 10.2542 0.135106
)
add_test(
NAME xs_emnubar_4j_long
COMMAND check_res ${tst_dir}/MGemnubar4j_unweighted_large.lhe.gz 5.73282 0.0583738
)
add_test(
NAME xs_epnu_4j_qqbar_mid
COMMAND check_res ${tst_dir}/MGepnu4j_unweighted_large.lhe.gz 0.802603 0.0126908 qqbar_mid
)
endif()
diff --git a/t/check_res_lowpt.cc b/t/check_res_lowpt.cc
new file mode 100644
index 0000000..b635d1c
--- /dev/null
+++ b/t/check_res_lowpt.cc
@@ -0,0 +1,164 @@
+/**
+ * \authors The HEJ collaboration (see AUTHORS for details)
+ * \date 2019-2020
+ * \copyright GPLv2 or later
+ */
+#include "hej_test.hh"
+
+#include <algorithm>
+#include <cmath>
+#include <cstdlib>
+#include <iostream>
+#include <iterator>
+#include <memory>
+#include <string>
+#include <utility>
+
+#include "HEJ/Config.hh"
+#include "HEJ/CrossSectionAccumulator.hh"
+#include "HEJ/Event.hh"
+#include "HEJ/event_types.hh"
+#include "HEJ/EventReweighter.hh"
+#include "HEJ/EWConstants.hh"
+#include "HEJ/Fraction.hh"
+#include "HEJ/HiggsCouplingSettings.hh"
+#include "HEJ/Mixmax.hh"
+#include "HEJ/Parameters.hh"
+#include "HEJ/ScaleFunction.hh"
+#include "HEJ/EventReader.hh"
+
+#include "fastjet/JetDefinition.hh"
+
+#include "LHEF/LHEF.h"
+
+namespace HEJ { struct RNG; }
+
+namespace {
+ const fastjet::JetDefinition JET_DEF{fastjet::kt_algorithm, 0.4};
+ const fastjet::JetDefinition BORN_JET_DEF{JET_DEF};
+ constexpr double BORN_JETPTMIN = 30;
+ constexpr double JETPTMIN = 35;
+ constexpr bool LOG_CORR = false;
+ constexpr std::size_t NUM_TRIES = 100;
+ constexpr HEJ::ParticleProperties WPROP{80.385, 2.085};
+ constexpr HEJ::ParticleProperties ZPROP{91.187, 2.495};
+ constexpr HEJ::ParticleProperties HPROP{125, 0.004165};
+ constexpr double VEV = 246.2196508;
+ using EventTreatment = HEJ::EventTreatment;
+ using namespace HEJ::event_type;
+ HEJ::EventTreatMap TREAT{
+ {not_enough_jets, EventTreatment::discard},
+ {bad_final_state, EventTreatment::discard},
+ {non_resummable, EventTreatment::discard},
+ {unof, EventTreatment::discard},
+ {unob, EventTreatment::discard},
+ {qqbar_exb, EventTreatment::discard},
+ {qqbar_exf, EventTreatment::discard},
+ {qqbar_mid, EventTreatment::discard},
+ {FKL, EventTreatment::reweight}
+ };
+
+ bool correct_colour(HEJ::Event const & ev){
+ if(!HEJ::event_type::is_resummable(ev.type()))
+ return true;
+ return ev.is_leading_colour();
+ }
+} // namespace
+
+int main(int argn, char** argv) {
+ if(argn == 5 && std::string(argv[4]) == "unof"){
+ --argn;
+ TREAT[unof] = EventTreatment::reweight;
+ TREAT[unob] = EventTreatment::discard;
+ TREAT[FKL] = EventTreatment::discard;
+ }
+ if(argn == 5 && std::string(argv[4]) == "unob"){
+ --argn;
+ TREAT[unof] = EventTreatment::discard;
+ TREAT[unob] = EventTreatment::reweight;
+ TREAT[FKL] = EventTreatment::discard;
+ }
+ else if(argn == 5 && std::string(argv[4]) == "splitf"){
+ --argn;
+ TREAT[qqbar_exb] = EventTreatment::discard;
+ TREAT[qqbar_exf] = EventTreatment::reweight;
+ TREAT[FKL] = EventTreatment::discard;
+ }
+ else if(argn == 5 && std::string(argv[4]) == "splitb"){
+ --argn;
+ TREAT[qqbar_exb] = EventTreatment::reweight;
+ TREAT[qqbar_exf] = EventTreatment::discard;
+ TREAT[FKL] = EventTreatment::discard;
+ }
+ else if(argn == 5 && std::string(argv[4]) == "qqbar_mid"){
+ --argn;
+ TREAT[qqbar_mid] = EventTreatment::reweight;
+ TREAT[FKL] = EventTreatment::discard;
+ }
+ if(argn != 4){
+ std::cerr << "Usage: check_res eventfile xsection tolerance [uno]";
+ return EXIT_FAILURE;
+ }
+
+ const double xsec_ref = std::stod(argv[2]);
+ const double tolerance = std::stod(argv[3]);
+
+ auto reader = HEJ::make_reader(argv[1]);
+
+ HEJ::PhaseSpacePointConfig psp_conf;
+ psp_conf.jet_param = HEJ::JetParameters{JET_DEF, JETPTMIN};
+ HEJ::MatrixElementConfig ME_conf;
+ ME_conf.log_correction = LOG_CORR;
+ ME_conf.Higgs_coupling = HEJ::HiggsCouplingSettings{};
+ ME_conf.ew_parameters.set_vevWZH(VEV, WPROP, ZPROP, HPROP);
+ HEJ::EventReweighterConfig conf;
+ conf.psp_config = std::move(psp_conf);
+ conf.ME_config = std::move(ME_conf);
+ conf.treat = TREAT;
+ conf.lowpt = true;
+
+ reader->read_event();
+ const bool has_Higgs = std::find(
+ begin(reader->hepeup().IDUP),
+ end(reader->hepeup().IDUP),
+ 25
+ ) != end(reader->hepeup().IDUP);
+ const double mu = has_Higgs?125.:91.188;
+ HEJ::ScaleGenerator scale_gen{
+ {{std::to_string(mu), HEJ::FixedScale{mu}}}, {}, 1.
+ };
+ std::shared_ptr<HEJ::RNG> ran{std::make_shared<HEJ::Mixmax>()};
+ HEJ::EventReweighter hej{reader->heprup(), std::move(scale_gen), conf, ran};
+
+ HEJ::CrossSectionAccumulator xs;
+ do{
+ auto ev_data = HEJ::Event::EventData{reader->hepeup()};
+ shuffle_particles(ev_data);
+ ev_data.reconstruct_intermediate(ME_conf.ew_parameters);
+ HEJ::Event ev{
+ ev_data.cluster(
+ BORN_JET_DEF, BORN_JETPTMIN
+ )
+ };
+ auto resummed_events = hej.reweight(ev, NUM_TRIES);
+ for(auto const & res_ev: resummed_events) {
+ ASSERT(correct_colour(res_ev));
+ ASSERT(std::isfinite(res_ev.central().weight));
+ // we fill the xs uncorrelated since we only want to test the uncertainty
+ // of the resummation
+ xs.fill(res_ev);
+ }
+ } while(reader->read_event());
+ const double xsec = xs.total().value;
+ const double xsec_err = std::sqrt(xs.total().error);
+ const double significance =
+ std::abs(xsec - xsec_ref) / std::sqrt( xsec_err*xsec_err + tolerance*tolerance );
+ std::cout << xsec_ref << " +/- " << tolerance << " ~ "
+ << xsec << " +- " << xsec_err << " => " << significance << " sigma\n";
+
+ if(significance > 3.){
+ std::cerr << "Cross section is off by over 3 sigma!\n";
+ return EXIT_FAILURE;
+ }
+ return EXIT_SUCCESS;
+}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Nov 19, 8:14 PM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805990
Default Alt Text
(26 KB)
Attached To
rHEJ HEJ
Event Timeline
Log In to Comment