Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

6.3 Writing Gaudi Algorithms

Getting Started

Writing Gaudi components requires a bit of boilerplate code. Often it is easiest to start from existing files and modify them as needed. For this tutorial, there is a dedicated repository that contains an example. Start by cloning it locally:

git clone https://github.com/key4hep/k4-project-template

It contains a CMake configuration (as described in more detail in the previous tutorial) so it can be built with:

cd k4-project-template
mkdir build install
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
make -j 4

To run the algorithms contained in this repository, it is not necesary to run

make install

you can use the run script in the build directory, like:

./run fccrun ../K4TestFWCore/options/createExampleEventData.py 

Exercise: Adding an Algorithm

The repository contains an EmptyAlg in K4TestFWCore/src/components.