Skip to content

key4hep/k4MarlinWrapper

Repository files navigation

DOI

k4MarlinWrapper

k4MarlinWrapper runs Marlin processors as Gaudi algorithms. It provides the necessary converters and interfaces between the file types and formats used between both frameworks:

  • Python interface to configure Marlin processors
  • In-memory Event Data Model (EDM) converters between LCIO and EDM4hep
  • Steering file input conversion from Marlin (XML) to Gaudi (Python)
  • Input and output file support for LCIO and EDM4hep

Build status

linux

doctest-linux

clang-format-check

Using Event Data Model (EDM) converters

Please refer to the EDM Converters documentation

Configuring, compiling and installing

Use the CVMFS HSF Key4hep view to compile and install k4MarlinWrapper.

source /cvmfs/sw.hsf.org/key4hep/setup.sh
# Alternatively use the nightly build to get the latest development branches of key4hep packages
# source /cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh

git clone https://github.com/key4hep/k4MarlinWrapper.git
cd k4MarlinWrapper

mkdir build install; cd build

cmake ..

cmake -DCMAKE_INSTALL_PREFIX=../install ..
make -j 4
make install

Running

k4MarlinWrapper processors run with LCIO and EDM4hep input.

  • As an example for LCIO, copy the muons.slcio from the DD4hep file located in the DDTest/inputFiles/ directory to test/inputFiles/ directory in k4MarlinWrapper

To copy the file and run:

mkdir ../test/inputFiles
cp /path/to/muons.slcio ../test/inputFiles/muons.slcio
k4run ../k4MarlinWrapper/examples/runit.py

Format

To keep source code style consistent a .clang-format configuration is included. A CI test will check for compliance with this format on Pull Requests. To apply Clang format to all source and header files, please use your editor's or IDE's built-in integration, or directly from the command line. For example:

find . -regex '.*\.\(cpp\|h\)' -exec clang-format -style=file -i {} \;

Testing and examples

Several tests are provided. These serve as examples on how to use different features of k4MarlinWrapper.

Refer to the test/gaudi_opts directory to find steering files covering different use cases.

# Display available tests
ctest -N
# Run all tests
ctest
# Run specific test with verbose output
ctest --verbose -R test_clicReconstruction

Using Event Data Model (EDM) converters

Please refer to this doc on how to convert between EDMs in k4MarlinWrapper

Running in parallel: multi-thread support

Please refer to this doc on how to run with multi-thread support, and which options are supported.