SLAC PEP-II
BABAR
SLAC<->RAL
Babar logo CM2 logo
HEPIC E,S & H Databases PDG HEP preprints
Organization Detector Computing Physics Documentation
Personnel Glossary Sitemap Search Hypernews

Moose: BaBar Simulation Application

Last Updated: 16 March 2006
Shahram Rahatlou, UC San Diego


Recipe for R18

If you see this error: KanConfig::KanFileLocater.cc(300):ERROR in KanFileLocater: Attempt to reset KanFileLocater config file after it has already been initialized. This is some sort of job configuration error.

Then 'unsetenv CFG_DEFAULT_IMPL' and rerun Moose. Note that Moose is not validated in an analysis release. Please use the production releases found here:

Simulation Production

Purpose

This is the application used to produce MC events, including generation, simulation, digitization , and reconstruction.

Input

The user specifies a decay file for an exclusive or inclusive decay process.

Output

The output is the same as the output of the reconstruction program. In addition, the tagbits used to define the skims for physics and detector studies are also stored in the output collection. The format of the output collection is a root file.

Requirements

  1. A working production release. Check the simuprod-hn forum for the latest recommended release.
  2. Decay file for your favorite decay mode
  3. A tcl file to configure correctly the I/O (see the example below).

Example

In the following $ is the shell prompt, the lines with # are comments, and 14.3.2b is chosen as an example production release.
# setup a new test release
$ newrel -s $BFROOT/work/your_username_initial/your_username -t 14.3.2b my-14.3.2b
$ cd my-14.3.2b

# setup your path 
$ srtpath <enter> <enter>

# setup the correct condition database
$ cond14boot

# checkout the workdir package
$ addpkg workdir
$ cd workdir
$ gmake setup

Next, you must create a tcl "snippet" with your favorite options for each job you want to run. Here is an example mymoose.tcl:

# -------- mymoose.tcl: begin -----------

set ProdTclOnly              true
set RUNNUM 987655
set CONDALIAS Aug2001
set SimAppBkndInputCollection /store/SP/BkgTriggers/BkgTriggers_200108_V01
set SimAppBkndFirstEvent 1
set SimAppDigiMix true
set SimAppKanDigiMix true
set NEVENT  1000
set UDECAY PARENT/ProdDecayFiles/B0B0bar_generic.dec
set MooseHBookFile        myMoose.hbook
set MooseOutputCollection  /work/users/rahatlou/vanilla-14.3.2b/myMoose-collection
mod talk KanEventOutput
  allowDirectoryCreation set true
exit
sourceFoundFile  Moose/MooseProduction.tcl

# -------- mymoose.tcl: end -----------
As you can see the tcl snippet is quite simple, it just sets a few configuration parameters specific to a particular job you would like to run:

Moose with digi mixing disabled is not supported. Subsystem simulation algorithms use the background digi timestamp to match data taking conditions fully. Without this timestamp, a default of T-25 years is selected - however in many cases, the conditions corresponding to T-25 years are simply a default and will not resemble realistic detector conditions.

The location of the output collection is interpreted in the new event store and corresponds to a physical location. If you are not familiar with this, you should look at the documentation for KanUserAdmin.

You are now ready to run:

$ MooseApp mymoose.tcl

After the successful completion of your job you can check on your collection by using the KanUserAdmin and KanCollUtil utilities.

$ KanUserAdmin list /work/users/rahatlou/vanilla-14.3.2b/myMoose-collection
/work/users/rahatlou/vanilla-14.3.2b/myMoose-collection

$ KanCollUtil  /work/users/rahatlou/vanilla-14.3.2b/myMoose-collection
/work/users/rahatlou/vanilla-14.3.2b/myMoose-collection (1000 events)

See the section about utility programs for more details about inspecting the content of the output collection.

You can now use the output collection /work/users/rahatlou/vanilla-14.3.2b/myMoose-collection to run your analysis jobs.

Other Notes

Where can I find the other tcl options for MooseApp?

All the options are described in Moose/MooseProduction.tcl . You can easily look at the description by doing
$ grep ";#" ~/reco/cand14.4.2-14.4.1a/Moose/MooseProduction.tcl 
FwkCfgVar MooseVerbose ;# set the ErrLoggingLevel level
FwkCfgVarRequire RUNNUM      ;# runnumber used to initialize the random numbers
FwkCfgVarRequire NEVENT      ;# number of events to generate
FwkCfgVarRequire CONDALIAS   ;# data taking month, e.g. Nov2002
These are release dependent. You can also use the web interface to the CVS repository to look up Moose/MooseProduction.tcl .