User Tools

Site Tools


loki:loki

This is an old revision of the document!


LoKi

Idea

LoKi is a package for the simple and user-friendly data analysis, a page with some useful links can be found | here. Mostly, the Filters are used.

How to add a Variable in DecayTreeTuple

When using a python optionsfile, one can add several tools to the DecayTreeTuple that will store information in the final tuple. However, one can also add (LoKi) variables by hand. Add in your code (some of these things might already be in):

from Configurables import LoKi__Hybrid__TupleTool
LoKiTool = LoKi__Hybrid__TupleTool( 'LoKiTool')
...
myTuple.addTool(LoKiTool, name = 'LoKiTool')
myTuple.ToolList = [
"LoKi::Hybrid::TupleTool/LoKiTool",
other tools...
]

Now you have to define the variables (a dictionary in Python). Suppose you want to add the deposited energy of a MIP (minimum ionizing particle) in your calorimeter(Ecal, Hcal, Pre-shower). For this, do:

myTuple.LoKiTool.Variables = {
    "HcalE" : "PPINFO( LHCb.ProtoParticle.CaloHcalE , -10)",
    "EcalE" : "PPINFO( LHCb.ProtoParticle.CaloEcalE , -10)",
    "PrsE" : "PPINFO( LHCb.ProtoParticle.CaloPrsE , -10)"
    }

Notes:

  • Mind the two __!
  • The code on the right sido of the : is just a LoKi particle functor, which can be found here. Don't forget: It's Python, not C++ (e.g. there aren't any :: for namespaces).
loki/loki.1235220159.txt.gz · Last modified: 2009/02/21 13:42 by decianm