diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..76dcc04 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,98 @@ +.tags_template: + tags: &tags_def + - docker + +stages: + - minimal_compile + - extended_tests + - different_compile + - clean + +variables: + HEJ_Install_DIR: ../tmp_HEJ/HEJ_installed + HEJ_build_DIR: ../tmp_HEJ/build_HEJ + FOG_build_DIR: ../tmp_HEJ/build_FOG + +after_script: + - date + +.HEJ_compile: + tags: *tags_def + before_script: + - date + - source /cvmfs/pheno.egi.eu/HEJ/HEJ_env.sh || exit 1 + - export t_HEJ_Install_DIR=${PWD}/$HEJ_Install_DIR + - export t_HEJ_build_DIR=${PWD}/$HEJ_build_DIR + - export t_HEJ_DIR=${PWD} + - mkdir -p ${t_HEJ_build_DIR} + - cd ${t_HEJ_build_DIR} + - cmake ${t_HEJ_DIR} -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_INSTALL_PREFIX=${t_HEJ_Install_DIR} + - make -j 8 + +Minimal_setup: + stage: minimal_compile + extends: .HEJ_compile + image: hejdock/hepenv + script: + - make test + - make install + +FOG: + stage: extended_tests + image: hejdock/hepenv + before_script: + - date + # setup env + - source /cvmfs/pheno.egi.eu/HEJ/HEJ_env.sh || exit 1 + - export t_HEJ_Install_DIR=${PWD}/$HEJ_Install_DIR + - export LD_LIBRARY_PATH=${t_HEJ_Install_DIR}/lib:${LD_LIBRARY_PATH} + - export PATH=${t_HEJ_Install_DIR}/bin:${PATH} + - export t_FOG_build_DIR=${PWD}/$FOG_build_DIR + - export t_FOG_DIR=${PWD}/FixedOrderGen + # compile + - mkdir -p ${t_FOG_build_DIR} + - cd ${t_FOG_build_DIR} + - cmake ${t_FOG_DIR} -DCMAKE_BUILD_TYPE=DEBUG + - make -j 8 + script: + - make test + +rivet: + stage: different_compile + extends: .HEJ_compile + image: hejdock/rivetenv + variables: + HEJ_build_DIR: ../tmp_HEJ/build_HEJ_rivet + script: + - make test + - bash -c '[ -f tst.yoda ]' && echo "found rivet output" + - rivet-cmphistos tst.yoda + - bash -c '[ -f MC_XS_XS.dat ]' && echo "yoda not empty" + +QCDloop: + stage: different_compile + extends: .HEJ_compile + image: hejdock/qcdloopenv + variables: + HEJ_build_DIR: ../tmp_HEJ/build_HEJ_qcd + script: + - make test + +HepMC3: + stage: different_compile + extends: .HEJ_compile + image: hejdock/hepmc3env + variables: + HEJ_build_DIR: ../tmp_HEJ/build_HEJ_HepMC3 + script: + - make test + +clean: + stage: clean + tags: *tags_def + image: hejdock/compilerenv + script: + - cd .. + - ls tmp_HEJ + - rm -rf tmp_HEJ + when: always diff --git a/CMakeLists.txt b/CMakeLists.txt index a84ac3c..3e2d6d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,216 +1,238 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) set(CMAKE_LEGACY_CYGWIN_WIN32 0) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) project("Reversed HEJ" VERSION 0.0.1 LANGUAGES 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") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") 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 ) set(INSTALL_INCLUDE_DIR "include/RHEJ/") set(INSTALL_BIN_DIR "bin/") set(INSTALL_LIB_DIR "lib/") CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Templates/Version.hh.in ${PROJECT_BINARY_DIR}/include/RHEJ/Version.hh @ONLY ) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Templates/rHEJ-config.cc.in ${PROJECT_BINARY_DIR}/src/bin/rHEJ-config.cc @ONLY ) ## Add directories and find dependences include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) find_package(fastjet REQUIRED) include_directories(${fastjet_INCLUDE_PATH}) find_package(clhep 2.3 REQUIRED) include_directories(${clhep_INCLUDE_PATH}) find_package(lhapdf REQUIRED) include_directories(${lhapdf_INCLUDE_PATH}) -find_package(gsl REQUIRED) -include_directories(${gsl_INCLUDE_PATH}) +## 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) include_directories(${Boost_INCLUDE_DIRS}) find_package(yaml-cpp) include_directories(${YAML_CPP_INCLUDE_DIR}) find_package(HepMC 2) if(${HepMC_FOUND}) message (STATUS "HepMC installation found: ${HepMC_INCLUDE_DIRS}") set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRHEJ_BUILD_WITH_HepMC_VERSION=${HepMC_VERSION_MAJOR}" ) include_directories(${HepMC_INCLUDE_DIRS}) find_package(rivet) if(${rivet_FOUND}) include_directories(${rivet_INCLUDE_PATH}) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRHEJ_BUILD_WITH_RIVET" ) endif() 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() +# Generate CMake config file +include(CMakePackageConfigHelpers) +set(INCLUDE_INSTALL_DIR include) +set(LIB_INSTALL_DIR lib) +set(CONFIG_INSTALL_DIR lib/cmake/rhej) +configure_package_config_file( + cmake/Templates/rhej-config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_INSTALL_DIR}/rhej-config.cmake + INSTALL_DESTINATION ${CONFIG_INSTALL_DIR} + PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR + ) +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_INSTALL_DIR}/rhej-config-version.cmake + COMPATIBILITY SameMajorVersion + ) +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_INSTALL_DIR}/rhej-config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_INSTALL_DIR}/rhej-config-version.cmake + DESTINATION ${CONFIG_INSTALL_DIR}) + add_subdirectory(src) ## define executable add_executable(rHEJ src/bin/rHEJ.cc) ## link libraries target_link_libraries(rHEJ rhej) add_executable(rHEJ-config src/bin/rHEJ-config.cc) file(GLOB rhej_headers ${CMAKE_CURRENT_SOURCE_DIR}/include/RHEJ/*.hh ${PROJECT_BINARY_DIR}/include/RHEJ/*.hh) file(GLOB lhef_headers ${CMAKE_CURRENT_SOURCE_DIR}/include/LHEF/*.h) install(FILES ${rhej_headers} DESTINATION ${INSTALL_INCLUDE_DIR}) install(FILES ${lhef_headers} DESTINATION include/LHEF/) install(TARGETS rHEJ rHEJ-config DESTINATION ${INSTALL_BIN_DIR}) ## tests enable_testing() set(tst_dir "${CMAKE_CURRENT_SOURCE_DIR}/t") -add_executable(test_Matrix ${tst_dir}/test_Matrix.cc) add_executable(test_classify ${tst_dir}/test_classify.cc) add_executable(test_psp ${tst_dir}/test_psp.cc) add_executable(test_ME_generic ${tst_dir}/test_ME_generic.cc) add_executable(check_res ${tst_dir}/check_res.cc) add_executable(check_lhe ${tst_dir}/check_lhe.cc) add_library(scales SHARED ${tst_dir}/scales.cc) add_executable(test_scale_import ${tst_dir}/test_scale_import) add_executable(test_descriptions ${tst_dir}/test_descriptions) -target_link_libraries(test_Matrix rhej) target_link_libraries(test_classify rhej) target_link_libraries(test_psp rhej) target_link_libraries(test_ME_generic rhej) target_link_libraries(check_res rhej) target_link_libraries(check_lhe rhej) target_link_libraries(test_scale_import rhej) target_link_libraries(test_descriptions rhej) ## add tests add_test( - NAME t_matrix - COMMAND test_Matrix - ) -add_test( NAME t_classify COMMAND test_classify ${tst_dir}/classify.lhe.gz ) add_test( NAME t_psp COMMAND test_psp ${tst_dir}/psp_gen.lhe.gz ) set(tst_ME_data_dir "${tst_dir}/ME_data") add_test( NAME t_ME_j COMMAND test_ME_generic ${tst_ME_data_dir}/config_mtinf.yml ${tst_ME_data_dir}/ME_jets.dat ${tst_ME_data_dir}/PSP_jets.lhe.gz ) add_test( NAME t_ME_h COMMAND test_ME_generic ${tst_ME_data_dir}/config_mtinf.yml ${tst_ME_data_dir}/ME_h_mtinf.dat ${tst_ME_data_dir}/PSP_h.lhe.gz ) if(${QCDloop_FOUND}) add_test( NAME t_ME_h_mt COMMAND test_ME_generic ${tst_ME_data_dir}/config_mt.yml ${tst_ME_data_dir}/ME_h_mt.dat ${tst_ME_data_dir}/PSP_h.lhe.gz ) add_test( NAME t_ME_h_mtmb COMMAND test_ME_generic ${tst_ME_data_dir}/config_mtmb.yml ${tst_ME_data_dir}/ME_h_mtmb.dat ${tst_ME_data_dir}/PSP_h.lhe.gz ) endif() add_test( NAME t_2j COMMAND check_res ${tst_dir}/2j.lhe.gz 3.49391e+07 419684 ) add_test( NAME t_3j COMMAND check_res ${tst_dir}/3j.lhe.gz 2.37902e+06 25746.6 ) add_test( NAME t_4j COMMAND check_res ${tst_dir}/4j.lhe.gz 603713 72822.6 ) add_test( NAME t_h_3j COMMAND check_res ${tst_dir}/h_3j.lhe.gz 0.821622 0.0220334 ) add_test( NAME t_h_3j_uno COMMAND check_res ${tst_dir}/h_3j_uno.lhe.gz 0.0261968 0.000341549 uno ) if(${HepMC_FOUND}) file(READ "${tst_dir}/jet_config.yml" config) file(WRITE "${tst_dir}/jet_config_withHepMC.yml" "${config} - tst.hepmc") if(${rivet_FOUND}) file(READ "${tst_dir}/jet_config_withHepMC.yml" config) file(WRITE "${tst_dir}/jet_config_withRivet.yml" "${config}\n\nanalysis:\n rivet: MC_XS\n output: tst") add_test( NAME t_main COMMAND rHEJ ${tst_dir}/jet_config_withRivet.yml ${tst_dir}/2j.lhe.gz ) else() add_test( NAME t_main COMMAND rHEJ ${tst_dir}/jet_config_withHepMC.yml ${tst_dir}/2j.lhe.gz ) endif() if(${HepMC_VERSION_MAJOR} GREATER 2) add_executable(check_hepmc ${tst_dir}/check_hepmc.cc) target_link_libraries(check_hepmc rhej) add_test( NAME t_hepmc COMMAND check_hepmc tst.hepmc ) endif() else() add_test( NAME t_main COMMAND rHEJ ${tst_dir}/jet_config.yml ${tst_dir}/2j.lhe.gz ) endif() add_test( NAME t_lhe COMMAND check_lhe tst.lhe ) add_test( NAME t_scale_import COMMAND test_scale_import ${tst_dir}/jet_config_with_import.yml ) add_test( NAME t_descriptions COMMAND test_descriptions ) diff --git a/FixedOrderGen/CMakeLists.txt b/FixedOrderGen/CMakeLists.txt index e1962f9..da25e82 100644 --- a/FixedOrderGen/CMakeLists.txt +++ b/FixedOrderGen/CMakeLists.txt @@ -1,86 +1,110 @@ 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 0.0.1 LANGUAGES 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") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") 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 ${PROJECT_BINARY_DIR}/include/Version.hh @ONLY ) ## Add directories and find dependences include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/../include) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../cmake/Modules/") +find_package(rHEJ REQUIRED) +include_directories(${RHEJ_INCLUDE_PATH}) find_package(fastjet REQUIRED) include_directories(${fastjet_INCLUDE_PATH}) find_package(clhep 2.3 REQUIRED) include_directories(${clhep_INCLUDE_PATH}) find_package(lhapdf REQUIRED) include_directories(${lhapdf_INCLUDE_PATH}) +## 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) include_directories(${Boost_INCLUDE_DIRS}) find_package(yaml-cpp) include_directories(${YAML_CPP_INCLUDE_DIR}) 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} ${Boost_LIBRARIES} ${YAML_CPP_LIBRARIES}) + ${FASTJET_LIBRARIES} ${Boost_LIBRARIES} ${YAML_CPP_LIBRARIES} ${RHEJ_LIBRARIES}) if(${QCDloop_FOUND}) list(APPEND libraries ${QCDloop_LIBRARIES} quadmath) endif() -# add libraries for reversed HEJ -list(APPEND libraries rhej) target_link_libraries(hejfog ${libraries}) target_link_libraries(FOgen hejfog) install(TARGETS FOgen DESTINATION bin) +## tests + enable_testing() set(tst_dir "${CMAKE_CURRENT_SOURCE_DIR}/t") foreach(tst h_2j h_3j h_5j h_3j_uno1 h_3j_uno2 h_2j_decay 2j 4j) add_executable(test_${tst} ${tst_dir}/${tst}.cc) target_link_libraries(test_${tst} hejfog) add_test(NAME t_${tst} COMMAND test_${tst} WORKING_DIRECTORY ${tst_dir}) endforeach() +add_test( + NAME t_main_2j + COMMAND FOgen ${tst_dir}/config_2j.yml + ) +add_test( + NAME t_main_h2j + COMMAND FOgen ${tst_dir}/config_h_2j.yml + ) +add_test( + NAME t_main_h2j_decay + COMMAND FOgen ${tst_dir}/config_h_2j_decay.yml + ) diff --git a/FixedOrderGen/include/Beam.hh b/FixedOrderGen/include/Beam.hh index 48a0f47..0d17565 100644 --- a/FixedOrderGen/include/Beam.hh +++ b/FixedOrderGen/include/Beam.hh @@ -1,14 +1,14 @@ #pragma once #include #include "RHEJ/PDG_codes.hh" namespace HEJFOG{ struct Beam{ double energy; - std::array particles = { + std::array particles{{ RHEJ::pid::proton, RHEJ::pid::proton - }; + }}; }; } diff --git a/cmake/Modules/Findgsl.cmake b/cmake/Modules/Findgsl.cmake deleted file mode 100644 index bb22dab..0000000 --- a/cmake/Modules/Findgsl.cmake +++ /dev/null @@ -1,28 +0,0 @@ -include (FindPackageMessage) - -message (STATUS "Detecting gsl installation") -execute_process (COMMAND gsl-config --prefix - OUTPUT_VARIABLE gsl_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE - ) -if (gsl_PREFIX) - string (STRIP ${gsl_PREFIX} gsl_PREFIX) - message (STATUS "gsl installation found: ${gsl_PREFIX}") - EXECUTE_PROCESS(COMMAND gsl-config --libs OUTPUT_VARIABLE - GSL_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE) - # set (gsl_LIBRARIES ${gsl_LIBRARIES} ) - set (gsl_INCLUDE_PATH ${gsl_PREFIX}/include) - set (gsl_FOUND TRUE) -else (gsl_PREFIX) - set (gsl_FOUND FALSE) -endif (gsl_PREFIX) - -if (NOT gsl_FOUND) - message(FATAL_ERROR "gsl installation not found!") -endif (NOT gsl_FOUND) - -mark_as_advanced( - gsl_INCLUDE_PATH - gsl_LIBRARIES -) - - diff --git a/cmake/Templates/rhej-config.cmake.in b/cmake/Templates/rhej-config.cmake.in new file mode 100644 index 0000000..edaaa05 --- /dev/null +++ b/cmake/Templates/rhej-config.cmake.in @@ -0,0 +1,12 @@ +@PACKAGE_INIT@ + +# - Config file for the rhej package +# It defines the following variables +# RHEJ_INCLUDE_DIR - include directory +# RHEJ_LIBRARIES - libraries to link against + +set_and_check(RHEJ_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") + +find_library(RHEJ_LIB NAMES rhej HINTS @PACKAGE_LIB_INSTALL_DIR@) + +set(RHEJ_LIBRARIES ${RHEJ_LIB}) diff --git a/doc/developer_manual/developer_manual.tex b/doc/developer_manual/developer_manual.tex index 34a8c93..1cf9b66 100644 --- a/doc/developer_manual/developer_manual.tex +++ b/doc/developer_manual/developer_manual.tex @@ -1,1111 +1,1157 @@ \documentclass[a4paper,11pt]{article} \usepackage{fourier} \usepackage[T1]{fontenc} \usepackage{microtype} \usepackage{geometry} \usepackage{enumitem} \setlist[description]{leftmargin=\parindent,labelindent=\parindent} \usepackage{amsmath} \usepackage{amssymb} \usepackage[utf8x]{inputenc} \usepackage{graphicx} \usepackage{xcolor} \usepackage{todonotes} \usepackage{listings} \usepackage{xspace} \usepackage{tikz} \usetikzlibrary{arrows.meta} \usetikzlibrary{shapes} \usetikzlibrary{calc} \usepackage[colorlinks,linkcolor={blue!50!black}]{hyperref} \graphicspath{{build/figures/}{figures/}} \emergencystretch \hsize \newcommand{\HEJ}{{\tt HEJ}\xspace} \newcommand{\HIGHEJ}{\emph{High Energy Jets}\xspace} \newcommand{\cmake}{\href{https://cmake.org/}{cmake}\xspace} \newcommand{\html}{\href{https://www.w3.org/html/}{html}\xspace} \newcommand{\YAML}{\href{http://yaml.org/}{YAML}\xspace} \definecolor{darkgreen}{rgb}{0,0.4,0} \lstset{ % backgroundcolor=\color{lightgray}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor} basicstyle=\footnotesize\usefont{T1}{DejaVuSansMono-TLF}{m}{n}, % the size of the fonts that are used for the code breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace breaklines=false, % sets automatic line breaking captionpos=t, % sets the caption-position to bottom commentstyle=\color{red}, % comment style deletekeywords={...}, % if you want to delete keywords from the given language escapeinside={\%*}{*)}, % if you want to add LaTeX within your code extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8 frame=false, % adds a frame around the code keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible) keywordstyle=\color{blue}, % keyword style otherkeywords={}, % if you want to add more keywords to the set numbers=none, % where to put the line-numbers; possible values are (none, left, right) numbersep=5pt, % how far the line-numbers are from the code rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here)) showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces' showstringspaces=false, % underline spaces within strings only showtabs=false, % show tabs within strings adding particular underscores stepnumber=2, % the step between two line-numbers. If it's 1, each line will be numbered stringstyle=\color{gray}, % string literal style - tabsize=2, % sets default tabsize to 2 spaces + tabsize=2, % sets default tabsize to 2 spaces title=\lstname, emph={}, emphstyle=\color{darkgreen} } \begin{document} \tikzstyle{mynode}=[rectangle split,rectangle split parts=2, draw,rectangle split part fill={lightgray, none}] \title{Reversed HEJ developer manual} \author{} \maketitle \tableofcontents \newpage \section{Overview} \label{sec:overview} Reversed HEJ is a C++ program and library implementing an algorithm to apply \HIGHEJ resummation~\cite{Andersen:2008ue,Andersen:2008gc} to pre-generated fixed-order events. This document is intended to give an overview over the concepts and structure of this implementation. \subsection{Project structure} \label{sec:project} Reversed HEJ is developed under the \href{https://git-scm.com/}{git} version control system. The main repository is on the IPPP \href{https://gitlab.com/}{gitlab} server under \url{https://gitlab.dur.scotgrid.ac.uk/hej/reversed_hej}. To get a local copy, get an account on the gitlab server and use \begin{lstlisting}[language=sh,caption={}] git clone git@gitlab.dur.scotgrid.ac.uk:hej/reversed_hej.git \end{lstlisting} This should create a directory \texttt{reversed\_hej} with the following contents: \begin{description} \item[doc:] Contains additional documentation, see section~\ref{sec:doc}. \item[include:] Contains the C++ header files. \item[src:] Contains the C++ source files. \item[t:] Contains the source code for the automated tests. \item[CMakeLists.txt:] Configuration file for the \cmake build system. See section~\ref{sec:cmake}. \item[cmake:] Auxiliary files for \cmake. This includes modules for finding installed software in \texttt{cmake/Modules} and templates for code generation during the build process in \texttt{cmake/Templates}. \item[config.yml:] Sample configuration file for running reversed HEJ. \item[events.lhe:] Fixed-order event sample that can be used as input for reversed HEJ. \item[FixedOrderGen:] Contains the code for the fixed-order generator, see section~\ref{sec:HEJFOG}. \end{description} In the following all paths are given relative to the \texttt{reversed\_hej} directory. \subsection{Documentation} \label{sec:doc} The \texttt{doc} directory contains user documentation in \texttt{doc/sphinx} and the configuration to generate source code documentation in \texttt{doc/doxygen}. The user documentation explains how to install and run reversed HEJ. The format is \href{http://docutils.sourceforge.net/rst.html}{reStructuredText}, which is mostly human-readable. Other formats, like \html, can be generated with the \href{http://www.sphinx-doc.org/en/master/}{sphinx} generator with \begin{lstlisting}[language=sh,caption={}] make html \end{lstlisting} To document the source code we use \href{https://www.stack.nl/~dimitri/doxygen/}{doxygen}. To generate \html documentation, use the command \begin{lstlisting}[language=sh,caption={}] doxygen Doxyfile \end{lstlisting} in the \texttt{doc/doxygen} directory. \subsection{Build system} \label{sec:cmake} For the most part, reversed HEJ is a library providing classes and functions that can be used to add resummation to fixed-order events. In addition, there is a relatively small executable program leveraging this library to read in events from an input file and produce resummation events. Both the library and the program are built and installed with the help of \cmake. Debug information can be turned on by using \begin{lstlisting}[language=sh,caption={}] cmake base/directory -DCMAKE_BUILD_TYPE=Debug make install \end{lstlisting} This facilitates the use of debuggers like \href{https://www.gnu.org/software/gdb/}{gdb}. The main \cmake configuration file is \texttt{CMakeLists.txt}. It defines the compiler flags, software prerequisites, header and source files used to build reversed HEJ, and the automated tests. \texttt{cmake/Modules} contains module files that help with the detection of the software prerequisites and \texttt{cmake/Templates} template files for the automatic generation of header and source files. For example, this allows to only keep the version information in one central location (\texttt{CMakeLists.txt}) and automatically generate a header file from the template \texttt{Version.hh.in} to propagate this to the C++ code. \subsection{General coding guidelines} \label{sec:notes} The goal is to make the reversed HEJ code well-structured and readable. Here are a number of guidelines to this end. \begin{description} \item[Observe the boy scout rule.] Always leave the code cleaner than how you found it. Ugly hacks can be useful for testing, but shouldn't make their way into the main branch. \item[Ask if something is unclear.] Often there is a good reason why code is written the way it is. Sometimes that reason is only obvious to the original author (use \lstinline!git blame! to find them), in which case they should be poked to add a comment. Sometimes there is no good reason, but nobody has had the time to come up with something better, yet. In some places the code might just be bad. \item[Don't break tests.] There are a number of tests in the \texttt{t} directory, which can be run with \lstinline!make test!. Ideally, all tests should run successfully in each git revision. If your latest commit broke a test and you haven't pushed to the central repository yet, you can fix it with \lstinline!git commit --amend!. If an earlier local commit broke a test, you can use \lstinline!git rebase -i! if you feel confident. \item[Test your new code.] When you add some new functionality, also add an automated test. This can be useful even if you don't know the ``correct'' result because it prevents the code from changing its behaviour silently in the future. \href{http://www.valgrind.org/}{valgrind} is a very useful tool to detect potential memory leaks. \item[Stick to the coding style.] It is somewhat easier to read code that has a uniform coding and indentation style. We don't have a strict style, but it helps if your code looks similar to what is already there. \end{description} \section{Program flow} \label{sec:flow} A run of the reversed HEJ program has three stages: initialisation, event processing, and cleanup. The following sections outline these stages and their relations to the various classes and functions in the code. Unless denoted otherwise, all classes and functions are part of the \lstinline!RHEJ! namespace. The code for the reversed HEJ program is in \texttt{src/main.cc}, all other code comprises the reversed HEJ library. Classes and free functions are usually implemented in header and source files with a corresponding name, i.e. the code for \lstinline!MyClass! can usually be found in \texttt{include/RHEJ/MyClass.hh} and \texttt{src/MyClass.cc}. \subsection{Initialisation} \label{sec:init} The first step is to load and parse the \YAML configuration file. The entry point for this is the \lstinline!load_config! function and the related code can be found in \texttt{include/RHEJ/YAMLreader.hh}, \texttt{include/RHEJ/config.hh} and the corresponding \texttt{.cc} files in the \texttt{src} directory. The implementation is based on the \href{https://github.com/jbeder/yaml-cpp}{yaml-cpp} library. The \lstinline!load_config! function returns a \lstinline!Config! object containing all settings. To detect potential mistakes as early as possible, we throw an exception whenever one of the following errors occurs: \begin{itemize} \item There is an unknown option in the \YAML file. \item A setting is invalid, for example a string is given where a number would be expected. \item An option value is not set. \end{itemize} The third rule is sometimes relaxed for ``advanced'' settings with an obvious default, like for importing custom scales or analyses. The information stored in the \lstinline!Config! object is then used to initialise various objects required for the event processing stage described in section~\ref{sec:processing}. First, the \lstinline!get_analysis! function creates an object that inherits from the \lstinline!Analysis! interface.\footnote{In the context of C++ the proper technical expression is ``pure abstract class''.} Using an interface allows us to decide the concrete type of the analysis at run time instead of having to make a compile-time decision. Depending on the settings, \lstinline!get_analysis! creates either a user-defined analysis loaded from an external library (see the user documentation \todo{link}) or the default \lstinline!EmptyAnalysis!, which does nothing. Together with a number of further objects, whose roles are described in section~\ref{sec:processing}, we also initialise the global random number generator. We again use an interface to defer deciding the concrete type until the program is actually run. Currently, we support the \href{https://mixmax.hepforge.org/}{MIXMAX} (\texttt{include/RHEJ/Mixmax.hh}) and Ranlux64 (\texttt{include/RHEJ/Ranlux64.hh}) random number generators, both are provided by \href{http://proj-clhep.web.cern.ch/}{CLHEP}. We also set up a \lstinline!LHEF::Reader! object (see \href{http://home.thep.lu.se/~leif/LHEF/}{\texttt{include/LHEF/LHEF.h}}) for reading events from a file in the Les Houches event file format~\cite{Alwall:2006yp}. A small wrapper around the \href{https://www.boost.org/doc/libs/1_67_0/libs/iostreams/doc/index.html}{boost iostreams} library allows us to also read event files compressed with \href{https://www.gnu.org/software/gzip/}{gzip}. The wrapper code is in \texttt{include/RHEJ/stream.hh} and the \texttt{src/stream.cc}. \subsection{Event processing} \label{sec:processing} In the second stage events are continously read from the event file. After jet clustering, a number of corresponding resummation events are generated for each input event and fed into the analysis and a number of output files. The roles of various classes and functions are illustrated in the following flow chart: \begin{center} \begin{tikzpicture}[node distance=2cm and 5mm] \node (reader) [mynode] {\lstinline!LHEF::Reader::readEvent!\nodepart{second}{read event}}; \node (cluster) [mynode,below=of reader] {\lstinline!Event! constructor\nodepart{second}{cluster jets}}; \node (resum) [mynode,below=of cluster] {\lstinline!EventReweighter::reweight!\nodepart{second}{perform resummation}}; \node (cut) [mynode,below=of resum] {\lstinline!Analysis::pass_cuts!\nodepart{second}{apply cuts}}; \node (fill) [mynode,below left=of cut] {\lstinline!Analysis::fill!\nodepart{second}{analyse event}}; \node (write) [mynode,below right=of cut] {\lstinline!CombinedEventWriter::write!\nodepart{second}{write out event}}; \node (control) [below=of cut] {}; \draw[-{Latex[length=3mm, width=1.5mm]}] (reader.south) -- node[left] {\lstinline!LHEF::HEPEUP!} (cluster.north); \draw[-{Latex[length=3mm, width=1.5mm]}] (cluster.south) -- node[left] {\lstinline!Event!} (resum.north); \draw[-{Latex[length=3mm, width=1.5mm]}] (resum.south) -- (cut.north); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(resum.south)+(7mm, 0cm)$) -- ($(cut.north)+(7mm, 0cm)$); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(resum.south)-(7mm, 0cm)$) -- node[left] {\lstinline!Event!} ($(cut.north)-(7mm, 0cm)$); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(cut.south)-(3mm,0mm)$) .. controls ($(control)-(3mm,0mm)$) ..node[left] {\lstinline!Event!} (fill.east); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(cut.south)-(3mm,0mm)$) .. controls ($(control)-(3mm,0mm)$) .. (write.west); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(cut.south)+(3mm,0mm)$) .. controls ($(control)+(3mm,0mm)$) .. (fill.east); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(cut.south)+(3mm,0mm)$) .. controls ($(control)+(3mm,0mm)$) ..node[right] {\lstinline!Event!} (write.west); \end{tikzpicture} \end{center} The resummation is performed by the \lstinline!EventReweighter! class, which is described in more detail in section~\ref{sec:resum}. The \lstinline!CombinedEventWriter! writes events to zero or more output files. To this end, it contains a number of objects implementing the \lstinline!EventWriter! interface. These event writers typically write the events to a file in a given format. We currently have the \lstinline!LesHouchesWriter! for event files in the Les Houches Event File format and the \lstinline!HepMCWriter! for the \href{https://hepmc.web.cern.ch/hepmc/}{HepMC} format (Version 2 and 3). \subsection{Resummation} \label{sec:resum} In the \lstinline!EventReweighter::reweight! member function, we first classify the input fixed-order event (FKL, unordered, non-HEJ, \dots) and decide according to the user settings whether to discard, keep, or resum the event. If we perform resummation for the given event, we generate a number of trial \lstinline!PhaseSpacePoint! objects. Phase space generation is discussed in more detail in section~\ref{sec:pspgen}. We then perform jet clustering according to the settings for the resummation jets on each \lstinline!PhaseSpacePoint!, update the factorisation and renormalisation scale in the resulting \lstinline!Event! and reweight it according to the ratio of pdf factors and \HEJ matrix elements between resummation and original fixed-order event: \begin{center} \begin{tikzpicture}[node distance=2cm and 5mm] \node (in) {}; \node (treat) [diamond,draw,below=of in,minimum size=3.5cm, label={[anchor=west, inner sep=8pt]west:discard}, label={[anchor=east, inner sep=14pt]east:keep}, label={[anchor=south, inner sep=20pt]south:reweight} ] {}; \draw (treat.north west) -- (treat.south east); \draw (treat.north east) -- (treat.south west); \node (psp) [mynode,below=of treat] {\lstinline!PhaseSpacePoint! constructor}; \node (cluster) [mynode,below=of psp] {\lstinline!Event! constructor\nodepart{second}{cluster jets}}; \node (gen_scales) [mynode,below=of cluster] {\lstinline!ScaleGenerator::operator()!\nodepart{second}{update scales}}; \node (rescale) [mynode,below=of gen_scales] {\lstinline!PDF::pdfpt!, \lstinline!MatrixElement!\nodepart{second}{reweight}}; \node (out) [below of=rescale] {}; \draw[-{Latex[length=3mm, width=1.5mm]}] (in.south) -- node[left] {\lstinline!Event!} (treat.north); \draw[-{Latex[length=3mm, width=1.5mm]}] (treat.south) -- node[left] {\lstinline!Event!} (psp.north); \draw[-{Latex[length=3mm, width=1.5mm]}] (psp.south) -- (cluster.north); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(psp.south)+(7mm, 0cm)$) -- ($(cluster.north)+(7mm, 0cm)$); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(psp.south)-(7mm, 0cm)$) -- node[left] {\lstinline!PhaseSpacePoint!} ($(cluster.north)-(7mm, 0cm)$); \draw[-{Latex[length=3mm, width=1.5mm]}] (cluster.south) -- (gen_scales.north); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(cluster.south)+(7mm, 0cm)$) -- ($(gen_scales.north)+(7mm, 0cm)$); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(cluster.south)-(7mm, 0cm)$) -- node[left] {\lstinline!Event!} ($(gen_scales.north)-(7mm, 0cm)$); \draw[-{Latex[length=3mm, width=1.5mm]}] (gen_scales.south) -- (rescale.north); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(gen_scales.south)+(7mm, 0cm)$) -- ($(rescale.north)+(7mm, 0cm)$); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(gen_scales.south)-(7mm, 0cm)$) -- node[left] {\lstinline!Event!} ($(rescale.north)-(7mm, 0cm)$); \draw[-{Latex[length=3mm, width=1.5mm]}] (rescale.south) -- (out.north); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(rescale.south)+(7mm, 0cm)$) -- ($(out.north)+(7mm, 0cm)$); \draw[-{Latex[length=3mm, width=1.5mm]}] ($(rescale.south)-(7mm, 0cm)$) -- node[left] {\lstinline!Event!} ($(out.north)-(7mm, 0cm)$); \node (helper) at ($(treat.east) + (15mm,0cm)$) {}; \draw[-{Latex[length=3mm, width=1.5mm]}] (treat.east) -- ($(treat.east) + (15mm,0cm)$) -- node[left] {\lstinline!Event!} (helper |- gen_scales.east) -- (gen_scales.east) ; \end{tikzpicture} \end{center} \subsection{Phase space point generation} \label{sec:pspgen} The resummed and matched \HEJ cross section for pure jet production of FKL configurations is given by (cf. eq. (3) of~\cite{Andersen:2018tnm}) \begin{align} \label{eq:resumdijetFKLmatched2} % \begin{split} \sigma&_{2j}^\mathrm{resum, match}=\sum_{f_1, f_2}\ \sum_m \prod_{j=1}^m\left( \int_{p_{j\perp}^B=0}^{p_{j\perp}^B=\infty} \frac{\mathrm{d}^2\mathbf{p}_{j\perp}^B}{(2\pi)^3}\ \int \frac{\mathrm{d} y_j^B}{2} \right) \ (2\pi)^4\ \delta^{(2)}\!\!\left(\sum_{k=1}^{m} \mathbf{p}_{k\perp}^B\right)\nonumber\\ &\times\ x_a^B\ f_{a, f_1}(x_a^B, Q_a^B)\ x_b^B\ f_{b, f_2}(x_b^B, Q_b^B)\ \frac{\overline{\left|\mathcal{M}_\text{LO}^{f_1f_2\to f_1g\cdots gf_2}\big(\big\{p^B_j\big\}\big)\right|}^2}{(\hat {s}^B)^2}\nonumber\\ & \times (2\pi)^{-4+3m}\ 2^m \nonumber\\ &\times\ \sum_{n=2}^\infty\ \int_{p_{1\perp}=p_{\perp,\mathrm{min}} }^{p_{1\perp}=\infty} \frac{\mathrm{d}^2\mathbf{p}_{1\perp}}{(2\pi)^3}\ \int_{p_{n\perp}=p_{\perp,\mathrm{min}}}^{p_{n\perp}=\infty} \frac{\mathrm{d}^2\mathbf{p}_{n\perp}}{(2\pi)^3}\ \prod_{i=2}^{n-1}\int_{p_{i\perp}=\lambda}^{p_{i\perp}=\infty} \frac{\mathrm{d}^2\mathbf{p}_{i\perp}}{(2\pi)^3}\ (2\pi)^4\ \delta^{(2)}\!\!\left(\sum_{k=1}^n \mathbf{p}_{k\perp}\right )\\ &\times \ \mathbf{T}_y \prod_{i=1}^n \left(\int \frac{\mathrm{d} y_i}{2}\right)\ \mathcal{O}_{mj}^e\ \left(\prod_{l=1}^{m-1}\delta^{(2)}(\mathbf{p}_{\mathcal{J}_{l}\perp}^B - \mathbf{j}_{l\perp})\right)\ \left(\prod_{l=1}^m\delta(y^B_{\mathcal{J}_l}-y_{\mathcal{J}_l})\right) \ \mathcal{O}_{2j}(\{p_i\})\nonumber\\ &\times \frac{(\hat{s}^B)^2}{\hat{s}^2}\ \frac{x_a f_{a,f_1}(x_a, Q_a)\ x_b f_{b,f_2}(x_b, Q_b)}{x_a^B\ f_{a,f_1}(x_a^B, Q_a^B)\ x_b^B\ f_{b,f_2}(x_b^B, Q_b^B)}\ \frac{\overline{\left|\mathcal{M}_{\mathrm{HEJ}}^{f_1 f_2\to f_1 g\cdots gf_2}(\{ p_i\})\right|}^2}{\overline{\left|\mathcal{M}_\text{LO, HEJ}^{f_1f_2\to f_1g\cdots gf_2}\big(\big\{p^B_j\big\}\big)\right|}^{2}} \,.\nonumber % \end{split} \end{align} The first two lines correspond to the generation of the fixed-order input events with incoming partons $f_1, f_2$ and outgoing momenta $p_j^B$, where $\mathbf{p}_{j\perp}^B$ and $y_j^B$ denote the respective transverse momentum and rapidity. Note that, at leading order, these coincide with the fixed-order jet momenta $p_{\mathcal{J}_j}^B$. $f_{a,f_1}(x_a, Q_a),f_{b,f_2}(x_b, Q_b)$ are the pdf factors for the incoming partons with momentum fractions $x_a$ and $x_b$. The square of the partonic centre-of-mass energy is denoted by $\hat{s}^B$ and $\mathcal{M}_\text{LO}^{f_1f_2\to f_1g\cdots gf_2}$ is the leading-order matrix element. The third line is a factor accounting for the different multiplicities between fixed-order and resummation events. Lines four and five are the integration over the resummation phase space described in this section. $p_i$ are the momenta of the outgoing partons in resummation phase space. $\mathbf{T}_y$ denotes rapidity ordering and $\mathcal{O}_{mj}^e$ projects out the exclusive $m$-jet component. The relation between resummation and fixed-order momenta is fixed by the $\delta$ functions. The first sets each transverse fixed-order jet momentum to some function $\mathbf{j_{l\perp}}$ of the resummation momenta. The exact form is described in section~\ref{sec:ptj_res}. The second $\delta$ forces the rapidities of resummation and fixed-order jets to be the same. Finally, the last line is the reweighting of pdf and matrix element factors already shown in section~\ref{sec:resum}. There are two kinds of cut-off in the integration over the resummation partons. $\lambda$ is a technical cut-off connected to the cancellation of infrared divergencies between real and virtual corrections. Its numerical value is set in \texttt{include/RHEJ/Constants.h}. $p_{\perp,\mathrm{min}}$ regulates and \emph{uncancelled} divergence in the extremal parton momenta. Its size is set by the user configuration \todo{link}. It is straightforward to generalise eq.~(\ref{eq:resumdijetFKLmatched2}) to unordered configurations and processes with additional colourless emissions, for example a Higgs or electroweak boson. In the latter case only the fixed-order integration and the matrix elements change. \subsubsection{Gluon Multiplicity} \label{sec:psp_ng} The first step in evaluating the resummation phase space in eq.~(\ref{eq:resumdijetFKLmatched2}) is to randomly pick terms in the sum over the number of emissions. This sampling of the gluon multiplicity is done in the \lstinline!PhaseSpacePoint::sample_ng! function in \texttt{src/PhaseSpacePoint.cc}. The typical number of extra emissions depends strongly on the rapidity span of the underlying fixed-order event. Let us, for example, consider a fixed-order FKL-type multi-jet configuration with rapidities $y_{j_f},\,y_{j_b}$ of the most forward and backward jets, respectively. By eq.~(\ref{eq:resumdijetFKLmatched2}), the jet multiplicity and the rapidity of each jet are conserved when adding resummation. This implies that additional hard radiation is restricted to rapidities $y$ within a region $y_{j_b} \lesssim y \lesssim y_{j_f}$. Within \HEJ, we require the most forward and most backward emissions to be hard \todo{specify how hard} in order to avoid divergences, so this constraint in fact applies to \emph{all} additional radiation. To simplify the remaining discussion, let us remove the FKL rapidity ordering \begin{equation} \label{eq:remove_y_order} \mathbf{T}_y \prod_{i=1}^n\int \frac{\mathrm{d}y_i}{2} = \frac{1}{n!}\prod_{i=1}^n\int \frac{\mathrm{d}y_i}{2}\,, \end{equation} where all rapidity integrals now cover a region which is approximately bounded by $y_{j_b}$ and $y_{j_f}$. Each of the $m$ jets has to contain at least one parton; selecting random emissions we can rewrite the phase space integrals as \begin{equation} \label{eq:select_jets} \frac{1}{n!}\prod_{i=1}^n\int [\mathrm{d}p_i] = \left(\prod_{i=1}^{m}\int [\mathrm{d}p_i]\ {\cal J}_i(p_i)\right) \frac{1}{n_g!}\prod_{i=m+1}^{m+n_g}\int [\mathrm{d}p_i] \end{equation} with jet selection functions \begin{equation} \label{eq:def_jet_selection} {\cal J}_i(p) = \begin{cases} 1 &p\text{ clustered into jet }i\\ 0 & \text{otherwise} \end{cases} \end{equation} and $n_g \equiv n - m$. Here and in the following we use the short-hand notation $[\mathrm{d}p_i]$ to denote the phase-space measure for parton $i$. As is evident from eq.~\eqref{eq:select_jets}, adding an extra emission $n_g+1$ introduces a suppression factor $\tfrac{1}{n_g+1}$. However, the additional phase space integral also results in an enhancement proportional to $\Delta y_{j_f j_b} = y_{j_f} - y_{j_b}$. This is a result of the rapidity-independence of the MRK limit of the integrand, consisting of the matrix elements divided by the flux factor. Indeed, we observe that the typical number of gluon emissions is to a good approximation proportional to the rapidity separation and the phase space integral is dominated by events with $n_g \approx \Delta y_{j_f j_b}$. For the actual phase space sampling, we assume a Poisson distribution and extract the mean number of gluon emissions in different rapidity bins and fit the results to a linear function in $\Delta y_{j_f j_b}$, finding a coefficient of $0.975$ for the inclusive production of a Higgs boson with two jets. Here are the observed and fitted average gluon multiplicities as a function of $\Delta y_{j_f j_b}$: \begin{center} \includegraphics[width=.75\textwidth]{ng_mean} \end{center} As shown for two rapidity slices the assumption of a Poisson distribution is also a good approximation: \begin{center} \includegraphics[width=.49\textwidth]{{ng_1.5}.pdf}\hfill \includegraphics[width=.49\textwidth]{{ng_5.5}.pdf} \end{center} \subsubsection{Number of Gluons inside Jets} \label{sec:psp_ng_jet} For each of the $n_g$ gluon emissions we can split the phase-space integral into a (disconnected) region inside the jets and a remainder: \begin{equation} \label{eq:psp_split} \int [\mathrm{d}p_i] = \int [\mathrm{d}p_i]\, \theta\bigg(\sum_{j=1}^{m}{\cal J}_j(p_i)\bigg) + \int [\mathrm{d}p_i]\, \bigg[1-\theta\bigg(\sum_{j=1}^{m}{\cal J}_j(p_i)\bigg)\bigg]\,. \end{equation} The next step is to decide how many of the gluons will form part of a jet. This is done in the \lstinline!PhaseSpacePoint::sample_ng_jets! function. We choose an importance sampling which is flat in the plane spanned by the azimuthal angle $\phi$ and the rapidity $y$. This is observed in BFKL and valid in the limit of Multi-Regge-Kinematics (MRK). Furthermore, we assume anti-$k_t$ jets, which cover an area of $\pi R^2$. In principle, the total accessible area in the $y$-$\phi$ plane is given by $2\pi \Delta y_{fb}$, where $\Delta y_{fb}\geq \Delta y_{j_f j_b}$ is the a priori unknown rapidity separation between the most forward and backward partons. In most cases the extremal jets consist of single partons, so that $\Delta y_{fb} = \Delta y_{j_f j_b}$. For the less common case of two partons forming a jet we observe a maximum distance of $R$ between the constituents and the jet centre. In rare cases jets have more than two constituents. Empirically, they are always within a distance of $\tfrac{5}{3}R$ to the centre of the jet, so $\Delta y_{fb} \leq \Delta y_{j_f j_b} + \tfrac{10}{3} R$. In practice, the extremal partons are required to carry a large fraction of the jet transverse momentum and will therefore be much closer to the jet axis. In summary, for sufficiently large rapidity separations we can use the approximation $\Delta y_{fb} \approx \Delta y_{j_f j_b}$. This scenario is depicted here: \begin{center} \includegraphics[width=0.5\linewidth]{ps_large_y} \end{center} If there is no overlap between jets, the probability $p_{\cal J, >}$ for an extra gluon to end up inside a jet is then given by \begin{equation} \label{eq:p_J_large} p_{\cal J, >} = \frac{(m - 1)\*R^2}{2\Delta y_{j_f j_b}}\,. \end{equation} For a very small rapidity separation, eq.~\eqref{eq:p_J_large} obviously overestimates the true probability. The maximum phase space covered by jets in the limit of a vanishing rapidity distance between all partons is $2mR \Delta y_{fb}$: \begin{center} \includegraphics[width=0.5\linewidth]{ps_small_y} \end{center} We therefore estimate the probability for a parton to end up inside a jet as \begin{equation} \label{eq:p_J} p_{\cal J} = \min\bigg(\frac{(m - 1)\*R^2}{2\Delta y_{j_f j_b}}, \frac{mR}{\pi}\bigg)\,. \end{equation} Here we compare this estimate with the actually observed fraction of additional emissions into jets as a function of the rapidity separation: \begin{center} \includegraphics[width=0.75\linewidth]{pJ} \end{center} \subsubsection{Gluons outside Jets} \label{sec:gluons_nonjet} Using our estimate for the probability of a gluon to be a jet constituent, we choose a number $n_{g,{\cal J}}$ of gluons inside jets, which also fixes the number $n_g - n_{g,{\cal J}}$ of gluons outside jets. As explained later on, we need to generate the momenta of the gluons outside jets first. This is done in \lstinline!PhaseSpacePoint::gen_non_jet!. The azimuthal angle $\phi$ is generated flat within $0\leq \phi \leq 2 \pi$. The allowed rapidity interval is set by the most forward and backward partons, which are necessarily inside jets. Since these parton rapidities are not known at this point, we also have to postpone the rapidity generation for the gluons outside jets. For the scalar transverse momentum $p_\perp = |\mathbf{p}_\perp|$ of a gluon outside jets we use the parametrisation \begin{equation} \label{eq:p_nonjet} p_\perp = \lambda + \tilde{p}_\perp\*\tan(\tau\*r)\,, \qquad \tau = \arctan\bigg(\frac{p_{\perp{\cal J}_\text{min}} - \lambda}{\tilde{p}_\perp}\bigg)\,. \end{equation} For $r \in [0,1)$, $p_\perp$ is always less than the minimum momentum $p_{\perp{\cal J}_\text{min}}$ required for a jet. $\tilde{p}_\perp$ is a free parameter, a good empirical value is $\tilde{p}_\perp = [1.3 + 0.2\*(n_g - n_{g,\cal J})]\,$GeV \subsubsection{Resummation jet momenta} \label{sec:ptj_res} On the one hand, each jet momentum is given by the sum of its constituent momenta. On the other hand, the resummation jet momenta are fixed by the constraints in line five of the master equation~\eqref{eq:resumdijetFKLmatched2}. We therefore have to calculate the resummation jet momenta from these constraints before generating the momenta of the gluons inside jets. This is done in \lstinline!PhaseSpacePoint::reshuffle! and in the free \lstinline!resummation_jet_momenta! function. The resummation jet momenta are determined by the $\delta$ functions in line five of eq.~(\ref{eq:resumdijetFKLmatched2}). The rapidities are fixed to the rapidities of the jets in the input fixed-order events, so -that the FKL ordering is guaranteed to be preserved. For the transverse -momentum components we currently use the traditional \HEJ reshuffling -relation +that the FKL ordering is guaranteed to be preserved. + +In traditional \HEJ reshuffling the transverse momentum are given through \begin{equation} - \label{eq:ptreassign} - \mathbf{p}^B_{\mathcal{J}_{l\perp}} = \mathbf{j}_{l\perp} \equiv \mathbf{p}_{\mathcal{J}_{l}\perp} + \mathbf{q}_\perp \, - \frac{|\mathbf{p}_{\mathcal{J}_{l}\perp}|}{P_\perp}, +\label{eq:ptreassign_old} +\mathbf{p}^B_{\mathcal{J}_{l\perp}} = \mathbf{j}_{l\perp} \equiv \mathbf{p}_{\mathcal{J}_{l}\perp} ++ \mathbf{q}_\perp \,\frac{|\mathbf{p}_{\mathcal{J}_{l}\perp}|}{P_\perp}, \end{equation} where $\mathbf{q}_\perp = \sum_{j=1}^n \mathbf{p}_{i\perp} \bigg[1-\theta\bigg(\sum_{j=1}^{m}{\cal J}_j(p_i)\bigg)\bigg] $ is the total transverse momentum of all partons \emph{outside} jets and $P_\perp = \sum_{j=1}^m |\mathbf{p}_{\mathcal{J}_{j}\perp}|$. Since the total transverse momentum of an event vanishes, we can also use $\mathbf{q}_\perp = - \sum_{j=1}^m \mathbf{p}_{\mathcal{J}_{j}\perp}$. Eq.~(\ref{eq:ptreassign}) is a non-linear system of equations in the resummation jet momenta -$\mathbf{p}_{\mathcal{J}_{l}\perp}$. To solve it we use -\href{https://www.gnu.org/software/gsl/}{GSL} routines. +$\mathbf{p}_{\mathcal{J}_{l}\perp}$. Hence we would have to solve +\begin{equation} +\label{eq:ptreassign_eq} +\mathbf{p}_{\mathcal{J}_{l}\perp}=\mathbf{j}^B_{l\perp} \equiv\mathbf{j}_{l\perp}^{-1} +\left(\mathbf{p}^B_{\mathcal{J}_{l\perp}}\right) +\end{equation} +numerically. + +Since solving such a system is computationally expensive, we instead +change the reshuffling around to be linear in the resummation jet +momenta. Hence~\eqref{eq:ptreassign_eq} gets replaces by +\begin{equation} +\label{eq:ptreassign} +\mathbf{p}_{\mathcal{J}_{l\perp}} = \mathbf{j}^B_{l\perp} \equiv \mathbf{p}^B_{\mathcal{J}_{l}\perp} +- \mathbf{q}_\perp \,\frac{|\mathbf{p}^B_{\mathcal{J}_{l}\perp}|}{P^B_\perp}, +\end{equation} +which is linear in the resummation momentum. Consequently the equivalent +of~\eqref{eq:ptreassign_old} is non-linear in the Born momentum. However +the exact form of~\eqref{eq:ptreassign_old} is not relevant for the resummation. +Both methods have been tested for two and three jets with the \textsc{rivet} +standard analysis \texttt{MC\_JETS}. They didn't show any differences even +after $10^9$ events. The reshuffling relation~\eqref{eq:ptreassign} allows the transverse momenta $p^B_{\mathcal{J}_{l\perp}}$ of the fixed-order jets to be somewhat below the minimum transverse momentum of resummation jets. It is crucial that this difference does not become too large, as the fixed-order cross section diverges for vanishing transverse momenta. In the production of a Higgs boson with resummation jets above $30\,$GeV we observe that the contribution from fixed-order events with jets softer than about $20\,$GeV can be safely neglected. This is shown in the following plot of the differential cross section over the transverse momentum of the softest fixed-order jet: \begin{center} \includegraphics[width=.75\textwidth]{ptBMin} \end{center} -Finally, to perform the integration over the resummation phase space, we -need the $\delta$ functions -$\delta^{(2)}(\mathbf{p}_{\mathcal{J}_{l}\perp}^B - -\mathbf{j}_{l\perp})$ form eq.~(\ref{eq:resumdijetFKLmatched2}) to be linear in the resummation parton momenta -instead of the fixed-order momenta. This introduces an extra Jacobian $\Delta$: + +Finally, we have to account for the fact that the reshuffling +relation~\eqref{eq:ptreassign} is non-linear in the Born momenta. To +arrive at the master formula~\eqref{eq:resumdijetFKLmatched2} for the +cross section, we have introduced unity in the form of an integral over +the Born momenta with $\delta$ functions in the integrand, that is +\begin{equation} + \label{eq:delta_intro} + 1 = \int_{p_{j\perp}^B=0}^{p_{j\perp}^B=\infty} + \mathrm{d}^2\mathbf{p}_{j\perp}^B\delta^{(2)}(\mathbf{p}_{\mathcal{J}_{j\perp}}^B - + \mathbf{j}_{j\perp})\,. +\end{equation} +If the arguments of the $\delta$ functions are not linear in the Born +momenta, we have to compensate with additional Jacobians as +factors. Explicitly, for the reshuffling relation~\eqref{eq:ptreassign} +we have \begin{equation} \label{eq:delta_rewrite} \prod_{l=1}^m \delta^{(2)}(\mathbf{p}_{\mathcal{J}_{l\perp}}^B - - \mathbf{j}_{l\perp}) = \frac{1}{\Delta} \prod_{l=1}^m \delta^{(2)}(\mathbf{p}_{\mathcal{J}_{l\perp}} - + \mathbf{j}_{l\perp}) = \Delta \prod_{l=1}^m \delta^{(2)}(\mathbf{p}_{\mathcal{J}_{l\perp}} - \mathbf{j}_{l\perp}^B)\,, \end{equation} -where $\mathbf{j}_{l\perp}^B$ only depends on the Born momenta. We have -extended the product to run to $m$ instead of $m-1$ by eliminating the -last $\delta$ function $\delta^{(2)}\!\!\left(\sum_{k=1}^n \mathbf{p}_{k\perp}\right )$. +where $\mathbf{j}_{l\perp}^B$ is given by~\eqref{eq:ptreassign_eq} and only +depends on the Born momenta. We have extended the product to run to $m$ +instead of $m-1$ by eliminating the last $\delta$ function +$\delta^{(2)}\!\!\left(\sum_{k=1}^n \mathbf{p}_{k\perp}\right )$. The Jacobian $\Delta$ is the determinant of a $2m \times 2m$ matrix with $l, l' = 1,\dots,m$ and $X, X' = x,y$. \begin{equation} \label{eq:jacobian} - \Delta = \bigg| \delta_{l l'} \delta_{X X'} + \frac{q_X\, p_{{\cal - J}_{l'}X'}}{|\mathbf{p}_{{\cal J}_{l'} \perp}| P_\perp}\bigg(\delta_{l l'} - - \frac{|\mathbf{p}_{{\cal J}_l \perp}|}{P_\perp}\bigg)\bigg|\,. + \Delta = \left|\frac{\partial\,\mathbf{j}^B_{l'\perp}}{\partial\, \mathbf{p}^B_{{\cal J}_l \perp}} \right| + = \left| \delta_{l l'} \delta_{X X'} - \frac{q_X\, p^B_{{\cal + J}_{l'}X'}}{\left|\mathbf{p}^B_{{\cal J}_{l'} \perp}\right| P^B_\perp}\left(\delta_{l l'} + - \frac{\left|\mathbf{p}^B_{{\cal J}_l \perp}\right|}{P^B_\perp}\right)\right|\,. \end{equation} +The Jacobian is calculated in \texttt{src/Jacobian.cc}. +\todo{Why is the Jacobian in its own header? Wouldn't it be nicer to have it +inside \texttt{resummation\_jet\_momenta.hh} and call it +\texttt{reshuffling\_weight}?} +Having to introduce this Jacobian is not a disadvantage specific to the new +reshuffling. If we instead use the old reshuffling +relation~\eqref{eq:ptreassign_old} we \emph{also} have to introduce a +similar Jacobian since we actually want to integrate over the +resummation phase space and need to transform the argument of the +$\delta$ function to be linear in the resummation momenta for this. \subsubsection{Gluons inside Jets} \label{sec:gluons_jet} After the steps outlined in section~\ref{sec:psp_ng_jet}, we have a total number of $m + n_{g,{\cal J}}$ constituents. In \lstinline!PhaseSpacePoint::distribute_jet_partons! we distribute them randomly among the jets such that each jet has at least one constituent. We then generate their momenta in \lstinline!PhaseSpacePoint::split! using the \lstinline!Splitter! class. The phase space integral for a jet ${\cal J}$ is given by \begin{equation} \label{eq:ps_jetparton} \prod_{i\text{ in }{\cal J}} \bigg(\int \mathrm{d}\mathbf{p}_{i\perp}\ \int \mathrm{d} y_i \bigg)\delta^{(2)}\Big(\sum_{i\text{ in }{\cal J}} \mathbf{p}_{i\perp} - \mathbf{j}_{\perp}^B\Big)\delta(y_{\mathcal{J}}-y^B_{\mathcal{J}})\,. \end{equation} For jets with a single constituent, the parton momentum is obiously equal to the jet momentum. In the case of two constituents, we observe that the partons are always inside the jet cone with radius $R$ and often very close to the jet centre. The following plots show the typical relative distance $\Delta R/R$ for this scenario: \begin{center} \includegraphics[width=0.45\linewidth]{dR_2} \includegraphics[width=0.45\linewidth]{dR_2_small} \end{center} According to this preference for small values of $\Delta R$, we parametrise the $\Delta R$ integrals as \begin{equation} \label{eq:dR_sampling} \frac{\Delta R}{R} = \begin{cases} 0.25\,x_R & x_R < 0.4 \\ 1.5\,x_R - 0.5 & x_R \geq 0.4 \end{cases}\,. \end{equation} Next, we generate $\Theta_1 \equiv \Theta$ and use the constraint $\Theta_2 = \Theta \pm \pi$. The transverse momentum of the first parton is then given by \begin{equation} \label{eq:delta_constraints} p_{1\perp} = \frac{p_{\mathcal{J} y} - \tan(\phi_2) p_{\mathcal{J} x}}{\sin(\phi_1) - \tan(\phi_2)\cos(\phi_1)}\,. \end{equation} We get $p_{2\perp}$ by exchanging $1 \leftrightarrow 2$ in the indices. To obtain the Jacobian of the transformation, we start from the single jet phase space eq.~(\ref{eq:ps_jetparton}) with the rapidity delta function already rewritten to be linear in the rapidity of the last parton, i.e. \begin{equation} \label{eq:jet_2p} \prod_{i=1,2} \bigg(\int \mathrm{d}\mathbf{p}_{i\perp}\ \int \mathrm{d} y_i \bigg)\delta^{(2)}\Big(\mathbf{p}_{1\perp} + \mathbf{p}_{2\perp} - \mathbf{j}_{\perp}^B\Big)\delta(y_2- \dots)\,. \end{equation} The integral over the second parton momentum is now trivial; we can just replace the integral over $y_2$ with the equivalent constraint \begin{equation} \label{eq:R2} \int \mathrm{d}R_2 \ \delta\bigg(R_2 - \bigg[\phi_{\cal J} - \arctan \bigg(\frac{p_{{\cal J}y} - p_{1y}}{p_{{\cal J}x} - p_{1x}}\bigg)\bigg]/\cos \Theta\bigg) \,. \end{equation} In order to fix the integral over $p_{1\perp}$ instead, we rewrite this $\delta$ function. This introduces the Jacobian \begin{equation} \label{eq:jac_pt1} \bigg|\frac{\partial p_{1\perp}}{\partial R_2} \bigg| = \frac{\cos(\Theta)\mathbf{p}_{2\perp}^2}{p_{{\cal J}\perp}\sin(\phi_{\cal J}-\phi_1)}\,. \end{equation} The final form of the integral over the two parton momenta is then \begin{equation} \label{eq:ps_jet_2p} \int \mathrm{d}R_1\ R_1 \int \mathrm{d}R_2 \int \mathrm{d}x_\Theta\ 2\pi \int \mathrm{d}p_{1\perp}\ p_{1\perp} \int \mathrm{d}p_{2\perp} \ \bigg|\frac{\partial p_{1\perp}}{\partial R_2} \bigg|\delta(p_{1\perp} -\dots) \delta(p_{2\perp} - \dots)\,. \end{equation} As is evident from section~\ref{sec:psp_ng_jet}, jets with three or more constituents are rare and an efficient phase-space sampling is less important. For such jets, we exploit the observation that partons with a distance larger than $R_{\text{max}} = \tfrac{5}{3} R$ to the jet centre are never clustered into the jet. Assuming $N$ constituents, we generate all components for the first $N-1$ partons and fix the remaining parton with the $\delta$-functional. In order to end up inside the jet, we use the parametrisation \begin{align} \label{eq:ps_jet_param} \phi_i ={}& \phi_{\cal J} + \Delta \phi_i\,, & \Delta \phi_i ={}& \Delta R_i \cos(\Theta_i)\,, \\ y_i ={}& y_{\cal J} + \Delta y_i\,, & \Delta y_i ={}& \Delta R_i \sin(\Theta_i)\,, \end{align} and generate $\Theta_i$ and $\Delta R_i$ randomly with $\Delta R_i \leq R_{\text{max}}$ and the empiric value $R_{\text{max}} = 5\*R/3$. We can then write the phase space integral for a single parton as $(p_\perp = |\mathbf{p}_\perp|)$ \begin{equation} \label{eq:ps_jetparton_x} \int \mathrm{d}\mathbf{p}_{\perp}\ \int \mathrm{d} y \approx \int_{\Box} \mathrm{d}x_{\perp} \mathrm{d}x_{ R} \mathrm{d}x_{\theta}\ 2\*\pi\,\*R_{\text{max}}^2\,\*x_{R}\,\*p_{\perp}\,\*(p_{\perp,\text{max}} - p_{\perp,\text{min}}) \end{equation} with \begin{align} \label{eq:ps_jetparton_parameters} \Delta \phi ={}& R_{\text{max}}\*x_{R}\*\cos(2\*\pi\*x_\theta)\,,& \Delta y ={}& R_{\text{max}}\*x_{R}\*\sin(2\*\pi\*x_\theta)\,, \\ p_{\perp} ={}& (p_{\perp,\text{max}} - p_{\perp,\text{min}})\*x_\perp + p_{\perp,\text{min}}\,. \end{align} $p_{\perp,\text{max}}$ is determined from the requirement that the total contribution from the first $n-1$ partons --- i.e. the projection onto the jet $p_{\perp}$ axis --- must never exceed the jet $p_\perp$. This gives \todo{This bound is too high} \begin{equation} \label{eq:pt_max} p_{i\perp,\text{max}} = \frac{p_{{\cal J}\perp} - \sum_{j`_. To get a copy of reversed HEJ, install git and run:: git clone https://gitlab.dur.scotgrid.ac.uk/hej/reversed_hej Prerequisites ------------- Before installing reversed HEJ, 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 `_ - `LHAPDF `_ -- `gsl `_ -- `Boost.IOStreams `_ +- The `IOStreams` and `uBLAS` `boost `_ libraries - `yaml-cpp `_ If you want to include finite top mass corrections in Higgs boson + jets production, you additionally need version 2 of the `QCDloop `_ library. Reversed HEJ supports versions 2 and 3 of `HepMC `_ if it is installed, but does not require it. Compilation ----------- To compile and install reversed HEJ run:: cmake source/directory -DCMAKE_INSTALL_PREFIX=target/directory -DCMAKE_BUILD_TYPE=Release make install :file:`source/directory` is the directory containing the file :file:`CMakeLists.txt`. If you omit :code:`-DCMAKE_INSTALL_PREFIX=target/directory` reversed HEJ 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. Testing ------- To test your installation, download the NNPDF 2.3 PDF set with:: lhapdf install NNPDF23_nlo_as_0119 and run:: make test diff --git a/include/RHEJ/Matrix.hh b/include/RHEJ/Matrix.hh deleted file mode 100644 index 306da42..0000000 --- a/include/RHEJ/Matrix.hh +++ /dev/null @@ -1,57 +0,0 @@ -/** \file - * \brief This header file contains the Matrix class - */ - -#pragma once - -#include // needed for size_t -#include - -#include - -namespace RHEJ{ - - - //! Class for matrices - class Matrix{ - public: - Matrix() = default; - //! Constructor - /** - * @param rows Number of rows - * @param columns Number of columns - */ - Matrix(size_t rows, size_t columns); - //! Access element in given row and column - double & operator()(size_t row, size_t column); - //! Access element in given row and column - double const & operator()(size_t row, size_t column) const; - - //! Get number of rows - size_t rows() const; - //! Get number of columns - size_t columns() const; - - Matrix(Matrix const & other); - Matrix(Matrix && other) noexcept; - - Matrix & operator=(Matrix const & other); - Matrix & operator=(Matrix && other) noexcept; - - ~Matrix(); - private: - gsl_matrix* m; - - friend double det(Matrix m); - friend void swap(Matrix & a, Matrix & b) noexcept; - }; - - //! Swap two matrices - void swap(Matrix & a, Matrix & b) noexcept; - - //! Compute the determinant - double det(Matrix m); - - //! Convert a matrix to a string - std::string to_string(Matrix const & m); -} diff --git a/include/RHEJ/MatrixElement.hh b/include/RHEJ/MatrixElement.hh index 7a3a0bf..d70102b 100644 --- a/include/RHEJ/MatrixElement.hh +++ b/include/RHEJ/MatrixElement.hh @@ -1,224 +1,225 @@ /** \file * \brief Contains the MatrixElement Class */ #pragma once #include #include "RHEJ/config.hh" #include "RHEJ/utility.hh" #include "RHEJ/HiggsCouplingSettings.hh" #include "CLHEP/Vector/LorentzVector.h" namespace RHEJ{ //! Class to calculate the squares of matrix elements class MatrixElement{ public: /** \brief MatrixElement Constructor * @param alpha_s Function taking the renormalisation scale * and returning the strong coupling constant * @param conf General matrix element settings */ MatrixElement( std::function alpha_s, MatrixElementConfig conf ); /** * \brief regulated HEJ matrix element * @param mur Value of the renormalisation scale * @param incoming Incoming particles * @param outgoing Outgoing particles * @param check_momenta Special treatment for partons inside extremal jets * @returns The HEJ matrix element including virtual corrections * * cf. eq. (22) in \cite Andersen:2011hs * Incoming particles should be ordered by ascending z momentum. * Outgoing particles should be ordered by ascending rapidity. * * \internal Relation to standard HEJ Met2: MatrixElement = Met2*shat^2/(pdfta*pdftb) */ double operator()( double mur, std::array const & incoming, std::vector const & outgoing, std::unordered_map> const & decays, bool check_momenta ) const; //! HEJ tree-level matrix element /** * @param mur Value of the renormalisation scale * @param incoming Incoming particles * @param outgoing Outgoing particles * @param check_momenta Special treatment for partons inside extremal jets * @returns The HEJ matrix element without virtual corrections * * cf. eq. (22) in \cite Andersen:2011hs * Incoming particles should be ordered by ascending z momentum. * Outgoing particles should be ordered by ascending rapidity. */ double tree( double mur, std::array const & incoming, std::vector const & outgoing, std::unordered_map> const & decays, bool check_momenta ) const; //! HEJ tree-level matrix element - parametric part /** * @param mur Value of the renormalisation scale * @param incoming Incoming particles * @param outgoing Outgoing particles * @returns The parametric part of the tree matrix element * * cf. eq. (22) in \cite Andersen:2011hs * * The tree level matrix element factorises into a parametric part * which depends on the theory parameters (alpha_s and scale) * and a kinematic part comprising the dependence on the particle momenta * and colour factors. This function returns the former. */ double tree_param( double mur, std::array const & incoming, std::vector const & outgoing ) const; //! HEJ tree-level matrix element - kinematic part /** * @param incoming Incoming particles * @param outgoing Outgoing particles * @param check_momenta Special treatment for partons inside extremal jets * @returns The kinematic part of the tree matrix element * * cf. eq. (22) in \cite Andersen:2011hs * Incoming particles should be ordered by ascending z momentum. * Outgoing particles should be ordered by ascending rapidity. * * The tree level matrix element factorises into a parametric part * which depends on the theory parameters (alpha_s and scale) * and a kinematic part comprising the dependence on the particle momenta * and colour factors. This function returns the latter. */ double tree_kin( std::array const & incoming, std::vector const & outgoing, std::unordered_map> const & decays, bool check_momenta ) const; /** * \brief Calculates the Virtual Corrections * @param mur Value of the renormalisation scale * @param in Incoming particles * @param out Outgoing particles * @returns The Virtual Corrections of the Matrix Element * * Incoming particles should be ordered by ascending z momentum. * Outgoing particles should be ordered by ascending rapidity. * * The all order virtual corrections to LL in the MRK limit is * given by replacing 1/t in the scattering amplitude according to the * lipatov ansatz. * * cf. second-to-last line of eq. (22) in \cite Andersen:2011hs * note that indices are off by one, i.e. out[0].p corresponds to p_1 */ double virtual_corrections( double mur, std::array const & in, std::vector const & out ) const; private: //! \internal cf. last line of eq. (22) in \cite Andersen:2011hs double omega0( double alpha_s, double mur, fastjet::PseudoJet const & q_j, double lambda ) const; double tree_kin_jets( std::array const & incoming, std::vector partons, bool check_momenta ) const; double tree_kin_W( std::array const & incoming, std::vector const & outgoing, std::unordered_map> const & decays, bool WPlus, bool check_momenta ) const; double tree_kin_W_FKL( std::array const & incoming, std::vector const & outgoing, std::unordered_map> const & decays, bool WPlus, bool check_momenta ) const; double tree_kin_Higgs( std::array const & incoming, std::vector const & outgoing, bool check_momenta ) const; double tree_kin_Higgs_first( std::array const & incoming, std::vector const & outgoing, bool check_momenta ) const; double tree_kin_Higgs_last( std::array const & incoming, std::vector const & outgoing, bool check_momenta ) const; /** * \internal * \brief Higgs inbetween extremal partons. * * Note that in the case of unordered emission, the Higgs is *always* * treated as if in between the extremal (FKL) partons, even if its * rapidity is outside the extremal parton rapidities */ double tree_kin_Higgs_between( std::array const & incoming, std::vector const & outgoing, bool check_momenta ) const; double tree_param_partons( double alpha_s, double mur, std::vector const & partons ) const; std::vector in_extremal_jet_indices( std::vector const & partons ) const; std::vector tag_extremal_jet_partons( std::array const & incoming, std::vector out_partons, bool check_momenta ) const; double MH2_forwardH( CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, + pid::ParticleID type2, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector pH, double t1, double t2 ) const; std::function alpha_s_; MatrixElementConfig param_; }; } diff --git a/include/RHEJ/currents.hh b/include/RHEJ/currents.hh index 435650e..2f5eee1 100644 --- a/include/RHEJ/currents.hh +++ b/include/RHEJ/currents.hh @@ -1,1324 +1,1339 @@ ////////////////////////////////////////////////// ////////////////////////////////////////////////// // This source code is Copyright (2012) of // // Jeppe R. Andersen and Jennifer M. Smillie // // and is distributed under the // // Gnu Public License version 2 // // http://www.gnu.org/licenses/gpl-2.0.html // // You are allowed to distribute and alter the // // source under the conditions of the GPLv2 // // as long as this copyright notice // // is unaltered and distributed with the source // // Any use should comply with the // // MCNET GUIDELINES // // for Event Generator Authors and Users // // as distributed with this source code // ////////////////////////////////////////////////// ////////////////////////////////////////////////// /** \file * \brief Functions computing the square of current contractions. * * This file contains all the necessary functions to compute the current * contractions for all valid HEJ processes. PJETS, H+JETS and W+JETS along with * some unordered counterparts. */ #pragma once #include #include #include #include #include +#include "RHEJ/Constants.hh" + ///TODO add a namespace typedef std::complex COM; typedef COM current[4]; typedef CLHEP::HepLorentzVector HLV; //! The Higgs field vacuum expectation value in GeV static constexpr double v = 246.; constexpr double infinity = std::numeric_limits::infinity(); constexpr double mb_default = 4.7; void Setup_Currents(void); //! Square of qQ->qenuQ W+Jets Scattering Current /** * @param p1out Momentum of final state quark * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @returns Square of the current contractions for qQ->qenuQ Scattering * * This returns the square of the current contractions in qQ->qenuQ scattering * with an emission of a W Boson. */ double jMWqQ (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! Square of qbarQ->qbarenuQ W+Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @returns Square of the current contractions for qbarQ->qbarenuQ Scattering * * This returns the square of the current contractions in qbarQ->qbarenuQ scattering * with an emission of a W Boson. */ double jMWqbarQ (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! Square of qQbar->qenuQbar W+Jets Scattering Current /** * @param p1out Momentum of final state quark * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @returns Square of the current contractions for qQbar->qenuQbar Scattering * * This returns the square of the current contractions in qQbar->qenuQbar scattering * with an emission of a W Boson. */ double jMWqQbar (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! Square of qbarQbar->qbarenuQbar W+Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @returns Square of the current contractions for qbarQbar->qbarenuQbar Scattering * * This returns the square of the current contractions in qbarQbar->qbarenuQbar scattering * with an emission of a W Boson. */ double jMWqbarQbar (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! Square of qg->qenug W+Jets Scattering Current /** * @param p1out Momentum of final state quark * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @returns Square of the current contractions for qg->qenug Scattering * * This returns the square of the current contractions in qg->qenug scattering * with an emission of a W Boson. */ double jMWqg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! Square of qbarg->qbarenug W+Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @returns Square of the current contractions for qbarg->qbarenug Scattering * * This returns the square of the current contractions in qbarg->qbarenug scattering * with an emission of a W Boson. */ double jMWqbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); // W+Jets Unordered Functions //! qQg Wjets Unordered backwards opposite leg to W /** * @param p1out Momentum of final state quark a * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state quark b * @param p2in Momentum of intial state quark b * @param pg Momentum of final state unordered gluon * @returns Square of the current contractions for qQ->qQg Scattering * * This returns the square of the current contractions in qQg->qQg scattering * with an emission of a W Boson. */ double junobMWqQg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector pg); //! qbarQg Wjets Unordered backwards opposite leg to W /** * @param p1out Momentum of final state anti-quark a * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state quark b * @param p2in Momentum of intial state quark b * @param pg Momentum of final state unordered gluon * @returns Square of the current contractions for qbarQ->qbarQg Scattering * * This returns the square of the current contractions in qbarQg->qbarQg scattering * with an emission of a W Boson. */ double junobMWqbarQg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector pg); //! qQbarg Wjets Unordered backwards opposite leg to W /** * @param p1out Momentum of final state quark a * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state anti-quark b * @param p2in Momentum of intial state anti-quark b * @param pg Momentum of final state unordered gluon * @returns Square of the current contractions for qQbar->qQbarg Scattering * * This returns the square of the current contractions in qQbarg->qQbarg scattering * with an emission of a W Boson. */ double junobMWqQbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector pg); //! qbarQbarg Wjets Unordered backwards opposite leg to W /** * @param p1out Momentum of final state anti-quark a * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state anti-quark b * @param p2in Momentum of intial state anti-quark b * @param pg Momentum of final state unordered gluon * @returns Square of the current contractions for qbarQbar->qbarQbarg Scattering * * This returns the square of the current contractions in qbarQbarg->qbarQbarg scattering * with an emission of a W Boson. */ double junobMWqbarQbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector pg); //!Wjets Unordered forwards opposite leg to W /** * @param pg Momentum of final state unordered gluon * @param p1out Momentum of final state quark a * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state quark b * @param p2in Momentum of intial state quark b * @returns Square of the current contractions for qQ->gqQ Scattering * * This returns the square of the current contractions in qQg->gqQ scattering * with an emission of a W Boson. */ double junofMWgqQ (CLHEP::HepLorentzVector pg,CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p2in); //!Wjets Unordered forwards opposite leg to W /** * @param pg Momentum of final state unordered gluon * @param p1out Momentum of final state anti-quark a * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state quark b * @param p2in Momentum of intial state quark b * @returns Square of the current contractions for qbarQ->gqbarQ Scattering * * This returns the square of the current contractions in qbarQg->gqbarQ scattering * with an emission of a W Boson. */ double junofMWgqbarQ (CLHEP::HepLorentzVector pg,CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p2in); //!Wjets Unordered forwards opposite leg to W /** * @param pg Momentum of final state unordered gluon * @param p1out Momentum of final state quark a * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state anti-quark b * @param p2in Momentum of intial state anti-quark b * @returns Square of the current contractions for qQbar->gqQbar Scattering * * This returns the square of the current contractions in qQbarg->gqQbar scattering * with an emission of a W Boson. */ double junofMWgqQbar (CLHEP::HepLorentzVector pg,CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p2in); //!Wjets Unordered forwards opposite leg to W /** * @param pg Momentum of final state unordered gluon * @param p1out Momentum of final state anti-quark a * @param pe Momentum of final state electron * @param pnu Momentum of final state Neutrino * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state anti-quark b * @param p2in Momentum of intial state anti-quark b * @returns Square of the current contractions for qbarQbar->gqbarQbar Scattering * * This returns the square of the current contractions in qbarQbarg->gqbarQbar scattering * with an emission of a W Boson. */ double junofMWgqbarQbar (CLHEP::HepLorentzVector pg,CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p2in); //!W+uno same leg /** * @param pg Momentum of final state unordered gluon * @param p1out Momentum of final state quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state quark b * @param p2in Momentum of intial state quark b * @returns Square of the current contractions for qQ->qQg Scattering * * This returns the square of the current contractions in gqQ->gqQ scattering * with an emission of a W Boson. */ double jM2WunogqQ(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! TODO: What does this function do? Crossed contribution is Exqqx..? /** * @param pg Momentum of final state unordered gluon * @param p1out Momentum of final state quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state quark b * @param p2in Momentum of intial state quark b * @returns Square of the current contractions for qQ->gqQ Scattering * * This returns the square of the current contractions in gqQ->gqQ scattering * with an emission of a W Boson. */ double jM2WunogqQ_crossqQ(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! W+uno same leg. quark anti-quark /** * @param pg Momentum of final state unordered gluon * @param p1out Momentum of final state quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state anti-quark b * @param p2in Momentum of intial state anti-quark b * @returns Square of the current contractions for qQbar->gqQbar Scattering * * This returns the square of the current contractions in gqQbar->gqQbar scattering * with an emission of a W Boson. (Unordered Same Leg) */ double jM2WunogqQbar(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! W+uno same leg. quark gluon /** * @param pg Momentum of final state unordered gluon * @param p1out Momentum of final state quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param p1in Momentum of initial state quark a * @param p2out Momentum of final state gluon b * @param p2in Momentum of intial state gluon b * @returns Square of the current contractions for qg->gqg Scattering * * This returns the square of the current contractions in qg->gqg scattering * with an emission of a W Boson. */ double jM2Wunogqg(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! W+uno same leg. anti-quark quark /** * @param pg Momentum of final state unordered gluon * @param p1out Momentum of final state anti-quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state quark b * @param p2in Momentum of intial state quark b * @returns Square of the current contractions for qbarQ->gqbarQ Scattering * * This returns the square of the current contractions in qbarQ->gqbarQ scattering * with an emission of a W Boson. */ double jM2WunogqbarQ(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! W+uno same leg. anti-quark anti-quark /** * @param pg Momentum of final state unordered gluon * @param p1out Momentum of final state anti-quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state anti-quark b * @param p2in Momentum of intial state anti-quark b * @returns Square of the current contractions for qbarQbar->gqbarQbar Scattering * * This returns the square of the current contractions in gqbarQbar->qbarQbar scattering * with an emission of a W Boson. */ double jM2WunogqbarQbar(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! W+uno same leg. anti-quark gluon /** * @param pg Momentum of final state unordered gluon * @param p1out Momentum of final state anti-quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param p1in Momentum of initial state anti-quark a * @param p2out Momentum of final state gluon b * @param p2in Momentum of intial state gluon b * @returns Square of the current contractions for ->gqbarg Scattering * * This returns the square of the current contractions in qbarg->gqbarg scattering * with an emission of a W Boson. */ double jM2Wunogqbarg(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //W+Jets qqxExtremal //! W+Extremal qqx. qxqQ /** * @param pgin Momentum of initial state gluon * @param pqout Momentum of final state quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param pqbarout Momentum of final state anti-quark a * @param p2out Momentum of initial state anti-quark b * @param p2in Momentum of final state gluon b * @returns Square of the current contractions for ->qbarqQ Scattering * * Calculates the square of the current contractions with extremal qqbar pair * production. This is calculated through the use of crossing symmetry. */ double jM2WgQtoqbarqQ(CLHEP::HepLorentzVector pgin, CLHEP::HepLorentzVector pqout,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector pqbarout, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //W+Jets qqxExtremal //! W+Extremal qqx. qqxQ /** * @param pgin Momentum of initial state gluon * @param pqout Momentum of final state quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param pqbarout Momentum of final state anti-quark a * @param p2out Momentum of initial state anti-quark b * @param p2in Momentum of final state gluon b * @returns Square of the current contractions for ->qqbarQ Scattering * * Calculates the square of the current contractions with extremal qqbar pair * production. This is calculated through the use of crossing symmetry. */ double jM2WgQtoqqbarQ(CLHEP::HepLorentzVector pgin, CLHEP::HepLorentzVector pqout,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector pqbarout, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //W+Jets qqxExtremal //! W+Extremal qqx. gg->qxqg /** * @param pgin Momentum of initial state gluon * @param pqout Momentum of final state quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param pqbarout Momentum of final state anti-quark a * @param p2out Momentum of initial state gluon b * @param p2in Momentum of final state gluon b * @returns Square of the current contractions for gg->qbarqg Scattering * * Calculates the square of the current contractions with extremal qqbar pair * production. This is calculated through the use of crossing symmetry. */ double jM2Wggtoqbarqg(CLHEP::HepLorentzVector pgin, CLHEP::HepLorentzVector pqout,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector pqbarout, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //W+Jets qqxExtremal //! W+Extremal qqx. gg->qqxg /** * @param pgin Momentum of initial state gluon * @param pqout Momentum of final state quark a * @param plbar Momentum of final state anti-lepton * @param pl Momentum of final state lepton * @param pqbarout Momentum of final state anti-quark a * @param p2out Momentum of initial state gluon a * @param p2in Momentum of final state gluon b * @returns Square of the current contractions for gg->qqbarg Scattering * * Calculates the square of the current contractions with extremal qqbar pair * production. This is calculated through the use of crossing symmetry. */ double jM2Wggtoqqbarg(CLHEP::HepLorentzVector pgin, CLHEP::HepLorentzVector pqbarout,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector pqout, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! W+Jets qqxCentral. qqx W emission. /** * @param pa Momentum of initial state particle a * @param pb Momentum of initial state particle b * @param pl Momentum of final state lepton * @param plbar Momentum of final state anti-lepton * @param partons Vector of outgoing parton momenta * @param aqlinepa Bool: True= pa is anti-quark * @param aqlinepb Bool: True= pb is anti-quark * @param qqxmarker Bool: Ordering of the qqbar pair produced (qqx vs qxq) * @param nabove Number of lipatov vertices "above" qqbar pair * @param nbelow Number of lipatov vertices "below" qqbar pair * @returns Square of the current contractions for qq>qQQbarWq Scattering * * Calculates the square of the current contractions with extremal qqbar pair * production. This is calculated through the use of crossing symmetry. */ double jM2WqqtoqQQq(HLV pa, HLV pb,HLV pl,HLV plbar, std::vector partons, bool aqlinepa, bool aqlinepb, bool qqxmarker, int nabove, int nbelow); //Doing //emission from backwards leg //! W+Jets qqxCentral. W emission from backwards leg. /** * @param ka HLV: Momentum of initial state particle a * @param kb HLV: Momentum of initial state particle b * @param pl HLV: Momentum of final state lepton * @param plbar HLV: Momentum of final state anti-lepton * @param partons Vector(HLV): outgoing parton momenta * @param aqlinepa Bool: True= pa is anti-quark * @param aqlinepb Bool: True= pb is anti-quark * @param qqxmarker Bool: Ordering of the qqbar pair produced (qqx vs qxq) * @param nabove Int: Number of lipatov vertices "above" qqbar pair * @param nbelow Int: Number of lipatov vertices "below" qqbar pair * @param forwards Bool: Swap to emission off front leg TODO:remove so args can be const * @returns Square of the current contractions for qq>qQQbarWq Scattering * * Calculates the square of the current contractions with extremal qqbar pair * production. This is calculated through the use of crossing symmetry. */ double jM2WqqtoqQQqW(HLV ka, HLV kb,HLV pl,HLV plbar, std::vector partons, bool aqlinepa, bool aqlinepb, bool qqxmarker, int nabove, int nbelow, bool forwards); //Doing //! Square of qQ->qQ Pure Jets Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @returns Square of the current contractions for qQ->qQ Scattering * * This returns the square of the current contractions in qQ->qQ Pure Jet Scattering. */ double jM2qQ (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! Square of qQbar->qQbar Pure Jets Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @returns Square of the current contractions for qQbar->qQbar Scattering * * This returns the square of the current contractions in qQbar->qQbar Pure Jet Scattering. * Note this can be used for qbarQ->qbarQ Scattering by inputting arguments appropriately. */ double jM2qQbar (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! Square of qbarQbar->qbarQbar Pure Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @returns Square of the current contractions for qbarQbar->qbarQbar Scattering * * This returns the square of the current contractions in qbarQbar->qbarQbar Pure Jet Scattering. */ double jM2qbarQbar (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! Square of qg->qg Pure Jets Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @returns Square of the current contractions for qg->qg Scattering * * This returns the square of the current contractions in qg->qg Pure Jet Scattering. * Note this can be used for gq->gq Scattering by inputting arguments appropriately. */ double jM2qg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! Square of qbarg->qbarg Pure Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @returns Square of the current contractions for qbarg->qbarg Scattering * * This returns the square of the current contractions in qbarg->qbarg Pure Jet Scattering. * Note this can be used for gqbar->gqbar Scattering by inputting arguments appropriately. */ double jM2qbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! Square of gg->gg Pure Jets Scattering Current /** * @param p1out Momentum of final state gluon * @param p1in Momentum of initial state gluon * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @returns Square of the current contractions for gg->gg Scattering * * This returns the square of the current contractions in gg->gg Pure Jet Scattering. */ double jM2gg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in); //! Square of gg->gg Higgs+Jets Scattering Current /** * @param p1out Momentum of final state gluon * @param p1in Momentum of initial state gluon * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for gg->gg Scattering * * This returns the square of the current contractions in gg->gg Higgs+Jet Scattering. * * g~p1 g~p2 * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if g is backward, q1 is forward) */ double MH2gg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of gq->gq Higgs+Jets Scattering Current with Higgs before Gluon /** * @param p1out Momentum of final state gluon * @param p1in Momentum of initial state gluon * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @param pH Momentum of Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contraction * */ double MH2gq_outsideH(CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector pH, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qg->qg Higgs+Jets Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qg->qg Scattering * * This returns the square of the current contractions in qg->qg Higgs+Jet Scattering. * * q~p1 g~p2 (i.e. ALWAYS p1 for quark, p2 for gluon) * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if g is backward, q1 is forward) */ double MH2qg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qbarg->qbarg Higgs+Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarg->qbarg Scattering * * This returns the square of the current contractions in qbarg->qbarg Higgs+Jet Scattering. * * qbar~p1 g~p2 (i.e. ALWAYS p1 for anti-quark, p2 for gluon) * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if g is backward, q1 is forward) */ double MH2qbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qQ->qQ Higgs+Jets Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qQ->qQ Scattering * * This returns the square of the current contractions in qQ->qQ Higgs+Jet Scattering. * * q~p1 Q~p2 (i.e. ALWAYS p1 for quark, p2 for quark) * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if Q is backward, q1 is forward) */ double MH2qQ (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qQbar->qQbar Higgs+Jets Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qQ->qQ Scattering * * This returns the square of the current contractions in qQbar->qQbar Higgs+Jet Scattering. * * q~p1 Qbar~p2 (i.e. ALWAYS p1 for quark, p2 for anti-quark) * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if Qbar is backward, q1 is forward) */ double MH2qQbar (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qbarQ->qbarQ Higgs+Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarQ->qbarQ Scattering * * This returns the square of the current contractions in qbarQ->qbarQ Higgs+Jet Scattering. * * qbar~p1 Q~p2 (i.e. ALWAYS p1 for anti-quark, p2 for quark) * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if Q is backward, q1 is forward) */ double MH2qbarQ (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qbarQbar->qbarQbar Higgs+Jets Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param q1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarQbar->qbarQbar Scattering * * This returns the square of the current contractions in qbarQbar->qbarQbar Higgs+Jet Scattering. * * qbar~p1 Qbar~p2 (i.e. ALWAYS p1 for anti-quark, p2 for anti-quark) * should be called with q1 meant to be contracted with p2 in first part of vertex * (i.e. if Qbar is backward, q1 is forward) */ double MH2qbarQbar (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); // Unordered f //! Square of qQ->gqQ Higgs+Jets Unordered f Scattering Current /** * @param pg Momentum of unordered gluon * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qQ->gqQ Scattering * * This returns the square of the current contractions in qQ->gqQ Higgs+Jet Scattering. * * This construction is taking rapidity order: pg > p1out >> p2out */ double jM2unogqHQ (CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qQbar->gqQbar Higgs+Jets Unordered f Scattering Current /** * @param pg Momentum of unordered gluon * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qQbar->gqQbar Scattering * * This returns the square of the current contractions in qQbar->gqQbar Higgs+Jet Scattering. * * This construction is taking rapidity order: pg > p1out >> p2out */ double jM2unogqHQbar (CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qbarQ->gqbarQ Higgs+Jets Unordered f Scattering Current /** * @param pg Momentum of unordered gluon * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarQ->gqbarQ Scattering * * This returns the square of the current contractions in qbarQ->gqbarQ Higgs+Jet Scattering. * * This construction is taking rapidity order: pg > p1out >> p2out */ double jM2unogqbarHQ (CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qbarQbar->gqbarQbar Higgs+Jets Unordered f Scattering Current /** * @param pg Momentum of unordered gluon * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarQbar->gqbarQbar Scattering * * This returns the square of the current contractions in qbarQbar->gqbarQbar Higgs+Jet Scattering. * * This construction is taking rapidity order: pg > p1out >> p2out */ double jM2unogqbarHQbar (CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qg->gqg Higgs+Jets Unordered f Scattering Current /** * @param pg Momentum of unordered gluon * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qg->gqg Scattering * * This returns the square of the current contractions in qg->gqg Higgs+Jet Scattering. * * This construction is taking rapidity order: pg > p1out >> p2out */ double jM2unogqHg (CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qbarg->gqbarg Higgs+Jets Unordered f Scattering Current /** * @param pg Momentum of unordered gluon * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param p2out Momentum of final state gluon * @param p2in Momentum of intial state gluon * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarg->gbarg Scattering * * This returns the square of the current contractions in qbarg->gqbarg Higgs+Jet Scattering. * * This construction is taking rapidity order: pg > p1out >> p2out */ double jM2unogqbarHg (CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //Unordered b //! Square of qbarQ->qbarQg Higgs+Jets Unordered b Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param pg Momentum of unordered b gluon * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarQ->qbarQg Scattering * * This returns the square of the current contractions in qbarQ->qbarQg Higgs+Jet Scattering. * * This construction is taking rapidity order: p1out >> p2out > pg */ double jM2unobqbarHQg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qQ->qQg Higgs+Jets Unordered b Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param pg Momentum of unordered b gluon * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qQ->qQg Scattering * * This returns the square of the current contractions in qQ->qQg Higgs+Jet Scattering. * * This construction is taking rapidity order: p1out >> p2out > pg */ double jM2unobqHQg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qQbar->qQbarg Higgs+Jets Unordered b Scattering Current /** * @param p1out Momentum of final state quark * @param p1in Momentum of initial state quark * @param pg Momentum of unordered b gluon * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qQbar->qQbarg Scattering * * This returns the square of the current contractions in qQbar->qQbarg Higgs+Jet Scattering. * * This construction is taking rapidity order: p1out >> p2out > pg */ double jM2unobqHQbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of qbarQbar->qbarQbarg Higgs+Jets Unordered b Scattering Current /** * @param p1out Momentum of final state anti-quark * @param p1in Momentum of initial state anti-quark * @param pg Momentum of unordered b gluon * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for qbarQbar->qbarQbarg Scattering * * This returns the square of the current contractions in qbarQbar->qbarQbarg Higgs+Jet Scattering. * * This construction is taking rapidity order: p1out >> p2out > pg */ double jM2unobqbarHQbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of gQbar->gQbarg Higgs+Jets Unordered b Scattering Current /** * @param p1out Momentum of final state gluon * @param p1in Momentum of initial state gluon * @param pg Momentum of unordered b gluon * @param p2out Momentum of final state anti-quark * @param p2in Momentum of intial state anti-quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for gQbar->gQbarg Scattering * * This returns the square of the current contractions in gQbar->gQbarg Higgs+Jet Scattering. * * This construction is taking rapidity order: p1out >> p2out > pg */ double jM2unobgHQbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); //! Square of gQ->gQg Higgs+Jets Unordered b Scattering Current /** * @param p1out Momentum of final state gluon * @param p1in Momentum of initial state gluon * @param pg Momentum of unordered b gluon * @param p2out Momentum of final state quark * @param p2in Momentum of intial state quark * @param qH1 Momentum of t-channel propagator before Higgs * @param qH2 Momentum of t-channel propagator after Higgs * @param mt Top quark mass * @param include_bottom Specifies whether bottom corrections are included * @param mb Bottom quark mass * @returns Square of the current contractions for gQ->gQg Scattering * * This returns the square of the current contractions in gQ->gQg Higgs+Jet Scattering. * * This construction is taking rapidity order: p1out >> p2out > pg */ double jM2unobgHQg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt = infinity, bool include_bottom = false, double mb = mb_default); // impact factors for Higgs + jet //! Implements Eq. (4.22) in hep-ph/0301013 with modifications to incoming plus momenta /** * @param p2 Momentum of Particle 2 * @param p1 Momentum of Particle 1 * @param pH Momentum of Higgs * @returns Value of Eq. (4.22) in Hep-ph/0301013 with modifications * * This gives the impact factor. First it determines first whether this is the case * p1p\sim php>>p3p or the opposite */ double C2gHgm(CLHEP::HepLorentzVector p2, CLHEP::HepLorentzVector p1, CLHEP::HepLorentzVector pH); //! Implements Eq. (4.23) in hep-ph/0301013 with modifications to incoming plus momenta /** * @param p2 Momentum of Particle 2 * @param p1 Momentum of Particle 1 * @param pH Momentum of Higgs * @returns Value of Eq. (4.23) in Hep-ph/0301013 * * This gives the impact factor. First it determines first whether this is the case * p1p\sim php>>p3p or the opposite */ double C2gHgp(CLHEP::HepLorentzVector p2, CLHEP::HepLorentzVector p1, CLHEP::HepLorentzVector pH); //! Implements Eq. (4.22) in hep-ph/0301013 /** * @param p2 Momentum of Particle 2 * @param p1 Momentum of Particle 1 * @param pH Momentum of Higgs * @returns Value of Eq. (4.22) in Hep-ph/0301013 * * This gives the impact factor. First it determines first whether this is the case * p1p\sim php>>p3p or the opposite */ double C2qHqm(CLHEP::HepLorentzVector p2, CLHEP::HepLorentzVector p1, CLHEP::HepLorentzVector pH); /** \class CCurrent currents.hh "include/RHEJ/currents.hh" * \brief This is the a new class structure for currents. */ class CCurrent { public: CCurrent(COM sc0, COM sc1, COM sc2, COM sc3) :c0(sc0),c1(sc1),c2(sc2),c3(sc3) {}; CCurrent(const CLHEP::HepLorentzVector p) { c0=p.e(); c1=p.px(); c2=p.py(); c3=p.pz(); }; CCurrent() {}; CCurrent operator+(const CCurrent& other); CCurrent operator-(const CCurrent& other); CCurrent operator*(const double x); CCurrent operator*(const COM x); CCurrent operator/(const double x); CCurrent operator/(const COM x); friend std::ostream& operator<<(std::ostream& os, const CCurrent& cur); COM dot(CLHEP::HepLorentzVector p1); COM dot(CCurrent p1); COM c0,c1,c2,c3; private: }; /* std::ostream& operator <<(std::ostream& os, const CCurrent& cur); */ CCurrent operator * ( double x, CCurrent& m); CCurrent operator * ( COM x, CCurrent& m); CCurrent operator / ( double x, CCurrent& m); CCurrent operator / ( COM x, CCurrent& m); //! Current ??? /** * These functions are a mess. There are many more defined in the source file than declared in the * header - and the arguments are mislabelled in some cases. Need to investigate. */ void j (CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector pin, bool helin,current &cur); //! Current ??? /** * These functions are a mess. There are many more defined in the source file than declared in the * header - and the arguments are mislabelled in some cases. Need to investigate. */ void jio(HLV pin, bool helin, HLV pout, bool helout, current &cur); //! Current ??? /** * These functions are a mess. There are many more defined in the source file than declared in the * header - and the arguments are mislabelled in some cases. Need to investigate. */ void joo(HLV pi, bool heli, HLV pj, bool helj, current &cur); //! Current ??? /** * These functions are a mess. There are many more defined in the source file than declared in the * header - and the arguments are mislabelled in some cases. Need to investigate. */ CCurrent j (CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector pin, bool helin); //! Current /** * These functions are a mess. There are many more defined in the source file than declared in the * header - and the arguments are mislabelled in some cases. Need to investigate. */ CCurrent jio (CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector pin, bool helin); //! Current /** * These functions are a mess. There are many more defined in the source file than declared in the * header - and the arguments are mislabelled in some cases. Need to investigate. */ CCurrent joo (CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector pin, bool helin); /* // Coupling values */ /* const double stw2 = 0.2222; */ /* const double ctw = sqrt(1.0 - stw2); */ /* const double gs = 1.217716; */ /* const double gw = 0.653232911; */ /* const double Zem = (-1.0 / 2.0 + stw2) / ctw; */ /* const double Zep = stw2 / ctw; */ /* const double Zum = ( 1.0 / 2.0 - 2.0 * stw2 / 3.0) / ctw; */ /* const double Zup = - 2.0 * stw2 / 3.0 / ctw; */ /* const double Zdm = (-1.0 / 2.0 + 1.0 / 3.0 * stw2) / ctw; */ /* const double Zdp = stw2 / 3.0 / ctw; */ /* const double RWeak = -pow(gw, 2.0); */ /* const double Strong = pow(gs, 4.0); */ /* const double ee = pow(gw, 2.0) * stw2; */ /* std::vector jMZqQ (HLV, HLV, HLV, HLV, HLV, HLV, std::vector , std::vector < std::vector >, int, int, bool, bool); */ /* std::vector jMZqg (HLV, HLV, HLV, HLV, HLV, HLV, std::vector , std::vector < std::vector >, int, int, bool, bool); */ /* void jZ (HLV, HLV, HLV, HLV, bool, bool, current); */ /* void jZbar (HLV, HLV, HLV, HLV, bool, bool, current); */ /* COM PZ(double); */ /* double Zq (int, bool); */ /* double Gq (int); */ inline COM cdot(const current & j1, const current & j2) { return j1[0]*j2[0]-j1[1]*j2[1]-j1[2]*j2[2]-j1[3]*j2[3]; } inline COM cdot(const HLV & p, const current & j1) { return j1[0]*p.e()-j1[1]*p.x()-j1[2]*p.y()-j1[3]*p.z(); } inline void cmult(const COM & factor, const current & j1, current &cur) { cur[0]=factor*j1[0]; cur[1]=factor*j1[1]; cur[2]=factor*j1[2]; cur[3]=factor*j1[3]; } // WHY!?! inline void cadd(const current & j1, const current & j2, const current & j3, const current & j4, const current & j5, current &sum) { sum[0]=j1[0]+j2[0]+j3[0]+j4[0]+j5[0]; sum[1]=j1[1]+j2[1]+j3[1]+j4[1]+j5[1]; sum[2]=j1[2]+j2[2]+j3[2]+j4[2]+j5[2]; sum[3]=j1[3]+j2[3]+j3[3]+j4[3]+j5[3]; } inline void cadd(const current & j1, const current & j2, const current & j3, const current & j4, current &sum) { sum[0] = j1[0] + j2[0] + j3[0] + j4[0]; sum[1] = j1[1] + j2[1] + j3[1] + j4[1]; sum[2] = j1[2] + j2[2] + j3[2] + j4[2]; sum[3] = j1[3] + j2[3] + j3[3] + j4[3]; } inline void cadd(const current & j1, const current & j2, const current & j3, current &sum) { sum[0]=j1[0]+j2[0]+j3[0]; sum[1]=j1[1]+j2[1]+j3[1]; sum[2]=j1[2]+j2[2]+j3[2]; sum[3]=j1[3]+j2[3]+j3[3]; } inline void cadd(const current & j1, const current & j2, current &sum) { sum[0]=j1[0]+j2[0]; sum[1]=j1[1]+j2[1]; sum[2]=j1[2]+j2[2]; sum[3]=j1[3]+j2[3]; } inline double abs2(const COM & a) { return (a*conj(a)).real(); } inline double vabs2(const CCurrent & cur) { return abs2(cur.c0)-abs2(cur.c1)-abs2(cur.c2)-abs2(cur.c3); } inline double vre(const CCurrent & a, const CCurrent & b) { return real(a.c0*conj(b.c0)-a.c1*conj(b.c1)-a.c2*conj(b.c2)-a.c3*conj(b.c3)); } + + // Colour acceleration multiplier for gluons see eq. (7) in arXiv:0910.5113 + // TODO: this is not a current and should be moved somewhere else + inline double K_g(double p1minus, double paminus) { + return 1./2.*(p1minus/paminus + paminus/p1minus)*(RHEJ::C_A - 1/RHEJ::C_A) + 1/RHEJ::C_A; + } + inline double K_g( + CLHEP::HepLorentzVector const & pout, + CLHEP::HepLorentzVector const & pin + ) { + if(pin.z() > 0) return K_g(pout.plus(), pin.plus()); + return K_g(pout.minus(), pin.minus()); + } diff --git a/include/RHEJ/gsl_wrapper.hh b/include/RHEJ/gsl_wrapper.hh deleted file mode 100644 index 3c4b569..0000000 --- a/include/RHEJ/gsl_wrapper.hh +++ /dev/null @@ -1,64 +0,0 @@ -/** \file - * \brief C++ wrappers around various gsl functions - */ - -#pragma once - -#include - -#include -#include -#include - -/** \brief gsl Namespace - * - * C++ wrappers around various gsl functions - */ -namespace gsl{ - - class MultirootFsolver; - - //! Wrapper around gsl_vector - class Vector{ - public: - explicit Vector(size_t size); - - double & at(size_t idx); - double const & at(size_t idx) const; - - double & operator[](size_t idx); - double const & operator[](size_t idx) const; - - size_t size() const; - - private: - friend class MultirootFsolver; - std::unique_ptr vec_; - }; - - //! Wrapper around gsl_multiroot_fsolver - /** - * This solves multdimensional systems of equations - */ - class MultirootFsolver{ - public: - MultirootFsolver( - gsl_multiroot_fsolver_type const * T, - gsl_multiroot_function* f, - Vector&& x - ); - - int iterate(); - int test_residual(double epsabs) const; - - gsl_vector const * x() const; - - const char * name() const; - - private: - std::unique_ptr solver_; - gsl_multiroot_function* f_; - Vector x_; - }; - -} diff --git a/include/RHEJ/resummation_jet_momenta.hh b/include/RHEJ/resummation_jet_momenta.hh index 03213f1..8e42f5b 100644 --- a/include/RHEJ/resummation_jet_momenta.hh +++ b/include/RHEJ/resummation_jet_momenta.hh @@ -1,21 +1,20 @@ /** \file * \brief Function to calculate the momenta of resummation jets */ #pragma once #include "RHEJ/utility.hh" namespace RHEJ{ - /** * \brief Calculate the resummation jet momenta - * @param p_born Born Jet Momenta + * @param p_born born Jet Momenta * @param qperp Sum of non-jet Parton Transverse Momenta * @returns Resummation Jet Momenta */ std::vector resummation_jet_momenta( std::vector const & p_born, fastjet::PseudoJet const & qperp ); } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8fcac5a..c15ac60 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,17 +1,17 @@ file(GLOB src_files *.cc) add_library(rhej SHARED ${src_files}) -set(libraries ${CMAKE_DL_LIBS} ${LHAPDF_LIBRARIES} ${CLHEP_LIBRARIES} ${FASTJET_LIBRARIES} ${GSL_LIBRARIES} ${Boost_LIBRARIES} ${YAML_CPP_LIBRARIES} yaml-cpp) +set(libraries ${CMAKE_DL_LIBS} ${LHAPDF_LIBRARIES} ${CLHEP_LIBRARIES} ${FASTJET_LIBRARIES} ${Boost_LIBRARIES} ${YAML_CPP_LIBRARIES} yaml-cpp) if(${QCDloop_FOUND}) list(APPEND libraries ${QCDloop_LIBRARIES} quadmath) endif() if(${HepMC_FOUND}) list(APPEND libraries ${HepMC_LIBRARIES}) if(${rivet_FOUND}) list(APPEND libraries ${rivet_LIBRARIES}) endif() endif() target_link_libraries(rhej ${libraries}) install(TARGETS rhej DESTINATION ${INSTALL_LIB_DIR}) diff --git a/src/Jacobian.cc b/src/Jacobian.cc index 87c83cb..1fa7d7f 100644 --- a/src/Jacobian.cc +++ b/src/Jacobian.cc @@ -1,44 +1,71 @@ #include "RHEJ/Jacobian.hh" -#include "RHEJ/Matrix.hh" +#include +#include namespace RHEJ{ namespace{ enum coordinates : size_t { x1, x2 }; + + + namespace ublas = boost::numeric::ublas; + + template + double det(ublas::matrix_expression const& m) { + + ublas::permutation_matrix pivots{m().size1()}; + Matrix mLu{m()}; + + const auto is_singular = lu_factorize(mLu, pivots); + + if(is_singular) return 0.; + + double det = 1.0; + for (std::size_t i = 0; i < pivots.size(); ++i){ + if (pivots(i) != i) det = -det; + + det *= mLu(i,i); + } + + return det; + } + + using ublas::matrix; } double Jacobian( std::vector const & jets, fastjet::PseudoJet const & q ) { + static constexpr int num_coordinates = 2; - auto Jacobian = Matrix{ + auto Jacobian = matrix{ num_coordinates*jets.size(), num_coordinates*jets.size() }; double P_perp = 0.; for(auto const & J: jets) P_perp += J.perp(); for(size_t l = 0; l < jets.size(); ++l){ const double Jl_perp = jets[l].perp(); for(size_t lp = 0; lp < jets.size(); ++lp){ const int delta_l = l == lp; const double Jlp_perp = jets[lp].perp(); for(size_t x = x1; x <= x2; ++x){ for(size_t xp = x1; xp <= x2; ++xp){ const int delta_x = x == xp; Jacobian(2*l + x, 2*lp + xp) = + delta_l*delta_x - + q[x]*jets[lp][xp]/(P_perp*Jlp_perp)*( + - q[x]*jets[lp][xp]/(P_perp*Jlp_perp)*( + delta_l - Jl_perp/P_perp ); } } } } return det(Jacobian); } } diff --git a/src/Matrix.cc b/src/Matrix.cc deleted file mode 100644 index 2833975..0000000 --- a/src/Matrix.cc +++ /dev/null @@ -1,91 +0,0 @@ -#include "RHEJ/Matrix.hh" - -#include - -namespace RHEJ{ - - Matrix::Matrix(size_t rows, size_t columns): - m(gsl_matrix_alloc(rows, columns)) - {} - - size_t Matrix::rows() const{ - return m->size1; - } - - size_t Matrix::columns() const{ - return m->size2; - } - - Matrix::Matrix(Matrix const & other): - m(gsl_matrix_alloc(other.rows(), other.columns())) - { - gsl_matrix_memcpy(m, other.m); - } - - Matrix::Matrix(Matrix && other) noexcept: - m(other.m) - { - other.m = gsl_matrix_alloc(0, 0); - } - - double & Matrix::operator()(size_t row, size_t column){ - return *gsl_matrix_ptr(m, row, column); - } - - double const & Matrix::operator()(size_t row, size_t column) const{ - return *gsl_matrix_const_ptr(m, row, column); - } - - Matrix & Matrix::operator=(Matrix const & other){ - Matrix o{other}; - swap(*this, o); - return *this; - } - - Matrix & Matrix::operator=(Matrix && other) noexcept{ - std::swap(m, other.m); - return *this; - } - - Matrix::~Matrix(){ - gsl_matrix_free(m); - } - - void swap(Matrix & a, Matrix & b) noexcept{ - std::swap(a.m, b.m); - } - - namespace{ - struct permutation{ - gsl_permutation* p; - permutation(size_t size): - p{gsl_permutation_alloc(size)} - {} - permutation(permutation const & other) = delete; - void operator=(permutation const & other) = delete; - - ~permutation(){ - gsl_permutation_free(p); - } - }; - } - - double det(Matrix m){ - int signum; - permutation p(m.rows()); - gsl_linalg_LU_decomp(m.m , p.p , &signum); - return gsl_linalg_LU_det(m.m, signum); - } - - std::string to_string(Matrix const & m){ - std::string result; - for(size_t i = 0; i < m.rows(); ++i){ - for(size_t j = 0; j < m.columns(); ++j){ - result += std::to_string(m(i, j)); - result += " "; - } - result.back() = '\n'; - } - return result; - } -} diff --git a/src/MatrixElement.cc b/src/MatrixElement.cc index ff39e24..b1507e4 100644 --- a/src/MatrixElement.cc +++ b/src/MatrixElement.cc @@ -1,957 +1,996 @@ #include "RHEJ/MatrixElement.hh" #include #include #include "RHEJ/Constants.hh" #include "RHEJ/currents.hh" #include "RHEJ/PDG_codes.hh" #include "RHEJ/uno.hh" #include "RHEJ/utility.hh" namespace RHEJ{ //cf. last line of eq. (22) in \ref Andersen:2011hs double MatrixElement::omega0( double alpha_s, double mur, fastjet::PseudoJet const & q_j, double lambda ) const { const double result = - alpha_s*N_C/M_PI*log(q_j.perp2()/(lambda*lambda)); if(! param_.log_correction) return result; // use alpha_s(sqrt(q_j*lambda)), evolved to mur return ( 1. + alpha_s/(4.*M_PI)*beta0*log(mur*mur/(q_j.perp()*lambda)) )*result; } double MatrixElement::virtual_corrections( double mur, std::array const & in, std::vector const & out ) const{ fastjet::PseudoJet const & pa = in.front().p; #ifndef NDEBUG fastjet::PseudoJet const & pb = in.back().p; double const norm = (in.front().p + in.back().p).E(); #endif assert(std::is_sorted(out.begin(), out.end(), rapidity_less{})); assert(out.size() >= 2); assert(pa.pz() < pb.pz()); fastjet::PseudoJet q = pa - out[0].p; size_t first_idx = 0; size_t last_idx = out.size() - 1; // if there is a Higgs or unordered gluon outside the extremal partons // then it is not part of the FKL ladder and does not contribute // to the virtual corrections if(out.front().type == pid::Higgs || has_unob_gluon(in, out)){ q -= out[1].p; ++first_idx; } if(out.back().type == pid::Higgs || has_unof_gluon(in, out)){ --last_idx; } double exponent = 0; const double alpha_s = alpha_s_(mur); for(size_t j = first_idx; j < last_idx; ++j){ exponent += omega0(alpha_s, mur, q, CLAMBDA)*( out[j+1].rapidity() - out[j].rapidity() ); q -= out[j+1].p; } assert( nearby(q, -1*pb, norm) || out.back().type == pid::Higgs || has_unof_gluon(in, out) ); return exp(exponent); } } // namespace RHEJ namespace { //! Lipatov vertex for partons emitted into extremal jets double C2Lipatov(CLHEP::HepLorentzVector qav, CLHEP::HepLorentzVector qbv, CLHEP::HepLorentzVector p1, CLHEP::HepLorentzVector p2) { CLHEP::HepLorentzVector temptrans=-(qav+qbv); CLHEP::HepLorentzVector p5=qav-qbv; CLHEP::HepLorentzVector CL=temptrans + p1*(qav.m2()/p5.dot(p1) + 2.*p5.dot(p2)/p1.dot(p2)) - p2*(qbv.m2()/p5.dot(p2) + 2.*p5.dot(p1)/p1.dot(p2)); // cout << "#Fadin qa : "<fabs(CL.dot(CL))) // not sufficient! // return 0.; // else return -CL.dot(CL); } //! Lipatov vertex with soft subtraction for partons emitted into extremal jets double C2Lipatovots(CLHEP::HepLorentzVector qav, CLHEP::HepLorentzVector qbv, CLHEP::HepLorentzVector p1, CLHEP::HepLorentzVector p2) { double kperp=(qav-qbv).perp(); if (kperp>RHEJ::CLAMBDA) return C2Lipatov(qav, qbv, p1, p2)/(qav.m2()*qbv.m2()); else { double Cls=(C2Lipatov(qav, qbv, p1, p2)/(qav.m2()*qbv.m2())); return Cls-4./(kperp*kperp); } } //! Lipatov vertex double C2Lipatov(CLHEP::HepLorentzVector qav, CLHEP::HepLorentzVector qbv, CLHEP::HepLorentzVector pim, CLHEP::HepLorentzVector pip, CLHEP::HepLorentzVector pom, CLHEP::HepLorentzVector pop) // B { CLHEP::HepLorentzVector temptrans=-(qav+qbv); CLHEP::HepLorentzVector p5=qav-qbv; CLHEP::HepLorentzVector CL=temptrans + qav.m2()*(1./p5.dot(pip)*pip + 1./p5.dot(pop)*pop)/2. - qbv.m2()*(1./p5.dot(pim)*pim + 1./p5.dot(pom)*pom)/2. + ( pip*(p5.dot(pim)/pip.dot(pim) + p5.dot(pom)/pip.dot(pom)) + pop*(p5.dot(pim)/pop.dot(pim) + p5.dot(pom)/pop.dot(pom)) - pim*(p5.dot(pip)/pip.dot(pim) + p5.dot(pop)/pop.dot(pim)) - pom*(p5.dot(pip)/pip.dot(pom) + p5.dot(pop)/pop.dot(pom)) )/2.; return -CL.dot(CL); } //! Lipatov vertex with soft subtraction double C2Lipatovots(CLHEP::HepLorentzVector qav, CLHEP::HepLorentzVector qbv, CLHEP::HepLorentzVector pa, CLHEP::HepLorentzVector pb, CLHEP::HepLorentzVector p1, CLHEP::HepLorentzVector p2) { double kperp=(qav-qbv).perp(); if (kperp>RHEJ::CLAMBDA) return C2Lipatov(qav, qbv, pa, pb, p1, p2)/(qav.m2()*qbv.m2()); else { double Cls=(C2Lipatov(qav, qbv, pa, pb, p1, p2)/(qav.m2()*qbv.m2())); double temp=Cls-4./(kperp*kperp); return temp; } } /** Matrix element squared for tree-level current-current scattering * @param aptype Particle a PDG ID * @param bptype Particle b PDG ID * @param pn Particle n Momentum * @param pb Particle b Momentum * @param p1 Particle 1 Momentum * @param pa Particle a Momentum * @returns ME Squared for Tree-Level Current-Current Scattering */ double ME_current( int aptype, int bptype, CLHEP::HepLorentzVector const & pn, CLHEP::HepLorentzVector const & pb, CLHEP::HepLorentzVector const & p1, CLHEP::HepLorentzVector const & pa ){ if (aptype==21&&bptype==21) { return jM2gg(pn,pb,p1,pa); } else if (aptype==21&&bptype!=21) { if (bptype > 0) return jM2qg(pn,pb,p1,pa); else return jM2qbarg(pn,pb,p1,pa); } else if (bptype==21&&aptype!=21) { // ----- || ----- if (aptype > 0) return jM2qg(p1,pa,pn,pb); else return jM2qbarg(p1,pa,pn,pb); } else { // they are both quark if (bptype>0) { if (aptype>0) return jM2qQ(pn,pb,p1,pa); else return jM2qQbar(pn,pb,p1,pa); } else { if (aptype>0) return jM2qQbar(p1,pa,pn,pb); else return jM2qbarQbar(pn,pb,p1,pa); } } throw std::logic_error("unknown particle types"); } /** Matrix element squared for tree-level current-current scattering With W+Jets * @param aptype Particle a PDG ID * @param bptype Particle b PDG ID * @param pn Particle n Momentum * @param pb Particle b Momentum * @param p1 Particle 1 Momentum * @param pa Particle a Momentum * @returns ME Squared for Tree-Level Current-Current Scattering */ double ME_W_current( int aptype, int bptype, CLHEP::HepLorentzVector const & pn, CLHEP::HepLorentzVector const & pb, CLHEP::HepLorentzVector const & p1, CLHEP::HepLorentzVector const & pa, CLHEP::HepLorentzVector const & plbar, CLHEP::HepLorentzVector const & pl ){ if (aptype==21&&bptype==21) { throw std::logic_error("gg incoming in W+jets, qqx not yet implemented"); } else if (aptype==21&&bptype!=21) { if (bptype > 0) return jMWqg(pn,pl,plbar,pb,p1,pa); else return jMWqbarg(pn,pl,plbar,pb,p1,pa); } else if (bptype==21&&aptype!=21) { // ----- || ----- if (aptype > 0) return jMWqg(p1,pl,plbar,pa,pn,pb); else return jMWqbarg(p1,pl,plbar,pa,pn,pb); } else { // they are both quark if (bptype>0) { if (aptype>0) return jMWqQ(pn,pl,plbar,pb,p1,pa); else return jMWqQbar(pn,pl,plbar,pb,p1,pa); } else { if (aptype>0) return jMWqQbar(p1,pl,plbar,pa,pn,pb); else return jMWqbarQbar(pn,pl,plbar,pb,p1,pa); } } throw std::logic_error("unknown particle types"); } /** \brief Matrix element squared for tree-level current-current scattering with Higgs * @param aptype Particle a PDG ID * @param bptype Particle b PDG ID * @param pn Particle n Momentum * @param pb Particle b Momentum * @param p1 Particle 1 Momentum * @param pa Particle a Momentum * @param qH t-channel momentum before Higgs * @param qHp1 t-channel momentum after Higgs * @returns ME Squared for Tree-Level Current-Current Scattering with Higgs */ double ME_Higgs_current( int aptype, int bptype, CLHEP::HepLorentzVector const & pn, CLHEP::HepLorentzVector const & pb, CLHEP::HepLorentzVector const & p1, CLHEP::HepLorentzVector const & pa, CLHEP::HepLorentzVector const & qH, // t-channel momentum before Higgs CLHEP::HepLorentzVector const & qHp1, // t-channel momentum after Higgs double mt, bool include_bottom, double mb ){ if (aptype==21&&bptype==21) // gg initial state return MH2gg(pn,pb,p1,pa,-qHp1,-qH,mt,include_bottom,mb); else if (aptype==21&&bptype!=21) { if (bptype > 0) return MH2qg(pn,pb,p1,pa,-qHp1,-qH,mt,include_bottom,mb)*4./9.; else return MH2qbarg(pn,pb,p1,pa,-qHp1,-qH,mt,include_bottom,mb)*4./9.; } else if (bptype==21&&aptype!=21) { if (aptype > 0) return MH2qg(p1,pa,pn,pb,-qH,-qHp1,mt,include_bottom,mb)*4./9.; else return MH2qbarg(p1,pa,pn,pb,-qH,-qHp1,mt,include_bottom,mb)*4./9.; } else { // they are both quark if (bptype>0) { if (aptype>0) return MH2qQ(pn,pb,p1,pa,-qHp1,-qH,mt,include_bottom,mb)*4.*4./(9.*9.); else return MH2qQbar(pn,pb,p1,pa,-qHp1,-qH,mt,include_bottom,mb)*4.*4./(9.*9.); } else { if (aptype>0) return MH2qQbar(p1,pa,pn,pb,-qH,-qHp1,mt,include_bottom,mb)*4.*4./(9.*9.); else return MH2qbarQbar(pn,pb,p1,pa,-qHp1,-qH,mt,include_bottom,mb)*4.*4./(9.*9.); } } throw std::logic_error("unknown particle types"); } /** \brief Current matrix element squared with Higgs and unordered forward emission * @param aptype Particle A PDG ID * @param bptype Particle B PDG ID * @param punof Unordered Particle Momentum * @param pn Particle n Momentum * @param pb Particle b Momentum * @param p1 Particle 1 Momentum * @param pa Particle a Momentum * @param qH t-channel momentum before Higgs * @param qHp1 t-channel momentum after Higgs * @returns ME Squared with Higgs and unordered forward emission */ double ME_Higgs_current_unof( int aptype, int bptype, CLHEP::HepLorentzVector const & punof, CLHEP::HepLorentzVector const & pn, CLHEP::HepLorentzVector const & pb, CLHEP::HepLorentzVector const & p1, CLHEP::HepLorentzVector const & pa, CLHEP::HepLorentzVector const & qH, // t-channel momentum before Higgs CLHEP::HepLorentzVector const & qHp1, // t-channel momentum after Higgs double mt, bool include_bottom, double mb ){ if (aptype==21&&bptype!=21) { if (bptype > 0) return jM2unogqHg(punof,pn,pb,p1,pa,-qHp1,-qH,mt,include_bottom,mb); else return jM2unogqbarHg(punof,pn,pb,p1,pa,-qHp1,-qH,mt,include_bottom,mb); } else { // they are both quark if (bptype>0) { if (aptype>0) return jM2unogqHQ(punof,pn,pb,p1,pa,-qHp1,-qH,mt,include_bottom,mb); else return jM2unogqHQbar(punof,pn,pb,p1,pa,-qHp1,-qH,mt,include_bottom,mb); } else { if (aptype>0) return jM2unogqbarHQ(punof,pn,pb,p1,pa,-qHp1,-qH,mt,include_bottom,mb); else return jM2unogqbarHQbar(punof,pn,pb,p1,pa,-qHp1,-qH,mt,include_bottom,mb); } } throw std::logic_error("unknown particle types"); } /** \brief Current matrix element squared with Higgs and unordered backward emission * @param aptype Particle A PDG ID * @param bptype Particle B PDG ID * @param pn Particle n Momentum * @param pb Particle b Momentum * @param punob Unordered back Particle Momentum * @param p1 Particle 1 Momentum * @param pa Particle a Momentum * @param qH t-channel momentum before Higgs * @param qHp1 t-channel momentum after Higgs * @returns ME Squared with Higgs and unordered backward emission */ double ME_Higgs_current_unob( int aptype, int bptype, CLHEP::HepLorentzVector const & pn, CLHEP::HepLorentzVector const & pb, CLHEP::HepLorentzVector const & punob, CLHEP::HepLorentzVector const & p1, CLHEP::HepLorentzVector const & pa, CLHEP::HepLorentzVector const & qH, // t-channel momentum before Higgs CLHEP::HepLorentzVector const & qHp1, // t-channel momentum after Higgs double mt, bool include_bottom, double mb ){ if (bptype==21&&aptype!=21) { if (aptype > 0) return jM2unobgHQg(pn,pb,punob,p1,pa,-qHp1,-qH,mt,include_bottom,mb); else return jM2unobgHQbarg(pn,pb,punob,p1,pa,-qHp1,-qH,mt,include_bottom,mb); } else { // they are both quark if (aptype>0) { if (bptype>0) return jM2unobqHQg(pn,pb,punob,p1,pa,-qHp1,-qH,mt,include_bottom,mb); else return jM2unobqbarHQg(pn,pb,punob,p1,pa,-qHp1,-qH,mt,include_bottom,mb); } else { if (bptype>0) return jM2unobqHQbarg(pn,pb,punob,p1,pa,-qHp1,-qH,mt,include_bottom,mb); else return jM2unobqbarHQbarg(pn,pb,punob,p1,pa,-qHp1,-qH,mt,include_bottom,mb); } } throw std::logic_error("unknown particle types"); } CLHEP::HepLorentzVector to_HepLorentzVector(RHEJ::Particle const & particle){ return {particle.p.px(), particle.p.py(), particle.p.pz(), particle.p.E()}; } + + void validate(RHEJ::MatrixElementConfig const & config) { +#ifndef RHEJ_BUILD_WITH_QCDLOOP + if(!config.Higgs_coupling.use_impact_factors) { + throw std::invalid_argument{ + "Invalid Higgs coupling settings.\n" + "HEJ without QCDloop support can only use impact factors.\n" + "Set use_impact_factors to true or recompile HEJ.\n" + }; + } +#endif + if(config.Higgs_coupling.use_impact_factors + && config.Higgs_coupling.mt != std::numeric_limits::infinity()) { + throw std::invalid_argument{ + "Conflicting settings: " + "impact factors may only be used in the infinite top mass limit" + }; + } + } } // namespace anonymous namespace RHEJ{ MatrixElement::MatrixElement( std::function alpha_s, MatrixElementConfig conf ): alpha_s_{std::move(alpha_s)}, param_{std::move(conf)} - {} + { + validate(param_); + } double MatrixElement::operator()( double mur, std::array const & incoming, std::vector const & outgoing, std::unordered_map> const & decays, bool check_momenta ) const { return tree( mur, incoming, outgoing, decays, check_momenta )*virtual_corrections( mur, incoming, outgoing ); } double MatrixElement::tree_kin( std::array const & incoming, std::vector const & outgoing, std::unordered_map> const & decays, bool check_momenta ) const { assert( std::is_sorted( incoming.begin(), incoming.end(), [](Particle o1, Particle o2){return o1.p.pz()type){ case pid::Higgs: { return tree_kin_Higgs(incoming, outgoing, check_momenta); } // TODO case pid::Wp: { return tree_kin_W(incoming, outgoing, decays, true, check_momenta); } case pid::Wm: { return tree_kin_W(incoming, outgoing, decays, false, check_momenta); } case pid::photon: case pid::Z: default: throw std::logic_error("Emission of boson of unsupported type."); } } namespace{ constexpr int extremal_jet_idx = 1; constexpr int no_extremal_jet_idx = 0; bool treat_as_extremal(Particle const & parton){ return parton.p.user_index() == extremal_jet_idx; } template double FKL_ladder_weight( InputIterator begin_gluon, InputIterator end_gluon, CLHEP::HepLorentzVector const & q0, CLHEP::HepLorentzVector const & pa, CLHEP::HepLorentzVector const & pb, CLHEP::HepLorentzVector const & p1, CLHEP::HepLorentzVector const & pn ){ double wt = 1; auto qi = q0; for(auto gluon_it = begin_gluon; gluon_it != end_gluon; ++gluon_it){ assert(gluon_it->type == pid::gluon); const auto g = to_HepLorentzVector(*gluon_it); const auto qip1 = qi - g; if(treat_as_extremal(*gluon_it)){ wt *= C2Lipatovots(qip1, qi, pa, pb)*C_A; } else{ wt *= C2Lipatovots(qip1, qi, pa, pb, p1, pn)*C_A; } qi = qip1; } return wt; } } // namespace anonymous std::vector MatrixElement::tag_extremal_jet_partons( std::array const & incoming, std::vector out_partons, bool check_momenta ) const{ if(!check_momenta){ for(auto & parton: out_partons){ parton.p.set_user_index(no_extremal_jet_idx); } return out_partons; } fastjet::ClusterSequence cs(to_PseudoJet(out_partons), param_.jet_param.def); const auto jets = sorted_by_rapidity(cs.inclusive_jets(param_.jet_param.min_pt)); assert(jets.size() >= 2); auto most_backward = begin(jets); auto most_forward = end(jets) - 1; // skip jets caused by unordered emission if(has_unob_gluon(incoming, out_partons)){ assert(jets.size() >= 3); ++most_backward; } else if(has_unof_gluon(incoming, out_partons)){ assert(jets.size() >= 3); --most_forward; } const auto extremal_jet_indices = cs.particle_jet_indices( {*most_backward, *most_forward} ); assert(extremal_jet_indices.size() == out_partons.size()); for(size_t i = 0; i < out_partons.size(); ++i){ assert(RHEJ::is_parton(out_partons[i])); const int idx = (extremal_jet_indices[i]>=0)? extremal_jet_idx: no_extremal_jet_idx; out_partons[i].p.set_user_index(idx); } return out_partons; } double MatrixElement::tree_kin_jets( std::array const & incoming, std::vector partons, bool check_momenta ) const { partons = tag_extremal_jet_partons(incoming, partons, check_momenta); if(has_unob_gluon(incoming, partons) || has_unof_gluon(incoming, partons)){ throw std::logic_error("unordered emission not implemented for pure jets"); } const auto pa = to_HepLorentzVector(incoming[0]); const auto pb = to_HepLorentzVector(incoming[1]); const auto p1 = to_HepLorentzVector(partons.front()); const auto pn = to_HepLorentzVector(partons.back()); return ME_current( incoming[0].type, incoming[1].type, pn, pb, p1, pa )/(4*(N_C*N_C - 1))*FKL_ladder_weight( begin(partons) + 1, end(partons) - 1, pa - p1, pa, pb, p1, pn ); } double MatrixElement::tree_kin_W( std::array const & incoming, std::vector const & outgoing, std::unordered_map> const & decays, bool WPlus, bool check_momenta ) const { bool qqxExtremal=false; bool qqxCentral=false; if(has_unob_gluon(incoming, outgoing)){ throw std::logic_error("unordered emission not yet implemented for W+jets"); //return tree_kin_W_unob(incoming, outgoing, check_momenta); } else if(has_unof_gluon(incoming, outgoing)){ throw std::logic_error("unordered emission not yet implemented for W+jets"); // return tree_kin_W_unof(incoming, outgoing, check_momenta); } else if(qqxExtremal){ throw std::logic_error("Extremal qqx not yet implemented for W+jets"); // return tree_kin_W_Exqqx(incoming, outgoing, check_momenta); } else if(qqxCentral){ throw std::logic_error("Central qqx not yet implemented for W+jets"); // return tree_kin_W_qqxCentral(incoming, outgoing, check_momenta); } else{ return tree_kin_W_FKL(incoming, outgoing, decays, WPlus, check_momenta); } } double MatrixElement::tree_kin_W_FKL( std::array const & incoming, std::vector const & outgoing, std::unordered_map> const & decays, bool WPlus, bool check_momenta ) const { const auto the_W = std::find_if( begin(outgoing), end(outgoing), [](Particle const & s){ return abs(s.type) == pid::Wp; } ); HLV plbar, pl; for (auto& x: decays) { if (x.second.at(0).type < 0){ plbar = to_HepLorentzVector(x.second.at(0)); pl = to_HepLorentzVector(x.second.at(1)); } else{ pl = to_HepLorentzVector(x.second.at(0)); plbar = to_HepLorentzVector(x.second.at(1)); } } const auto pW = to_HepLorentzVector(*the_W); std::vector partons(begin(outgoing), the_W); partons.insert(end(partons), the_W + 1, end(outgoing)); partons = tag_extremal_jet_partons(incoming, partons, check_momenta); const auto pa = to_HepLorentzVector(incoming[0]); const auto pb = to_HepLorentzVector(incoming[1]); auto p1 = to_HepLorentzVector(partons[0]); auto pn = to_HepLorentzVector(partons[partons.size() - 1]); auto first_after_W = begin(partons) + (the_W-begin(outgoing)); // always treat the Higgs as if it were in between the extremal FKL partons if(first_after_W == begin(partons)) ++first_after_W; else if(first_after_W == end(partons)) --first_after_W; // t-channel momentum before W auto qW = pa; for(auto parton_it = begin(partons); parton_it != first_after_W; ++parton_it){ qW -= to_HepLorentzVector(*parton_it); } auto q0 = pa - p1; auto begin_ladder = begin(partons) + 1; auto end_ladder = end(partons) - 1; double current_factor; if (WPlus){ current_factor = ME_W_current( incoming[0].type, incoming[1].type, pn, pb, p1, pa, pl, plbar ); } else{ current_factor = ME_W_current( incoming[0].type, incoming[1].type, pn, pb, p1, pa, plbar, pl ); } const double ladder_factor = FKL_ladder_weight( begin_ladder, first_after_W, q0, pa, pb, p1, pn )*FKL_ladder_weight( begin_ladder, end_ladder, pa - p1, pa, pb, p1, pn ); return current_factor*9./8.*ladder_factor; } double MatrixElement::tree_kin_Higgs( std::array const & incoming, std::vector const & outgoing, bool check_momenta ) const { if(has_uno_gluon(incoming, outgoing)){ return tree_kin_Higgs_between(incoming, outgoing, check_momenta); } if(outgoing.front().type == pid::Higgs){ return tree_kin_Higgs_first(incoming, outgoing, check_momenta); } if(outgoing.back().type == pid::Higgs){ return tree_kin_Higgs_last(incoming, outgoing, check_momenta); } return tree_kin_Higgs_between(incoming, outgoing, check_momenta); } + namespace { + // Colour acceleration multipliers, for gluons see eq. (7) in arXiv:0910.5113 + // TODO: code duplication with currents.cc + double K_g(double p1minus, double paminus) { + return 1./2.*(p1minus/paminus + paminus/p1minus)*(C_A - 1/C_A) + 1/C_A; + } + double K_g( + CLHEP::HepLorentzVector const & pout, + CLHEP::HepLorentzVector const & pin + ) { + if(pin.z() > 0) return K_g(pout.plus(), pin.plus()); + return K_g(pout.minus(), pin.minus()); + } + double K( + ParticleID type, + CLHEP::HepLorentzVector const & pout, + CLHEP::HepLorentzVector const & pin + ) { + if(type == ParticleID::gluon) return K_g(pout, pin); + return C_F; + } + // Colour factor in strict MRK limit + double K_MRK(ParticleID type) { + return (type == ParticleID::gluon)?C_A:C_F; + } + } + double MatrixElement::MH2_forwardH( CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, + ParticleID type2, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector pH, double t1, double t2 ) const{ ignore(p2out, p2in); const double shat = p1in.invariantMass2(p2in); // gluon case #ifdef RHEJ_BUILD_WITH_QCDLOOP if(!param_.Higgs_coupling.use_impact_factors){ - return C_A/C_F*1./(16*M_PI*M_PI)*t1/t2*MH2gq_outsideH( + return K(type2, p2out, p2in)/C_F*1./(16*M_PI*M_PI)*t1/t2*MH2gq_outsideH( p1out, p1in, p2out, p2in, pH, param_.Higgs_coupling.mt, param_.Higgs_coupling.include_bottom, param_.Higgs_coupling.mb ); } #endif - return 9./2.*shat*shat*( + return K_MRK(type2)/C_A*9./2.*shat*shat*( C2gHgp(p1in,p1out,pH) + C2gHgm(p1in,p1out,pH) )/(t1*t2); } double MatrixElement::tree_kin_Higgs_first( std::array const & incoming, std::vector const & outgoing, bool check_momenta ) const { assert(outgoing.front().type == pid::Higgs); if(outgoing[1].type != pid::gluon) { assert(incoming.front().type == outgoing[1].type); return tree_kin_Higgs_between(incoming, outgoing, check_momenta); } const auto pH = to_HepLorentzVector(outgoing.front()); const auto partons = tag_extremal_jet_partons( incoming, std::vector(begin(outgoing) + 1, end(outgoing)), check_momenta ); const auto pa = to_HepLorentzVector(incoming[0]); const auto pb = to_HepLorentzVector(incoming[1]); const auto p1 = to_HepLorentzVector(partons.front()); const auto pn = to_HepLorentzVector(partons.back()); const auto q0 = pa - p1 - pH; const double t1 = q0.m2(); const double t2 = (pn - pb).m2(); - double wt = MH2_forwardH( - p1, pa, pn, pb, pH, + return MH2_forwardH( + p1, pa, incoming[1].type, pn, pb, pH, t1, t2 )*FKL_ladder_weight( begin(partons) + 1, end(partons) - 1, q0, pa, pb, p1, pn ); - - for(auto const & inc: incoming){ - if(inc.type != pid::gluon) wt *= C_F/C_A; - } - return wt; } double MatrixElement::tree_kin_Higgs_last( std::array const & incoming, std::vector const & outgoing, bool check_momenta ) const { assert(outgoing.back().type == pid::Higgs); if(outgoing[outgoing.size()-2].type != pid::gluon) { assert(incoming.back().type == outgoing[outgoing.size()-2].type); return tree_kin_Higgs_between(incoming, outgoing, check_momenta); } const auto pH = to_HepLorentzVector(outgoing.back()); const auto partons = tag_extremal_jet_partons( incoming, std::vector(begin(outgoing), end(outgoing) - 1), check_momenta ); const auto pa = to_HepLorentzVector(incoming[0]); const auto pb = to_HepLorentzVector(incoming[1]); auto p1 = to_HepLorentzVector(partons.front()); const auto pn = to_HepLorentzVector(partons.back()); auto q0 = pa - p1; const double t1 = q0.m2(); const double t2 = (pn + pH - pb).m2(); - double wt = MH2_forwardH( - pn, pb, p1, pa, pH, + return MH2_forwardH( + pn, pb, incoming[0].type, p1, pa, pH, t2, t1 )*FKL_ladder_weight( begin(partons) + 1, end(partons) - 1, q0, pa, pb, p1, pn ); - - for(auto const & inc: incoming){ - if(inc.type != pid::gluon) wt *= C_F/C_A; - } - return wt; } double MatrixElement::tree_kin_Higgs_between( std::array const & incoming, std::vector const & outgoing, bool check_momenta ) const { const auto the_Higgs = std::find_if( begin(outgoing), end(outgoing), [](Particle const & s){ return s.type == pid::Higgs; } ); assert(the_Higgs != end(outgoing)); const auto pH = to_HepLorentzVector(*the_Higgs); std::vector partons(begin(outgoing), the_Higgs); partons.insert(end(partons), the_Higgs + 1, end(outgoing)); partons = tag_extremal_jet_partons(incoming, partons, check_momenta); const auto pa = to_HepLorentzVector(incoming[0]); const auto pb = to_HepLorentzVector(incoming[1]); auto p1 = to_HepLorentzVector( partons[has_unob_gluon(incoming, outgoing)?1:0] ); auto pn = to_HepLorentzVector( partons[partons.size() - (has_unof_gluon(incoming, outgoing)?2:1)] ); auto first_after_Higgs = begin(partons) + (the_Higgs-begin(outgoing)); assert( (first_after_Higgs == end(partons) && ( has_unob_gluon(incoming, outgoing) || partons.back().type != pid::gluon )) || first_after_Higgs->rapidity() >= the_Higgs->rapidity() ); assert( (first_after_Higgs == begin(partons) && ( has_unof_gluon(incoming, outgoing) || partons.front().type != pid::gluon )) || (first_after_Higgs-1)->rapidity() <= the_Higgs->rapidity() ); // always treat the Higgs as if it were in between the extremal FKL partons if(first_after_Higgs == begin(partons)) ++first_after_Higgs; else if(first_after_Higgs == end(partons)) --first_after_Higgs; // t-channel momentum before Higgs auto qH = pa; for(auto parton_it = begin(partons); parton_it != first_after_Higgs; ++parton_it){ qH -= to_HepLorentzVector(*parton_it); } auto q0 = pa - p1; auto begin_ladder = begin(partons) + 1; auto end_ladder = end(partons) - 1; double current_factor; if(has_unob_gluon(incoming, outgoing)){ - current_factor = 9./2.*ME_Higgs_current_unob( + current_factor = C_A*C_A/2.*ME_Higgs_current_unob( // 1/2 = "K_uno" incoming[0].type, incoming[1].type, pn, pb, to_HepLorentzVector(partons.front()), p1, pa, qH, qH - pH, param_.Higgs_coupling.mt, param_.Higgs_coupling.include_bottom, param_.Higgs_coupling.mb ); const auto p_unob = to_HepLorentzVector(partons.front()); q0 -= p_unob; p1 += p_unob; ++begin_ladder; } else if(has_unof_gluon(incoming, outgoing)){ - current_factor = 9./2.*ME_Higgs_current_unof( + current_factor = C_A*C_A/2.*ME_Higgs_current_unof( // 1/2 = "K_uno" incoming[0].type, incoming[1].type, to_HepLorentzVector(partons.back()), pn, pb, p1, pa, qH, qH - pH, param_.Higgs_coupling.mt, param_.Higgs_coupling.include_bottom, param_.Higgs_coupling.mb ); pn += to_HepLorentzVector(partons.back()); --end_ladder; } else{ current_factor = ME_Higgs_current( incoming[0].type, incoming[1].type, pn, pb, p1, pa, qH, qH - pH, param_.Higgs_coupling.mt, param_.Higgs_coupling.include_bottom, param_.Higgs_coupling.mb ); } const double ladder_factor = FKL_ladder_weight( begin_ladder, first_after_Higgs, q0, pa, pb, p1, pn )*FKL_ladder_weight( first_after_Higgs, end_ladder, qH - pH, pa, pb, p1, pn ); - return current_factor*9./8.*ladder_factor; + return current_factor*C_A*C_A/(N_C*N_C-1.)*ladder_factor; } double MatrixElement::tree_param_partons( double alpha_s, double mur, std::vector const & partons ) const{ const double gs2 = 4.*M_PI*alpha_s; double wt = std::pow(gs2, partons.size()); if(param_.log_correction){ // use alpha_s(q_perp), evolved to mur assert(partons.size() >= 2); for(size_t i = 1; i < partons.size()-1; ++i){ wt *= 1 + alpha_s/(2*M_PI)*beta0*log(mur/partons[i].p.perp()); } } return wt; } double MatrixElement::tree_param( double mur, std::array const & incoming, std::vector const & outgoing ) const{ const double alpha_s = alpha_s_(mur); auto AWZH_boson = std::find_if( begin(outgoing), end(outgoing), [](auto const & p){return is_AWZH_boson(p);} ); double AWZH_coupling = 1.; if(AWZH_boson != end(outgoing)){ switch(AWZH_boson->type){ case pid::Higgs: { AWZH_coupling = alpha_s*alpha_s; break; } // TODO case pid::Wp:{ AWZH_coupling = alpha_w*alpha_w/2; break; } case pid::Wm:{ AWZH_coupling = alpha_w*alpha_w/2; break; } case pid::photon: case pid::Z: default: throw std::logic_error("Emission of boson of unsupported type"); } } if(has_unob_gluon(incoming, outgoing)){ return AWZH_coupling*4*M_PI*alpha_s*tree_param_partons( alpha_s, mur, filter_partons({begin(outgoing) + 1, end(outgoing)}) ); } if(has_unof_gluon(incoming, outgoing)){ return AWZH_coupling*4*M_PI*alpha_s*tree_param_partons( alpha_s, mur, filter_partons({begin(outgoing), end(outgoing) - 1}) ); } return AWZH_coupling*tree_param_partons(alpha_s, mur, filter_partons(outgoing)); } double MatrixElement::tree( double mur, std::array const & incoming, std::vector const & outgoing, std::unordered_map> const & decays, bool check_momenta ) const { return tree_param(mur, incoming, outgoing)*tree_kin( incoming, outgoing, decays, check_momenta ); } } // namespace RHEJ diff --git a/src/PhaseSpacePoint.cc b/src/PhaseSpacePoint.cc index 3ac02ab..2f8e477 100644 --- a/src/PhaseSpacePoint.cc +++ b/src/PhaseSpacePoint.cc @@ -1,537 +1,537 @@ #include "RHEJ/PhaseSpacePoint.hh" #include #include #include #include "RHEJ/Constants.hh" #include "RHEJ/resummation_jet_momenta.hh" #include "RHEJ/Jacobian.hh" #include "RHEJ/uno.hh" #include "RHEJ/utility.hh" #include "RHEJ/kinematics.hh" namespace RHEJ{ namespace { constexpr int max_jet_user_idx = PhaseSpacePoint::ng_max; bool is_nonjet_parton(fastjet::PseudoJet const & parton){ assert(parton.user_index() != -1); return parton.user_index() > max_jet_user_idx; } bool is_jet_parton(fastjet::PseudoJet const & parton){ assert(parton.user_index() != -1); return parton.user_index() <= max_jet_user_idx; } // user indices for partons with extremal rapidity constexpr int unob_idx = -5; constexpr int unof_idx = -4; constexpr int backward_FKL_idx = -3; constexpr int forward_FKL_idx = -2; } namespace { double estimate_ng_mean(std::vector const & Born_jets){ const double delta_y = Born_jets.back().rapidity() - Born_jets.front().rapidity(); assert(delta_y > 0); // Formula derived from fit in reversed HEJ intro paper return 0.975052*delta_y; } } std::vector PhaseSpacePoint::cluster_jets( std::vector const & partons ) const{ fastjet::ClusterSequence cs(partons, param_.jet_param.def); return cs.inclusive_jets(param_.jet_param.min_pt); } bool PhaseSpacePoint::pass_resummation_cuts( std::vector const & jets ) const{ return cluster_jets(jets).size() == jets.size(); } int PhaseSpacePoint::sample_ng(std::vector const & Born_jets){ const double ng_mean = estimate_ng_mean(Born_jets); std::poisson_distribution dist(ng_mean); const int ng = dist(ran_.get()); assert(ng >= 0); assert(ng < ng_max); weight_ *= std::tgamma(ng + 1)*std::exp(ng_mean)*std::pow(ng_mean, -ng); return ng; } void PhaseSpacePoint::copy_AWZH_boson_from(Event const & event){ auto const & from = event.outgoing(); const auto AWZH_boson = std::find_if( begin(from), end(from), [](Particle const & p){ return is_AWZH_boson(p); } ); if(AWZH_boson == end(from)) return; auto insertion_point = std::lower_bound( begin(outgoing_), end(outgoing_), *AWZH_boson, rapidity_less{} ); outgoing_.insert(insertion_point, *AWZH_boson); // copy decay products const int idx = std::distance(begin(from), AWZH_boson); const auto decay_it = event.decays().find(idx); if(decay_it != end(event.decays())){ const int new_idx = std::distance(begin(outgoing_), insertion_point); assert(outgoing_[new_idx].type == AWZH_boson->type); decays_.emplace(new_idx, decay_it->second); } assert(std::is_sorted(begin(outgoing_), end(outgoing_), rapidity_less{})); } PhaseSpacePoint::PhaseSpacePoint( Event const & ev, PhaseSpacePointConfig conf, RHEJ::RNG & ran ): unob_{has_unob_gluon(ev.incoming(), ev.outgoing())}, unof_{!unob_ && has_unof_gluon(ev.incoming(), ev.outgoing())}, param_{std::move(conf)}, ran_{ran} { weight_ = 1; const auto Born_jets = sorted_by_rapidity(ev.jets()); const int ng = sample_ng(Born_jets); weight_ /= std::tgamma(ng + 1); const int ng_jets = sample_ng_jets(ng, Born_jets); std::vector out_partons = gen_non_jet( ng - ng_jets, CMINPT, param_.jet_param.min_pt ); { const auto qperp = std::accumulate( begin(out_partons), end(out_partons), fastjet::PseudoJet{} ); const auto jets = reshuffle(Born_jets, qperp); if(weight_ == 0.) return; if(! pass_resummation_cuts(jets)){ weight_ = 0.; return; } std::vector jet_partons = split(jets, ng_jets); if(weight_ == 0.) return; rescale_rapidities( out_partons, most_backward_FKL(jet_partons).rapidity(), most_forward_FKL(jet_partons).rapidity() ); if(! cluster_jets(out_partons).empty()){ weight_ = 0.; return; } std::sort(begin(out_partons), end(out_partons), rapidity_less{}); assert( std::is_sorted(begin(jet_partons), end(jet_partons), rapidity_less{}) ); const auto first_jet_parton = out_partons.insert( end(out_partons), begin(jet_partons), end(jet_partons) ); std::inplace_merge( begin(out_partons), first_jet_parton, end(out_partons), rapidity_less{} ); } if(! jets_ok(Born_jets, out_partons)){ weight_ = 0.; return; } weight_ *= phase_space_normalisation(Born_jets.size(), out_partons.size()); outgoing_.reserve(out_partons.size() + 1); // one slot for possible A, W, Z, H for(auto & p: out_partons){ outgoing_.emplace_back(Particle{pid::gluon, std::move(p)}); } most_backward_FKL(outgoing_).type = ev.incoming().front().type; most_forward_FKL(outgoing_).type = ev.incoming().back().type; copy_AWZH_boson_from(ev); assert(!outgoing_.empty()); reconstruct_incoming(ev.incoming()); } std::vector PhaseSpacePoint::gen_non_jet( int count, double ptmin, double ptmax ){ // heuristic parameters for pt sampling const double ptpar = 1.3 + count/5.; const double temp1 = atan((ptmax - ptmin)/ptpar); std::vector partons(count); for(size_t i = 0; i < (size_t) count; ++i){ const double r1 = ran_.get().flat(); const double pt = ptmin + ptpar*tan(r1*temp1); const double temp2 = cos(r1*temp1); const double phi = 2*M_PI*ran_.get().flat(); weight_ *= 2.0*M_PI*pt*ptpar*temp1/(temp2*temp2); // we don't know the allowed rapidity span yet, // set a random value to be rescaled later on const double y = ran_.get().flat(); partons[i].reset_PtYPhiM(pt, y, phi); // Set user index higher than any jet-parton index // in order to assert that these are not inside jets partons[i].set_user_index(i + 1 + ng_max); assert(ptmin-1e-5 <= partons[i].pt() && partons[i].pt() <= ptmax+1e-5); } assert(std::all_of(partons.cbegin(), partons.cend(), is_nonjet_parton)); return partons; } void PhaseSpacePoint::rescale_rapidities( std::vector & partons, double ymin, double ymax ){ constexpr double ep = 1e-7; for(auto & parton: partons){ assert(0 <= parton.rapidity() && parton.rapidity() <= 1); const double dy = ymax - ymin - 2*ep; const double y = ymin + ep + dy*parton.rapidity(); parton.reset_momentum_PtYPhiM(parton.pt(), y, parton.phi()); weight_ *= dy; assert(ymin <= parton.rapidity() && parton.rapidity() <= ymax); } } namespace { template auto min(T const & a, T const & b, Rest&&... r) { using std::min; return min(a, min(b, std::forward(r)...)); } } double PhaseSpacePoint::probability_in_jet( std::vector const & Born_jets ) const{ assert(std::is_sorted(begin(Born_jets), end(Born_jets), rapidity_less{})); assert(Born_jets.size() >= 2); const double dy = Born_jets.back().rapidity() - Born_jets.front().rapidity(); const double R = param_.jet_param.def.R(); const int njets = Born_jets.size(); const double p_J_y_large = (njets-1)*R*R/(2.*dy); const double p_J_y0 = njets*R/M_PI; return min(p_J_y_large, p_J_y0, 1.); } int PhaseSpacePoint::sample_ng_jets( int ng, std::vector const & Born_jets ){ const double p_J = probability_in_jet(Born_jets); std::binomial_distribution<> bin_dist(ng, p_J); const int ng_J = bin_dist(ran_.get()); weight_ *= std::pow(p_J, -ng_J)*std::pow(1 - p_J, ng_J - ng); return ng_J; } - std::vector - PhaseSpacePoint::reshuffle( + std::vector PhaseSpacePoint::reshuffle( std::vector const & Born_jets, fastjet::PseudoJet const & q ){ if(q == fastjet::PseudoJet{0, 0, 0, 0}) return Born_jets; - std::vector jets = resummation_jet_momenta(Born_jets, q); + const auto jets = resummation_jet_momenta(Born_jets, q); if(jets.empty()){ weight_ = 0; return {}; } - // transform delta functions to integration over resummation momenta - weight_ /= Jacobian(jets, q); + + // additional Jacobian to ensure Born integration over delta gives 1 + weight_ *= Jacobian(Born_jets, q); return jets; } std::vector PhaseSpacePoint::distribute_jet_partons( int ng_jets, std::vector const & jets ){ size_t first_valid_jet = 0; size_t num_valid_jets = jets.size(); const double R_eff = 5./3.*param_.jet_param.def.R(); // if there is an unordered jet too far away from the FKL jets // then extra gluon constituents of the unordered jet would // violate the FKL rapidity ordering if(unob_ && jets[0].delta_R(jets[1]) > R_eff){ ++first_valid_jet; --num_valid_jets; } else if(unof_ && jets[jets.size()-1].delta_R(jets[jets.size()-2]) > R_eff){ --num_valid_jets; } std::vector np(jets.size(), 1); for(int i = 0; i < ng_jets; ++i){ ++np[first_valid_jet + ran_.get().flat() * num_valid_jets]; } weight_ *= std::pow(num_valid_jets, ng_jets); return np; } #ifndef NDEBUG namespace{ bool tagged_FKL_backward( std::vector const & jet_partons ){ return std::find_if( begin(jet_partons), end(jet_partons), [](fastjet::PseudoJet const & p){ return p.user_index() == backward_FKL_idx; } ) != end(jet_partons); } bool tagged_FKL_forward( std::vector const & jet_partons ){ // the most forward FKL parton is most likely near the end of jet_partons; // start search from there return std::find_if( jet_partons.rbegin(), jet_partons.rend(), [](fastjet::PseudoJet const & p){ return p.user_index() == forward_FKL_idx; } ) != jet_partons.rend(); } bool tagged_FKL_extremal( std::vector const & jet_partons ){ return tagged_FKL_backward(jet_partons) && tagged_FKL_forward(jet_partons); } } // namespace anonymous #endif std::vector PhaseSpacePoint::split( std::vector const & jets, int ng_jets ){ return split(jets, distribute_jet_partons(ng_jets, jets)); } bool PhaseSpacePoint::pass_extremal_cuts( fastjet::PseudoJet const & ext_parton, fastjet::PseudoJet const & jet ) const{ if(ext_parton.pt() < param_.min_extparton_pt) return false; return (ext_parton - jet).pt()/jet.pt() < param_.max_ext_soft_pt_fraction; } std::vector PhaseSpacePoint::split( std::vector const & jets, std::vector const & np ){ assert(! jets.empty()); assert(jets.size() == np.size()); assert(pass_resummation_cuts(jets)); const size_t most_backward_FKL_idx = 0 + unob_; const size_t most_forward_FKL_idx = jets.size() - 1 - unof_; const auto & jet = param_.jet_param; const JetSplitter jet_splitter{jet.def, jet.min_pt, ran_}; std::vector jet_partons; // randomly distribute jet gluons among jets for(size_t i = 0; i < jets.size(); ++i){ auto split_res = jet_splitter.split(jets[i], np[i]); weight_ *= split_res.weight; if(weight_ == 0) return {}; assert( std::all_of( begin(split_res.constituents), end(split_res.constituents), is_jet_parton ) ); const auto first_new_parton = jet_partons.insert( end(jet_partons), begin(split_res.constituents), end(split_res.constituents) ); // mark uno and extremal FKL emissions here so we can check // their position once all emissions are generated auto extremal = end(jet_partons); if((unob_ && i == 0) || i == most_backward_FKL_idx){ // unordered or FKL backward emission extremal = std::min_element( first_new_parton, end(jet_partons), rapidity_less{} ); extremal->set_user_index( (i == most_backward_FKL_idx)?backward_FKL_idx:unob_idx ); } else if((unof_ && i == jets.size() - 1) || i == most_forward_FKL_idx){ // unordered or FKL forward emission extremal = std::max_element( first_new_parton, end(jet_partons), rapidity_less{} ); extremal->set_user_index( (i == most_forward_FKL_idx)?forward_FKL_idx:unof_idx ); } if( extremal != end(jet_partons) && !pass_extremal_cuts(*extremal, jets[i]) ){ weight_ = 0; return {}; } } assert(tagged_FKL_extremal(jet_partons)); std::sort(begin(jet_partons), end(jet_partons), rapidity_less{}); if( !extremal_ok(jet_partons) || !split_preserved_jets(jets, jet_partons) ){ weight_ = 0.; return {}; } return jet_partons; } bool PhaseSpacePoint::extremal_ok( std::vector const & partons ) const{ assert(std::is_sorted(begin(partons), end(partons), rapidity_less{})); if(unob_ && partons.front().user_index() != unob_idx) return false; if(unof_ && partons.back().user_index() != unof_idx) return false; return most_backward_FKL(partons).user_index() == backward_FKL_idx && most_forward_FKL(partons).user_index() == forward_FKL_idx; } bool PhaseSpacePoint::split_preserved_jets( std::vector const & jets, std::vector const & jet_partons ) const{ assert(std::is_sorted(begin(jets), end(jets), rapidity_less{})); const auto split_jets = sorted_by_rapidity(cluster_jets(jet_partons)); // this can happen if two overlapping jets // are both split into more than one parton if(split_jets.size() != jets.size()) return false; for(size_t i = 0; i < split_jets.size(); ++i){ // this can happen if there are two overlapping jets // and a parton is assigned to the "wrong" jet if(!nearby_ep(jets[i].rapidity(), split_jets[i].rapidity(), 1e-2)){ return false; } } return true; } template Particle const & PhaseSpacePoint::most_backward_FKL( std::vector const & partons ) const{ return partons[0 + unob_]; } template Particle const & PhaseSpacePoint::most_forward_FKL( std::vector const & partons ) const{ const size_t idx = partons.size() - 1 - unof_; assert(idx < partons.size()); return partons[idx]; } template Particle & PhaseSpacePoint::most_backward_FKL( std::vector & partons ) const{ return partons[0 + unob_]; } template Particle & PhaseSpacePoint::most_forward_FKL( std::vector & partons ) const{ const size_t idx = partons.size() - 1 - unof_; assert(idx < partons.size()); return partons[idx]; } namespace { bool contains_idx( fastjet::PseudoJet const & jet, fastjet::PseudoJet const & parton ){ auto const & constituents = jet.constituents(); const int idx = parton.user_index(); return std::find_if( begin(constituents), end(constituents), [idx](fastjet::PseudoJet const & con){return con.user_index() == idx;} ) != end(constituents); } } /** * final jet test: * - number of jets must match Born kinematics * - no partons designated as nonjet may end up inside jets * - all other outgoing partons *must* end up inside jets * - the extremal (in rapidity) partons must be inside the extremal jets * - rapidities must be the same (by construction) */ bool PhaseSpacePoint::jets_ok( std::vector const & Born_jets, std::vector const & partons ) const{ fastjet::ClusterSequence cs(partons, param_.jet_param.def); const auto jets = sorted_by_rapidity(cs.inclusive_jets(param_.jet_param.min_pt)); if(jets.size() != Born_jets.size()) return false; int in_jet = 0; for(size_t i = 0; i < jets.size(); ++i){ assert(jets[i].has_constituents()); for(auto && parton: jets[i].constituents()){ if(is_nonjet_parton(parton)) return false; } in_jet += jets[i].constituents().size(); } const int expect_in_jet = std::count_if( partons.cbegin(), partons.cend(), is_jet_parton ); if(in_jet != expect_in_jet) return false; // note that PseudoJet::contains does not work here if(! ( contains_idx(most_backward_FKL(jets), most_backward_FKL(partons)) && contains_idx(most_forward_FKL(jets), most_forward_FKL(partons)) )) return false; if(unob_ && !contains_idx(jets.front(), partons.front())) return false; if(unof_ && !contains_idx(jets.back(), partons.back())) return false; for(size_t i = 0; i < jets.size(); ++i){ assert(nearby_ep(jets[i].rapidity(), Born_jets[i].rapidity(), 1e-2)); } return true; } void PhaseSpacePoint::reconstruct_incoming( std::array const & Born_incoming ){ std::tie(incoming_[0].p, incoming_[1].p) = incoming_momenta(outgoing_); for(size_t i = 0; i < incoming_.size(); ++i){ incoming_[i].type = Born_incoming[i].type; } assert(momentum_conserved()); } double PhaseSpacePoint::phase_space_normalisation( int num_Born_jets, int num_out_partons ) const{ return pow(16*pow(M_PI,3), num_Born_jets - num_out_partons); } bool PhaseSpacePoint::momentum_conserved() const{ fastjet::PseudoJet diff; for(auto const & in: incoming()) diff += in.p; const double norm = diff.E(); for(auto const & out: outgoing()) diff -= out.p; return nearby(diff, fastjet::PseudoJet{}, norm); } } //namespace RHEJ diff --git a/src/RivetAnalysis.cc b/src/RivetAnalysis.cc index eb94b4d..ceef85d 100644 --- a/src/RivetAnalysis.cc +++ b/src/RivetAnalysis.cc @@ -1,110 +1,109 @@ #include "RHEJ/RivetAnalysis.hh" #ifdef RHEJ_BUILD_WITH_RIVET #include #include "RHEJ/Event.hh" #include "yaml-cpp/yaml.h" #include "Rivet/AnalysisHandler.hh" #endif namespace RHEJ{ std::unique_ptr RivetAnalysis::create(YAML::Node const & config){ return std::unique_ptr{new RivetAnalysis{config}}; } } #ifdef RHEJ_BUILD_WITH_RIVET namespace RHEJ { RivetAnalysis::RivetAnalysis(YAML::Node const & config): output_name_{config["output"].as()}, first_event_(true) { // read in analyses const auto & name_node = config["rivet"]; switch(name_node.Type()){ case YAML::NodeType::Scalar: analyses_names_.push_back(name_node.as()); break; case YAML::NodeType::Sequence: for(YAML::const_iterator it = name_node.begin(); it != name_node.end(); ++it){ analyses_names_.push_back(it->as()); } break; default: throw std::invalid_argument{ "No Analysis was provided to rivet. " "Either give an analysis or deactivate rivet." }; } } void RivetAnalysis::init(Event const & event){ rivet_runs_.push_back( {std::make_unique(), "", HepMCInterface()} ); rivet_runs_.back().handler->addAnalyses(analyses_names_); if( !event.variations().empty() ){ + rivet_runs_.reserve(event.variations().size()+1); for(auto const & vari : event.variations()){ std::ostringstream name; - // calculate name ratio of the scales and use them for the output file name name << ".Scale" << vari.description->scale_name << "_MuR" << vari.description->mur_factor << "_MuF" << vari.description->muf_factor; - /// @TODO replace this by proper weight name rivet_runs_.push_back( {std::make_unique(), name.str(), HepMCInterface()} ); rivet_runs_.back().handler->addAnalyses(analyses_names_); } } } void RivetAnalysis::fill(Event const & event, Event const &){ if(first_event_){ first_event_=false; init(event); } HepMC::GenEvent hepmc_kin(rivet_runs_[0].hepmc.init_kinematics(event)); for(size_t i = 0; i < rivet_runs_.size(); ++i){ auto & run = rivet_runs_[i]; run.hepmc.set_central(hepmc_kin, event, i-1); // -1: first = central run.handler->analyze(hepmc_kin); } } void RivetAnalysis::finalise(){ for(auto const & run: rivet_runs_){ run.handler->finalize(); run.handler->writeData(output_name_+run.name+std::string(".yoda")); } } } // namespace RHEJ #else // no rivet => create empty analysis namespace Rivet { class AnalysisHandler {}; } namespace RHEJ { RivetAnalysis::RivetAnalysis(YAML::Node const &) { throw std::invalid_argument( "Failed to create RivetAnalysis: " "Reversed HEJ was built without rivet support" ); } void RivetAnalysis::init(Event const &){} void RivetAnalysis::fill(Event const &, Event const &){} void RivetAnalysis::finalise(){} } // namespace RHEJ #endif diff --git a/src/Wjets.cc b/src/Wjets.cc index 1d69ce6..5609b25 100644 --- a/src/Wjets.cc +++ b/src/Wjets.cc @@ -1,1973 +1,1958 @@ #include "RHEJ/currents.hh" #include "RHEJ/utility.hh" #include "RHEJ/Tensor.hh" #include "RHEJ/Constants.hh" #include #include namespace { // Helper Functions // FKL W Helper Functions void jW (CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector pe, bool hele, CLHEP::HepLorentzVector pnu, bool helnu, CLHEP::HepLorentzVector pin, bool helin, current cur) { // NOTA BENE: Conventions for W+ --> e+ nu, so that nu is lepton(6), e is anti-lepton(5) // Need to swap e and nu for events with W- --> e- nubar! if (helin==helout && hele==helnu) { CLHEP::HepLorentzVector qa=pout+pe+pnu; CLHEP::HepLorentzVector qb=pin-pe-pnu; double ta(qa.m2()),tb(qb.m2()); current t65,vout,vin,temp2,temp3,temp5; joo(pnu,helnu,pe,hele,t65); vout[0]=pout.e(); vout[1]=pout.x(); vout[2]=pout.y(); vout[3]=pout.z(); vin[0]=pin.e(); vin[1]=pin.x(); vin[2]=pin.y(); vin[3]=pin.z(); COM brac615=cdot(t65,vout); COM brac645=cdot(t65,vin); // prod1565 and prod6465 are zero for Ws (not Zs)!! joo(pout,helout,pnu,helout,temp2); COM prod1665=cdot(temp2,t65); j(pe,helin,pin,helin,temp3); COM prod5465=cdot(temp3,t65); joo(pout,helout,pe,helout,temp2); j(pnu,helnu,pin,helin,temp3); j(pout,helout,pin,helin,temp5); current term1,term2,term3,sum; cmult(2.*brac615/ta+2.*brac645/tb,temp5,term1); cmult(prod1665/ta,temp3,term2); cmult(-prod5465/tb,temp2,term3); cadd(term1,term2,term3,sum); cur[0]=sum[0]; cur[1]=sum[1]; cur[2]=sum[2]; cur[3]=sum[3]; } } void jWbar (CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector pe, bool hele, CLHEP::HepLorentzVector pnu, bool helnu, CLHEP::HepLorentzVector pin, bool helin, current cur) { // NOTA BENE: Conventions for W+ --> e+ nu, so that nu is lepton(6), e is anti-lepton(5) // Need to swap e and nu for events with W- --> e- nubar! if (helin==helout && hele==helnu) { CLHEP::HepLorentzVector qa=pout+pe+pnu; CLHEP::HepLorentzVector qb=pin-pe-pnu; double ta(qa.m2()),tb(qb.m2()); current t65,vout,vin,temp2,temp3,temp5; joo(pnu,helnu,pe,hele,t65); vout[0]=pout.e(); vout[1]=pout.x(); vout[2]=pout.y(); vout[3]=pout.z(); vin[0]=pin.e(); vin[1]=pin.x(); vin[2]=pin.y(); vin[3]=pin.z(); COM brac615=cdot(t65,vout); COM brac645=cdot(t65,vin); // prod1565 and prod6465 are zero for Ws (not Zs)!! joo(pe,helout,pout,helout,temp2); // temp2 is <5|alpha|1> COM prod5165=cdot(temp2,t65); jio(pin,helin,pnu,helin,temp3); // temp3 is <4|alpha|6> COM prod4665=cdot(temp3,t65); joo(pnu,helout,pout,helout,temp2); // temp2 is now <6|mu|1> jio(pin,helin,pe,helin,temp3); // temp3 is now <4|mu|5> jio(pin,helin,pout,helout,temp5); // temp5 is <4|mu|1> current term1,term2,term3,sum; cmult(-2.*brac615/ta-2.*brac645/tb,temp5,term1); cmult(-prod5165/ta,temp3,term2); cmult(prod4665/tb,temp2,term3); cadd(term1,term2,term3,sum); cur[0]=sum[0]; cur[1]=sum[1]; cur[2]=sum[2]; cur[3]=sum[3]; } } CCurrent jW (CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector pe, bool hele, CLHEP::HepLorentzVector pnu, bool helnu, CLHEP::HepLorentzVector pin, bool helin) { COM cur[4]; cur[0]=0.; cur[1]=0.; cur[2]=0.; cur[3]=0.; CCurrent sum(0.,0.,0.,0.); // NOTA BENE: Conventions for W+ --> e+ nu, so that nu is lepton(6), e is anti-lepton(5) // Need to swap e and nu for events with W- --> e- nubar! if (helin==helout && hele==helnu) { CLHEP::HepLorentzVector qa=pout+pe+pnu; CLHEP::HepLorentzVector qb=pin-pe-pnu; double ta(qa.m2()),tb(qb.m2()); CCurrent temp2,temp3,temp5; CCurrent t65 = joo(pnu,helnu,pe,hele); CCurrent vout(pout.e(),pout.x(),pout.y(),pout.z()); CCurrent vin(pin.e(),pin.x(),pin.y(),pin.z()); COM brac615=t65.dot(vout); COM brac645=t65.dot(vin); // prod1565 and prod6465 are zero for Ws (not Zs)!! temp2 = joo(pout,helout,pnu,helout); COM prod1665=temp2.dot(t65); temp3 = j(pe,helin,pin,helin); COM prod5465=temp3.dot(t65); temp2=joo(pout,helout,pe,helout); temp3=j(pnu,helnu,pin,helin); temp5=j(pout,helout,pin,helin); CCurrent term1,term2,term3; term1=(2.*brac615/ta+2.*brac645/tb)*temp5; term2=(prod1665/ta)*temp3; term3=(-prod5465/tb)*temp2; sum=term1+term2+term3; } return sum; } CCurrent jWbar (CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector pe, bool hele, CLHEP::HepLorentzVector pnu, bool helnu, CLHEP::HepLorentzVector pin, bool helin) { COM cur[4]; cur[0]=0.; cur[1]=0.; cur[2]=0.; cur[3]=0.; CCurrent sum(0.,0.,0.,0.); // NOTA BENE: Conventions for W+ --> e+ nu, so that nu is lepton(6), e is anti-lepton(5) // Need to swap e and nu for events with W- --> e- nubar! if (helin==helout && hele==helnu) { CLHEP::HepLorentzVector qa=pout+pe+pnu; CLHEP::HepLorentzVector qb=pin-pe-pnu; double ta(qa.m2()),tb(qb.m2()); CCurrent temp2,temp3,temp5; CCurrent t65 = joo(pnu,helnu,pe,hele); CCurrent vout(pout.e(),pout.x(),pout.y(),pout.z()); CCurrent vin(pin.e(),pin.x(),pin.y(),pin.z()); COM brac615=t65.dot(vout); COM brac645=t65.dot(vin); // prod1565 and prod6465 are zero for Ws (not Zs)!! temp2 = joo(pe,helout,pout,helout); // temp2 is <5|alpha|1> COM prod5165=temp2.dot(t65); temp3 = jio(pin,helin,pnu,helin); // temp3 is <4|alpha|6> COM prod4665=temp3.dot(t65); temp2=joo(pnu,helout,pout,helout); // temp2 is now <6|mu|1> temp3=jio(pin,helin,pe,helin); // temp3 is now <4|mu|5> temp5=jio(pin,helin,pout,helout); // temp5 is <4|mu|1> CCurrent term1,term2,term3; term1 =(-2.*brac615/ta-2.*brac645/tb)*temp5; term2 =(-prod5165/ta)*temp3; term3 =(prod4665/tb)*temp2; sum = term1 + term2 + term3; } return sum; } // Relevant W+Jets Unordered Contribution Helper Functions // W+Jets Uno double jM2Wuno(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1,CLHEP::HepLorentzVector plbar, CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector pa, bool h1, CLHEP::HepLorentzVector p2, CLHEP::HepLorentzVector pb, bool h2, bool pol) { static bool is_sigma_index_set(false); if(!is_sigma_index_set){ //std::cout<<"Setting sigma_index...." << std::endl; if(init_sigma_index()) is_sigma_index_set = true; else return 0.; } CLHEP::HepLorentzVector pW = pl+plbar; CLHEP::HepLorentzVector q1g=pa-pW-p1-pg; CLHEP::HepLorentzVector q1 = pa-p1-pW; CLHEP::HepLorentzVector q2 = p2-pb; const double taW = (pa-pW).m2(); const double taW1 = (pa-pW-p1).m2(); const double tb2 = (pb-p2).m2(); const double tb2g = (pb-p2-pg).m2(); const double s1W = (p1+pW).m2(); const double s1gW = (p1+pW+pg).m2(); const double s1g = (p1+pg).m2(); const double tag = (pa-pg).m2(); const double taWg = (pa-pW-pg).m2(); const double ca = RHEJ::C_A; const double cf = RHEJ::C_F; /// epsg = eps(pg,p2,pol); Tensor<1,4> epsW = TCurrent(pl,false,plbar,false); Tensor<1,4> j2b = TCurrent(p2,h2,pb,h2); Tensor<1,4> Tq1q2 = Construct1Tensor((q1+q2)/taW1 + (pb/pb.dot(pg) + p2/p2.dot(pg)) * tb2/(2*tb2g)); Tensor<1,4> Tq1g = Construct1Tensor((-pg-q1))/taW1; Tensor<1,4> Tq2g = Construct1Tensor((pg-q2)); Tensor<1,4> TqaW = Construct1Tensor((pa-pW));//pa-pw Tensor<1,4> Tqag = Construct1Tensor((pa-pg)); Tensor<1,4> TqaWg = Construct1Tensor((pa-pg-pW)); Tensor<1,4> Tp1g = Construct1Tensor((p1+pg)); Tensor<1,4> Tp1W = Construct1Tensor((p1+pW));//p1+pw Tensor<1,4> Tp1gW = Construct1Tensor((p1+pg+pW));//p1+pw+pg Tensor<2,4> g=Metric(); Tensor<3,4> J31a = T3Current(p1, h1, pa, h1); Tensor<2,4> J2_qaW =J31a.contract(TqaW/taW, 2); Tensor<2,4> J2_p1W =J31a.contract(Tp1W/s1W, 2); Tensor<3,4> L1a =J2_qaW.leftprod(Tq1q2); Tensor<3,4> L1b =J2_p1W.leftprod(Tq1q2); Tensor<3,4> L2a = J2_qaW.leftprod(Tq1g); Tensor<3,4> L2b = J2_p1W.leftprod(Tq1g); Tensor<3,4> L3 = (g.rightprod(J2_qaW.contract(Tq2g,1)+J2_p1W.contract(Tq2g,2)))/taW1; Tensor<3,4> L(0.); Tensor<5,4> J51a = T5Current(p1, h1, pa, h1); Tensor<4,4> J_qaW = J51a.contract(TqaW,4); Tensor<4,4> J_qag = J51a.contract(Tqag,4); Tensor<4,4> J_p1gW = J51a.contract(Tp1gW,4); Tensor<3,4> U1a = J_qaW.contract(Tp1g,2); Tensor<3,4> U1b = J_p1gW.contract(Tp1g,2); Tensor<3,4> U1c = J_p1gW.contract(Tp1W,2); Tensor<3,4> U1(0.); Tensor<3,4> U2a = J_qaW.contract(TqaWg,2); Tensor<3,4> U2b = J_qag.contract(TqaWg,2); Tensor<3,4> U2c = J_qag.contract(Tp1W,2); Tensor<3,4> U2(0.); for(int nu=0; nu<4;nu++){ for(int mu=0;mu<4;mu++){ for(int rho=0;rho<4;rho++){ L.Set(nu, mu, rho, L1a.at(nu,mu,rho) + L1b.at(nu,rho,mu) + L2a.at(mu,nu,rho) + L2b.at(mu,rho,nu) + L3.at(mu,nu,rho)); U1.Set(nu, mu, rho, U1a.at(nu, mu, rho) / (s1g*taW) + U1b.at(nu,rho,mu) / (s1g*s1gW) + U1c.at(rho,nu,mu) / (s1W*s1gW)); U2.Set(nu,mu,rho,U2a.at(mu,nu,rho) / (taWg*taW) + U2b.at(mu,rho,nu) / (taWg*tag) + U2c.at(rho,mu,nu) / (s1W*tag)); } } } COM X = ((((U1-L).contract(epsW,3)).contract(j2b,2)).contract(epsg,1)).at(0); COM Y = ((((U2+L).contract(epsW,3)).contract(j2b,2)).contract(epsg,1)).at(0); double amp = ca*cf*cf/2.*(norm(X)+norm(Y)) - cf/2.*(X*conj(Y)).real(); double t1 = q1g.m2(); double t2 = q2.m2(); //Divide by t-channels amp/=(t1*t2); //Average over initial states amp/=(4.*ca*ca); return amp; } // Relevant Wqqx Helper Functions. //g->qxqlxl (Calculates gluon to qqx Current. See JV_\mu in WSubleading Notes) Tensor <1,4> gtqqxW(CLHEP::HepLorentzVector pq,CLHEP::HepLorentzVector pqbar,CLHEP::HepLorentzVector pl,CLHEP::HepLorentzVector plbar){ double s2AB=(pl+plbar+pq).m2(); double s3AB=(pl+plbar+pqbar).m2(); Tensor<1,4> Tpq = Construct1Tensor(pq); Tensor<1,4> Tpqbar = Construct1Tensor(pqbar); Tensor<1,4> TAB = Construct1Tensor(pl+plbar); // Define llx current. Tensor<1,4> ABCur = TCurrent(pl, false, plbar, false); //blank 3 Gamma Current Tensor<3,4> JV23 = T3Current(pq,false,pqbar,false); // Components of g->qqW before W Contraction Tensor<2,4> JV1 = JV23.contract((Tpq + TAB),2)/(s2AB); Tensor<2,4> JV2 = JV23.contract((Tpqbar + TAB),2)/(s3AB); // g->qqW Current. Note Minus between terms due to momentum flow. // Also note: (-I)^2 from W vert. (I) from Quark prop. Tensor<1,4> JVCur = (JV1.contract(ABCur,1) - JV2.contract(ABCur,2))*COM(0.,-1.); return JVCur; } // Helper Functions Calculate the Crossed Contribution Tensor <2,4> MCrossW(CLHEP::HepLorentzVector pa,CLHEP::HepLorentzVector p1,CLHEP::HepLorentzVector pb,CLHEP::HepLorentzVector p4, CLHEP::HepLorentzVector pq,CLHEP::HepLorentzVector pqbar,CLHEP::HepLorentzVector pl,CLHEP::HepLorentzVector plbar, std::vector partons, int nabove){ // Useful propagator factors double s2AB=(pl+plbar+pq).m2(); double s3AB=(pl+plbar+pqbar).m2(); CLHEP::HepLorentzVector q1, q3; q1=pa; for(int i=0; i Tp1 = Construct1Tensor(p1); Tensor<1,4> Tp4 = Construct1Tensor(p4); Tensor<1,4> Tpa = Construct1Tensor(pa); Tensor<1,4> Tpb = Construct1Tensor(pb); Tensor<1,4> Tpq = Construct1Tensor(pq); Tensor<1,4> Tpqbar = Construct1Tensor(pqbar); Tensor<1,4> TAB = Construct1Tensor(pl+plbar); Tensor<1,4> Tq1 = Construct1Tensor(q1); Tensor<1,4> Tq3 = Construct1Tensor(q3); Tensor<2,4> g=Metric(); // Define llx current. Tensor<1,4> ABCur = TCurrent(pl, false, plbar,false); //Blank 5 gamma Current Tensor<5,4> J523 = T5Current(pq,false,pqbar,false); // 4 gamma currents (with 1 contraction already). Tensor<4,4> J_q3q = J523.contract((Tq3+Tpq),2); Tensor<4,4> J_2AB = J523.contract((Tpq+TAB),2); // Components of Crossed Vertex Contribution Tensor<3,4> Xcro1 = J_q3q.contract((Tpqbar + TAB),3); Tensor<3,4> Xcro2 = J_q3q.contract((Tq1-Tpqbar),3); Tensor<3,4> Xcro3 = J_2AB.contract((Tq1-Tpqbar),3); // Term Denominators Taken Care of at this stage Tensor<2,4> Xcro1Cont = Xcro1.contract(ABCur,3)/(tcro1*s3AB); Tensor<2,4> Xcro2Cont = Xcro2.contract(ABCur,2)/(tcro1*tcro2); Tensor<2,4> Xcro3Cont = Xcro3.contract(ABCur,1)/(s2AB*tcro2); //Initialise the Crossed Vertex Object Tensor<2,4> Xcro(0.); for(int mu=0; mu<4;mu++){ for(int nu=0;nu<4;nu++){ Xcro.Set(mu,nu, -(-Xcro1Cont.at(nu,mu)+Xcro2Cont.at(nu,mu)+Xcro3Cont.at(nu,mu))); } } return Xcro; } // Helper Functions Calculate the Uncrossed Contribution Tensor <2,4> MUncrossW(CLHEP::HepLorentzVector pa, CLHEP::HepLorentzVector p1, CLHEP::HepLorentzVector pb, CLHEP::HepLorentzVector p4, CLHEP::HepLorentzVector pq,CLHEP::HepLorentzVector pqbar,CLHEP::HepLorentzVector pl,CLHEP::HepLorentzVector plbar, std::vector partons, int nabove){ double s2AB=(pl+plbar+pq).m2(); double s3AB=(pl+plbar+pqbar).m2(); CLHEP::HepLorentzVector q1, q3; q1=pa; for(int i=0; i Tp1 = Construct1Tensor(p1); Tensor<1,4> Tp4 = Construct1Tensor(p4); Tensor<1,4> Tpa = Construct1Tensor(pa); Tensor<1,4> Tpb = Construct1Tensor(pb); Tensor<1,4> Tpq = Construct1Tensor(pq); Tensor<1,4> Tpqbar = Construct1Tensor(pqbar); Tensor<1,4> TAB = Construct1Tensor(pl+plbar); Tensor<1,4> Tq1 = Construct1Tensor(q1); Tensor<1,4> Tq3 = Construct1Tensor(q3); Tensor<2,4> g=Metric(); // Define llx current. Tensor<1,4> ABCur = TCurrent(pl, false, plbar, false); //Blank 5 gamma Current Tensor<5,4> J523 = T5Current(pq,false,pqbar,false); // 4 gamma currents (with 1 contraction already). Tensor<4,4> J_2AB = J523.contract((Tpq+TAB),2); Tensor<4,4> J_q1q = J523.contract((Tq1-Tpq),2); // 2 Contractions taken care of. Tensor<3,4> Xunc1 = J_2AB.contract((Tq3+Tpqbar),3); Tensor<3,4> Xunc2 = J_q1q.contract((Tq3+Tpqbar),3); Tensor<3,4> Xunc3 = J_q1q.contract((Tpqbar+TAB),3); // Term Denominators Taken Care of at this stage Tensor<2,4> Xunc1Cont = Xunc1.contract(ABCur,1)/(s2AB*tunc2); Tensor<2,4> Xunc2Cont = Xunc2.contract(ABCur,2)/(tunc1*tunc2); Tensor<2,4> Xunc3Cont = Xunc3.contract(ABCur,3)/(tunc1*s3AB); //Initialise the Uncrossed Vertex Object Tensor<2,4> Xunc(0.); for(int mu=0; mu<4;mu++){ for(int nu=0;nu<4;nu++){ Xunc.Set(mu,nu,-(- Xunc1Cont.at(mu,nu)+Xunc2Cont.at(mu,nu) +Xunc3Cont.at(mu,nu))); } } return Xunc; } // Helper Functions Calculate the g->qqxW (Eikonal) Contributions Tensor <2,4> MSymW(CLHEP::HepLorentzVector pa,CLHEP::HepLorentzVector p1,CLHEP::HepLorentzVector pb,CLHEP::HepLorentzVector p4, CLHEP::HepLorentzVector pq,CLHEP::HepLorentzVector pqbar,CLHEP::HepLorentzVector pl,CLHEP::HepLorentzVector plbar, std::vector partons, int nabove){ double sa2=(pa+pq).m2(); double s12=(p1+pq).m2(); double sa3=(pa+pqbar).m2(); double s13=(p1+pqbar).m2(); double saA=(pa+pl).m2(); double s1A=(p1+pl).m2(); double saB=(pa+plbar).m2(); double s1B=(p1+plbar).m2(); double sb2=(pb+pq).m2(); double s42=(p4+pq).m2(); double sb3=(pb+pqbar).m2(); double s43=(p4+pqbar).m2(); double sbA=(pb+pl).m2(); double s4A=(p4+pl).m2(); double sbB=(pb+plbar).m2(); double s4B=(p4+plbar).m2(); double s23AB=(pl+plbar+pq+pqbar).m2(); CLHEP::HepLorentzVector q1,q3; q1=pa; for(int i=0;i Tp1 = Construct1Tensor(p1); Tensor<1,4> Tp4 = Construct1Tensor(p4); Tensor<1,4> Tpa = Construct1Tensor(pa); Tensor<1,4> Tpb = Construct1Tensor(pb); Tensor<1,4> Tpq = Construct1Tensor(pq); Tensor<1,4> Tpqbar = Construct1Tensor(pqbar); Tensor<1,4> TAB = Construct1Tensor(pl+plbar); Tensor<1,4> Tq1 = Construct1Tensor(q1); Tensor<1,4> Tq3 = Construct1Tensor(q3); Tensor<2,4> g=Metric(); // g->qqW Current (Factors of sqrt2 dealt with in this function.) Tensor<1,4> JV = gtqqxW(pq,pqbar,pl,plbar); // 1a gluon emisson Contribution Tensor<3,4> X1a = g.rightprod(Tp1*(t1/(s12+s13+s1A+s1B)) + Tpa*(t1/(sa2+sa3+saA+saB))); Tensor<2,4> X1aCont = X1a.contract(JV,3); //4b gluon emission Contribution Tensor<3,4> X4b = g.rightprod(Tp4*(t3/(s42+s43+s4A+s4B)) + Tpb*(t3/(sb2+sb3+sbA+sbB))); Tensor<2,4> X4bCont = X4b.contract(JV,3); //Set up each term of 3G diagram. Tensor<3,4> X3g1 = g.leftprod(Tq1+Tpq+Tpqbar+TAB); Tensor<3,4> X3g2 = g.leftprod(Tq3-Tpq-Tpqbar-TAB); Tensor<3,4> X3g3 = g.leftprod((Tq1+Tq3)); // Note the contraction of indices changes term by term Tensor<2,4> X3g1Cont = X3g1.contract(JV,3); Tensor<2,4> X3g2Cont = X3g2.contract(JV,2); Tensor<2,4> X3g3Cont = X3g3.contract(JV,1); // XSym is an amalgamation of x1a, X4b and X3g. Makes sense from a colour factor point of view. Tensor<2,4>Xsym(0.); for(int mu=0; mu<4;mu++){ for(int nu=0;nu<4;nu++){ Xsym.Set(mu,nu, (X3g1Cont.at(nu,mu) + X3g2Cont.at(mu,nu) - X3g3Cont.at(nu,mu)) + (X1aCont.at(mu,nu) - X4bCont.at(mu,nu)) ); } } return Xsym/s23AB; } Tensor <2,4> MCross(CLHEP::HepLorentzVector pa, CLHEP::HepLorentzVector pq,CLHEP::HepLorentzVector pqbar, std::vector partons, bool hq, int nabove){ CLHEP::HepLorentzVector q1; q1=pa; for(int i=0;i Tq1 = Construct1Tensor(q1-pqbar); //Blank 3 gamma Current Tensor<3,4> J323 = T3Current(pq,hq,pqbar,hq); // 2 gamma current (with 1 contraction already). Tensor<2,4> XCroCont = J323.contract((Tq1),2)/(t2); //Initialise the Crossed Vertex Tensor<2,4> Xcro(0.); for(int mu=0; mu<4;mu++){ for(int nu=0;nu<4;nu++){ Xcro.Set(mu,nu, (XCroCont.at(nu,mu))); } } return Xcro; } // Helper Functions Calculate the Uncrossed Contribution Tensor <2,4> MUncross(CLHEP::HepLorentzVector pa, CLHEP::HepLorentzVector pq,CLHEP::HepLorentzVector pqbar, std::vector partons, bool hq, int nabove){ CLHEP::HepLorentzVector q1; q1=pa; for(int i=0;i Tq1 = Construct1Tensor(q1-pq); //Blank 3 gamma Current Tensor<3,4> J323 = T3Current(pq,hq,pqbar,hq); // 2 gamma currents (with 1 contraction already). Tensor<2,4> XUncCont = J323.contract((Tq1),2)/t2; //Initialise the Uncrossed Vertex Tensor<2,4> Xunc(0.); for(int mu=0; mu<4;mu++){ for(int nu=0;nu<4;nu++){ Xunc.Set(mu,nu,-(XUncCont.at(mu,nu))); } } return Xunc; } // Helper Functions Calculate the Eikonal Contributions Tensor <2,4> MSym(CLHEP::HepLorentzVector pa,CLHEP::HepLorentzVector p1,CLHEP::HepLorentzVector pb,CLHEP::HepLorentzVector p4, CLHEP::HepLorentzVector pq,CLHEP::HepLorentzVector pqbar, std::vector partons, bool hq, int nabove){ CLHEP::HepLorentzVector q1, q3; q1=pa; for(int i=0;i Tp1 = Construct1Tensor(p1); Tensor<1,4> Tp4 = Construct1Tensor(p4); Tensor<1,4> Tpa = Construct1Tensor(pa); Tensor<1,4> Tpb = Construct1Tensor(pb); Tensor<1,4> Tpq = Construct1Tensor(pq); Tensor<1,4> Tpqbar = Construct1Tensor(pqbar); Tensor<1,4> Tq1 = Construct1Tensor(q1); Tensor<1,4> Tq3 = Construct1Tensor(q3); Tensor<2,4> g=Metric(); Tensor<1,4> qqxCur = TCurrent(pq, hq, pqbar, hq); // // 1a gluon emisson Contribution Tensor<3,4> X1a = g.rightprod(Tp1*(t1/(s12+s13))+Tpa*(t1/(sa2+sa3))); Tensor<2,4> X1aCont = X1a.contract(qqxCur,3); // //4b gluon emission Contribution Tensor<3,4> X4b = g.rightprod(Tp4*(t3/(s42+s43)) + Tpb*(t3/(sb2+sb3))); Tensor<2,4> X4bCont = X4b.contract(qqxCur,3); // New Formulation Corresponding to New Analytics Tensor<3,4> X3g1 = g.leftprod(Tq1+Tpq+Tpqbar); Tensor<3,4> X3g2 = g.leftprod(Tq3-Tpq-Tpqbar); Tensor<3,4> X3g3 = g.leftprod((Tq1+Tq3)); // Note the contraction of indices changes term by term Tensor<2,4> X3g1Cont = X3g1.contract(qqxCur,3); Tensor<2,4> X3g2Cont = X3g2.contract(qqxCur,2); Tensor<2,4> X3g3Cont = X3g3.contract(qqxCur,1); Tensor<2,4>Xsym(0.); for(int mu=0; mu<4;mu++){ for(int nu=0;nu<4;nu++){ Xsym.Set(mu, nu, COM(0,1) * ( (X3g1Cont.at(nu,mu) + X3g2Cont.at(mu,nu) - X3g3Cont.at(nu,mu)) + (X1aCont.at(mu,nu) - X4bCont.at(mu,nu)) ) ); } } return Xsym/s23; } Tensor <1,4> jW4bEmit(HLV pb, HLV p4, HLV pl, HLV plbar, bool aqlinepb){ // Build the external quark line W Emmision Tensor<1,4> ABCurr = TCurrent(pl, false, plbar, false)/2; Tensor<1,4> Tp4W = Construct1Tensor((p4+pl+plbar));//p4+pw Tensor<1,4> TpbW = Construct1Tensor((pb-pl-plbar));//pb-pw Tensor<3,4> J4bBlank; if (aqlinepb){ J4bBlank = T3Current(pb,false,p4,false); } else{ J4bBlank = T3Current(p4,false,pb,false); } double t4AB = (p4+pl+plbar).m2(); double tbAB = (pb-pl-plbar).m2(); Tensor<2,4> J4b1 = (J4bBlank.contract(Tp4W,2))/t4AB; Tensor<2,4> J4b2 = (J4bBlank.contract(TpbW,2))/tbAB; Tensor<2,4> T4bmMom(0.); if (aqlinepb){ for(int mu=0; mu<4;mu++){ for(int nu=0;nu<4;nu++){ T4bmMom.Set(mu,nu, (J4b1.at(nu,mu) + J4b2.at(mu,nu))*(COM(-1,0))); } } } else{ for(int mu=0; mu<4;mu++){ for(int nu=0;nu<4;nu++){ T4bmMom.Set(nu,mu, (J4b1.at(nu,mu) + J4b2.at(mu,nu))); } } } Tensor<1,4> T4bm = T4bmMom.contract(ABCurr,1); return T4bm; } } // Anonymous Namespace helper functions //Functions which can be called elsewhere (declarations in currents.hh). // FKL W+Jets double jMWqQ (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) // Calculates the square of the current contractions for qQ->qenuQ scattering // p1: quark (with W emittance) // p2: Quark { current mj1m,mj2p,mj2m; CLHEP::HepLorentzVector q1=p1in-p1out-pe-pnu; CLHEP::HepLorentzVector q2=-(p2in-p2out); jW(p1out,false,pe,false,pnu,false,p1in,false,mj1m); j(p2out,true,p2in,true,mj2p); j(p2out,false,p2in,false,mj2m); // mj1m.mj2p COM Mmp=cdot(mj1m,mj2p); // mj1m.mj2m COM Mmm=cdot(mj1m,mj2m); // sum of spinor strings ||^2 double a2Mmp=abs2(Mmp); double a2Mmm=abs2(Mmm); // // Leave division by colour and Helicity avg until Tree files // Leave multi. of couplings to later return RHEJ::C_F*RHEJ::C_F*(a2Mmp+a2Mmm)/(q1.m2()*q2.m2()); } double jMWqQbar (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) // Calculates the square of the current contractions for qQ->qenuQ scattering // p1: quark (with W emittance) // p2: Quark { current mj1m,mj2p,mj2m; CLHEP::HepLorentzVector q1=p1in-p1out-pe-pnu; CLHEP::HepLorentzVector q2=-(p2in-p2out); jW(p1out,false,pe,false,pnu,false,p1in,false,mj1m); jio(p2in,true,p2out,true,mj2p); jio(p2in,false,p2out,false,mj2m); // mj1m.mj2p COM Mmp=cdot(mj1m,mj2p); // mj1m.mj2m COM Mmm=cdot(mj1m,mj2m); // sum of spinor strings ||^2 double a2Mmp=abs2(Mmp); double a2Mmm=abs2(Mmm); // // Leave division by colour and Helicity avg until Tree files // Leave multi. of couplings to later return RHEJ::C_F*RHEJ::C_F*(a2Mmp+a2Mmm)/(q1.m2()*q2.m2()); } double jMWqbarQ (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) // Calculates the square of the current contractions for qQ->qenuQ scattering // p1: quark (with W emittance) // p2: Quark { current mj1m,mj2p,mj2m; CLHEP::HepLorentzVector q1=p1in-p1out-pe-pnu; CLHEP::HepLorentzVector q2=-(p2in-p2out); jWbar(p1out,false,pe,false,pnu,false,p1in,false,mj1m); j(p2out,true,p2in,true,mj2p); j(p2out,false,p2in,false,mj2m); // mj1m.mj2p COM Mmp=cdot(mj1m,mj2p); // mj1m.mj2m COM Mmm=cdot(mj1m,mj2m); // sum of spinor strings ||^2 double a2Mmp=abs2(Mmp); double a2Mmm=abs2(Mmm); // // Leave division by colour and Helicity avg until Tree files // Leave multi. of couplings to later return RHEJ::C_F*RHEJ::C_F*(a2Mmp+a2Mmm)/(q1.m2()*q2.m2()); } double jMWqbarQbar (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) // Calculates the square of the current contractions for qQ->qenuQ scattering // p1: quark (with W emittance) // p2: Quark { current mj1m,mj2p,mj2m; CLHEP::HepLorentzVector q1=p1in-p1out-pe-pnu; CLHEP::HepLorentzVector q2=-(p2in-p2out); jWbar(p1out,false,pe,false,pnu,false,p1in,false,mj1m); jio(p2in,true,p2out,true,mj2p); jio(p2in,false,p2out,false,mj2m); // mj1m.mj2p COM Mmp=cdot(mj1m,mj2p); // mj1m.mj2m COM Mmm=cdot(mj1m,mj2m); // sum of spinor strings ||^2 double a2Mmp=abs2(Mmp); double a2Mmm=abs2(Mmm); // // Leave division by colour and Helicity avg until Tree files // Leave multi. of couplings to later return RHEJ::C_F*RHEJ::C_F*(a2Mmp+a2Mmm)/(q1.m2()*q2.m2()); } double jMWqg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) // Calculates the square of the current contractions for qg->qenug scattering // p1: quark // p2: gluon { CLHEP::HepLorentzVector q1=p1in-p1out-pe-pnu; CLHEP::HepLorentzVector q2=-(p2in-p2out); current mj1m,mj2p,mj2m; jW(p1out,false,pe,false,pnu,false,p1in,false,mj1m); j(p2out,true,p2in,true,mj2p); j(p2out,false,p2in,false,mj2m); // mj1m.mj2p COM Mmp=cdot(mj1m,mj2p); // mj1m.mj2m COM Mmm=cdot(mj1m,mj2m); - double ratio; // p2-/pb- in the notes - if (p2in.pz()>0.) // if the gluon is the positive - ratio=p2out.plus()/p2in.plus(); - else // the gluon is the negative - ratio=p2out.minus()/p2in.minus(); - - - double nonflipcolourmult=(1.-1./9.)/2.*(ratio+1./ratio)+1./9.; + const double K = K_g(p2out, p2in); // sum of spinor strings ||^2 double a2Mmp=abs2(Mmp); double a2Mmm=abs2(Mmm); - double sst = nonflipcolourmult*(a2Mmp+a2Mmm); + double sst = K/RHEJ::C_A*(a2Mmp+a2Mmm); // double sstsave=sst; // // Leave division by colour and Helicity avg until Tree files // Leave multi. of couplings to later // Multiply by Cf*Ca=4 return 4.*sst/(q1.m2()*q2.m2()); } double jMWqbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) // Calculates the square of the current contractions for qg->qenug scattering // p1: quark // p2: gluon { CLHEP::HepLorentzVector q1=p1in-p1out-pe-pnu; CLHEP::HepLorentzVector q2=-(p2in-p2out); current mj1m,mj2p,mj2m; jWbar(p1out,false,pe,false,pnu,false,p1in,false,mj1m); j(p2out,true,p2in,true,mj2p); j(p2out,false,p2in,false,mj2m); // mj1m.mj2p COM Mmp=cdot(mj1m,mj2p); // mj1m.mj2m COM Mmm=cdot(mj1m,mj2m); - double ratio; // p2-/pb- in the notes - // if (p2in.plus()>0) // if the gluon is the positive - if (p2in.pz()>0.) // if the gluon is the positive - ratio=p2out.plus()/p2in.plus(); - else // the gluon is the negative - ratio=p2out.minus()/p2in.minus(); - - - double nonflipcolourmult=(1.-1./9.)/2.*(ratio+1./ratio)+1./9.; + const double K = K_g(p2out, p2in); // sum of spinor strings ||^2 double a2Mmp=abs2(Mmp); double a2Mmm=abs2(Mmm); - double sst = nonflipcolourmult*(a2Mmp+a2Mmm); + double sst = K/RHEJ::C_A*(a2Mmp+a2Mmm); // double sstsave=sst; // // Leave division by colour and Helicity avg until Tree files // Leave multi. of couplings to later // Multiply by Cf*Ca=4 return 4.*sst/(q1.m2()*q2.m2()); } // W+Jets Unordered Contributions //qQ->qQWg_unob double junobMWqQg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector pg) // Calculates the square of the current contractions for qQ->qenuQ scattering // p1: quark (with W emittance) // p2: Quark { CCurrent mj1m,mj2p,mj2m; CLHEP::HepLorentzVector q1=p1in-p1out-pe-pnu; CLHEP::HepLorentzVector q2=-(p2in-p2out-pg); CLHEP::HepLorentzVector q3=-(p2in-p2out); mj1m=jW(p1out,false,pe,false,pnu,false,p1in,false); mj2p=j(p2out,true,p2in,true); mj2m=j(p2out,false,p2in,false); // Dot products of these which occur again and again COM MWmp=mj1m.dot(mj2p); // And now for the Higgs ones COM MWmm=mj1m.dot(mj2m); CCurrent jgbm,jgbp,j2gm,j2gp; j2gp=joo(p2out,true,pg,true); j2gm=joo(p2out,false,pg,false); jgbp=j(pg,true,p2in,true); jgbm=j(pg,false,p2in,false); CCurrent qsum(q2+q3); CCurrent Lmp,Lmm,Lpp,Lpm,U1mp,U1mm,U1pp,U1pm,U2mp,U2mm,U2pp,U2pm,p1o(p1out),p1i(p1in); CCurrent p2o(p2out); CCurrent p2i(p2in); Lmm=((-1.)*qsum*(MWmm) + (-2.*mj1m.dot(pg))*mj2m+2.*mj2m.dot(pg)*mj1m+(p1o/pg.dot(p1out) + p1i/pg.dot(p1in))*(q2.m2()*MWmm/2.))/q3.m2(); Lmp=((-1.)*qsum*(MWmp) + (-2.*mj1m.dot(pg))*mj2p+2.*mj2p.dot(pg)*mj1m+(p1o/pg.dot(p1out) + p1i/pg.dot(p1in))*(q2.m2()*MWmp/2.))/q3.m2(); U1mm=(jgbm.dot(mj1m)*j2gm+2.*p2o*MWmm)/(p2out+pg).m2(); U1mp=(jgbp.dot(mj1m)*j2gp+2.*p2o*MWmp)/(p2out+pg).m2(); U2mm=((-1.)*j2gm.dot(mj1m)*jgbm+2.*p2i*MWmm)/(p2in-pg).m2(); U2mp=((-1.)*j2gp.dot(mj1m)*jgbp+2.*p2i*MWmp)/(p2in-pg).m2(); const double cf=RHEJ::C_F; double amm,amp; amm=cf*(2.*vre(Lmm-U1mm,Lmm+U2mm))+2.*cf*cf/3.*vabs2(U1mm+U2mm); amp=cf*(2.*vre(Lmp-U1mp,Lmp+U2mp))+2.*cf*cf/3.*vabs2(U1mp+U2mp); double ampsq=-(amm+amp); // Now add the t-channels double th=q2.m2()*q1.m2(); ampsq/=th; ampsq/=16.; return ampsq; } //qQbar->qQbarWg_unob double junobMWqQbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector pg) // Calculates the square of the current contractions for qQ->qenuQ scattering // p1: quark (with W emittance) // p2: Quark { CCurrent mj1m,mj2p,mj2m; CLHEP::HepLorentzVector q1=p1in-p1out-pe-pnu; CLHEP::HepLorentzVector q2=-(p2in-p2out-pg); CLHEP::HepLorentzVector q3=-(p2in-p2out); mj1m=jW(p1out,false,pe,false,pnu,false,p1in,false); mj2p=jio(p2in,true,p2out,true); mj2m=jio(p2in,false,p2out,false); // Dot products of these which occur again and again COM MWmp=mj1m.dot(mj2p); // And now for the Higgs ones COM MWmm=mj1m.dot(mj2m); CCurrent jgbm,jgbp,j2gm,j2gp; j2gp=joo(pg,true,p2out,true); j2gm=joo(pg,false,p2out,false); jgbp=jio(p2in,true,pg,true); jgbm=jio(p2in,false,pg,false); CCurrent qsum(q2+q3); CCurrent Lmp,Lmm,Lpp,Lpm,U1mp,U1mm,U1pp,U1pm,U2mp,U2mm,U2pp,U2pm,p1o(p1out),p1i(p1in); CCurrent p2o(p2out); CCurrent p2i(p2in); Lmm=((-1.)*qsum*(MWmm) + (-2.*mj1m.dot(pg))*mj2m+2.*mj2m.dot(pg)*mj1m+(p1o/pg.dot(p1out) + p1i/pg.dot(p1in))*(q2.m2()*MWmm/2.))/q3.m2(); Lmp=((-1.)*qsum*(MWmp) + (-2.*mj1m.dot(pg))*mj2p+2.*mj2p.dot(pg)*mj1m+(p1o/pg.dot(p1out) + p1i/pg.dot(p1in))*(q2.m2()*MWmp/2.))/q3.m2(); U1mm=(jgbm.dot(mj1m)*j2gm+2.*p2o*MWmm)/(p2out+pg).m2(); U1mp=(jgbp.dot(mj1m)*j2gp+2.*p2o*MWmp)/(p2out+pg).m2(); U2mm=((-1.)*j2gm.dot(mj1m)*jgbm+2.*p2i*MWmm)/(p2in-pg).m2(); U2mp=((-1.)*j2gp.dot(mj1m)*jgbp+2.*p2i*MWmp)/(p2in-pg).m2(); const double cf=RHEJ::C_F; double amm,amp; amm=cf*(2.*vre(Lmm-U1mm,Lmm+U2mm))+2.*cf*cf/3.*vabs2(U1mm+U2mm); amp=cf*(2.*vre(Lmp-U1mp,Lmp+U2mp))+2.*cf*cf/3.*vabs2(U1mp+U2mp); double ampsq=-(amm+amp); // Now add the t-channels double th=q2.m2()*q1.m2(); ampsq/=th; ampsq/=16.; return ampsq; } //qbarQ->qbarQWg_unob double junobMWqbarQg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector pg) // Calculates the square of the current contractions for qQ->qenuQ scattering // p1: quark (with W emittance) // p2: Quark { CCurrent mj1m,mj2p,mj2m; CLHEP::HepLorentzVector q1=p1in-p1out-pe-pnu; CLHEP::HepLorentzVector q2=-(p2in-p2out-pg); CLHEP::HepLorentzVector q3=-(p2in-p2out); mj1m=jWbar(p1out,false,pe,false,pnu,false,p1in,false); mj2p=j(p2out,true,p2in,true); mj2m=j(p2out,false,p2in,false); // Dot products of these which occur again and again COM MWmp=mj1m.dot(mj2p); // And now for the Higgs ones COM MWmm=mj1m.dot(mj2m); CCurrent jgbm,jgbp,j2gm,j2gp; j2gp=joo(p2out,true,pg,true); j2gm=joo(p2out,false,pg,false); jgbp=j(pg,true,p2in,true); jgbm=j(pg,false,p2in,false); CCurrent qsum(q2+q3); CCurrent Lmp,Lmm,Lpp,Lpm,U1mp,U1mm,U1pp,U1pm,U2mp,U2mm,U2pp,U2pm,p1o(p1out),p1i(p1in); CCurrent p2o(p2out); CCurrent p2i(p2in); Lmm=((-1.)*qsum*(MWmm) + (-2.*mj1m.dot(pg))*mj2m+2.*mj2m.dot(pg)*mj1m+(p1o/pg.dot(p1out) + p1i/pg.dot(p1in))*(q2.m2()*MWmm/2.))/q3.m2(); Lmp=((-1.)*qsum*(MWmp) + (-2.*mj1m.dot(pg))*mj2p+2.*mj2p.dot(pg)*mj1m+(p1o/pg.dot(p1out) + p1i/pg.dot(p1in))*(q2.m2()*MWmp/2.))/q3.m2(); U1mm=(jgbm.dot(mj1m)*j2gm+2.*p2o*MWmm)/(p2out+pg).m2(); U1mp=(jgbp.dot(mj1m)*j2gp+2.*p2o*MWmp)/(p2out+pg).m2(); U2mm=((-1.)*j2gm.dot(mj1m)*jgbm+2.*p2i*MWmm)/(p2in-pg).m2(); U2mp=((-1.)*j2gp.dot(mj1m)*jgbp+2.*p2i*MWmp)/(p2in-pg).m2(); const double cf=RHEJ::C_F; double amm,amp; amm=cf*(2.*vre(Lmm-U1mm,Lmm+U2mm))+2.*cf*cf/3.*vabs2(U1mm+U2mm); amp=cf*(2.*vre(Lmp-U1mp,Lmp+U2mp))+2.*cf*cf/3.*vabs2(U1mp+U2mp); double ampsq=-(amm+amp); // Now add the t-channels double th=q2.m2()*q1.m2(); ampsq/=th; ampsq/=16.; return ampsq; } //qbarQbar->qbarQbarWg_unob double junobMWqbarQbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector pg) // Calculates the square of the current contractions for qQ->qenuQ scattering // p1: quark (with W emittance) // p2: Quark { CCurrent mj1m,mj2p,mj2m; CLHEP::HepLorentzVector q1=p1in-p1out-pe-pnu; CLHEP::HepLorentzVector q2=-(p2in-p2out-pg); CLHEP::HepLorentzVector q3=-(p2in-p2out); mj1m=jWbar(p1out,false,pe,false,pnu,false,p1in,false); mj2p=jio(p2in,true,p2out,true); mj2m=jio(p2in,false,p2out,false); // Dot products of these which occur again and again COM MWmp=mj1m.dot(mj2p); // And now for the Higgs ones COM MWmm=mj1m.dot(mj2m); CCurrent jgbm,jgbp,j2gm,j2gp; j2gp=joo(pg,true,p2out,true); j2gm=joo(pg,false,p2out,false); jgbp=jio(p2in,true,pg,true); jgbm=jio(p2in,false,pg,false); CCurrent qsum(q2+q3); CCurrent Lmp,Lmm,Lpp,Lpm,U1mp,U1mm,U1pp,U1pm,U2mp,U2mm,U2pp,U2pm,p1o(p1out),p1i(p1in); CCurrent p2o(p2out); CCurrent p2i(p2in); Lmm=((-1.)*qsum*(MWmm) + (-2.*mj1m.dot(pg))*mj2m+2.*mj2m.dot(pg)*mj1m+(p1o/pg.dot(p1out) + p1i/pg.dot(p1in))*(q2.m2()*MWmm/2.))/q3.m2(); Lmp=((-1.)*qsum*(MWmp) + (-2.*mj1m.dot(pg))*mj2p+2.*mj2p.dot(pg)*mj1m+(p1o/pg.dot(p1out) + p1i/pg.dot(p1in))*(q2.m2()*MWmp/2.))/q3.m2(); U1mm=(jgbm.dot(mj1m)*j2gm+2.*p2o*MWmm)/(p2out+pg).m2(); U1mp=(jgbp.dot(mj1m)*j2gp+2.*p2o*MWmp)/(p2out+pg).m2(); U2mm=((-1.)*j2gm.dot(mj1m)*jgbm+2.*p2i*MWmm)/(p2in-pg).m2(); U2mp=((-1.)*j2gp.dot(mj1m)*jgbp+2.*p2i*MWmp)/(p2in-pg).m2(); const double cf=RHEJ::C_F; double amm,amp; amm=cf*(2.*vre(Lmm-U1mm,Lmm+U2mm))+2.*cf*cf/3.*vabs2(U1mm+U2mm); amp=cf*(2.*vre(Lmp-U1mp,Lmp+U2mp))+2.*cf*cf/3.*vabs2(U1mp+U2mp); double ampsq=-(amm+amp); // Now add the t-channels double th=q2.m2()*q1.m2(); ampsq/=th; ampsq/=16.; return ampsq; } //////////////////////////////////////////////////////////////////// //qQ->qQWg_unof double junofMWgqQ (CLHEP::HepLorentzVector pg,CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p2in) // Calculates the square of the current contractions for qQ->qenuQ scattering // p1: quark (with W emittance) // p2: Quark { CCurrent mj2m,mj1p,mj1m; CLHEP::HepLorentzVector q1=p1in-p1out; CLHEP::HepLorentzVector qg=p1in-p1out-pg; CLHEP::HepLorentzVector q2=-(p2in-p2out-pe-pnu); mj2m=jW(p2out,false,pe,false,pnu,false,p2in,false); mj1p=j(p1out,true,p1in,true); mj1m=j(p1out,false,p1in,false); // Dot products of these which occur again and again COM MWpm=mj1p.dot(mj2m); // And now for the Higgs ones COM MWmm=mj1m.dot(mj2m); CCurrent jgam,jgap,j2gm,j2gp; j2gp=joo(p1out,true,pg,true); j2gm=joo(p1out,false,pg,false); jgap=j(pg,true,p1in,true); jgam=j(pg,false,p1in,false); CCurrent qsum(q1+qg); CCurrent Lmp,Lmm,Lpp,Lpm,U1mp,U1mm,U1pp,U1pm,U2mp,U2mm,U2pp,U2pm,p2o(p2out),p2i(p2in); CCurrent p1o(p1out); CCurrent p1i(p1in); Lmm=(qsum*(MWmm) + (-2.*mj2m.dot(pg))*mj1m+2.*mj1m.dot(pg)*mj2m+(p2o/pg.dot(p2out) + p2i/pg.dot(p2in))*(qg.m2()*MWmm/2.))/q1.m2(); Lpm=(qsum*(MWpm) + (-2.*mj2m.dot(pg))*mj1p+2.*mj1p.dot(pg)*mj2m+(p2o/pg.dot(p2out) + p2i/pg.dot(p2in))*(qg.m2()*MWpm/2.))/q1.m2(); U1mm=(jgam.dot(mj2m)*j2gm+2.*p1o*MWmm)/(p1out+pg).m2(); U1pm=(jgap.dot(mj2m)*j2gp+2.*p1o*MWpm)/(p1out+pg).m2(); U2mm=((-1.)*j2gm.dot(mj2m)*jgam+2.*p1i*MWmm)/(p1in-pg).m2(); U2pm=((-1.)*j2gp.dot(mj2m)*jgap+2.*p1i*MWpm)/(p1in-pg).m2(); const double cf=RHEJ::C_F; double amm,apm; amm=cf*(2.*vre(Lmm-U1mm,Lmm+U2mm))+2.*cf*cf/3.*vabs2(U1mm+U2mm); apm=cf*(2.*vre(Lpm-U1pm,Lpm+U2pm))+2.*cf*cf/3.*vabs2(U1pm+U2pm); double ampsq=-(apm+amm); // Now add the t-channels double th=q2.m2()*qg.m2(); ampsq/=th; ampsq/=16.; return ampsq; } //qQbar->qQbarWg_unof double junofMWgqQbar (CLHEP::HepLorentzVector pg,CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p2in) // Calculates the square of the current contractions for qQ->qenuQ scattering // p1: quark (with W emittance) // p2: Quark { CCurrent mj2m,mj1p,mj1m; CLHEP::HepLorentzVector q1=p1in-p1out; CLHEP::HepLorentzVector qg=p1in-p1out-pg; CLHEP::HepLorentzVector q2=-(p2in-p2out-pe-pnu); mj2m=jWbar(p2out,false,pe,false,pnu,false,p2in,false); mj1p=j(p1out,true,p1in,true); mj1m=j(p1out,false,p1in,false); // Dot products of these which occur again and again COM MWpm=mj1p.dot(mj2m); // And now for the Higgs ones COM MWmm=mj1m.dot(mj2m); CCurrent jgam,jgap,j2gm,j2gp; j2gp=joo(p1out,true,pg,true); j2gm=joo(p1out,false,pg,false); jgap=j(pg,true,p1in,true); jgam=j(pg,false,p1in,false); CCurrent qsum(q1+qg); CCurrent Lmp,Lmm,Lpp,Lpm,U1mp,U1mm,U1pp,U1pm,U2mp,U2mm,U2pp,U2pm,p2o(p2out),p2i(p2in); CCurrent p1o(p1out); CCurrent p1i(p1in); Lmm=(qsum*(MWmm) + (-2.*mj2m.dot(pg))*mj1m+2.*mj1m.dot(pg)*mj2m+(p2o/pg.dot(p2out) + p2i/pg.dot(p2in))*(qg.m2()*MWmm/2.))/q1.m2(); Lpm=(qsum*(MWpm) + (-2.*mj2m.dot(pg))*mj1p+2.*mj1p.dot(pg)*mj2m+(p2o/pg.dot(p2out) + p2i/pg.dot(p2in))*(qg.m2()*MWpm/2.))/q1.m2(); U1mm=(jgam.dot(mj2m)*j2gm+2.*p1o*MWmm)/(p1out+pg).m2(); U1pm=(jgap.dot(mj2m)*j2gp+2.*p1o*MWpm)/(p1out+pg).m2(); U2mm=((-1.)*j2gm.dot(mj2m)*jgam+2.*p1i*MWmm)/(p1in-pg).m2(); U2pm=((-1.)*j2gp.dot(mj2m)*jgap+2.*p1i*MWpm)/(p1in-pg).m2(); const double cf=RHEJ::C_F; double amm,apm; amm=cf*(2.*vre(Lmm-U1mm,Lmm+U2mm))+2.*cf*cf/3.*vabs2(U1mm+U2mm); apm=cf*(2.*vre(Lpm-U1pm,Lpm+U2pm))+2.*cf*cf/3.*vabs2(U1pm+U2pm); double ampsq=-(apm+amm); // Now add the t-channels double th=q2.m2()*qg.m2(); ampsq/=th; ampsq/=16.; return ampsq; } //qbarQ->qbarQWg_unof double junofMWgqbarQ (CLHEP::HepLorentzVector pg,CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p2in) // Calculates the square of the current contractions for qQ->qenuQ scattering // p1: quark (with W emittance) // p2: Quark { CCurrent mj2m,mj1p,mj1m; CLHEP::HepLorentzVector q1=p1in-p1out; CLHEP::HepLorentzVector qg=p1in-p1out-pg; CLHEP::HepLorentzVector q2=-(p2in-p2out-pe-pnu); mj2m=jW(p2out,false,pe,false,pnu,false,p2in,false); mj1p=jio(p1in,true,p1out,true); mj1m=jio(p1in,false,p1out,false); // Dot products of these which occur again and again COM MWpm=mj1p.dot(mj2m); // And now for the Higgs ones COM MWmm=mj1m.dot(mj2m); CCurrent jgam,jgap,j2gm,j2gp; j2gp=joo(pg,true,p1out,true); j2gm=joo(pg,false,p1out,false); jgap=jio(p1in,true,pg,true); jgam=jio(p1in,false,pg,false); CCurrent qsum(q1+qg); CCurrent Lmp,Lmm,Lpp,Lpm,U1mp,U1mm,U1pp,U1pm,U2mp,U2mm,U2pp,U2pm,p2o(p2out),p2i(p2in); CCurrent p1o(p1out); CCurrent p1i(p1in); Lmm=(qsum*(MWmm) + (-2.*mj2m.dot(pg))*mj1m+2.*mj1m.dot(pg)*mj2m+(p2o/pg.dot(p2out) + p2i/pg.dot(p2in))*(qg.m2()*MWmm/2.))/q1.m2(); Lpm=(qsum*(MWpm) + (-2.*mj2m.dot(pg))*mj1p+2.*mj1p.dot(pg)*mj2m+(p2o/pg.dot(p2out) + p2i/pg.dot(p2in))*(qg.m2()*MWpm/2.))/q1.m2(); U1mm=(jgam.dot(mj2m)*j2gm+2.*p1o*MWmm)/(p1out+pg).m2(); U1pm=(jgap.dot(mj2m)*j2gp+2.*p1o*MWpm)/(p1out+pg).m2(); U2mm=((-1.)*j2gm.dot(mj2m)*jgam+2.*p1i*MWmm)/(p1in-pg).m2(); U2pm=((-1.)*j2gp.dot(mj2m)*jgap+2.*p1i*MWpm)/(p1in-pg).m2(); const double cf=RHEJ::C_F; double amm,apm; amm=cf*(2.*vre(Lmm-U1mm,Lmm+U2mm))+2.*cf*cf/3.*vabs2(U1mm+U2mm); apm=cf*(2.*vre(Lpm-U1pm,Lpm+U2pm))+2.*cf*cf/3.*vabs2(U1pm+U2pm); double ampsq=-(apm+amm); // Now add the t-channels double th=q2.m2()*qg.m2(); ampsq/=th; ampsq/=16.; return ampsq; } //qbarQbar->qbarQbarWg_unof double junofMWgqbarQbar (CLHEP::HepLorentzVector pg,CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector pe, CLHEP::HepLorentzVector pnu, CLHEP::HepLorentzVector p2in) // Calculates the square of the current contractions for qQ->qenuQ scattering // p1: quark (with W emittance) // p2: Quark { CCurrent mj2m,mj1p,mj1m; CLHEP::HepLorentzVector q1=p1in-p1out; CLHEP::HepLorentzVector qg=p1in-p1out-pg; CLHEP::HepLorentzVector q2=-(p2in-p2out-pe-pnu); mj2m=jWbar(p2out,false,pe,false,pnu,false,p2in,false); mj1p=jio(p1in,true,p1out,true); mj1m=jio(p1in,false,p1out,false); // Dot products of these which occur again and again COM MWpm=mj1p.dot(mj2m); // And now for the Higgs ones COM MWmm=mj1m.dot(mj2m); CCurrent jgam,jgap,j2gm,j2gp; j2gp=joo(pg,true,p1out,true); j2gm=joo(pg,false,p1out,false); jgap=jio(p1in,true,pg,true); jgam=jio(p1in,false,pg,false); CCurrent qsum(q1+qg); CCurrent Lmp,Lmm,Lpp,Lpm,U1mp,U1mm,U1pp,U1pm,U2mp,U2mm,U2pp,U2pm,p2o(p2out),p2i(p2in); CCurrent p1o(p1out); CCurrent p1i(p1in); Lmm=(qsum*(MWmm) + (-2.*mj2m.dot(pg))*mj1m+2.*mj1m.dot(pg)*mj2m+(p2o/pg.dot(p2out) + p2i/pg.dot(p2in))*(qg.m2()*MWmm/2.))/q1.m2(); Lpm=(qsum*(MWpm) + (-2.*mj2m.dot(pg))*mj1p+2.*mj1p.dot(pg)*mj2m+(p2o/pg.dot(p2out) + p2i/pg.dot(p2in))*(qg.m2()*MWpm/2.))/q1.m2(); U1mm=(jgam.dot(mj2m)*j2gm+2.*p1o*MWmm)/(p1out+pg).m2(); U1pm=(jgap.dot(mj2m)*j2gp+2.*p1o*MWpm)/(p1out+pg).m2(); U2mm=((-1.)*j2gm.dot(mj2m)*jgam+2.*p1i*MWmm)/(p1in-pg).m2(); U2pm=((-1.)*j2gp.dot(mj2m)*jgap+2.*p1i*MWpm)/(p1in-pg).m2(); const double cf=RHEJ::C_F; double amm,apm; amm=cf*(2.*vre(Lmm-U1mm,Lmm+U2mm))+2.*cf*cf/3.*vabs2(U1mm+U2mm); apm=cf*(2.*vre(Lpm-U1pm,Lpm+U2pm))+2.*cf*cf/3.*vabs2(U1pm+U2pm); double ampsq=-(apm+amm); // Now add the t-channels double th=q2.m2()*qg.m2(); ampsq/=th; ampsq/=16.; return ampsq; } ///TODO make this comment more visible /// Naming scheme jM2-Wuno-g-({q/qbar}{Q/Qbar/g}) ///TODO Spit naming for more complicated functions? /// e.g. jM2WqqtoqQQq -> jM2_Wqq_to_qQQq double jM2WunogqQ(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) { //COM temp; double ME2mpp=0.; double ME2mpm=0.; double ME2mmp=0.; double ME2mmm=0.; double ME2; ME2mpp = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,true,true); ME2mpm = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,true,false); ME2mmp = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,false,true); ME2mmm = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,false,false); //Helicity sum ME2 = ME2mpp + ME2mpm + ME2mmp + ME2mmm; return ME2; } //same as function above but actually obtaining the antiquark line by crossing symmetry, where p1out and p1in are expected to be negative. //should give same result as jM2WunogqbarQ below (verified) double jM2WunogqQ_crossqQ(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) { //COM temp; double ME2mpp=0.; double ME2mpm=0.; double ME2mmp=0.; double ME2mmm=0.; double ME2; ME2mpp = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,true,true); ME2mpm = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,true,false); ME2mmp = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,false,true); ME2mmm = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,false,false); //Helicity sum ME2 = ME2mpp + ME2mpm + ME2mmp + ME2mmm; return ME2; } double jM2WunogqQbar(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) { //COM temp; double ME2mpp=0.; double ME2mpm=0.; double ME2mmp=0.; double ME2mmm=0.; double ME2; ME2mpp = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,true,true); ME2mpm = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,true,false); ME2mmp = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,false,true); ME2mmm = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,false,false); //Helicity sum ME2 = ME2mpp + ME2mpm + ME2mmp + ME2mmm; return ME2; } double jM2Wunogqg(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) { //COM temp; double ME2mpp=0.; double ME2mpm=0.; double ME2mmp=0.; double ME2mmm=0.; double ME2; ME2mpp = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,true,true); ME2mpm = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,true,false); ME2mmp = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,false,true); ME2mmm = jM2Wuno(pg, p1out,plbar,pl,p1in,false,p2out,p2in,false,false); //Helicity sum ME2 = ME2mpp + ME2mpm + ME2mmp + ME2mmm; const double ca = RHEJ::C_A; const double cf = RHEJ::C_F; ///0.) // if the gluon is the positive ratio=p2out.plus()/p2in.plus(); else // the gluon is the negative ratio=p2out.minus()/p2in.minus(); double cam = ( (ca - 1/ca)*(ratio + 1./ratio)/2. + 1/ca)/cf; ME2*=cam; return ME2; } double jM2WunogqbarQ(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) { //COM temp; double ME2mpp=0.; double ME2mpm=0.; double ME2mmp=0.; double ME2mmm=0.; double ME2; ME2mpp = jM2Wuno(pg, p1out,plbar,pl,p1in,true,p2out,p2in,true,true); ME2mpm = jM2Wuno(pg, p1out,plbar,pl,p1in,true,p2out,p2in,true,false); ME2mmp = jM2Wuno(pg, p1out,plbar,pl,p1in,true,p2out,p2in,false,true); ME2mmm = jM2Wuno(pg, p1out,plbar,pl,p1in,true,p2out,p2in,false,false); //Helicity sum ME2 = ME2mpp + ME2mpm + ME2mmp + ME2mmm; return ME2; } double jM2WunogqbarQbar(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) { //COM temp; double ME2mpp=0.; double ME2mpm=0.; double ME2mmp=0.; double ME2mmm=0.; double ME2; ME2mpp = jM2Wuno(pg, p1out,plbar,pl,p1in,true,p2out,p2in,true,true); ME2mpm = jM2Wuno(pg, p1out,plbar,pl,p1in,true,p2out,p2in,true,false); ME2mmp = jM2Wuno(pg, p1out,plbar,pl,p1in,true,p2out,p2in,false,true); ME2mmm = jM2Wuno(pg, p1out,plbar,pl,p1in,true,p2out,p2in,false,false); //Helicity sum ME2 = ME2mpp + ME2mpm + ME2mmp + ME2mmm; return ME2; } double jM2Wunogqbarg(CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) { //COM temp; double ME2mpp=0.; double ME2mpm=0.; double ME2mmp=0.; double ME2mmm=0.; double ME2; ME2mpp = jM2Wuno(pg, p1out,plbar,pl,p1in,true,p2out,p2in,true,true); ME2mpm = jM2Wuno(pg, p1out,plbar,pl,p1in,true,p2out,p2in,true,false); ME2mmp = jM2Wuno(pg, p1out,plbar,pl,p1in,true,p2out,p2in,false,true); ME2mmm = jM2Wuno(pg, p1out,plbar,pl,p1in,true,p2out,p2in,false,false); //Helicity sum ME2 = ME2mpp + ME2mpm + ME2mmp + ME2mmm; const double ca = RHEJ::C_A; const double cf = RHEJ::C_F; ///0.) // if the gluon is the positive ratio=p2out.plus()/p2in.plus(); else // the gluon is the negative ratio=p2out.minus()/p2in.minus(); double cam = ( (ca - 1/ca)*(ratio + 1./ratio)/2. + 1/ca)/cf; ME2*=cam; return ME2; } // W+Jets qqxExtremal // W+Jets qqxExtremal Currents - wqq emission double jM2WgQtoqbarqQ(CLHEP::HepLorentzVector pgin, CLHEP::HepLorentzVector pqout,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector pqbarout, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) { //COM temp; double ME2mpp=0.; double ME2mpm=0.; double ME2mmp=0.; double ME2mmm=0.; double ME2; ME2mpp = jM2Wuno(-pgin, pqout,plbar,pl,-pqbarout,false,p2out,p2in,true,true); ME2mpm = jM2Wuno(-pgin, pqout,plbar,pl,-pqbarout,false,p2out,p2in,true,false); ME2mmp = jM2Wuno(-pgin, pqout,plbar,pl,-pqbarout,false,p2out,p2in,false,true); ME2mmm = jM2Wuno(-pgin, pqout,plbar,pl,-pqbarout,false,p2out,p2in,false,false); //Helicity sum ME2 = ME2mpp + ME2mpm + ME2mmp + ME2mmm; //Correct colour averaging ME2*=(3.0/8.0); return ME2; } double jM2WgQtoqqbarQ(CLHEP::HepLorentzVector pgin, CLHEP::HepLorentzVector pqbarout,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector pqout, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in){ //COM temp; double ME2mpp=0.; double ME2mpm=0.; double ME2mmp=0.; double ME2mmm=0.; double ME2; ME2mpp = jM2Wuno(-pgin, pqbarout,plbar,pl,-pqout,true,p2out,p2in,true,true); ME2mpm = jM2Wuno(-pgin, pqbarout,plbar,pl,-pqout,true,p2out,p2in,true,false); ME2mmp = jM2Wuno(-pgin, pqbarout,plbar,pl,-pqout,true,p2out,p2in,false,true); ME2mmm = jM2Wuno(-pgin, pqbarout,plbar,pl,-pqout,true,p2out,p2in,false,false); //Helicity sum ME2 = ME2mpp + ME2mpm + ME2mmp + ME2mmm; //Correct colour averaging ME2*=(3.0/8.0); return ME2; } double jM2Wggtoqbarqg(CLHEP::HepLorentzVector pgin, CLHEP::HepLorentzVector pqout,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector pqbarout, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) { //COM temp; double ME2mpp=0.; double ME2mpm=0.; double ME2mmp=0.; double ME2mmm=0.; double ME2; ME2mpp = jM2Wuno(-pgin, pqout,plbar,pl,-pqbarout,false,p2out,p2in,true,true); ME2mpm = jM2Wuno(-pgin, pqout,plbar,pl,-pqbarout,false,p2out,p2in,true,false); ME2mmp = jM2Wuno(-pgin, pqout,plbar,pl,-pqbarout,false,p2out,p2in,false,true); ME2mmm = jM2Wuno(-pgin, pqout,plbar,pl,-pqbarout,false,p2out,p2in,false,false); //Helicity sum ME2 = ME2mpp + ME2mpm + ME2mmp + ME2mmm; const double ca = RHEJ::C_A; const double cf = RHEJ::C_F; ///0.) // if the gluon is the positive ratio=p2out.plus()/p2in.plus(); else // the gluon is the negative ratio=p2out.minus()/p2in.minus(); double cam = ( (ca - 1/ca)*(ratio + 1./ratio)/2. + 1/ca)/cf; ME2*=cam; //Correct colour averaging ME2*=(3.0/8.0); return ME2; } double jM2Wggtoqqbarg(CLHEP::HepLorentzVector pgin, CLHEP::HepLorentzVector pqbarout,CLHEP::HepLorentzVector plbar,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector pqout, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in){ //COM temp; double ME2mpp=0.; double ME2mpm=0.; double ME2mmp=0.; double ME2mmm=0.; double ME2; ME2mpp = jM2Wuno(-pgin, pqbarout,plbar,pl,-pqout,true,p2out,p2in,true,true); ME2mpm = jM2Wuno(-pgin, pqbarout,plbar,pl,-pqout,true,p2out,p2in,true,false); ME2mmp = jM2Wuno(-pgin, pqbarout,plbar,pl,-pqout,true,p2out,p2in,false,true); ME2mmm = jM2Wuno(-pgin, pqbarout,plbar,pl,-pqout,true,p2out,p2in,false,false); //Helicity sum ME2 = ME2mpp + ME2mpm + ME2mmp + ME2mmm; const double ca = RHEJ::C_A; const double cf = RHEJ::C_F; ///0.) // if the gluon is the positive ratio=p2out.plus()/p2in.plus(); else // the gluon is the negative ratio=p2out.minus()/p2in.minus(); double cam = ( (ca - 1/ca)*(ratio + 1./ratio)/2. + 1/ca)/cf; ME2*=cam; //Correct colour averaging ME2*=(3.0/8.0); return ME2; } // W+Jets qqxCentral double jM2WqqtoqQQq(CLHEP::HepLorentzVector pa, CLHEP::HepLorentzVector pb,CLHEP::HepLorentzVector pl, CLHEP::HepLorentzVector plbar, std::vector partons, bool aqlinepa, bool aqlinepb, bool qqxmarker, int nabove) { static bool is_sigma_index_set(false); if(!is_sigma_index_set){ if(init_sigma_index()) is_sigma_index_set = true; else return 0.;} HLV pq, pqbar, p1, p4; if (qqxmarker){ pqbar = partons[nabove+1]; pq = partons[nabove+2];} else{ pq = partons[nabove+1]; pqbar = partons[nabove+2];} p1 = partons.front(); p4 = partons.back(); Tensor<1,4> T1am, T4bm, T1ap, T4bp; if(!(aqlinepa)){ T1ap = TCurrent(p1, true, pa, true); T1am = TCurrent(p1, false, pa, false);} else if(aqlinepa){ T1ap = TCurrent(pa, true, p1, true); T1am = TCurrent(pa, false, p1, false);} if(!(aqlinepb)){ T4bp = TCurrent(p4, true, pb, true); T4bm = TCurrent(p4, false, pb, false);} else if(aqlinepb){ T4bp = TCurrent(pb, true, p4, true); T4bm = TCurrent(pb, false, p4, false);} // Calculate the 3 separate contributions to the effective vertex Tensor<2,4> Xunc = MUncrossW(pa, p1, pb, p4, pq, pqbar, pl, plbar, partons, nabove); Tensor<2,4> Xcro = MCrossW( pa, p1, pb, p4, pq, pqbar, pl, plbar, partons, nabove); Tensor<2,4> Xsym = MSymW( pa, p1, pb, p4, pq, pqbar, pl, plbar, partons, nabove); // 4 Different Helicity Choices (Differs from Pure Jet Case, where there is also the choice in qqbar helicity. // (- - hel choice) COM M_mmUnc = (((Xunc).contract(T1am,1)).contract(T4bm,1)).at(0); COM M_mmCro = (((Xcro).contract(T1am,1)).contract(T4bm,1)).at(0); COM M_mmSym = (((Xsym).contract(T1am,1)).contract(T4bm,1)).at(0); // (- + hel choice) COM M_mpUnc = (((Xunc).contract(T1am,1)).contract(T4bp,1)).at(0); COM M_mpCro = (((Xcro).contract(T1am,1)).contract(T4bp,1)).at(0); COM M_mpSym = (((Xsym).contract(T1am,1)).contract(T4bp,1)).at(0); // (+ - hel choice) COM M_pmUnc = (((Xunc).contract(T1ap,1)).contract(T4bm,1)).at(0); COM M_pmCro = (((Xcro).contract(T1ap,1)).contract(T4bm,1)).at(0); COM M_pmSym = (((Xsym).contract(T1ap,1)).contract(T4bm,1)).at(0); // (+ + hel choice) COM M_ppUnc = (((Xunc).contract(T1ap,1)).contract(T4bp,1)).at(0); COM M_ppCro = (((Xcro).contract(T1ap,1)).contract(T4bp,1)).at(0); COM M_ppSym = (((Xsym).contract(T1ap,1)).contract(T4bp,1)).at(0); //Colour factors: COM cmsms,cmumu,cmcmc,cmsmu,cmsmc,cmumc; cmsms=3.; cmumu=4./3.; cmcmc=4./3.; cmsmu =3./2.*COM(0.,1.); cmsmc = -3./2.*COM(0.,1.); cmumc = -1./6.; // Work Out Interference in each case of helicity: double amp_mm = real(cmsms*pow(abs(M_mmSym),2) +cmumu*pow(abs(M_mmUnc),2) +cmcmc*pow(abs(M_mmCro),2) +2.*real(cmsmu*M_mmSym*conj(M_mmUnc)) +2.*real(cmsmc*M_mmSym*conj(M_mmCro)) +2.*real(cmumc*M_mmUnc*conj(M_mmCro))); double amp_mp = real(cmsms*pow(abs(M_mpSym),2) +cmumu*pow(abs(M_mpUnc),2) +cmcmc*pow(abs(M_mpCro),2) +2.*real(cmsmu*M_mpSym*conj(M_mpUnc)) +2.*real(cmsmc*M_mpSym*conj(M_mpCro)) +2.*real(cmumc*M_mpUnc*conj(M_mpCro))); double amp_pm = real(cmsms*pow(abs(M_pmSym),2) +cmumu*pow(abs(M_pmUnc),2) +cmcmc*pow(abs(M_pmCro),2) +2.*real(cmsmu*M_pmSym*conj(M_pmUnc)) +2.*real(cmsmc*M_pmSym*conj(M_pmCro)) +2.*real(cmumc*M_pmUnc*conj(M_pmCro))); double amp_pp = real(cmsms*pow(abs(M_ppSym),2) +cmumu*pow(abs(M_ppUnc),2) +cmcmc*pow(abs(M_ppCro),2) +2.*real(cmsmu*M_ppSym*conj(M_ppUnc)) +2.*real(cmsmc*M_ppSym*conj(M_ppCro)) +2.*real(cmumc*M_ppUnc*conj(M_ppCro))); double amp=((amp_mm+amp_mp+amp_pm+amp_pp)/(9.*4.)); CLHEP::HepLorentzVector q1,q3; q1=pa; for(int i=0;i partons, bool aqlinepa, bool aqlinepb, bool qqxmarker, int nabove, int nbelow, bool forwards){ static bool is_sigma_index_set(false); if(!is_sigma_index_set){ if(init_sigma_index()) is_sigma_index_set = true; else return 0.; } if (!forwards){ //If Emission from Leg a instead, flip process. HLV dummymom = pa; bool dummybool= aqlinepa; int dummyint = nabove; pa = pb; pb = dummymom; std::reverse(partons.begin(),partons.end()); qqxmarker = !(qqxmarker); aqlinepa = aqlinepb; aqlinepb = dummybool; nabove = nbelow; nbelow = dummyint; } HLV pq, pqbar, p1,p4; if (qqxmarker){ pqbar = partons[nabove+1]; pq = partons[nabove+2];} else{ pq = partons[nabove+1]; pqbar = partons[nabove+2];} p1 = partons.front(); p4 = partons.back(); Tensor<1,4> T1am(0.), T1ap(0.); if(!(aqlinepa)){ T1ap = TCurrent(p1, true, pa, true); T1am = TCurrent(p1, false, pa, false);} else if(aqlinepa){ T1ap = TCurrent(pa, true, p1, true); T1am = TCurrent(pa, false, p1, false);} Tensor <1,4> T4bm = jW4bEmit(pb, p4, pl, plbar, aqlinepb); // Calculate the 3 separate contributions to the effective vertex Tensor<2,4> Xunc_m = MUncross(pa, pq, pqbar,partons, false, nabove); Tensor<2,4> Xcro_m = MCross( pa, pq, pqbar,partons, false, nabove); Tensor<2,4> Xsym_m = MSym( pa, p1, pb, p4, pq, pqbar, partons, false, nabove); Tensor<2,4> Xunc_p = MUncross(pa, pq, pqbar,partons, true, nabove); Tensor<2,4> Xcro_p = MCross( pa, pq, pqbar,partons, true, nabove); Tensor<2,4> Xsym_p = MSym( pa, p1, pb, p4, pq, pqbar, partons, true, nabove); // (- - hel choice) COM M_mmUnc = (((Xunc_m).contract(T1am,1)).contract(T4bm,1)).at(0); COM M_mmCro = (((Xcro_m).contract(T1am,1)).contract(T4bm,1)).at(0); COM M_mmSym = (((Xsym_m).contract(T1am,1)).contract(T4bm,1)).at(0); // (- + hel choice) COM M_mpUnc = (((Xunc_p).contract(T1am,1)).contract(T4bm,1)).at(0); COM M_mpCro = (((Xcro_p).contract(T1am,1)).contract(T4bm,1)).at(0); COM M_mpSym = (((Xsym_p).contract(T1am,1)).contract(T4bm,1)).at(0); // (+ - hel choice) COM M_pmUnc = (((Xunc_m).contract(T1ap,1)).contract(T4bm,1)).at(0); COM M_pmCro = (((Xcro_m).contract(T1ap,1)).contract(T4bm,1)).at(0); COM M_pmSym = (((Xsym_m).contract(T1ap,1)).contract(T4bm,1)).at(0); // (+ + hel choice) COM M_ppUnc = (((Xunc_p).contract(T1ap,1)).contract(T4bm,1)).at(0); COM M_ppCro = (((Xcro_p).contract(T1ap,1)).contract(T4bm,1)).at(0); COM M_ppSym = (((Xsym_p).contract(T1ap,1)).contract(T4bm,1)).at(0); //Colour factors: COM cmsms,cmumu,cmcmc,cmsmu,cmsmc,cmumc; cmsms=3.; cmumu=4./3.; cmcmc=4./3.; cmsmu =3./2.*COM(0.,1.); cmsmc = -3./2.*COM(0.,1.); cmumc = -1./6.; // Work Out Interference in each case of helicity: double amp_mm = real(cmsms*pow(abs(M_mmSym),2) +cmumu*pow(abs(M_mmUnc),2) +cmcmc*pow(abs(M_mmCro),2) +2.*real(cmsmu*M_mmSym*conj(M_mmUnc)) +2.*real(cmsmc*M_mmSym*conj(M_mmCro)) +2.*real(cmumc*M_mmUnc*conj(M_mmCro))); double amp_mp = real(cmsms*pow(abs(M_mpSym),2) +cmumu*pow(abs(M_mpUnc),2) +cmcmc*pow(abs(M_mpCro),2) +2.*real(cmsmu*M_mpSym*conj(M_mpUnc)) +2.*real(cmsmc*M_mpSym*conj(M_mpCro)) +2.*real(cmumc*M_mpUnc*conj(M_mpCro))); double amp_pm = real(cmsms*pow(abs(M_pmSym),2) +cmumu*pow(abs(M_pmUnc),2) +cmcmc*pow(abs(M_pmCro),2) +2.*real(cmsmu*M_pmSym*conj(M_pmUnc)) +2.*real(cmsmc*M_pmSym*conj(M_pmCro)) +2.*real(cmumc*M_pmUnc*conj(M_pmCro))); double amp_pp = real(cmsms*pow(abs(M_ppSym),2) +cmumu*pow(abs(M_ppUnc),2) +cmcmc*pow(abs(M_ppCro),2) +2.*real(cmsmu*M_ppSym*conj(M_ppUnc)) +2.*real(cmsmc*M_ppSym*conj(M_ppCro)) +2.*real(cmumc*M_ppUnc*conj(M_ppCro))); double amp=((amp_mm+amp_mp+amp_pm+amp_pp)/(9.*4.)); CLHEP::HepLorentzVector q1,q3; q1=pa; for(int i=0;i const COM looprwfactor = (COM(0.,1.)*M_PI*M_PI)/pow((2.*M_PI),4); //const double HVE = 246.21845810181637; #ifdef RHEJ_BUILD_WITH_QCDLOOP #include "qcdloop/qcdloop.h" #endif #include namespace { // Loop integrals #ifdef RHEJ_BUILD_WITH_QCDLOOP COM B0DD(CLHEP::HepLorentzVector q, double mq) { static std::vector> result(3); static auto ql_B0 = [](){ ql::Bubble,double,double> ql_B0; ql_B0.setCacheSize(100); return ql_B0; }(); static std::vector masses(2); static std::vector momenta(1); for(auto & m: masses) m = mq*mq; momenta.front() = q.m2(); ql_B0.integral(result, 1, masses, momenta); return result[0]; } COM C0DD(CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mq) { static std::vector> result(3); static auto ql_C0 = [](){ ql::Triangle,double,double> ql_C0; ql_C0.setCacheSize(100); return ql_C0; }(); static std::vector masses(3); static std::vector momenta(3); for(auto & m: masses) m = mq*mq; momenta[0] = q1.m2(); momenta[1] = q2.m2(); momenta[2] = (q1+q2).m2(); ql_C0.integral(result, 1, masses, momenta); return result[0]; } COM D0DD(CLHEP::HepLorentzVector q1,CLHEP::HepLorentzVector q2, CLHEP::HepLorentzVector q3, double mq) { static std::vector> result(3); static auto ql_D0 = [](){ ql::Box,double,double> ql_D0; ql_D0.setCacheSize(100); return ql_D0; }(); static std::vector masses(4); static std::vector momenta(6); for(auto & m: masses) m = mq*mq; momenta[0] = q1.m2(); momenta[1] = q2.m2(); momenta[2] = q3.m2(); momenta[3] = (q1+q2+q3).m2(); momenta[4] = (q1+q2).m2(); momenta[5] = (q2+q3).m2(); ql_D0.integral(result, 1, masses, momenta); return result[0]; } - #else // no QCDloop - - COM B0an(double q2, double mt) - // This is the bubble integral as given in Eq. (A.4) of VDD - { - COM ans(COM(0.,0.)); - double mt2; - - //std::cerr<<"mt in B0an = "<0&&q2<4*mt2) { - ans=-1./8/M_PI/M_PI*sqrt((4*mt2-q2)/q2)*atan(sqrt(q2/(4*mt2-q2))); - } - else if (q2<=0||q2>=4*mt2) { - ans=-1./16/M_PI/M_PI*sqrt((q2-4*mt2)/q2)*log(COM(1.+sqrt(q2/(q2-4*mt2)))/(1.-sqrt(q2/(q2-4*mt2)))); - } - else { - std::cout << "Error in B0an!"<pin.minus()) { // if forward double sqpip=sqrt(pin.plus()); cur[0]=sqpop*sqpip; cur[1]=sqpom*sqpip*poperp/abs(poperp); cur[2]=-COM(0,1)*cur[1]; cur[3]=cur[0]; } else { // if backward double sqpim=sqrt(pin.minus()); cur[0]=-sqpom*sqpim*poperp/abs(poperp); cur[1]=-sqpim*sqpop; cur[2]=COM(0,1)*cur[1]; cur[3]=-cur[0]; } } else { // positive helicity if (pin.plus()>pin.minus()) { // if forward double sqpip=sqrt(pin.plus()); cur[0]=sqpop*sqpip; cur[1]=sqpom*sqpip*conj(poperp)/abs(poperp); cur[2]=COM(0,1)*cur[1]; cur[3]=cur[0]; } else { // if backward double sqpim=sqrt(pin.minus()); cur[0]=-sqpom*sqpim*conj(poperp)/abs(poperp); cur[1]=-sqpim*sqpop; cur[2]=-COM(0,1)*cur[1]; cur[3]=-cur[0]; } } } CCurrent j (CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector pin, bool helin) { COM cur[4]; cur[0]=0.; cur[1]=0.; cur[2]=0.; cur[3]=0.; double sqpop=sqrt(pout.plus()); double sqpom=sqrt(pout.minus()); COM poperp=pout.x()+COM(0,1)*pout.y(); if (helout!=helin) { std::cerr<< "void j : Non-matching helicities\n"; } else if (helout==false) { // negative helicity if (pin.plus()>pin.minus()) { // if forward double sqpip=sqrt(pin.plus()); cur[0]=sqpop*sqpip; cur[1]=sqpom*sqpip*poperp/abs(poperp); cur[2]=-COM(0,1)*cur[1]; cur[3]=cur[0]; } else { // if backward double sqpim=sqrt(pin.minus()); cur[0]=-sqpom*sqpim*poperp/abs(poperp); cur[1]=-sqpim*sqpop; cur[2]=COM(0,1)*cur[1]; cur[3]=-cur[0]; } } else { // positive helicity if (pin.plus()>pin.minus()) { // if forward double sqpip=sqrt(pin.plus()); cur[0]=sqpop*sqpip; cur[1]=sqpom*sqpip*conj(poperp)/abs(poperp); cur[2]=COM(0,1)*cur[1]; cur[3]=cur[0]; } else { // if backward double sqpim=sqrt(pin.minus()); cur[0]=-sqpom*sqpim*conj(poperp)/abs(poperp); cur[1]=-sqpim*sqpop; cur[2]=-COM(0,1)*cur[1]; cur[3]=-cur[0]; } } CCurrent temp(cur[0],cur[1],cur[2],cur[3]); return temp; } CCurrent jio (CLHEP::HepLorentzVector pin, bool helin, CLHEP::HepLorentzVector pout, bool helout) { COM cur[4]; cur[0]=0.; cur[1]=0.; cur[2]=0.; cur[3]=0.; double sqpop=sqrt(pout.plus()); double sqpom=sqrt(pout.minus()); COM poperp=pout.x()+COM(0,1)*pout.y(); if (helout!=helin) { std::cerr<< "void j : Non-matching helicities\n"; } else if (helout==false) { // negative helicity if (pin.plus()>pin.minus()) { // if forward double sqpip=sqrt(pin.plus()); cur[0]=sqpop*sqpip; cur[1]=sqpom*sqpip*conj(poperp)/abs(poperp); cur[2]=COM(0,1)*cur[1]; cur[3]=cur[0]; } else { // if backward double sqpim=sqrt(pin.minus()); cur[0]=-sqpom*sqpim*conj(poperp)/abs(poperp); cur[1]=-sqpim*sqpop; cur[2]=-COM(0,1)*cur[1]; cur[3]=-cur[0]; } } else { // positive helicity if (pin.plus()>pin.minus()) { // if forward double sqpip=sqrt(pin.plus()); cur[0]=sqpop*sqpip; cur[1]=sqpom*sqpip*poperp/abs(poperp); cur[2]=-COM(0,1)*cur[1]; cur[3]=cur[0]; } else { // if backward double sqpim=sqrt(pin.minus()); cur[0]=-sqpom*sqpim*poperp/abs(poperp); cur[1]=-sqpim*sqpop; cur[2]=COM(0,1)*cur[1]; cur[3]=-cur[0]; } } CCurrent temp(cur[0],cur[1],cur[2],cur[3]); return temp; } // Current for void jio(HLV pin, bool helin, HLV pout, bool helout, current &cur) { cur[0] = 0.0; cur[1] = 0.0; cur[2] = 0.0; cur[3] = 0.0; if(helin!=helout){ std::cout<<__LINE__<<" "<<__FILE__< pin.minus()) { // if forward double sqpip=sqrt(pin.plus()); cur[0] = sqpop * sqpip; cur[1] = sqpom * sqpip * conj(poperp) / abs(poperp); cur[2] = COM(0,1) * cur[1]; cur[3] = cur[0]; } else { double sqpim = sqrt(pin.minus()); cur[0] = -sqpom * sqpim * conj(poperp) / abs(poperp); cur[1] = -sqpim * sqpop; cur[2] = -COM(0,1) * cur[1]; cur[3] = -cur[0]; } } else { if (pin.plus() > pin.minus()) { // if forward double sqpip = sqrt(pin.plus()); cur[0] = sqpop * sqpip; cur[1] = sqpom * sqpip*poperp/abs(poperp); cur[2] = -COM(0,1)*cur[1]; cur[3] = cur[0]; } else { double sqpim = sqrt(pin.minus()); cur[0] = -sqpom * sqpim * poperp/abs(poperp); cur[1] = -sqpim * sqpop; cur[2] = COM(0,1)*cur[1]; cur[3] = -cur[0]; } } } // Current for void joo(HLV pi, bool heli, HLV pj, bool helj, current &cur) { // Zero our current cur[0] = 0.0; cur[1] = 0.0; cur[2] = 0.0; cur[3] = 0.0; if(helj){ std::cout<<__LINE__<<" "<<__FILE__< void joi(HLV pout, bool helout, HLV pin, bool helin, current &cur) { cur[0] = 0.0; cur[1] = 0.0; cur[2] = 0.0; cur[3] = 0.0; if(helin){ std::cout<<__LINE__<<" "<<__FILE__< pin.minus()) { // if forward double sqpip=sqrt(pin.plus()); cur[0] = sqpop * sqpip; cur[1] = sqpom * sqpip * poperp/abs(poperp); cur[2] = -COM(0,1)*cur[1]; cur[3] = cur[0]; } else { double sqpim = sqrt(pin.minus()); cur[0] = -sqpom*sqpim*poperp/abs(poperp); cur[1] = -sqpim*sqpop; cur[2] = COM(0,1)*cur[1]; cur[3] = -cur[0]; } } else { if (pin.plus() > pin.minus()) { // if forward double sqpip = sqrt(pin.plus()); cur[0] = sqpop * sqpip; cur[1] = sqpom * sqpip*conj(poperp)/abs(poperp); cur[2] = COM(0,1)*cur[1]; cur[3] = cur[0]; } else { double sqpim = sqrt(pin.minus()); cur[0] = -sqpom * sqpim * conj(poperp)/abs(poperp); cur[1] = -sqpim * sqpop; cur[2] = -COM(0,1)*cur[1]; cur[3] = -cur[0]; } } } - double jM2qQ (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in) { // std::cerr<<"Current: "<0) // if the gluon is the positive - if (p2in.pz()>0.) // if the gluon is the positive - ratio=p2out.plus()/p2in.plus(); - else // the gluon is the negative - ratio=p2out.minus()/p2in.minus(); - - double nonflipcolourmult=(1.-1./9.)/2.*(ratio+1./ratio)+1./9.; + const double K = K_g(p2out, p2in); // sum of spinor strings ||^2 double a2Mmp=abs2(Mmp); double a2Mmm=abs2(Mmm); double a2Mpp=abs2(Mpp); double a2Mpm=abs2(Mpm); - double sst = nonflipcolourmult*(a2Mpp+a2Mpm+a2Mmp+a2Mmm); + double sst = K/C_A*(a2Mpp+a2Mpm+a2Mmp+a2Mmm); // double sstsave=sst; // std::cout <<"ratio: "<0) // if the gluon is the positive - if (p2in.pz()>0.) // if the gluon is the positive - ratio=p2out.plus()/p2in.plus(); - else // the gluon is the negative - ratio=p2out.minus()/p2in.minus(); - - double nonflipcolourmult=(1.-1./9.)/2.*(ratio+1./ratio)+1./9.; + const double K = K_g(p2out, p2in); // sum of spinor strings ||^2 double a2Mmp=abs2(Mmp); double a2Mmm=abs2(Mmm); double a2Mpp=abs2(Mpp); double a2Mpm=abs2(Mpm); - double sst = nonflipcolourmult*(a2Mpp+a2Mpm+a2Mmp+a2Mmm); + double sst = K/C_A*(a2Mpp+a2Mpm+a2Mmp+a2Mmm); // double sstsave=sst; // std::cout <<"ratio: "<1.) // if the gluon is the positive. Should have been a - // // test against 0, but 1. is better - if (p1in.pz()>0.) // a much better test - ratio1=p1out.plus()/p1in.plus(); - else // the gluon is the negative - ratio1=p1out.minus()/p1in.minus(); - double nonflipcolourmult1=(1.-1./9.)/2.*(ratio1+1./ratio1)+1./9.; - - double ratio2; // p2-/pb- in the notes - if (p2in.pz()>0.) // a much better test - ratio2=p2out.plus()/p2in.plus(); - else // the gluon is the negative - ratio2=p2out.minus()/p2in.minus(); - double nonflipcolourmult2=(1.-1./9.)/2.*(ratio2+1./ratio2)+1./9.; + const double K_g1 = K_g(p1out, p1in); + const double K_g2 = K_g(p2out, p2in); // sum of spinor strings ||^2 double a2Mmp=abs2(Mmp); double a2Mmm=abs2(Mmm); double a2Mpp=abs2(Mpp); double a2Mpm=abs2(Mpm); - double sst = nonflipcolourmult1*nonflipcolourmult2*(a2Mpp+a2Mpm+a2Mmp+a2Mmm); + double sst = K_g1/C_A*K_g2/C_A*(a2Mpp+a2Mpm+a2Mmp+a2Mmm); // double sstsave=sst; // std::cout <<"ratio: "< 16 pi mt^2/v alphas, and we divide by a factor 4 at the amp sqaured level later which I absorb here (i.e. I divide by 2) + if(!(incBot)) + // Factor is because 4 mt^2 g^2/v A1 -> 16 pi mt^2/v alphas, + // and we divide by a factor 4 at the amp sqaured level later + // which I absorb here (i.e. I divide by 2) + /// @TODO move factor 1/2 from S to |ME|^2 => consistent with general notation return 8.*M_PI*mt*mt/v*(-cdot(C1,q2)*cdot(C2,q1)*A1(-vq1,vq2,mt)-cdot(C1,C2)*A2(-vq1,vq2,mt)); else return 8.*M_PI*mt*mt/v*(-cdot(C1,q2)*cdot(C2,q1)*A1(-vq1,vq2,mt)-cdot(C1,C2)*A2(-vq1,vq2,mt)) + 8.*M_PI*mb*mb/v*(-cdot(C1,q2)*cdot(C2,q1)*A1(-vq1,vq2,mb)-cdot(C1,C2)*A2(-vq1,vq2,mb)); } } } // namespace anonymous double MH2qQ (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mt, bool incBot, double mb) { // CLHEP::HepLorentzVector q1=p1in-p1out; // CLHEP::HepLorentzVector q2=-(p2in-p2out); current j1p,j1m,j2p,j2m, q1v, q2v; j (p1out,true,p1in,true,j1p); j (p1out,false,p1in,false,j1m); j (p2out,true,p2in,true,j2p); j (p2out,false,p2in,false,j2m); to_current(q1, q1v); to_current(q2, q2v); COM Mmp=cHdot(j1m,j2p,q1v,q2v,mt, incBot, mb); COM Mmm=cHdot(j1m,j2m,q1v,q2v,mt, incBot, mb); COM Mpp=cHdot(j1p,j2p,q1v,q2v,mt, incBot, mb); COM Mpm=cHdot(j1p,j2m,q1v,q2v,mt, incBot, mb); double sst=abs2(Mmp)+abs2(Mmm)+abs2(Mpp)+abs2(Mpm); // return (4./3.)*(4./3.)*sst/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); return sst/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); } double MH2qQbar (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mt, bool incBot, double mb) { // CLHEP::HepLorentzVector q1=p1in-p1out; // CLHEP::HepLorentzVector q2=-(p2in-p2out); current j1p,j1m,j2p,j2m,q1v,q2v; j (p1out,true,p1in,true,j1p); j (p1out,false,p1in,false,j1m); jio (p2in,true,p2out,true,j2p); jio (p2in,false,p2out,false,j2m); to_current(q1, q1v); to_current(q2, q2v); COM Mmp=cHdot(j1m,j2p,q1v,q2v,mt, incBot, mb); COM Mmm=cHdot(j1m,j2m,q1v,q2v,mt, incBot, mb); COM Mpp=cHdot(j1p,j2p,q1v,q2v,mt, incBot, mb); COM Mpm=cHdot(j1p,j2m,q1v,q2v,mt, incBot, mb); double sst=abs2(Mmp)+abs2(Mmm)+abs2(Mpp)+abs2(Mpm); // return (4./3.)*(4./3.)*sst/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); return sst/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); } double MH2qbarQ (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mt, bool incBot, double mb) { // CLHEP::HepLorentzVector q1=p1in-p1out; // CLHEP::HepLorentzVector q2=-(p2in-p2out); current j1p,j1m,j2p,j2m,q1v,q2v; jio (p1in,true,p1out,true,j1p); jio (p1in,false,p1out,false,j1m); j (p2out,true,p2in,true,j2p); j (p2out,false,p2in,false,j2m); to_current(q1, q1v); to_current(q2, q2v); COM Mmp=cHdot(j1m,j2p,q1v,q2v,mt, incBot, mb); COM Mmm=cHdot(j1m,j2m,q1v,q2v,mt, incBot, mb); COM Mpp=cHdot(j1p,j2p,q1v,q2v,mt, incBot, mb); COM Mpm=cHdot(j1p,j2m,q1v,q2v,mt, incBot, mb); double sst=abs2(Mmp)+abs2(Mmm)+abs2(Mpp)+abs2(Mpm); // return (4./3.)*(4./3.)*sst/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); return sst/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); } double MH2qbarQbar (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mt, bool incBot, double mb) { // CLHEP::HepLorentzVector q1=p1in-p1out; // CLHEP::HepLorentzVector q2=-(p2in-p2out); current j1p,j1m,j2p,j2m,q1v,q2v; jio (p1in,true,p1out,true,j1p); jio (p1in,false,p1out,false,j1m); jio (p2in,true,p2out,true,j2p); jio (p2in,false,p2out,false,j2m); to_current(q1, q1v); to_current(q2, q2v); COM Mmp=cHdot(j1m,j2p,q1v,q2v,mt, incBot, mb); COM Mmm=cHdot(j1m,j2m,q1v,q2v,mt, incBot, mb); COM Mpp=cHdot(j1p,j2p,q1v,q2v,mt, incBot, mb); COM Mpm=cHdot(j1p,j2m,q1v,q2v,mt, incBot, mb); double sst=abs2(Mmp)+abs2(Mmm)+abs2(Mpp)+abs2(Mpm); // return (4./3.)*(4./3.)*sst/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); return sst/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); } double MH2qg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mt, bool incBot, double mb) // q~p1 g~p2 (i.e. ALWAYS p1 for quark, p2 for gluon) // should be called with q1 meant to be contracted with p2 in first part of vertex // (i.e. if g is backward, q1 is forward) { current j1p,j1m,j2p,j2m,q1v,q2v; j (p1out,true,p1in,true,j1p); j (p1out,false,p1in,false,j1m); j (p2out,true,p2in,true,j2p); j (p2out,false,p2in,false,j2m); to_current(q1, q1v); to_current(q2, q2v); // First, calculate the non-flipping amplitudes: COM Mpp=cHdot(j1p,j2p,q1v,q2v,mt, incBot, mb); COM Mpm=cHdot(j1p,j2m,q1v,q2v,mt, incBot, mb); COM Mmp=cHdot(j1m,j2p,q1v,q2v,mt, incBot, mb); COM Mmm=cHdot(j1m,j2m,q1v,q2v,mt, incBot, mb); //cout << "Bits in MH2qg: " << Mpp << " " << Mpm << " " << Mmp << " " << Mmm << endl; - double ratio; // p2-/pb- in the notes - // if (p2in.plus()>0) // if the gluon is the positive - if (p2in.pz()>0) // if the gluon is the positive - ratio=p2out.plus()/p2in.plus(); - else // the gluon is the negative - ratio=p2out.minus()/p2in.minus(); + const double K = K_g(p2out, p2in); - double nonflipcolourmult=(1.-1./9.)/2.*(ratio+1./ratio)+1./9.; - double sst=nonflipcolourmult*(abs2(Mmp)+abs2(Mmm)+abs2(Mpp)+abs2(Mpm)); + double sst=K/C_A*(abs2(Mmp)+abs2(Mmm)+abs2(Mpp)+abs2(Mpm)); // Cf*Ca=4 // return 4.*sst/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); return sst/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); } double MH2qbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mt, bool incBot, double mb) // qbar~p1 g~p2 (i.e. ALWAYS p1 for anti-quark, p2 for gluon) // should be called with q1 meant to be contracted with p2 in first part of vertex // (i.e. if g is backward, q1 is forward) { current j1p,j1m,j2p,j2m,q1v,q2v; jio (p1in,true,p1out,true,j1p); jio (p1in,false,p1out,false,j1m); j (p2out,true,p2in,true,j2p); j (p2out,false,p2in,false,j2m); to_current(q1, q1v); to_current(q2, q2v); // First, calculate the non-flipping amplitudes: COM amp,amm,apm,app; app=cHdot(j1p,j2p,q1v,q2v,mt, incBot, mb); apm=cHdot(j1p,j2m,q1v,q2v,mt, incBot, mb); amp=cHdot(j1m,j2p,q1v,q2v,mt, incBot, mb); amm=cHdot(j1m,j2m,q1v,q2v,mt, incBot, mb); double MH2sum = abs2(app)+abs2(amm)+abs2(apm)+abs2(amp); - double ratio; // p2-/pb- in the notes - // if (p2in.plus()>0) // if the gluon is the positive - if (p2in.pz()>0) // if the gluon is the positive - ratio=p2out.plus()/p2in.plus(); - else // the gluon is the negative - ratio=p2out.minus()/p2in.minus(); - - double nonflipcolourmult=(1.-1./9.)/2.*(ratio+1./ratio)+1./9.; - MH2sum*=nonflipcolourmult; + const double K = K_g(p2out, p2in); + MH2sum*=K/C_A; // Cf*Ca=4 // return 4.*MH2sum/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); return MH2sum/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); } double MH2gg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mt, bool incBot, double mb) // g~p1 g~p2 // should be called with q1 meant to be contracted with p2 in first part of vertex // (i.e. if g is backward, q1 is forward) { current j1p,j1m,j2p,j2m,q1v,q2v; j (p1out,true,p1in,true,j1p); j (p1out,false,p1in,false,j1m); j (p2out,true,p2in,true,j2p); j (p2out,false,p2in,false,j2m); to_current(q1, q1v); to_current(q2, q2v); // First, calculate the non-flipping amplitudes: COM amp,amm,apm,app; app=cHdot(j1p,j2p,q1v,q2v,mt, incBot, mb); apm=cHdot(j1p,j2m,q1v,q2v,mt, incBot, mb); amp=cHdot(j1m,j2p,q1v,q2v,mt, incBot, mb); amm=cHdot(j1m,j2m,q1v,q2v,mt, incBot, mb); double MH2sum = abs2(app)+abs2(amm)+abs2(apm)+abs2(amp); - double ratio1; // p1-/pa- in the notes - // if (p1in.plus()>0) // if the gluon is the positive - if (p1in.pz()>0.) // if the gluon is the positive - ratio1=p1out.plus()/p1in.plus(); - else // the gluon is the negative - ratio1=p1out.minus()/p1in.minus(); - - double nonflipcolourmult1=(1.-1./9.)/2.*(ratio1+1./ratio1)+1./9.; + const double K_g1 = K_g(p1out, p1in); + const double K_g2 = K_g(p2out, p2in); - double ratio2; // p2-/pb- in the notes - // if (p2in.plus()>0) // if the gluon is the positive - if (p2in.pz()>0.) // if the gluon is the positive - ratio2=p2out.plus()/p2in.plus(); - else // the gluon is the negative - ratio2=p2out.minus()/p2in.minus(); - - double nonflipcolourmult2=(1.-1./9.)/2.*(ratio2+1./ratio2)+1./9.; - MH2sum*=nonflipcolourmult1*nonflipcolourmult2; + MH2sum*=K_g1/C_A*K_g2/C_A; // Ca*Ca=9 // return 9.*MH2sum/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); return MH2sum/((p1in-p1out).m2()*(p2in-p2out).m2()*q1.m2()*q2.m2()); } // // Z's stuff // void jZ(HLV pin, HLV pout, HLV pem, HLV pep, bool HelPartons, bool HelLeptons, current cur) { // // Init current to zero // cur[0] = 0.0; // cur[1] = 0.0; // cur[2] = 0.0; // cur[3] = 0.0; // // Temporary variables // COM temp; // current Term_1, Term_2, Term_3, Term_4, J_temp, TempCur1, TempCur2; // // Momentum of virtual gluons aroun weak boson emission site // HLV qa = pout + pep + pem; // HLV qb = pin - pep - pem; // double ta = qa.m2(); // double tb = qb.m2(); // // Out-Out currents: // current Em_Ep, Out_Em, Out_Ep; // // Other currents: // current Out_In, Em_In, Ep_In; // joi(pout, HelPartons, pin, HelPartons, Out_In); // joi(pem, HelLeptons, pin, HelPartons, Em_In); // joi(pep, HelLeptons, pin, HelPartons, Ep_In); // joo(pem, HelLeptons, pep, HelLeptons, Em_Ep); // joo(pout, HelPartons, pem, HelLeptons, Out_Em); // joo(pout, HelPartons, pep, HelLeptons, Out_Ep); // if (HelLeptons == HelPartons) { // temp = 2.0 * cdot(pout, Em_Ep); // cmult(temp / ta, Out_In, Term_1); // temp = cdot(Out_Em, Em_Ep); // cmult(temp / ta , Em_In, Term_2); // temp = 2.0 * cdot(pin, Em_Ep); // cmult(temp / tb, Out_In, Term_3); // temp = -cdot(Ep_In, Em_Ep); // cmult(temp / tb, Out_Ep, Term_4); // cadd(Term_1, Term_2, Term_3, Term_4, J_temp); // cur[0] = J_temp[0]; // cur[1] = J_temp[1]; // cur[2] = J_temp[2]; // cur[3] = J_temp[3]; // } // else { // if (HelPartons == true) { // temp = 2.0 * cdot(pout, Em_Ep); // cmult(temp / ta, Out_In, Term_1); // joo(pout, true, pep, true, TempCur1); // joi(pep, true, pin, true, TempCur2); // temp = cdot(TempCur1, Em_Ep); // cmult(temp / ta , TempCur2, Term_2); // temp = 2.0 * cdot(pin, Em_Ep); // cmult(temp / tb, Out_In, Term_3); // joo(pout, true, pem, true, TempCur1); // joi(pem, true, pin, true, TempCur2); // temp = -cdot(TempCur2, Em_Ep); // cmult(temp / tb, TempCur1, Term_4); // cadd(Term_1, Term_2, Term_3, Term_4, J_temp); // cur[0] = J_temp[0]; // cur[1] = J_temp[1]; // cur[2] = J_temp[2]; // cur[3] = J_temp[3]; // } // else { // temp = 2.0 * cdot(pout, Em_Ep); // cmult(temp / ta, Out_In, Term_1); // joo(pout, false, pep, false, TempCur1); // joi(pep, false, pin, false, TempCur2); // temp = cdot(TempCur1, Em_Ep); // cmult(temp / ta, TempCur2, Term_2); // temp = 2.0 * cdot(pin, Em_Ep); // cmult(temp / tb, Out_In, Term_3); // joo(pout, false, pem, false, TempCur1); // joi(pem, false, pin, false, TempCur2); // temp = -cdot(TempCur2, Em_Ep); // cmult(temp / tb, TempCur1, Term_4); // cadd(Term_1, Term_2, Term_3, Term_4, J_temp); // cur[0] = J_temp[0]; // cur[1] = J_temp[1]; // cur[2] = J_temp[2]; // cur[3] = J_temp[3]; // } // } // } // void jZbar(HLV pin, HLV pout, HLV pem, HLV pep, bool HelPartons, bool HelLeptons, current cur) { // // Init current to zero // cur[0] = 0.0; // cur[1] = 0.0; // cur[2] = 0.0; // cur[3] = 0.0; // // Temporary variables // COM temp; // current Term_1, Term_2, Term_3, Term_4, J_temp, TempCur1, TempCur2; // // Transfered 4-momenta // HLV qa = pout + pep + pem; // HLV qb = pin - pep - pem; // // The square of the transfered 4-momenta // double ta = qa.m2(); // double tb = qb.m2(); // // Out-Out currents: // current Em_Ep, Em_Out, Ep_Out; // // In-Out currents: // current In_Out, In_Em, In_Ep; // // Safe to use the currents since helicity structure is ok // if (HelPartons == HelLeptons) { // jio(pin, HelPartons, pout, HelPartons, In_Out); // joo(pem, HelLeptons, pep, HelLeptons, Em_Ep); // jio(pin, HelPartons, pem, HelLeptons, In_Em); // jio(pin, HelPartons, pep, HelLeptons, In_Ep); // joo(pem, HelLeptons, pout, HelPartons, Em_Out); // joo(pep, HelLeptons, pout, HelPartons, Ep_Out); // } // else { // jio(pin, HelPartons, pout, HelPartons, In_Out); // joo(pem, HelLeptons, pep, HelLeptons, Em_Ep); // In_Em[0] = 0.0; // In_Em[1] = 0.0; // In_Em[2] = 0.0; // In_Em[3] = 0.0; // In_Ep[0] = 0.0; // In_Ep[1] = 0.0; // In_Ep[2] = 0.0; // In_Ep[3] = 0.0; // Em_Out[0] = 0.0; // Em_Out[1] = 0.0; // Em_Out[2] = 0.0; // Em_Out[3] = 0.0; // Ep_Out[0] = 0.0; // Ep_Out[1] = 0.0; // Ep_Out[2] = 0.0; // Ep_Out[3] = 0.0; // } // if (HelLeptons == HelPartons) { // temp = 2.0 * cdot(pout, Em_Ep); // cmult(temp / ta, In_Out, Term_1); // temp = cdot(Ep_Out, Em_Ep); // cmult(temp / ta, In_Ep, Term_2); // temp = 2.0 * cdot(pin, Em_Ep); // cmult(temp / tb, In_Out, Term_3); // temp = - cdot(In_Em, Em_Ep); // cmult(temp / tb, Em_Out, Term_4); // cadd(Term_1, Term_2, Term_3, Term_4, J_temp); // cur[0] = J_temp[0]; // cur[1] = J_temp[1]; // cur[2] = J_temp[2]; // cur[3] = J_temp[3]; // } // else { // if (HelPartons == true) { // temp = 2.0 * cdot(pout, Em_Ep); // cmult(temp / ta, In_Out, Term_1); // joo(pem, true, pout, true, TempCur1); // jio(pin, true, pem, true, TempCur2); // temp = cdot(TempCur1, Em_Ep); // cmult(temp / ta , TempCur2, Term_2); // temp = 2.0 * cdot(pin, Em_Ep); // cmult(temp / tb, In_Out, Term_3); // joo(pep, true, pout, true, TempCur1); // jio(pin, true, pep, true, TempCur2); // temp = - cdot(TempCur2, Em_Ep); // cmult(temp / tb, TempCur1, Term_4); // cadd(Term_1, Term_2, Term_3, Term_4, J_temp); // cur[0] = J_temp[0]; // cur[1] = J_temp[1]; // cur[2] = J_temp[2]; // cur[3] = J_temp[3]; // } // else { // temp = 2.0 * cdot(pout, Em_Ep); // cmult(temp / ta, In_Out, Term_1); // joo(pem, false, pout, false, TempCur1); // jio(pin, false, pem, false, TempCur2); // temp = cdot(TempCur1, Em_Ep); // cmult(temp / ta , TempCur2, Term_2); // temp = 2.0 * cdot(pin, Em_Ep); // cmult(temp / tb, In_Out, Term_3); // joo(pep, false, pout, false, TempCur1); // jio(pin, false, pep, false, TempCur2); // temp = - cdot(TempCur2, Em_Ep); // cmult(temp / tb, TempCur1, Term_4); // cadd(Term_1, Term_2, Term_3, Term_4, J_temp); // cur[0] = J_temp[0]; // cur[1] = J_temp[1]; // cur[2] = J_temp[2]; // cur[3] = J_temp[3]; // } // } // } // // Progagators // COM PZ(double s) { // double MZ, GammaZ; // MZ = 9.118800e+01; // Mass of the mediating gauge boson // GammaZ = 2.441404e+00; // Z peak width // // Return Z Prop value // return 1.0 / (s - MZ * MZ + COM(0.0, 1.0) * GammaZ * MZ); // } // COM PG(double s) { // return 1.0 / s; // } // // Non-gluonic with pa emitting // std::vector jMZqQ (HLV pa, HLV pb, HLV p1, HLV p2, HLV pep, HLV pem, std::vector VProducts, std::vector < std::vector > Virtuals, int aptype, int bptype, bool UseVirtuals, bool BottomLineEmit) { // std::vector ScaledWeights; // double Sum; // // Propagator factors // COM PZs = PZ((pep + pem).m2()); // COM PGs = PG((pep + pem).m2()); // // Emitting current initialisation // current j1pptop, j1pmtop; // Emission from top line // current j1ppbot, j1pmbot; // Emission from bottom line // // Non-emitting current initialisation // current j2ptop, j2mtop; // Emission from top line // current j2pbot, j2mbot; // Emission from bottom line // // Currents for top emission // // Upper current calculations // // if a is a quark // if (aptype > 0) { // jZ(pa, p1, pem, pep, true, true, j1pptop); // jZ(pa, p1, pem, pep, true, false, j1pmtop); // } // // if a is an antiquark // else { // jZbar(pa, p1, pem, pep, true, true, j1pptop); // jZbar(pa, p1, pem, pep, true, false, j1pmtop); // } // // Lower current calculations // // if b is a quark // if (bptype > 0) { // joi(p2, true, pb, true, j2ptop); // joi(p2, false, pb, false, j2mtop); // } // // if b is an antiquark // else { // jio(pb, true, p2, true, j2ptop); // jio(pb, false, p2, false, j2mtop); // } // // Currents for bottom emission // // Lower current calculations // if (bptype > 0) { // jZ(pb, p2, pem, pep, true, true, j1ppbot); // jZ(pb, p2, pem, pep, true, false, j1pmbot); // } // else { // jZbar(pb, p2, pem, pep, true, true, j1ppbot); // jZbar(pb, p2, pem, pep, true, false, j1pmbot); // } // // Upper current calculations // if (aptype > 0) { // joi(p1, true, pa, true, j2pbot); // joi(p1, false, pa, false, j2mbot); // } // else { // jio(pa, true, p1, true, j2pbot); // jio(pa, false, p1, false, j2mbot); // } // COM Coeff[2][8]; // if (!Interference) { // double ZCharge_a_P = Zq(aptype, true); // double ZCharge_a_M = Zq(aptype, false); // double ZCharge_b_P = Zq(bptype, true); // double ZCharge_b_M = Zq(bptype, false); // if (BottomLineEmit) { // // Emission from top-line quark (pa/p1 line) // Coeff[0][0] = (ZCharge_a_P * Zep * PZs * RWeak + Gq(aptype) * PGs) * cdot(j1pptop, j2ptop); // Coeff[0][1] = (ZCharge_a_P * Zep * PZs * RWeak + Gq(aptype) * PGs) * cdot(j1pptop, j2mtop); // Coeff[0][2] = (ZCharge_a_P * Zem * PZs * RWeak + Gq(aptype) * PGs) * cdot(j1pmtop, j2ptop); // Coeff[0][3] = (ZCharge_a_P * Zem * PZs * RWeak + Gq(aptype) * PGs) * cdot(j1pmtop, j2mtop); // Coeff[0][4] = (ZCharge_a_M * Zem * PZs * RWeak + Gq(aptype) * PGs) * conj(cdot(j1pptop, j2ptop)); // Coeff[0][5] = (ZCharge_a_M * Zem * PZs * RWeak + Gq(aptype) * PGs) * conj(cdot(j1pptop, j2mtop)); // Coeff[0][6] = (ZCharge_a_M * Zep * PZs * RWeak + Gq(aptype) * PGs) * conj(cdot(j1pmtop, j2ptop)); // Coeff[0][7] = (ZCharge_a_M * Zep * PZs * RWeak + Gq(aptype) * PGs) * conj(cdot(j1pmtop, j2mtop)); // } // else { // // Emission from bottom-line quark (pb/p2 line) // Coeff[1][0] = (ZCharge_b_P * Zep * PZs * RWeak + Gq(bptype) * PGs) * cdot(j1ppbot, j2pbot); // Coeff[1][7] = (ZCharge_b_P * Zep * PZs * RWeak + Gq(bptype) * PGs) * cdot(j1ppbot, j2mbot); // Coeff[1][2] = (ZCharge_b_P * Zem * PZs * RWeak + Gq(bptype) * PGs) * cdot(j1pmbot, j2pbot); // Coeff[1][5] = (ZCharge_b_P * Zem * PZs * RWeak + Gq(bptype) * PGs) * cdot(j1pmbot, j2mbot); // Coeff[1][4] = (ZCharge_b_M * Zem * PZs * RWeak + Gq(bptype) * PGs) * conj(cdot(j1ppbot, j2pbot)); // Coeff[1][3] = (ZCharge_b_M * Zem * PZs * RWeak + Gq(bptype) * PGs) * conj(cdot(j1ppbot, j2mbot)); // Coeff[1][6] = (ZCharge_b_M * Zep * PZs * RWeak + Gq(bptype) * PGs) * conj(cdot(j1pmbot, j2pbot)); // Coeff[1][1] = (ZCharge_b_M * Zep * PZs * RWeak + Gq(bptype) * PGs) * conj(cdot(j1pmbot, j2mbot)); // } // } // // Else calculate all the possiblities // else { // double ZCharge_a_P = Zq(aptype, true); // double ZCharge_a_M = Zq(aptype, false); // double ZCharge_b_P = Zq(bptype, true); // double ZCharge_b_M = Zq(bptype, false); // // Emission from top-line quark (pa/p1 line) // Coeff[0][0] = (ZCharge_a_P * Zep * PZs * RWeak + Gq(aptype) * PGs) * cdot(j1pptop, j2ptop); // Coeff[0][1] = (ZCharge_a_P * Zep * PZs * RWeak + Gq(aptype) * PGs) * cdot(j1pptop, j2mtop); // Coeff[0][2] = (ZCharge_a_P * Zem * PZs * RWeak + Gq(aptype) * PGs) * cdot(j1pmtop, j2ptop); // Coeff[0][3] = (ZCharge_a_P * Zem * PZs * RWeak + Gq(aptype) * PGs) * cdot(j1pmtop, j2mtop); // Coeff[0][4] = (ZCharge_a_M * Zem * PZs * RWeak + Gq(aptype) * PGs) * conj(cdot(j1pptop, j2ptop)); // Coeff[0][5] = (ZCharge_a_M * Zem * PZs * RWeak + Gq(aptype) * PGs) * conj(cdot(j1pptop, j2mtop)); // Coeff[0][6] = (ZCharge_a_M * Zep * PZs * RWeak + Gq(aptype) * PGs) * conj(cdot(j1pmtop, j2ptop)); // Coeff[0][7] = (ZCharge_a_M * Zep * PZs * RWeak + Gq(aptype) * PGs) * conj(cdot(j1pmtop, j2mtop)); // // Emission from bottom-line quark (pb/p2 line) // Coeff[1][0] = (ZCharge_b_P * Zep * PZs * RWeak + Gq(bptype) * PGs) * cdot(j1ppbot, j2pbot); // Coeff[1][7] = (ZCharge_b_P * Zep * PZs * RWeak + Gq(bptype) * PGs) * cdot(j1ppbot, j2mbot); // Coeff[1][2] = (ZCharge_b_P * Zem * PZs * RWeak + Gq(bptype) * PGs) * cdot(j1pmbot, j2pbot); // Coeff[1][5] = (ZCharge_b_P * Zem * PZs * RWeak + Gq(bptype) * PGs) * cdot(j1pmbot, j2mbot); // Coeff[1][4] = (ZCharge_b_M * Zem * PZs * RWeak + Gq(bptype) * PGs) * conj(cdot(j1ppbot, j2pbot)); // Coeff[1][3] = (ZCharge_b_M * Zem * PZs * RWeak + Gq(bptype) * PGs) * conj(cdot(j1ppbot, j2mbot)); // Coeff[1][6] = (ZCharge_b_M * Zep * PZs * RWeak + Gq(bptype) * PGs) * conj(cdot(j1pmbot, j2pbot)); // Coeff[1][1] = (ZCharge_b_M * Zep * PZs * RWeak + Gq(bptype) * PGs) * conj(cdot(j1pmbot, j2mbot)); // } // // Find the numbers of scales // int ScaleCount; // #if calcscaleunc // ScaleCount = 20; // #else // ScaleCount = 1; // #endif // // For each scale... // for (int j = 0; j < ScaleCount; j++) { // Sum = 0.0; // // If we want to compare back to the W's code only emit from one quark and only couple to left handed particles // // virtuals arent here since they are calculated and included in weight() call. // if (!Interference) { // if (BottomLineEmit) for (int i = 0; i < 8; i++) Sum += abs2(Coeff[1][i]) * VProducts.at(1); // else for (int i = 0; i < 8; i++) Sum += abs2(Coeff[0][i]) * VProducts.at(0); // } // // Else work out the full interference // else { // // For the full calculation... // if (UseVirtuals) { // for (int i = 0; i < 8; i++) { // Sum += abs2(Coeff[0][i]) * VProducts.at(0) * Virtuals.at(j).at(0) // + abs2(Coeff[1][i]) * VProducts.at(1) * Virtuals.at(j).at(1) // + 2.0 * real(Coeff[0][i] * conj(Coeff[1][i])) * VProducts.at(2) * Virtuals.at(j).at(2); // } // } // // For the tree level calculation... // else { // for (int i = 0; i < 8; i++) { // Sum += abs2(Coeff[0][i]) * VProducts.at(0) // + abs2(Coeff[1][i]) * VProducts.at(1) // + 2.0 * real(Coeff[0][i] * conj(Coeff[1][i])) * VProducts.at(2); // } // } // } // // Add this to the vector to be returned with the other factors of C_A and the helicity sum/average factors. // ScaledWeights.push_back(Sum / 18.0); // } // // Return all the scale values // return ScaledWeights; // } // // Semi-gluonic with pa emitting // std::vector jMZqg (HLV pa, HLV pb, HLV p1, HLV p2, HLV pep, HLV pem, std::vector VProducts, std::vector < std::vector > Virtuals, int aptype, int bptype, bool UseVirtuals, bool BottomLineEmit) { // COM Coeff[8]; // double Sum; // std::vector ScaledWeights; // COM PZs = PZ((pep + pem).m2()); // COM PGs = PG((pep + pem).m2()); // // Emitting current initialisation - Emission from top line // current j1pptop, j1pmtop; // // Non-emitting current initialisation - Emission from top line // current j2ptop, j2mtop; // // Currents for top emission // // Upper current calculations // if (aptype > 0) { // jZ (pa, p1, pem, pep, true, true, j1pptop); // jZ (pa, p1, pem, pep, true, false, j1pmtop); // } // else { // jZbar(pa, p1, pem, pep, true, true, j1pptop); // jZbar(pa, p1, pem, pep, true, false, j1pmtop); // } // // Lower current calculations // joi(p2, true, pb, true, j2ptop); // joi(p2, false, pb, false, j2mtop); // // Calculate all the possiblities // double ZCharge_a_P = Zq(aptype, true); // double ZCharge_a_M = Zq(aptype, false); // // Emission from top-line quark (pa/p1 line) // Coeff[0] = (ZCharge_a_P * Zep * PZs * RWeak + Gq(aptype) * PGs) * cdot(j1pptop, j2ptop); // Coeff[1] = (ZCharge_a_P * Zep * PZs * RWeak + Gq(aptype) * PGs) * cdot(j1pptop, j2mtop); // Coeff[2] = (ZCharge_a_P * Zem * PZs * RWeak + Gq(aptype) * PGs) * cdot(j1pmtop, j2ptop); // Coeff[3] = (ZCharge_a_P * Zem * PZs * RWeak + Gq(aptype) * PGs) * cdot(j1pmtop, j2mtop); // Coeff[4] = (ZCharge_a_M * Zem * PZs * RWeak + Gq(aptype) * PGs) * conj(cdot(j1pptop, j2ptop)); // Coeff[5] = (ZCharge_a_M * Zem * PZs * RWeak + Gq(aptype) * PGs) * conj(cdot(j1pptop, j2mtop)); // Coeff[6] = (ZCharge_a_M * Zep * PZs * RWeak + Gq(aptype) * PGs) * conj(cdot(j1pmtop, j2ptop)); // Coeff[7] = (ZCharge_a_M * Zep * PZs * RWeak + Gq(aptype) * PGs) * conj(cdot(j1pmtop, j2mtop)); // // Calculate gluon colour accelerated factor // double CAMFactor, z; // // If b is a forward moving gluon define z (C.F. multiple jets papers) // if (pb.pz() > 0) z = p2.plus() / pb.plus(); // else z = p2.minus() / pb.minus(); // CAMFactor = (1.0 - 1.0 / 9.0) / 2.0 * (z + 1.0 / z) + 1.0 / 9.0; // // Find the numbers of scales // int ScaleCount; // #if calcscaleunc // ScaleCount = 20; // #else // ScaleCount = 1; // #endif // // For each scale... // for (int j = 0; j < ScaleCount; j++) { // Sum = 0.0; // // If we dont want the interference // if (!Interference) for (int i = 0; i < 8; i++) Sum += abs2(Coeff[i]) * VProducts.at(0); // // Else work out the full interference // else { // if (UseVirtuals) { // for (int i = 0; i < 8; i++) Sum += abs2(Coeff[i]) * VProducts.at(0) * Virtuals.at(j).at(0); // } // else { // for (int i = 0; i < 8; i++) Sum += abs2(Coeff[i]) * VProducts.at(0); // } // } // // Add this to the vector to be returned with the other factors of C_A, the colour accelerated factor and the helicity sum/average factors.: (4/3)*3/32 // ScaledWeights.push_back(CAMFactor * Sum / 8.0); // } // return ScaledWeights; // } // // Electroweak Charge Functions // double Zq (int PID, bool Helcitiy) { // double temp; // // Positive Spin // if (Helcitiy == true) { // if (PID == 1 || PID == 3 || PID == 5) temp = (+ 1.0 * stw2 / 3.0) / ctw; // if (PID == 2 || PID == 4) temp = (- 2.0 * stw2 / 3.0) / ctw; // if (PID == -1 || PID == -3 || PID == -5) temp = (- 1.0 * stw2 / 3.0) / ctw; // if (PID == -2 || PID == -4) temp = (+ 2.0 * stw2 / 3.0) / ctw; // // If electron or positron // if (PID == 7 || PID == -7) temp = Zep; // } // // Negative Spin // else { // if (PID == 1 || PID == 3 || PID == 5) temp = (-0.5 + 1.0 * stw2 / 3.0) / ctw; // if (PID == 2 || PID == 4) temp = ( 0.5 - 2.0 * stw2 / 3.0) / ctw; // if (PID == -1 || PID == -3 || PID == -5) temp = ( 0.5 - 1.0 * stw2 / 3.0) / ctw; // if (PID == -2 || PID == -4) temp = (-0.5 + 2.0 * stw2 / 3.0) / ctw; // // If electron or positron // if (PID == 7 || PID == -7) temp = Zem; // } // return temp; // } // double Gq (int PID) { // if (!VirtualPhoton) return 0.0; // if (PID == -1) return 1.0 * ee / 3.0; // if (PID == -2) return -2.0 * ee / 3.0; // if (PID == -3) return 1.0 * ee / 3.0; // if (PID == -4) return -2.0 * ee / 3.0; // if (PID == -5) return 1.0 * ee / 3.0; // if (PID == 1) return -1.0 * ee / 3.0; // if (PID == 2) return 2.0 * ee / 3.0; // if (PID == 3) return -1.0 * ee / 3.0; // if (PID == 4) return 2.0 * ee / 3.0; // if (PID == 5) return -1.0 * ee / 3.0; // std::cout << "ERROR! No Electroweak Charge Found at line " << __LINE__ << "..." << std::endl; // return 0.0; // } namespace { - CCurrent jH (CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector pin, bool helin, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mt, bool incBot, double mb) + + //@{ + /// @brief Higgs vertex contracted with one current + + CCurrent jH (CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector pin, + bool helin, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, + double mt, bool incBot, double mb) { CCurrent j2 = j(pout,helout,pin,helin); CCurrent jq2(q2.e(),q2.px(),q2.py(),q2.pz()); if(mt == infinity) return ((q1.dot(q2))*j2 - j2.dot(q1)*jq2)/(3*M_PI*v); else { if(incBot) - return (-16.*M_PI*mb*mb/v*j2.dot(q1)*jq2*A1(-q1,q2,mb)-16.*M_PI*mb*mb/v*j2*A2(-q1,q2,mb)) + (-16.*M_PI*mt*mt/v*j2.dot(q1)*jq2*A1(-q1,q2,mt)-16.*M_PI*mt*mt/v*j2*A2(-q1,q2,mt)); + return (-16.*M_PI*mb*mb/v*j2.dot(q1)*jq2*A1(-q1,q2,mb)-16.*M_PI*mb*mb/v*j2*A2(-q1,q2,mb)) + + (-16.*M_PI*mt*mt/v*j2.dot(q1)*jq2*A1(-q1,q2,mt)-16.*M_PI*mt*mt/v*j2*A2(-q1,q2,mt)); else return (-16.*M_PI*mt*mt/v*j2.dot(q1)*jq2*A1(-q1,q2,mt)-16.*M_PI*mt*mt/v*j2*A2(-q1,q2,mt)); } } - CCurrent jioH (CLHEP::HepLorentzVector pin, bool helin, CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mt, bool incBot, double mb) + CCurrent jioH (CLHEP::HepLorentzVector pin, bool helin, CLHEP::HepLorentzVector pout, + bool helout, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, + double mt, bool incBot, double mb) { CCurrent j2 = jio(pin,helin,pout,helout); CCurrent jq2(q2.e(),q2.px(),q2.py(),q2.pz()); if(mt == infinity) return ((q1.dot(q2))*j2 - j2.dot(q1)*jq2)/(3*M_PI*v); else { if(incBot) - return (-16.*M_PI*mb*mb/v*j2.dot(q1)*jq2*A1(-q1,q2,mb)-16.*M_PI*mb*mb/v*j2*A2(-q1,q2,mb)) + (-16.*M_PI*mt*mt/v*j2.dot(q1)*jq2*A1(-q1,q2,mt)-16.*M_PI*mt*mt/v*j2*A2(-q1,q2,mt)); + return (-16.*M_PI*mb*mb/v*j2.dot(q1)*jq2*A1(-q1,q2,mb)-16.*M_PI*mb*mb/v*j2*A2(-q1,q2,mb)) + + (-16.*M_PI*mt*mt/v*j2.dot(q1)*jq2*A1(-q1,q2,mt)-16.*M_PI*mt*mt/v*j2*A2(-q1,q2,mt)); else return (-16.*M_PI*mt*mt/v*j2.dot(q1)*jq2*A1(-q1,q2,mt)-16.*M_PI*mt*mt/v*j2*A2(-q1,q2,mt)); } } - CCurrent jHtop (CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector pin, bool helin, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mt, bool incBot, double mb) + CCurrent jHtop (CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector pin, + bool helin, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, + double mt, bool incBot, double mb) { CCurrent j1 = j(pout,helout,pin,helin); CCurrent jq1(q1.e(),q1.px(),q1.py(),q1.pz()); if(mt == infinity) return ((q1.dot(q2))*j1 - j1.dot(q2)*jq1)/(3*M_PI*v); else { if(incBot) - return (-16.*M_PI*mb*mb/v*j1.dot(q2)*jq1*A1(-q1,q2,mb)-16.*M_PI*mb*mb/v*j1*A2(-q1,q2,mb)) + (-16.*M_PI*mt*mt/v*j1.dot(q2)*jq1*A1(-q1,q2,mt)-16.*M_PI*mt*mt/v*j1*A2(-q1,q2,mt)); + return (-16.*M_PI*mb*mb/v*j1.dot(q2)*jq1*A1(-q1,q2,mb)-16.*M_PI*mb*mb/v*j1*A2(-q1,q2,mb)) + + (-16.*M_PI*mt*mt/v*j1.dot(q2)*jq1*A1(-q1,q2,mt)-16.*M_PI*mt*mt/v*j1*A2(-q1,q2,mt)); else return (-16.*M_PI*mt*mt/v*j1.dot(q2)*jq1*A1(-q1,q2,mt)-16.*M_PI*mt*mt/v*j1*A2(-q1,q2,mt)); } } - CCurrent jioHtop (CLHEP::HepLorentzVector pin, bool helin, CLHEP::HepLorentzVector pout, bool helout, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mt, bool incBot, double mb) + CCurrent jioHtop (CLHEP::HepLorentzVector pin, bool helin, CLHEP::HepLorentzVector pout, + bool helout, CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, + double mt, bool incBot, double mb) { CCurrent j1 = jio(pin,helin,pout,helout); CCurrent jq1(q1.e(),q1.px(),q1.py(),q1.pz()); if(mt == infinity) return ((q1.dot(q2))*j1 - j1.dot(q2)*jq1)/(3*M_PI*v); else { if(incBot) - return (-16.*M_PI*mb*mb/v*j1.dot(q2)*jq1*A1(-q1,q2,mb)-16.*M_PI*mb*mb/v*j1*A2(-q1,q2,mb)) + (-16.*M_PI*mt*mt/v*j1.dot(q2)*jq1*A1(-q1,q2,mt)-16.*M_PI*mt*mt/v*j1*A2(-q1,q2,mt)); + return (-16.*M_PI*mb*mb/v*j1.dot(q2)*jq1*A1(-q1,q2,mb)-16.*M_PI*mb*mb/v*j1*A2(-q1,q2,mb)) + + (-16.*M_PI*mt*mt/v*j1.dot(q2)*jq1*A1(-q1,q2,mt)-16.*M_PI*mt*mt/v*j1*A2(-q1,q2,mt)); else return (-16.*M_PI*mt*mt/v*j1.dot(q2)*jq1*A1(-q1,q2,mt)-16.*M_PI*mt*mt/v*j1*A2(-q1,q2,mt)); } } + //@} } // namespace anonymous double jM2unogqHQ (CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt, bool incBot, double mb) { // This construction is taking rapidity order: pg > p1out >> p2out // std::cerr<<"This Uno Current: "< 1.0000001) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // if ((vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm))/(2*vre(Lmm-U1mm,Lmm+U2mm)) < 0.9999999) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // Now add the t-channels for the Higgs double th=qH1.m2()*qg.m2(); ampsq/=th; ampsq/=16.; - ampsq*=4.*4./(9.*9.); // Factor of (Cf/Ca) for each quark to match MH2qQ. + ampsq*=RHEJ::C_F*RHEJ::C_F/RHEJ::C_A/RHEJ::C_A; // Factor of (Cf/Ca) for each quark to match MH2qQ. //Higgs coupling is included in Hjets.C return ampsq; } double jM2unogqbarHQ (CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt, bool incBot, double mb) { // This construction is taking rapidity order: pg > p1out >> p2out // std::cerr<<"This Uno Current: "< 1.0000001) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // if ((vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm))/(2*vre(Lmm-U1mm,Lmm+U2mm)) < 0.9999999) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // Now add the t-channels for the Higgs double th=qH1.m2()*qg.m2(); ampsq/=th; ampsq/=16.; ampsq*=4.*4./(9.*9.); // Factor of (Cf/Ca) for each quark to match MH2qQ. //Higgs coupling is included in Hjets.C return ampsq; } double jM2unogqHQbar (CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt, bool incBot, double mb) { // This construction is taking rapidity order: pg > p1out >> p2out // std::cerr<<"This Uno Current: "< 1.0000001) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // if ((vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm))/(2*vre(Lmm-U1mm,Lmm+U2mm)) < 0.9999999) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // Now add the t-channels for the Higgs double th=qH1.m2()*qg.m2(); ampsq/=th; ampsq/=16.; ampsq*=4.*4./(9.*9.); // Factor of (Cf/Ca) for each quark to match MH2qQ. //Higgs coupling is included in Hjets.C return ampsq; } double jM2unogqbarHQbar (CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt, bool incBot, double mb) { // This construction is taking rapidity order: pg > p1out >> p2out // std::cerr<<"This Uno Current: "< 1.0000001) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // if ((vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm))/(2*vre(Lmm-U1mm,Lmm+U2mm)) < 0.9999999) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // Now add the t-channels for the Higgs double th=qH1.m2()*qg.m2(); ampsq/=th; ampsq/=16.; //Higgs coupling is included in Hjets.C ampsq*=4.*4./(9.*9.); // Factor of (Cf/Ca) for each quark to match MH2qQ. return ampsq; } double jM2unogqHg (CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt, bool incBot, double mb) { // This construction is taking rapidity order: pg > p1out >> p2out // std::cerr<<"This Uno Current: "< 1.0000001) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // if ((vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm))/(2*vre(Lmm-U1mm,Lmm+U2mm)) < 0.9999999) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // Now add the t-channels for the Higgs double th=qH1.m2()*qg.m2(); ampsq/=th; ampsq/=16.; ampsq*=4./9.*4./9.; // Factor of (Cf/Ca) for each quark to match MH2qQ. // here we need 2 to match with the normalization // gq is 9./4. times the qQ //Higgs coupling is included in Hjets.C - double ratio; // p2-/pb- in the notes - // if (p2in.plus()>0) // if the gluon is the positive - if (p2in.pz()>0) // if the gluon is the positive - ratio=p2out.plus()/p2in.plus(); - else // the gluon is the negative - ratio=p2out.minus()/p2in.minus(); - - double nonflipcolourmult=(1.-1./9.)/2.*(ratio+1./ratio)+1./9.; + const double K = K_g(p2out, p2in); - return ampsq*nonflipcolourmult*9./4.; //ca/cf = 9/4 + return ampsq*K/C_A*9./4.; //ca/cf = 9/4 } double jM2unogqbarHg (CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt, bool incBot, double mb) { // This construction is taking rapidity order: pg > p1out >> p2out // std::cerr<<"This Uno Current: "< 1.0000001) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // if ((vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm))/(2*vre(Lmm-U1mm,Lmm+U2mm)) < 0.9999999) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // Now add the t-channels for the Higgs double th=qH1.m2()*qg.m2(); ampsq/=th; ampsq/=16.; ampsq*=4./9.*4./9.; // Factor of (Cf/Ca) for each quark to match MH2qQ. // here we need 2 to match with the normalization // gq is 9./4. times the qQ //Higgs coupling is included in Hjets.C - double ratio; // p2-/pb- in the notes - // if (p2in.plus()>0) // if the gluon is the positive - if (p2in.pz()>0) // if the gluon is the positive - ratio=p2out.plus()/p2in.plus(); - else // the gluon is the negative - ratio=p2out.minus()/p2in.minus(); + const double K = K_g(p2out, p2in); - double nonflipcolourmult=(1.-1./9.)/2.*(ratio+1./ratio)+1./9.; - - return ampsq*nonflipcolourmult*9./4.; //ca/cf = 9/4 + return ampsq*K/C_F; } double jM2unobqHQg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt, bool incBot, double mb) { // std::cout << "####################\n"; // std::cout << "# p1in : "< 1.0000001) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // if ((vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm))/(2*vre(Lmm-U1mm,Lmm+U2mm)) < 0.9999999) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // Now add the t-channels for the Higgs - double th=qH2.m2()*q2.m2(); + const double th=qH2.m2()*q2.m2(); ampsq/=th; ampsq/=16.; - ampsq*=4.*4./(9.*9.); // Factor of (Cf/Ca) for each quark to match MH2qQ. + ampsq*=RHEJ::C_F*RHEJ::C_F/(RHEJ::C_A*RHEJ::C_A); // Factor of (Cf/Ca) for each quark to match MH2qQ. return ampsq; } double jM2unobqbarHQg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt, bool incBot, double mb) { CLHEP::HepLorentzVector q1=p1in-p1out; // Top End CLHEP::HepLorentzVector q2=-(p2in-p2out-pg); // Extra bit pre-gluon CLHEP::HepLorentzVector q3=-(p2in-p2out); // Bottom End // std::cerr<<"Current: "< 1.0000001) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // if ((vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm))/(2*vre(Lmm-U1mm,Lmm+U2mm)) < 0.9999999) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // Now add the t-channels for the Higgs double th=qH2.m2()*q2.m2(); ampsq/=th; ampsq/=16.; ampsq*=4.*4./(9.*9.); // Factor of (Cf/Ca) for each quark to match MH2qQ. //Higgs coupling is included in Hjets.C return ampsq; } double jM2unobqHQbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt, bool incBot, double mb) { CLHEP::HepLorentzVector q1=p1in-p1out; // Top End CLHEP::HepLorentzVector q2=-(p2in-p2out-pg); // Extra bit pre-gluon CLHEP::HepLorentzVector q3=-(p2in-p2out); // Bottom End // std::cerr<<"Current: "< 1.0000001) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // if ((vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm))/(2*vre(Lmm-U1mm,Lmm+U2mm)) < 0.9999999) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // Now add the t-channels for the Higgs double th=qH2.m2()*q2.m2(); ampsq/=th; ampsq/=16.; ampsq*=4.*4./(9.*9.); // Factor of (Cf/Ca) for each quark to match MH2qQ. //Higgs coupling is included in Hjets.C return ampsq; } double jM2unobqbarHQbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt, bool incBot, double mb) { CLHEP::HepLorentzVector q1=p1in-p1out; // Top End CLHEP::HepLorentzVector q2=-(p2in-p2out-pg); // Extra bit pre-gluon CLHEP::HepLorentzVector q3=-(p2in-p2out); // Bottom End // std::cerr<<"Current: "< 1.0000001) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // if ((vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm))/(2*vre(Lmm-U1mm,Lmm+U2mm)) < 0.9999999) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // Now add the t-channels for the Higgs double th=qH2.m2()*q2.m2(); ampsq/=th; ampsq/=16.; ampsq*=4.*4./(9.*9.); // Factor of (Cf/Ca) for each quark to match MH2qQ. //Higgs coupling is included in Hjets.C return ampsq; } double jM2unobgHQg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt, bool incBot, double mb) { // std::cout << "####################\n"; // std::cout << "# p1in : "< 1.0000001) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // if ((vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm))/(2*vre(Lmm-U1mm,Lmm+U2mm)) < 0.9999999) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // Now add the t-channels for the Higgs double th=qH2.m2()*q2.m2(); ampsq/=th; ampsq/=16.; ampsq*=4./9.*4./9.; // Factor of (Cf/Ca) for each quark to match MH2qQ. // need twice to match the normalization //Higgs coupling is included in Hjets.C - double ratio; // p2-/pb- in the notes - // if (p2in.plus()>0) // if the gluon is the positive - if (p1in.pz()>0) // if the gluon is the positive - ratio=p1out.plus()/p1in.plus(); - else // the gluon is the negative - ratio=p1out.minus()/p1in.minus(); + const double K = K_g(p1out, p1in); - double nonflipcolourmult=(1.-1./9.)/2.*(ratio+1./ratio)+1./9.; - - return ampsq*nonflipcolourmult*9./4.; //ca/cf = 9/4 + return ampsq*K/C_F; } double jM2unobgHQbarg (CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector pg, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector qH1, CLHEP::HepLorentzVector qH2, double mt, bool incBot, double mb) { CLHEP::HepLorentzVector q1=p1in-p1out; // Top End CLHEP::HepLorentzVector q2=-(p2in-p2out-pg); // Extra bit pre-gluon CLHEP::HepLorentzVector q3=-(p2in-p2out); // Bottom End // std::cerr<<"Current: "< 1.0000001) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // if ((vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm))/(2*vre(Lmm-U1mm,Lmm+U2mm)) < 0.9999999) // std::cout << " Big Problem!! " << vabs2(Lmm-U1mm+U2mm)+vabs2(Lmm)-vabs2(U1mm)-vabs2(U2mm) << " " << 2*vre(Lmm-U1mm,Lmm+U2mm) << std::endl; // Now add the t-channels for the Higgs double th=qH2.m2()*q2.m2(); ampsq/=th; ampsq/=16.; ampsq*=4./9.*4./9.; // Factor of (Cf/Ca) for each quark to match MH2qQ. //Higgs coupling is included in Hjets.C - double ratio; // p2-/pb- in the notes - // if (p2in.plus()>0) // if the gluon is the positive - if (p1in.pz()>0) // if the gluon is the positive - ratio=p1out.plus()/p1in.plus(); - else // the gluon is the negative - ratio=p1out.minus()/p1in.minus(); + const double K = K_g(p1out, p1in); - double nonflipcolourmult=(1.-1./9.)/2.*(ratio+1./ratio)+1./9.; - - return ampsq*nonflipcolourmult*9./4.; //ca/cf = 9/4 + return ampsq*K/C_F; //ca/cf = 9/4 } // Begin finite mass stuff #ifdef RHEJ_BUILD_WITH_QCDLOOP namespace { // All the stuff needed for the box functions in qg->qgH now... //COM E1(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM E1(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //CLHEP::HepLorentzVector q2=k3+k4; CLHEP::HepLorentzVector q2=-(k1+k2+kh); double Delta, Sigma, S1, S2, s12, s34; S1 = 2.*k1.dot(q2); S2 = 2.*k2.dot(q2); s12 = 2.*k1.dot(k2); //s34 = 2.*k3.dot(k4); s34 = q2.m2(); Delta = s12*s34 - S1*S2; Sigma = 4.*s12*s34 - pow(S1+S2,2); return looprwfactor*(-s12*D0DD(k2, k1, q2, mq)*(1 - 8.*mq*mq/s12 + S2/(2.*s12) + S2*(s12 - 8.*mq*mq)*(s34 + S1)/(2.*s12*Delta) + 2.*(s34 + S1)*(s34 + S1)/Delta + S2*pow((s34 + S1),3)/Delta/Delta) - ((s12 + S2)*C0DD(k2, k1 + q2, mq) - s12*C0DD(k1, k2, mq) + (S1 - S2)*C0DD(k1 + k2, q2, mq) - S1*C0DD(k1, q2, mq))*(S2*(s12 - 4.*mq*mq)/(2.*s12*Delta) + 2.*(s34 + S1)/Delta + S2*pow((s34 + S1),2)/Delta/Delta) + (C0DD(k1, q2, mq) - C0DD(k1 + k2, q2, mq))*(1. - 4.*mq*mq/s12) - C0DD(k1 + k2, q2, mq)*2.*s34/ S1 - (B0DD(k1 + q2, mq) - B0DD(k1 + k2 + q2, mq))*2.*s34*(s34 + S1)/(S1*Delta) + (B0DD(q2, mq) - B0DD(k1 + k2 + q2, mq) + s12*C0DD(k1 + k2, q2, mq))*(2.*s34*(s34 + S1)*(S1 - S2)/(Delta*Sigma) + 2.*s34*(s34 + S1)/(S1*Delta)) + (B0DD(k1 + k2, mq) - B0DD(k1 + k2 + q2, mq) - (s34 + S1 + S2)*C0DD(k1 + k2, q2, mq))*2.*(s34 + S1)*(2.*s12*s34 - S2*(S1 + S2))/(Delta*Sigma)); } //COM F1(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM F1(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //CLHEP::HepLorentzVector q2=k3+k4; CLHEP::HepLorentzVector q2 = -(k1+k2+kh); double Delta, Sigma, S1, S2, s12, s34; S1 = 2.*k1.dot(q2); S2 = 2.*k2.dot(q2); s12 = 2.*k1.dot(k2); //s34 = 2.*k3.dot(k4); s34 = q2.m2(); Delta = s12*s34 - S1*S2; Sigma = 4.*s12*s34 - pow(S1+S2,2); return looprwfactor*(-S2*D0DD(k1, k2, q2, mq)*(0.5 - (s12 - 8.*mq*mq)*(s34 + S2)/(2.*Delta) - s12*pow((s34 + S2),3)/Delta/Delta) + ((s12 + S1)*C0DD(k1, k2 + q2, mq) - s12*C0DD(k1, k2, mq) - (S1 - S2)*C0DD(k1 + k2, q2, mq) - S2*C0DD(k2, q2, mq))*(S2*(s12 - 4.*mq*mq)/(2.*s12*Delta) + S2*pow((s34 + S2),2)/Delta/Delta) - (C0DD(k1 + k2, q2, mq) - C0DD(k1, k2 + q2, mq))*(1. - 4.*mq*mq/s12) - C0DD(k1, k2 + q2, mq) + (B0DD(k2 + q2, mq) - B0DD(k1 + k2 + q2, mq))*2.*pow((s34 + S2),2)/((s12 + S1)*Delta) - (B0DD( q2, mq) - B0DD(k1 + k2 + q2, mq) + s12*C0DD(k1 + k2, q2, mq))*2.*s34*(s34 + S2)*(S2 - S1)/(Delta*Sigma) + (B0DD( k1 + k2, mq) - B0DD(k1 + k2 + q2, mq) - (s34 + S1 + S2)*C0DD(k1 + k2, q2, mq))*2.*(s34 + S2)*(2.*s12*s34 - S2*(S1 + S2))/(Delta*Sigma)); } //COM G1(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM G1(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //CLHEP::HepLorentzVector q2=k3+k4; CLHEP::HepLorentzVector q2 = -(k1+k2+kh); double Delta, S1, S2, s12, s34; S1 = 2.*k1.dot(q2); S2 = 2.*k2.dot(q2); s12 = 2.*k1.dot(k2); //s34 = 2.*k3.dot(k4); s34 = q2.m2(); Delta = s12*s34 - S1*S2; return looprwfactor*(S2*D0DD(k1, q2, k2, mq)*(Delta/s12/s12 - 4.*mq*mq/s12) - S2*((s12 + S1)*C0DD(k1, k2 + q2, mq) - S1*C0DD(k1, q2, mq))*(1./ s12/s12 - (s12 - 4.*mq*mq)/(2.*s12*Delta)) - S2*((s12 + S2)*C0DD(k1 + q2, k2, mq) - S2*C0DD(k2, q2, mq))*(1./ s12/s12 + (s12 - 4.*mq*mq)/(2.*s12*Delta)) - C0DD(k1, q2, mq) - (C0DD(k1, k2 + q2, mq) - C0DD(k1, q2, mq))*4.*mq*mq/ s12 + (B0DD(k1 + q2, mq) - B0DD(k1 + k2 + q2, mq))*2./ s12 + (B0DD(k1 + q2, mq) - B0DD(q2, mq))*2.*s34/(s12*S1) + (B0DD(k2 + q2, mq) - B0DD(k1 + k2 + q2, mq))*2.*(s34 + S2)/(s12*(s12 + S1))); } //COM E4(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM E4(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //CLHEP::HepLorentzVector q2=k3+k4; CLHEP::HepLorentzVector q2 = -(k1+k2+kh); double Delta, Sigma, S1, S2, s12, s34; S1 = 2.*k1.dot(q2); S2 = 2.*k2.dot(q2); s12 = 2.*k1.dot(k2); //s34 = 2.*k3.dot(k4); s34 = q2.m2(); Delta = s12*s34 - S1*S2; Sigma = 4.*s12*s34 - pow(S1+S2,2); return looprwfactor* (-s12*D0DD(k2, k1, q2, mq)*(0.5 - (S1 - 8.*mq*mq)*(s34 + S1)/(2.*Delta) - s12*pow((s34 + S1),3)/Delta/Delta) + ((s12 + S2)*C0DD(k2, k1 + q2, mq) - s12*C0DD(k1, k2, mq) + (S1 - S2)*C0DD(k1 + k2, q2, mq) - S1*C0DD(k1, q2, mq))*((S1 - 4.*mq*mq)/(2.*Delta) + s12*pow((s34 + S1),2)/Delta/Delta) - C0DD(k1 + k2, q2, mq) + (B0DD(k1 + q2, mq) - B0DD(k1 + k2 + q2, mq))*(2.*s34/Delta + 2.*s12*(s34 + S1)/((s12 + S2)*Delta)) - (B0DD( q2, mq) - B0DD(k1 + k2 + q2, mq) + s12*C0DD(k1 + k2, q2, mq))*((2.*s34*(2.*s12*s34 - S2*(S1 + S2) + s12*(S1 - S2)))/(Delta*Sigma)) + (B0DD(k1 + k2, mq) - B0DD(k1 + k2 + q2, mq) - (s34 + S1 + S2)*C0DD(k1 + k2, q2, mq))*((2.*s12*(2.*s12*s34 - S1*(S1 + S2) + s34*(S2 - S1)))/(Delta*Sigma))); } //COM F4(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM F4(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //CLHEP::HepLorentzVector q2=k3+k4; CLHEP::HepLorentzVector q2 = -(k1+k2+kh); double Delta, Sigma, S1, S2, s12, s34; S1 = 2.*k1.dot(q2); S2 = 2.*k2.dot(q2); s12 = 2.*k1.dot(k2); //s34 = 2.*k3.dot(k4); s34 = q2.m2(); Delta = s12*s34 - S1*S2; Sigma = 4.*s12*s34 - pow(S1+S2,2); return looprwfactor* (-s12*D0DD(k1, k2, q2, mq)*(0.5 + (S1 - 8.*mq*mq)*(s34 + S2)/(2.*Delta) + s12*pow((s34 + S2),3)/Delta/Delta) - ((s12 + S1)*C0DD(k1, k2 + q2, mq) - s12*C0DD(k1, k2, mq) - (S1 - S2)*C0DD(k1 + k2, q2, mq) - S2*C0DD(k2, q2, mq))*((S1 - 4.*mq*mq)/(2.*Delta) + s12*pow((s34 + S2),2)/Delta/Delta) - C0DD(k1 + k2, q2, mq) - (B0DD(k2 + q2, mq) - B0DD(k1 + k2 + q2, mq))*2.*(s34 + S2)/Delta + (B0DD(q2, mq) - B0DD(k1 + k2 + q2, mq) + s12*C0DD(k1 + k2, q2, mq))*2.*s34*(2.*s12*s34 - S1*(S1 + S2) + s12*(S2 - S1))/(Delta*Sigma) - (B0DD(k1 + k2, mq) - B0DD(k1 + k2 + q2, mq) - (s34 + S1 + S2)*C0DD(k1 + k2, q2, mq))*(2.*s12*(2.*s12*s34 - S2*(S1 + S2) + s34*(S1 - S2))/(Delta*Sigma))); } //COM G4(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM G4(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //CLHEP::HepLorentzVector q2=k3+k4; CLHEP::HepLorentzVector q2 = -(k1+k2+kh); double Delta, S1, S2, s12, s34; S1 = 2.*k1.dot(q2); S2 = 2.*k2.dot(q2); s12 = 2.*k1.dot(k2); //s34 = 2.*k3.dot(k4); s34 = q2.m2(); Delta = s12*s34 - S1*S2; return looprwfactor* (-D0DD(k1, q2, k2, mq)*(Delta/s12 + (s12 + S1)/2. - 4.*mq*mq) + ((s12 + S1)*C0DD(k1, k2 + q2, mq) - S1*C0DD(k1, q2, mq))*(1./ s12 - (S1 - 4.*mq*mq)/(2.*Delta)) + ((s12 + S2)*C0DD( k1 + q2, k2, mq) - S2*C0DD(k2, q2, mq))*(1./ s12 + (S1 - 4.*mq*mq)/(2.*Delta)) + (B0DD( k1 + k2 + q2, mq) - B0DD(k1 + q2, mq))*2./(s12 + S2)); } //COM E10(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM E10(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //CLHEP::HepLorentzVector q2=k3+k4; CLHEP::HepLorentzVector q2 = -(k1+k2+kh); double Delta, Sigma, S1, S2, s12, s34; S1 = 2.*k1.dot(q2); S2 = 2.*k2.dot(q2); s12 = 2.*k1.dot(k2); //s34 = 2.*k3.dot(k4); s34 = q2.m2(); Delta = s12*s34 - S1*S2; Sigma = 4.*s12*s34 - pow(S1+S2,2); return looprwfactor*(-s12*D0DD(k2, k1, q2, mq)*((s34 + S1)/Delta + 12.*mq*mq*S1*(s34 + S1)/Delta/Delta - 4.*s12*S1*pow((s34 + S1),3)/Delta/Delta/Delta) - ((s12 + S2)*C0DD(k2, k1 + q2, mq) - s12*C0DD(k1, k2, mq) + (S1 - S2)*C0DD(k1 + k2, q2, mq) - S1*C0DD(k1, q2, mq))*(1./Delta + 4.*mq*mq*S1/Delta/Delta - 4.*s12*S1*pow((s34 + S1),2)/Delta/Delta/Delta) + C0DD(k1 + k2, q2, mq)*(4.*s12*s34*(S1 - S2)/(Delta*Sigma) - 4.*(s12 - 2.*mq*mq)*(2.*s12*s34 - S1*(S1 + S2))/(Delta*Sigma)) + (B0DD(k1 + q2, mq) - B0DD(k1 + k2 + q2, mq))*(4.*(s34 + S1)/((s12 + S2)*Delta) + 8.*S1*(s34 + S1)/Delta/Delta) + (B0DD(q2, mq) - B0DD(k1 + k2 + q2, mq) + s12*C0DD(k1 + k2, q2, mq))*(12.*s34*(2.*s12 + S1 + S2)*(2.*s12*s34 - S1*(S1 + S2))/(Delta*Sigma*Sigma) - 4.*s34*(4.*s12 + 3.*S1 + S2)/(Delta*Sigma) + 8.*s12*s34*(s34*(s12 + S2) - S1*(s34 + S1))/(Delta*Delta*Sigma)) + (B0DD(k1 + k2, mq) - B0DD(k1 + k2 + q2, mq) - (s34 + S1 + S2)*C0DD(k1 + k2, q2, mq))*(12.*s12*(2.*s34 + S1 + S2)*(2.*s12*s34 - S1*(S1 + S2))/(Delta*Sigma*Sigma) + 8.*s12*S1*(s34*(s12 + S2) - S1*(s34 + S1))/(Delta*Delta*Sigma))) + (COM(0.,1.)/(4.*M_PI*M_PI))*((2.*s12*s34 - S1*(S1 + S2))/(Delta*Sigma)); } //COM F10(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM F10(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //CLHEP::HepLorentzVector q2=k3+k4; CLHEP::HepLorentzVector q2 = -(k1+k2+kh); double Delta, Sigma, S1, S2, s12, s34; S1 = 2.*k1.dot(q2); S2 = 2.*k2.dot(q2); s12 = 2.*k1.dot(k2); //s34 = 2.*k3.dot(k4); s34 = q2.m2(); Delta = s12*s34 - S1*S2; Sigma = 4.*s12*s34 - pow(S1+S2,2); return looprwfactor* (s12*D0DD(k1, k2, q2, mq)*((s34 + S2)/Delta - 4.*mq*mq/Delta + 12.*mq*mq*s34*(s12 + S1)/Delta/Delta - 4.*s12*pow((s34 + S2),2)/Delta/Delta - 4.*s12*S1*pow((s34 + S2),3)/Delta/Delta/Delta) + ((s12 + S1)*C0DD(k1, k2 + q2, mq) - s12*C0DD(k1, k2, mq) - (S1 - S2)*C0DD(k1 + k2, q2, mq) - S2*C0DD(k2, q2, mq))*(1./Delta + 4.*mq*mq*S1/Delta/Delta - 4.*s12*(s34 + S2)/Delta/Delta - 4.*s12*S1*pow((s34 + S2),2)/Delta/Delta/Delta) - C0DD(k1 + k2, q2, mq)*(4.*s12*s34/(S2*Delta) + 4.*s12*s34*(S2 - S1)/(Delta*Sigma) + 4.*(s12 - 2.*mq*mq)*(2.*s12*s34 - S1*(S1 + S2))/(Delta*Sigma)) - (B0DD( k2 + q2, mq) - B0DD(k1 + k2 + q2, mq))*(4.*s34/(S2*Delta) + 8.*s34*(s12 + S1)/Delta/Delta) - (B0DD(q2, mq) - B0DD(k1 + k2 + q2, mq) + s12*C0DD(k1 + k2, q2, mq))*(-12*s34*(2*s12 + S1 + S2)*(2.*s12*s34 - S1*(S1 + S2))/(Delta*Sigma*Sigma) - 4.*s12*s34*s34/(S2*Delta*Delta) + 4.*s34*S1/(Delta*Sigma) - 4.*s34*(s12*s34*(2.*s12 + S2) - S1*S1*(2.*s12 + S1))/(Delta*Delta*Sigma)) - (B0DD(k1 + k2, mq) - B0DD(k1 + k2 + q2, mq) - (s34 + S1 + S2)*C0DD(k1 + k2, q2, mq))*(-12.*s12*(2.*s34 + S1 + S2)*(2.*s12*s34 - S1*(S1 + S2))/(Delta*Sigma*Sigma) + 8.*s12*(2.*s34 + S1)/(Delta*Sigma) - 8.*s12*s34*(2.*s12*s34 - S1*(S1 + S2) + s12*(S2 - S1))/(Delta*Delta*Sigma))) + (COM(0.,1.)/(4.*M_PI*M_PI))*((2.*s12*s34 - S1*(S1 + S2))/(Delta*Sigma)); } //COM G10(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM G10(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //CLHEP::HepLorentzVector q2=k3+k4; CLHEP::HepLorentzVector q2 = -(k1+k2+kh); double Delta, S1, S2, s12, s34; S1 = 2.*k1.dot(q2); S2 = 2.*k2.dot(q2); s12 = 2.*k1.dot(k2); //s34 = 2.*k3.dot(k4); s34 = q2.m2(); Delta = s12*s34 - S1*S2; return looprwfactor* (-D0DD(k1, q2, k2, mq)*(1. + 4.*S1*mq*mq/Delta) + ((s12 + S1)*C0DD(k1, k2 + q2, mq) - S1*C0DD(k1, q2, mq))*(1./Delta + 4.*S1*mq*mq/Delta/Delta) - ((s12 + S2)*C0DD(k1 + q2, k2, mq) - S2*C0DD(k2, q2, mq))*(1./Delta + 4.*S1*mq*mq/Delta/Delta) + (B0DD(k1 + k2 + q2, mq) - B0DD(k1 + q2, mq))*4.*(s34 + S1)/(Delta*(s12 + S2)) + (B0DD(q2, mq) - B0DD(k2 + q2, mq))*4.*s34/(Delta*S2)); } //COM H1(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM H1(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //return E1(k1,k2,k3,k4,mq)+F1(k1,k2,k3,k4,mq)+G1(k1,k2,k3,k4,mq); return E1(k1,k2,kh,mq)+F1(k1,k2,kh,mq)+G1(k1,k2,kh,mq); } //COM H4(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM H4(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //return E4(k1,k2,k3,k4,mq)+F4(k1,k2,k3,k4,mq)+G4(k1,k2,k3,k4,mq); return E4(k1,k2,kh,mq)+F4(k1,k2,kh,mq)+G4(k1,k2,kh,mq); } //COM H10(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM H10(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //return E10(k1,k2,k3,k4,mq)+F10(k1,k2,k3,k4,mq)+G10(k1,k2,k3,k4,mq); return E10(k1,k2,kh,mq)+F10(k1,k2,kh,mq)+G10(k1,k2,kh,mq); } //COM H2(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM H2(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //return -1.*H1(k2,k1,k3,k4,mq); return -1.*H1(k2,k1,kh,mq); } //COM H5(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM H5(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //return -1.*H4(k2,k1,k3,k4,mq); return -1.*H4(k2,k1,kh,mq); } //COM H12(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector k3, CLHEP::HepLorentzVector k4, double mq) COM H12(CLHEP::HepLorentzVector k1, CLHEP::HepLorentzVector k2, CLHEP::HepLorentzVector kh, double mq) { //return -1.*H10(k2,k1,k3,k4,mq); return -1.*H10(k2,k1,kh,mq); } // FL and FT functions COM FL(CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mq) { CLHEP::HepLorentzVector Q = q1 + q2; double detQ2 = q1.m2()*q2.m2() - q1.dot(q2)*q1.dot(q2); return -1./(2.*detQ2)*((2.- 3.*q1.m2()*q2.dot(Q)/detQ2)*(B0DD(q1, mq) - B0DD(Q, mq)) + (2. - 3.*q2.m2()*q1.dot(Q)/detQ2)*(B0DD(q2, mq) - B0DD(Q, mq)) - (4.*mq*mq + q1.m2() + q2.m2() + Q.m2() - 3.*q1.m2()*q2.m2()*Q.m2()/detQ2)*C0DD( q1, q2, mq) - 2.); } COM FT(CLHEP::HepLorentzVector q1, CLHEP::HepLorentzVector q2, double mq) { CLHEP::HepLorentzVector Q = q1 + q2; double detQ2 = q1.m2()*q2.m2() - q1.dot(q2)*q1.dot(q2); return -1./(2.*detQ2)*(Q.m2()*(B0DD(q1, mq) + B0DD(q2, mq) - 2.*B0DD(Q, mq) - 2.*q1.dot(q2)*C0DD(q1, q2, mq)) + (q1.m2() - q2.m2()) *(B0DD(q1, mq) - B0DD(q2, mq))) - q1.dot(q2)*FL(q1, q2, mq); } CLHEP::HepLorentzVector ParityFlip(CLHEP::HepLorentzVector p) { CLHEP::HepLorentzVector flippedVector; flippedVector.setE(p.e()); flippedVector.setX(-p.x()); flippedVector.setY(-p.y()); flippedVector.setZ(-p.z()); return flippedVector; } - // HC amp for qg->qgH with finite top - void g_gH_HC(CLHEP::HepLorentzVector pa, CLHEP::HepLorentzVector p1, CLHEP::HepLorentzVector pH, double mq, current &retAns) + /// @brief HC amp for qg->qgH with finite top (i.e. j^{++}_H) + void g_gH_HC(CLHEP::HepLorentzVector pa, CLHEP::HepLorentzVector p1, + CLHEP::HepLorentzVector pH, double mq, current &retAns) { - current cura1,pacur,p1cur,pHcur,conjeps1,conjepsH1,epsa,epsHa,epsHapart1,epsHapart2,conjepsH1part1,conjepsH1part2; - current T1,T2,T3,T4,T5,T6,T7,T8,T9,T10, ans; - COM ang1a,sqa1,aH1,Fta,Ft1,h4,h5,h10,h12; - double prop; - //cout << mq << endl; - //double F = 4.*mq*mq/v/16./M_PI/M_PI; - double F = 4.*mq*mq/v; - //cout << mq << endl; - //cout << HVE << endl; + current cura1,pacur,p1cur,pHcur,conjeps1,conjepsH1,epsa,epsHa,epsHapart1, + epsHapart2,conjepsH1part1,conjepsH1part2; + COM ang1a,sqa1; + + const double F = 4.*mq*mq/v; // Easier to have the whole thing as current object so I can use cdot functionality. // Means I need to write pa,p1 as current objects to_current(pa, pacur); to_current(p1,p1cur); to_current(pH,pHcur); bool gluonforward = true; if(pa.z() < 0) gluonforward = false; //HEJ gauge jio(pa,false,p1,false,cura1); if(gluonforward){ + // sqrt(2pa_-/p1_-)*p1_perp/abs(p1_perp) ang1a = sqrt(pa.plus()*p1.minus())*(p1.x()+COM(0.,1.)*p1.y())/p1.perp(); - sqa1 = sqrt(pa.plus()*p1.minus())*(p1.x()-COM(0.,1.)*p1.y())/p1.perp(); } - else { + // sqrt(2pa_-/p1_-)*p1_perp*/abs(p1_perp) + sqa1 = sqrt(pa.plus()*p1.minus())*(p1.x()-COM(0.,1.)*p1.y())/p1.perp(); + } else { ang1a = sqrt(pa.minus()*p1.plus()); sqa1 = sqrt(pa.minus()*p1.plus()); } - prop = (pa-p1-pH).m2(); - - //double Acheck = 1./(12.*M_PI*M_PI*v); + const double prop = (pa-p1-pH).m2(); cmult(-1./sqrt(2)/ang1a,cura1,conjeps1); cmult(1./sqrt(2)/sqa1,cura1,epsa); - //if(mq<1000.){ - Fta = FT(-pa,pa-pH,mq)/(pa-pH).m2(); - Ft1 = FT(-p1-pH,p1,mq)/(p1+pH).m2(); - //} - //else{ - // Fta = -Acheck/(pa-pH).m2()/F; - // Ft1 = -Acheck/(p1+pH).m2()/F; - //} - - //if(mq<1000.){ - h4 = H4(p1,-pa,pH,mq); - h5 = H5(p1,-pa,pH,mq); - h10 = H10(p1,-pa,pH,mq); - h12 = H12(p1,-pa,pH,mq); - //} - //else{ - // h4 = COM(0.,2.)/16./M_PI/M_PI*Acheck/F; - // h5 = COM(0.,-2.)/16./M_PI/M_PI*Acheck/F; - // h10 = 0; - // h12 = 0; - //} - - - cmult(Fta*pa.dot(pH),epsa,epsHapart1); - cmult(-1.*Fta*cdot(pHcur,epsa),pacur,epsHapart2); - cmult(Ft1*cdot(pHcur,conjeps1),p1cur,conjepsH1part1); - cmult(-Ft1*p1.dot(pH),conjeps1,conjepsH1part2); - cadd(epsHapart1,epsHapart2,epsHa); - cadd(conjepsH1part1,conjepsH1part2,conjepsH1); - aH1 = cdot(pHcur,cura1); + const COM Fta = FT(-pa,pa-pH,mq)/(pa-pH).m2(); + const COM Ft1 = FT(-p1-pH,p1,mq)/(p1+pH).m2(); + + const COM h4 = H4(p1,-pa,pH,mq); + const COM h5 = H5(p1,-pa,pH,mq); + const COM h10 = H10(p1,-pa,pH,mq); + const COM h12 = H12(p1,-pa,pH,mq); + + + cmult(Fta*pa.dot(pH), epsa, epsHapart1); + cmult(-1.*Fta*cdot(pHcur,epsa), pacur, epsHapart2); + cmult(Ft1*cdot(pHcur,conjeps1), p1cur, conjepsH1part1); + cmult(-Ft1*p1.dot(pH), conjeps1, conjepsH1part2); + cadd(epsHapart1, epsHapart2, epsHa); + cadd(conjepsH1part1, conjepsH1part2, conjepsH1); + const COM aH1 = cdot(pHcur, cura1); + + current T1,T2,T3,T4,T5,T6,T7,T8,T9,T10; if(gluonforward){ - cmult(sqrt(2.)*sqrt(p1.plus()/pa.plus())*prop/sqa1,conjepsH1,T1); - cmult(-sqrt(2.)*sqrt(pa.plus()/p1.plus())*prop/ang1a,epsHa,T2); + cmult(sqrt(2.)*sqrt(p1.plus()/pa.plus())*prop/sqa1, conjepsH1, T1); + cmult(-sqrt(2.)*sqrt(pa.plus()/p1.plus())*prop/ang1a, epsHa, T2); } else{ - cmult(-sqrt(2.)*sqrt(p1.minus()/pa.minus())*((p1.x()-COM(0.,1.)*p1.y())/p1.perp())*prop/sqa1,conjepsH1,T1); - cmult(sqrt(2.)*sqrt(pa.minus()/p1.minus())*((p1.x()-COM(0.,1.)*p1.y())/p1.perp())*prop/ang1a,epsHa,T2); + cmult(-sqrt(2.)*sqrt(p1.minus()/pa.minus()) + *((p1.x()-COM(0.,1.)*p1.y())/p1.perp())*prop/sqa1, conjepsH1, T1); + cmult(sqrt(2.)*sqrt(pa.minus()/p1.minus()) + *((p1.x()-COM(0.,1.)*p1.y())/p1.perp())*prop/ang1a, epsHa, T2); } - cmult(sqrt(2.)/ang1a*aH1,epsHa,T3); - cmult(sqrt(2.)/sqa1*aH1,conjepsH1,T4); + cmult(sqrt(2.)/ang1a*aH1, epsHa, T3); + cmult(sqrt(2.)/sqa1*aH1, conjepsH1, T4); - cmult(-sqrt(2.)*Fta*pa.dot(p1)*aH1/sqa1,conjeps1,T5); - cmult(-sqrt(2.)*Ft1*pa.dot(p1)*aH1/ang1a,epsa,T6); + cmult(-sqrt(2.)*Fta*pa.dot(p1)*aH1/sqa1, conjeps1, T5); + cmult(-sqrt(2.)*Ft1*pa.dot(p1)*aH1/ang1a, epsa, T6); - cmult(-aH1/sqrt(2.)/sqa1*h4*8.*COM(0.,1.)*M_PI*M_PI,conjeps1,T7); - cmult(aH1/sqrt(2.)/ang1a*h5*8.*COM(0.,1.)*M_PI*M_PI,epsa,T8); - cmult(aH1*aH1/2./ang1a/sqa1*h10*8.*COM(0.,1.)*M_PI*M_PI,pacur,T9); - cmult(-aH1*aH1/2./ang1a/sqa1*h12*8.*COM(0.,1.)*M_PI*M_PI,p1cur,T10); + cmult(-aH1/sqrt(2.)/sqa1*h4*8.*COM(0.,1.)*M_PI*M_PI, conjeps1, T7); + cmult(aH1/sqrt(2.)/ang1a*h5*8.*COM(0.,1.)*M_PI*M_PI, epsa, T8); + cmult(aH1*aH1/2./ang1a/sqa1*h10*8.*COM(0.,1.)*M_PI*M_PI, pacur, T9); + cmult(-aH1*aH1/2./ang1a/sqa1*h12*8.*COM(0.,1.)*M_PI*M_PI, p1cur, T10); + current ans; for(int i=0;i<4;i++) { ans[i] = T1[i]+T2[i]+T3[i]+T4[i]+T5[i]+T6[i]+T7[i]+T8[i]+T9[i]+T10[i]; } retAns[0] = F/prop*ans[0]; retAns[1] = F/prop*ans[1]; retAns[2] = F/prop*ans[2]; retAns[3] = F/prop*ans[3]; } - // HNC amp for qg->qgH with finite top + /// @brief HNC amp for qg->qgH with finite top (i.e. j^{+-}_H) void g_gH_HNC(CLHEP::HepLorentzVector pa, CLHEP::HepLorentzVector p1, CLHEP::HepLorentzVector pH, double mq, current &retAns) { - double prop; - //COM F = 4.*mq*mq/v/16./M_PI/M_PI; - double F = 4.*mq*mq/v; - COM ang1a,Fta,Ft1,phase,aH1,oneHa,h1,h2,h4,h5,h10,h12,sqa1,Falpha,Fbeta; - current ans,conjepsH1,epsHa,p1cur,pacur,pHcur,conjeps1,epsa,paplusp1cur,p1minuspacur,cur1a,cura1,epsHapart1,epsHapart2,conjepsH1part1,conjepsH1part2,T1,T2,T3,T4,T5a,T5b,T6,T7,T8a,T8b,T9,T10,T11a,T11b,T12a,T12b,T13; + const double F = 4.*mq*mq/v; + COM ang1a,sqa1; + current conjepsH1,epsHa,p1cur,pacur,pHcur,conjeps1,epsa,paplusp1cur, + p1minuspacur,cur1a,cura1,epsHapart1,epsHapart2,conjepsH1part1, + conjepsH1part2; // Find here if pa, meaning the gluon, is forward or backward bool gluonforward = true; if(pa.z() < 0) gluonforward = false; jio(pa,true,p1,true,cura1); j(p1,true,pa,true,cur1a); to_current(pa,pacur); to_current(p1,p1cur); to_current(pH,pHcur); to_current(pa+p1,paplusp1cur); to_current(p1-pa,p1minuspacur); - aH1 = cdot(pHcur,cura1); - oneHa = cdot(pHcur,cur1a); + const COM aH1 = cdot(pHcur,cura1); + const COM oneHa = std::conj(aH1); // = cdot(pHcur,cur1a) if(gluonforward){ + // sqrt(2pa_-/p1_-)*p1_perp/abs(p1_perp) ang1a = sqrt(pa.plus()*p1.minus())*(p1.x()+COM(0.,1.)*p1.y())/p1.perp(); + // sqrt(2pa_-/p1_-)*p1_perp*/abs(p1_perp) sqa1 = sqrt(pa.plus()*p1.minus())*(p1.x()-COM(0.,1.)*p1.y())/p1.perp(); } else { ang1a = sqrt(pa.minus()*p1.plus()); sqa1 = sqrt(pa.minus()*p1.plus()); } - prop = (pa-p1-pH).m2(); - - cmult(1./sqrt(2)/sqa1,cur1a,epsa); - cmult(-1./sqrt(2)/sqa1,cura1,conjeps1); - phase = cdot(conjeps1,epsa); - Fta = FT(-pa,pa-pH,mq)/(pa-pH).m2(); - Ft1 = FT(-p1-pH,p1,mq)/(p1+pH).m2(); - Falpha = FT(p1-pa,pa-p1-pH,mq); - Fbeta = FL(p1-pa,pa-p1-pH,mq); - - h1 = H1(p1,-pa,pH,mq); - h2 = H2(p1,-pa,pH,mq); - h4 = H4(p1,-pa,pH,mq); - h5 = H5(p1,-pa,pH,mq); - h10 = H10(p1,-pa,pH,mq); - h12 = H12(p1,-pa,pH,mq); - - cmult(Fta*pa.dot(pH),epsa,epsHapart1); - cmult(-1.*Fta*cdot(pHcur,epsa),pacur,epsHapart2); - cmult(Ft1*cdot(pHcur,conjeps1),p1cur,conjepsH1part1); - cmult(-Ft1*p1.dot(pH),conjeps1,conjepsH1part2); - cadd(epsHapart1,epsHapart2,epsHa); - cadd(conjepsH1part1,conjepsH1part2,conjepsH1); + const double prop = (pa-p1-pH).m2(); + + cmult(1./sqrt(2)/sqa1, cur1a, epsa); + cmult(-1./sqrt(2)/sqa1, cura1, conjeps1); + const COM phase = cdot(conjeps1, epsa); + const COM Fta = FT(-pa,pa-pH,mq)/(pa-pH).m2(); + const COM Ft1 = FT(-p1-pH,p1,mq)/(p1+pH).m2(); + const COM Falpha = FT(p1-pa,pa-p1-pH,mq); + const COM Fbeta = FL(p1-pa,pa-p1-pH,mq); + + const COM h1 = H1(p1,-pa, pH, mq); + const COM h2 = H2(p1,-pa, pH, mq); + const COM h4 = H4(p1,-pa, pH, mq); + const COM h5 = H5(p1,-pa, pH, mq); + const COM h10 = H10(p1,-pa, pH, mq); + const COM h12 = H12(p1,-pa, pH, mq); + + cmult(Fta*pa.dot(pH), epsa, epsHapart1); + cmult(-1.*Fta*cdot(pHcur,epsa), pacur, epsHapart2); + cmult(Ft1*cdot(pHcur,conjeps1), p1cur, conjepsH1part1); + cmult(-Ft1*p1.dot(pH), conjeps1, conjepsH1part2); + cadd(epsHapart1, epsHapart2, epsHa); + cadd(conjepsH1part1, conjepsH1part2, conjepsH1); + + current T1,T2,T3,T4,T5a,T5b,T6,T7,T8a,T8b,T9,T10,T11a, + T11b,T12a,T12b,T13; if(gluonforward){ - cmult(sqrt(2.)*sqrt(p1.plus()/pa.plus())*prop/sqa1,conjepsH1,T1); - cmult(-sqrt(2.)*sqrt(pa.plus()/p1.plus())*prop/sqa1,epsHa,T2); + cmult(sqrt(2.)*sqrt(p1.plus()/pa.plus())*prop/sqa1, conjepsH1, T1); + cmult(-sqrt(2.)*sqrt(pa.plus()/p1.plus())*prop/sqa1, epsHa, T2); } else{ - cmult(-sqrt(2.)*sqrt(p1.minus()/pa.minus())*((p1.x()-COM(0.,1.)*p1.y())/p1.perp())*prop/sqa1,conjepsH1,T1); - cmult(sqrt(2.)*sqrt(pa.minus()/p1.minus())*((p1.x()+COM(0.,1.)*p1.y())/p1.perp())*prop/sqa1,epsHa,T2); - + cmult(-sqrt(2.)*sqrt(p1.minus()/pa.minus())*((p1.x()-COM(0.,1.)*p1.y())/p1.perp()) + *prop/sqa1, conjepsH1, T1); + cmult(sqrt(2.)*sqrt(pa.minus()/p1.minus())*((p1.x()+COM(0.,1.)*p1.y())/p1.perp()) + *prop/sqa1, epsHa, T2); } - COM boxdiagFact = 8.*COM(0.,1.)*M_PI*M_PI; - - cmult(aH1*sqrt(2.)/sqa1,epsHa,T3); - cmult(oneHa*sqrt(2.)/sqa1,conjepsH1,T4); - cmult(-2.*phase*Fta*pa.dot(pH),p1cur,T5a); - cmult(2.*phase*Ft1*p1.dot(pH),pacur,T5b); - cmult(-sqrt(2.)*Fta*p1.dot(pa)*oneHa/sqa1,conjeps1,T6); - cmult(-sqrt(2.)*Ft1*pa.dot(p1)*aH1/sqa1,epsa,T7); + const COM boxdiagFact = 8.*COM(0.,1.)*M_PI*M_PI; - cmult(-boxdiagFact*phase*h2,pacur,T8a); - cmult(boxdiagFact*phase*h1,p1cur,T8b); - cmult(boxdiagFact*aH1/sqrt(2.)/sqa1*h5,epsa,T9); - cmult(-boxdiagFact*oneHa/sqrt(2.)/sqa1*h4,conjeps1,T10); - cmult(boxdiagFact*aH1*oneHa/2./sqa1/sqa1*h10,pacur,T11a); - cmult(-boxdiagFact*aH1*oneHa/2./sqa1/sqa1*h12,p1cur,T11b); + cmult(aH1*sqrt(2.)/sqa1, epsHa, T3); + cmult(oneHa*sqrt(2.)/sqa1, conjepsH1, T4); + cmult(-2.*phase*Fta*pa.dot(pH), p1cur, T5a); + cmult(2.*phase*Ft1*p1.dot(pH), pacur, T5b); + cmult(-sqrt(2.)*Fta*p1.dot(pa)*oneHa/sqa1, conjeps1, T6); + cmult(-sqrt(2.)*Ft1*pa.dot(p1)*aH1/sqa1, epsa, T7); - cmult(-phase/(pa-p1).m2()*Falpha*(p1-pa).dot(pa-p1-pH),paplusp1cur,T12a); - cmult(phase/(pa-p1).m2()*Falpha*(pa+p1).dot(pa-p1-pH),p1minuspacur,T12b); - cmult(-phase*Fbeta*(pa-p1-pH).m2(),paplusp1cur,T13); + cmult(-boxdiagFact*phase*h2, pacur, T8a); + cmult(boxdiagFact*phase*h1, p1cur, T8b); + cmult(boxdiagFact*aH1/sqrt(2.)/sqa1*h5, epsa, T9); + cmult(-boxdiagFact*oneHa/sqrt(2.)/sqa1*h4, conjeps1, T10); + cmult(boxdiagFact*aH1*oneHa/2./sqa1/sqa1*h10, pacur, T11a); + cmult(-boxdiagFact*aH1*oneHa/2./sqa1/sqa1*h12, p1cur, T11b); - //cout << phase << endl; + cmult(-phase/(pa-p1).m2()*Falpha*(p1-pa).dot(pa-p1-pH), paplusp1cur, T12a); + cmult(phase/(pa-p1).m2()*Falpha*(pa+p1).dot(pa-p1-pH), p1minuspacur, T12b); + cmult(-phase*Fbeta*(pa-p1-pH).m2(), paplusp1cur, T13); + current ans; for(int i=0;i<4;i++) { ans[i] = T1[i]+T2[i]+T3[i]+T4[i]+T5a[i]+T5b[i]+T6[i]+T7[i]+T8a[i]+T8b[i]+T9[i]+T10[i]+T11a[i]+T11b[i]+T12a[i]+T12b[i]+T13[i]; } retAns[0] = F/prop*ans[0]; retAns[1] = F/prop*ans[1]; retAns[2] = F/prop*ans[2]; retAns[3] = F/prop*ans[3]; } } // namespace anonymous // JDC - new amplitude with Higgs emitted close to gluon with full mt effects. Keep usual HEJ-style function call double MH2gq_outsideH(CLHEP::HepLorentzVector p1out, CLHEP::HepLorentzVector p1in, CLHEP::HepLorentzVector p2out, CLHEP::HepLorentzVector p2in, CLHEP::HepLorentzVector pH, double mq, bool includeBottom, double mq2) { current cur2bplus,cur2bminus, cur2bplusFlip, cur2bminusFlip; current retAns,retAnsb; j(p2out,true,p2in,true,cur2bplus); j(p2out,false,p2in,false,cur2bminus); j(ParityFlip(p2out),true,ParityFlip(p2in),true,cur2bplusFlip); j(ParityFlip(p2out),false,ParityFlip(p2in),false,cur2bminusFlip); COM app1,app2,apm1,apm2; COM app3, app4, apm3, apm4; if(!includeBottom) { g_gH_HC(p1in,p1out,pH,mq,retAns); app1=cdot(retAns,cur2bplus); app2=cdot(retAns,cur2bminus); g_gH_HC(ParityFlip(p1in),ParityFlip(p1out),ParityFlip(pH),mq,retAns); app3=cdot(retAns,cur2bplusFlip); app4=cdot(retAns,cur2bminusFlip); // And non-conserving bits g_gH_HNC(p1in,p1out,pH,mq,retAns); apm1=cdot(retAns,cur2bplus); apm2=cdot(retAns,cur2bminus); g_gH_HNC(ParityFlip(p1in),ParityFlip(p1out),ParityFlip(pH),mq,retAns); apm3=cdot(retAns,cur2bplusFlip); apm4=cdot(retAns,cur2bminusFlip); } else { g_gH_HC(p1in,p1out,pH,mq,retAns); g_gH_HC(p1in,p1out,pH,mq2,retAnsb); app1=cdot(retAns,cur2bplus) + cdot(retAnsb,cur2bplus); app2=cdot(retAns,cur2bminus) + cdot(retAnsb,cur2bminus); g_gH_HC(ParityFlip(p1in),ParityFlip(p1out),ParityFlip(pH),mq,retAns); g_gH_HC(ParityFlip(p1in),ParityFlip(p1out),ParityFlip(pH),mq2,retAnsb); app3=cdot(retAns,cur2bplusFlip) + cdot(retAnsb,cur2bplusFlip); app4=cdot(retAns,cur2bminusFlip) + cdot(retAnsb,cur2bminusFlip); // And non-conserving bits g_gH_HNC(p1in,p1out,pH,mq,retAns); g_gH_HNC(p1in,p1out,pH,mq2,retAnsb); apm1=cdot(retAns,cur2bplus) + cdot(retAnsb,cur2bplus); apm2=cdot(retAns,cur2bminus) + cdot(retAnsb,cur2bminus); g_gH_HNC(ParityFlip(p1in),ParityFlip(p1out),ParityFlip(pH),mq,retAns); g_gH_HNC(ParityFlip(p1in),ParityFlip(p1out),ParityFlip(pH),mq2,retAnsb); apm3=cdot(retAns,cur2bplusFlip) + cdot(retAnsb,cur2bplusFlip); apm4=cdot(retAns,cur2bminusFlip) + cdot(retAnsb,cur2bminusFlip); } - return (abs2(app1) + abs2(app2) + abs2(app3) + abs2(app4) + abs2(apm1) + abs2(apm2) + abs2(apm3) + abs2(apm4))*12./4./(3.*8.); - //return (abs2(app1))*12./(3.*8.); + return (abs2(app1) + abs2(app2) + abs2(app3) + abs2(app4) + abs2(apm1) + + abs2(apm2) + abs2(apm3) + abs2(apm4))*12./4./(3.*8.); // factor = 12 (colour sum) /4 (hel avg) /(3*8) (col avg) } #endif // RHEJ_BUILD_WITH_QCDLOOP double C2gHgm(CLHEP::HepLorentzVector p2, CLHEP::HepLorentzVector p1, CLHEP::HepLorentzVector pH) { static double A=1./(3.*M_PI*v); // Implements Eq. (4.22) in hep-ph/0301013 with modifications to incoming plus momenta double s12,p1p,p2p; COM p1perp,p3perp,phperp; // Determine first whether this is the case p1p\sim php>>p3p og the opposite s12=p1.invariantMass2(-p2); if (p2.pz()>0.) { // case considered in hep-ph/0301013 p1p=p1.plus(); p2p=p2.plus(); } else { // opposite case p1p=p1.minus(); p2p=p2.minus(); } p1perp=p1.px()+COM(0,1)*p1.py(); phperp=pH.px()+COM(0,1)*pH.py(); p3perp=-(p1perp+phperp); COM temp=COM(0,1)*A/(2.*s12)*(p2p/p1p*conj(p1perp)*p3perp+p1p/p2p*p1perp*conj(p3perp)); temp=temp*conj(temp); return temp.real(); } double C2gHgp(CLHEP::HepLorentzVector p2, CLHEP::HepLorentzVector p1, CLHEP::HepLorentzVector pH) { static double A=1./(3.*M_PI*v); // Implements Eq. (4.23) in hep-ph/0301013 double s12,php,p1p,phm; COM p1perp,p3perp,phperp; // Determine first whether this is the case p1p\sim php>>p3p og the opposite s12=p1.invariantMass2(-p2); if (p2.pz()>0.) { // case considered in hep-ph/0301013 php=pH.plus(); phm=pH.minus(); p1p=p1.plus(); } else { // opposite case php=pH.minus(); phm=pH.plus(); p1p=p1.minus(); } p1perp=p1.px()+COM(0,1)*p1.py(); phperp=pH.px()+COM(0,1)*pH.py(); p3perp=-(p1perp+phperp); COM temp=-COM(0,1)*A/(2.*s12)*(conj(p1perp*p3perp)*pow(php/p1p,2)/(1.+php/p1p)+s12*(pow(conj(phperp),2)/(pow(abs(phperp),2)+p1p*phm)-pow(conj(p3perp)+(1.+php/p1p)*conj(p1perp),2)/((1.+php/p1p)*(pH.m2()+2.*p1.dot(pH))))); temp=temp*conj(temp); return temp.real(); } double C2qHqm(CLHEP::HepLorentzVector p2, CLHEP::HepLorentzVector p1, CLHEP::HepLorentzVector pH) { static double A=1./(3.*M_PI*v); // Implements Eq. (4.22) in hep-ph/0301013 double s12,p2p,p1p; COM p1perp,p3perp,phperp; // Determine first whether this is the case p1p\sim php>>p3p og the opposite s12=p1.invariantMass2(-p2); if (p2.pz()>0.) { // case considered in hep-ph/0301013 p2p=p2.plus(); p1p=p1.plus(); } else { // opposite case p2p=p2.minus(); p1p=p1.minus(); } p1perp=p1.px()+COM(0,1)*p1.py(); phperp=pH.px()+COM(0,1)*pH.py(); p3perp=-(p1perp+phperp); COM temp=A/(2.*s12)*(sqrt(p2p/p1p)*p3perp*conj(p1perp)+sqrt(p1p/p2p)*p1perp*conj(p3perp)); temp=temp*conj(temp); return temp.real(); } diff --git a/src/gsl_wrapper.cc b/src/gsl_wrapper.cc deleted file mode 100644 index c294710..0000000 --- a/src/gsl_wrapper.cc +++ /dev/null @@ -1,66 +0,0 @@ -#include "RHEJ/gsl_wrapper.hh" - -#include - -namespace gsl{ - MultirootFsolver::MultirootFsolver( - gsl_multiroot_fsolver_type const * T, - gsl_multiroot_function* f, - Vector&& x - ): - solver_{ - gsl_multiroot_fsolver_alloc(T, x.size()), - gsl_multiroot_fsolver_free - }, - x_{std::move(x)} - { - if(solver_ == nullptr) throw std::bad_alloc{}; - gsl_multiroot_fsolver_set(solver_.get(), f, x_.vec_.get()); - } - - const char * MultirootFsolver::name() const{ - return gsl_multiroot_fsolver_name(solver_.get()); - } - - int MultirootFsolver::iterate(){ - return gsl_multiroot_fsolver_iterate(solver_.get()); - } - - int MultirootFsolver::test_residual(double epsabs) const{ - return gsl_multiroot_test_residual(solver_->f, epsabs); - } - - gsl_vector const * MultirootFsolver::x() const{ - return solver_->x; - } - - Vector::Vector(size_t size): - vec_{gsl_vector_alloc(size), gsl_vector_free} - { - if(vec_ == nullptr) throw std::bad_alloc(); - } - - double & Vector::at(size_t idx){ - if(idx > vec_->size) throw std::out_of_range{std::to_string(idx)}; - return vec_->data[idx]; - } - - double const & Vector::at(size_t idx) const{ - if(idx > vec_->size) throw std::out_of_range{std::to_string(idx)}; - return vec_->data[idx]; - } - - double & Vector::operator[](size_t idx){ - return vec_->data[idx]; - } - - double const & Vector::operator[](size_t idx) const{ - return vec_->data[idx]; - } - - size_t Vector::size() const { - return vec_->size; - } - - -} diff --git a/src/resummation_jet_momenta.cc b/src/resummation_jet_momenta.cc index fc02847..7e335ce 100644 --- a/src/resummation_jet_momenta.cc +++ b/src/resummation_jet_momenta.cc @@ -1,173 +1,41 @@ #include #include #include #include #include #include #include "RHEJ/resummation_jet_momenta.hh" #include "RHEJ/utility.hh" -#include "RHEJ/gsl_wrapper.hh" - - -namespace { - using namespace gsl; - - enum Coordinate{ - x = 0, - y = 1, - }; - - struct BornParameters{ - std::vector< std::array > pt_born; - std::array q; - }; - - double pt_abs(double px, double py){ - return sqrt(px*px + py*py); - } - - //! calculate momentum difference for jets - /** - * After reshuffling, we have the condition - * Delta = pt_born - pt_res + q* |pt_res|/P_perp = 0 - * for each jet, where P_perp is the sum of |pt_res| over all jets - * This function calculates Delta and stores the result in diff - * - * Since the gsl_vectors are one-dimensional, indices are a bit funny; - * diff->data[2*i + X] - * corresponds to the X component of the momentum vector for jet i - */ - int calc_jet_diff(const gsl_vector * pt_resum, void *data, gsl_vector * diff){ - assert(diff->size == pt_resum->size); - assert(diff->size % 2 == 0); - auto param = static_cast(data); - auto const & pt_born = param->pt_born; - auto pt_res = pt_resum->data; - auto const & q = param->q; - const size_t n_jets = pt_resum->size/2; - - double P_perp = 0.; - for(size_t jet = 0; jet < n_jets; ++jet){ - P_perp += pt_abs(pt_res[2*jet + x], pt_res[2*jet + y]); - } - - for(size_t jet = 0; jet < n_jets; ++jet){ - const double pt_res_abs = pt_abs(pt_res[2*jet + x], pt_res[2*jet + y]); - for(Coordinate X: {x,y}){ - diff->data[2*jet + X] = - pt_born[jet][X] - pt_res[2*jet + X] - q[X]*pt_res_abs/P_perp; - } - } - - return GSL_SUCCESS; - } - - // computes resummation jet pt from Born jet pt - // if this fails an empty vector is returned - std::vector< std::array > reshuffle(BornParameters const & p){ - constexpr int max_iterations = 1000; - const size_t n_jets = p.pt_born.size(); - - gsl_multiroot_function f = { - &calc_jet_diff, 2*n_jets, - const_cast(&p) - }; - Vector pt_resum{2*n_jets}; - // initial values for solver - resummation pt = Born pt - for (size_t jet = 0; jet < n_jets; ++jet) { - pt_resum[2*jet+x] = p.pt_born[jet][x]; - pt_resum[2*jet+y] = p.pt_born[jet][y]; - } - MultirootFsolver solver{ - gsl_multiroot_fsolver_hybrids, - &f, std::move(pt_resum) - }; - - // solve equations - int status = GSL_CONTINUE; - for( - int iterations = 1; - status == GSL_CONTINUE && iterations < max_iterations; - ++iterations - ){ - status = solver.iterate(); - if(status == GSL_EBADFUNC || status == GSL_ENOPROG) return {}; - status = solver.test_residual(1e-7); - } - if(status != GSL_SUCCESS) return {}; - - std::vector< std::array > res_pt(n_jets); - for(size_t jet = 0; jet < n_jets; ++jet) { - res_pt[jet][x] = gsl_vector_get(solver.x(), 2*jet + x); - res_pt[jet][y] = gsl_vector_get(solver.x(), 2*jet + y); - } - return res_pt; - } - - // check that pt_i^B == pt_i + qt_i for each jet - void assert_pt_conservation( - std::vector const & jetvects, - fastjet::PseudoJet const & qperp, - std::vector const & shuffledmomenta - ){ - RHEJ::ignore(jetvects, qperp, shuffledmomenta); -#ifndef NDEBUG - assert(jetvects.size() == shuffledmomenta.size()); - double Pperp = 0; - for(auto const & p: shuffledmomenta) Pperp += p.perp(); - for(size_t i = 0; i < jetvects.size(); ++i){ - const auto qperp_i = qperp*shuffledmomenta[i].perp()/Pperp; - const auto pdiff = jetvects[i] - shuffledmomenta[i] - qperp_i; - assert(RHEJ::nearby_ep(pdiff.px(), 0, 1e-5)); - assert(RHEJ::nearby_ep(pdiff.py(), 0, 1e-5)); - } -#endif - } -} namespace RHEJ{ std::vector resummation_jet_momenta( std::vector const & p_born, fastjet::PseudoJet const & q ) { + // for "new" reshuffling p^B = p + q*|p^B|/P^B + double Pperp_born = 0.; + for(auto const & p: p_born) Pperp_born += p.perp(); + std::vector p_res; p_res.reserve(p_born.size()); - - BornParameters r; - r.q[x] = q.px(); - r.q[y] = q.py(); - - r.pt_born.resize(p_born.size()); - for (size_t jet = 0; jet < p_born.size(); ++jet) { - r.pt_born[jet][x] = p_born[jet].px(); - r.pt_born[jet][y] = p_born[jet].py(); - } - - const auto pt_reshuffled = reshuffle(r); - if(pt_reshuffled.empty()) return {}; - - // Construct the new 4-momenta - for (size_t jet = 0; jet < p_born.size(); ++jet) { - const double px = pt_reshuffled[jet][x]; - const double py = pt_reshuffled[jet][y]; + for(auto & pB: p_born) { + const double px = pB.px() - q.px()*pB.perp()/Pperp_born; + const double py = pB.py() - q.py()*pB.perp()/Pperp_born; const double pperp = sqrt(px*px + py*py); // keep the rapidities fixed - const double pz = pperp*sinh(p_born[jet].rapidity()); - const double E = pperp*cosh(p_born[jet].rapidity()); + const double pz = pperp*sinh(pB.rapidity()); + const double E = pperp*cosh(pB.rapidity()); p_res.emplace_back(px, py, pz, E); assert( - nearby_ep( + RHEJ::nearby_ep( p_res.back().rapidity(), - p_born[jet].rapidity(), + pB.rapidity(), 1e-5 ) ); } - - assert_pt_conservation(p_born, q, p_res); - return p_res; } } diff --git a/t/ME_data/ME_h_mt.dat b/t/ME_data/ME_h_mt.dat index ba23656..349d686 100644 --- a/t/ME_data/ME_h_mt.dat +++ b/t/ME_data/ME_h_mt.dat @@ -1,807 +1,807 @@ 3.999227056e-08 4.193300057e-05 3.89321526e-05 0.0168082963 4.057962883e-06 4.063245819e-07 6.411897603e-07 7.822040516e-07 6.064514954e-07 -2.202805699e-05 +2.338845036e-05 4.738208766e-05 1.624045121e-06 -0.0005217822994 +0.0005243567971 1.536443326e-05 9.5908372e-06 0.0339113482 8.152325116e-07 608.615459 5.962078524e-06 -0.01340321821 +0.01352350209 1.931630897 0.0005720381031 0.0008001259943 3.300880891e-05 -0.0003564506816 +0.0007712160505 0.0007037298905 0.03792377651 -6.513991407e-07 +1.079417185e-06 2.011798913 8.842231663e-08 0.0463578742 0.1064067277 9.357584012e-07 -0.006517735511 +0.007615558468 0.02272391876 3.606711294e-05 6.725111513e-07 0.005897687516 7.581255699e-05 0.005354681787 0.0006088947447 0.0083356406 0.003352568463 -3.23438533e-05 +3.95296533e-05 0.0001515363281 0.005531947882 -0.03875973775 +0.0388505972 2.312735565e-07 5.479259483e-05 8.480458133 -0.0001854378187 -4.957725793e-06 +0.0001863702054 +7.349046553e-06 5.091269317e-06 -0.0001308303481 -0.1918392997 +0.0001452556797 +0.2136081233 0.0238989834 4.446354691 -0.0002597751966 +0.0002720132705 1.267033388 0.005050109129 -2.130648865e-06 -0.05854510061 +2.848397879e-06 +0.07116846744 0.00280707581 -6.289945688 +7.10418958 7.216599144e-08 4.779195357e-06 -1.655604389e-05 +1.924410023e-05 1.522656761e-05 1.116772322e-06 0.0009539322219 9.279967349e-07 2.28564472 0.001331277201 0.001585734932 26972.25526 -8.555976389e-07 +1.2516302e-06 0.0006894623725 1.065245235e-07 0.01968534835 1.951627129e-06 4.401131811e-05 0.02561966521 49705.99132 5.383396351e-06 1.07104069e-06 2.808652999e-06 0.0001066898908 0.0002239236027 7.851273644e-08 0.002704063747 -0.0005663491795 +0.0005842786082 0.07550986067 -0.00128549481 -3.590772606e-05 +0.001335627914 +6.766626128e-05 0.1149401044 0.183403668 0.000113873958 -1.730096598e-05 -0.02430322741 +1.844065382e-05 +0.02689433062 0.001076022562 5.066109523e-06 -0.1068111238 +0.1097193795 9.253312815e-05 -91.21436585 +92.12237679 0.01945125628 8.958261209e-05 -1.678018826e-06 -0.0002943803381 +3.849412514e-06 +0.0003305165961 0.0001299537598 1.170328977e-06 0.0001328201344 3034.923139 1.378838481 -0.08550576557 -36.1778481 +0.08677679017 +36.20174579 1.785612005e-06 -9.054761711e-06 +1.032516793e-05 0.001615788007 1.23208212 0.0003642605012 2.708222463e-06 4.719890307e-06 0.001710230342 0.3182780512 -0.0008830648263 -0.08778053115 +0.0009491003377 +0.09165888221 0.2629019547 0.02748771871 -1.833687248e-06 -0.002690141449 +3.179028152e-06 +0.002811209731 1.89343446e-06 1.77338727e-06 2.291261955e-05 1.31623411e-05 0.02865008699 -0.0001316279098 +0.0001547359261 5.992647136 427898745.7 0.0002908564713 180.1583563 1.149638817 -4.549308837e-06 +4.915348327e-06 0.02938178265 12.41064482 0.0005867842208 1.235864829e-06 -4.615116294e-05 +6.021062978e-05 0.7228122449 -0.0003119308893 +0.0003703954772 1.100546805e-07 0.0007569561799 3.456980613e-06 0.001902875586 1.766220045 0.0006636538355 435.7550934 1.468265667e-05 -0.003868037348 +0.003895447939 0.005375424637 9.895862027e-06 0.002634610055 0.04246482577 1.811370936e-05 0.0008533026641 -1.935841576 -1.965419689e-06 +1.973172924 +2.216040365e-06 0.0001940609469 6.432993714e-05 436.2325667 8.585463564e-05 0.003171908449 3.1453383e-07 0.10708771 1.134414955e-07 5.434578249e-06 6.681002905e-06 -0.00246782063 -0.00431428184 +0.002957334168 +0.005022320071 2.421882039e-05 3.783451257e-08 5.144794528e-06 -8.550628039e-05 +0.0001067748459 13660.98467 117.1131418 387.5973894 -0.2157832996 +0.2286644594 2.335478847e-06 0.0001022288321 0.004686932429 0.4278874185 -0.000106415896 +0.0001089502807 1.985873409e-06 2.25291051e-07 2.945623146e-05 0.3581923626 -6.785775177e-06 +8.204917967e-06 0.004893941209 0.0005325322641 1.060152245e-07 1.118231806e-05 2.203633348e-06 -3.969211813e-06 +4.953456305e-06 0.007400958058 5.769269726e-05 1.899358848e-06 0.002291707993 0.007504512648 0.0946266303 -0.07641638751 -0.001194744559 +0.07677680285 +0.001406412108 0.000131740617 3.126413693e-07 6.676941465e-07 2.247981499e-07 1.394670123e-07 0.0003117083998 0.003124792631 3.196614452e-07 0.0005145950558 1.196095567 1.715539058e-05 2.527890627e-05 -2.665407449e-06 +4.198681685e-06 4.483788358e-07 3.597134253e-05 6.514469651e-07 0.002675227421 0.1700338633 0.0151159864 -1.877463443e-05 -0.001018686854 -0.0001769414038 +2.549964327e-05 +0.00103462801 +0.0002092909388 3.068873861e-06 1176.630703 9.378378651e-06 7.10431401e-07 4.541139018e-05 3.954117424e-06 0.003271203855 0.01288628186 0.01758893926 0.0001040458517 0.08587993013 7.493297002e-07 0.0303353991 2.525780749e-07 1.075360445e-06 0.0005909996117 3.980399911e-06 67.71892274 -8.802422373e-06 +8.935469327e-06 3.997018327e-05 -2.690317449e-06 +3.48516788e-06 0.1177580565 1.362864165e-07 0.00719011227 3.379854611e-06 1.335802906e-08 0.0008096413047 8.017608649e-08 5.475646202e-07 9.89836826e-07 0.0001097524935 0.005006547178 0.01328382633 3.708077203e-10 1.7738466e-09 6.195338978e-10 1.375292134e-08 -7.712749689e-06 +1.198886719e-05 1.087672399e-10 7.612820481e-06 1.631362221e-06 7.195255533e-08 8.307139358e-09 2.261143452e-08 -2.267767047e-07 +3.176205908e-07 7.680504754e-08 1.175875499e-07 0.0006018013011 1.467361257e-05 1.350450721e-07 -2.569869939e-07 -7.718323457e-07 +4.010394331e-07 +7.773787384e-07 0.0170653268 0.0001792376906 3.072166197e-06 22266.55115 0.06729772649 -1.065337157 +1.156967792 7.103072447e-07 0.0008701526857 0.3457109502 0.001639388444 6.829709377e-07 103.0220399 1.724918219e-06 0.006442680294 0.0002924073612 0.0061407479 3.014208435e-07 -1.065501509e-05 +1.067129219e-05 5.819752501e-07 0.002933183567 1.390851143e-08 1.359009867e-06 0.02819012119 1.30006471e-09 78.00480652 3.27001628e-06 2.84175006e-07 -3.993660531e-07 +4.457488422e-07 0.0003605232041 1.871558115e-06 2.854501301e-07 0.02600693272 0.0004600409654 -0.001348216483 +0.001476738524 2.488693144e-08 2.395438283e-11 4.248528123e-07 1.389769895e-05 8.049135616e-07 2.12824677e-07 8.405933433e-07 2.36621812e-06 0.06259159217 1.831343487e-07 2.1663617e-08 6.323481085e-10 1.339773875e-07 4.883049792e-06 1.705369167e-05 0.0001013417062 0.01536206656 1.67093181 5.039245627e-10 1.141488157e-05 3.188719492e-07 3.24135522e-10 0.0002434524475 1.383868594e-06 0.498790572 9.03612161e-05 0.02764416817 0.01341805272 7.529041731e-07 0.0002257161473 0.0003717671499 1.858022341e-08 5.715357136e-07 2.477427879e-09 0.0001517676839 2.326424939e-11 1.729565889e-05 7.354412281e-09 -6.877321994e-06 +9.505701399e-06 0.0005289104709 0.02479967619 6.212490017e-06 1.714682348e-08 7.916835703e-09 0.00934088881 4.083237353e-07 0.004696390685 6.761095529e-10 0.003004586166 6.030026635e-05 8.803060787e-08 6.957661086e-08 9.612925872e-08 1.628346787e-05 5.143053469e-07 8.784807581e-08 1.024493405e-08 3.137825282e-07 42.00569276 0.004640201019 1.146513701e-05 -4.057040434e-08 +5.876691844e-08 3.381428808e-06 2.603443408e-07 -0.002272672712 +0.002350385674 1.276808422e-05 0.06226820245 1.778585408e-08 2.378758757e-07 9.7714181e-05 0.387678215 4.398556239e-07 3.0060972e-08 3.874778496e-05 -9.119354143e-06 +1.0694862e-05 1.402325829e-06 4.695875643e-06 2.383017224e-07 2.417306793e-06 0.0002708928034 0.01384277314 1.710909166e-07 1.217157554 177.0639344 0.03861638077 7.433640647e-05 0.0002263704383 0.002948183736 0.008773163623 5.353914571e-08 360.0073872 6.478760385e-07 2.750359008e-07 8.589493477e-08 4.263303371e-07 2.005861581e-05 5.503740271e-08 0.00180575553 16.03887797 7.922076143 5.036869078e-12 1.277093114e-06 0.003373959327 1.743675895e-05 1.778007998e-06 0.0002212911594 9.259789313e-05 8.539690283e-05 2.423945599e-06 0.0001233083611 -6.913916933e-09 +9.174270377e-09 2.570708518e-07 0.0008554774811 -0.2986161102 +0.3056275035 0.0006441353055 1.203219038e-07 4.75874322e-07 258.1003097 2.768523645e-09 1.270156521e-11 1.46097374e-09 34.87523283 8.506779165e-05 4.671813569e-06 1.907838682e-05 3.716521365e-07 1.888947852e-08 -0.02669197841 +0.02682389012 15.26083816 2.873162527e-10 1.360352114e-06 9.527755241e-07 0.0003084354836 0.0009838761157 1.302357534e-05 0.004623681617 0.01694286548 9.642283586e-07 8.499293031e-06 8.770386824e-06 0.001276821989 6.668543971e-07 5.652013261e-11 0.238779506 1.624068992e-07 0.0002438443448 0.002313588467 7.53704251e-09 7.248545824e-12 0.02160343338 6.465648118e-09 7.430463219e-08 0.000611761207 2.262200983e-07 8.810901655e-07 1.688360234e-07 -2.91786064e-06 +3.452136087e-06 5.480913194e-08 0.0004601409972 3.364979337e-10 8.967694023e-09 0.1345541103 2.492529354e-06 9.220762636e-06 7.386130159e-06 3.598519539 8.045779179e-06 4.730716431e-07 2.192459188e-07 2.194928052e-06 3.130712514e-07 1.43402212e-05 0.0002608840076 23.2295584 -1.440575153e-08 +1.820768009e-08 4.161369951e-06 0.001762466634 4.255417524e-09 3320585.541 0.0009563172933 0.03635196251 0.5161165209 0.004796521016 2.31018301e-06 0.06003700358 0.0004342970655 2.009638611e-08 0.0001808310494 0.0003251077547 -4.320349927e-07 +6.445298688e-07 2.882854303e-08 0.0422146142 8.524423251e-07 19.01825412 0.000339795268 1.575704657e-07 0.0004837774983 4.132343892e-07 5.931203648e-09 0.01135109493 5.877226405e-05 1.480445352e-08 0.3379228367 1.786471685e-06 1.021098483e-07 1.079160999e-08 -9.622764911e-09 +1.26575267e-08 0.002978083967 4.588139504e-06 6.6721226e-11 3.261090243e-06 0.06059954782 4.847476637e-09 1.104977758e-06 -0.0003141612317 -0.0006548050265 +0.0003977585716 +0.0006607921183 0.000225642662 4.294099642e-06 1.185934783e-07 0.001042912926 8.03811263e-06 1.755333168e-10 6.77273477e-08 598.9038787 1.572919365e-07 0.04266693618 2.739698989e-08 0.0005135423693 1.264426626e-10 2.608778512e-07 1.857091679e-06 1.075074651e-10 1.188966384e-07 0.03379476153 0.0006473640268 3.624390296e-09 1.237883305e-05 1.016117525e-05 9.687850834e-06 0.0002738964397 9.038889191e-09 7.786947927e-07 3.198680693e-05 1.608278345e-11 0.003353487144 6.107229663e-08 0.0003768704931 0.0002005945404 3.670401818e-11 9.030155872e-09 2.042723216e-08 2.386955262e-08 4.835084799e-09 3.685817471e-11 1.066443786e-07 2.652667148e-07 3.649486136e-11 0.02477462094 3.517378902e-05 3.080027841e-09 1.018709237e-09 2.870228082e-10 8.744977958e-06 5.273214292e-09 3.168385461e-11 0.001556612382 -3.116051041e-07 +7.188695072e-07 2.492191426e-09 7.615392241e-10 0.01004217426 1.101368692e-06 3.918013244e-06 3.713827343e-09 6.857767402e-09 1.290966146e-09 6.224822208e-12 3.376319521e-06 -3.94050205e-09 +4.097980204e-09 7.633357106e-05 6.164135969e-05 1.630673977e-06 7.08423096e-09 4.080955534e-10 232770.6483 0.008068531153 8.666549381e-10 2.246457597e-10 3.222301462e-08 1.395629818e-06 2.196466632e-08 1.592802071e-08 4.326999161e-05 0.0005042839931 0.00197308444 3.032370137e-05 0.0005857579152 7.171987925e-06 6.864328965e-06 4.00109422e-06 0.005161817275 2.375668536e-09 9.778482285e-06 1.181506681e-08 1.503749258e-08 3.203838424e-11 0.3676119133 1.281881299e-09 0.0004415836065 -1.190288394e-07 +1.205682724e-07 8.77428226e-07 7.210177682e-11 1.45886715e-06 0.02121994342 0.01168544154 3.982811877e-09 8.600471911e-09 1.434258247e-08 8.098070419e-10 0.0007724068717 2.490831815e-12 2.21358682e-06 -0.2873305685 -5.652944325e-06 +0.3039319263 +1.06879986e-05 2.722304477e-09 3.122833335e-06 1.198571403e-06 4.489385847e-09 2.67381748e-08 3.471377557e-09 5.756644016e-06 6.839839041e-05 2.209846587e-07 8.291924237e-08 5.242886271e-07 6.844201737e-11 1.726048304e-06 9.225948144e-07 0.000185717301 0.002602315394 6.138200606e-11 0.0001818846094 7.733889705e-14 1.358383639e-08 1.07000594e-06 4.579302999e-07 7.849169727e-07 2.448333585 7.535064872e-11 3.779457663e-06 1.495153092e-07 3.954406596e-09 8.122956595e-09 0.0001228391098 2.269361403e-11 0.001844497418 0.01115645921 -2.08005184e-06 +2.597690032e-06 4.660852875e-11 4.199474743e-10 4.628821128e-05 0.0004980806998 7.598116953e-09 4.143456828e-13 0.002644658829 2.564668699e-08 6.50580785e-08 3.820040563e-11 0.2398554094 9.400695396e-08 0.002358652784 1.171877918e-11 1.637975849e-09 8.942959658e-08 3.408065038e-10 6.371021504e-07 8.862071381e-07 8.07800753e-13 1.275141633e-07 5.065134208e-08 3.723768129e-05 1.586955855e-06 4.630822765e-08 3.869149299e-05 0.0002373420357 8.091381421e-08 2.031825403e-10 1.493296083e-05 2.814058365e-06 4.293942142e-10 1.227720708e-09 9.668701181e-10 5.082776865e-06 0.001170366525 -2.950213679e-07 +3.153572708e-07 2.929772297e-06 3.908673483e-06 -1.641984659e-08 +1.837314879e-08 9.22544372e-06 0.004601199051 1.245696104e-11 1.623356072e-06 0.0004075079271 0.06223654452 2.229639676e-12 1.548827536e-10 0.2098995653 0.02739866019 1.922659779e-12 0.001586041269 1.845383825 0.8609993903 0.09603688052 5.904130818e-11 9.958673683e-12 0.05389921105 0.0001869127049 6.618563858e-08 3.845467031e-07 9.065990802e-07 0.0003895671306 2.782863325e-11 0.0002689153495 5.924260979e-06 0.0005747447785 4.117458599e-09 5.117012888e-08 3.396356612e-09 8.109913215e-12 4.329382871e-08 4.881990436e-07 1.276280038e-11 9.120675139e-12 7.192434752e-07 3.913876447e-11 1.9517939e-08 0.11670582 1.114874302e-06 -8.08838007e-07 +1.051244942e-06 2.596368516e-07 0.0001277437573 0.0004507490086 5.934514686e-10 9.045316154e-06 1.1680623e-08 4.405302098e-07 1.103299007e-15 7.105364025e-08 6.778113877e-05 2.587602347e-06 2.630707294e-07 2.256922483e-10 1.585065727e-05 -9.078985718e-05 +0.0001137727537 1.439932327e-09 0.003315113132 4.417287152e-05 3.208255435e-09 7.222413113e-10 0.000300699488 4.624336745e-05 8.037199117e-10 6.718759329e-12 3.83547078e-05 7.94104255e-05 4.496517789e-05 1.351102043e-06 9.177810983e-10 8.693619098e-07 1.929511565e-06 4.773961763e-09 1.896551164e-08 1.552346596e-08 9.245502051e-06 0.0001037407773 6.368845512e-07 4.041904863e-06 1.506851808e-08 9.717844454e-12 2.297581007e-05 0.0234227485 0.00306449787 5.437659639e-08 0.001404494601 1.582456182e-12 10.74537802 0.0006876957837 3.080472252e-07 4.979458387e-09 2.191738006e-08 diff --git a/t/ME_data/ME_h_mtmb.dat b/t/ME_data/ME_h_mtmb.dat index 463c576..8370f81 100644 --- a/t/ME_data/ME_h_mtmb.dat +++ b/t/ME_data/ME_h_mtmb.dat @@ -1,807 +1,807 @@ 4.043634525e-08 3.947735809e-05 3.978333671e-05 0.01707962353 4.133534858e-06 4.12758231e-07 6.527379321e-07 7.807924441e-07 6.213247187e-07 -2.158745738e-05 +2.292064051e-05 4.929604661e-05 1.648537835e-06 -0.0005294944592 +0.0005321070091 1.551221705e-05 9.732109994e-06 0.03508523471 8.385697667e-07 608.0814044 6.0749939e-06 -0.01370931025 +0.01383234108 1.96358809 0.0005777778828 0.000827073758 3.396653466e-05 -0.0003663185905 +0.0007925662403 0.000712177849 0.03945983226 -6.694529237e-07 +1.109333656e-06 2.002990871 9.107975513e-08 0.04804489153 0.1078671772 9.503786206e-07 -0.00665553606 +0.007776569624 0.02341176253 3.684250185e-05 6.861318278e-07 0.005400516499 7.647108683e-05 0.005354950581 0.0006200616798 0.008448060377 0.003448403835 -3.215759836e-05 +3.93020183e-05 0.0001546133101 0.005591549046 -0.03949683081 +0.03958941813 2.350530066e-07 5.66847762e-05 8.602097332 -0.0001911650059 -5.061383546e-06 +0.0001921261891 +7.502702823e-06 5.119802912e-06 -0.0001348170624 -0.1914012121 +0.0001496819684 +0.213120324 0.02428150541 4.539435975 -0.0002614830785 +0.0002738016111 1.314349378 0.005127584311 -2.106730988e-06 -0.06042114066 +2.816422817e-06 +0.07344901515 0.002877526755 -6.46292188 +7.299557828 7.320533172e-08 4.686272323e-06 -1.674918088e-05 +1.946859515e-05 1.561186199e-05 1.127468541e-06 0.0009956223126 9.322344484e-07 2.355779109 0.001354263217 0.001607437479 27300.17114 -8.763842677e-07 +1.282038387e-06 0.0006972261753 1.071457504e-07 0.02005686587 1.961498186e-06 4.460773766e-05 0.02601668696 50724.57307 5.480882962e-06 1.076584976e-06 2.869362531e-06 0.0001072518549 0.0002293795185 8.022114184e-08 0.002698012227 -0.0005830909647 +0.0006015504033 0.07725070316 -0.001325583365 -3.695641615e-05 +0.001377279885 +6.964246376e-05 0.1179283377 0.187466976 0.0001155356229 -1.778799047e-05 -0.02462347248 +1.895976068e-05 +0.02724871881 0.001087874101 5.154078743e-06 -0.1031621088 +0.1059710091 9.484855944e-05 -93.85073623 +94.78499143 0.02033391802 9.092704303e-05 -1.705551286e-06 -0.0002974887579 +3.912572591e-06 +0.0003340065858 0.0001322670062 1.193514887e-06 0.0001344144727 3095.568362 1.406347883 -0.08812981858 -35.91258076 +0.08943984916 +35.93630323 1.82576512e-06 -9.27160445e-06 +1.057243426e-05 0.001666287395 1.269161514 0.0003682229129 2.790042514e-06 4.841321328e-06 0.001729869633 0.3293946648 -0.0008921922127 -0.08111101834 +0.0009589102693 +0.08469469459 0.2664463909 0.02792004132 -1.869728836e-06 -0.002768079641 +3.241512757e-06 +0.002892655486 1.908915912e-06 1.7932868e-06 2.342012655e-05 1.3539045e-05 0.02918304927 -0.0001341037055 +0.0001576463616 6.099926061 438766540.3 0.0003006556126 182.0743425 1.166556788 -4.685195193e-06 +5.062168162e-06 0.02991092642 12.79082303 0.0005990054968 1.245221356e-06 -4.607261468e-05 +6.010815261e-05 0.729519575 -0.0003077751881 +0.0003654608813 1.113634813e-07 0.0007837766949 3.49282179e-06 0.001938345149 1.741954359 0.000679566605 447.8606334 1.502685811e-05 -0.003972927121 +0.004001081006 0.005572294955 1.00407234e-05 0.002697149585 0.04268640856 1.838639564e-05 0.0008683709605 -1.984375256 -2.023641764e-06 +2.022642541 +2.281686632e-06 0.000198987372 6.590604109e-05 451.0223058 8.870879716e-05 0.003243511862 3.187920803e-07 0.1107987679 1.145759171e-07 5.532565231e-06 6.903234805e-06 -0.002276208464 -0.004410664221 +0.002727714074 +0.005134520243 2.467146722e-05 3.863236208e-08 5.225855864e-06 -8.615548536e-05 +0.0001075855321 13702.18793 118.8790931 398.6816605 -0.2170834277 +0.2300421985 2.355356756e-06 0.0001050726086 0.004854583584 0.4416609149 -0.0001091431342 +0.0001117424705 2.015137689e-06 2.270813172e-07 3.065037179e-05 0.3695610208 -6.626431375e-06 +8.012249806e-06 0.005034520677 0.0005496323042 1.077013565e-07 1.134883954e-05 2.217217266e-06 -4.053576036e-06 +5.058740304e-06 0.007630107217 5.870346284e-05 1.937770986e-06 0.002308560802 0.00756714829 0.09713373161 -0.07865638607 -0.001166988788 +0.07902736629 +0.001373738971 0.0001360267898 3.146930172e-07 6.721239549e-07 2.308081382e-07 1.402445764e-07 0.000317796034 0.003250721897 3.220983676e-07 0.0005361385069 1.1674911 1.701754998e-05 2.555659626e-05 -2.72704331e-06 +4.295773543e-06 4.575225674e-07 3.723503521e-05 6.625793946e-07 0.002713331741 0.1757705927 0.01528287892 -1.914346383e-05 -0.001027883901 -0.0001819228709 +2.600058607e-05 +0.00104396898 +0.000215183149 3.169381656e-06 1197.183436 9.459688271e-06 7.151860571e-07 4.709453403e-05 4.024117529e-06 0.003399032872 0.01326938543 0.0181234889 0.0001070400499 0.08816817298 7.557106621e-07 0.03150507468 2.546159018e-07 1.083218854e-06 0.0006029839411 4.109536026e-06 69.62539127 -9.053551382e-06 +9.190394104e-06 3.976334138e-05 -2.74610264e-06 +3.557434726e-06 0.1217200425 1.39072939e-07 0.007475099982 3.40898863e-06 1.355970335e-08 0.0008211141398 8.085185969e-08 5.540708628e-07 9.793920273e-07 0.0001116678867 0.005087064408 0.01371958748 3.747341913e-10 1.784590611e-09 6.285401932e-10 1.403711889e-08 -7.942905268e-06 +1.234662607e-05 1.099705834e-10 7.694717507e-06 1.645454731e-06 7.281682073e-08 8.437713425e-09 2.293298229e-08 -2.337785459e-07 +3.274272811e-07 7.748072516e-08 1.184163566e-07 0.0006048814428 1.496340286e-05 1.358047852e-07 -2.641795688e-07 -7.894816929e-07 +4.122637606e-07 +7.951549138e-07 0.01733476065 0.0001847336643 3.09120607e-06 22646.44954 0.06825326182 -1.097908477 +1.192340601 7.194716543e-07 0.0008831460117 0.3510995791 0.001703720233 6.923341702e-07 104.5021475 1.817413974e-06 0.006274458892 0.000298133205 0.006212019474 2.971106209e-07 -1.073536231e-05 +1.075176214e-05 6.001267547e-07 0.002926676713 1.394485679e-08 1.378850246e-06 0.02873430354 1.324231029e-09 78.68865757 3.323528263e-06 2.901477846e-07 -4.025907172e-07 +4.493480222e-07 0.0003762267637 1.888509349e-06 2.984779601e-07 0.02649146415 0.0004735978501 -0.001390723358 +0.001523297471 2.511800946e-08 2.406174629e-11 4.343797764e-07 1.413682848e-05 8.187236684e-07 2.137756399e-07 8.487602643e-07 2.382894999e-06 0.06385257472 1.843038529e-07 2.200340736e-08 6.500296312e-10 1.369543749e-07 5.034654856e-06 1.729239287e-05 0.0001029880478 0.01584013323 1.717937137 5.051793703e-10 1.169719308e-05 3.274892339e-07 3.257575264e-10 0.0002494213231 1.395452311e-06 0.503263349 9.183628731e-05 0.02652180806 0.01351083505 7.697372696e-07 0.0002345916253 0.0003785854477 1.911331681e-08 5.741981368e-07 2.496303102e-09 0.0001538309849 2.342705363e-11 1.733704579e-05 7.440708121e-09 -6.97019919e-06 +9.634074462e-06 0.0005366276141 0.02581853732 6.351131637e-06 1.725302693e-08 7.963798782e-09 0.009484858796 4.13192111e-07 0.004760868685 6.868174526e-10 0.003035550995 6.122424548e-05 8.912863951e-08 7.049197773e-08 9.784536423e-08 1.644442743e-05 5.17689779e-07 8.945719428e-08 1.043648257e-08 3.220171418e-07 42.8640364 0.004721640337 1.17318728e-05 -4.163036826e-08 +6.030229416e-08 3.442022366e-06 2.613636766e-07 -0.002337930201 +0.002417874611 1.311028403e-05 0.06454239294 1.788371853e-08 2.431129133e-07 9.887586539e-05 0.393826783 4.435492073e-07 3.017594495e-08 3.944030937e-05 -8.95155309e-06 +1.049807075e-05 1.480534305e-06 4.80208438e-06 2.278546025e-07 2.431285271e-06 0.0002795248679 0.01414217835 1.721740596e-07 1.225137873 184.4942235 0.03969271858 7.5889168e-05 0.0002307099487 0.002991500607 0.008823843341 5.377454625e-08 363.5972586 6.577363411e-07 2.768216121e-07 8.808374953e-08 4.320144869e-07 2.087813482e-05 5.563234756e-08 0.001828101352 16.31099206 8.047143214 5.054980175e-12 1.31165661e-06 0.003453525346 1.775158542e-05 1.735750599e-06 0.0002258034827 9.302350911e-05 8.722704625e-05 2.463340497e-06 0.0001266405389 -7.186989683e-09 +9.536618271e-09 2.616936561e-07 0.0008671500774 -0.3034312162 +0.3105556664 0.0006552874753 1.250994614e-07 4.836707652e-07 267.0859855 2.784590138e-09 1.277933942e-11 1.625022487e-09 35.42273613 8.653074513e-05 4.787553737e-06 1.988624796e-05 3.776413822e-07 1.896902599e-08 -0.02757075064 +0.02770700524 15.7257863 2.903221186e-10 1.383656135e-06 9.796122701e-07 0.000313466982 0.001008582166 1.326553759e-05 0.004678660451 0.01717544418 9.763673978e-07 8.769786833e-06 8.887711201e-06 0.001304503338 6.699929944e-07 5.668340919e-11 0.2432408562 1.65579253e-07 0.000246842309 0.002380529019 7.590644517e-09 7.382339234e-12 0.02191318318 6.595093824e-09 7.59955463e-08 0.0006241836255 2.306006909e-07 8.949234518e-07 1.745865901e-07 -2.984765317e-06 +3.531291359e-06 5.515085903e-08 0.0004672383281 3.41289611e-10 9.072028681e-09 0.1360437848 2.516296619e-06 9.347242718e-06 7.560996071e-06 3.650323724 8.084973509e-06 4.821049366e-07 2.262423437e-07 2.237305224e-06 3.165244113e-07 1.440989373e-05 0.0002661269589 24.06039199 -1.471908477e-08 +1.860370743e-08 4.189979743e-06 0.001821016076 4.36609224e-09 3372180.49 0.0009765702499 0.03671795044 0.5266849257 0.004945279364 2.349850855e-06 0.06096774779 0.000440582517 2.030747703e-08 0.0001828061992 0.0003290502891 -4.360219646e-07 +6.504778186e-07 2.945465959e-08 0.04314824277 8.695492983e-07 19.3255897 0.0003433917438 1.623604604e-07 0.0004985403516 4.206613628e-07 6.048976857e-09 0.01167821222 5.984173029e-05 1.495919742e-08 0.349858651 1.798434603e-06 1.039820674e-07 1.118772128e-08 -9.889699357e-09 +1.30086451e-08 0.003069395217 4.6681898e-06 6.697088362e-11 3.350850437e-06 0.06185962328 4.883448988e-09 1.110833085e-06 -0.0003200423438 -0.0006747162613 +0.0004052046295 +0.0006808854079 0.0002346905421 4.330939823e-06 1.219218909e-07 0.00107853716 8.281691391e-06 1.767444691e-10 6.900019008e-08 605.6626124 1.58440332e-07 0.04329139184 2.752138714e-08 0.0005185712214 1.286238525e-10 2.639855477e-07 1.869433683e-06 1.079551089e-10 1.229225358e-07 0.03468655392 0.0006584274735 3.689112319e-09 1.260350348e-05 1.040877611e-05 9.878538403e-06 0.00027695052 9.100037836e-09 8.033944341e-07 3.315013452e-05 1.633327055e-11 0.003414227642 6.245172231e-08 0.0003805246583 0.0002060494734 3.729836801e-11 9.13272934e-09 2.051216421e-08 2.436679394e-08 4.8855578e-09 3.735846979e-11 1.088675628e-07 2.683031236e-07 3.706588258e-11 0.02523141233 3.549809347e-05 3.149827076e-09 1.040176277e-09 2.910870047e-10 8.86122235e-06 5.308664537e-09 3.218598972e-11 0.001577139281 -3.19884756e-07 +7.379705718e-07 2.55834443e-09 7.691641781e-10 0.01021181751 1.105572103e-06 3.947538433e-06 3.734235002e-09 6.899637353e-09 1.304337436e-09 6.538762872e-12 3.449997548e-06 -4.050730086e-09 +4.212613391e-09 7.962318534e-05 6.295652823e-05 1.652753715e-06 7.186541052e-09 4.161402504e-10 240986.4156 0.00837085449 8.760965452e-10 2.273546864e-10 3.315418794e-08 1.416471539e-06 2.236464809e-08 1.633966009e-08 4.518163364e-05 0.0005095243003 0.001992318371 3.067811242e-05 0.000600451339 7.236523643e-06 6.932191963e-06 4.091606026e-06 0.00532740987 2.395091742e-09 9.944229055e-06 1.205282983e-08 1.590006487e-08 3.215700583e-11 0.3737229127 1.296635624e-09 0.0004534080133 -1.217859786e-07 +1.233610704e-07 8.898892246e-07 7.255073266e-11 1.472337758e-06 0.02150215784 0.01192727543 4.01006022e-09 8.731812041e-09 1.44194837e-08 8.229024075e-10 0.0007855372767 2.506773438e-12 2.241537936e-06 -0.2916665128 -5.828120261e-06 +0.3085183925 +1.101920302e-05 2.752322662e-09 3.158084387e-06 1.215204067e-06 4.56919432e-09 2.790752035e-08 3.511291959e-09 5.863328277e-06 6.94327717e-05 2.22257262e-07 8.350918192e-08 5.331043956e-07 6.969438883e-11 1.760059719e-06 9.217915003e-07 0.000186591209 0.002628593815 6.211758257e-11 0.0001834032575 7.768284292e-14 1.377546165e-08 1.091734431e-06 4.677996963e-07 7.943499964e-07 2.545817678 7.562150253e-11 3.799329956e-06 1.510534633e-07 3.983823634e-09 8.184966815e-09 0.000124713148 2.309165194e-11 0.001872087514 0.01153490791 -2.14659923e-06 +2.680798294e-06 4.693787525e-11 4.26518767e-10 4.684595348e-05 0.0005076579094 7.644830233e-09 4.193877203e-13 0.002676923954 2.654050699e-08 6.800195443e-08 3.888064789e-11 0.2446884347 9.628489292e-08 0.002537052711 1.189694289e-11 1.656137485e-09 9.040798991e-08 3.488787289e-10 6.557255554e-07 9.083676565e-07 8.150458329e-13 1.315321346e-07 5.098465051e-08 3.786448639e-05 1.600711068e-06 4.658140964e-08 3.906381479e-05 0.0002389891749 8.287668941e-08 2.051670765e-10 1.60134009e-05 2.847282071e-06 4.308493985e-10 1.238922307e-09 9.741854048e-10 5.146899686e-06 0.001209019717 -3.025450861e-07 +3.233996009e-07 2.974261102e-06 3.899610282e-06 -1.695222355e-08 +1.896885723e-08 9.332118489e-06 0.004694117038 1.266652132e-11 1.65446818e-06 0.0004100868952 0.06302457519 2.236229887e-12 1.584413907e-10 0.2179964362 0.0278380659 1.936978481e-12 0.001609711018 1.892891439 0.8712003892 0.09866862844 5.934210083e-11 1.002311696e-11 0.05494208606 0.000190347461 6.722151007e-08 4.030694324e-07 9.278979899e-07 0.0003978128465 2.803383506e-11 0.0002738201279 5.960007001e-06 0.0005814501443 4.157124101e-09 5.198894043e-08 3.465884394e-09 8.167365756e-12 4.450019241e-08 4.893968894e-07 1.288321375e-11 9.163290302e-12 7.451831479e-07 3.940383302e-11 1.996508632e-08 0.1236118645 1.182043812e-06 -8.323870133e-07 +1.081851533e-06 2.618934064e-07 0.0001307650885 0.0004571929478 6.07226713e-10 9.141057675e-06 1.18356058e-08 4.465375632e-07 1.107633947e-15 7.416788486e-08 6.870175273e-05 2.600618361e-06 2.647425108e-07 2.279494937e-10 1.611105573e-05 -9.315734048e-05 +0.0001167395509 1.474187502e-09 0.003419123567 4.527389745e-05 3.271142207e-09 7.434473088e-10 0.0003102710133 4.710559791e-05 8.139484815e-10 6.749221433e-12 3.882836934e-05 8.016924727e-05 4.578651435e-05 1.374899461e-06 9.31258077e-10 9.107579154e-07 2.005597861e-06 4.853545363e-09 1.906194275e-08 1.569062034e-08 9.37420375e-06 0.0001051157618 6.464238034e-07 4.092696924e-06 1.538436694e-08 9.760057524e-12 2.626691189e-05 0.02379715614 0.00314703493 5.484543738e-08 0.00141690332 1.612112513e-12 11.09088062 0.0007046654234 3.111374555e-07 5.038033967e-09 2.21156295e-08 diff --git a/t/test_ME_generic.cc b/t/test_ME_generic.cc index b30b432..69ab8bc 100644 --- a/t/test_ME_generic.cc +++ b/t/test_ME_generic.cc @@ -1,104 +1,104 @@ // Generic tester for the ME for a given set of PSP // reference weights and PSP (as LHE file) have to be given as _individual_ files #include #include "LHEF/LHEF.h" #include "RHEJ/MatrixElement.hh" #include "RHEJ/Event.hh" #include "RHEJ/YAMLreader.hh" #include "RHEJ/stream.hh" constexpr double alpha_s = 0.118; -constexpr double mu = 1234.; // coupling fixed mu doesn't matter +constexpr double mu = 1234.; // coupling fixed, mu doesn't matter constexpr double ep = 1e-6; void dump(RHEJ::UnclusteredEvent const & ev, RHEJ::Config config){ { LHEF::Writer writer{std::cout}; std::cout << std::setprecision(6); RHEJ::Event out_ev{ev, config.resummation_jets.def, config.resummation_jets.min_pt}; writer.hepeup = to_HEPEUP(std::move(out_ev), nullptr); writer.writeEvent(); } std::cout << "Rapidity ordering:\n"; for(const auto & part: ev.outgoing){ std::cout << std::setw(2) << part.type << ": "<< std::setw(7) << part.rapidity() << std::endl; } } int main(int argn, char** argv){ if(argn != 4 && argn != 5){ std::cerr << "\n# Usage:\n."<< argv[0] <<" config.yml ME_weights input_file.lhe\n\n"; return EXIT_FAILURE; } bool OUTPUT_MODE = false; if(argn == 5 && std::string("OUTPUT")==std::string(argv[4])) OUTPUT_MODE = true; const RHEJ::Config config = RHEJ::load_config(argv[1]); std::fstream wgt_file; if ( OUTPUT_MODE ) { std::cout << "_______________________USING OUTPUT MODE!_______________________" << std::endl; wgt_file.open(argv[2], std::fstream::out); wgt_file.precision(10); } else { wgt_file.open(argv[2], std::fstream::in); } RHEJ::istream in{argv[3]}; LHEF::Reader reader{in}; RHEJ::MatrixElement ME{ [](double){ return alpha_s; }, RHEJ::to_MatrixElementConfig(config) }; double max_ratio = 0.; size_t idx_max_ratio = 0; RHEJ::UnclusteredEvent ev_max_ratio; double av_ratio = 0; size_t i = 0; while(reader.readEvent()){ ++i; RHEJ::UnclusteredEvent event{reader.hepeup}; const double our_ME = ME.tree( mu, event.incoming, event.outgoing, event.decays, true ); if ( OUTPUT_MODE ) { wgt_file << our_ME << std::endl; } else { std::string line; if(!std::getline(wgt_file,line)) break; const double ref_ME = std::stod(line); const double diff = std::abs(our_ME/ref_ME-1.); av_ratio+=diff; if( diff > max_ratio ) { max_ratio = diff; idx_max_ratio = i; ev_max_ratio = event; } if( diff > ep ){ size_t precision(std::cout.precision()); std::cout.precision(16); std::cout<< "Large difference in PSP " << i << "\nis: "< difference: " << diff << std::endl; std::cout.precision(precision); dump(event, config); return EXIT_FAILURE; } } } wgt_file.close(); if ( !OUTPUT_MODE ) { size_t precision(std::cout.precision()); std::cout.precision(16); std::cout << "Avg ratio after " << i << " PSP: " << av_ratio/i << std::endl; std::cout << "maximal ratio at " << idx_max_ratio << ": " << max_ratio << std::endl; std::cout.precision(precision); } return EXIT_SUCCESS; } diff --git a/t/test_Matrix.cc b/t/test_Matrix.cc deleted file mode 100644 index 76fff71..0000000 --- a/t/test_Matrix.cc +++ /dev/null @@ -1,47 +0,0 @@ -#ifdef NDEBUG -#undef NDEBUG -#endif - -#include -#include -#include - -#include "RHEJ/Matrix.hh" - -int main(){ - constexpr size_t dim = 4; - constexpr double ep = 1e-16; - - auto m = RHEJ::Matrix{dim, dim}; - assert(m.rows() == dim); - assert(m.columns() == dim); - m(0,0) = 0.35388638718713294; - assert(m(0,0) == 0.35388638718713294); - m(0,1) = 0.441472069363144; - m(0,2) = 0.7821385102801595; - m(0,3) = 0.4506533375385655; - m(1,0) = 0.5954699211986723; - m(1,1) = 0.7337301649423917; - m(1,2) = 0.24953309317812855; - m(1,3) = 0.5747608628993972; - m(2,0) = 0.5241499726390944; - m(2,1) = 0.5202946315779862; - m(2,2) = 0.5178464229701134; - m(2,3) = 0.22486555579427625; - m(3,0) = 0.28294299023923397; - m(3,1) = 0.23061982229765166; - m(3,2) = 0.9472220498156341; - m(3,3) = 0.68515373407338; - auto mcpy = m; - assert(mcpy.rows() == m.rows()); - assert(mcpy.columns() == m.columns()); - assert(mcpy(0,0) == 0.35388638718713294); - m(0,0) = 0; - assert(m(0,0) == 0); - assert(mcpy(0,0) == 0.35388638718713294); - m = std::move(mcpy); - assert(m.rows() == dim); - assert(m.columns() == dim); - assert(m(0,0) == 0.35388638718713294); - assert(std::abs(det(m) + 0.028722124827027316) < ep); -}