Skip to content
Snippets Groups Projects

Modernize xgen test

Merged Patrick Koppenburg requested to merge pkoppenb-xgen into master
Files
3
###############################################################################
# (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,23 @@
###############################################################################
"""
Read and process a .xgen file with the new DaVinci configuration.
This is run as
./run davinci run-mc --user_algorithms DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_xgen:main
To test with another xgen file, copy the options above, edit the list of files below (can be local files) and make sure you adapt the database tags.
Then specify the decay descriptors.
"""
xgenFiles = [
"root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/testDV_read_xgen/Gauss-12143001-100ev-20211117.xgen"
]
conddb_tag = "sim-20171127-vc-md100"
dddb_tag = "dddb-20171126"
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 +39,18 @@ 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,
'ORIGIN_VX': F.ORIGIN_VX,
'ORIGIN_VY': F.ORIGIN_VY,
'ORIGIN_VZ': F.ORIGIN_VZ,
'END_VX': F.END_VX,
'END_VY': F.END_VY,
'END_VZ': F.END_VZ,
})
#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 = {
@@ -64,6 +76,13 @@ def main():
options.ntuple_file = "DV_tuple_xgen.root"
options.process = "Hlt2"
options.input_files = xgenFiles
options.data_type = "Upgrade"
options.input_type = "XGEN"
options.simulation = True
options.conddb_tag = conddb_tag
options.dddb_tag = dddb_tag
printMC = PrintMCTree(
MCParticles=bu2jpsik_line, ParticleNames=["B+", "B-"], OutputLevel=4)
Loading