Review of AnaAlgorithm Basics

Last update: 23 Oct 2019 [History] [Edit]

If you have made it this far, congratulations, you now know how to setup a basic EventLoop/Athena job and run it. It doesn’t do anything yet (that’s what we will teach next), but this is already an important milestone. Also, if in the future you need to set up a new EventLoop/Athena job or algorithm you can go back to this part of the tutorial, repeat it and then fill in the code specific to your use case.

From this point on we will only tell you to build and run your job, but no longer give you the actual commands. For your reference we have outlined them once more below, so you can go back to this page if you feel unsure. There are several reasons for doing things like this:

  • Compiling and running your job is a very basic task that should become second nature to you. We feel that from a training perspective it is better if you don’t just copy and paste the commands from a web page all the time. Once you start working on your own analysis there will no longer be a web page to copy from, so you may as well start now.

  • Most of the sections that follow apply equally to EventLoop and Athena, but the instructions for running the code are very different between the two. As such not including those instructions makes the documentation both more generic and simple.

  • If you follow some of the advanced sections they will slightly modify these instructions. Again it is easier to leave out the instructions than to add a lot of caveats to them.

  • On a more practical level, repeating these instructions everywhere is tedious cut-and-paste that we can do without.

Compiling Your Job (Review)

Normally to recompile your job call:

cd ../build/
make

If you have added/removed any files or packages call instead:

cd ../build/
cmake ../source
make

It is always save to call cmake, but it can be quite slow, so omitting it when it is not needed is often a reasonable choice. Note that if you followed the instructions for placing source and build directories on different disks you may have to modify the cmake command accordingly.

Some users prefer instead of changing directories all the time to log in a second time and then have one window just for compilation. Other users relies on shell scripts or IDEs (integrated development environment) to call the commands automatically in the right directory, or they rely on the --build option of cmake:

cmake --build ../build/

warning Sometimes we tell you to run cmake explicitly (typically because we added files or packages). In that case you really have to go to the build directory and call cmake. Calling cmake --build will often not be sufficient.

Running the Job (EventLoop)

To run your job call:

cd ../run
ATestRun_eljob.py --submission-dir=submitDir

If you used the C++ macro that would instead be:

cd ../run
root -b -q '$ROOTCOREDIR/scripts/load_packages.C' '../source/MyAnalysis/share/ATestRun_eljob.cxx ("submitDir")'

warning There are multiple paths through this tutorial, be sure that now that you have finished AnaAlgorithm introduction you continue to Basic Tools.

Running the Job (Athena)

To run your job call:

cd ../run
athena.py MyAnalysis/ATestRun_jobOptions.py

warning There are multiple paths through this tutorial, be sure that now that you have finished AnaAlgorithm introduction you continue to Basic Tools.