Skip to content
Snippets Groups Projects
Commit 4c16c13f authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Fixing test that depend on algorithm names

parent 38f23e44
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!790Fixing test that depend on algorithm names
Showing
with 43 additions and 19 deletions
......@@ -24,7 +24,7 @@
</set></argument>
<argument name="validator"><text>
findReferenceBlock("""
PrintHeader INFO Number of counters : 1
PrintHeader_14578b4c INFO Number of counters : 1
| Counter | # | sum | mean/eff^* | rms/err^* | min | max |
| "EventCount" | 7 |
ApplicationMgr INFO Application Manager Stopped successfully
......
......@@ -24,6 +24,7 @@
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import remove_known_warnings
from PyConf.components import findRootObjByDir
countErrorLines({"FATAL": 0, "WARNING": 0, "ERROR": 0},
stdout=remove_known_warnings(stdout))
......@@ -57,7 +58,7 @@ B_vars_stored = sorted(B_vars_stored)
ntuple = './hlt2_B0_test_ntuple.root'
if not os.path.isfile(ntuple): raise Exception(f"File: {ntuple} does not exist!")
f = TFile.Open(ntuple)
t_B = f.Get('Tuple/DecayTree')
t_B = findRootObjByDir(f, 'Tuple', 'DecayTree')
#sort the stores vars
b_names = sorted([b.GetName() for b in t_B.GetListOfLeaves()])
......
......@@ -47,6 +47,8 @@
<text>DaVinciExamples.tupling.AllFunctors:alg_config</text>
</set></argument>
<argument name="validator"><text>
from PyConf.components import findRootObjByDir
findReferenceBlock("""B0DsK_Tuple SUCCESS Booked 1 N-Tuples and 0 Event Tag Collections"""
, stdout, result, causes, signature_offset = 0)
......@@ -65,7 +67,7 @@ ntuple = './DV_example_allFunctors_ntp.root'
if not os.path.isfile(ntuple):
causes.append(f"File {ntuple} does not exist!")
f = TFile.Open(ntuple)
t_B = f.Get('B0DsK_Tuple/DecayTree')
t_B = findRootObjByDir(f, 'B0DsK_Tuple', 'DecayTree')
#sort the stores vars
b_names = sorted([b.GetName() for b in t_B.GetListOfLeaves()])
......
......@@ -47,6 +47,8 @@
<text>DaVinciExamples.tupling.AllFunctors:alg_config</text>
</set></argument>
<argument name="validator"><text>
from PyConf.components import findRootObjByDir
findReferenceBlock("""B0DsK_Tuple SUCCESS Booked 1 N-Tuples and 0 Event Tag Collections"""
, stdout, result, causes, signature_offset = 0)
......@@ -65,7 +67,7 @@ ntuple = './DV_example_allFunctors_ntp_old.root'
if not os.path.isfile(ntuple):
causes.append(f"File {ntuple} does not exist!")
f = TFile.Open(ntuple)
t_B = f.Get('B0DsK_Tuple/DecayTree')
t_B = findRootObjByDir(f, 'B0DsK_Tuple', 'DecayTree')
#sort the stores vars
b_names = sorted([b.GetName() for b in t_B.GetListOfLeaves()])
......
......@@ -23,6 +23,7 @@
</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import remove_known_warnings
from PyConf.components import findRootObjByDir
countErrorLines({"FATAL": 0, "ERROR": 0},
stdout=remove_known_warnings(stdout))
import sys, os
......@@ -40,7 +41,7 @@ B_vars_stored = sorted(B_vars_stored)
ntuple = './passthrough_tuple.root'
if not os.path.isfile(ntuple): raise Exception(f"File: {ntuple} does not exist!")
f = TFile.Open(ntuple)
t_B = f.Get('Bs2JpsiPhi_Tuple/DecayTree')
t_B = findRootObjByDir(f, 'Bs2JpsiPhi_Tuple', 'DecayTree')
#sort the stores vars
b_names = sorted([b.GetName() for b in t_B.GetListOfLeaves()])
......
......@@ -23,6 +23,7 @@
</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import remove_known_warnings
from PyConf.components import findRootObjByDir
countErrorLines({"FATAL": 0, "ERROR": 0},
stdout=remove_known_warnings(stdout))
......@@ -38,9 +39,9 @@ B_vars_stored = sorted(B_vars_stored)
ntuple = './sprucing_tuple.root'
if not os.path.isfile(ntuple): raise Exception(f"File: {ntuple} does not exist!")
f = TFile.Open(ntuple)
t_Original = f.Get('OriginalTuple/DecayTree')
t_Swapped = f.Get('SwappedTuple/DecayTree')
t_Merged = f.Get('MergedTuple/DecayTree')
t_Original = findRootObjByDir(f, 'OriginalTuple', 'DecayTree')
t_Swapped = findRootObjByDir(f, 'SwappedTuple', 'DecayTree')
t_Merged = findRootObjByDir(f, 'MergedTuple', 'DecayTree')
def check_tree(t_B, B_vars_stored):
#sort the stores vars
......
......@@ -25,6 +25,8 @@
input_raw_format: 4.3
</text></argument>
<argument name="validator"><text>
from PyConf.components import findRootObjByDir
import sys, os, glob
from ROOT import TFile
......@@ -73,8 +75,8 @@ Ks_vars_stored = sorted(Ks_vars_stored)
ntuple = './DV-example-tupling-advanced-ntp.root'
if not os.path.isfile(ntuple): raise Exception(f"File: {ntuple} does not exist!")
f = TFile.Open(ntuple)
t_Jpsi = f.Get('DimuonsTuple/DecayTree')
t_Ks = f.Get('KsTuple/DecayTree')
t_Jpsi = findRootObjByDir(f, 'DimuonsTuple', 'DecayTree')
t_Ks = findRootObjByDir(f, 'KsTuple', 'DecayTree')
#sort the stores vars
b_Jpsi_names = sorted([b.GetName() for b in t_Jpsi.GetListOfLeaves()])
......
......@@ -26,6 +26,7 @@
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import preprocessor,remove_known_warnings
from PyConf.components import findRootObjByDir
validateWithReference(preproc = preprocessor)
import sys, os, glob
......@@ -40,7 +41,7 @@ B_vars_stored = sorted(B_vars_stored)
ntuple = './tuple_LbToLcmunu.root'
if not os.path.isfile(ntuple): raise Exception(f"File: {ntuple} does not exist!")
f = TFile.Open(ntuple)
t_B = f.Get('Tuple/DecayTree')
t_B = findRootObjByDir(f, 'Tuple', 'DecayTree')
#sort the stores vars
b_names = sorted([b.GetName() for b in t_B.GetListOfLeaves()])
......
......@@ -26,6 +26,8 @@ validateWithReference(preproc = preprocessor, counter_preproc = counter_preproce
countErrorLines({"FATAL":0, "ERROR":0})
</text></argument>
<argument name="validator"><text>
from PyConf.components import findRootObjByDir
findReferenceBlock("""Tuple_KS2PiPi SUCCESS Booked 1 N-Tuples and 0 Event Tag Collections"""
, stdout, result, causes, signature_offset = 0)
......@@ -35,7 +37,7 @@ from ROOT import TFile
ntuple = './Spruce_DV_Ks_example.root'
if not os.path.isfile(ntuple): raise Exception(f"File: {ntuple} does not exist!")
f = TFile.Open(ntuple)
t_B = f.Get('Tuple_KS2PiPi/DecayTree')
t_B = findRootObjByDir(f, 'Tuple_KS2PiPi', 'DecayTree')
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.")
......
......@@ -27,6 +27,7 @@
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import preprocessor, counter_preprocessor
from PyConf.components import findRootObjByDir
validateWithReference(preproc = preprocessor, counter_preproc = counter_preprocessor)
import sys, os, glob
from ROOT import TFile
......@@ -118,7 +119,7 @@ B_vars_stored = sorted(B_vars_stored)
ntuple = './tuple_D0_Kpi_10evts_fromHlt2_ntuples.root'
if not os.path.isfile(ntuple): raise Exception(f"File: {ntuple} does not exist!")
f = TFile.Open(ntuple)
t_B = f.Get('Tuple/DecayTree')
t_B = findRootObjByDir(f, 'Tuple', 'DecayTree')
#sort the stores vars
b_names = sorted([b.GetName() for b in t_B.GetListOfLeaves()])
......
......@@ -22,6 +22,8 @@
print_freq: 1
</text></argument>
<argument name="validator"><text>
from PyConf.components import findRootObjByDir
findReferenceBlock("""Tuple SUCCESS Booked 1 N-Tuples and 0 Event Tag Collections"""
, stdout, result, causes, signature_offset = 0)
......
......@@ -23,6 +23,7 @@
</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import remove_known_warnings
from PyConf.components import findRootObjByDir
countErrorLines({"FATAL": 0, "WARNING": 0, "ERROR": 0},
stdout=remove_known_warnings(stdout))
import sys, os
......@@ -38,7 +39,7 @@ B_vars_stored = sorted(B_vars_stored)
ntuple = './hlt2_B0_test_ntuple.root'
if not os.path.isfile(ntuple): raise Exception(f"File: {ntuple} does not exist!")
f = TFile.Open(ntuple)
t_B = f.Get('DpiMC/DecayTree')
t_B = findRootObjByDir(f, 'DpiMC', 'DecayTree')
#sort the stores vars
b_names = sorted([b.GetName() for b in t_B.GetListOfLeaves()])
......
......@@ -25,6 +25,7 @@
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
<argument name="validator"><text>
#from DaVinciExamples.QMTest.DaVinciExclusions import preprocessor, counter_preprocessor
from PyConf.components import findRootObjByDir
#validateWithReference(preproc = preprocessor, counter_preproc = counter_preprocessor)
import sys, os, glob
from ROOT import TFile
......@@ -39,8 +40,8 @@ B_vars_stored = sorted(B_vars_stored)
ntuple = './v2_example_ntuples.root'
if not os.path.isfile(ntuple): raise Exception(f"File: {ntuple} does not exist!")
f = TFile.Open(ntuple)
t_B = f.Get('TupleB/DecayTree')
t_K = f.Get('TupleK/DecayTree')
t_B = findRootObjByDir(f, 'TupleB', 'DecayTree')
t_K = findRootObjByDir(f, 'TupleK', 'DecayTree')
#sort the stores vars
b_names = sorted([b.GetName() for b in t_B.GetListOfLeaves()])
......
......@@ -25,6 +25,7 @@
ntuple_file: "davinci_filters_ntuple.root"
histo_file: "davinci_filters_histos.root"
print_freq: 1
write_decoding_keys_to_git: false
</text></argument>
<argument name="reference"><text>../refs/test_davinci_filters.ref</text></argument>
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
......
......@@ -24,11 +24,13 @@
histo_file: DV-test-array-his.root
ntuple_file: DV-test-array-ntp.root
input_process: Spruce
write_decoding_keys_to_git: false
</text></argument>
<argument name="reference"><text>../refs/test_davinci_funtuple_array.ref</text></argument>
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import preprocessor, counter_preprocessor
from PyConf.components import findRootObjByDir
validateWithReference(preproc = preprocessor, counter_preproc = counter_preprocessor)
import os
......@@ -40,7 +42,7 @@ vars_stored = []
ntuple = "DV-test-array-ntp.root"
if not os.path.isfile(ntuple): raise Exception(f"File: {ntuple} does not exist!")
infile = TFile.Open(ntuple)
intree = infile.Get('B0DsK_Tuple/DecayTree')
intree = findRootObjByDir(infile, 'B0DsK_Tuple', 'DecayTree')
assert intree.GetEntries()
......
......@@ -23,6 +23,7 @@
ntuple_file: test_recVertices.root
histo_file: test_recVertices_hist.root
print_freq: 1
write_decoding_keys_to_git: false
</text></argument>
<argument name="reference"><text>../refs/test_davinci_recVertices.ref</text></argument>
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
......
......@@ -22,6 +22,7 @@
ntuple_file: 'DVtest_useralgs_ntp.root'
histo_file: 'DVtest_useralgs_his.root'
evt_max: 10
write_decoding_keys_to_git: false
</text></argument>
<argument name="reference"><text>../refs/test_davinci_user_algs.ref</text></argument>
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
......
......@@ -33,8 +33,8 @@ findReferenceBlock("""TightD02KK
| Counter | # | sum | mean/eff^* | rms/err^* | min | max |
|*"# passed" | 21 | 19 |( 90.47619 +- 6.405645)% |
|*"# passed CombinationCut" | 803 | 39 |( 4.856787 +- 0.7585875)% |
|*"# passed CompositeCut" | 39 | 39 |( 100.0000 +- 0.000000)% |
|*"# passed vertex fit" | 39 | 39 |( 100.0000 +- 0.000000)% |
|*"# passed CompositeCut" | 39 | 39 |( 100.0000 +- 0.000000)% |
|*"# passed vertex fit" | 39 | 39 |( 100.0000 +- 0.000000)% |
| "Input1 size" | 21 | 258 | 12.286 |
| "Input2 size" | 21 | 258 | 12.286 |
""", stdout, result, causes, signature_offset = 0, id = "Stream3")
......
......@@ -20,6 +20,7 @@
<argument name="extra_options_yaml"><text>
evt_max: 200
input_process: Boole
write_decoding_keys_to_git: false
</text></argument>
<argument name="reference"><text>../refs/test_davinci_read_mc_digi.ref</text></argument>
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
......
......@@ -20,6 +20,7 @@
<argument name="extra_options_yaml"><text>
evt_max: 200
input_process: Brunel
write_decoding_keys_to_git: false
</text></argument>
<argument name="reference"><text>../refs/test_davinci_read_mc_ldst.ref</text></argument>
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
......
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