Page MenuHomeHEPForge

No OneTemporary

diff --git a/FixedOrderGen/CMakeLists.txt b/FixedOrderGen/CMakeLists.txt
index 1a005ec..35502b4 100644
--- a/FixedOrderGen/CMakeLists.txt
+++ b/FixedOrderGen/CMakeLists.txt
@@ -1,63 +1,66 @@
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project("Fixed Order Generation" C CXX)
## Flags for the compiler. No warning allowed.
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
elseif (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /EHsc")
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 11)
## Add directories and find dependences
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/../include)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../cmake/Modules/")
#find_library(rhej rhej_)
find_package(fastjet REQUIRED)
find_package(clhep REQUIRED)
find_package(lhapdf REQUIRED)
find_package(gsl REQUIRED)
find_package(Boost REQUIRED COMPONENTS iostreams)
find_package(HepMC 3)
find_package(QCDloop 2)
include_directories(SYSTEM ${lhapdf_INCLUDE_PATH})
include_directories(SYSTEM ${fastjet_INCLUDE_PATH})
include_directories(SYSTEM ${clhep_INCLUDE_PATH})
include_directories(SYSTEM ${gsl_INCLUDE_PATH})
## define executable
file(GLOB FOgen_source ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc)
list(REMOVE_ITEM FOgen_source ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cc)
add_library(hejfog STATIC ${FOgen_source})
add_executable(FOgen ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cc)
## link libraries
set(libraries ${CMAKE_DL_LIBS} ${LHAPDF_LIBRARIES} ${CLHEP_LIBRARIES} ${FASTJET_LIBRARIES} ${GSL_LIBRARIES} ${Boost_LIBRARIES} ${HepMC_LIBRARIES} yaml-cpp)
if(${QCDloop_FOUND})
list(APPEND libraries ${QCDloop_LIBRARIES} quadmath)
endif()
# add libraries for reversed HEJ <by hand>
list(APPEND libraries rhej)
target_link_libraries(hejfog ${libraries})
target_link_libraries(FOgen hejfog)
install(TARGETS FOgen DESTINATION bin)
enable_testing()
set(tst_dir "${CMAKE_CURRENT_SOURCE_DIR}/t")
add_executable(test_h_2j ${tst_dir}/h_2j.cc)
target_link_libraries(test_h_2j hejfog)
add_test(NAME t_h_2j COMMAND test_h_2j WORKING_DIRECTORY ${tst_dir})
add_executable(test_h_3j ${tst_dir}/h_3j.cc)
target_link_libraries(test_h_3j hejfog)
add_test(NAME t_h_3j COMMAND test_h_3j WORKING_DIRECTORY ${tst_dir})
add_executable(test_h_5j ${tst_dir}/h_5j.cc)
target_link_libraries(test_h_5j hejfog)
add_test(NAME t_h_5j COMMAND test_h_5j WORKING_DIRECTORY ${tst_dir})
+add_executable(test_h_3j_uno1 ${tst_dir}/h_3j_uno1.cc)
+target_link_libraries(test_h_3j_uno1 hejfog)
+add_test(NAME t_h_3j_uno1 COMMAND test_h_3j_uno1 WORKING_DIRECTORY ${tst_dir})
diff --git a/FixedOrderGen/t/h_3j_uno1.cc b/FixedOrderGen/t/h_3j_uno1.cc
new file mode 100644
index 0000000..0da0171
--- /dev/null
+++ b/FixedOrderGen/t/h_3j_uno1.cc
@@ -0,0 +1,79 @@
+#ifdef NDEBUG
+#undef NDEBUG
+#endif
+
+// check that adding uno emissions doesn't change the FKL cross section
+
+#include <algorithm>
+#include <cmath>
+#include <cassert>
+#include <iostream>
+
+#include "config.hh"
+#include "EventGenerator.hh"
+
+#include "RHEJ/PDF.hh"
+#include "RHEJ/MatrixElement.hh"
+
+using namespace HEJFOG;
+
+namespace{
+ bool is_uno(RHEJ::Event const & ev){
+ auto const & out = ev.outgoing();
+ const size_t nout = ev.outgoing().size();
+ assert(nout > 2);
+ if(
+ out.front().type == RHEJ::pid::gluon
+ && is_parton(out[1])
+ && out[1].type != RHEJ::pid::gluon
+ ) return true;
+ if(
+ out.back().type == RHEJ::pid::gluon
+ && is_parton(out[nout-2])
+ && out[nout-2].type != RHEJ::pid::gluon
+ ) return true;
+ return false;
+ }
+}
+
+int main(){
+ constexpr double invGeV2_to_pb = 389379292.;
+ constexpr double xs_ref = 0.02603824; //calculated with "old" HEJ svn r3364
+
+ auto config = load_config("config_h_2j.yml");
+ config.process.njets = 3;
+ config.process.incoming = {RHEJ::pid::u, RHEJ::pid::u};
+ config.unordered_fraction = 0.43;
+
+ HEJFOG::EventGenerator generator{
+ config.process,
+ config.beam,
+ config.scale_gen,
+ config.jets,
+ config.pdf_id,
+ config.unordered_fraction,
+ config.Higgs_coupling
+ };
+
+ double xs = 0., xs_err = 0.;
+ int uno_found = 0;
+ for (int trials = 0; trials < config.trials; ++trials){
+ auto ev = generator.gen_event();
+ if(generator.status() != good) continue;
+ if(is_uno(ev)){
+ ++uno_found;
+ continue;
+ }
+ ev.central().weight *= invGeV2_to_pb;
+ ev.central().weight /= config.trials;
+
+ xs += ev.central().weight;
+ xs_err += ev.central().weight*ev.central().weight;
+ }
+ xs_err = std::sqrt(xs_err);
+ std::cout << xs_ref << " ~ " << xs << " +- " << xs_err << '\n';
+ std::cout << uno_found << " events with unordered emission\n";
+ assert(uno_found > 0);
+ assert(std::abs(xs - xs_ref) < 3*xs_err);
+ assert(xs_err < 0.05*xs);
+}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Jan 21, 2:19 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4235221
Default Alt Text
(4 KB)

Event Timeline