From 05f80aaba12eca4ea4fede703371ea6880c38021 Mon Sep 17 00:00:00 2001
From: Jiahui Zhuo <jiahui.zhuo@cern.ch>
Date: Wed, 5 Jul 2023 09:21:29 +0200
Subject: [PATCH 1/2] Add test to new ValueOr

---
 .../option_davinci_tupling_DTF_substitutePID.py        | 10 +++++++++-
 .../tupling.qms/test_davinci_tupling_DTF_SubsPID.qmt   |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_DTF_substitutePID.py b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_DTF_substitutePID.py
index 9aecea2af..65f3d37a3 100644
--- a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_DTF_substitutePID.py
+++ b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_DTF_substitutePID.py
@@ -87,7 +87,15 @@ def main(options: Options):
         }
     )
 
-    variables = {"ALL": variables_all}
+    variables_decay = FunctorCollection(
+        {
+            # Test the invalid value for LinAlg::Vec
+            "DTF_JpsiKst_ENDVERTEX": F.VALUE_OR((-1,-1,-1)) @ DTF_JpsiKst( F.ENDVERTEX_POS ),
+            "DTF_JpsiPhi_ENDVERTEX": F.VALUE_OR((-1,-1,-1)) @ DTF_JpsiPhi( F.ENDVERTEX_POS )
+        }
+    )
+
+    variables = {"ALL": variables_all, 'Bs': variables_decay}
 
     # Configure Funtuple algorithm
     tuple_data = Funtuple(
diff --git a/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_DTF_SubsPID.qmt b/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_DTF_SubsPID.qmt
index 24d1aab1f..8216f6265 100644
--- a/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_DTF_SubsPID.qmt
+++ b/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_DTF_SubsPID.qmt
@@ -32,6 +32,7 @@ from ROOT import TFile
 
 B_vars_stored = ['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_DTF_JpsiPhi_P', 'Phi_ORIGINAL_CHI2DOF', 'Phi_ORIGINAL_ENERGY', 'Phi_ORIGINAL_ID', 'Phi_ORIGINAL_M', 'Phi_ORIGINAL_P']
 B_vars_stored += ['RUNNUMBER', 'EVENTNUMBER']
+B_vars_stored += ['Bs_DTF_JpsiKst_ENDVERTEX', 'Bs_DTF_JpsiPhi_ENDVERTEX']
 
 
 #sort the expected vars
-- 
GitLab


From 8db51a85862b85627c371ac32b3b033ee4eef930 Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Wed, 5 Jul 2023 07:22:00 +0000
Subject: [PATCH 2/2] pre-commit fixes

patch generated by https://gitlab.cern.ch/lhcb/DaVinci/-/jobs/30801995
---
 .../tupling/option_davinci_tupling_DTF_substitutePID.py   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_DTF_substitutePID.py b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_DTF_substitutePID.py
index 65f3d37a3..d7cdd5009 100644
--- a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_DTF_substitutePID.py
+++ b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_DTF_substitutePID.py
@@ -90,12 +90,14 @@ def main(options: Options):
     variables_decay = FunctorCollection(
         {
             # Test the invalid value for LinAlg::Vec
-            "DTF_JpsiKst_ENDVERTEX": F.VALUE_OR((-1,-1,-1)) @ DTF_JpsiKst( F.ENDVERTEX_POS ),
-            "DTF_JpsiPhi_ENDVERTEX": F.VALUE_OR((-1,-1,-1)) @ DTF_JpsiPhi( F.ENDVERTEX_POS )
+            "DTF_JpsiKst_ENDVERTEX": F.VALUE_OR((-1, -1, -1))
+            @ DTF_JpsiKst(F.ENDVERTEX_POS),
+            "DTF_JpsiPhi_ENDVERTEX": F.VALUE_OR((-1, -1, -1))
+            @ DTF_JpsiPhi(F.ENDVERTEX_POS),
         }
     )
 
-    variables = {"ALL": variables_all, 'Bs': variables_decay}
+    variables = {"ALL": variables_all, "Bs": variables_decay}
 
     # Configure Funtuple algorithm
     tuple_data = Funtuple(
-- 
GitLab