Skip to content
Snippets Groups Projects

Modernize xgen test

Merged Patrick Koppenburg requested to merge pkoppenb-xgen into master
Files
2
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2022 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". #
@@ -10,10 +10,19 @@
###############################################################################
"""
Read and process a .xgen file with the new DaVinci configuration.
This is run as
./run davinci run-mc --inputfiledb test_read_xgen Phys/DaVinci/options/DaVinciDB-Example.yaml --user_algorithms DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_xgen:main
To test with another file, create a yaml file and do
./run davinci run-mc --inputfiledb fileKey file.yaml --user_algorithms DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_xgen:main
"""
from FunTuple import FunctorCollection, FunTuple_MCParticles as FuntupleMC
from PyConf.Algorithms import PrintMCTree
from PyConf.dataflow import force_location
import Functors as F
#FunTuple: define fields (branches)
fields = {
@@ -26,19 +35,15 @@ fields = {
#FunTuple: define variables for the B meson
variables_B = FunctorCollection({
'ETA': 'MCETA',
'PHI': 'MCPHI',
'PT': 'MCPT',
'E': 'MCE',
'ETA': F.ETA,
'PHI': F.PHI,
'VX': 'MCVFASPF(MCVX)', #LoKi
'VY': 'MCVFASPF(MCVY)', #LoKi
'VZ': 'MCVFASPF(MCVZ)', #LoKi
})
#FunTuple: define common variables
variables_all = FunctorCollection({
'P': 'MCP',
'PX': 'MCPX',
'PY': 'MCPY',
'PZ': 'MCPZ',
})
variables_all = FunctorCollection({'PT': F.PT, 'P': F.FOURMOMENTUM})
#FunTuple: associate functor collections to field (branch) name
variables = {
Loading