The CBGEANT Mini Guide

Table of Contents

Introduction to the Crystal Barrel Monte Carlo: CBGEANT

Building the Crystal Barrel Monte Carlo: CBGEANT

The Crystal Barrel Monte Carlo program is distributed as a CMZ file, cbgeant.cmz. In addition to this, there are semi-regular update cradles sent out and need to be installed locally. The most up to date version can always be found by exmaining the url:

Assuming that you do have the most up to date software, then the installation procedure will proceed quite smoothly. First we wish to build the library, and extract any needed files:

Unix Installation

  1. Move into the directory in which you have the cbgeant.cmz file.
  2. Make sure that a subdirectory exists in which the soure code can be placed. We will assume that on a unix platform this is src.
  3. Now enter the command:

    cmz -install cbgeant src all

  4. After some time, you will have a cbgeant library, libcbgeant.a, a main program cbmain.f, a linking script, cbgeant_link, an example run script, cbgeant_run, an example card file, cbgea.crd and two input files, mc2282.lut and mcfera.lut.
  5. You can now link the default cbgeant program by using the produced linking script. Type:


    At this point, you are ready to run cbgeant.

VMS Installation

  1. Move into the directory in which you have the cbgeant.cmz file.
  2. Make sure that a subdirectory exists in which the soure code can be placed. We will assume that on a vms platform, this is [.src].
  3. Now enter the command:


  4. After some time, you will have a cbgeant library, CBGEANT.OLB, a main program CBMAIN.FOR, a linking script, CBGEANT_LINK.COM, an example run script, CBGEANT_RUN.COM, an example card file, CBGEA.CRD and two input files, MC2282.LUT and MCFERA.LUT.
  5. Move the CBGEANT.OLB file into the CB$LIB directory.
  6. You can now link the default cbgeant program by using the produced linking script. Type:


    At this point, you are ready to run cbgeant.

Input files for the Crystal Barrel Monte Carlo.

In order to run cbgeant, there are several input files which are needed. Some are extracted during installation, while others must be obtained from a remote site.
  1. The card File to steer cbgeant. An example file, cbgea.crd is produced during installation of the code. A listing of all cards is available.
  2. Two crystal look up tables. These are extracted during installation as the files:
  3. A JDC gas file which maps the hit positions in the JDC to drift times. These files can be obtained from the Crystal Barrel Decstations in the /cboff/gea_pro/dat directory. In addition a tared and gzipped file containing these can be obtained here. A complete set of these files is given as:
  4. flukaaf.dat is a needed input file for FLUKA within geant 321. This file usually resides in $CERNLIB. If this is defined on your system, then things should work. If not, then you should be sure to place a copy of flukaaf.dat in the directory from which you run cbgeant.
  5. sv_MMMYY.dat is a calibration file for the silicon vertex detector. This files normally reside in the Crystal Barrel database area and should be available on the CERN decstations in /cboff/gea_pro/dat directory. In addition, a tarred and gzipped file containing these can be obtained here. A complete set of thse is given as:

Running the Crystal Barrel Monte Carlo.

During the installation of cbgeant, an example script for running cbgeant was produced. This script can be used with the cbgea.crd file to produce 100 pi+ pi- pi0 events at rest in the old jdc. However, you should verify that the input files are specified correctly in the card file. If you examine the card file, you will find four lines of the form: The first indicates that the JDC Design is 1, or the old jdc. Specifying 2 here would select the new jdc. The second tells cbgeant which jdc gas file to read. On a unix platform, you must have an EXACT path and filename. No environment expansion is performed. On a VMS platform, logicals are expanded. If you change the jdc design, be sure to change the gas file as well. Finally, the two crystal tables must be specified. You will also need to edit the name of the silicon vertex file assuming that you are using this detector. Again, on a unix platform, and absolute path and filename must be given. Environment variables are NOT expanded.

Common problems with the Crystal Barrel Monte Carlo.

Problems should be reported to Curtis Meyer. However, before reporting problems, please verify that you have the most up to date software.
  1. The program gives me an error message in initialization of the jdc.

    The program most likely failed to find the jdc gas file. Check to make sure that the file exists where you indicated in the card file.

  2. I don't find any hits in the JDC.

    You probably have an out of date version of geant 321 installed on your machine. You need geant 321 from at least the 94b version of cernlib. One way to check for this is to look for the geant initialization statements in the log file, and make sure that you have correction cradle 03, or later.

  3. The program creates a number of fort.xx files.

    This may arise if you do not use the automatic installation procedure. In addition, this may also arise if your machine is not yet supported. Currently, we have support for Alliant, Alpha under both OpenVMS and OSF, Decstation, HP Unix, IBM RISC, Silicon Graphics, SUN, and VAXen under both VMS and OPENVMS. If you are running on some other platform, please report your problems.

  4. The program suddenly stops, with perhaps some message about fluka.

    Since cbgeant version 5.03/00, we are using FLUKA as the default hadronization package. In order for this to run, the program needs to read in the flukaaf.dat file. Your problem may be that it cannot find the flukaaf.dat file. Check to make sure that this file exists in one of the places in which the program looks.

    On decstations, there is a bug in fluka which tries to open this file with write access. In order to work around this problem, you need to have a local copy of flukaaf.dat, and make sure that CERN_ROOT is not defined. The default run script will do this for you.

  5. You have recently upgraded your alphas to OpenVMS version 6.1, and suddenly the program crashes in strange places, or no longer produces output.

    There seems to be some serious problems with this version of OpenVMS. You should perhaps try to upgrade your fortran compiler to the most recent version. If this fails, you can try compiling the code without optimization. I am unable to trace this probelm, as we are still in the dark ages of OpenVMS version 1.5 at CMU.

  6. Out of curiosity, you made a Dalitz plot of all generated events. Unfortunately, this Dalitz plot is not flat as you would expect, but seriously skewed.

    You may be generating events using FOWL rather than Hit/Miss weighting. This is steered using the KINE card for the cbgeant Monte Carlo. A normal form for this card is

    KINE Event_Generator Event_Weight Event_z_momentum ...

    For Event_generator, the usual choice, the event weight can take on two options 0.0 and 1.0 .

    0.0 will give you FOWL Monte Carlo wieghts, and 1.0 will give you Hit/Miss weights. If you opt to use the FOWL weightings, you must know that the generated events all have different weights. In using these data, you need to also keep track of these weights. If you use the Hit/Miss option, than all your events will have equal weights -- events generated using the Hit/Miss method will give a flat Dalitz plot. Events generated using FOWL will only give a flat Dalitz plot if you fill the event weights. It will be highly skewed if you forget to do this.

    In most cases, you will want to use the Hit/Miss Monte Carlo, and NOT the FOWL generator.

  7. You have recently picked up geant 3.21/04 (new area at CERN), and are now getting a ZFATAL with IQUEST=99. This seems to be caused by a GCBANK overflow.

    Unfortunately, there appears to be a bug in this release of geant. It is reccommended that you stick with the /03 version, cerlib 95a. You can partially cure this problem by increasing the length of GCBANK from it current 700,000, but this only delays it until later. As far as we can tell, "GEANT321/04 produces some hadronic 'Killer-events' with FLUKA" -- (Marcel Kunze).

Back to the CMU Crystal Barrel Home Page.

Last updated on the 16'th of April, 1997 by Curtis A. Meyer