Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8725705
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
View Options
diff --git a/FixedOrderGen/CMakeLists.txt b/FixedOrderGen/CMakeLists.txt
index 6375aac..1a005ec 100644
--- a/FixedOrderGen/CMakeLists.txt
+++ b/FixedOrderGen/CMakeLists.txt
@@ -1,60 +1,63 @@
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})
diff --git a/FixedOrderGen/t/h_5j.cc b/FixedOrderGen/t/h_5j.cc
new file mode 100644
index 0000000..d8e4f6f
--- /dev/null
+++ b/FixedOrderGen/t/h_5j.cc
@@ -0,0 +1,52 @@
+#ifdef NDEBUG
+#undef NDEBUG
+#endif
+// This is a regression test
+// the reference cross section has not been checked against any other program
+
+#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;
+
+int main(){
+ constexpr double invGeV2_to_pb = 389379292.;
+ constexpr double xs_ref = 0.235969;
+
+ auto config = load_config("config_h_2j.yml");
+ config.process.njets = 5;
+
+ 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.;
+ for (int trials = 0; trials < config.trials; ++trials){
+ auto ev = generator.gen_event();
+ if(generator.status() != good) 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';
+
+ assert(std::abs(xs - xs_ref) < 3*xs_err);
+ assert(xs_err < 0.06*xs);
+}
File Metadata
Details
Attached
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
4220394
Default Alt Text
(3 KB)
Attached To
rHEJ HEJ
Event Timeline
Log In to Comment