Utility for Production data

This page provide useful information of analyzing production data.

Peter Cooper created a directory fn781f:/spool11/prod/work/pass/strip8b/ntu and the following README file.

                                                              09-Dec-1997  psc

This directory contains the tools to process ftuple files and some ntuple files
already produced from the present ftuples.  The general tool for processing 
ftuples is ftup_select.  This Fortran program reads a list of ftuple files
from the command line, opens each file in turn and selects for output to 
ntuple and/or ftuple files a selected set of reconstructions from the input 
files.  Selection by reconstruction id is possible from the command line.  More 
complicated selection criteria require you to edit and link a new version of
the ftup_select.F.  A short script is provided for this (link_ftup_select).

The ntuple files here are for general use.  Feel free to search and sort these
until you need larger samples and tigher criteria.  Then see below for how to
make you own reconstruction selections from the ftuples.


       ftup_select <-n ntup_file> <-f ftup_file> 
                   <-l id lower limit> <-u id upper limit>


This is the "ntup_make" script which produced the ntuple (*.ntu) files found 
in this directory.  

ftup_select  -l 100 -u 103 -n d0.ntu       ftup1/*/* >/dev/null
ftup_select  -l 200 -u 201 -n d+.ntu       ftup1/*/* >/dev/null
ftup_select  -l 202 -u 205 -n dstar.ntu    ftup0/*/* >/dev/null
ftup_select  -l 300 -u 301 -n ds+.ntu      ftup1/*/* >/dev/null
ftup_select  -l 400 -u 401 -n lc+.ntu      ftup2/*/* >/dev/null
ftup_select  -l 600 -u 601 -n xc.ntu       ftup2/*/* >/dev/null
ftup_select  -l   1 -u   3 -n strange.ntu  ftup4/*/* >/dev/null


   ftup_select  -l 100 -u 103 -n d0.ntu       ftup1/*/* >/dev/null

   writes all reconstructions with id>=100 .and. id<=103 from the ftup1 files
   to the ntuple d0.ntu.  

   ftup1, etc. are links in this directory to the direcotry which contains all 
   the ftup1 files.  The shell construction ftup1/*/* produces a list of all
   the files beneath the ftup1 directory.

   The time to run this script on the 14.7M event sample of strip8b on fn78f 
   was:   real 6:08.65  user 1:05.92  sys  48.84

dstar_select is a version of ftup_select which requires L/sigma>5.  The source 
for this version is in dstar_select.F

*Output streams, recdf tables, etc:

The recdf table for these data is included in this directory.  The first five
bits of the "out" field determines how reconstructions are routed to ftuple 
streams 0-5.  When writting ntuples ftup_select assigns ntuple numbers to each 
reconstruction [110-5] in the same way as was done by soap.  e.g.  mesons end 
up in 111, baryons in 112, etc.  The quick summary is:

   stream   name     ntu_id   file_link    comments
     0      default   110     ftup0/*/*    all recon's not written elsewhere
     1      meson     111     ftup1/*/*    D0, D+, Ds+ and friends
     2      baryon    112     ftup2/*/*    Lc+, Xc+, Xc0, Oc0 and friends
     3      exotic    113     ftup3/*/*    u, penta-quark, etc.
     4      strange   114     ftup4/*/*    K0s, Lambda, anti-lambda, Phi, Psi
     5      semilept  115     ftup5/*/*    semi-leptonics with e+

*Making a user specicifed selections:

0. setup -d off781    ! to have $OFF781_INC/recon_ntuple.inc and CERNLIB

1. copy files from here to your directory.

2. edit your ftup_select.F  - see dstar_select.F here as an example.  All
   ntuple variables have the same names in Fortran as they have in paw
   (via: $OFF781_INC/recon_ntuple.inc) 

3. link_ftup_select   ! compile - repeat 2/3 until no errors

4. make a link to the ftup files you need (like done here). e.g.

   ln -s -f /spool11/prod/work/pass/strip8b/ftp1/ ftup1

5. run ftup_select. id limits will still work; default is none.  e.g.

   ftup_select  -n my.ntu  ftup1/*/* ! make my selection from the meson ftuples

   Each file opened is echoed with number of reconstructions read and written.
   Read errors are noted.  The file with the read error is closed and the next
   file opened.

6. To check distributions for all ntuple variables and a few calculated variables
   with some 'reasonable' cuts you may use sample kumac lambdac_gen.kumac

7. To make full printout for a few (5) events from ntuple starting from any 
   event (1) you may use command

   nt/loop 112 prin_ntu.f(1) 5 1