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

Using KanAccess

The KanAccess utility provides the mapping from logical file names (LFNs) to physical file names (PFNs) for CM2 data. The KanCollUtil utility can be used to determine the LFNs (and PFNs) for a given collection.

This utility is not generally needed by the average user. It is used instead behind the scenes by some other tools and by some production scripts. It is documented here, however, for completeness.

You should find KanAccess as part of the release. For example if your test release is based on 14.3.1
   myrel/workdir> which KanAccess

   /afs/slac.stanford.edu/g/babar/dist/releases/14.3.1/bin/Linux24RH72_i386_gcc2953/KanAccess

   myrel/workdir>
otherwise, you can make KanAccess by checking out the KanUtils package and linking it.

Usage

   KanAccess lfn1 ..... lfnN

Available Options for KanAccess:
    Default   -h


Usage options

Default behavior

KanAccess expects no options, simply a list of LFNs. For example, after using KanCollUtil to determine that the LFN root://kanolb-a:1094///store/PR/R12/AllEvents/0002/14/12.3.4e/AllEvents_00021439_12.3.4eV00_C14.2.0bV00.01.root is one of the LFNs for the collection /store/PR/R12/AllEvents/0002/14/12.3.4e/AllEvents_00021439_12.3.4eV00_C14.2.0bV00. Then the corresponding PFN can be determined simply:
   myrel/workdir> KanCollUtil -L /store/PR/R12/AllEvents/0002/14/12.3.4e/AllEvents_00021439_12.3.4eV00_C14.2.0bV00

   /store/PR/R12/AllEvents/0002/14/12.3.4e/AllEvents_00021439_12.3.4eV00_C14.2.0bV00 (286908 events)
      LFN 000  /store/PR/R12/AllEvents/0002/14/12.3.4e/AllEvents_00021439_12.3.4eV00_C14.2.0bV00.01.root (owned)
      LFN 001  /store/PR/R12/AllEvents/0002/14/12.3.4e/AllEvents_00021439_12.3.4eV00_C14.2.0bV00.02E.root (owned)

   myrel/workdir> KanAccess /store/PR/R12/AllEvents/0002/14/12.3.4e/AllEvents_00021439_12.3.4eV00_C14.2.0bV00.01.root

   root://kanolb-a:1094///store/PR/R12/AllEvents/0002/14/12.3.4e/AllEvents_00021439_12.3.4eV00_C14.2.0bV00.01.root

Option: -h

There is also command line help available to see the most up to date set of options.
   myrel/workdir> KanAccess -h

Adding KanAccess to your test release

From your test release, check out the KanUtils package. For example, if your test release is based on the 14.3.1 release:
   myrel> addpkg KanUtils

   Offline Release 14.3.1 uses KanUtils version V00-03-09, will check that out
   cvs checkout: Updating KanUtils
   U KanUtils/GNUmakefile
   U KanUtils/KanAccess.cc
   U KanUtils/KanBbrRoot.cc
   U KanUtils/KanBbrRoot.hh
   U KanUtils/KanBkgrConverter.tcl
   U KanUtils/KanCollUtil.cc
   U KanUtils/KanCopyUtil.cc
   U KanUtils/KanFileUtil.cc
   U KanUtils/KanFrameApp.cc
   U KanUtils/KanFromBdbConverter.tcl
   U KanUtils/KanMergeCollections.tcl
   U KanUtils/KanRepairFromBdb.tcl
   U KanUtils/KanUtils.cc
   U KanUtils/KanUtils.hh
   U KanUtils/KanUtilsProcs.tcl
   U KanUtils/README
   U KanUtils/bin_KanAccess.mk
   U KanUtils/bin_KanCollUtil.mk
   U KanUtils/bin_KanCopyUtil.mk
   U KanUtils/bin_KanFileUtil.mk
   U KanUtils/bin_KanFrameApp.mk
   U KanUtils/bin_KanUtils.mk
   U KanUtils/binlist
   U KanUtils/link_KanUtils.mk
   U KanUtils/mergeExample.tcl
   U KanUtils/mergePRExample.tcl
   GNU Make version 3.79.1,
   Build OPTIONS = Linux24RH72_i386_gcc2953-Debug-native-Objy-Optimize-Fastbuild-Ldlink2-SkipSlaclog-Static-Lstatic
   Linux noric11 2.4.20-28slac2.7smp #1 SMP Wed Jan 21 23:01:23 PST 2004 i686 unknown  [uname -a]
   -> installdirs:

   myrel>
Then build the executable
   myrel> gmake KanUtils.KanAccess

   GNU Make version 3.79.1,
   Build OPTIONS = Linux24RH72_i386_gcc2953-Debug-native-Objy-Optimize-Fastbuild-Ldlink2-SkipSlaclog-Static-Lstatic
   Linux noric11 2.4.20-28slac2.7smp #1 SMP Wed Jan 21 23:01:23 PST 2004 i686 unknown  [uname -a]
   -> KanUtils.KanAccess:   (Sat Feb  7 10:13:35 PST 2004)
   Making KanUtils.d [cc1]
   Making KanBbrRoot.d [cc1]
   Making KanFrameApp.d [cc3]
   Making KanAccess.d [cc3]
   Making KanCopyUtil.d [cc3]
   Making KanCollUtil.d [cc3]
   Making KanFileUtil.d [cc3]
   Compiling KanBbrRoot.cc [libKanUtils.a] [cc-1]
   Compiling KanUtils.cc [libKanUtils.a] [cc-1]
   Compiling KanAccess.cc [KanAccess.o] [cc-3]
   Linking KanAccess in KanUtils [link-1]
   /afs/.slac.stanford.edu/package/gcc/i386_linux22/gcc-2.95.3/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libg2c.a(open.o): In function `f_open':
   /u/sf/bartelt/RWPackage/gcc/build/gcc-2.95.3/i686-pc-linux-gnu/libf2c/libI77/../../../../../src/gcc-2.95.3/libf2c/libI77/open.c:213: the use of `tempnam' is dangerous, better use `mkstemp'

   myrel>
then you should see it under your bin directory
   myrel/workdir> which KanAccess

   ./bin/Linux24RH72_i386_gcc2953/KanAccess

   myrel/workdir>