Running Monte Carlo (with 4.5.0)


The goal of this page is to explain how to run Monte Carlo and make Stntuple files from the Monte Carlo data. Specifically, I will describe the use of Pythia with Tauola in release 4.5.0 of cdfsoft. Other generators and releases should work similarly, but you will need to alter the .tcl files somewhat.

I will try to keep this page fairly up-to-date, but if you notice problems, please fix them or send me an e-mail (mreece@hep).

Before proceeding to the detailed description of how things work, here are brief descriptions of how to solve some problems.

Important notes; troubleshooting.

Changes for 4.5.0

4.5.0 out of the box will have some problems running Production. In ProductionExe.tcl you need to change the lines:

# # Define the entry in USED_SETS that we want to load.
# ProcessName set PROD_PHYSICS_CDF
# Version set 15
# parmSetName set PROD_PHYSICS_CDF15

# It's time to use the pass tables instead...
PassName set 02
parmSetName set Pass02

to:

# Define the entry in USED_SETS that we want to load.
ProcessName set PROD_PHYSICS_CDF
Version set 15
parmSetName set PROD_PHYSICS_CDF15

# # It's time to use the pass tables instead...
# PassName set 02
# parmSetName set Pass02

Altering ProductionExe.tcl, or, what to do if your Stntuple scripts die when you try to access the track block:

The ProductionExe.tcl file from $CDFSOFT2_DIR/Production/ has a line that reads
creator set USRP

Change this line to read:
creator set PROD

Changes in 4.3.0 and later:

Using Pythia with the CDF software is a bit different in 4.3.0. Here's what the new syntax looks like:

module enable Pythia
talk Pythia
# Produce t tbar
  PythiaMenu
    msel set 6
    commonMenu
      # commonMenu commands here, e.g.:
      set_mdme -channelIndex=200 -decayType=0
    exit
  exit
exit

Note that "msel" is lower-case, and you must specifically invoke the "PythiaMenu." This is opposed to the older code which looks like:

module enable Pythia
talk Pythia
# Produce t tbar
  MSEL set 6
exit

Brief overview

I have been working in /cdf/data2a/mreece/mc on a Monte Carlo framework adapted from an older one by Peter Onyisi. You can copy the .tcl and .sh files from here to set up your own system. See below for more details about which files you'll need and what you may need to change. From the directory /cdf/data2a/mreece/mc/ttbar, here are the steps you would use to generate events, run the detector simulation, production, and the stnmaker. Note this is assuming a bash shell: you'll have to change "export" statements to "setenv" statements, etc., with tcsh.

Basic setup of cdfsoft: Generate 10,000 events with Pythia, run cdfSim, Production, and make an Stntuple: You now should have files tt_pythia_HEPG.root (the Pythia data), tt_pythia_postcdfsim.root, tt_pythia_postproduction.root, and tt_pythia_stntuple.root. You may have additional files with names like these and "_1" or "_2" appended; you get these when file size runs over 1 GB. Note that Pythia often crashes after finishing , but your output file should be ok. Feel free to kill cdfSim at that point. [UPDATE 5/20/2002. I don't see this crash in 4.5.0 UPDATE AGAIN 5/24/2002. Now I do, but again it's not a real problem.]

The files in /cdf/data2a/mreece/mc

Here is what the directory structure looks like, along with some notes about what the files do and what you might need to change for your own use:
Production/
Copied from $CDFSOFT2_DIR/Production/ - be sure to copy the version that corresponds to the release you are running!
Production/ProductionExe.tcl
The .tcl file that controls Production. As noted above, you must alter the line "creator set USRP" to read "creator set PROD" or you won't be able to read the track block in the Stntuple.
Production/setup_*.tcl
Various files that set up parameters for ProductionExe to run. You probably won't need to change these.
generic_cdfsim.tcl
Sets up the detector simulation. Talks to the GeometryManager, SimInitManager, SimulationControlMod, and DHOutput modules.
run_stnmaker_mc.tcl
Sets up the stnmaker.exe program. The only change from the default here (at the moment) is to set "makeGenp" to 1. The file $CDFSOFT2_DIR/Stntuple/mod/StntupleMakerModule.cc determines what options are on by default (in the constructor, beginning with the line " fMakeCalData     ("makeCalData",this,0) ".
ttbar/
In this folder I set up a specific example: running Pythia+Tauola to simulate ttbar production.
ttbar/tt_pythia_generate.tcl
This sets up the Monte Carlo: it talks to Pythia and sets msel to 6 for ttbar production, and then talks to Tauola to turn on all decays. You will need to determine which options to use for what you wish to simulate. The DHOutput section sets up the output stream, and probably will not need to be changed.
ttbar/tt_pythia_generate.sh
This runs cdfSim on the .tcl file above. Edit the value assigned to MCGEN_OUTPUT to change the name of your .root file for the simulation.
ttbar/tt_pythia_cdfsim.sh
This just runs cdfSim on the generic_cdfsim.tcl file, taking the data generated by Pythia. Be sure to make the MC_INPUT_FILE name here the same as your output file from Pythia.
ttbar/tt_pythia_production.sh
Calls ProductionExe on the default ProductionExe.tcl file described above. Again, make your input file here match the output from cdfSim.
ttbar/tt_pythia_stnmaker.sh
Runs stnmaker.exe on the data from ProductionExe, using the run_stnmaker_mc.tcl file.

Links to More Information

The Pythia home page.

My notes on tau Monte Carlo.


Created by Matt Reece (mreece@hep.uchicago.edu) March 7, 2002