Kanga Tutorial - PowerPoint PPT Presentation

1 / 59
About This Presentation
Title:

Kanga Tutorial

Description:

An brief overview of the Kanga world. Going from skims to plots in less ... Writing macros and using 'handles' to access data. Configuring your own Kanga data ... – PowerPoint PPT presentation

Number of Views:132
Avg rating:3.0/5.0
Slides: 60
Provided by: tri5140
Category:
Tags: kanga | macros | tutorial

less

Transcript and Presenter's Notes

Title: Kanga Tutorial


1
Kanga Tutorial
  • A little bit about how it works and and a lot
    about what it can do for you

SLAC 12/09/04
2
An brief overview of the Kanga world
  • Going from skims to plots in less that an hour
  • Finding out what we have how to browse our data
  • Running Kanga, reading data and making plots
  • A tour of a Kanga collection
  • More advanced access to Kanga data
  • Access to conditions database
  • Available data for testing/ development
  • Writing macros and using handles to access data
  • Configuring your own Kanga data
  • Writing user data
  • Configuring the candidates branches
  • Building your own Kanga-based analysis
  • Compiling, linking and running your own software
  • Status, Overview and Whisky Challenges

3
What is Kanga all about
Since when do Kangaroos wear blue
sweatshirts? For that matter, since when do
elephants wear green trousers?
4
From skims to plots in less that an hour
  • Kanga allows you to have direct access to the
    data
  • Much (up to 100-fold) faster
  • no need to build (and refit calibrate) objects
  • only read the data you need, ignore the rest

Chung Khim Lae made this plot directly from ALL
the Run 1-3 skim output in 30 minutes with a
simple Kanga-based program
5
Using Kanga to Browse the Data
  • You can treat the Kanga files as your N-tuples
  • For objects you can plot functions, just like in
    ROOT
  • Draw(Candidate.E())
  • Draw(Candidate.p4().Pt())
  • You can follow references between objects
  • Draw(Candidate.dau(0)-gtE())

input-gtDraw(Cnd_ChargedTracks__n)
input-gtDraw(Cnd_BToD.obj()-gtp4().Theta())
6
You are already using Kanga
  • Kanga works by running directly on the stored
    data
  • It uses exactly the same data as Beta/Framework
  • It also uses exactly the same functions to access
    the data
  • So Kanga is exactly the official data
  • If you see differences between Kanga and your
    ntuples
  • Make sure that the functions you are using are
    the correct ones
  • Make sure that you are really looking at the same
    thing
  • Subtleties about when calibration/ re-fitting is
    done in cache and refit modes
  • Look for bugs in your ntuples
  • Even if you have already used it for years, there
    might be some problems you never probed
  • During testing/ development almost all of the
    problems people reported were in the test
    program, not in Kanga

7
Introduction and Brief Tour of Kanga World
Kanga
Roo
8
Running Kanga
  • Kanga is a standalone program based on ROOT
  • It is built as part of the release (use 16.0.2 or
    later)
  • noric05 srtpath ltretgt ltretgt
  • noric05 cd workdir
  • must run from workdir to get access to PDT table
  • noric05 Kanga
  • You will get a few lines of info and the ROOT
    prompt
  • You can use tab completion to verify that all the
    BaBar classes have been loaded
  • root0 Btalttabgt
  • should print a long list of all the classes that
    start with Bta

9
Reading Kanga data with KanEventSource
  • The first thing to do make a class to read your
    data
  • root0 KanEventSource input
    KanEventSourceminiMC()
  • This builds and configure an object to read data
  • various configurations are possible
  • mini() // all reconstruction data
  • miniMC() // mini MC truth
  • micro() // only high level reconstruction
    data
  • microMC() // micro MC truth
  • it doesnt matter if you pick the wrong one
  • missing stuff will just get turned off
  • Then add some collections to the KanEventSource
  • root1 input-gtAdd(/a/collection/name)
  • root2 input-gtAdd(/a/collection/name2)
  • KanEventSource is a sub-class of TTree
  • All the same functions exist, though some of them
    might be less useful
  • For example, using TBrowser GUI with Kanga data
    is probably silly

