DaVinci Tutorial 6

This is all about running DecayTreeTuple and some more.


This tutorial corresponds to the slides last shown here. (i.e. that is an entire conference around the tutorials, you can read all of the slides, and they will take you though the tutorials step-by-step). There is also a talk on DecayTreeTuple here which is a nice introduction, but strays a little into DaVinciTutorial7 also.

Tuple Tools

When you create a decay tree tuple, there are several variables that are automatically written into it:

  • nCandidate
  • totCandidates
  • EventInSequence

The tuple tools are configurables that write particle, track, vertex, and event information into a ROOT tuple. Two tuple tools are automatically included in the tuple's tool list:

Some other common and useful tuple tools include:

  • TupleToolPropertime, which simply writes the proper lifetime of reconstructed particles
  • TupleToolAngles, which writes the decay angles of (charged) tracks
  • TupleToolPid, which writes PID (particle identification) information for (charge) particles
  • TupleToolTISTOS (TISTOS stands for "Trigger Independent of Signal or Trigger On Signal)
  • TupleToolPrimaries, which writes the number and coordinates of primary vertices in the candidate events
  • TupleToolTrackInfo, which writes track type and reconstruction information
  • TupleToolEventInfo, which writes event information such as run number, magnet polarity, GPS time, bunch ID, etc.

Additionally, there are some tuple tools that provide MC information. Many of these are completely analogous to the above data TupleTools, but simply provide MC truth values for truth matched candidates (and appropriate null values for non-truth matched candidates). Others give other sorts of MC information. These include:

  • TupleToolMCBackgroundInfo, which use some boolean variables to sort reconstructed candidates into some generic signal and background categories

Data or MC

To avoid filling stuff in the Tuple that is not available, put a switch in your options:

simulation = False # or True, as you wish

Make two Tuples

Add an instance of DecayTreeTuple and add the appropriate tools:
from DecayTreeTuple.Configuration import *
from DaVinci4.solutions.Bs2JpsiPhi import SeqBs2JpsiPhi
# get the GaudiSequencer with everything we need
seq = SeqBs2JpsiPhi.sequence()
tuple = DecayTreeTuple()
tuple.Inputs = [ SeqBs2JpsiPhi.outputLocation() ]
tuple.Inputs = [ SeqBs2JpsiPhi.outputLocation() ]
# tuple.addTupleTool( "TupleToolGeometry") // already default
# tuple.addTupleTool( "TupleToolKinematic")// already default
tuple.addTupleTool( "TupleToolPropertime")
tuple.addTupleTool( "TupleToolPrimaries")
# tuple.addTupleTool( "TupleToolEventInfo")// already default
tuple.addTupleTool( "TupleToolTrackInfo")
tuple.addTupleTool( "TupleToolTagging")
if (simulation):
    tuple.addTupleTool( "TupleToolMCTruth")
    tuple.addTupleTool( "TupleToolMCBackgroundInfo")

tuple.Decay = "[B_s0 -> ^(J/psi(1S) -> ^mu+ ^mu-) ^(phi(1020) -> ^K+ ^K-)]CC"
DecayTreeTuple makes one entry per candidate and takes both EventTupleTools and ParticleTupleTools. The most difficult part of the exercise is to get the decay descriptor right. See the syntax here.

You can also add a Tuple with one entry per event. This is done using EventTuple.

etuple = EventTuple()
# etuple.addTupleTool("TupleToolEventInfo")// already default
if (simulation): etuple.addTupleTool("TupleToolGeneration")

An EventTuple can only take EventTupleTools. Since a candidate always also has an associated event, you can add the information from the event into every candidate. This is why EventTupleTools can equally well go into an EventTuple and/or a DecayTreeTuple.

EventTupleTools and ParticleTupleTools are tools that implement the IEventTupleTool and IParticleTupleTool tool interfaces, respectively. Look at the description of these interfaces in doxygen, starting from this page to get a full up to date list of all tools implementing these interfaces. For more information on the different tools and what they are for, you really should see the slides last shown here.

Job configuration

Run them outside of your sequence, and define an ntuple output file (which is different from the histogram file):
DaVinci().UserAlgorithms = [ tutorialseq, tuple, etuple ]
DaVinci().TupleFile = "DVNtuples.root"
DaVinci().Simulation = simulation


-- PatrickKoppenburg - 01 Oct 2007 -- PatrickKoppenburg - 13 Jun 2008 -- PatrickKoppenburg - 05 Jan 2009 -- PatrickSKoppenburg - 16-Oct-2012 -- PatrickSKoppenburg - 30-Sep-2013

Edit | Attach | Watch | Print version | History: r52 < r51 < r50 < r49 < r48 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r49 - 2013-09-30 - PatrickSKoppenburg
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback