Newer
Older

Patrick Koppenburg
committed
###############################################################################
# (c) Copyright 2020-2023 CERN for the benefit of the LHCb Collaboration #

Patrick Koppenburg
committed
# #
# 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. #
###############################################################################
-->
<!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
<extension class="GaudiTest.GaudiExeTest" kind="test">

Patrick Koppenburg
committed
<argument name="program"><text>lbexec</text></argument>
<argument name="args"><set>
<text>DaVinciExamples.tupling.basic:main</text>
</set></argument>
<argument name="options_yaml_fn"><text>$DAVINCIEXAMPLESROOT/example_data/Upgrade_Bd2KstarMuMu_ldst.yaml</text></argument>
<argument name="extra_options_yaml"><text>
ntuple_file: DV-example-tupling-basic-ntp.root
histo_file: DV-example-tupling-basic-his.root
evt_max: 10
input_raw_format: 4.3
<argument name="timeout"><integer>3600</integer></argument>
<argument name="validator"><text>
findReferenceBlock("""
RFileCnv INFO dumping contents of /NTUPLES/FILE1
TFile: name=DV-example-tupling-basic-ntp.root, title=Gaudi Trees, option=CREATE
******************************************************************************
*Tree :DecayTree : DecayTree *
""", stdout, result, causes, signature_offset = 0)
countErrorLines({"FATAL":0, "ERROR":0})
import os
from DaVinciTests.QMTest.check_helpers import get_pandas_dataframe, df_has_nan
ntuple = './DV-example-tupling-basic-ntp.root'
if not os.path.isfile(ntuple):
causes.append(f"File {ntuple} does not exist!")
df1 = get_pandas_dataframe(ntuple, 'DimuonsTuple/DecayTree')
df2 = get_pandas_dataframe(ntuple, 'KsTuple/DecayTree')
# Check ntuples structure
if df1.empty:
causes.append(f"File {ntuple}: ntuple 'DimuonsTuple/DecayTree' does not contain any branches")
if df2.empty:
causes.append(f"File: {ntuple}: ntuple 'KsTuple/DecayTree' does not contain any branches")
causes.append("Ntuple 'DimuonsTuple/DecayTree' not with expected number of entries and/or branches")
# FIXME: check disabled because 8(7) candidates are tupled with(out) DD4hep!
# No appetite to investigate since we should soon update the input files used.
#if df2.shape != (8, 10):
# causes.append("Ntuple 'KsTuple/DecayTree' not with expected number of entries and/or branches")
# Check there are no NaN values in the ntuples
if df_has_nan(df1):
causes.append("Ntuple 'DimuonsTuple/DecayTree' contains NaN entries")
if df_has_nan(df2):
causes.append("Ntuple 'KsTuple/DecayTree' contains NaN entries")
print('Test successfully completed!')
#os.system(f"rm {ntuple}")
#os.system(f"rm {ntuple_new}")
<argument name="exit_code"><integer>1</integer></argument>
</text></argument>