10
Drawing from a KanEventSource
  • Before you plot any data, you need to link up the
    various components in your KanEventSource
  • root3 input-gtsetupFriends()
  • Then you can work away to your hearts content
  • root4 input-gtDraw(Cnd_ChargedTrack__n)
  • Plotting a simple number
  • root5 input-gtDraw(Tag.floatVal(\R2\))
  • Plotting a tag value by name
  • root6 input-gtDraw(Cnd_B0.p4()-gtTheta())
  • Following a local reference
  • root7 input-gtDraw(Cnd_Pion.trk()-gtnSvt())
  • Following a reference between two files
  • To plot any quantity you need two pieces of
    information
  • The name of the Branch (location of the data)
  • The name of the function you want to call
  • If you know the type of object, you can get a
    list of all its functions

11
Some of the things that you can do in Kanga
Plotting User Data
Projecting against basic detector data
Data v. MC comparison
12
A Tour of Kanga Data
  • There are about 60 types of objects in the
    Micro data
  • Data from all systems, tracking, PID, Beta, Tag
    and Trigger
  • Summarized in a table on the web
  • http//www.slac.stanford.edu/echarles/Kanga/data_
    classes.html
  • These objects have functions to access the data
    for you
  • All the functions are tested and sample plots are
    available
  • http//www.slac.stanford.edu/echarles/Kanga/Refer
    ence/Funcs.html
  • The next 23 slides show everything in Kanga
  • All the plots were made straight from ROOT
  • Starting with more basic objects and working our
    way up
  • Event Stuff and Tag bits
  • Monte Carlo Truth from GEANT
  • Reconstruction objects (Tracks and clusters)
  • Particle ID data (dE/dx, Qc, likelihoods)
  • Beta Candidates
  • User Data

13
Event Header and Event ID
Class KanEvtIDI Branch hdr__Eid BkgEid
run number
Just the event ID (EID) and the EID of the
mixed-in background event for MC
Functions UInt_t platform() UInt_t
partitionMask() UInt_t timeStamp_u() UInt_t
timeStamp_l() UInt_t run() UInt_t
bdbTimeGmtSec() UInt_t bdbTimeGmtNSec() UInt_t
configKey() void print()
print() is useful to get lists of event
ids prints the EID same format as EvtCounter
module
14
Tag Data
Class TagEventTagK Branch Tag
RecoBGFilter
All of the tag data are accessible from the Tag
branch
Also, there are some functions to explore and
manage the tag database. Things like
asking which tag bits exist.
R2
Functions bool boolVal(const char name) int
intVal(const char name) float floatVal(const
char name)
use \ in Draw. For example
Draw(Tag.floatVal(\R2\))
15
GEANT (Monte Carlo Truth) Data GTrack
Class GTrackI Branch G4_Tracks
pz
This is the GEANT truth particle table
Functions int pdtEntry() float px() float
py() float pz() float e() GVertexI
parentVertex() GVertexI terminalVertex()
GTrackI parentTrack()
You can use parentVertex(), terminalVertex() and
parentTrack() to navigate
16
GEANT Data GVertex
Class TrkRepI Branch Trk_Reps
These are the decay points of all the GEANT
particles
Functions float x() float y() float z() float
tof() int cause() GTrackI parentTrack()
You can use parentTrack() to navigate
17
Micro (aod) Data
  • The micro (or aod) contains the high-level
    reconstruction data
  • Tracks, Emc and Ifr Clusters used to make
    BtaCandidates
  • But individual hits (Svt/Drc/Dch) are in esd
    (mini)
  • Particle identification summary information
  • Svt, Dch dE/dx data
  • Drc qc and likelihoods/ consistencies
  • EmcTrack-cluster match data
  • Ifr Cluster summary data muon likelihood
  • Truth matching
  • G-Hit-bases match map from reco to GEANT objects

18
Tracking Data Tracks
Class TrkRecoTrkI Branch Trk_Tracks
endFoundRange
The tracks are mainly holders, they know about
the number of hits, and various Kalman fits
Functions int nActive() int nDch() int
nSvt() int firstDchLayer() int
lastDchLayer() int svtView(int layer) float
startFoundRange() float endFoundRange()
TrkSimpTrajI seedTrajectory() TrkRepI
trackRep(int pid)
nDch
nSvt
Pointers to the trajectory fit result
19
Tracking Data Reps (Fits Results)
Class TrkRepI Branch Trk_Reps
momentum pT
The Reps are the interface between the helix
parameters and the tracks
prob(c2)
Functions int pidType() float chisqProb() bool
fitValid() bool fitCurrent() int
fitSuccess() int charge() TVector3 momentum()
charge() and momentum() use the conditions
database to get the B field. You need to run
Kanga with the -s Trk option.
20
Tracking Data Helix Trajectories
Class TrkSimpTrajI Branch Trk_Trajs
The trajs are the actual helix parameters
Functions float flightRangeStart() float
flightRangeStop() float flightLength() int
nParameters() float d0() float z0() float
phi0() float omega() float tanDip()
21
EMC Data Digis
Class EmcDigiI Branch Emc_Digis
energy
The Emc Digis are the raw Emc crystal data
Since we have access to the Emc conditions we
should be able to return the calibrated
values Need some input from EMC about this
Functions int energy() int time() int
theta() int phi() int calibIdx()
Q
f
calibIdx is always 1 as only 1 calibration is
ever used
22
EMC Data Clusters and Bumps
Class EmcBumpiI EmcClusterI Branch
Emc_001_SingleBumps Emc_001_MultiBumps
Emc_001_Clusters
Functions int nDigis() EmcDigiI digi(iDigi)
int nSharedDigis() EmcDigiI sharedDigi(iDigi)
float weight(iDigi) int nUnSharedDigis()
EmcDigiI unSharedDigi(iDigi) EmcClusterI
cluster() int nBumps()
23
EMC Data Candidates
Class EmcBumpiI EmcClusterI Branch
Emc_001_SingleBumps Emc_001_MultiBumps
Emc_001_Clusters
EmcCand
This is a place where we would put in some more
useful forms of access. p4() p3() energy()
Trk
Cluster
Bump
Functions TrkRecoTrkI track() EmcClusterI
cluster() EmcBumpI bump()
24
IFR Data Digis
Class IfrAbs1DI Branch Ifr_Abs1Ds
The IfrAbs1D are the raw IFR RPC data
Since we have access to the Ifr conditions we
should be able to return the calibrated
values Need some input from IFR about this
Functions int strip() int view() int
layer() int sector() int strips()
25
IFR Data Clusters
Class IfrAbs3DI BranchIfr_Abs3Ds
This is also a place where we could add access to
information about p4() really only direction()
as the IFR has no energy sensitivity
Functions int nDigis() IfrAbs1D digi(iDigi)
26
SVT PID Data
Class SvtPidInfoI Branch Pid_SvtPids
These are the calibrated Svt PID data It has not
been used to calculate the likelihood or
consistency for any particle hypothesis
Functions float getMeanDedx() float
momentum() int getNPoints()
27
DCH PID Data
Class DchPidInfoI Branch Pid_DchPids
These are the calibrated Dch PID data It has not
been used to calculate the likelihood or
consistency for any particle hypothesis
Functions float dedx() float dedxErr() float
momentum() int nSample() int
algorithmID() int nHypos()
The DCH only uses 1 algorithm and always uses the
pion fit to get the flight length, so these last
two functions are trivial
28
DRC PID Data
Class DrcPidInfoI Branch Pid_DrcPids
These are the calibrated Drc PID data These data
also include the consistencies for various
hypotheses
Functions float thetaC() float thetaCErr() float
momentum() int nHit() int nBkg() float
nExPhotons(pid) float likelihood(pid) float
consistency(pid)
The number of expected photons and the
consistencies depend on which particle hypothesis
you consider
29
IFR PID Data
Class IfrPidInfoI Branch Pid_IfrPids
expectedX0
Functions float interactionLengths() float
interactionLengthsBeforeIron() float chiSqPdof()
float expectedInteractionLengths() float
rpcMuonProbability() float expectLayers() float
cLikelihood() float deltaLambdaPrime() float
matchQuality()
X0BeforeIron
matchQuality() is deprecated and always returns 0.
30
GEANT-Based Truth Matching Data
Class RecoCompGMatchI Branch Reco_TrkRecoTrks
Reco_EmcCands_001 Reco_IfrAbs3Ds
True px v. Reco px
The truth matching is stored as a map from reco
objects to their associated GEANT objects
A single reco object may have more that one GEANT
match
Functions Reco rObj() int nGObj() Geant
gObj(iMatch) int nComposites()
31
Candidate Data
Class BtaCandIdI Branch Cnd_ltPidgt
BtaCandIdI
p4
vtx
BtaCandidates are just holders that point you
back to the underlying data You can follow the
pointers back to any object in any of the
previous pages
Trk
Emc
Ifr
Dau1
Pid
Dau2
Functions Int_t lundID() UInt_t nDau()
TLorentzVector p4() BtaCandIdI dau(iDau)
TrkRecoTrkI trk() EmcCandI emc() IfrAbs3DI
ifr() PidInfoChargedSummaryI pid()
BtaCandVtxI decayVtx()
SvtPID
DrcPID
IfrPID
DchPID
Dau3
32
How Candidate Data are stored
The candidates themselves are sorted by type and
stored on branches
Cnd_Reco
C
Cnd_Comp
C
C
The sorting is specified by the user on a skim by
skim basis
Cnd_Pion
C
C
C
C
Cnd_Kaon
C
Any unsorted candidates end up on leftover
branches Cnd_Reco (track clusters)
Cnd_Comp (composites)
Cnd_D0
C
C
C
C
Cnd_D0_p4
p4
p4
p4
p4
p4 and vertex storage are turned on by type
Cnd_D0_vtx
vx
vx
vx
vx
Cnd_Tracks
C
C
C
C
Event lists are stored as references to the
actual candidates use obj() function to follow
reference
Cnd_Neutrals
C
Cnd_D0List
C
C
C
C
Since most intermediate lists are not stored, the
PID sorting is very important to be able to do
full analyses
33
User Data
Class UsrCandBlockK Branch ltBlockgt_ltvargt
To plot user data just use the bariable name
Draw(mES) Or Draw(BBlock_mES)
To access the candidates used the Cands
branch Draw(BBlock_cands.obj()-gtnDau())
Functions int nCands() BtaCandIdI obj()
34
How User Data are stored
Event Block data are stored as simple types
(floats, ints)
Evt_mult
I
Event Data
Evt_R2
F
B__n
I
B_cands
C
C
C
C
Each Cand Block has
B Block
B_mES
1) index of cands 2) vector of references to
the candidates 3) vector of simple types (float,
int) for each variable
F
F
F
F
B_deltaE
F
F
F
F
B_mode
I
I
I
I
I
D__n
D Block
D_cands
C
C
C
D_mass
F
F
F
D_chi2
F
F
F
35
Writing Macro and applications in Kanga
  • You can develop and share macros for Kanga in C
  • No need to force students to learn FORTRAN
  • You can re-use code from other BaBar packages
  • Macros are limited only by code development
  • With a bit of foresight you should be able to get
    rid of all your ntuples
  • Need to be careful configuring data for output
  • Which user data to store
  • How to store candidates
  • which lists to store
  • caching 4-Vector and vertex data
  • How to cluster the data
  • Easy to port macros to standalone applications
  • You can run standalone apps in batch mode

36
Basic steps to writing macros
  • Load an event source using KanEventSource
  • All you need are the collections names
  • Declare all the data you wish to access
  • You will need to know which data
  • Data locations names of branches
  • Data types types of objects you are reading
  • Do event loop
  • Inside the loop
  • Go from one event to the next
  • Read the data you need every event
  • Apply cuts, fill histograms, tables, TTrees
  • At the end of event loop
  • Do any fitting, printout, file writing

37
Interface and Persistent types
  • When reading data you need type of objects you
    want
  • All persistent classes inherit from Interface
    classes
  • The interface classes have no stored data, but
    define which functions you can call
  • All interface class names end in I (eg
    BtaCandIdI)
  • The actual data stored are defined by the
    persistent classes
  • All persistent class names end in K or K_00x
  • Different versions of the same class share the
    same interface class

You dont need to worry about this
XxxObjK
XxxObjI
Actual data storage
XxxObjK_000
virtual functions only
38
Kanga stores all its data as TTrees in ROOT files
A collection is just a set of events, and
basically the collection name is just a filename
TTrees contain the event data
TTree hdr
TTree usr
TTree esd
Different types of data are stored in
different trees
TTree tag
File Data.02E.root
TTree cnd
An event is a single entry in the various TTrees.
TTree aod
File Data.01.root
Collections in the event store start with
/store and are store in HPSS (staged tapes)
Collection Data
39
A collection can contain several components
  • hdr the event header
  • Information about the location of the other
    components
  • always in the .01.root file
  • tag the tag bit database
  • usr user data
  • Defined by the user on a skim-by-skim basis
  • cnd the Beta Candidates
  • Partially configured by the user on a
    skim-by-skim basis
  • Which lists to store, how to sort candidates by
    flavor
  • aod the micro-level data
  • High level reconstruction data (tracks, clusters,
    PID)
  • tru Monte Carlo truth
  • esd the mini-level data
  • Lower level reconstruction data (hits, digis)
  • sim and raw the raw-level data simulated
    data

