How to Make Use of Kanga Index Collections
What is an index collection?
A Kanga index collection is a file containing a set of pointers to events
which themselves reside in other Kanga event files. Index collections can
be used to skim the Kanga allevents collections (in analogy to objectivity
skims). Index collections are available since analysis-7.
How to write an index collection?
Set up a tag or micro filter job as usual. Then edit your AppUserBuild.cc
and add the following line in the constructor function of AppUserBuild:
add( new RooSkimOutputModule ( "RooSkimOutputModule", "Write
an index collection.") );
Now hook up this module in your tcl path. If you are using myAnalsys.tcl
you would need to add the following:
sequence append MyAnalysis RooSkimOutputModule
The default name for the index collection file is default-skim.root.
You can change the name by talking to RooSkimOutputModule:
mod talk RooSkimOutputModule
filename set mySelection-skim.root
exit
Note: The file name must end with -skim.root !
How to use an index collection as input to a Beta job?
Add the collection to your RooEventInput in the same way as a regular Kanga
file:
mod talk RooEventInput
input add ~/mySelection1-skim
input add ~/mySelection2-skim
input add ~/mySelection3-skim
exit
Note: The file names must include the extension "-skim" but not
".root".
Utilities
The Kanga event store usually contains only the latest reprocessing of
each event. This means that superceded data will be deleted after some
period of time. The RooSkimUtil utility allows one to check if all Kanga
files which are referenced by an index collection still exist. You should
run this utility before running your Beta job to make sure that your jobs
will succeed.
The syntax for doing this is
RooSkimUtil -c ~/mySelection*-skim.root
The example illustrates that one can use wildcards or pass several files
to the utility. The result will be a list of missing kanga files.
If all files are present the result will be empty. The utility offers some
more functionality. RooSkimUtil -h displays the following:
Utility for Inspecting and Manipulating Kanga Index
Collections
USAGE
RooSkimUtil <options> <list of files>
<list of files> can be kanga index collections
or tcl files (which follow the standard
syntax for adding kanga index collections
to a RooEventInput module).
OPTIONS
-b specify a base directory name (used
with option -c). Default is $BFROOT/kanga/EventStore.
-c print a list of missing kanga files
(prints nothing if all are present)
-e print the event id for all events
-h display this help text
-k print the names of all kanga files
which are referred to by the specified index collection(s)
-m merge index collections; >=3 arguments
required:
the name of the new
merged collection first
-n print the total number of events
in the specified index collection(s)
-p print all contents of index collection(s)
in ascii format
-v display this utilitie's version number
This page is maintained by Leif Wilden.
Last significant update August 14 2000.
|