diff --git a/t/CMakeLists.txt b/t/CMakeLists.txt index df4ce46..49da87b 100644 --- a/t/CMakeLists.txt +++ b/t/CMakeLists.txt @@ -1,277 +1,281 @@ set(tst_dir "${CMAKE_CURRENT_SOURCE_DIR}") set(tst_ME_data_dir "${tst_dir}/ME_data") # test event classification add_executable(test_classify ${tst_dir}/test_classify.cc) target_link_libraries(test_classify HEJ) add_test( NAME t_classify COMMAND test_classify ) add_executable(test_classify_ref ${tst_dir}/test_classify_ref.cc) target_link_libraries(test_classify_ref HEJ) 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 phase space point add_executable(test_psp ${tst_dir}/test_psp.cc) target_link_libraries(test_psp HEJ) add_test( NAME t_psp COMMAND test_psp ${tst_dir}/psp_gen.lhe.gz ) # test importing scales add_library(scales SHARED ${tst_dir}/scales.cc) target_link_libraries(scales HEJ) add_executable(test_scale_import ${tst_dir}/test_scale_import) target_link_libraries(test_scale_import HEJ) add_test( NAME t_scale_import COMMAND test_scale_import ${tst_dir}/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) 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) 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) add_test( NAME test_parameters COMMAND test_parameters ) # test unweighting add_executable(test_unweighter ${tst_dir}/test_unweighter) target_link_libraries(test_unweighter HEJ) 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) 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) 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_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") 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") if(${rivet_FOUND}) file(READ ${test_config} config) file(WRITE ${test_config} "${config}\nanalysis:\n rivet: MC_XS\n output: tst\n") endif() 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) set(test_cmd_lhe "$<TARGET_FILE:check_lhe>\\\;tst.lhe") # 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} -P ${PROJECT_SOURCE_DIR}/cmake/run_multiple_tests.cmake ) # check HDF5 reader 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 ) endif() # check rivet interface if(${RIVET_FOUND}) add_executable(check_rivet ${tst_dir}/check_rivet.cc) target_link_libraries(check_rivet HEJ rivet::rivet HepMC::HepMC) 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) 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_4j COMMAND check_res ${tst_dir}/4j.lhe.gz 603713 72822.6 ) 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() diff --git a/t/classify_ref_W4j b/t/classify_ref_W4j new file mode 100644 index 0000000..0e37a12 --- /dev/null +++ b/t/classify_ref_W4j @@ -0,0 +1,4000 @@ +4 +0 +0 +0 +4 +4 +8 +4 +4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0 +4 +0 +4 +0 +4 +0 +0 +2 +16 +0 +0 +0 +64 +4 +0 +32 +0 +64 +0 +4 +0 +128 +0 +0 +0 +0 +16 +0 +8 +32 +0 +64 +128 +4 +8 +0 +0 +8 +4 +0 +0 +2 +0 +0 +0 +4 +0 +4 +4 +16 +0 +4 +32 +0 +4 +4 +0 +0 +16 +0 +4 +4 +0 +4 +0 +0 +0 +0 +4 +0 +0 +4 +8 +4 +0 +0 +0 +0 +0 +0 +0 +4 +2 +4 +4 +0 +0 +0 +4 +128 +4 +0 +4 +0 +0 +16 +8 +0 +4 +0 +4 +0 +0 +0 +4 +0 +4 +4 +4 +64 +0 +4 +16 +0 +32 +4 +0 +0 +0 +0 +0 +0 +0 +4 +0 +0 +4 +0 +0 +0 +16 +0 +0 +4 +32 +0 +0 +2 +0 +0 +0 +0 +0 +8 +4 +4 +0 +4 +0 +8 +0 +0 +0 +0 +4 +4 +4 +0 +0 +4 +4 +4 +0 +16 +4 +0 +0 +32 +0 +4 +0 +16 +4 +4 +2 +16 +4 +2 +8 +0 +0 +0 +0 +8 +0 +8 +4 +0 +0 +0 +4 +4 +0 +0 +0 +4 +64 +4 +4 +0 +64 +0 +4 +0 +4 +0 +4 +4 +0 +4 +0 +0 +0 +4 +0 +0 +128 +0 +16 +128 +0 +4 +0 +4 +8 +0 +4 +4 +16 +4 +0 +4 +4 +64 +4 +64 diff --git a/t/test_classify_ref.cc b/t/test_classify_ref.cc index a74f634..4cc6c68 100644 --- a/t/test_classify_ref.cc +++ b/t/test_classify_ref.cc @@ -1,100 +1,102 @@ /** * \authors The HEJ collaboration (see AUTHORS for details) * \date 2019 * \copyright GPLv2 or later */ #include <fstream> #include <random> #include <algorithm> #include "LHEF/LHEF.h" #include "HEJ/YAMLreader.hh" #include "HEJ/event_types.hh" #include "HEJ/Event.hh" #include "HEJ/EventReader.hh" namespace{ // this is deliberately chosen bigger than in the generation, // to cluster multiple partons in one jet constexpr double min_jet_pt = 40.; const fastjet::JetDefinition jet_def{fastjet::kt_algorithm, 0.6}; void shuffle_particles(HEJ::Event::EventData & ev) { static std::mt19937_64 ran{0}; // incoming std::shuffle(begin(ev.incoming), end(ev.incoming), ran); // outgoing (through index) auto old_outgoing = std::move(ev.outgoing); std::vector<size_t> idx(old_outgoing.size()); std::iota(idx.begin(), idx.end(), 0); std::shuffle(begin(idx), end(idx), ran); ev.outgoing.clear(); ev.outgoing.reserve(old_outgoing.size()); for(size_t i: idx) { ev.outgoing.emplace_back(std::move(old_outgoing[i])); } // find decays again if(!ev.decays.empty()){ auto old_decays = std::move(ev.decays); ev.decays.clear(); for(size_t i=0; i<idx.size(); ++i) { auto decay = old_decays.find(idx[i]); if(decay != old_decays.end()) ev.decays.emplace(i, std::move(decay->second)); } } } } int main(int argn, char** argv) { if(argn != 3 && argn != 4){ std::cerr << "Usage: " << argv[0] << " reference_classification input_file.lhe\n"; return EXIT_FAILURE; } bool OUTPUT_MODE = false; if(argn == 4 && std::string("OUTPUT")==std::string(argv[3])) OUTPUT_MODE = true; std::fstream ref_file; if ( OUTPUT_MODE ) { std::cout << "_______________________USING OUTPUT MODE!_______________________" << std::endl; ref_file.open(argv[1], std::fstream::out); } else { ref_file.open(argv[1], std::fstream::in); } auto reader{ HEJ::make_reader(argv[2]) }; size_t nevent{0}; while(reader->read_event()){ ++nevent; + // We don't need to test forever, the first "few" are enough + if(nevent>4000) break; HEJ::Event::EventData data{ reader->hepeup() }; shuffle_particles(data); const HEJ::Event ev{ data.cluster( jet_def, min_jet_pt ) }; if ( OUTPUT_MODE ) { ref_file << ev.type() << std::endl; } else { std::string line; if(!std::getline(ref_file,line)) break; const auto expected{static_cast<HEJ::event_type::EventType>(std::stoi(line))}; if(ev.type() != expected){ using HEJ::event_type::name; std::cerr << "wrong classification of event " << nevent << ":\n" << ev << "classified as " << name(ev.type()) << ", expected " << name(expected) << "\nJet indices: "; for(auto const & idx: ev.particle_jet_indices(ev.jets())) std::cerr << idx << " "; std::cerr << "\n"; return EXIT_FAILURE; } } } return EXIT_SUCCESS; }