diff --git a/CMakeLists.txt b/CMakeLists.txt index f91fc7c..c5aed79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,305 +1,305 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) set(CMAKE_LEGACY_CYGWIN_WIN32 0) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -project("HEJ" VERSION 2.0.6 LANGUAGES C CXX) +project("HEJ" VERSION 2.1.0 LANGUAGES C CXX) ## User settings include(CMakeDependentOption) option(EXCLUDE_QCDloop "Do not include QCDloop" FALSE) option(EXCLUDE_HighFive "Do not include HighFive" FALSE) option(EXCLUDE_HepMC "Do not include HepMC version 2" FALSE) option(EXCLUDE_HepMC3 "Do not include HepMC version 3" FALSE) option(EXCLUDE_ROOT "Do not include ROOT" TRUE) # Only skip rivet if we both HepMC 2 & 3 are excluded, since we don't know which # HepMC version rivet needs CMAKE_DEPENDENT_OPTION(EXCLUDE_rivet "Do not include rivet" FALSE "NOT EXCLUDE_HepMC OR NOT EXCLUDE_HepMC3" TRUE) option(BUILD_EXAMPLES "Build examples" FALSE) option(TEST_ALL "Run additional (longer) tests" FALSE) option(TEST_COVERAGE "Generate test coverage with \"gcovr\"" FALSE) option(RUN_CLANG_TIDY "Run clang tidy" FALSE) # Set a default build type if none was specified set(default_build_type "RelWithDebInfo") if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "Setting build type to '${default_build_type}' as none was specified.") set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") endif() ## Global flags for the compiler (all warnings) if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic") elseif (MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /EHsc") endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 14) ## Check if this is a git folder find_package(Git QUIET) if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") set(_is_git TRUE) endif() ## download FORM submodule # from https://cliutils.gitlab.io/modern-cmake/chapters/projects/submodule.html if(_is_git) option(GIT_SUBMODULE "Check submodules during build" ON) if(GIT_SUBMODULE AND NOT EXISTS "${PROJECT_SOURCE_DIR}/current_generator/form/Makefile.am") message(STATUS "Submodule update") execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE GIT_SUBMOD_RESULT) if(NOT GIT_SUBMOD_RESULT EQUAL "0") message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") endif() endif() endif() if(NOT EXISTS "${PROJECT_SOURCE_DIR}/current_generator/form/Makefile.am") message(FATAL_ERROR "FORM was not downloaded! Please update git-submodules and try again.") endif() ## Create Version set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") # Get the latest abbreviated commit hash of the working branch if(_is_git) execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE PROJECT_GIT_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE ) # Get the current working branch execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE PROJECT_GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE ) else() set(PROJECT_GIT_REVISION "UNKNOWN") set(PROJECT_GIT_BRANCH "UNKNOWN") endif() ## target directories for install set(INSTALL_INCLUDE_DIR_BASE include) set(INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR_BASE}/HEJ) set(INSTALL_BIN_DIR bin) set(INSTALL_LIB_DIR lib) set(INSTALL_CONFIG_DIR lib/cmake/HEJ) ## find dependencies find_package(CLHEP 2.3 REQUIRED) find_package(fastjet REQUIRED) find_package(LHAPDF 6 REQUIRED) ## Amend unintuitive behaviour of FindBoost.cmake ## Priority of BOOST_ROOT over BOOSTROOT matches FindBoost.cmake ## at least for cmake 3.12 if(DEFINED BOOST_ROOT) message("BOOST_ROOT set - only looking for Boost in ${BOOST_ROOT}") set(Boost_NO_BOOST_CMAKE ON) elseif(DEFINED BOOSTROOT) message("BOOSTROOT set - only looking for Boost in ${BOOSTROOT}") set(Boost_NO_BOOST_CMAKE ON) endif() find_package(Boost REQUIRED COMPONENTS iostreams) find_package(yaml-cpp) # requiring yaml does not work with fedora if(EXCLUDE_HepMC) message(STATUS "Skipping HepMC") else() find_package(HepMC 2 EXACT) endif() if(EXCLUDE_HepMC3) message(STATUS "Skipping HepMC3") else() ## version 3.1: Finding version not possible in 3.1.1, see HepMC3 git 29e7a6c3 find_package(HepMC3 QUIET) # suppress CMake warning if HepMC3 not available ## print standard message find_package_handle_standard_args( HepMC3 FOUND_VAR HepMC3_FOUND REQUIRED_VARS HEPMC3_INCLUDE_DIR HEPMC3_LIBRARIES # VERSION_VAR # HEPMC3_VERSION ) endif() if(EXCLUDE_rivet) message(STATUS "Skipping rivet") else() find_package(rivet) if(rivet_FOUND) if(rivet_USE_HEPMC3 AND NOT HepMC3_FOUND) message(FATAL_ERROR "Rivet was compiled with HepMC version 3, " "but HepMC3 was not found!") elseif(NOT rivet_USE_HEPMC3 AND NOT HepMC_FOUND) message(FATAL_ERROR "Rivet was compiled with HepMC version 2, " "but HepMC2 was not found!") endif() endif() endif() if(EXCLUDE_QCDloop) message(STATUS "Skipping QCDloop") else() find_package(QCDloop 2) endif() if(NOT EXCLUDE_ROOT) # Don't print "Skipping ROOT" for default option (EXCLUDE_ROOT=TRUE) find_package(ROOT 6.14) # root targets are broken before 6.14 find_package_handle_standard_args( ROOT FOUND_VAR ROOT_FOUND REQUIRED_VARS ROOT_INCLUDE_DIRS ROOT_LIBRARIES VERSION_VAR ROOT_VERSION ) endif() if(EXCLUDE_HighFive) message(STATUS "Skipping HighFive") else() find_package(HighFive QUIET) find_package_handle_standard_args( HighFive CONFIG_MODE ) endif() include(RepairTargets) # more reliable cmake targets ## Save dependencies for templates set(HEJ_BUILD_WITH_HepMC2 ${HepMC_FOUND}) set(HEJ_BUILD_WITH_HepMC3 ${HepMC3_FOUND}) set(HEJ_BUILD_WITH_RIVET ${rivet_FOUND}) if(rivet_FOUND AND rivet_VERSION VERSION_LESS 3) set(HEJ_USE_RIVET2 TRUE) endif() set(HEJ_BUILD_WITH_QCDLOOP ${QCDloop_FOUND}) set(HEJ_BUILD_WITH_HDF5 ${HighFive_FOUND}) ## Template files configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Templates/Version.hh.in include/HEJ/Version.hh @ONLY ) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Templates/ConfigFlags.hh.in include/HEJ/ConfigFlags.hh @ONLY ) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Templates/HEJ-config.cc.in src/bin/HEJ-config.cc @ONLY ) # Generate CMake config file include(CMakePackageConfigHelpers) configure_package_config_file( cmake/Templates/hej-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CONFIG_DIR}/hej-config.cmake INSTALL_DESTINATION ${INSTALL_CONFIG_DIR} PATH_VARS INSTALL_INCLUDE_DIR_BASE INSTALL_LIB_DIR ) write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CONFIG_DIR}/hej-config-version.cmake COMPATIBILITY SameMajorVersion ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CONFIG_DIR}/hej-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CONFIG_DIR}/hej-config-version.cmake DESTINATION ${INSTALL_CONFIG_DIR}) ## shortcut for HEJ specific includes set(HEJ_INCLUDE_DIR $ $ $ ) # Add test coverage if (TEST_COVERAGE AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) ) include(CodeCoverage) APPEND_COVERAGE_COMPILER_FLAGS() set(COVERAGE_GCOVR_EXCLUDES "${PROJECT_SOURCE_DIR}/include/LHEF/*" "${PROJECT_SOURCE_DIR}/include/cxxopts.hpp" "${PROJECT_SOURCE_DIR}/t/*" "${PROJECT_BINARY_DIR}/*") SETUP_TARGET_FOR_COVERAGE_GCOVR_HTML( NAME ctest_coverage EXECUTABLE ctest ) endif() add_subdirectory(current_generator) ## create main HEJ library add_subdirectory(src) ## define executable add_executable(HEJ_main src/bin/HEJ.cc) set_target_properties(HEJ_main PROPERTIES OUTPUT_NAME "HEJ") ## link libraries target_link_libraries(HEJ_main HEJ) add_executable(HEJ-config src/bin/HEJ-config.cc) target_include_directories(HEJ-config PRIVATE ${HEJ_INCLUDE_DIR}) file(GLOB hej_headers ${CMAKE_CURRENT_SOURCE_DIR}/include/HEJ/*.hh ${PROJECT_BINARY_DIR}/include/HEJ/*.hh ) file(GLOB hej_detail_headers ${CMAKE_CURRENT_SOURCE_DIR}/include/HEJ/detail/*.hh) file(GLOB lhef_headers ${CMAKE_CURRENT_SOURCE_DIR}/include/LHEF/*.h) install(FILES ${hej_headers} DESTINATION ${INSTALL_INCLUDE_DIR}) install(FILES ${hej_detail_headers} DESTINATION ${INSTALL_INCLUDE_DIR}/detail/) install(FILES ${lhef_headers} DESTINATION ${INSTALL_INCLUDE_DIR_BASE}/LHEF/) install(TARGETS HEJ_main HEJ-config DESTINATION ${INSTALL_BIN_DIR}) ## tests (prevent testing if current project is a subproject) if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) ## advanced version of enable_testing() ## adds "BUILD_TESTING" option to deactivate testing include(CTest) if(BUILD_TESTING) set(BUILD_EXAMPLES TRUE) # examples needed for testing set(include_tests TRUE) endif() endif() ## build examples if(BUILD_EXAMPLES) message(STATUS "Adding examples") add_subdirectory(examples) endif() ## build tests if(include_tests) message(STATUS "Adding tests") add_subdirectory(t) endif() add_subdirectory(doc) ## Clang-tidy if(RUN_CLANG_TIDY) find_program( CLANG_TIDY_EXE NAMES "clang-tidy" DOC "Path to clang-tidy executable" ) if(NOT CLANG_TIDY_EXE) message(FATAL_ERROR "clang-tidy not found, but requested. Please deactivate RUN_CLANG_TIDY" ) else() set_target_properties( HEJ PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-header-filter=${CMAKE_SOURCE_DIR}/include/HEJ;-fix;--fix-errors" ) endif() endif() diff --git a/Changes-API.md b/Changes-API.md index d21d791..4bbede7 100644 --- a/Changes-API.md +++ b/Changes-API.md @@ -1,113 +1,113 @@ # Changelog for HEJ API This log lists only changes on the HEJ API. These are primarily code changes relevant for calling HEJ as an API. This file should only be read as an addition to [`Changes.md`](Changes.md), where the main features are documented. ## Version 2.1 ### 2.1.0 #### Changes to Event class * Restructured `Event` class - `Event` can now only be build from a (new) `Event::EventData` class - Removed default constructor for `Event` - `Event::EventData` replaces the old `UnclusteredEvent` struct. - - `UnclusteredEvent` is now **deprecated**, and will be removed in HEJ Version - 2.3.0 + - `UnclusteredEvent` is now **deprecated**, and will be removed in version + 2.2.0 - Removed `Event.unclustered()` function - Added new member function `Events.parameters()`, to directly access (underlying) `Parameters` - New member functions `begin_partons`, `end_partons` (`rbegin_partons`, `rend_partons`) with aliases `cbegin_partons`, `cend_partons` (`crbegin_partons`, `crend_partons`) for constant (reversed) iterators over outgoing partons. * New function `Event::EventData.reconstruct_intermediate()` to reconstruct bosons from decays, e.g. `positron + nu_e => Wp` * Added optional Colour charges to particles (`Particle.colour`) - Colour connection in the HEJ limit can be generated via `Event.generate_colours` (automatically done in the resummation) - Colour configuration of input events can be checked with `Event.is_leading_colour` * Added function `Event.valid_hej_state` to check if event _could have_ been produced by `HEJ` according to the `soft pt regulator` cut on the jets #### New and updated functions * Renamed `EventType::nonHEJ` to `EventType::non_resummable` and `is_HEJ()` to `is_resummable()` such that run card is consistent with internal workings * Made `MatrixElement.tree_kin(...)` and `MatrixElement.tree_param(...)` public * New `EventReweighter` member function `treatment` to query the treatment with respect to resummation for the various event types. * Added auxiliary functions to obtain a `std::string` from `EventDescription` (`to_string` for human readable, and `to_simple_string` for easy parsable string) * New `get_analyses` function to read in multiple `HEJ::Analysis` at once, similar to `get_analysis` * New `get_ew_parameters` function to extract electroweak parameters from YAML configuration. #### New classes * New class `Unweighter` to do unweighting * New class `CrossSectionAccumulator` to keep track of Cross Section of the different subprocess * New template struct `Parameters` similar to old `Weights` - `Weights` are now an alias for `Parameters`. Calling `Weights` did not change - `Weights.hh` was replaced by `Parameters.hh`. The old `Weights.hh` header - will be removed in HEJ Version 2.2.0 + will be removed in version 2.2.0 * Function to multiplication and division of `EventParameters.weight` by double - This can be combined with `Parameters`, e.g. `Parameters*Weights`, see also `Events.parameters()` - Moved `EventParameters` to `Parameters.hh` header * new class `EWConstants` replaces previously hard coded `vev` - `EWConstants` have to be set in the general `Config` and the `MatrixElementConfig` #### Input/Output * New abstract `EventReader` class, as base for reading events from files - Moved LHE file reader to `HEJ::LesHouchesReader` * New (optional) function `finish()` in abstract class `EventWriter`. `finish()` is called _after_ all events are written. * Support reading (`HDF5Reader`) and writing (`HDF5Writer`) `hdf5` files * New `BufferedEventReader` class that allows to put events back into the reader. * New `SherpaLHEReader` to read Sherpa LHE files with correct weights * `get_analysis` now requires `YAML::Node` and `LHEF::HEPRUP` as arguments * Replaced `HepMCInterface` and `HepMCWriter` by `HepMCInterfaceX` and `HepMCWriterX` respectively, with `X` being the major version of HepMC (2 or 3) - Renamed `HepMCInterfaceX::init_kinematics` to `HepMCInterfaceX::init_event` and protected it, use `HepMCInterfaceX::operator()` instead - Removed redundant `HepMCInterfaceX::add_variation` function #### Linking * Export cmake target `HEJ::HEJ` to link directly against `libHEJ` * Preprocessor flags (`HEJ_BUILD_WITH_XYZ`) for enabled/disabled dependencies are now written to `ConfigFlags.hh` * Provide links to version specific object files, e.g. `libHEJ.so -> libHEJ.so.2.1 (soname) -> libHEJ.so.2.1.0` * Removed `LHAPDF` from public interface #### Miscellaneous * Capitalisation of `Config.hh` now matches class `Config` (was `config.hh`) * Renamed `Config::max_ext_soft_pt_fraction` to `Config::soft_pt_regulator`. The new `Config::soft_pt_regulator` parameter is optional and the old `Config::max_ext_soft_pt_fraction` is **deprecated**. * Replaced redundant member `EventReweighterConfig::jet_param` with getter function `EventReweighter.jet_param()` (`JetParameters` are already in `PhaseSpacePointConfig`) * Avoid storing reference to the Random Number Generator inside classes - Constructors of `EventReweighter` now expect `std::shared_ptr` (was reference) - Moved reference to `HEJ::RNG` from constructor of `JetSplitter` to `JetSplitter.split` ## Version 2.0 ### 2.0.4 * Fixed wrong path of `HEJ_INCLUDE_DIR` in `hej-config.cmake` ### 2.0.0 * First release diff --git a/Changes.md b/Changes.md index ec49d4d..4cd4d0e 100644 --- a/Changes.md +++ b/Changes.md @@ -1,145 +1,145 @@ # Changelog This is the log for changes to the HEJ program. Further changes to the HEJ API are documented in [`Changes-API.md`](Changes-API.md). If you are using HEJ as a library, please also read the changes there. ## Version 2.1 This release adds support for two new processes: * W boson with jets. * Jets with a charged lepton-antilepton pair via a virtual Z boson or photon. In addition, the complete set of first subleading processes (unordered gluon, central and extremal quark-antiquark pair) is implemented for pure jets and W + jets, see [arXiv:TODO](https://arxiv.org/abs/TODO). Unordered gluon emission is also supported for Higgs boson + jets and Z boson/photon + jets. This release include many changes to the code, which affect users of HEJ as a library (see [`Changes-API.md`](Changes-API.md)). ### 2.1.0 #### New Processes * Resummation for W bosons with jets - New subleading processes `extremal qqbar` & `central qqbar` for a quark and anti-quark in the final state, e.g. `g g => u d_bar Wm g` (the other subleading processes also work with W's) - `HEJFOG` can generate multiple jets together with a (off-shell) W bosons decaying into lepton & neutrino * Resummation for jets with a charged lepton-antilepton pair via a virtual Z boson or photon. Includes the `unordered` subleading process. * Resummation can now be performed on all subleading processes within pure jets also. This includes `unordered`, `extremal qqbar` and `central qqbar` processes. #### More Physics implementation * Partons now have a Colour charge - Colours are read from and written to LHE files - For reweighted events the colours are created according to leading colour in the FKL limit * Use relative fraction for soft transverse momentum in tagging jets (`soft pt regulator`) as new (optional) parameter. - This supersedes `min extparton pt`, which is marked **deprecated** and will - be removed in future versions. + be removed in version 2.2.0 - This is a direct replacement for the old `max ext soft pt fraction`, which is also **deprecated**. * Changed the redistribution of the momenta of soft emissions. Now also bosons can take part of the recoil (previously only jets). #### Updates to Runcard * Allow multiplication and division of multiple scale functions e.g. `H_T/2*m_j1j2` * Grouped `event treatment` for subleading channels together in runcard - Rename `non-HEJ` processes to `non-resummable` * Read electro-weak constants from input - new mandatory setting `vev` to change vacuum expectation value - new mandatory settings `particle properties` to specify mass & width of bosons - `HEJFOG`: decays are now specified in `decays` setting (previously under `particle properties`) * Allow loading multiple analyses with `analyses`. The old `analysis` (with "i") is marked **deprecated**. * Optional setting to specify maximal number of Fixed Order events (`max events`, default is all) * Allow changing the regulator lambda in input (`regulator parameter`, only for advanced users) #### Changes to Input/Output * Added support to read & write `hdf5` event files suggested in [arXiv:1905.05120](https://arxiv.org/abs/1905.05120) (needs [HighFive](https://github.com/BlueBrain/HighFive)) * Support input with average weight equal to the cross section (`IDWTUP=1 or 4`) * Support unmodified Les Houches Event Files written by Sherpa with `cross section = sum(weights)/sum(trials)` * Analyses now get general run information (`LHEF::HEPRUP`) in the constructor. **This might break previously written, external analyses!** - external analyses should now be created with `make_analysis(YAML::Node const & config, LHEF::HEPRUP const & heprup)` * Support `rivet` version 3 with both `HepMC` version 2 and 3 - Multiple weights with `rivet 3` will only create one `.yoda` file (instead of one per weight/scale) * Added option to unweight only resummation events (`unweight: {type: resummation}`) * Added option for partially unweighting resummation events, similar to the fixed-order generator. * Improved unweighting algorithm. * Follow HepMC convention for particle Status codes: incoming = 11, decaying = 2, outgoing = 1 (unchanged) #### Miscellaneous * Print cross sections at end of run * Added example analysis & scale to `examples/`. Everything in `examples/` will be build when the flag `-DBUILD_EXAMPLES=TRUE` is set in `cmake`. * Dropped support for HepMC 3.0.0, either HepMC version 2 or >3.1 is required - It is now possible to write out both HepMC 2 and HepMC 3 events at the same time * Require LHADPF version 6. Dropped support for all other versions. * Use `git-lfs` for raw data in test (`make test` now requires `git-lfs`) * Currents are now generated with [`FORM`](https://github.com/vermaseren/form) - `FORM` is included as a `git submodule`, use `git submodule update --init` to download `FORM` * Create [Sphinx](http://sphinx-doc.org/) and [Doxygen](http://doxygen.org/) documentation by `make sphinx` or `make doxygen` in your `build/` folder ## Version 2.0 First release of HEJ 2. Complete code rewrite compared to HEJ 1. Improved matching to Fixed Order ([arXiv:1805.04446](https://arxiv.org/abs/1805.04446)). Implemented processes: Higgs boson with jets (FKL and unordered gluon emission, with finite quark mass loop, [arXiv:1812.08072](https://arxiv.org/abs/1812.08072)), and pure jets (only FKL). See [arXiv:1902.08430](https://arxiv.org/abs/1902.08430) ### 2.0.6 * Fixed compiling rivet when YODA headers are _outside_ of rivet directory ### 2.0.5 * Fixed event classification for input not ordered in rapidity ### 2.0.4 * Fixed wrong path of `HEJ_INCLUDE_DIR` in `hej-config.cmake` ### 2.0.3 * Fixed parsing of (numerical factor) * (base scale) in configuration * Don't change scale names, but sanitise Rivet output file names instead ### 2.0.2 * Changed scale names to `"_over_"` and `"_times_"` for proper file names (was `"/"` and `"*"` before) ### 2.0.1 * Fixed name of fixed-order generator in error message. ### 2.0.0 * First release diff --git a/FixedOrderGen/CMakeLists.txt b/FixedOrderGen/CMakeLists.txt index 992f3ba..93eb5a7 100644 --- a/FixedOrderGen/CMakeLists.txt +++ b/FixedOrderGen/CMakeLists.txt @@ -1,106 +1,106 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) set(CMAKE_LEGACY_CYGWIN_WIN32 0) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -project("HEJ Fixed Order Generation" VERSION 2.0.6 LANGUAGES C CXX) +project("HEJ Fixed Order Generation" VERSION 2.1.0 LANGUAGES C CXX) ## User settings include(CMakeDependentOption) option(TEST_ALL "Run additional (longer) tests" FALSE) option(RUN_CLANG_TIDY "Run clang tidy" FALSE) option(TEST_COVERAGE "Generate test coverage with \"gcovr\"" FALSE) # Set a default build type if none was specified set(default_build_type "RelWithDebInfo") if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "Setting build type to '${default_build_type}' as none was specified.") set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") endif() ## Global flags for the compiler (all warnings) if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic") elseif (MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /EHsc") endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 14) ## Create Version set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") # Get the latest abbreviated commit hash of the working branch execute_process( COMMAND git rev-parse HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE PROJECT_GIT_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE ) # Get the current working branch execute_process( COMMAND git rev-parse --abbrev-ref HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE PROJECT_GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE ) CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Templates/Version.hh.in include/Version.hh @ONLY ) ## Use cmake modules from HEJ src set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../cmake/Modules/") ## Find HEJ (only dependency) ## HEJ includes all sub dependencies (fastjet, lhapdf, ...) find_package(HEJ 2 REQUIRED) include(RepairTargets) # more reliable cmake targets # Add test coverage if (TEST_COVERAGE AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) ) include(CodeCoverage) APPEND_COVERAGE_COMPILER_FLAGS() set(COVERAGE_GCOVR_EXCLUDES "${PROJECT_SOURCE_DIR}/t/*" "${PROJECT_BINARY_DIR}/*") SETUP_TARGET_FOR_COVERAGE_GCOVR_HTML( NAME ctest_coverage EXECUTABLE ctest ) endif() ## define executable add_subdirectory(src) add_executable(HEJFOG src/bin/main.cc) target_link_libraries(HEJFOG hejfog_lib) install(TARGETS HEJFOG DESTINATION bin) ## tests include(CTest) ## advanced version of enable_testing() ## adds "BUILD_TESTING" option to deactivate testing if(BUILD_TESTING) add_subdirectory(t) endif() ## Clang-tidy if(RUN_CLANG_TIDY) find_program( CLANG_TIDY_EXE NAMES "clang-tidy" DOC "Path to clang-tidy executable" ) if(NOT CLANG_TIDY_EXE) message(FATAL_ERROR "clang-tidy not found, but requested. Please deactivate RUN_CLANG_TIDY" ) else() set_target_properties( hejfog_lib PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-header-filter=${CMAKE_SOURCE_DIR}/include;-fix;--fix-errors" ) endif() endif() diff --git a/README.md b/README.md index 9ec4bed..dcdf07b 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,64 @@ # High Energy Jets High Energy Jets (HEJ) is a Monte Carlo generator for all-order summation of high-energy logarithms. It can be used as both a C++ library and standalone executable. For further informations and questions please visit > http://hej.web.cern.ch/ The latest version can be downloaded from -> https://phab.hepforge.org/source/hej/repository/v2.0/ +> https://phab.hepforge.org/source/hej/repository/v2.1/ ## Installation HEJ can be installed via [CMake](https://cmake.org/) version 3.1 or later by running ```sh mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=target/directory make install ``` Replace "target/directory" with the directory where HEJ should be installed to. HEJ depends on multiple external packages, a full list is given in the user documentation (i.e. http://hej.web.cern.ch/). The minimal requirements are: * A compiler supporting the C++14 standard (e.g. gcc 5 or later) * [CLHEP](https://gitlab.cern.ch/CLHEP/CLHEP) * [FastJet](http://fastjet.fr/) * IOStreams and uBLAS from the [boost libraries](https://boost.org/) * [LHAPDF](https://lhapdf.hepforge.org/) * [yaml-cpp](https://github.com/jbeder/yaml-cpp) We also provide a Fixed Order Generator for the HEJ matrix elements as a separate executable. To install it run the same commands as above in the [_FixedOrderGen_](FixedOrderGen) directory. ## Documentation All documentation is hosted on > http://hej.web.cern.ch/ To generate the user documentation locally run (requires [sphinx](http://sphinx-doc.org/)) ```sh cd build make sphinx xdg-open doc/sphinx/html/index.html ``` The code documentation can be built through [doxygen](http://doxygen.org/); ```sh cd build make doxygen xdg-open doc/doxygen/html/index.html ``` diff --git a/doc/doxygen/mainpage.dox b/doc/doxygen/mainpage.dox index 91e4744..f308feb 100644 --- a/doc/doxygen/mainpage.dox +++ b/doc/doxygen/mainpage.dox @@ -1,225 +1,225 @@ namespace HEJ { // so that doxygen links names in this namespace /** * @mainpage * * @section intro Introduction * * HEJ 2 is a library for all-order resummation of high-energy * logarithms. It includes a program to add resummation to fixed-order * events. User documentation for the program can be found here. This + * href="https://hej.web.cern.ch/HEJ/doc/2.1/user/">here. This * documentation is instead aimed at users of the library itself. * * @section overview Overview * * The main functionality is contained in the HEJ namespace. Particles are * defined via the Particle struct, which consists of the particle * four-momentum, its identifier according to the * PDG Monte Carlo numbering scheme and an optional Colour charge. Given a * number of incoming and outgoing particles, the square of the resummation * matrix element can be calculated with the help of the MatrixElement class. * * The EventReweighter class adds resummation to existing fixed-order * events. Both fixed-order and resummation events are objects of the * Event class, which are created from EventData objects with the * help of a jet * definition according to the fastjet library. EventData * objects can be assembled manually or converted from input events in * the LesHouches standard, read from file with a EventReader (e.g. * LesHouchesReader or HDF5Reader). * * Events can be saved with one of the EventWriter classes. Currently, * there is support for the Les Houches event file format with the * LesHouchesWriter class. If HEJ 2 was installed with HepMC 2 or 3 * support, the respective format is available through the HepMC2Writer * or HepMC3Writer class. The HDF5Writer class can be used if HEJ 2 was * compiled with HDF5 support. * * Further classes of interest are the interfaces to the Mixmax and * Ranlux64 random number generators, the PDF class to interact with LHAPDF and the ScaleGenerator * and ScaleConfig classes to calculate renormalisation and factorisation * scales for a given Event. * * @section example Example * * As an example, we show a toy program that computes the square of a * matrix element in the HEJ approximation for a single event. First, we * include the necessary header files: * @code{.cpp} * #include "HEJ/Event.hh" * #include "HEJ/MatrixElement.hh" * @endcode * We then specify the incoming and outgoing particles. A particle * has a type, a four-momentum \f$(p_x, p_y, p_z, E)\f$ and optionally a colour * charge. For instance, an incoming gluon could be defined as * @code{.cpp} * fastjet::PseudoJet momentum{0, 0, 308., 308.}; * HEJ::Colour colours{501,502}; * HEJ::Particle gluon_in{HEJ::ParticleID::gluon, momentum, colours}; * @endcode * We collect all incoming and outgoing particles in a partonic event. Here * is an example for a partonic \f$gu \to gghu\f$ event (omitting colours): * @code{.cpp} * HEJ::Event::EventData partonic_event; * * // incoming particles * partonic_event.incoming[0] = { * HEJ::ParticleID::gluon, * { 0., 0., 308., 308.} * }; * partonic_event.incoming[1] = { * HEJ::ParticleID::up, * { 0., 0.,-164., 164.} * }; * // outgoing particles * partonic_event.outgoing.push_back({ * HEJ::ParticleID::higgs, * { 98., 82., 14., 180.} * }); * partonic_event.outgoing.push_back({ * HEJ::ParticleID::up, * { 68.,-54., 36., 94.} * }); * partonic_event.outgoing.push_back({ * HEJ::ParticleID::gluon, * {-72., 9., 48., 87.} * }); * partonic_event.outgoing.push_back({ * HEJ::ParticleID::gluon, * {-94.,-37., 46., 111.} * }); * @endcode * Alternatively, we could read the event from e.g. a Les Houches event file, * possibly compressed with gzip. For this, the additional header file * @c HEJ/EventReader.hh have to be included. * @code{.cpp} * auto reader = HEJ::make_reader("events.lhe.gz"); * reader->read_event(); * HEJ::Event::EventData partonic_event{reader->hepeup()}; * @endcode * * In this specific example we will later choose a constant value for the * strong coupling, so that the HEJ matrix element does not depend on the * renormalisation scale. However, in a more general scenario, we will want * to set a central scale: * @code{.cpp} * partonic_event.parameters.central.mur = 50.; * @endcode * It is possible to add more scales in order to perform scale variation: * @code{.cpp} * partonic_event.parameters.variations.resize(2); * partonic_event.parameters.variations[0].mur = 25.; * partonic_event.parameters.variations[1].mur = 100.; * @endcode * * In the next step, we leverage FastJet to construct an event with * clustered jets. Here, we use antikt jets with R=0.4 and transverse * momenta of at least 30 GeV. * @code{.cpp} * const fastjet::JetDefinition jet_def{ * fastjet::JetAlgorithm::antikt_algorithm, 0.4 * }; * const double min_jet_pt = 30.; * HEJ::Event event{partonic_event.cluster(jet_def, min_jet_pt)}; * @endcode * In order to calculate the Matrix element, we now have to fix the physics * parameters. For the sake of simplicity, we assume an effective coupling * of the Higgs boson to gluons in the limit of an infinite top-quark mass * and a fixed value of \f$\alpha_s = 0.118\f$ for the strong coupling. * @code{.cpp} * const auto alpha_s = [](double /* mu_r */) { return 0.118; }; * HEJ::MatrixElementConfig ME_config; * // whether to include corrections from the * // evolution of \alpha_s in virtual corrections * ME_config.log_correction = false; * HEJ::MatrixElement ME{alpha_s, ME_config}; * @endcode * If QCDLoop is installed, we can also take into account the full loop * effects with finite top and bottom quark masses: * @code{.cpp} * HEJ::MatrixElementConfig ME_config; * ME_config.Higgs_coupling.use_impact_factors = false; * ME_config.Higgs_coupling.mt = 163; * ME_config.Higgs_coupling.include_bottom = true; * ME_config.Higgs_coupling.mb = 2.8; * @endcode * Finally, we can compute and print the square of the matrix element with * @code{.cpp} * std::cout << "HEJ ME: " << ME(event).central << '\n'; * @endcode * In the case of scale variation, the weight associated with the scale * @c event.variations[i].mur is @c ME(event).variations[i]. * * Collecting the above pieces, we have the following program: * @code{.cpp} * #include "HEJ/Event.hh" * #include "HEJ/MatrixElement.hh" * * int main(){ * HEJ::Event::EventData partonic_event; * // incoming particles * partonic_event.incoming[0] = { * HEJ::ParticleID::gluon, * { 0., 0., 308., 308.} * }; * partonic_event.incoming[1] = { * HEJ::ParticleID::up, * { 0., 0.,-164., 164.} * }; * // outgoing particles * partonic_event.outgoing.push_back({ * HEJ::ParticleID::higgs, * { 98., 82., 14., 180.} * }); * partonic_event.outgoing.push_back({ * HEJ::ParticleID::up, * { 68.,-54., 36., 94.} * }); * partonic_event.outgoing.push_back({ * HEJ::ParticleID::gluon, * {-72., 9., 48., 87.} * }); * partonic_event.outgoing.push_back({ * HEJ::ParticleID::gluon, * {-94.,-37., 46., 111.} * }); * * const fastjet::JetDefinition jet_def{ * fastjet::JetAlgorithm::antikt_algorithm, 0.4 * }; * const double min_jet_pt = 30.; * HEJ::Event event{partonic_event.cluster(jet_def, min_jet_pt)}; * const auto alpha_s = [](double /* mu_r */) { return 0.118; }; * HEJ::MatrixElementConfig ME_config; * // whether to include corrections from the * // evolution of \alpha_s in virtual corrections * ME_config.log_correction = false; * HEJ::MatrixElement ME{alpha_s, ME_config}; * * std::cout * << "HEJ ME: " << ME(event).central * << " = tree * virtual = " << ME.tree(event).central * << " * " << ME.virtual_corrections(event).central * << '\n'; * } * @endcode * After saving the above code to a file @c matrix_element.cc, it * can be compiled into an executable @c matrix_element with a * suitable compiler. For example, with @c g++ this can be done * with the command * @code{.sh} * g++ -o matrix_element matrix_element.cc -lHEJ -lfastjet * @endcode * If HEJ or any of the required libraries was installed to a * non-standard location, it may be necessary to explicitly specify the * paths to the required header and library files. This can be done with * the @c HEJ-config executable and similar programs for the * other dependencies: * @code{.sh} * g++ $(fastjet-config --cxxflags) $(HEJ-config --cxxflags) -o matrix_element matrix_element.cc $(HEJ-config --libs) $(fastjet-config --libs) * @endcode */ } diff --git a/doc/sphinx/installation.rst b/doc/sphinx/installation.rst index 008bf02..3478786 100644 --- a/doc/sphinx/installation.rst +++ b/doc/sphinx/installation.rst @@ -1,102 +1,102 @@ .. _Installation: Installation ============ Download -------- A tar archive of the HEJ 2 source code can be downloaded and decompressed with the command:: - curl https://hej.web.cern.ch/HEJ/downloads/HEJ_2.0.tar.gz | tar -xz + curl https://hej.web.cern.ch/HEJ/downloads/HEJ_2.1.tar.gz | tar -xz -To obtain the latest stable HEJ version, `HEJ_2.0.tar.gz` should be +To obtain the latest stable HEJ version, `HEJ_2.1.tar.gz` should be replaced by `HEJ.tar.gz`. Alternatively, the HEJ source code can be obtained by installing the `git version control system `_. and running: .. code-block:: sh git clone https://phab.hepforge.org/source/hej.git We also provide a `Docker image `_ containing a HEJ 2 installation. This image can be pulled with:: docker pull hejdock/hej When using the Docker image the remaining installation steps can be skipped. Prerequisites ------------- Before installing HEJ 2, you need the following programs and libraries: - `CMake `_ version 3.1 - A compiler supporting the C++14 standard, for example `gcc `_ 5 or later - `FastJet `_ - `CLHEP `_ version 2.3 - `LHAPDF `_ version 6 - The `IOStreams` and `uBLAS` `boost `_ libraries - `yaml-cpp `_ - `autoconf` and `automake` for `FORM `_ In addition, some optional features have additional dependencies: - `Version 2 of QCDLoop `_ is required to include finite top mass corrections in Higgs boson + jets production. - `HepMC versions 2 and 3 `_ enable event output in the respective format. - `Rivet `_ together with HepMC 2 or 3 allow using Rivet analyses. - `HighFive `_ has to be installed in order to read and write event files in the `HDF5 `_-based format suggested in `arXiv:1905.05120 `_. Compilation ----------- To compile and install HEJ 2 run:: cmake source/directory -DCMAKE_INSTALL_PREFIX=target/directory make install :file:`source/directory` is the directory containing the file :file:`CMakeLists.txt`. If you omit :code:`-DCMAKE_INSTALL_PREFIX=target/directory` HEJ 2 will be installed to some default location. In case some of the aforementioned prerequisites are not found by :code:`cmake` you can give a hint by adding an additional argument :code:`-Dlibname_ROOT_DIR=/directory/with/library`, where :code:`libname` should be replaced by the name of the library in question. If :code:`cmake` fails to find (the correct) boost path, try setting :code:`-DBOOST_ROOT=/path/to/boost`, this will force :code:`cmake` to search for boost only in :code:`/path/to/boost`. To not include specific packages one can add :code:`-DEXCLUDE_packagename=TRUE` to :code:`cmake`, e.g. by setting :code:`-DEXCLUDE_rivet=TRUE` HEJ 2 will not be interfaced to Rivet even if it is available on the system. Testing ------- To test your installation, download the NNPDF 2.3 PDF set with:: lhapdf install NNPDF23_nlo_as_0119 and run:: make test The test data of HEJ are stored in a `Git Large File Storage `_ format. :code:`git clone` therefore requires :code:`git-lfs` to download the data correctly. diff --git a/include/HEJ/Event.hh b/include/HEJ/Event.hh index 480aadf..00ed131 100644 --- a/include/HEJ/Event.hh +++ b/include/HEJ/Event.hh @@ -1,374 +1,376 @@ /** \file * \brief Declares the Event class and helpers * * \authors The HEJ collaboration (see AUTHORS for details) * \date 2019-2020 * \copyright GPLv2 or later */ #pragma once #include #include #include #include #include #include #include #include "boost/iterator/filter_iterator.hpp" #include "fastjet/ClusterSequence.hh" #include "fastjet/PseudoJet.hh" #include "HEJ/Constants.hh" #include "HEJ/Parameters.hh" #include "HEJ/Particle.hh" #include "HEJ/event_types.hh" namespace LHEF { class HEPEUP; class HEPRUP; } namespace fastjet { class JetDefinition; } namespace HEJ { struct RNG; struct UnclusteredEvent; /** @brief An event with clustered jets * * This is the main HEJ 2 event class. * It contains kinematic information including jet clustering, * parameter (e.g. scale) settings and the event weight. */ class Event { public: class EventData; //! Iterator over partons using ConstPartonIterator = boost::filter_iterator< bool (*)(Particle const &), std::vector::const_iterator >; //! Reverse Iterator over partons using ConstReversePartonIterator = std::reverse_iterator< ConstPartonIterator>; //! No default Constructor Event() = delete; //! Event Constructor adding jet clustering to an unclustered event - //! @deprecated UnclusteredEvent will be replaced by EventData in HEJ 2.2.0 - [[deprecated("UnclusteredEvent will be replaced by EventData")]] + //! @deprecated UnclusteredEvent got superseded by EventData + //! and will be removed in HEJ 2.2.0 + [[deprecated("UnclusteredEvent got superseded by EventData")]] Event( UnclusteredEvent const & ev, fastjet::JetDefinition const & jet_def, double min_jet_pt ); //! @name Particle Access //! @{ //! Incoming particles std::array const & incoming() const{ return incoming_; } //! Outgoing particles std::vector const & outgoing() const{ return outgoing_; } //! Iterator to the first outgoing parton ConstPartonIterator begin_partons() const; //! Iterator to the first outgoing parton ConstPartonIterator cbegin_partons() const; //! Iterator to the end of the outgoing partons ConstPartonIterator end_partons() const; //! Iterator to the end of the outgoing partons ConstPartonIterator cend_partons() const; //! Reverse Iterator to the first outgoing parton ConstReversePartonIterator rbegin_partons() const; //! Reverse Iterator to the first outgoing parton ConstReversePartonIterator crbegin_partons() const; //! Reverse Iterator to the first outgoing parton ConstReversePartonIterator rend_partons() const; //! Reverse Iterator to the first outgoing parton ConstReversePartonIterator crend_partons() const; //! Particle decays /** * The key in the returned map corresponds to the index in the * vector returned by outgoing() */ std::unordered_map> const & decays() const { return decays_; } //! The jets formed by the outgoing partons, sorted in rapidity std::vector const & jets() const{ return jets_; } //! @} //! @name Weight variations //! @{ //! All chosen parameter, i.e. scale choices (const version) Parameters const & parameters() const{ return parameters_; } //! All chosen parameter, i.e. scale choices Parameters & parameters(){ return parameters_; } //! Central parameter choice (const version) EventParameters const & central() const{ return parameters_.central; } //! Central parameter choice EventParameters & central(){ return parameters_.central; } //! Parameter (scale) variations (const version) std::vector const & variations() const{ return parameters_.variations; } //! Parameter (scale) variations std::vector & variations(){ return parameters_.variations; } //! Parameter (scale) variation (const version) /** * @param i Index of the requested variation */ EventParameters const & variations(std::size_t i) const{ return parameters_.variations.at(i); } //! Parameter (scale) variation /** * @param i Index of the requested variation */ EventParameters & variations(std::size_t i){ return parameters_.variations.at(i); } //! @} //! Indices of the jets the outgoing partons belong to /** * @param jets Jets to be tested * @returns A vector containing, for each outgoing parton, * the index in the vector of jets the considered parton * belongs to. If the parton is not inside any of the * passed jets, the corresponding index is set to -1. */ std::vector particle_jet_indices( std::vector const & jets ) const { return cs_.particle_jet_indices(jets); } //! particle_jet_indices() of the Event jets() std::vector particle_jet_indices() const { return particle_jet_indices(jets()); } //! Jet definition used for clustering fastjet::JetDefinition const & jet_def() const{ return cs_.jet_def(); } //! Minimum jet transverse momentum double min_jet_pt() const{ return min_jet_pt_; } //! Event type event_type::EventType type() const{ return type_; } //! Give colours to each particle /** * @returns true if new colours are generated, i.e. same as is_resummable() * @details Colour ordering is done according to leading colour in the MRK * limit, see \cite Andersen:2011zd. This only affects \ref * is_resummable() "HEJ" configurations, all other \ref event_type * "EventTypes" will be ignored. * @note This overwrites all previously set colours. */ bool generate_colours(RNG & /*ran*/); //! Check that current colours are leading in the high energy limit /** * @details Checks that the colour configuration can be split up in * multiple, rapidity ordered, non-overlapping ladders. Such * configurations are leading in the MRK limit, see * \cite Andersen:2011zd * * @note This is _not_ to be confused with \ref is_resummable(), however * for all resummable states it is possible to create a leading colour * configuration, see generate_colours() */ bool is_leading_colour() const; /** * @brief Check if given event could have been produced by HEJ * @details A HEJ state has to fulfil: * 1. type() has to be \ref is_resummable() "resummable" * 2. Soft radiation in the tagging jets contributes at most to * `soft_pt_regulator` of the total jet \f$ p_\perp \f$ * * @note This is true for any resummed stated produced by the * EventReweighter or any \ref is_resummable() "resummable" Leading * Order state. * * @param soft_pt_regulator Maximum transverse momentum fraction from soft * radiation in tagging jets * @param min_pt Absolute minimal \f$ p_\perp \f$, * \b deprecated use soft_pt_regulator instead * @return True if this state could have been produced by HEJ */ bool valid_hej_state( double soft_pt_regulator = DEFAULT_SOFT_PT_REGULATOR, double min_pt = 0. ) const; private: //! \internal //! @brief Construct Event explicitly from input. /** This is only intended to be called from EventData. * * \warning The input is taken _as is_, sorting and classification has to be * done externally, i.e. by EventData */ Event( std::array && incoming, std::vector && outgoing, std::unordered_map> && decays, Parameters && parameters, fastjet::JetDefinition const & jet_def, double min_jet_pt ); //! Iterator over partons (non-const) using PartonIterator = boost::filter_iterator< bool (*)(Particle const &), std::vector::iterator >; //! Reverse Iterator over partons (non-const) using ReversePartonIterator = std::reverse_iterator; //! Iterator to the first outgoing parton (non-const) PartonIterator begin_partons(); //! Iterator to the end of the outgoing partons (non-const) PartonIterator end_partons(); //! Reverse Iterator to the first outgoing parton (non-const) ReversePartonIterator rbegin_partons(); //! Reverse Iterator to the first outgoing parton (non-const) ReversePartonIterator rend_partons(); std::array incoming_; std::vector outgoing_; std::unordered_map> decays_; std::vector jets_; Parameters parameters_; fastjet::ClusterSequence cs_; double min_jet_pt_; event_type::EventType type_; }; // end class Event //! Class to store general Event setup, i.e. Phase space and weights class Event::EventData { public: //! Default Constructor EventData() = default; //! Constructor from LesHouches event information EventData(LHEF::HEPEUP const & hepeup); //! Constructor with all values given EventData( std::array incoming, std::vector outgoing, std::unordered_map> decays, Parameters parameters ): incoming(std::move(incoming)), outgoing(std::move(outgoing)), decays(std::move(decays)), parameters(std::move(parameters)) {} //! Generate an Event from the stored EventData. /** * @details Do jet clustering and classification. * Use this to generate an Event. * * @note Calling this function destroys EventData * * @param jet_def Jet definition * @param min_jet_pt minimal \f$p_T\f$ for each jet * * @returns Full clustered and classified event. */ Event cluster( fastjet::JetDefinition const & jet_def, double min_jet_pt); //! Alias for cluster() Event operator()( fastjet::JetDefinition const & jet_def, double const min_jet_pt){ return cluster(jet_def, min_jet_pt); } //! Sort particles in rapidity void sort(); //! Reconstruct intermediate particles from final-state leptons /** * Final-state leptons are created from virtual photons, W, or Z bosons. * This function tries to reconstruct such intermediate bosons if they * are not part of the event record. */ void reconstruct_intermediate(); //! Incoming particles std::array incoming; //! Outcoing particles std::vector outgoing; //! Particle decays in the format {outgoing index, decay products} std::unordered_map> decays; //! Parameters, e.g. scale or inital weight Parameters parameters; }; // end class EventData //! Print Event std::ostream& operator<<(std::ostream & os, Event const & ev); //! Square of the partonic centre-of-mass energy \f$\hat{s}\f$ double shat(Event const & ev); //! Convert an event to a LHEF::HEPEUP LHEF::HEPEUP to_HEPEUP(Event const & event, LHEF::HEPRUP * /*heprup*/); // put deprecated warning at the end, so don't get the warning inside Event.hh, // additionally doxygen can not identify [[deprecated]] correctly struct [[deprecated("UnclusteredEvent will be replaced by EventData")]] UnclusteredEvent; //! An event before jet clustering - //! @deprecated UnclusteredEvent will be replaced by EventData in HEJ 2.2.0 + //! @deprecated UnclusteredEvent got superseded by EventData + //! and will be removed in HEJ 2.2.0 struct UnclusteredEvent{ //! Default Constructor UnclusteredEvent() = default; //! Constructor from LesHouches event information UnclusteredEvent(LHEF::HEPEUP const & hepeup); std::array incoming; /**< Incoming Particles */ std::vector outgoing; /**< Outgoing Particles */ //! Particle decays in the format {outgoing index, decay products} std::unordered_map> decays; //! Central parameter (e.g. scale) choice EventParameters central; std::vector variations; /**< For parameter variation */ }; } // namespace HEJ