How to generate single events

It's easy to generate a sample of single events (ie. an event which contains a single particle), with the CDF code. You just need to run the cdfSim executable with an appropriate directives file. Instructions for changing the directives file are given below.

How to generate single particles

A sample directives file can be seen in /cdf/disk1/utilities/run_cdfSim.tcl . Copy this and change it however you want. The relevant parts that control single particle generation are shown below:
mod enable FAKE_EVENT
talk FAKE_EVENT
  use PT
  use THETA
  use PHI
  generate PT  10. 0. 10. 10. 0. 1.
  generate PHI  180. 0. 360. 270. 0. 2
  generate THETA 90. 10. 45. 135. 1.
# Generate mu-
  generate CDFCODE 207
  generate NPARTICLES 1
#  show
exit
FAKE_EVENT is the name of the single particle generator; we must enable this if we want to use it. In this example we have selected the position (in phi and theta) of our generated particle, and also the pt range. One could also select by momentum (P), eta (ETA). Ranges of interest in these variables are specified by
 
  PARAM_NAME mean sigma pmin pmax power mode
where PARAM_NAME is one of P, PT, ETA, THETA, PHI, mode = 1 (2) means Gaussian (power law), and you set (mean,sigma) or (pmin, pmax) accordingly. Note that PHI and THETA are specified in degrees, not radians.

The particle type to generate is given by CDFCODE. Here 207 corresponds to a mu- in a historical CDF numbering scheme. Other useful numbers are:

How to run the job

Just type executable_path tcl_path , where executable_path is the full path to your cdfSim executable, and tcl_path is the full path to your directives file. Make sure that you have set the name of your output file and the number of events you want to generate in your directives file:
talk DHOutput
  output create main_stream cdfSim.root
... you will produce a file called cdfSim.root

begin -nev 10
.... with 10 events in.

Useful links