Commit 36e3d791 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

TrigNavTools: use xAODConfigSvc in Run3 navigation converter

Use the TrigConfigSvc configured in the TrigDecisionTool (xAODConfigSvc) to
access the list of trigger chains. Also make the `xAODConfigSvc` the
default in C++ and rename the property to `TrigConfigSvc`.
parent 658ff8b0
...@@ -22,20 +22,25 @@ def createNavConverterAlg(): ...@@ -22,20 +22,25 @@ def createNavConverterAlg():
def NavConverterCfg(flags): def NavConverterCfg(flags):
acc = ComponentAccumulator() acc = ComponentAccumulator()
from TrigConfigSvc.TrigConfigSvcCfg import HLTConfigSvcCfg from TrigDecisionTool.TrigDecisionToolConfig import getTrigDecisionTool
configSvcAcc = HLTConfigSvcCfg(flags) tdt_ca = getTrigDecisionTool(flags)
service = configSvcAcc.getService("HLTConfigSvc") #TODO fetching the HLTConfigSvc should rely on the fact that it tdt = tdt_ca.getPrimary()
acc.merge(configSvcAcc) acc.merge(tdt_ca)
cnvAlg = createNavConverterAlg() cnvAlg = createNavConverterAlg()
cnvAlg.HLTConfigSvc = service cnvAlg.TrigDecisionTool = tdt
cnvAlg.TrigConfigSvc = tdt.TrigConfigSvc
acc.addEventAlgo(cnvAlg) acc.addEventAlgo(cnvAlg)
return acc return acc
if __name__ == "__main__": if __name__ == "__main__":
from AthenaConfiguration.AllConfigFlags import ConfigFlags from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.TestDefaults import defaultTestFiles
ConfigFlags.Input.Files = defaultTestFiles.RAW
ConfigFlags.lock() ConfigFlags.lock()
acc = NavConverterCfg(ConfigFlags) acc = NavConverterCfg(ConfigFlags)
acc.printConfig(withDetails=True, summariseProps=True) acc.printConfig(withDetails=True, summariseProps=True)
acc.wasMerged() acc.wasMerged()
#!/usr/bin/env python #!/usr/bin/env python
# #
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
# #
if __name__=='__main__': if __name__=='__main__':
...@@ -36,10 +36,10 @@ if __name__=='__main__': ...@@ -36,10 +36,10 @@ if __name__=='__main__':
from AthenaServices.MetaDataSvcConfig import MetaDataSvcCfg from AthenaServices.MetaDataSvcConfig import MetaDataSvcCfg
cfg.merge(MetaDataSvcCfg(ConfigFlags)) cfg.merge(MetaDataSvcCfg(ConfigFlags))
confSvc = CompFactory.TrigConf.xAODConfigSvc("HLTConfigSvc") confSvc = CompFactory.TrigConf.xAODConfigSvc("xAODConfigSvc")
cfg.addService(confSvc) cfg.addService(confSvc)
from AthenaCommon.Constants import DEBUG from AthenaCommon.Constants import DEBUG
alg = CompFactory.Run2ToRun3TrigNavConverter("TrigNavCnv", OutputLevel=DEBUG, HLTConfigSvc=confSvc) alg = CompFactory.Run2ToRun3TrigNavConverter("TrigNavCnv", OutputLevel=DEBUG, TrigConfigSvc=confSvc)
alg.doPrint = False alg.doPrint = False
alg.Collections = ["xAOD::MuonContainer","xAOD::L2StandAloneMuonContainer"] alg.Collections = ["xAOD::MuonContainer","xAOD::L2StandAloneMuonContainer"]
......
/* /*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef TRIGNAVTOOLS_RUN2TORUN3TRIGNAVCONVERTER_H #ifndef TRIGNAVTOOLS_RUN2TORUN3TRIGNAVCONVERTER_H
#define TRIGNAVTOOLS_RUN2TORUN3TRIGNAVCONVERTER_H #define TRIGNAVTOOLS_RUN2TORUN3TRIGNAVCONVERTER_H
...@@ -48,7 +48,7 @@ private: ...@@ -48,7 +48,7 @@ private:
Gaudi::Property<std::vector<std::string>> m_chainsToSave{ this, "Chains", {} }; Gaudi::Property<std::vector<std::string>> m_chainsToSave{ this, "Chains", {} };
Gaudi::Property<std::vector<std::string>> m_roisToSave{ this, "Rois", {} }; Gaudi::Property<std::vector<std::string>> m_roisToSave{ this, "Rois", {} };
ServiceHandle< TrigConf::IHLTConfigSvc > m_configSvc { this, "HLTConfigSvc", "HLTConfigSvc", "HLTConfig Service" }; ServiceHandle< TrigConf::IHLTConfigSvc > m_configSvc { this, "TrigConfigSvc", "TrigConf::xAODConfigSvc/xAODConfigSvc", "Trigger configuration service" };
ServiceHandle<IClassIDSvc> m_clidSvc{ this, "ClassIDSvc", "ClassIDSvc", "Service to translate CLID to class name" }; ServiceHandle<IClassIDSvc> m_clidSvc{ this, "ClassIDSvc", "ClassIDSvc", "Service to translate CLID to class name" };
SG::WriteHandleKey<xAOD::TrigCompositeContainer> m_trigNavWriteKey { this, "TrigNavWriteKey", "HLTNav_All" }; SG::WriteHandleKey<xAOD::TrigCompositeContainer> m_trigNavWriteKey { this, "TrigNavWriteKey", "HLTNav_All" };
SG::WriteHandleKey<xAOD::TrigCompositeContainer> m_trigSummaryWriteKey { this, "TrigSummaryWriteKey", "HLTNav_Summary" }; SG::WriteHandleKey<xAOD::TrigCompositeContainer> m_trigSummaryWriteKey { this, "TrigSummaryWriteKey", "HLTNav_Summary" };
......
...@@ -202,7 +202,7 @@ class TrigDecisionGetterRun1or2(Configured): ...@@ -202,7 +202,7 @@ class TrigDecisionGetterRun1or2(Configured):
if (ConfigFlags.Trigger.EDMVersion == 1 or ConfigFlags.Trigger.EDMVersion == 2) and ConfigFlags.Trigger.doEDMVersionConversion: if (ConfigFlags.Trigger.EDMVersion == 1 or ConfigFlags.Trigger.EDMVersion == 2) and ConfigFlags.Trigger.doEDMVersionConversion:
from TrigNavTools.NavConverterConfig import createNavConverterAlg from TrigNavTools.NavConverterConfig import createNavConverterAlg
navCnvAlg = createNavConverterAlg() navCnvAlg = createNavConverterAlg()
navCnvAlg.HLTConfigSvc = "HLTConfigSvcRun3" navCnvAlg.TrigConfigSvc = "HLTConfigSvcRun3"
navCnvAlg.ExtraInputs += [("TrigBSExtractionOutput", "StoreGateSvc+TrigBSExtractionOutput")] navCnvAlg.ExtraInputs += [("TrigBSExtractionOutput", "StoreGateSvc+TrigBSExtractionOutput")]
topSequence += navCnvAlg topSequence += navCnvAlg
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment