Skip to content
Snippets Groups Projects
Commit e4286a2c authored by Patrick Koppenburg's avatar Patrick Koppenburg :leaves:
Browse files

Merge branch 'pkoppenb-xgen' into 'master'

Modernize xgen test

See merge request lhcb/DaVinci!641
parents d212ccb9 30338aaf
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!641Modernize xgen test
Pipeline #3588715 passed
###############################################################################
# (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)
......
......@@ -28,9 +28,6 @@
<argument name="timeout"><integer>600</integer></argument>
<argument name="args"><set>
<text>run-mc</text>
<text>--inputfiledb</text>
<text>test_read_xgen</text>
<text>$DAVINCIROOT/options/DaVinciDB-Example.yaml</text>
<text>--user_algorithms</text>
<text>../../python/DaVinciExamples/tupling/option_davinci_tupling_from_xgen:main</text>
</set></argument>
......
......@@ -23,7 +23,7 @@ FSROutputStreamDstWriter INFO Set up File Summary Record
FSROutputStreamDstWriter INFO Events output: 1
BuJpsiK_MCTuple SUCCESS Booked 1 N-Tuples and 0 Event Tag Collections
BuJpsiK_MCTuple SUCCESS List of booked N-Tuples in directory "FILE1/BuJpsiK_MCTuple"
BuJpsiK_MCTuple SUCCESS ID=DecayTree Title="DecayTree" #items=24 {Bu_ETA,Bu_PHI,Bu_PT,Bu_E,Bu_P,Bu_PX,Bu_PY,Bu_PZ,Jpsi_P,Jpsi_PX,Jpsi_PY,Jpsi_PZ,Kp}
BuJpsiK_MCTuple SUCCESS ID=DecayTree Title="DecayTree" #items=33 {Bu_ETA,Bu_PHI,Bu_ORIGIN_VX,Bu_ORIGIN_VY,Bu_ORIGIN_VZ,Bu_END_VX,Bu_END_VY,Bu_END_V}
LAZY_AND: DaVinci #=100 Sum=100 Eff=|( 100.0000 +- 0.00000 )%|
NONLAZY_OR: FileSummaryRecords #=100 Sum=100 Eff=|( 100.0000 +- 0.00000 )%|
LAZY_AND: GenFSR #=100 Sum=100 Eff=|( 100.0000 +- 0.00000 )%|
......@@ -53,6 +53,3 @@ BuJpsiK_MCTuple INFO Number of counters : 11
| "# non-empty events for field muminus" | 63 |
| "# non-empty events for field muplus" | 63 |
| "# processed events" | 100 |
ToolSvc.MCHybridFactory INFO Number of counters : 1
| Counter | # | sum | mean/eff^* | rms/err^* | min | max |
| "# loaded from PYTHON" | 24 |
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment