Page MenuHomeHEPForge

No OneTemporary

diff --git a/FixedOrderGen/CMakeLists.txt b/FixedOrderGen/CMakeLists.txt
index b85cd84..f083cd6 100644
--- a/FixedOrderGen/CMakeLists.txt
+++ b/FixedOrderGen/CMakeLists.txt
@@ -1,75 +1,79 @@
cmake_minimum_required(VERSION 2.8 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_CXX_COMPILER_ID}" STREQUAL "GNU")
set(warnings "-Wall -Wextra -Werror -std=c++1y")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(warnings "-Wall -Wextra -Werror -std=c++11")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(warnings "/W4 /WX /EHsc")
endif()
if (NOT CONFIGURED_ONCE)
set(CMAKE_CXX_FLAGS "${warnings}"
CACHE STRING "Flags used by the compiler during all build types." FORCE)
set(CMAKE_C_FLAGS "${warnings}"
CACHE STRING "Flags used by the compiler during all build types." FORCE)
endif()
## 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(ROOT MODULE COMPONENTS Hist Tree MathCore)
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)
if(${HepMC_FOUND})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRHEJ_BUILD_WITH_HepMC")
endif()
find_package(QCDloop 2)
if(${QCDloop_FOUND})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRHEJ_BUILD_WITH_QCDLOOP")
include_directories(SYSTEM ${QCDloop_INCLUDE_PATH})
endif()
include_directories(SYSTEM ${ROOT_INCLUDE_DIR})
include_directories(SYSTEM ${lhapdf_INCLUDE_PATH})
include_directories(SYSTEM ${fastjet_INCLUDE_PATH})
include_directories(SYSTEM ${clhep_INCLUDE_PATH})
include_directories(SYSTEM ${gsl_INCLUDE_PATH})
link_directories(${ROOT_LIBRARY_DIR})
#add_subdirectory(src)
## define executable
file(GLOB FOgen_source ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc)
-add_executable(FOgen ${FOgen_source})
+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} ${ROOT_LIBRARIES} yaml-cpp)
if(${QCDloop_FOUND})
list(APPEND libraries ${QCDloop_LIBRARIES} quadmath)
endif()
# add libraries for reversed HEJ <by hand>
list(APPEND libraries "/home/andersen/HEJ/PURE/GitReverse/run/lib/librhej.so")
+target_link_libraries(hejfog ${libraries})
+target_link_libraries(FOgen hejfog)
-target_link_libraries(FOgen ${libraries})
-
-file(GLOB FOgen_headers ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hh)
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})
set(CONFIGURED_ONCE TRUE CACHE INTERNAL
"A flag showing that CMake has configured at least once.")
diff --git a/FixedOrderGen/t/config_h_2j.yml b/FixedOrderGen/t/config_h_2j.yml
new file mode 100644
index 0000000..06c5a4c
--- /dev/null
+++ b/FixedOrderGen/t/config_h_2j.yml
@@ -0,0 +1,19 @@
+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: false
+
+scales: 125
diff --git a/FixedOrderGen/t/h_2j.cc b/FixedOrderGen/t/h_2j.cc
new file mode 100644
index 0000000..c2993fb
--- /dev/null
+++ b/FixedOrderGen/t/h_2j.cc
@@ -0,0 +1,79 @@
+#ifdef NDEBUG
+#undef NDEBUG
+#endif
+
+#include <algorithm>
+#include <cmath>
+#include <cassert>
+#include <iostream>
+
+#include "config.hh"
+#include "PhaseSpacePoint.hh"
+
+#include "RHEJ/PDF.hh"
+#include "RHEJ/MatrixElement.hh"
+
+using namespace HEJFOG;
+
+int main(){
+ constexpr double invGeV2_to_pb = 389379292.;
+ constexpr double xs_ref = 2.0304; //calculated with "old" HEJ svn r3364
+
+ const auto config = load_config("config_h_2j.yml");
+
+ RHEJ::PDF pdf{
+ config.pdf_id,
+ config.beam.particles[0], config.beam.particles[1]
+ };
+
+ RHEJ::MatrixElement ME{
+ [&pdf](double mu){ return pdf.Halphas(mu); },
+ config.jets.def, config.jets.min_pt,
+ false,
+ config.Higgs_coupling
+ };
+
+ double xs = 0., xs_err = 0.;
+ for (int trials = 0; trials < config.trials; ++trials){
+ HEJFOG::PhaseSpacePoint psp{
+ config.process,
+ config.jets.def,config.jets.min_pt, config.jets.max_y,
+ pdf, config.beam.energy
+ };
+ if (psp.status()!=0) continue;
+
+ RHEJ::Event ev = config.scale_gen(
+ RHEJ::Event{
+ to_UnclusteredEvent(std::move(psp)),
+ config.jets.def, config.jets.min_pt
+ }
+ );
+ const double shat = RHEJ::shat(ev);
+ const double xa = (ev.incoming()[0].E()-ev.incoming()[0].pz())/(2.*config.beam.energy);
+ const double xb = (ev.incoming()[1].E()+ev.incoming()[1].pz())/(2.*config.beam.energy);
+
+ // evaluate matrix element on this point
+ ev.central().weight *= ME.tree(
+ ev.central().mur, ev.incoming(), ev.outgoing(), false
+ )/(shat*shat);
+ ev.central().weight *= pdf.pdfpt(0,xa,ev.central().muf, ev.incoming()[0].type);
+ ev.central().weight *= pdf.pdfpt(0,xb,ev.central().muf, ev.incoming()[1].type);
+ ev.central().weight *= invGeV2_to_pb;
+ ev.central().weight /= config.trials;
+
+ const auto the_Higgs = std::find_if(
+ begin(ev.outgoing()), end(ev.outgoing()),
+ [](RHEJ::Sparticle const & p){ return p.type == RHEJ::ParticleID::h; }
+ );
+ assert(the_Higgs != end(ev.outgoing()));
+ if(std::abs(the_Higgs->rapidity()) > 5.) continue;
+
+ 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.01*xs);
+}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Jan 21, 1:47 AM (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4243552
Default Alt Text
(6 KB)

Event Timeline