Skip to content

IntVar,FloatVar,BoolVar options for tuple tools

@masmith @erodrigu @mramospe

See Analysis#4 (closed)

Currently DaVinci users write something like

atool=branch.addTupleTool("LoKi::Hybrid::TupleTool")
atool.Variables = {"ISMUON" : "switch(ISMUON,1,0)",
                   "Q"     : "Q",
                   "TRCHI2DOF":"TRCHI2DOF"}

and all branches in the output tree will be 64 bit double. Now they have the option of writing

atool.BoolVariables = {"ISMUON" : "switch(ISMUON,1,0)"}
atool.IntVariables = {"Q"     : "Q"}
atool.FloatVariables =  {"TRCHI2DOF":"TRCHI2DOF"}

so (before compression) they will now get 1 + 32 + 32 bits instead of 64*3 bits.

Analysis!763 (merged) is the related merge request to Analysis that adds the equivalent feature for MCDecayTreeTuples

Test of functionality

from DecayTreeTuple.Configuration import *
from Configurables import DaVinci
DaVinci().TupleFile = 'DVntuple.root'
DaVinci().Simulation = True
DaVinci().DataType = '2016'
DaVinci().EvtMax    =  1000
DaVinci().PrintFreq =  100
from GaudiConf import IOHelper
IOHelper().inputFiles(['root://eoslhcb.cern.ch//eos/lhcb/grid/prod/lhcb/MC/2016/ALLSTREAMS.DST/00065692/0000/00065692_00000548_7.AllStreams.dst'])

dtt = DecayTreeTuple("reco")
dtt.ToolList = []
dtt.Inputs = ['/Event/AllStreams/Phys/WMuLine/Particles']
dtt.Decay = 'mu+'
dtt.addBranches({"mu": "^mu+"})
atool = dtt.mu.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_Reco")
use_new_feature = True
if use_new_feature:
    atool.IntVariables = {"Q": "Q"}
    atool.BoolVariables = {"ISMUON" : "switch(ISMUON,1,0)"}
    atool.FloatVariables =  {"TRCHI2DOF":"TRCHI2DOF"}
else:
    atool.Variables = {"Q": "Q",
                       "ISMUON" : "switch(ISMUON,1,0)",
                       "TRCHI2DOF":"TRCHI2DOF"}

DaVinci().UserAlgorithms.append(dtt)
lb-set-platform x86_64-centos7-gcc9-opt
lb-dev --nightly lhcb-run2-patches/Fri DaVinci/run2-patches
cd DaVinciDev_run2-patches
git lb-use Analysis
git lb-checkout Analysis/mvesteri-mctuple-extra-types Phys/LoKiPhysMC 
git lb-use Phys
git lb-checkout Phys/mvesteri-extra-decaytreetuple-branch-types Phys/LoKiArrayFunctors  
make
./run gaudirun.py analysis_issue4_reco.py

Output file contains:

   Bool_t          mu_ISMUON;
   Float_t         mu_TRCHI2DOF;
   Int_t           mu_Q;
   UInt_t          nCandidate;
   ULong64_t       totCandidates;
   ULong64_t       EventInSequence;
Edited by Mika Anton Vesterinen

Merge request reports