Skip to content
Snippets Groups Projects

Resolve "Tupling test running on spruced output"

Merged Davide Fazzini requested to merge 6-tupling-test-running-on-spruced-output into master
1 unresolved thread
Compare and
9 files
+ 444
11
Compare changes
  • Side-by-side
  • Inline
Files
9
###############################################################################
# (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
"""
Read the output of an HLT2 job with the new DaVinci configuration.
"""
import Functors as F
from FunTuple import FunctorCollection
from FunTuple import FunTuple_Particles as Funtuple
from FunTuple.NewTupleTools import Kinematics
from PyConf.application import make_data_with_FetchDataFromFile
bd2dsk_line = make_data_with_FetchDataFromFile(
"/Event/Spruce/SpruceB2OC_BdToDsmK_DsmToHHH_FEST_Line/Particles")
branches = {}
branches['B0'] = "[B0 -> D_s- K+]CC"
branches['Ds'] = "[B0 -> ^D_s- K+]CC"
branches['Kp'] = "[B0 -> D_s- ^K+]CC"
variables_B0 = FunctorCollection({
'LOKI_MAXPT': 'TRACK_MAX_PT',
'LOKI_Muonp_PT': 'CHILD(PT, 1)',
'LOKI_Muonm_PT': 'CHILD(PT, 2)',
})
variables_extra = FunctorCollection({
'LOKI_NTRCKS_ABV_THRSHLD':
'NINTREE(ISBASIC & (PT > 15*MeV))'
})
variables_B0 += variables_extra
#FunTuple: make functor collection from the imported functor library Kinematics
variables_all = FunctorCollection(Kinematics)
#FunTuple: associate functor collections to branch name
variables = {}
variables['ALL'] = variables_all #adds variables to all branches
variables['B0'] = variables_B0
variables['Ds'] = variables_extra
variables['Kp'] = variables_extra
loki_preamble = ['TRACK_MAX_PT = MAXTREE(ISBASIC & HASTRACK, PT, -1)']
tuple_B0DsK = Funtuple(
name="B0DsK_Tuple",
tree_name="DecayTree",
branches=branches,
variables=variables,
loki_preamble=loki_preamble,
inputs=bd2dsk_line)
def main():
tools = []
algs = [tuple_B0DsK]
return algs, tools
Loading