From 472bbc71c12ae0ef34e5d1d7b27cf8ce8e0960e9 Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Tue, 25 Jan 2022 12:38:03 +0100 Subject: [PATCH] TrigOutputHandling: use OrderedSet semantics in TriggerEDMSerialiserTool Use `OrderedSet` semantics for the "CollectionsToSerialize" property instead of defining our own merge semantics in Python. Note that we could have also just used a `set::set` in C++, which would have the same effect (but the Python type would still be `list`, which is a bit confusing maybe). --- .../python/TrigOutputHandlingConfig.py | 11 +---------- .../TrigOutputHandling/src/TriggerEDMSerialiserTool.h | 5 +++-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py b/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py index 685efd720c9..b2215369d1d 100644 --- a/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py +++ b/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentFactory import CompFactory @@ -70,15 +70,6 @@ def TriggerEDMSerialiserToolCfg(name="Serialiser"): # Create and return a serialiser tool object serialiser = TriggerEDMSerialiserTool(name) - # Allow appending to the collections list - def merge_collection_list(a, b): - for item in b: - if item not in a: - a.append(item) - return a - serialiser._descriptors['CollectionsToSerialize'].semantics.merge = merge_collection_list - - from TrigEDMConfig.TriggerEDMRun3 import tpMap tpTool = CompFactory.TrigSerTPTool() tpTool.TPMap = tpMap() diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h index 4a66e05b4ca..e2e687125b9 100644 --- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h +++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGOUTPUTHANDLING_TRIGGEREDMSERIALISERTOOL_H #define TRIGOUTPUTHANDLING_TRIGGEREDMSERIALISERTOOL_H @@ -55,7 +55,8 @@ class TriggerEDMSerialiserTool: public extends "formatted like for AthenaOutputStream, e.g. TYPE#SG.aux1.aux2..etc. For xAOD classes the typedef type should be " "used and the _vN version number is automatically detected. For old T/P classes the persistent version has to be " "given. Module IDs following the semicolon are the HLT result ROB module IDs to which the collection should be " - "written. ID=0 is the main result, other IDs are used for data scouting." + "written. ID=0 is the main result, other IDs are used for data scouting.", + "OrderedSet" }; Gaudi::Property m_saveDynamic { this, "SaveDynamic", true, "If false skips serialising of dynamic variables. Use for test purpose only." -- GitLab