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

Elf: BaBar Event Reconstruction Application



Last Updated: 29 April 2004
Shahram Rahatlou, UC San Diego

Purpose

This is the application used to reconstruct the events recorded in IR-2 with the online system.

Input

The output of the online system is stored in the xtc files which are used as input to run Elf.

Output

The output of the reconstruction are charged tracks and neutral particles that are then used to perform physics analysis. The output of Elf is by default a root file. You can still (for test purposes) store the output as a collection in objectivity, but this requires some modification of the default tcl parameters.

Requirements

  1. A working production release. Check the recoCommon-hn forum for the latest recommended release.
  2. The xtc file for a run. These are usually in /nfs/farm/babar/tcfiles.
  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

# stage the xtc file for the run your interested.
$ tcstage 0020029-001
Fetching runs-0020000/babar-0020029-001.xtc from HPSS thru tcstage ...
File /nfs/babar/tcfiles/babar-0020029-001.xtc staged from HPSS

You can check the status of the staging queue by:

$ tcstat 

STATUS ON SERVER tcstage
Total clients:    0             HPSS clients:    0

DATE TIME   USER        NODE         CLIENT#  STATUS   FILE
so in this case there is no pending request and you will get the xtc file fairly quickly.

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

# -------- myelf.tcl: begin -----------

set ElfConfigPatchSet        Run2
set ElfHistoFileName         myElf.hbook
set ElfOutputCollection      /work/users/rahatlou/vanilla-14.3.2b/myelf-collection
sourceFoundFile  Elf/ElfProduction.tcl

# -------- myelf.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 is documented in Elf/ElfProduction.tcl which is always kept up to date.

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:

$ ElfUserXtcApp -n 1000 -s 178 -f /nfs/farm/babar/tcfiles/babar-0020029-001.xtc myelf.tcl

where the command line options are:

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/myelf-collection
/work/users/rahatlou/vanilla-14.3.2b/myelf-collection

$ KanCollUtil  /work/users/rahatlou/vanilla-14.3.2b/myelf-collection
/work/users/rahatlou/vanilla-14.3.2b/myelf-collection (xxxxx 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/myelf-collection to run your analysis jobs.

Other Notes

Where do I find the all the available tcl variables?

They are described in Elf/ElfProduction.tcl which is always kept up-to-date. In order to make the lookup easier, we have used ";#" to comment the description in the header. So you can simply do:
$ grep ";#" $BFDIST/releases/14.3.2b/Elf/ElfProduction.tcl
set ProdTclOnly true          ;# Disable the use of env. variables with the FwkCfgVar
FwkCfgVar ElfConfigPatchSet   ;# Name of the config patch set to apply.
                              ;# Choices are listed in the README file.
FwkCfgVar ElfPromptCalib      ;# Can be set to one of:
                              ;# PromptCalib   : To pass 1
                              ;# Default       : To pass 2 
                              ;# noPromptCalib : Configure for the old rolling
                              ;#                  calibrations
                              ;# If not set it will default to "Default"
 ...

The comments fit in 80 columns to make it easy to visualize on a standard terminal. You can also look up Elf/ElfProduction.tcl via the web interface to the CVS repository.

How can I make collections for random background triggers?

In your myelf.tcl you need to add
set ElfBkgRawOutputCollection /work/users/rahatlou/vanilla-14.3.2b/myBkgTriggers-collection

How can I make collections for the calibration stream?

In your myelf.tcl you need to add
set ElfCalibOutputCollection   /work/users/rahatlou/vanilla-14.3.2b/myCalibStream-collection
Providing the name of the output calibration collection also turns on the output.