User-Configured
40
Figuring out what type of objects you have
  • KanEventSourcelistComponets() shows how your
    event source is configured
  • root4 input-gtlistComponents()
  • hdr usr tag cnd aod tru
  • KanEventSourcegetXxx() and print() list all the
    branches and data types
  • root5 input-gtgetAod()-gtprint()
  • Trk_Tracks R _at_ 42 W XXX
  • KanClonesVector_IltTrkRecoTrkIgtKanMiniTrkK

Branch name
Interface class
41
BtaCandIdI is the persistent BtaCandidate
  • Some very standard access functions
  • For all candidates
  • Int_t lundID() // return the LUND code (ie
    511 for B0..)
  • TLorentzVector p4()
  • Might not have been stored, or might not be
    available
  • For composite candidates
  • These functions only access the cnd component
  • UInt_t nDau()
  • BtaCandIdI dau(UInt_t iDau)
  • For reconstruction level candidates
  • These functions require access to aod component
  • TrkRecoTrkI trk()
  • EmcClusterI emc()
  • IfrAbs3DI ifr()
  • PidInfoChargedSummaryI pid()

42
KanHandle makes it easy to access data
  • You can attach a handle to a KanEventSource
  • KanHandleltIgt aHandle(KanCompMapindex,BranchName
    )
  • Handle template is interface type
  • input-gtsetBranchToRead(aHandle) // once per job
  • input-gtLoadTree(iEvt)
  • Bool_t readOk aHandle(input)
  • I myData (aHandle)
  • The handle guarantees type safety
  • It will only attach to branch of type ltIgt
  • It will always return a pointer to an object of
    type ltIgt

Every Event
43
Some special types of handles for Candidates
  • BtaCandHandleBranch is for reading branches
  • Branches store the candidates sorted by flavor
  • Branch configuration is skim-specific
  • BtaCandHandleBranch B0(KanCompMapcnd,Cnd_B0)
  • BtaCandHandleList is for reading candidate lists
  • BtaCandHandleList myList(KanCompMapcnd,Cnd_MyLi
    st)
  • Both types of handles have two specific
    functions
  • UInt_t size() // returns the of candidates
  • BtaCandIdI cand(UInt_t i) // returns the ith
    candidates
  • Examples of how to use these in macros are in the
    KanExamples package
  • nCand.C (plots the number of cands on a given
    list)
  • nDau.C (plots the number of daughters for all
    cands on a branch)

44
Special types of handles for User Data
  • UsrCandHandle is for reading candidate user data
  • UsrCandHandle B(KanCompMapusr,B)
  • UsrVectorKltfloatgt mES B.addVect(mES,mES) //
    mES branch
  • UsrVectorKltfloatgt dE B.addVect(deltaE,dE) //
    DE branch
  • B(input) B.readIndex() // setup the block
  • dE.readBranch() mES.readBranch() // reads the
    data
  • for ( UInt_t iC 0 iC lt B.nCands() iC ) //
    loop on cands
  • hist-gtFill(mESiC,dEiC) // use operator to
    get values
  • UsrEvtHandle is for reading event user data
  • UsrEventHandle evt(KanCompMapusr,Evt)
  • UsrDatumKltintgt mult evt.addDatum(multplicity,mu
    lt)
  • evt(input) // as usual
  • hist-gtFill(mult()) // use operator() to get value

45
Special Handle for Tag Data
  • You can use the class TagHandle to read tag data
    into variables
  • TagHandle Tag // make handle
  • input-gtsetBranchToRead(Tag) // attach to source
  • Bool_t RecoBG Tag.newBool(RecoBGFilter) //
    attach bits
  • Float_t R2 Tag.newFloat(R2) // attach
    floats
  • Tag(input) // as usual
  • Tag.updateData() // copies values to local
    variables
  • if ( RecoBGF R2 gt 0.5 ) // test tag bits

