9 The RMC physics projects

You cannot do complicated studies just by using JRunMC. First of all, only a small number of histograms are available from JRunMC. Monte Carlo settings also cannot be changed flexibly enough. Note that if you will copy steering cards to the directory where you execute ``runmc'', you can change some Monte Carlo parameters by modifying the steering cards. Examples of the steering cards are located in ``example/steer'' directory.

As was mentioned above, the user can include personal histograms and modifications to the MC settings by changing subroutines in the ``proj'' directory. This directory contains:

  1. At least one ``project.mc'' file which defines the status of RunMC. This file can be loaded to RunMC GUI via ``File-read MC'', or using the command line: ``runmc project.mc''

  2. One file ``user-comment.xml''. It has comments on the structure of this projects, and is shown automatically when an RMC project is loaded. It has some useful information on how to run this project (in XML format). This file can be edited the menu "RMC project - RMC info editor". You can view HTML formated information using "RMC project - RMC info". In fact, the user can edit the file ``user-comment.xml'' using any text editor.

  3. Directory ``ini'' with ``dummy'' subroutines for each MC model. Here you can set MC parameters using FORTRAN codings (read MC manuals how to do this. All MC manuals are located in ``main/mcarlo'' directory).

  4. , ``user-init.cpp'', ``user-end.cpp'', ``user-run.cpp'' - project initialisation, analysis and terminations subroutines. The RMC file ``par-had-jetLHC.mc'' illustrates how to use these files.

  5. ``user-select.cpp'' - here you can set any cuts you want on hadronic final state or original HEPEVT record (if option ``stable+all'' used).

  6. ``user_afill.cpp'' defines user variables for each event, each particle (1-particle density), or each 2-particle combinations (2-particle density). The same file is used to fill histograms for jets. Read comments in this file. One may also look at a very similar system file ``main/src/afill.cpp''.

  7. This directory can contain steering cards for MC models. Settings in these cards can be overwritten by subroutines in ``ini'' directory.

  8. ``Makefile'' and ``Makefile_in''. You need this to compile your project by typing ``make''. The same make files are used when you load RMC project using ``RMC project - open RMC'';

  9. ``user-name.txt'' file which attributes names to your personal histograms which will be automatically included to RunMC during compilation. All names here should be exactly as in the ``user_afill.cpp'' file.


The structure of the ``user-name.txt'' is:

# this is just a comment 
#
variable1     describe it here 
variable2     describe it here 
....

Use "#" to add a comment. Do not use spaces in the definition of the variable names!.


All the subroutines defined above can be modified, and all executable for MC models can be recompiled by typing ``make'' from the ``proj'' directory.

In fact, the directory ``proj'' is ``unpacked'' form of the so called ``RMC'' file (or project), which contains everything you need to do the analysis. At this moment, this directory has only dummy functions. Go to this directory ``proj'', type ``runmc'' and save this directory from ``RMC project - save RMC''. You will see the message ``archive/<project>.rmc created'' (of course, <project>.rmc' could be any name which you type in JRunMC).

The file <project>.rmc is nothing but the ``proj'' directory, archived and compressed using the ``zip'' utility. This file is stored in the ``archive'' directory.

In the directory ``archive'' you can find a number of files with the extension ``rmc''. These files contain various physics projects (MC settings+histogram definitions as in the ``proj'' directory), saved exactly as you did before. This is a list of the present projects: Every time when you start JRunMC, the program read XML file inside such file and build a database.

  1. ``default.rmc'' - just ``proj'' directory with dummy functions; ``default1.rmc'', ``default2.rmc'' - are few examples of how to fill ROOT histograms.

  2. ``dis_kinematics.rmc'' - project for DIS related studies;

  3. ``dis_strange.rmc'' - project to study strange particles in DIS;

  4. ``event_shapes.rmc'' - project to study the event shapes;

  5. ``charm_dis.rmc'' - project to study D* cross sections in DIS;

  6. ``jets_HERA.rmc'' - project to study jets at HERA (using the longitudinally invariant algorithm in the Breit frame);

  7. ``jets_LHC.rmc'' - project to study jets at LHC; It also illustrates how one can preselect events in the user function ``user-select.cpp''.

  8. ``jets+charm_LHC.mc'' - project to study jets at LHC. It also requires at least one charm particle in an event. This example illustrates how one can preselect events in ``user-select.cpp'' function. Note: option ``stable+all'' are used for the final state (fills both PP and HP vectors from heplist class).

  9. ``par-had-jetLHC.rmc''- project to study jets at LHC. This calculates jets at parton and hadron levels, and takes the ratio (the so-called hadronisation correction). This example is very important: it illustrates how to set user-defined calculations via ``user-run.cpp'' file, without using the internal RunMC functions. Also, the user can set some histogram options ``user-init.cpp''.

  10. ``view3d.rmc''- project to study top production at NLC. It creates a 3D view of the event, following to a very similar approach of the example tree2.C file in $ROOTSYS/tutorials. In this example, RUNMC canvas is modified by the user. The settings for MC are done in ``ini'' directory

Try to load one of this projects to ``proj'' directory for testing. Click ``RMC project - open RMC''. Select one of the files with the extension. Use doble click to read about the selected project. To load the RMC project, click on "Load". You can get recent RMC files from http://www.desy.de/~chekanov/runmc.

When you click on "Load", this automatically recreates ``proj'' directory by copying new files from the selected RMC file. You will see a yellow message ``Wait'' and yellow status bar indicating the compilation progress: it starts compilations of all MC models using new files from ``proj''.

Note that if you had important files in ``proj'', and you have forgotten to save them before loading a new RMC project, such files will not be lost. Check the ``main/tmp'' directory. It should contain old ``proj'' directory (in zip format) with the name ``proj_date.tmp''. Note that files which are one week old are removed automatically.

When the compilation process finished, you can see that there are new histogram in RunMC. A new message will appear which contains information on this project (from the ``proj/user-comment.xml'' file). Say ``OK'' to close this window. Then, press histogram bottom, and study the list of the histograms. Now you can do necessary modification via RunMC and can start the run. (Note: if histograms in JRunMC were not updated, try to restart ``runmc'').

You can read comments on the current project using the the menu ``RMC Projects-RMC info''. This information be modified by using ``RMC Projects-RMC info editor''

The new ``proj'' file should contain at least one file with the extension ``mc'' which defines the status of RunMC GUI (which can be loaded as ``runmc project.mc'' or using ``File-read MC'' option.

To debug files in ``proj'' directory, just type ``make'' from the shell prompt.

You can study the RMC project which is currently in ``proj'' using ``RMC project-RMC browser''. This executes appropriately modified Jedit editor.

The user can define and fill external variables in ``user-run.cpp''. Load the ``par-had-jetLHC.rmc'' project to see how this was done. In this example, several histogram files are defined in the user initialization subroutine, and final states are defined in the ``user-run.cpp'' file. In this subroutine, jets are reconstructed using an external function ``ktjet.cpp'', and histograms are filled separately for hadrons and partons. The final state in RunMC GUI was set to ``user-defined'' final state, since the final state is filled by a user.