From 3378825621fc118e5617855738406c1e4c343429 Mon Sep 17 00:00:00 2001
From: amathad <amathad@cern.ch>
Date: Tue, 2 May 2023 20:51:42 +0200
Subject: [PATCH] test to array of ints also

---
 ...davinci_tupling_from_hlt2_with_matching.py | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2_with_matching.py b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2_with_matching.py
index f19a163d0..2bd875549 100644
--- a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2_with_matching.py
+++ b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2_with_matching.py
@@ -94,7 +94,8 @@ def main(options: Options):
         long_electrons = make_long_electrons_with_brem()
 
     relation_table_match_by_veloid = VeloIDOverlapRelationTable(
-        MatchFrom=basic_particles_dz_to_kpi, MatchTo=long_electrons)
+        MatchFrom=basic_particles_dz_to_kpi,
+        MatchTo=long_electrons).OutputRelations
 
     # make electrons with some cuts
     with reconstruction.bind(from_file=True, spruce=True):
@@ -103,7 +104,8 @@ def main(options: Options):
             Cut=F.FILTER(F.require_all(F.PT > 500. * MeV, F.PID_E > 1.)))
     # make a test relation table
     relation_table_match_by_veloid_tight_cuts = VeloIDOverlapRelationTable(
-        MatchFrom=basic_particles_dz_to_kpi, MatchTo=long_electrons_tight_cuts)
+        MatchFrom=basic_particles_dz_to_kpi,
+        MatchTo=long_electrons_tight_cuts).OutputRelations
 
     my_filter = create_lines_filter(
         name="HDRFilter_D0Kpi", lines=[f"{line_name}"])
@@ -111,15 +113,16 @@ def main(options: Options):
     variables["piplus"] += FunctorCollection({
         'Matched_to_Electron_P[nMatchTracks]':
         F.MAP_INPUT_ARRAY(
-            Functor=F.P,
-            Relations=relation_table_match_by_veloid.OutputRelations),
+            Functor=F.P, Relations=relation_table_match_by_veloid),
         "Matched_to_Electron_Weight[nMatchTracks]":
-        F.MAP_WEIGHT(Relations=relation_table_match_by_veloid.OutputRelations),
+        F.MAP_WEIGHT(Relations=relation_table_match_by_veloid),
         'Matched_to_Electron_P_tight_cuts[nMatchTracks_tight_cuts]':
         F.MAP_INPUT_ARRAY(
-            Functor=F.P,
-            Relations=relation_table_match_by_veloid_tight_cuts.
-            OutputRelations),
+            Functor=F.P, Relations=relation_table_match_by_veloid_tight_cuts),
+        'Matched_to_Electron_ID_tight_cuts[nMatchTracks_tight_cuts]':
+        F.MAP_INPUT_ARRAY(
+            Functor=F.PARTICLE_ID,
+            Relations=relation_table_match_by_veloid_tight_cuts),
     })
 
     evt_variables = FC.SelectionInfo(
-- 
GitLab