From 065ce2e27fb523caf3624124add1d1df2e2e6c8d Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu <tommaso.fulghesu@cern.ch> Date: Tue, 14 Feb 2023 14:20:29 +0100 Subject: [PATCH 1/3] Add default values to relations functors (and renaming) --- .../DaVinciExamples/tupling/lhcb-metainfo | 1 + ...n_davinci_tupling_relation_isovariables.py} | 18 +++++++++--------- ..._davinci_tupling_relation_isovariables.qmt} | 4 ++-- ..._davinci_tupling_relation_isovariables.ref} | 0 ..._tupling_relation_isovariables.ref.detdesc} | 0 5 files changed, 12 insertions(+), 11 deletions(-) create mode 160000 DaVinciExamples/python/DaVinciExamples/tupling/lhcb-metainfo rename DaVinciExamples/python/DaVinciExamples/tupling/{option_davinci_tupling_weightedrelation_trackvariables.py => option_davinci_tupling_relation_isovariables.py} (81%) rename DaVinciExamples/tests/qmtest/tupling.qms/{test_davinci_tupling_weightedrelation_trackvariables.qmt => test_davinci_tupling_relation_isovariables.qmt} (91%) rename DaVinciExamples/tests/refs/{test_davinci_tupling_weightedrelation_trackvariables.ref => test_davinci_tupling_relation_isovariables.ref} (100%) rename DaVinciExamples/tests/refs/{test_davinci_tupling_weightedrelation_trackvariables.ref.detdesc => test_davinci_tupling_relation_isovariables.ref.detdesc} (100%) diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/lhcb-metainfo b/DaVinciExamples/python/DaVinciExamples/tupling/lhcb-metainfo new file mode 160000 index 000000000..e228211a0 --- /dev/null +++ b/DaVinciExamples/python/DaVinciExamples/tupling/lhcb-metainfo @@ -0,0 +1 @@ +Subproject commit e228211a03d3a141b83ce545e875422b6a3d4cd2 diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_weightedrelation_trackvariables.py b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_relation_isovariables.py similarity index 81% rename from DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_weightedrelation_trackvariables.py rename to DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_relation_isovariables.py index 216295200..320f59022 100644 --- a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_weightedrelation_trackvariables.py +++ b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_relation_isovariables.py @@ -15,7 +15,7 @@ looks at the TES location which contains the tagged particles and creates a 'one relating all the available tracks to the B candidate of the events. Important: Setting DVPATH properly. -To run the example: $DVPATH/run lbexec option_davinci_tupling_weightedrelation_trackvariables:main $DVPATH/DaVinciExamples/example_data/spruce_b2jpsik_opt.yaml +To run the example: $DVPATH/run lbexec option_davinci_tupling_relation_isovariables:main $DVPATH/DaVinciExamples/example_data/spruce_b2jpsik_opt.yaml """ from PyConf.Algorithms import WeightedRelTableAlg @@ -52,21 +52,21 @@ def main(options: Options): 'THOR_MASS': F.MASS, "First_P": - F.MAP_INPUT(Functor=F.P, Relations=ftAlg_Rels), + F.VALUE_OR(0.) @ F.MAP_INPUT(Functor=F.P, Relations=ftAlg_Rels), "First_PT": - F.MAP_INPUT(Functor=F.PT, Relations=ftAlg_Rels), + F.VALUE_OR(0.) @ F.MAP_INPUT(Functor=F.PT, Relations=ftAlg_Rels), "Sum_P": - F.SUMCONE(Functor=F.P, Relations=ftAlg_Rels), + F.VALUE_OR(0.) @ F.SUMCONE(Functor=F.P, Relations=ftAlg_Rels), "Sum_PT": - F.SUMCONE(Functor=F.PT, Relations=ftAlg_Rels), + F.VALUE_OR(0.) @ F.SUMCONE(Functor=F.PT, Relations=ftAlg_Rels), "Max_P": - F.MAXCONE(Functor=F.P, Relations=ftAlg_Rels), + F.VALUE_OR(0.) @ F.MAXCONE(Functor=F.P, Relations=ftAlg_Rels), "Max_PT": - F.MAXCONE(Functor=F.PT, Relations=ftAlg_Rels), + F.VALUE_OR(0.) @ F.MAXCONE(Functor=F.PT, Relations=ftAlg_Rels), "Min_P": - F.MINCONE(Functor=F.P, Relations=ftAlg_Rels), + F.VALUE_OR(0.) @ F.MINCONE(Functor=F.P, Relations=ftAlg_Rels), "Min_PT": - F.MINCONE(Functor=F.PT, Relations=ftAlg_Rels), + F.VALUE_OR(0.) @ F.MINCONE(Functor=F.PT, Relations=ftAlg_Rels), "Asym_P": F.ASYM(Functor=F.P, Relations=ftAlg_Rels), "Asym_PT": diff --git a/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_weightedrelation_trackvariables.qmt b/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_relation_isovariables.qmt similarity index 91% rename from DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_weightedrelation_trackvariables.qmt rename to DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_relation_isovariables.qmt index f26015bf6..76d0b95da 100644 --- a/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_weightedrelation_trackvariables.qmt +++ b/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_relation_isovariables.qmt @@ -15,7 +15,7 @@ <extension class="GaudiTest.GaudiExeTest" kind="test"> <argument name="program"><text>lbexec</text></argument> <argument name="args"><set> - <text>DaVinciExamples.tupling.option_davinci_tupling_weightedrelation_trackvariables:main</text> + <text>DaVinciExamples.tupling.option_davinci_tupling_relation_isovariables:main</text> </set></argument> <argument name="options_yaml_fn"><text>$DAVINCIEXAMPLESROOT/example_data/spruce_b2jpsik_opt.yaml</text></argument> <argument name="extra_options_yaml"><text> @@ -28,7 +28,7 @@ input_process: Turbo </text></argument> <argument name="timeout"><integer>3600</integer></argument> - <argument name="reference"><text>$DAVINCIEXAMPLESROOT/tests/refs/test_davinci_tupling_weightedrelation_trackvariables.ref</text></argument> + <argument name="reference"><text>$DAVINCIEXAMPLESROOT/tests/refs/test_davinci_tupling_relation_isovariables.ref</text></argument> <argument name="validator"><text> findReferenceBlock("""Tuple SUCCESS ID=DecayTree Title="DecayTree" #items=34 {EVENTNUMBER,RUNNUMBER,B_THOR_P,B_THOR_PT,B_THOR_MASS,B_First_P,B_First_PT,B_Sum_P}""") countErrorLines({"FATAL":0, "ERROR":0}) diff --git a/DaVinciExamples/tests/refs/test_davinci_tupling_weightedrelation_trackvariables.ref b/DaVinciExamples/tests/refs/test_davinci_tupling_relation_isovariables.ref similarity index 100% rename from DaVinciExamples/tests/refs/test_davinci_tupling_weightedrelation_trackvariables.ref rename to DaVinciExamples/tests/refs/test_davinci_tupling_relation_isovariables.ref diff --git a/DaVinciExamples/tests/refs/test_davinci_tupling_weightedrelation_trackvariables.ref.detdesc b/DaVinciExamples/tests/refs/test_davinci_tupling_relation_isovariables.ref.detdesc similarity index 100% rename from DaVinciExamples/tests/refs/test_davinci_tupling_weightedrelation_trackvariables.ref.detdesc rename to DaVinciExamples/tests/refs/test_davinci_tupling_relation_isovariables.ref.detdesc -- GitLab From da021de82d8702f7c9d5a5e6e2903affe425204c Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu <tommaso.fulghesu@cern.ch> Date: Fri, 17 Feb 2023 10:44:22 +0100 Subject: [PATCH 2/3] Remove default values --- ...tion_davinci_tupling_relation_isovariables.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_relation_isovariables.py b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_relation_isovariables.py index 320f59022..1f7dd622e 100644 --- a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_relation_isovariables.py +++ b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_relation_isovariables.py @@ -52,21 +52,21 @@ def main(options: Options): 'THOR_MASS': F.MASS, "First_P": - F.VALUE_OR(0.) @ F.MAP_INPUT(Functor=F.P, Relations=ftAlg_Rels), + F.MAP_INPUT(Functor=F.P, Relations=ftAlg_Rels), "First_PT": - F.VALUE_OR(0.) @ F.MAP_INPUT(Functor=F.PT, Relations=ftAlg_Rels), + F.MAP_INPUT(Functor=F.PT, Relations=ftAlg_Rels), "Sum_P": - F.VALUE_OR(0.) @ F.SUMCONE(Functor=F.P, Relations=ftAlg_Rels), + F.SUMCONE(Functor=F.P, Relations=ftAlg_Rels), "Sum_PT": - F.VALUE_OR(0.) @ F.SUMCONE(Functor=F.PT, Relations=ftAlg_Rels), + F.SUMCONE(Functor=F.PT, Relations=ftAlg_Rels), "Max_P": - F.VALUE_OR(0.) @ F.MAXCONE(Functor=F.P, Relations=ftAlg_Rels), + F.MAXCONE(Functor=F.P, Relations=ftAlg_Rels), "Max_PT": - F.VALUE_OR(0.) @ F.MAXCONE(Functor=F.PT, Relations=ftAlg_Rels), + F.MAXCONE(Functor=F.PT, Relations=ftAlg_Rels), "Min_P": - F.VALUE_OR(0.) @ F.MINCONE(Functor=F.P, Relations=ftAlg_Rels), + F.MINCONE(Functor=F.P, Relations=ftAlg_Rels), "Min_PT": - F.VALUE_OR(0.) @ F.MINCONE(Functor=F.PT, Relations=ftAlg_Rels), + F.MINCONE(Functor=F.PT, Relations=ftAlg_Rels), "Asym_P": F.ASYM(Functor=F.P, Relations=ftAlg_Rels), "Asym_PT": -- GitLab From 1f6a4aeffca7349acf65c47ec41b69d82388a6cc Mon Sep 17 00:00:00 2001 From: Tommaso Fulghesu <tommaso.fulghesu@cern.ch> Date: Fri, 17 Feb 2023 10:51:39 +0100 Subject: [PATCH 3/3] Remove directory --- DaVinciExamples/python/DaVinciExamples/tupling/lhcb-metainfo | 1 - 1 file changed, 1 deletion(-) delete mode 160000 DaVinciExamples/python/DaVinciExamples/tupling/lhcb-metainfo diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/lhcb-metainfo b/DaVinciExamples/python/DaVinciExamples/tupling/lhcb-metainfo deleted file mode 160000 index e228211a0..000000000 --- a/DaVinciExamples/python/DaVinciExamples/tupling/lhcb-metainfo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e228211a03d3a141b83ce545e875422b6a3d4cd2 -- GitLab