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 KanCopyUtil

The KanCopyUtil command copies and merges CM2 collections

You should find it as part of the release. For example, if your test release is based on 14.5.0:
   myrel/workdir> which KanCopyUtil

   /afs/slac.stanford.edu/g/babar/dist/releases/14.5.0/bin/Linux24RH72_i386_gcc2953/KanCollUtil

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

Usage

   myrel/workdir> KanCopyUtil [-h] -o < output > < inColl1 > [ < inColl2 > .... ] 

Available Options for KanCollUtil:
    Default   -i   -r   -z   -n   -m   -h


Usage options

Default behavior

By default, KanCopyUtil takes a list of input collections and creates a combined (or "merged") output collection. The -o option is required unless the -r option is specified. For example
   myrel/workdir> KanCopyUtil -o /work/users/lange/testKCU /work/users/lange/0401/PsiKs_nom_2000096 /work/users/lange/0401/PsiKs_nom_2000097

   < output suppressed >

    Evt: 1000
   Copied/Merged/Read 1000 events

   myrel/workdir> KanCollUtil /work/users/lange/testKCU

   /work/users/lange/testKCU (1000 events)

   /myrel/workdir>
results in the two input collections specified being merged together into a new collection: /work/users/lange/testKCU.

Option: -i

Using the -i option, the list of input collections may be given in a text file instead of on the command line. In this case the usage of KanCopyUtil is
   myrel/workdir> KanCopyUtil [-h] -i < collectionList.txt > -o < output >

Option: -r

With the -r option, KanCopyUtil will only read the input collections, no output collection will be created. This can test if any of your input collections are corrupted or have other problems

Option: -z

Change the default root compression level. Valid levels are integers between 0 (no compression) to 9.

Option: -n

To specify the number of events to read in from the input collections, use the -n option. By default all events are read in.

Option: -m

The -m option sets the maximum file size, before a new file is created. The default rollover size is 1.8 GB.

Option: -h

There is also command line help available to see the most up to date set of options. Try 'KanCopyUtil -h' to see this output.

Adding KanCollUtil to your test release

From your test release, check out the KanUtils package. For example, if your test release is based on 14.5.0, you will see
   myrel> addpkg KanUtils

   Offline Release 14.5.0 uses KanUtils version V01-01-01, 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/KanFileLocater.cc
   U KanUtils/KanFileLocater.hh
   U KanUtils/KanFileUtil.cc
   U KanUtils/KanFrameApp.cc
   U KanUtils/KanFromBdbConverter.tcl
   U KanUtils/KanMergeCollections.tcl
   U KanUtils/KanRecover.cc
   U KanUtils/KanRepairFromBdb.tcl
   U KanUtils/KanTagCheck.cc
   U KanUtils/KanUserAdmin
   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_KanRecover.mk
   U KanUtils/bin_KanTagCheck.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 noric14 2.4.20-30HEP2.7smp #1 SMP Fri Feb 20 11:10:35 PST 2004 i686 unknown  [uname -a]
   [Warning]: ./bin/Linux24RH72_i386_gcc2953 (and/or) /afs/slac.stanford.edu/g/babar/dist/releases/14.5.0/bin/Linux24RH72_i386_gcc2953 is not in PATH, type 'srtpath' to fix PATH.
   -> installdirs:

   myrel>
then,
   myrel> gmake KanUtils.KanCopyUtil

   This release based on 14.5.0, overriding BFCURRENT value of current
   GNU Make version 3.79.1,
   Build OPTIONS = Linux24RH72_i386_gcc2953-Debug-native-Objy-Optimize-Fastbuild-Ldlink2-SkipSlaclog-Static-Lstatic
   Linux noric14 2.4.20-30HEP2.7smp #1 SMP Fri Feb 20 11:10:35 PST 2004 i686 unknown  [uname -a]
   [Warning]: ./bin/Linux24RH72_i386_gcc2953 (and/or) /afs/slac.stanford.edu/g/babar/dist/releases/14.5.0/bin/Linux24RH72_i386_gcc2953 is not in PATH, type 'srtpath' to fix PATH.
   -> KanUtils.KanCopyUtil:   (Sat Apr 10 13:35:19 PDT 2004)
   Making KanUtils.d [cc1]
   Making KanFileLocater.d [cc1]
   Making KanBbrRoot.d [cc1]
   Making KanTagCheck.d [cc3]
   Making KanFrameApp.d [cc3]
   Making KanRecover.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 KanFileLocater.cc [libKanUtils.a] [cc-1]
   Compiling KanUtils.cc [libKanUtils.a] [cc-1]
   Compiling KanCopyUtil.cc [KanCopyUtil.o] [cc-3]
   Linking KanCopyUtil 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 KanCopyUtil

   ./bin/Linux24RH72_i386_gcc2953/KanCopyUtil

   myrel/workdir>