From 97077a10610a2f500eae8f88a2c58aa5f8a14b12 Mon Sep 17 00:00:00 2001
From: Dan Guest <dguest@cern.ch>
Date: Tue, 27 Feb 2024 18:23:33 +0100
Subject: [PATCH] trigger xaod on seqname

---
 EasyjetHub/python/output/xaod.py                   | 10 ++++++++--
 EasyjetHub/python/steering/main_sequence_config.py |  2 +-
 bbbbAnalysis/bin/bbbb-ntupler                      |  2 +-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/EasyjetHub/python/output/xaod.py b/EasyjetHub/python/output/xaod.py
index 8056d23f9..734c7b56c 100644
--- a/EasyjetHub/python/output/xaod.py
+++ b/EasyjetHub/python/output/xaod.py
@@ -13,10 +13,11 @@ def container(typename, key, items=[]):
     ]
 
 
-def get_xaod_cfg(flags):
+def get_xaod_cfg(flags, seqname):
     ca = ComponentAccumulator()
     # first we make copies of the jet collection, because reasons
     jetcol = flags.Analysis.container_names.input[flags.Analysis.small_R_jet.jet_type]
+    AcceptAlgs = [seqname]
     ca.addEventAlgo(CompFactory.Easyjet.JetDeepCopyAlg(
         name="jetdeepcopy",
         jetsIn=jetcol.replace("%SYS%", "NOSYS"),
@@ -30,6 +31,11 @@ def get_xaod_cfg(flags):
         flags,
         "AOD",
         ItemList=item_list,
+        AcceptAlgs=AcceptAlgs,
+    ))
+    ca.merge(SetupMetaDataForStreamCfg(
+        flags,
+        streamName="AOD",
+        AcceptAlgs=AcceptAlgs
     ))
-    ca.merge(SetupMetaDataForStreamCfg(flags, streamName="AOD"))
     return ca
diff --git a/EasyjetHub/python/steering/main_sequence_config.py b/EasyjetHub/python/steering/main_sequence_config.py
index a98130f0d..62c2a97e4 100644
--- a/EasyjetHub/python/steering/main_sequence_config.py
+++ b/EasyjetHub/python/steering/main_sequence_config.py
@@ -163,7 +163,7 @@ def output_cfg(flags, seqname):
 
     if flags.Output.AODFileName:
         cfg.merge(
-            get_xaod_cfg(flags),
+            get_xaod_cfg(flags, seqname),
             seqname
         )
 
diff --git a/bbbbAnalysis/bin/bbbb-ntupler b/bbbbAnalysis/bin/bbbb-ntupler
index 09a37c95b..98fd87a54 100755
--- a/bbbbAnalysis/bin/bbbb-ntupler
+++ b/bbbbAnalysis/bin/bbbb-ntupler
@@ -113,7 +113,7 @@ def hh4b_job_cfg():
 
     if flags.Output.AODFileName:
         cfg.merge(
-            get_xaod_cfg(flags),
+            get_xaod_cfg(flags, seqname),
             seqname
         )
 
-- 
GitLab