14 How to include user-defined RMC projects

There are three functions in the ``proj'' directory: ``user-init.cpp'' (initialisation), ``user-run.cpp'' (for event calculation), ``user-end.cpp'' (for job termination). You can access the HEPLIST class for every events and do any calculation you want to, including filling of a ntuple. If you have an external function you want to link to the project, you should add an additional line in the file ``Makefile_in'' with the name of new file. Then you have to recompile the project from the ``proj'' directory.

You can also include user-defined labraries, use variable "$(PROJ_LIBS)" in Makefile_in to do this. Look at the example ``hztool.rmc''.

The example ``par-had-jetLHC.rmc'' illustrates how to fill user-defined histograms. It does not used the final state option from RunMC GUI (it is set to ``user-defined''). Instead, the final states (partons and hadrons) are filled inside ``user-run.cpp''. Histograms are also filled inside this function. Drawing options and some protection conditions are redefined in the ``user-init.cpp'' function.

You can save and restore the ``proj'' directory using ``RMC project - save RMC''. This will create a file with the extention ``rmc'' in the ``archive'' directory. You can restore this file latter using ``RMC project - read RMC''.

It is very easy to make a personal RMC project. First, load the default RMC project file using ``RMC project - open RMC'' and select ``default.rmc''. Then start "RMC browser". Now you can modify any file in the "proj" directory. Alternatively, just go to ``proj'' and edit the RMC source using any editor.