Page MenuHomeHEPForge

No OneTemporary

diff --git a/FixedOrderGen/CMakeLists.txt b/FixedOrderGen/CMakeLists.txt
index 31f705f..57e2016 100644
--- a/FixedOrderGen/CMakeLists.txt
+++ b/FixedOrderGen/CMakeLists.txt
@@ -1,78 +1,81 @@
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_package(fastjet REQUIRED)
include_directories(${fastjet_INCLUDE_PATH})
find_package(clhep REQUIRED)
include_directories(${clhep_INCLUDE_PATH})
find_package(lhapdf REQUIRED)
include_directories(${lhapdf_INCLUDE_PATH})
find_package(gsl REQUIRED)
include_directories(${gsl_INCLUDE_PATH})
find_package(Boost REQUIRED COMPONENTS iostreams)
include_directories(${Boost_INCLUDE_DIRS})
find_package(yaml-cpp REQUIRED)
include_directories(${YAML_CPP_INCLUDE_DIR})
find_package(HepMC 3)
if(${HepMC_FOUND})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRHEJ_BUILD_WITH_HepMC")
include_directories(${HepMC_INCLUDE_DIRS})
endif()
find_package(QCDloop 2)
if(${QCDloop_FOUND})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRHEJ_BUILD_WITH_QCDLOOP")
include_directories(SYSTEM ${QCDloop_INCLUDE_DIRS})
endif()
## 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_LIBRARIES})
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})
add_executable(test_h_3j_uno2 ${tst_dir}/h_3j_uno2.cc)
target_link_libraries(test_h_3j_uno2 hejfog)
add_test(NAME t_h_3j_uno2 COMMAND test_h_3j_uno2 WORKING_DIRECTORY ${tst_dir})
+add_executable(test_h_2j_decay ${tst_dir}/h_2j_decay.cc)
+target_link_libraries(test_h_2j_decay hejfog)
+add_test(NAME t_h_2j_decay COMMAND test_h_2j_decay WORKING_DIRECTORY ${tst_dir})
diff --git a/FixedOrderGen/t/config_h_2j_decay.yml b/FixedOrderGen/t/config_h_2j_decay.yml
new file mode 100644
index 0000000..5d2cb31
--- /dev/null
+++ b/FixedOrderGen/t/config_h_2j_decay.yml
@@ -0,0 +1,24 @@
+trials : 100000
+
+jets:
+ min pt: 30
+ R: 0.4
+ algorithm: antikt
+ max rapidity: 5
+
+beam:
+ energy: 6500
+ particles: [p, p]
+
+pdf: 11000
+
+process: p p => h 2j
+
+unordered fraction: 0
+
+scales: 125
+
+Higgs properties:
+ mass: 125
+ width: 0.00407
+ decays: {into: [photon, photon], branching ratio: 0.00228}
diff --git a/FixedOrderGen/t/h_2j_decay.cc b/FixedOrderGen/t/h_2j_decay.cc
new file mode 100644
index 0000000..cfa0796
--- /dev/null
+++ b/FixedOrderGen/t/h_2j_decay.cc
@@ -0,0 +1,75 @@
+#ifdef NDEBUG
+#undef NDEBUG
+#endif
+
+#include <algorithm>
+#include <cmath>
+#include <cassert>
+#include <iostream>
+
+#include "config.hh"
+#include "EventGenerator.hh"
+
+#include "RHEJ/PDF.hh"
+#include "RHEJ/MatrixElement.hh"
+#include "RHEJ/debug.hh"
+
+using namespace HEJFOG;
+
+bool pass_dR_cut(
+ std::vector<fastjet::PseudoJet> const & jets,
+ std::vector<RHEJ::Sparticle> const & photons
+){
+ constexpr double delta_R_min = 0.7;
+ for(auto const & jet: jets){
+ for(auto const & photon: photons){
+ if(jet.delta_R(photon.p) < delta_R_min) return false;
+ }
+ }
+ return true;
+}
+
+int main(){
+ constexpr double invGeV2_to_pb = 389379292.;
+ constexpr double xs_ref = 0.00425287; //calculated with "old" HEJ svn r3364
+
+ auto config = load_config("config_h_2j_decay.yml");
+
+ HEJFOG::EventGenerator generator{
+ config.process,
+ config.beam,
+ config.scale_gen,
+ config.jets,
+ config.pdf_id,
+ config.unordered_fraction,
+ config.Higgs_properties,
+ 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;
+ assert(ev.decays().size() == 1);
+ const auto decay = begin(ev.decays());
+ assert(ev.outgoing().size() > static_cast<size_t>(decay->first));
+ const auto & the_Higgs = ev.outgoing()[decay->first];
+ assert(the_Higgs.type == RHEJ::pid::Higgs);
+ assert(decay->second.size() == 2);
+ auto const & gamma = decay->second;
+ assert(gamma[0].type == RHEJ::pid::photon);
+ assert(gamma[1].type == RHEJ::pid::photon);
+ assert(nearby_ep(gamma[0].p + gamma[1].p, the_Higgs.p, 1e-6));
+ if(!pass_dR_cut(ev.jets(), gamma)) 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.012*xs);
+}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 4:47 PM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3799552
Default Alt Text
(6 KB)

Event Timeline