Skip to content
Snippets Groups Projects
Commit 80246865 authored by Tim Martin's avatar Tim Martin Committed by Edward Moyse
Browse files

[ATR-22386] Integrate trigger doEDMVersionConversion into CA PHYS and PHYSLITE

Work the doEDMVersionConversion flag into derivations PHYS and PHYSLITE. With PHYS this additonally envokes a full dump of trigger data for development of this flag
parent 9dea5b41
No related merge requests found
Showing
with 133 additions and 80 deletions
...@@ -148,10 +148,24 @@ def PHYSCfg(ConfigFlags): ...@@ -148,10 +148,24 @@ def PHYSCfg(ConfigFlags):
AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSSlimmingHelper, AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSSlimmingHelper,
OutputContainerPrefix = "TrigMatch_", OutputContainerPrefix = "TrigMatch_",
TriggerList = PHYSTriggerListsHelper.Run2TriggerNamesNoTau) TriggerList = PHYSTriggerListsHelper.Run2TriggerNamesNoTau)
# Run 3 # Run 3, or Run 2 with navigation conversion
if ConfigFlags.Trigger.EDMVersion == 3: if ConfigFlags.Trigger.EDMVersion == 3 or (ConfigFlags.Trigger.EDMVersion == 2 and ConfigFlags.Trigger.doEDMVersionConversion):
from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(PHYSSlimmingHelper) AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(PHYSSlimmingHelper)
#####################################################
## NOTE: This block is temporary, during validation of the doEDMVersionConversion flag.
## This adds a LOT of containers to the output! In order to help validate the conversion.
## It should be removed once doEDMVersionConversion goes into production use.
if ConfigFlags.Trigger.doEDMVersionConversion:
from DerivationFrameworkTrigger.TrigSlimmingHelper import addTrigEDMSetToOutput
from AthenaCommon.Logging import logging
msg = logging.getLogger('PHYSCfg')
msg.warn('doEDMVersionConversion is still in validation, WRITING FULL TRIGGER EDM TO THE DAOD!')
addTrigEDMSetToOutput(ConfigFlags, PHYSSlimmingHelper, "AODFULL")
PHYSSlimmingHelper.AppendToDictionary.update({'HLTNav_R2ToR3Summary':'xAOD::TrigCompositeContainer'})
PHYSSlimmingHelper.AllVariables += ['HLTNav_R2ToR3Summary']
##
#####################################################
# Output stream # Output stream
PHYSItemList = PHYSSlimmingHelper.GetItemList() PHYSItemList = PHYSSlimmingHelper.GetItemList()
......
...@@ -223,11 +223,12 @@ def PHYSLITECfg(ConfigFlags): ...@@ -223,11 +223,12 @@ def PHYSLITECfg(ConfigFlags):
AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSLITESlimmingHelper, AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSLITESlimmingHelper,
OutputContainerPrefix = "AnalysisTrigMatch_", OutputContainerPrefix = "AnalysisTrigMatch_",
TriggerList = PHYSLITETriggerListsHelper.Run2TriggerNamesNoTau) TriggerList = PHYSLITETriggerListsHelper.Run2TriggerNamesNoTau)
# Run 3
if ConfigFlags.Trigger.EDMVersion == 3: # Run 3, or Run 2 with navigation conversion
if ConfigFlags.Trigger.EDMVersion == 3 or (ConfigFlags.Trigger.EDMVersion == 2 and ConfigFlags.Trigger.doEDMVersionConversion):
# No need to run matching: just keep navigation so matching can be done by analysts # No need to run matching: just keep navigation so matching can be done by analysts
from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(PHYSLITESlimmingHelper) AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(PHYSLITESlimmingHelper)
# Event content # Event content
PHYSLITESlimmingHelper.AppendToDictionary.update({ PHYSLITESlimmingHelper.AppendToDictionary.update({
......
...@@ -91,10 +91,16 @@ def PhysCommonAugmentationsCfg(ConfigFlags,**kwargs): ...@@ -91,10 +91,16 @@ def PhysCommonAugmentationsCfg(ConfigFlags,**kwargs):
# Trigger matching # Trigger matching
if ConfigFlags.Reco.EnableTrigger or ConfigFlags.Trigger.triggerConfig == 'INFILE': if ConfigFlags.Reco.EnableTrigger or ConfigFlags.Trigger.triggerConfig == 'INFILE':
from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2Cfg from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2Cfg
from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2ToRun3Cfg
from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun3Cfg from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun3Cfg
# requires some wrangling due to the difference between run 2 and 3 # requires some wrangling due to the difference between run 2 and 3
triggerListsHelper = kwargs['TriggerListsHelper'] triggerListsHelper = kwargs['TriggerListsHelper']
if ConfigFlags.Trigger.EDMVersion == 2: if ConfigFlags.Trigger.EDMVersion == 2:
# NOTE: Once Run-2 -> Run-3 trigger navigation is validated and doEDMVersionConversion is on by default, we will only want to do ONE of
# TriggerMatchingCommonRun2Cfg(s) OR TriggerMatchingCommonRun2ToRun3Cfg
# Otherwise we are doubling up on the analysis trigger data in both the Run-2 and Run-3 formats.
# This sets up the Run-2 style matching during the derivation process
acc.merge(TriggerMatchingCommonRun2Cfg(ConfigFlags, acc.merge(TriggerMatchingCommonRun2Cfg(ConfigFlags,
name = "PhysCommonTrigMatchNoTau", name = "PhysCommonTrigMatchNoTau",
OutputContainerPrefix = "TrigMatch_", OutputContainerPrefix = "TrigMatch_",
...@@ -104,7 +110,13 @@ def PhysCommonAugmentationsCfg(ConfigFlags,**kwargs): ...@@ -104,7 +110,13 @@ def PhysCommonAugmentationsCfg(ConfigFlags,**kwargs):
OutputContainerPrefix = "TrigMatch_", OutputContainerPrefix = "TrigMatch_",
ChainNames = triggerListsHelper.Run2TriggerNamesTau, ChainNames = triggerListsHelper.Run2TriggerNamesTau,
DRThreshold = 0.2)) DRThreshold = 0.2))
# This sets up a conversion of the Run-2 trigger navigation to the Run-3 style,
# followed by Run-3 style navigation slimming for trigger-matching from DAOD.
# This function is a noop if doEDMVersionConversion=False
acc.merge(TriggerMatchingCommonRun2ToRun3Cfg(ConfigFlags,
TriggerList = triggerListsHelper.Run2TriggerNamesNoTau + triggerListsHelper.Run2TriggerNamesTau))
if ConfigFlags.Trigger.EDMVersion == 3: if ConfigFlags.Trigger.EDMVersion == 3:
# This sets up the Run-3 style navigation slimming for trigger-matching from DAOD
acc.merge(TriggerMatchingCommonRun3Cfg(ConfigFlags, TriggerList = triggerListsHelper.Run3TriggerNames)) acc.merge(TriggerMatchingCommonRun3Cfg(ConfigFlags, TriggerList = triggerListsHelper.Run3TriggerNames))
return acc return acc
......
...@@ -50,7 +50,7 @@ def AddRun2TriggerMatchingToSlimmingHelper(**kwargs): ...@@ -50,7 +50,7 @@ def AddRun2TriggerMatchingToSlimmingHelper(**kwargs):
def TriggerMatchingCommonRun2Cfg(ConfigFlags, name, **kwargs): def TriggerMatchingCommonRun2Cfg(ConfigFlags, name, **kwargs):
"""Configure the common trigger matching for run 2 DAODs""" """Configure the common trigger matching for run 2 DAODs using the run 2 analysis formalism (matching happens during derivation)"""
acc = ComponentAccumulator() acc = ComponentAccumulator()
...@@ -61,11 +61,34 @@ def TriggerMatchingCommonRun2Cfg(ConfigFlags, name, **kwargs): ...@@ -61,11 +61,34 @@ def TriggerMatchingCommonRun2Cfg(ConfigFlags, name, **kwargs):
outputContainerPrefix = kwargs['OutputContainerPrefix'] outputContainerPrefix = kwargs['OutputContainerPrefix']
acc.addEventAlgo(CommonAugmentation(f"{outputContainerPrefix}TriggerMatchingKernel", acc.addEventAlgo(CommonAugmentation(f"{outputContainerPrefix}TriggerMatchingKernel",
AugmentationTools=[PhysCommonTriggerMatchingTool])) AugmentationTools=[PhysCommonTriggerMatchingTool]))
return(acc)
def TriggerMatchingCommonRun2ToRun3Cfg(ConfigFlags, **kwargs):
"""Covert run 2 trigger navigation data these data into the run 3 formalism (matching happens from DAOD)"""
acc = ComponentAccumulator()
if not ConfigFlags.Trigger.doEDMVersionConversion:
return(acc)
from AthenaCommon.Logging import logging
msg = logging.getLogger('TriggerMatchingCommonRun2ToRun3Cfg')
msg.info('doEDMVersionConversion is True, now scheduling conversion of Run 2 trigger navigation to Run 3')
from TrigNavTools.NavConverterConfig import NavConverterCfg
acc.merge(NavConverterCfg(ConfigFlags))
# And then run the run 3 slimming on the output of NavConverter
triggerList = kwargs['TriggerList']
from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import TrigNavSlimmingMTDerivationCfg
acc.merge(TrigNavSlimmingMTDerivationCfg(ConfigFlags,chainsFilter=triggerList))
return(acc) return(acc)
def TriggerMatchingCommonRun3Cfg(ConfigFlags, **kwargs): def TriggerMatchingCommonRun3Cfg(ConfigFlags, **kwargs):
"""Configure the common trigger matching for run 3 DAODs""" """Configure the common trigger matching for run 3 DAODs using the run 3 formalism (matching happens from DAOD)"""
if ConfigFlags.Trigger.EDMVersion != 3: if ConfigFlags.Trigger.EDMVersion != 3:
raise ValueError('This configuration can only be used for Run 3 trigger navigation') raise ValueError('This configuration can only be used for Run 3 trigger navigation')
......
...@@ -3,18 +3,17 @@ ...@@ -3,18 +3,17 @@
"""Helper functions for adding trigger EDM content to a derivation""" """Helper functions for adding trigger EDM content to a derivation"""
from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from TrigEDMConfig.TriggerEDM import getTriggerEDMList from TrigEDMConfig.TriggerEDM import getTriggerEDMList
def addTrigEDMSetToOutput(helper: SlimmingHelper, edmSet: str, edmVersion: int = None): def addTrigEDMSetToOutput(flags, helper: SlimmingHelper, edmSet: str, edmVersion: int = None):
"""Add a full trigger EDM set to the output slimming helper""" """Add a full trigger EDM set to the output slimming helper"""
# NB: I'm not sure that importing and using the ConfigFlags is a pattern that we want to # NB: I'm not sure that importing and using the ConfigFlags is a pattern that we want to
# encourage, but given that the derivations aren't built with CA's yet this is the best I can # encourage, but given that the derivations aren't built with CA's yet this is the best I can
# do... # do...
if edmVersion is None: if edmVersion is None:
edmVersion = ConfigFlags.Trigger.EDMVersion edmVersion = flags.Trigger.EDMVersion
edmList = getTriggerEDMList(edmSet, edmVersion) edmList = getTriggerEDMList(edmSet, edmVersion)
# This list is a mapping from container type to a list of required container names # This list is a mapping from container type to a list of required container names
......
...@@ -67,26 +67,36 @@ def TrigDecisionToolCfg(flags): ...@@ -67,26 +67,36 @@ def TrigDecisionToolCfg(flags):
possible_keys = [ possible_keys = [
'HLTNav_Summary', 'HLTNav_Summary', # Produced initially online (only the final nodes, all other nodes spread out over many many collections created by trigger framework algs)
'HLTNav_Summary_OnlineSlimmed', 'HLTNav_Summary_OnlineSlimmed', # Produced online, all nodes in one container. Accessible during RAWtoALL, good for T0 monitoring.
'HLTNav_Summary_ESDSlimmed', 'HLTNav_Summary_ESDSlimmed', # Produced offline in jobs writing ESD. Minimal slimming, good for T0-style monitoring. Equivalent to AOD at AODFULL level.
'HLTNav_Summary_AODSlimmed', 'HLTNav_Summary_AODSlimmed', # Produced offline in jobs writing AOD. Minimal slimming in AODFULL mode, good for T0-style monitoring. Slimming applied in AODSLIM mode, good for analysis use, final-features accessible.
'HLTNav_Summary_DAODSlimmed' 'HLTNav_Summary_DAODSlimmed', # Chain level slimming and IParticle feature-compacting for DAOD. Good for analysis use, final-features four vectors accessible.
'HLTNav_R2ToR3Summary' # Output of Run 2 to Run 3 navigation conversion procedure. Somewhat equivalent to AODFULL level. Designed to be further reduced to DAODSlimmed level before analysis use.
] ]
def getRun3NavigationContainerFromInput(flags): def getRun3NavigationContainerFromInput(flags):
# What to return if we cannot look in the file # What to return if we cannot look in the file
default_key = 'HLTNav_Summary_OnlineSlimmed' if flags.Trigger.doOnlineNavigationCompactification else 'HLTNav_Summary' default_key = 'HLTNav_Summary_OnlineSlimmed' if flags.Trigger.doOnlineNavigationCompactification else 'HLTNav_Summary'
to_return = default_key to_return = default_key
for key in possible_keys: if flags.Trigger.doEDMVersionConversion:
if key in flags.Input.Collections: to_return = 'HLTNav_R2ToR3Summary'
to_return = key else:
break for key in possible_keys:
if key in flags.Input.Collections:
to_return = key
break
from AthenaCommon.Logging import logging from AthenaCommon.Logging import logging
msg = logging.getLogger('getRun3NavigationContainerFromInput') msg = logging.getLogger('getRun3NavigationContainerFromInput')
msg.info('Returning {} as the Run 3 trigger navigation colletion to read in this job.'.format(to_return)) msg.info('Returning {} as the Run 3 trigger navigation colletion to read in this job.'.format(to_return))
# Double check 'possible_keys' is kept up to date
if to_return not in possible_keys:
msg.error('Must add {} to the "possible_keys" array!'.format(to_return))
return to_return return to_return
......
...@@ -74,7 +74,9 @@ def TrigNavSlimmingMTDerivationCfg(flags, chainsFilter = []): ...@@ -74,7 +74,9 @@ def TrigNavSlimmingMTDerivationCfg(flags, chainsFilter = []):
daodSlim.KeepOnlyFinalFeatures = True daodSlim.KeepOnlyFinalFeatures = True
daodSlim.RepackROIs = False # CAUTION: There may be an ROI memory management issue which needs solving in order to enable this functionality (ATLASG-1662). daodSlim.RepackROIs = False # CAUTION: There may be an ROI memory management issue which needs solving in order to enable this functionality (ATLASG-1662).
daodSlim.RepackROIsOutputCollection = "HLTNav_RepackedROIs" daodSlim.RepackROIsOutputCollection = "HLTNav_RepackedROIs"
daodSlim.RepackMET = True # To check: Is there any analysis need to have online-MET(s) in DAOD?
daodSlim.RepackFeatures = True daodSlim.RepackFeatures = True
daodSlim.RepackFeaturesOutputCollection_Particle = "HLTNav_RepackedFeatures_Particle" daodSlim.RepackFeaturesOutputCollection_Particle = "HLTNav_RepackedFeatures_Particle"
daodSlim.RepackFeaturesOutputCollection_MET = "HLTNav_RepackedFeatures_MET" daodSlim.RepackFeaturesOutputCollection_MET = "HLTNav_RepackedFeatures_MET"
daodSlim.EdgesToDrop = ["view"] daodSlim.EdgesToDrop = ["view"]
...@@ -89,26 +91,6 @@ def TrigNavSlimmingMTDerivationCfg(flags, chainsFilter = []): ...@@ -89,26 +91,6 @@ def TrigNavSlimmingMTDerivationCfg(flags, chainsFilter = []):
return ca return ca
#
# Ideally this should be handled inside TrigNavSlimmingMTDerivationCfg
# But until DAOD production migrates to new-JO, we can have this as a separate call
#
def AddRun3TrigNavSlimmingCollectionsToEDM(stream):
# Note: Not nice, duplication in strings between here and TrigNavSlimmingMTDerivationCfg
#
# Note: Not using the ThinningHelper as this only looks to work with content in the AOD.
# These collections are all created during AOD->DAOD
stream.AddItem("xAOD::TrigCompositeContainer#HLTNav_Summary_DAODSlimmed")
stream.AddItem("xAOD::TrigCompositeAuxContainer#HLTNav_Summary_DAODSlimmedAux.")
#
stream.AddItem("xAOD::ParticleContainer#HLTNav_RepackedFeatures_Particle")
stream.AddItem("xAOD::ParticleAuxContainer#HLTNav_RepackedFeatures_ParticleAux.")
#
stream.AddItem("xAOD::TrigMissingETContainer#HLTNav_RepackedFeatures_MET")
stream.AddItem("xAOD::TrigMissingETAuxContainer#HLTNav_RepackedFeatures_METAux.")
#
stream.AddItem("TrigRoiDescriptorCollection#HLTNav_RepackedROIs")
# Same as the above but adds the branches to the slimming helper. # Same as the above but adds the branches to the slimming helper.
# This is the component accumulator version # This is the component accumulator version
def AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(slimmingHelper): def AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(slimmingHelper):
......
...@@ -124,8 +124,10 @@ StatusCode TrigNavSlimmingMTAlg::execute(const EventContext& ctx) const { ...@@ -124,8 +124,10 @@ StatusCode TrigNavSlimmingMTAlg::execute(const EventContext& ctx) const {
} }
if (m_repackFeatures) { if (m_repackFeatures) {
outputParticles = createAndStoreWithAux<xAOD::ParticleContainer, xAOD::ParticleAuxContainer>(m_outputRepackedFeaturesCollectionKey_Particle, ctx); outputParticles = createAndStoreWithAux<xAOD::ParticleContainer, xAOD::ParticleAuxContainer>(m_outputRepackedFeaturesCollectionKey_Particle, ctx);
outputMETs = createAndStoreWithAux<xAOD::TrigMissingETContainer, xAOD::TrigMissingETAuxContainer>(m_outputRepackedFeaturesCollectionKey_MET, ctx);
outputContainers.particles = &outputParticles; outputContainers.particles = &outputParticles;
}
if (m_repackMET) {
outputMETs = createAndStoreWithAux<xAOD::TrigMissingETContainer, xAOD::TrigMissingETAuxContainer>(m_outputRepackedFeaturesCollectionKey_MET, ctx);
outputContainers.mets = &outputMETs; outputContainers.mets = &outputMETs;
} }
...@@ -401,6 +403,19 @@ StatusCode TrigNavSlimmingMTAlg::propagateDecisionIDs( ...@@ -401,6 +403,19 @@ StatusCode TrigNavSlimmingMTAlg::propagateDecisionIDs(
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
void TrigNavSlimmingMTAlg::printIParticleRepackingDebug(const TrigCompositeUtils::Decision* output, const std::string& when) const {
if (not msgLvl(MSG::DEBUG)) return;
if (output->hasObjectLink(featureString(), ClassID_traits<xAOD::IParticleContainer>::ID())) {
ElementLink<xAOD::IParticleContainer> link = output->objectLink<xAOD::IParticleContainer>(featureString());
if (link.isValid()) {
const xAOD::IParticle& l = **link;
ATH_MSG_DEBUG("IParticle repacking debug. " << when << " : "
<< "(pt:" << l.pt() << ",eta:" << l.eta() << ",phi:" << l.phi() << ",m:" << l.m() << ",e:" << l.e() << ")"
<< " from:" << link.dataID());
}
}
}
StatusCode TrigNavSlimmingMTAlg::repackLinks( StatusCode TrigNavSlimmingMTAlg::repackLinks(
TrigCompositeUtils::Decision* output, TrigCompositeUtils::Decision* output,
...@@ -412,44 +427,23 @@ StatusCode TrigNavSlimmingMTAlg::repackLinks( ...@@ -412,44 +427,23 @@ StatusCode TrigNavSlimmingMTAlg::repackLinks(
ATH_CHECK( doRepack<TrigRoiDescriptorCollection>(output, outputContainers.rois, initialRoIString()) ); ATH_CHECK( doRepack<TrigRoiDescriptorCollection>(output, outputContainers.rois, initialRoIString()) );
} }
if (m_repackFeatures) { if (m_repackFeatures) {
// Debug printing. Look at the four-momentum of any feature before the repacking. // Debug printing. Look at the four-momentum of any feature before the repacking.
// Note: Transiently we interact with the IParticle interface. // Note: Transiently we interact with the IParticle interface.
if (msgLvl(MSG::DEBUG)) { printIParticleRepackingDebug(output, "Before");
if (output->hasObjectLink(featureString(), ClassID_traits<xAOD::IParticleContainer>::ID())) {
ElementLink<xAOD::IParticleContainer> before = output->objectLink<xAOD::IParticleContainer>(featureString());
if (before.isValid()) {
const xAOD::IParticle& b = **before;
ATH_MSG_DEBUG("--- --- ---");
ATH_MSG_DEBUG("IParticle repacking debug. Before: "
<< "(pt:" << b.pt() << ",eta:" << b.eta() << ",phi:" << b.phi() << ",m:" << b.m() << ",e:" << b.e() << ")"
<< " from:" << before.dataID());
}
}
}
// Do any IParticle repacking // Do any IParticle repacking
ATH_CHECK( doRepack<xAOD::ParticleContainer>(output, outputContainers.particles, featureString()) ); ATH_CHECK( doRepack<xAOD::ParticleContainer>(output, outputContainers.particles, featureString()) );
// Debug printing. Look at the four-momentum of any feature after the repacking (the stored link is re-written) // Debug printing. Look at the four-momentum of any feature after the repacking (the stored link is re-written)
if (msgLvl(MSG::DEBUG)) { printIParticleRepackingDebug(output, "After");
if (output->hasObjectLink(featureString(), ClassID_traits<xAOD::IParticleContainer>::ID())) { }
ElementLink<xAOD::IParticleContainer> after = output->objectLink<xAOD::IParticleContainer>(featureString());
if (after.isValid()) {
const xAOD::IParticle& a = **after;
ATH_MSG_DEBUG("IParticle repacking debug. After : "
<< "(pt:" << a.pt() << ",eta:" << a.eta() << ",phi:" << a.phi() << ",m:" << a.m() << ",e:" << a.e() << ")"
<< " from:" << after.dataID());
}
}
}
// Some features do not support an IParticle interface. These need their own containers. // Some features do not support an IParticle interface. These need their own containers.
// TODO. Apply some thinning? // TODO. Apply some thinning?
if (m_repackMET) {
ATH_CHECK( doRepack<xAOD::TrigMissingETContainer>(output, outputContainers.mets, featureString()) ); ATH_CHECK( doRepack<xAOD::TrigMissingETContainer>(output, outputContainers.mets, featureString()) );
} }
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -78,11 +78,15 @@ private: ...@@ -78,11 +78,15 @@ private:
Gaudi::Property<bool> m_repackROIs{ Gaudi::Property<bool> m_repackROIs{
this, "RepackROIs", false, this, "RepackROIs", false,
"Re=pack the target of all 'roi' and 'initialRoI' edges into a single container (WriteHandle defined above)"}; "Re-pack the target of all 'roi' and 'initialRoI' edges into a single container (WriteHandle defined above)"};
Gaudi::Property<bool> m_repackMET{
this, "RepackMET", false,
"Re-pack the target of all 'feature' edges to xAOD::TrigMissingET objects into a single container (WriteHandle defined above)"};
Gaudi::Property<bool> m_repackFeatures{ Gaudi::Property<bool> m_repackFeatures{
this, "RepackFeatures", false, this, "RepackFeatures", false,
"Re=pack the target of all 'feature' edges into a small number of containers (WriteHandle defined above)"}; "Re-pack the target of all 'feature' edges into a small number of containers (WriteHandle defined above)"};
Gaudi::Property<std::vector<std::string>> m_edgesToDrop{ Gaudi::Property<std::vector<std::string>> m_edgesToDrop{
this, "EdgesToDrop", {"view"}, this, "EdgesToDrop", {"view"},
...@@ -183,6 +187,13 @@ private: ...@@ -183,6 +187,13 @@ private:
TrigCompositeUtils::Decision* output, TrigCompositeUtils::Decision* output,
Outputs& outputContainers) const; Outputs& outputContainers) const;
/**
* @brief Print debug infomration relating to the re-packing of feature links as Particle objects
**/
void printIParticleRepackingDebug(
const TrigCompositeUtils::Decision* output,
const std::string& when) const;
/** /**
* @brief Look for an ElementLink<COLLECTION> with the given edge-name in 'decision', * @brief Look for an ElementLink<COLLECTION> with the given edge-name in 'decision',
* if found then make a copy of the linked object to the supplied writeHandle and update the link * if found then make a copy of the linked object to the supplied writeHandle and update the link
......
...@@ -10,18 +10,24 @@ log = logging.getLogger("NavConverterConfig") ...@@ -10,18 +10,24 @@ log = logging.getLogger("NavConverterConfig")
def NavConverterCfg(flags): def NavConverterCfg(flags):
"""Configures Run 1/2 to Run 3 navigation conversion algorithm for all triggers""" """Configures Run 1/2 to Run 3 navigation conversion algorithm for all triggers"""
acc = ComponentAccumulator() acc = ComponentAccumulator()
from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg
if not flags.Trigger.doEDMVersionConversion:
return acc
from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg, getRun3NavigationContainerFromInput
tdt = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags)) tdt = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
r2ToR3OutputName = getRun3NavigationContainerFromInput(flags)
cnvAlg = CompFactory.Run2ToRun3TrigNavConverterV2("TrigRun2ToRun3NavConverter") cnvAlg = CompFactory.Run2ToRun3TrigNavConverterV2("TrigRun2ToRun3NavConverter")
cnvAlg.TrigDecisionTool = tdt cnvAlg.TrigDecisionTool = tdt
cnvAlg.TrigNavReadKey = "" cnvAlg.TrigNavReadKey = ""
cnvAlg.TrigConfigSvc = tdt.TrigConfigSvc cnvAlg.TrigConfigSvc = tdt.TrigConfigSvc
outputName = "HLTNav_R2ToR3Summary" cnvAlg.OutputNavKey = r2ToR3OutputName
cnvAlg.OutputNavKey = outputName
from OutputStreamAthenaPool.OutputStreamConfig import addToAOD, addToESD from OutputStreamAthenaPool.OutputStreamConfig import addToAOD, addToESD
collections = [f"xAOD::TrigCompositeContainer#{outputName}", f"xAOD::TrigCompositeAuxContainer#{outputName}Aux."] collections = [f"xAOD::TrigCompositeContainer#{r2ToR3OutputName}", f"xAOD::TrigCompositeAuxContainer#{r2ToR3OutputName}Aux."]
acc.merge(addToAOD(flags, collections)) acc.merge(addToAOD(flags, collections))
acc.merge(addToESD(flags, collections)) acc.merge(addToESD(flags, collections))
...@@ -42,9 +48,10 @@ def NavConverterCfg(flags): ...@@ -42,9 +48,10 @@ def NavConverterCfg(flags):
# in conversion job Run2 TDT is setup as default, we need to setup an alternative to access Run 3 format # in conversion job Run2 TDT is setup as default, we need to setup an alternative to access Run 3 format
run3tdt = CompFactory.Trig.TrigDecisionTool("Run3TrigDecisionTool", run3tdt = CompFactory.Trig.TrigDecisionTool("Run3TrigDecisionTool",
HLTSummary = "HLTNav_R2ToR3Summary", HLTSummary = r2ToR3OutputName,
NavigationFormat = 'TrigComposite', NavigationFormat = 'TrigComposite',
AcceptMultipleInstance=True) AcceptMultipleInstance=True,
TrigConfigSvc = tdt.TrigConfigSvc)
acc.addPublicTool(run3tdt) acc.addPublicTool(run3tdt)
checker.RetrievalToolRun3Nav = CompFactory.Trig.R3IParticleRetrievalTool(TrigDecisionTool = run3tdt) checker.RetrievalToolRun3Nav = CompFactory.Trig.R3IParticleRetrievalTool(TrigDecisionTool = run3tdt)
checker.Chains=['HLT_e26_lhtight_nod0_e15_etcut_L1EM7_Zee', 'HLT_mu4'] #TODO automate this checker.Chains=['HLT_e26_lhtight_nod0_e15_etcut_L1EM7_Zee', 'HLT_mu4'] #TODO automate this
...@@ -58,6 +65,7 @@ if __name__ == "__main__": ...@@ -58,6 +65,7 @@ if __name__ == "__main__":
from AthenaConfiguration.TestDefaults import defaultTestFiles from AthenaConfiguration.TestDefaults import defaultTestFiles
flags = initConfigFlags() flags = initConfigFlags()
flags.Input.Files = defaultTestFiles.RAW_RUN2 flags.Input.Files = defaultTestFiles.RAW_RUN2
flags.Trigger.doEDMVersionConversion = True
flags.lock() flags.lock()
acc = NavConverterCfg(flags) acc = NavConverterCfg(flags)
......
...@@ -11,12 +11,11 @@ ...@@ -11,12 +11,11 @@
from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
aod2daod = ExecStep.ExecStep('AODtoDAOD') aod2daod = ExecStep.ExecStep('AODtoDAOD')
aod2daod.type = 'Reco_tf' aod2daod.type = 'Derivation_tf'
aod2daod.input = 'data_run2_reco_run3_AOD' aod2daod.input = 'data_run2_reco_run3_AOD'
aod2daod.explicit_input = True aod2daod.explicit_input = True
aod2daod.args = ' --reductionConf=PHYS --outputDAODFile=DAOD.pool.root' aod2daod.args = ' --formats=PHYS --outputDAODFile=DAOD.pool.root --CA True'
aod2daod.args += ' --preExec="from AthenaConfiguration.AllConfigFlags import ConfigFlags; ConfigFlags.Trigger.doEDMVersionConversion=True;"' aod2daod.args += ' --preExec="ConfigFlags.Trigger.doEDMVersionConversion=True;"'
aod2daod.args += ' --postExec="from OutputStreamAthenaPool.MultipleStreamManager import MSMgr; daod=MSMgr.GetStream(\\\"StreamDAOD_PHYS\\\"); daod.AddItem(\\\"xAOD::TrigCompositeContainer#HLTNav_R2ToR3Summary\\\"); daod.AddItem(\\\"xAOD::TrigCompositeAuxContainer#HLTNav_R2ToR3SummaryAux.\\\"); daod.AddItem(\\\"TrigRoiDescriptorCollection\\\"); daod.AddItem(\\\"xAOD::TrigEMCluster\\\"); daod.AddItem(\\\"xAOD::TrigEMClusterContainer\\\"); daod.AddItem(\\\"xAOD::TrigRingerRings\\\"); daod.AddItem(\\\"xAOD::TrigRingerRingsContainer\\\"); daod.AddItem(\\\"xAOD::TrigRNNOutput\\\"); daod.AddItem(\\\"xAOD::TrigRNNOutputContainer\\\"); daod.AddItem(\\\"xAOD::CaloClusterContainer\\\"); daod.AddItem(\\\"xAOD::L2StandAloneMuonContainer\\\"); daod.AddItem(\\\"xAOD::L2StandAloneMuonAuxContainer\\\"); daod.AddItem(\\\"xAOD::L2CombinedMuonContainer\\\"); daod.AddItem(\\\"xAOD::L2CombinedMuonAuxContainer\\\"); daod.AddItem(\\\"xAOD::L2IsoMuonContainer\\\"); daod.AddItem(\\\"xAOD::MuonContainer\\\"); daod.AddItem(\\\"xAOD::MuonAuxContainer\\\"); daod.AddItem(\\\"xAOD::TauJetContainer\\\"); daod.AddItem(\\\"xAOD::ElectronContainer\\\"); daod.AddItem(\\\"xAOD::PhotonContainer\\\"); daod.AddItem(\\\"xAOD::JetContainer\\\"); daod.AddItem(\\\"xAOD::BTaggingContainer\\\"); daod.AddItem(\\\"xAOD::BTagVertexContainer\\\"); daod.AddItem(\\\"xAOD::JetElementContainer\\\"); daod.AddItem(\\\"xAOD::TrigMissingET\\\"); daod.AddItem(\\\"xAOD::TrigBphysContainer\\\"); from DerivationFrameworkJetEtMiss.JetCommon import swapAlgsInSequence;swapAlgsInSequence(topSequence,\'jetalg_ConstitModCorrectPFOCSSKCHS_GPFlowCSSK\', \'UFOInfoAlgCSSK\');"'
test = Test.Test() test = Test.Test()
test.art_type = 'build' test.art_type = 'build'
test.exec_steps = [aod2daod] test.exec_steps = [aod2daod]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment