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

SkimMiniApp: BaBar Skimming Application

Last Updated: 3 May 2004
Shahram Rahatlou, UC San Diego


Purpose

Make skim collections by filtering on the tagbits. Optionally write user configured (and skim-specific) lists of composite candidates as well as user data to the skim output.

Input

You can run on an existing data or MC collection produced with Elf, Moose, or another SkimMiniApp job.

Output

A collection in the CM2 eventstore.

Requirements

  1. A working production release. Check the SkimTaskForce-hn forum for the latest recommended release.
  2. A collection for data or MC events
  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 myskim.tcl:

# -------- myskim.tcl: begin -----------

set SkimNEvent 1000
set SkimsToRun all
set SkimsToWrite none
set SkimOutputDir /work/users/rahatlou/vanilla-14.3.2b/skim-test
#set SkimMC yes
set SkimInputCollection /store/PR/R14/AllEvents/0004/24/14.3.2/AllEvents_00042488_14.3.2V00
sourceFoundFile SkimMini/SkimMiniProduction.tcl

# -------- myskim.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:

The full list of available options (and most up-to-date documentation of them) can be found in SkimMini/SkimMiniProduction.tcl.

The input collection and the output directory for the skim collections are interpreted in the new eventstore. For example:

$ KanCollUtil  /store/PR/R14/AllEvents/0004/24/14.3.2/AllEvents_00042488_14.3.2V00
/store/PR/R14/AllEvents/0004/24/14.3.2/AllEvents_00042488_14.3.2V00 (115831 events)
If you are not familiar with this, you should look at the documentation in the section on tools and utilities.

You are now ready to run:

$ SkimMiniApp myskim.tcl

After successfully finishing your job you can find the output skim collections as:

$ KanUserAdmin list /work/users/rahatlou/vanilla-14.3.2b/skim-test | head
/work/users/rahatlou/vanilla-14.3.2b/skim-test/A0Kan
/work/users/rahatlou/vanilla-14.3.2b/skim-test/AllEventsKan
/work/users/rahatlou/vanilla-14.3.2b/skim-test/B0DKNeutKan
/work/users/rahatlou/vanilla-14.3.2b/skim-test/B0ToD0KPiKan
/work/users/rahatlou/vanilla-14.3.2b/skim-test/B0ToDsDsKan

$ KanCollUtil /work/users/rahatlou/vanilla-14.3.2b/skim-tes/AllEventsKan
/work/users/rahatlou/vanilla-14.3.2b/skim-test/AllEventsKan (1966 events)

Other Notes

Where can I find the name of the available skims?

All the current skims are defined in FilterTools/defineMiniSkims.tcl
$ grep "declareMiniSkim" $BFDIST/releases/14.3.2b/FilterTools/defineMiniSkims.tcl | head
# Valid choices for the 3rd and 4th arguments to declareMiniSkim
declareMiniSkim AllEvents           KanGA/AllEvents           tagOnly         tagOnly
declareMiniSkim AlignCal            Tracking/AlignCal         noOutput        noOutput
declareMiniSkim PreVeto             Tracking/PreVeto          deepCopyMicro   deepCopyMicro
declareMiniSkim BPCBhabha           PID/BPCBhabha             deepCopyMicro   deepCopyMicro
declareMiniSkim BPCKaon             PID/BPCKaon               deepCopyMicro   deepCopyMicro
declareMiniSkim BPCKLong            PID/BPCKLong              deepCopyMicro   deepCopyMicro
declareMiniSkim BPCMuon             PID/BPCMuon               deepCopyMicro   deepCopyMicro
declareMiniSkim BPCProton           PID/BPCProton             deepCopyMicro   deepCopyMicro
declareMiniSkim BPCElectron         PID/BPCElectron           deepCopyMicro   deepCopyMicro

NB: for skims in specific releases you should look up this file in that release, as the definitions change as a function of time!

Where can I find all the tcl options for SkimMiniApp?

All the options are defined in SkimMini/SkimMiniProduction.tcl

You can look at the descriptions by easily parsing the tcl file as:

$ grep ";#" $BFDIST/releases/14.3.2b/SkimMini/SkimMiniProduction.tcl | head
FwkCfgVar SkimMC                 ;# Set this to skim MC
FwkCfgVar SkimFromBdb            ;# Set this to skim Bdb
FwkCfgVar SkimFromKan            ;# Set this to skim Kanga (default: will 
                                 ;#   eventually disappear)
FwkCfgVar SkimInputCollection    ;# Specify a single input collection to use

The comments fit in 80 columns to make it easy to visualize on a standard terminal. You can also use the web interface to the CVS repository to look at SkimMini/SkimMiniProduction.tcl.