46
You can configure and customize your output
  • You can cluster data so rarely used files stay on
    tape
  • You can add any user data you want
  • Store fitting variables (mES, Fischer, Dm)
  • Store quantities that are slow to calculate (EMC
    moments)
  • Configure candidate storage
  • Designed to work like standard ntuples
  • cache 4-vector and vertex position
  • separate candidates by type
  • Kanga automatically navigates between branches
    for daughters

47
Borrowing components from other collections
By borrowing the data from an underlying
collection we reduce the event size for skims
TTree hdr
TTree usr
TTree esd
TTree tag
Coll AllEvents
TTree cnd
The header tree points to trees in the underlying
collection rather that the local collection
TTree aod
Together with the ability to split data among
files, borrowing allows users to export much
smaller data set to their local sites
Coll Skim
48
Setting up you own analysis in Kanga
  • Set up your skims to select events
  • if possible add user data and candidate branch
    configuration
  • otherwise, add it during re-skim
  • Consider using borrowing in re-skim
  • Write Kanga macros and programs
  • study data, extract quantities for fitters, make
    plots
  • possible make reduced TTree to feed to RooFit
  • Make sure to keep event index back into Kanga
    collection

Skim
Fit Data
Kanga
hdr usr tag cnd aod
Re-Skim
variables event indices plots
hdr usr more vars tag more bits cnd more lists
BetaMiniApp
49
Writing your own Kanga data
  • It is easy to write Kanga data with BetaMiniApp
  • You can re-skim and add your own user data or
    change the configuration of the candidate data
  • Run you application with a short (30 lines) tcl
    file
  • example in KanExamples/reSkim.tcl
  • Use the writeMini tcl proc in BetaMiniSequences
  • writeMini Path Output Components Lists ltoptionsgt
  • Path is your path (probably Everything in
    BetaMiniApp)
  • Output is the name of the output collection
  • Components is a list (ie Tag Cnd Aod) of
    components to write
  • Components not written will be borrowed from
    the underlying collection
  • Lists is the list of Candidate list to store
  • ChargedTracks, MyB0toPiPiNuList
  • Similar tcl proc for User Data

50
Configuring SkimMiniApp
  • In your paths tcl stub (FilterTools/SkimPath.tcl)
    you can specify which candidates to store
  • the tcl variable BtaCandLists is a list of all
    the list names to store
  • global BtaCandLists
  • lappend BtaCandLists myList1
  • lappend BtaCandLists myList2
  • You can configure how the candidates are stored
  • the tcl variable CandBranches is a list of all
    the branch configurations
  • global CandBranches
  • lappend CandBranches Pion pi pi-
  • This puts all p and p- on a branch called Pion
  • Must use names exactly as in file PDT/pdt.table
  • vtx adds cached vertex data, p4 adds cached
    4-vectors
  • lappend CandBranches Dch D D- vtx p4

51
Writing standalone applications for Kanga
  • Include the stand alone header file
  • Kanga/KanFramework.hh
  • Inside your main() you need two lines
  • KanFrameworkinitStandalone() // Initialize
    ROOT
  • KanSchemalink() // Link in all the Kanga
    Classes
  • These needs to come before you do anything else
  • The function KanUtilsparseLinesFromLine() is
    useful to get a list of input collections for a
    text file
  • listltstringgt colls
  • KanUtilsparseLinesFromFile(fileName,colls)
  • for (listltstringgtiterator it colls.begin()
    it !colls.end() it)
  • input-gtAdd(it-gtc_str())

52
You can use KanCopyUtil to merge collections
  • The utility KanCopyUtil merges collections
    quickly
  • Only looks at stored data, never re-does fits
  • Very simple syntax
  • KanCopyUtil -o output ltinput1gt ltinput2gt ltinput3gt
  • KanCopyUtil -o output -i ltinput.txtgt
  • ltinput.txtgt is a text file with only input
    collection per line
  • KanCopyUtil has some options that allow you to
    configure the output
  • -k ltclusteringgt allows you to pick which
    components to put where
  • default is -k HUBCATESR
  • esd in separate file, sim/raw in other file (if
    present)
  • -k options does not copy borrowed components
  • -a option (all-in-one) is the same as -K
    HUBCATESR
  • -b ltclusteringgt allows you to copy borrowed
    components

