Skip to content
Snippets Groups Projects
Commit 1b828b86 authored by Eduardo Rodrigues's avatar Eduardo Rodrigues
Browse files

Merge branch 'erodrigu-NAN' into 'master'

DaVinciTutorials and DaVinciExamples - checks on NaNs in produced ntuples

See merge request !822
parents 444b5255 642f74ef
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!822DaVinciTutorials and DaVinciExamples - checks on NaNs in produced ntuples
Pipeline #5085341 passed
Showing
with 152 additions and 40 deletions
<?xml version="1.0" ?>
<!--
###############################################################################
# (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......
<?xml version="1.0" ?>
<!--
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -48,6 +48,8 @@
findReferenceBlock("""B0DsK_Tuple SUCCESS Booked 1 N-Tuples and 0 Event Tag Collections"""
, stdout, result, causes, signature_offset = 0)
countErrorLines({"FATAL":0, "ERROR":0})
import sys, os, glob
from ROOT import TFile
......@@ -69,15 +71,17 @@ B_excluded_1 = set(B_vars_stored) - set(b_names)
B_excluded_2 = set(b_names) - set(B_vars_stored)
if len(B_excluded_1) != 0: raise Exception('Number of stored variables is less than what is expected. The extra variables expected are: ' , B_excluded_1)
if len(B_excluded_2) != 0: raise Exception('Number of stored variables is greater than what is expected. The extra variables stored are: ', B_excluded_2)
f.Close()
# Check there are no NaN values in the ntuple
# from DaVinciTests.QMTest.check_helpers import has_nan
# assert not has_nan("DV_example_allFunctors_ntp.root", "B0DsK_Tuple/DecayTree")
# Check there are no NaN values in the ntuple except where expected.
from DaVinciTests.QMTest.check_helpers import list_fields_with_nan
f.Close()
print('Test successfully completed!')
l_branches_with_nans = ['B0_TRUEP', 'B0_TRUEPT', 'B0_TRUEPX', 'B0_TRUEPY', 'B0_TRUEPZ', 'B0_TRUEENERGY', 'B0_TRUEORIGINVERTEX_X', 'B0_TRUEORIGINVERTEX_Y', 'B0_TRUEORIGINVERTEX_Z', 'B0_TRUEENDVERTEX_X', 'B0_TRUEENDVERTEX_Y', 'B0_TRUEENDVERTEX_Z', 'B0_MASSWITHHYPOTHESES', 'Kaon_PROBNN_D', 'Kaon_PROBNN_MU', 'Kaon_TRUEP', 'Kaon_TRUEPT', 'Kaon_TRUEPX', 'Kaon_TRUEPY', 'Kaon_TRUEPZ', 'Kaon_TRUEENERGY', 'Kaon_BREMENERGY', 'Kaon_BREMBENDCORR', 'Kaon_BREMPIDE', 'Kaon_ECALPIDE', 'Kaon_ECALPIDMU', 'Kaon_HCALPIDE', 'Kaon_HCALPIDMU', 'Kaon_ELECTRONSHOWEREOP', 'Kaon_CLUSTERMATCH', 'Kaon_ELECTRONMATCH', 'Kaon_BREMHYPOMATCH', 'Kaon_ELECTRONENERGY', 'Kaon_BREMHYPOENERGY', 'Kaon_BREMHYPODELTAX', 'Kaon_ELECTRONID', 'Kaon_HCALEOP', 'Ds_TRUEP', 'Ds_TRUEPT', 'Ds_TRUEPX', 'Ds_TRUEPY', 'Ds_TRUEPZ', 'Ds_TRUEENERGY', 'Ds_TRUEORIGINVERTEX_X', 'Ds_TRUEORIGINVERTEX_Y', 'Ds_TRUEORIGINVERTEX_Z', 'Ds_TRUEENDVERTEX_X', 'Ds_TRUEENDVERTEX_Y', 'Ds_TRUEENDVERTEX_Z', 'Ds_BPVCORRMERR', 'Ds_BPVLTIME', 'Ds_MASSWITHHYPOTHESES', 'pip_PROBNN_D', 'pip_PROBNN_MU', 'pip_TRUEP', 'pip_TRUEPT', 'pip_TRUEPX', 'pip_TRUEPY', 'pip_TRUEPZ', 'pip_TRUEENERGY', 'pip_BREMENERGY', 'pip_BREMBENDCORR', 'pip_BREMPIDE', 'pip_ECALPIDE', 'pip_ECALPIDMU', 'pip_HCALPIDE', 'pip_HCALPIDMU', 'pip_ELECTRONSHOWEREOP', 'pip_CLUSTERMATCH', 'pip_ELECTRONMATCH', 'pip_BREMHYPOMATCH', 'pip_ELECTRONENERGY', 'pip_BREMHYPOENERGY', 'pip_BREMHYPODELTAX', 'pip_ELECTRONID', 'pip_HCALEOP']
l_test = list_fields_with_nan("DV_example_allFunctors_ntp.root", "B0DsK_Tuple/DecayTree")
assert sorted(l_test) == sorted(l_branches_with_nans)
print('Test successfully completed!')
os.system(f"rm {ntuple}")
countErrorLines({"FATAL":0, "ERROR":0})
</text></argument>
</extension>
<?xml version="1.0" ?>
<!--
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -48,6 +48,8 @@
findReferenceBlock("""B0DsK_Tuple SUCCESS Booked 1 N-Tuples and 0 Event Tag Collections"""
, stdout, result, causes, signature_offset = 0)
countErrorLines({"FATAL":0, "ERROR":0})
import sys, os, glob
from ROOT import TFile
......@@ -69,15 +71,17 @@ B_excluded_1 = set(B_vars_stored) - set(b_names)
B_excluded_2 = set(b_names) - set(B_vars_stored)
if len(B_excluded_1) != 0: raise Exception('Number of stored variables is less than what is expected. The extra variables expected are: ' , B_excluded_1)
if len(B_excluded_2) != 0: raise Exception('Number of stored variables is greater than what is expected. The extra variables stored are: ', B_excluded_2)
f.Close()
# Check there are no NaN values in the ntuple
# from DaVinciTests.QMTest.check_helpers import has_nan
# assert not has_nan("DV_example_allFunctors_ntp.root", "B0DsK_Tuple/DecayTree")
# Check there are no NaN values in the ntuple except where expected.
from DaVinciTests.QMTest.check_helpers import list_fields_with_nan
f.Close()
print('Test successfully completed!')
l_branches_with_nans = ['B0_TRUEP', 'B0_TRUEPT', 'B0_TRUEPX', 'B0_TRUEPY', 'B0_TRUEPZ', 'B0_TRUEENERGY', 'B0_TRUEORIGINVERTEX_X', 'B0_TRUEORIGINVERTEX_Y', 'B0_TRUEORIGINVERTEX_Z', 'B0_TRUEENDVERTEX_X', 'B0_TRUEENDVERTEX_Y', 'B0_TRUEENDVERTEX_Z', 'Kaon_PROBNN_D', 'Kaon_PROBNN_MU', 'Kaon_TRUEP', 'Kaon_TRUEPT', 'Kaon_TRUEPX', 'Kaon_TRUEPY', 'Kaon_TRUEPZ', 'Kaon_TRUEENERGY', 'Kaon_BREMENERGY', 'Kaon_BREMBENDCORR', 'Kaon_BREMPIDE', 'Kaon_ECALPIDE', 'Kaon_ECALPIDMU', 'Kaon_HCALPIDE', 'Kaon_HCALPIDMU', 'Kaon_ELECTRONSHOWEREOP', 'Kaon_CLUSTERMATCH', 'Kaon_ELECTRONMATCH', 'Kaon_BREMHYPOMATCH', 'Kaon_ELECTRONENERGY', 'Kaon_BREMHYPOENERGY', 'Kaon_BREMHYPODELTAX', 'Kaon_ELECTRONID', 'Kaon_HCALEOP', 'Ds_TRUEP', 'Ds_TRUEPT', 'Ds_TRUEPX', 'Ds_TRUEPY', 'Ds_TRUEPZ', 'Ds_TRUEENERGY', 'Ds_TRUEORIGINVERTEX_X', 'Ds_TRUEORIGINVERTEX_Y', 'Ds_TRUEORIGINVERTEX_Z', 'Ds_TRUEENDVERTEX_X', 'Ds_TRUEENDVERTEX_Y', 'Ds_TRUEENDVERTEX_Z', 'Ds_BPVCORRMERR', 'Ds_BPVLTIME', 'Ds_MASSWITHHYPOTHESES', 'pip_PROBNN_D', 'pip_PROBNN_MU', 'pip_TRUEP', 'pip_TRUEPT', 'pip_TRUEPX', 'pip_TRUEPY', 'pip_TRUEPZ', 'pip_TRUEENERGY', 'pip_BREMENERGY', 'pip_BREMBENDCORR', 'pip_BREMPIDE', 'pip_ECALPIDE', 'pip_ECALPIDMU', 'pip_HCALPIDE', 'pip_HCALPIDMU', 'pip_ELECTRONSHOWEREOP', 'pip_CLUSTERMATCH', 'pip_ELECTRONMATCH', 'pip_BREMHYPOMATCH', 'pip_ELECTRONENERGY', 'pip_BREMHYPOENERGY', 'pip_BREMHYPODELTAX', 'pip_ELECTRONID', 'pip_HCALEOP']
l_test = list_fields_with_nan("DV_example_allFunctors_ntp_old.root", "B0DsK_Tuple/DecayTree")
assert sorted(l_test) == sorted(l_branches_with_nans)
print('Test successfully completed!')
os.system(f"rm {ntuple}")
countErrorLines({"FATAL":0, "ERROR":0})
</text></argument>
</extension>
<?xml version="1.0" ?>
<!--
###############################################################################
# (c) Copyright 2020-2021 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2020-2023 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". #
......@@ -26,6 +26,15 @@
</text></argument>
<argument name="validator"><text>
findReferenceBlock("""DimuonsTuple SUCCESS ID=DecayTree Title="DecayTree" #items=18 {EVENTNUMBER,RUNNUMBER,Jpsi_LOKI_P,Jpsi_LOKI_PT,Jpsi_LOKI_Muonp_PT,Jpsi_LOKI_Muonm}""")
countErrorLines({"FATAL":0, "ERROR":0})
# Check there are no NaN values in the ntuple except where expected.
from DaVinciTests.QMTest.check_helpers import list_fields_with_nan
l_branches_with_nans = ['Jpsi_DTF_PV_MASS']
l_test = list_fields_with_nan("DV-example-tupling-DTF-ntp.root", "DimuonsTuple/DecayTree")
assert sorted(l_test) == sorted(l_branches_with_nans)
</text></argument>
</extension>
......@@ -25,6 +25,53 @@ def has_nan(filename: str,
with the `columns` and `exclude` arguments, respectively,
as detailed in the documentation of `RDataFrame.AsNumpy`.
Args:
filename (str): The full path to the ROOT file.
ntuple_name (str): The full path to the ntuple, e.g. My/Dir/MyNtuple.
columns (iterable[str], optional): If None, return all fields (branches) as columns,
otherwise specify names in iterable.
exclude (iterable[str], optional): Exclude fields (branches) from selection.
"""
df = _get_pandas_dataframe(filename, ntuple_name, columns, exclude)
return df.isna().any().any()
def count_nan_in_fields(filename: str, ntuple_name: str,
fields: Iterable[str]):
"""
Count the number of NaN values for a give list of fields (branches).
Args:
filename (str): The full path to the ROOT file.
ntuple_name (str): The full path to the ntuple, e.g. My/Dir/MyNtuple.
fields (iterable[str]): The list of fields to inspect.
"""
df = _get_pandas_dataframe(filename, ntuple_name, fields)
return {f: df[f].isna().sum() for f in fields}
def list_fields_with_nan(filename: str, ntuple_name: str):
"""
List the fields (branches) that contain NaN values.
Args:
filename (str): The full path to the ROOT file.
ntuple_name (str): The full path to the ntuple, e.g. My/Dir/MyNtuple.
"""
df = _get_pandas_dataframe(filename, ntuple_name)
return df.columns[df.isna().any()].tolist()
def _get_pandas_dataframe(filename: str,
ntuple_name: str,
columns: Iterable[str] = None,
exclude: Iterable[str] = None):
"""
Helper to produce a Pandas DataFrame from a ROOT RDataFrame.
Args:
filename (str): The full path to the ROOT file.
ntuple_name (str): The full path to the ntuple, e.g. My/Dir/MyNtuple.
......@@ -35,6 +82,4 @@ def has_nan(filename: str,
rdf = RDataFrame(ntuple_name, filename)
ar = rdf.AsNumpy(columns, exclude)
df = pd.DataFrame(ar)
return df.isna().any().any()
return pd.DataFrame(ar)
<?xml version="1.0" ?>
<!--
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -25,10 +25,14 @@
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import preprocessor, counter_preprocessor
validateWithReference(preproc = preprocessor, counter_preproc = counter_preprocessor)
countErrorLines({"FATAL":0, "ERROR":0})
import os
from ROOT import TFile
ntuple = './tutorial1_functors_specialfield.root'
#this file should be disabled
ntuple_new = './tutorial1_Functors_specialfield_new.root'
......@@ -38,10 +42,13 @@ t_B = f.Get('TDirectoryName/TTreeName')
b_names= [b.GetName() for b in t_B.GetListOfLeaves()]
if not b_names: raise Exception(f"File: {ntuple} does not contain any branches. Please check.")
f.Close()
# Check there are no NaN values in the ntuple
from DaVinciTests.QMTest.check_helpers import has_nan
assert not has_nan(ntuple, 'TDirectoryName/TTreeName')
print('Test successfully completed!')
os.system(f"rm {ntuple}")
os.system(f"rm {ntuple_new}")
countErrorLines({"FATAL":0, "ERROR":0})
</text></argument>
</extension>
<?xml version="1.0" ?>
<!--
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -25,10 +25,14 @@
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import preprocessor, counter_preprocessor
validateWithReference(preproc = preprocessor, counter_preproc = counter_preprocessor)
countErrorLines({"FATAL":0, "ERROR":0})
import os
from ROOT import TFile
ntuple = './tutorial2_LoKi.root'
#this file should be disabled
ntuple_new = './tutorial2_LoKi_new.root'
......@@ -38,10 +42,13 @@ t_B = f.Get('TDirectoryName/TTreeName')
b_names= [b.GetName() for b in t_B.GetListOfLeaves()]
if not b_names: raise Exception(f"File: {ntuple} does not contain any branches. Please check.")
f.Close()
# Check there are no NaN values in the ntuple
from DaVinciTests.QMTest.check_helpers import has_nan
assert not has_nan(ntuple, 'TDirectoryName/TTreeName')
print('Test successfully completed!')
os.system(f"rm {ntuple}")
os.system(f"rm {ntuple_new}")
countErrorLines({"FATAL":0, "ERROR":0})
</text></argument>
</extension>
<?xml version="1.0" ?>
<!--
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -25,10 +25,14 @@
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import preprocessor, counter_preprocessor
validateWithReference(preproc = preprocessor, counter_preproc = counter_preprocessor)
countErrorLines({"FATAL":0, "ERROR":0})
import os
from ROOT import TFile
ntuple = './tutorial3_ThOrfunctors.root'
#this file should be disabled
ntuple_new = './tutorial3_ThOrfunctors_new.root'
......@@ -38,10 +42,13 @@ t_B = f.Get('TDirectoryName/TTreeName')
b_names= [b.GetName() for b in t_B.GetListOfLeaves()]
if not b_names: raise Exception(f"File: {ntuple} does not contain any branches. Please check.")
f.Close()
# Check there are no NaN values in the ntuple
from DaVinciTests.QMTest.check_helpers import has_nan
assert not has_nan(ntuple, 'TDirectoryName/TTreeName')
print('Test successfully completed!')
os.system(f"rm {ntuple}")
os.system(f"rm {ntuple_new}")
countErrorLines({"FATAL":0, "ERROR":0})
</text></argument>
</extension>
<?xml version="1.0" ?>
<!--
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -28,8 +28,11 @@ from DaVinciTests.QMTest.DaVinciExclusions import preprocessor, counter_preproce
##validator complains about long TTreeNames so comment out(see https://gitlab.cern.ch/lhcb/DaVinci/-/issues/46)
#validateWithReference(preproc = preprocessor, counter_preproc = counter_preprocessor)
countErrorLines({"FATAL":0, "ERROR":0})
import os
from ROOT import TFile
ntuple = './tutorial4_trigger_eventinfo.root'
#this file should be disabled
ntuple_new = './tutorial4_trigger_eventinfo_new.root'
......@@ -39,10 +42,13 @@ t_B = f.Get('TDirectoryName/TTreeName')
b_names= [b.GetName() for b in t_B.GetListOfLeaves()]
if not b_names: raise Exception(f"File: {ntuple} does not contain any branches. Please check.")
f.Close()
# Check there are no NaN values in the ntuple
from DaVinciTests.QMTest.check_helpers import has_nan
assert not has_nan(ntuple, 'TDirectoryName/TTreeName')
print('Test successfully completed!')
os.system(f"rm {ntuple}")
os.system(f"rm {ntuple_new}")
countErrorLines({"FATAL":0, "ERROR":0})
</text></argument>
</extension>
<?xml version="1.0" ?>
<!--
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -25,10 +25,14 @@
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import preprocessor, counter_preprocessor
validateWithReference(preproc = preprocessor, counter_preproc = counter_preprocessor)
countErrorLines({"FATAL":0, "ERROR":0})
import os
from ROOT import TFile
ntuple = './tutorial5_MCTruth.root'
#this file should be disabled
ntuple_new = './tutorial5_MCTruth_new.root'
......@@ -38,10 +42,15 @@ t_B = f.Get('TDirectoryName/TTreeName')
b_names= [b.GetName() for b in t_B.GetListOfLeaves()]
if not b_names: raise Exception(f"File: {ntuple} does not contain any branches. Please check.")
f.Close()
# Check there are no NaN values in the ntuple except where expected.
from DaVinciTests.QMTest.check_helpers import list_fields_with_nan
l_branches_with_nans = ['Bs_TRUEP', 'Jpsi_TRUEP', 'Phi_TRUEP', 'Mup_TRUEP', 'Mum_TRUEP', 'Kp_TRUEEPHI', 'Kp_TRUEP', 'Km_TRUEP']
l_test = list_fields_with_nan(ntuple, 'TDirectoryName/TTreeName')
assert sorted(l_test) == sorted(l_branches_with_nans)
print('Test successfully completed!')
os.system(f"rm {ntuple}")
os.system(f"rm {ntuple_new}")
countErrorLines({"FATAL":0, "ERROR":0})
</text></argument>
</extension>
<?xml version="1.0" ?>
<!--
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -25,11 +25,14 @@
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import preprocessor, counter_preprocessor
validateWithReference(preproc = preprocessor, counter_preproc = counter_preprocessor)
countErrorLines({"FATAL":0, "ERROR":0})
import os
from ROOT import TFile
ntuple = './tutorial6_DecayTreeFit.root'
#this file should be disabled
ntuple_new = './tutorial6_DecayTreeFit_new.root'
......@@ -39,10 +42,13 @@ t_B = f.Get('TDirectoryName/TTreeName')
b_names= [b.GetName() for b in t_B.GetListOfLeaves()]
if not b_names: raise Exception(f"File: {ntuple} does not contain any branches. Please check.")
f.Close()
# Check there are no NaN values in the ntuple
from DaVinciTests.QMTest.check_helpers import has_nan
assert not has_nan(ntuple, 'TDirectoryName/TTreeName')
print('Test successfully completed!')
os.system(f"rm {ntuple}")
os.system(f"rm {ntuple_new}")
countErrorLines({"FATAL":0, "ERROR":0})
</text></argument>
</extension>
<?xml version="1.0" ?>
<!--
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -25,10 +25,14 @@
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import preprocessor, counter_preprocessor
validateWithReference(preproc = preprocessor, counter_preproc = counter_preprocessor)
countErrorLines({"FATAL":0, "ERROR":0})
import os
from ROOT import TFile
ntuple = './tutorial7_multiple_sel_lines.root'
#this file should be disabled
ntuple_new = './tutorial7_multiple_sel_lines_new.root'
......@@ -41,10 +45,14 @@ b_names_2= [b.GetName() for b in t_B_2.GetListOfLeaves()]
if not b_names_1: raise Exception(f"File: {ntuple} does not contain any branches. Please check.")
if not b_names_2: raise Exception(f"File: {ntuple} does not contain any branches. Please check.")
f.Close()
# Check there are no NaN values in the ntuples
from DaVinciTests.QMTest.check_helpers import has_nan
assert not has_nan(ntuple, 'TDirectoryName1/TTreeName1')
assert not has_nan(ntuple, 'TDirectoryName2/TTreeName2')
print('Test successfully completed!')
os.system(f"rm {ntuple}")
os.system(f"rm {ntuple_new}")
countErrorLines({"FATAL":0, "ERROR":0})
</text></argument>
</extension>
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