Hammer-README

DOI DOI

HAMMER - Helicity Amplitude Module for Matrix Element Reweighting, ver. 1.4.1

A C++ software library, designed to provide fast and efficient reweighting of large Monte Carlo datasets containing semileptonic b-Hadron decays to any desired New Physics, or to any description of the hadronic matrix elements. See the HAMMER website for more information.

Documentation

System Requirements

To use the latest HAMMER, you will need:

Installation

HAMMER uses CMake to configure the build process. Out-of-source build is required:

~$ tar -xzf Hammer-X.Y.Z-Source.tar.gz
~$ mkdir Hammer-build
~$ cd Hammer-build
~$ cmake -DCMAKE_INSTALL_PREFIX=../Hammer-install <ADDITIONAL_OPTIONS> ../Hammer-X.Y.Z-Source  # configure the project. See below for ADDITIONAL_OPTIONS
~$ make # compile the project
~$ ctest -V  # runs all the unit tests. Optional, to be called if tests are enabled
~$ make doc  # create the code documentation. Optional, to be called if documentation is enabled
~$ make install # install the project

Configure Options

The following options can be passed to CMake at configure time with the usual -D<OPTION_NAME>=ON|OFF syntax.

Option Default Description
WITH_PYTHON ON Build the HAMMER Python3 bindings
WITH_ROOT OFF Build the HAMMER ROOT interface
WITH_EXAMPLES OFF Build the HAMMER examples. The ROOT and Python examples will be built only if the corresponding options are enabled. All the examples will be located in <INSTALL_DIR>/shared/Hammer/Examples after installation
WITH_EXAMPLES_EXTRA OFF Build HAMMER extra examples. These are longer examples or validation runs which require larger downloads.
ENABLE_TESTS OFF Build the unit tests
BUILD_DOCUMENTATION OFF Allows building the doxygen documentation with make doc
INSTALL_EXTERNAL_DEPENDENCIES OFF Build and install local copies of certain missing dependencies. For missing Python modules a working pip is required
FORCE_YAMLCPP_INSTALL OFF Install local copy of yaml-cpp even if one is present (rarely needed). Useful on certain systems where package finding and INSTALL_EXTERNAL_DEPENDENCIES both fails
FORCE_HEPMC_INSTALL OFF Install local copy of HepMC even if one is present (rarely needed). Useful on certain systems where package finding and INSTALL_EXTERNAL_DEPENDENCIES both fails
MAX_CXX_STANDARD 20 Affects the C++ dialect used by the compiler, to resolve linking issues on certain platforms. The configuration step will choose the minimum of: the maximum dialect supported by the compiler; the value of MAX_CXX_STANDARD; and the dialect used in compiling ROOT if WITH_ROOT option is enabled

furthermore, the following options are available for debugging

Option Default Description
VERBOSE_DEBUG OFF Build for debugging with high verbosity
SANITIZE OFF Enable sanitizer infrastructure for debugging (the C++ compiler should have the support enabled)
SANITIZE_ADDRESS OFF Enable the address sanitizer
SANITIZE_UNDEFINED OFF Enable the undefined behavior sanitizer
SANITIZE_THREAD OFF Enable the thread sanitizer
SANITIZE_MEMORY OFF Enable the memory sanitizer

and the standard CMake option -DBUILD_SHARED_LIBS=ON|OFF controls whether Hammer is built as a static or dynamic library (static is default) and switching to shared librarary sometimes may be useful for resolving linking issues with the Boost Thread library on some platforms.

Examples

The folder Examples/ contains several examples and is a great place to learn to use HAMMER.

Example Description
demo01 read MC events, reweighs \(B\rightarrow (D^*\rightarrow D\pi) \tau\nu\) and \(B\rightarrow D \tau \nu\) and from ISGW2 to BLPR for generalized NP, saving all the event NP tensor weights into a file
demo02 read in the output of demo01 and reweighs all the events from Standard Model to new physics with complex Wilson Coefficients \(S_{qLlL} = x i\), \(T_{qLlL}= x/4\) for \(x=0, 0.2, \ldots, 1.0\) printing the values of the first few weights in each case
demo03 same reweighing as in demo01 but histograms are filled (\(p_\ell~\) vs \(Q^2\), in 6-by-5 bins, separately for \(D\) and \(D^*\)), including weight-squared uncertainties, and saved instead
demo04 read the output of demo04 and prints perform the same reweighing to new physics as demo02, printing the histogram bin values – weight, number of events, and weight-squared uncertainty – instead
demo05 read MC events, reweighs \(B\rightarrow (D^*\rightarrow D\pi) \tau\nu\), \(B\rightarrow D \tau \nu\), \(B\rightarrow (D^*\rightarrow D\pi) \ell~\nu\) and \(B\rightarrow D \ell~ \nu\) starting from pure phase space events. Prints total sum of weights reweighing decays with a \(\tau\) to \(S_{qLlL} = x i\), \(T_{qLlL}= x/4\) those with a \(\mu\) to \(S_{qLlL} = -x i\), \(T_{qLlL}= -x/4\) for \(x=0, 0.2, \ldots, 1.0\)
demo07 read MC events, reweighs \(B \rightarrow D \ell~ \nu\) from ISGW2 to BGL with FF variations and fill histograms (\(Q^2\) in 12 bins and \(p_\ell~\) vs \(Q^2\) in 8-by-7 bins), including weight-squared uncertainties
demo08 read the output of demo07 and reweighs by varying the Form Factors with BGL parameters \(\delta~ a_1=x\) and \(\delta~ a_2=x/3\) with \(x=0.0,0.01,\ldots,0.05\) printing out the histogram bin values for weight, number of events, and weight-squared uncertainty.
demo09 same as demo03, but splits the event sample in two different output files
demo10 same as demo04, but merges the output files produced in demo09 (automatically summing histograms)
demo11 same as demo07, but renames the FF variation directions
demo12 same as demo08, but renames the FF variation directions, processes the results of demo11
demo01root same as demo01 but using ROOT TTree for storage
demo02root same as demo01 but using ROOT TTree for storage
demo03root same as demo01 but using ROOT TTree for storage and TH2D for histograms
demo04root same as demo01 but using ROOT TTree for storage and TH2D for histograms
demo04root2 another take on demo04root
demo01card same as demo01 but using a card file to set the run options
demo04mma same as demo04 but with Wilson Coefficient values passed from the command line (to be called from Mathematica)
demo08mma same as demo08 but with Wilson Coefficient values passed from the command line (to be called from Mathematica)
demo04parallel same as demo04 but using multi-threading
demo03.py python version of demo03
demo04.py python version of demo04

Contributors

Hammer has been developed by:

Current contributors can be found here.

License

Hammer is licensed under version 3 of the GPL. Please note the MCnet academic guidelines.

Keeping in touch

Notes


  1. Hammer uses CMake to find Boost. In rare cases, depending on the CMake and boost versions this error may appear: “Imported targets not available for Boost version …”. This is due to a mismatch between the CMake and boost versions (CMake FindBoost has hardcoded the boost library versions existing at the time that CMake version was released) and can be easily resolved by setting the variable Boost_ADDITIONAL_VERSIONS at configure time with the correct Boost version or switching to a more recent CMake version.↩︎