53
Linking your own classes into Kanga
  • If none of your classes depend on Kanga (eg.
    RooFit)
  • Just use the built-in function gSystem-gtLoad() to
    load the shared library
  • If some of your classes do depend on Kanga (eg.
    analysis macros, selection functions, etc.)
  • You will have to make your own version of the
    Kanga executable
  • Kanga/KangaUser.cc is an example
  • Also need to look at Kanga/bin_KangaUser.mk and
    Kanga/GNUmakefile to get all the changes you need
  • Add all the classes you want to the function
    KanUserSchemaLink() in KangaUser.cc
  • MyClassClass() // Links in MyClass
  • Your class must have the ROOT ClassDef and
    ClassImp macros

54
Conditions Data Access from Kanga
  • It is possible to access conditions data via
    KanEnv
  • Must initialize the systems with -s ltSysgt flag
  • Emc Calibrations (not used yet)
  • Pep Pep beams and beam spot data
  • Trk B Field for Helix-4Vector conversion
  • All All of the above
  • Only Pep system makes sense for user access
  • KanEnvboostToCM(TLorentzVector v)
  • KanEnvenergyCM() // return
  • Trk ( and eventually Emc ) conditions are built
    into access functions in persistent data objects
  • TrkRepIp4(float fltlen) // return p4 _at_ a point
    along helix
  • Fail-safe, if you forget to initialize a system,
    you get a warning and null return values

55
Available Data for Testing and Development
  • I have made over 100 M events in this format from
    the BSemiExcl skim
  • Available from BbkDatasetTcl and BbkUser
  • BbkDatasetTcl -l users-echarles-14.5.3a
  • shows a list of the data sets
  • BbkUser collection --datasetusers-echarles-14.5.
    3a
  • prints a list of the collection
  • These data include examples of user data and
    branch sorting
  • mES, DE available as user data
  • 4-vectors and vertex data stored to D-mesons and
    Ks
  • 4-vectors (no vertex) stored

56
Wrapping in all up
Lets blow this joint go hit the slopes
57
Status of Kanga
  • All of the micro data are accessible in the
    16-series
  • http//www.slac.stanford.edu/echarles/Kanga/Refer
    ence/Funcs.html
  • It is easy to do your entire analysis in Kanga
  • You can user data to cover get everything you
    need
  • High-Level data
  • mES, Fisher and NN variables and inputs, Dm
  • Data that is hard to get to in Kanga
  • Particle ID lists and PID likelihoods
  • EMC/IFR p4
  • EMC moments
  • As we see what people want/ use, we can improve
    the storage
  • Getting better access to EMC/IFR
  • You wont need to change anything, but could get
    more speed, less disk space used by doing so

58
Getting some official R.E.S.P.E.C.T
  • Kanga can be a very valuable tool
  • Certain tasks can be done in seconds
  • Making plots/ doing basic checks
  • You can write marcos/ programs for every step of
    your analysis
  • We need ways to coordinate work with Kanga
  • Sharing useful macro and techniques
  • Putting documentation and examples where people
    can benefit
  • Deciding when to add access functions and
    utilities
  • Whisky Challenges
  • I find it hard to take people seriously if they
    drink champagne more that once a year
  • Ill buy a bottle of Johnny Red for the first
    person who
  • Does an offline calibration/ or monitoring task
    with Kanga
  • Writes a physics BAD for an analysis where they
    used Kanga

59
More information
  • The Kanga website is up-to-date
  • http//www.slac.stanford.edu/BFROOT/www/Computing/
    Documentation/Kanga
  • Tutorial and examples
  • ROOT-style documentation of classes in Kanga
  • Table of data types stored in Kanga skims
  • There are some examples in the KanExamples
    package
  • the file with .C endings are Kanga macros
  • KanExamples/KanUserApp.cc is a standalone
    executable that fills a bunch of histograms for
    the BSemiExcl skims
  • There is a relevant hypernews forum for questions
  • http//babar-hn.slac.stanford.edu5090/HyperNews/g
    et/kangaAnalTools.html
Write a Comment
User Comments (0)
About PowerShow.com