DecayTreeTuple – an update (v2r3p1) Robert W. Lambert, Imperial College London. R Lambert, Imperial Software Week, June 2009
What is DecayTreeTuple DecayTreeTuple is: A labour-saving device A common tool for writing ntuples Continuously expanding/developing Highly configurable An ntuple is: User defined quick and dirty analysis solution A compact ordered list of all relevant data A reduced, condensed set of data about events/candidates One typical starting point for an analysis Easily viewed/plotted in Root Produced from DSTs (possibly micro-DSTs) R Lambert, Imperial Software Week, June 2009
What is a TupleTool? A TupleTool: Previous talk: Adds information into the tuple Contains a “Fill” method Is called by the DecayTreeTuple Will typically contain a set of common entries Previous talk: http://indico.cern.ch/contributionDisplay.py?contribId=26&sessionId=2&confId=25000 Jeremie Borel, March 2008 There has been a lot of work since then!! I will give an overview of where we are now R Lambert, Imperial Software Week, June 2009
Purpose of this talk For the unconverted: For Everyone For Experts Introduce DecayTreeTuple Demonstrate the use of DecayTreeTuple Categorise types of TupleTools Introduce the new DaVinci Tutorial For Everyone Provide an up-to-date list of all TupleTools Provide a quick-reference of tool useage For Experts Give an overview of what has changed Open discussion of what needs to be changed in the future R Lambert, Imperial Software Week, June 2009
Using DecayTreeTuple Pick a Type of Tuple Pick the TupleTools you want to write Configure the tools in your python opts file R Lambert, Imperial Software Week, June 2009
1.Types of Tuple EventTuple MCDecayTreeTuple DecayTreeTuple Writes out one entry per event Filled by (MC)EventTupleTools MCDecayTreeTuple Uses the MCDecayFinder Writes once per candidate, LHCb::MCParticle Filled by MC(Particle)TupleTools DecayTreeTuple Uses the PhysDesktop and a DecayDescriptor Writes once per decay candidate, LHCb::Particle Filled by (Particle)TupleTools R Lambert, Imperial Software Week, June 2009
2.TupleTools TupleTools add/fill information into the ntuple TupleTools inherit from one of three base classes IEventTupleTool Fills information about the event IParticleTupleTool Fills information about an LHCb::Particle IMCParticleTupleTool Fills information about an LHCb::MCParticle R Lambert, Imperial Software Week, June 2009
EventTupleTools Can be added to any of the tuples, to fill info about the event Tool Description TupleToolEventInfo Fills event/run number TupleToolGeneration What was generated (MCTruth) TupleToolPrimaries PV information TupleToolRecoStats Number of Tracks/Particles reconstructed TupleToolSelectionResults Results of selections TupleToolTrigger L0, HLT1 and HLT2 output MCTupleToolEventType Categorise the event against the EvtGen ID MCTupleToolInteractions Weight based on the number of interactions R Lambert, Imperial Software Week, June 2009
MCParticle TupleTools Added to an MCDecayTreeTuple, fills info on MCParticles Tool Description MCTupleToolAngles Cos(theta) pointing angle MCTupleToolDalitz Dalitz mass distributions MCTupleToolDecayType Categorise the decay against the EvtGen ID MCTupleToolHierarchy Info on the mother/grandmother/daughters MCTupleToolKinematic Momentum etc. MCTupleToolP2VV Helicity/Transversity angles MCTupleToolReconstructed Is the particle reconstructed/reconstructible R Lambert, Imperial Software Week, June 2009
Particle TupleTools Added to a DecayTreeTuple, fills info about the particles Tool Description TupleToolAngles Cos(theta) pointing angle TupleToolDalitz Dalitz mass distributions TupleToolGeometry Vertices and distances TupleToolKinematic Momentum etc. TupleToolP2VV Helicity/Transversity angles TupleToolPID PID information, RICH, DLLs etc. TupleToolPropertime Decay proper time TupleToolTagging Tagging information TupleToolTISTOS Trigger: TIS, TOS, TOBbing TupleToolTrackInfo Tracking Chi2, extra info, etc. TupleToolVtxIsoln Tracks close to this vertex R Lambert, Imperial Software Week, June 2009
Special TupleTools LoKi::Hybrid::TupleTool TupleToolMCBackgroundInfo Add any entry which exists in the CombineParticles framework Perform basic maths with/between entries TupleToolMCBackgroundInfo Does MCTruth association through BackgroundCategory Stores the results TupleToolMCTruth Performs MCTruth association with SmartAssociator Fills MCParticleTupleTools attached to it TupleToolPi0 Information and MCTruth association for special case of Pi0 R Lambert, Imperial Software Week, June 2009
3. Using options Get an instance and add the TupleTools Define the decay, with ^ for the particles to process The ‘head’ particle is processed by default from Configurables import DecayTreeTuple tuple = DecayTreeTuple() tuple.InputLocations = [ "Bs2JpsiPhi" ] #your algorithm name tuple.ToolList += [ "TupleToolMCTruth" , "TupleToolMCBackgroundInfo" , "TupleToolKinematic" , "TupleToolEventInfo" , "TupleToolTrackInfo" ] tuple.Decay = "[B_s0 -> (^J/psi(1S) => ^mu+ ^mu-) (^phi(1020) -> ^K+ ^K-)]cc” R Lambert, Imperial Software Week, June 2009
LoKi::Hybrid::TupleTool A VERY powerful TupleTool Add anything from the CombineParticles framework Massive list of LoKi::Hybrid functors to choose from: https://twiki.cern.ch/twiki/bin/view/LHCb/LoKiHybridFilters LoKi_B=LoKi__Hybrid__TupleTool("LoKi_B") LoKi_B.Variables = { # " name " : " functor ", “PID" : "ID" , "BPVDIRA" : "BPVDIRA" , "MassDiff_Bs0" : "DMASS('B_s0')" , "P2" : "P*P“ } tuple.addTool(LoKi_B) tuple.ToolList+=["LoKi::Hybrid::TupleTool/LoKi_B"] R Lambert, Imperial Software Week, June 2009
MCTruth To add MCTruth information, you first add the MCTruth Tool This does the association, Then fill MC(Particle)TupleTools for this associate (No need for multiple assosciation calls) tuple = DecayTreeTuple() … tuple.ToolList += [ "TupleToolMCTruth" ] MCTruth = TupleToolMCTruth() MCTruth.ToolList = [ "MCTupleToolKinematic" , "MCTupleToolHierarchy" ] tuple.addTool(MCTruth) R Lambert, Imperial Software Week, June 2009
Tutorial Tutorial/Analysis v8r2 DaVinci Tutorial 6 DaVinci Tutorial 7 Basic DecayTreeTuple https://twiki.cern.ch/twiki/bin/view/LHCb/DaVinciTutorial6 Setting up and using a few tools DaVinci Tutorial 7 Advanced DecayTreeTuple https://twiki.cern.ch/twiki/bin/view/LHCb/DaVinciTutorial7 LoKi::Hybrid::TupleTool Working with MCTruth Configuring Branches Writing your own TupleTool R Lambert, Imperial Software Week, June 2009
Summary Tuples are often the starting point for a user analysis DecayTreeTuple is a common labour-saving tool Latest version v2r3p1 Many changes have happened recently: Now many TupleTools Can/Should use LoKi::Hybrid::TupleTool where possible MCTruth association simplified New tutorials reflect the situation Tutorial/Analysis v8r2 Enjoy your analysis! R Lambert, Imperial Software Week, June 2009
End Questions/Discussion R Lambert, Imperial Software Week, June 2009
Backup Backup slides R Lambert, Imperial Software Week, June 2009
Branches Branches are used to separate out particles: Different TupleTools can be added/configured for each one tuple.Branches={ "B" : "[B_s0]cc : [B_s0 -> (J/psi(1S) => mu+ mu-) (phi(1020) -> K+ K-)]cc" , "KPlus" : "[B_s0]cc -> (phi(1020) -> ^K+ K-) ? " , "KMinus" : "[B_s0]cc -> (phi(1020) -> K+ ^K-) ? " } tuple.addTool(TupleToolDecay, name="B") LoKi_B=LoKi__Hybrid__TupleTool("LoKi_B") LoKi_B.Variables = { "PID" : "ID" , "BPVDIRA" : "BPVDIRA" , "MassDiff_Bs0" : "DMASS('B_s0')" tuple.B.ToolList+=["LoKi::Hybrid::TupleTool/LoKi_B"] tuple.B.addTool(LoKi_B) R Lambert, Imperial Software Week, June 2009