From 5bf0c5d8456baafc676df8cab0f817f2f0f65877 Mon Sep 17 00:00:00 2001 From: Jon Burr <jon.burr@cern.ch> Date: Fri, 11 Dec 2020 12:45:57 +0100 Subject: [PATCH] Fixes suggested by Tim --- .../TriggerMatchingTool/Root/R3MatchingTool.cxx | 11 +++++++---- .../TrigCompositeUtils/Root/IPartCombItr.cxx | 15 ++++++++++++++- .../TrigCompositeUtils/IPartCombItr.h | 4 ++++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/R3MatchingTool.cxx b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/R3MatchingTool.cxx index 56f5eca41e65..aba7f08b401c 100644 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/R3MatchingTool.cxx +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/R3MatchingTool.cxx @@ -59,7 +59,6 @@ namespace Trig // TODO - detect if we're looking at run 3 data. // If we are, then setting rerun to true should give a warning as it no // longer makes sense for run 3 - unsigned int condition = rerun ? TrigDefs::Physics | TrigDefs::allowResurrectedDecision : TrigDefs::Physics; // In what follows, the same comparisons between reco and trigger objects will done // fairly frequently. As these include DR checks we want to minimise how often we do these @@ -73,8 +72,12 @@ namespace Trig const Trig::ChainGroup *chainGroup = m_trigDecTool->getChainGroup(chain); for (const std::string &chainName : chainGroup->getListOfTriggers()) { - if (msgLvl(MSG::DEBUG)) - ATH_MSG_DEBUG("Chain " << chainName << " was passed? " << m_trigDecTool->isPassed(chainName)); + if (!m_trigDecTool->isPassed(chainName, rerun ? TrigDefs::Physics | TrigDefs::allowResurrectedDecision : TrigDefs::Physics)) + { + ATH_MSG_DEBUG("Chain " << chainName << " did not pass"); + continue; + } + ATH_MSG_DEBUG("Chain " << chainName << " passed"); // Now we have to build up combinations // TODO - right now we use a filter that passes everything that isn't pointer-equal. // This will probably need to be fixed to something else later - at least the unique RoI filter @@ -83,7 +86,7 @@ namespace Trig std::vector<std::size_t> multiplicities = chainInfo->leg_multiplicities(); combinations.reserve(multiplicities.size()); // Get all the features for the chain - VecLinkInfo_t chainFeatures = m_trigDecTool->features<xAOD::IParticleContainer>(chainName, condition); + VecLinkInfo_t chainFeatures = m_trigDecTool->features<xAOD::IParticleContainer>(chainName); ATH_MSG_VERBOSE("Chain " << chainName << " has " << chainFeatures.size() << " features and " << multiplicities.size() << " legs with multiplicities, nFeatures: "); if (multiplicities.size() == 1) { diff --git a/Trigger/TrigSteer/TrigCompositeUtils/Root/IPartCombItr.cxx b/Trigger/TrigSteer/TrigCompositeUtils/Root/IPartCombItr.cxx index 7ad557c3b212..68b6a663107c 100644 --- a/Trigger/TrigSteer/TrigCompositeUtils/Root/IPartCombItr.cxx +++ b/Trigger/TrigSteer/TrigCompositeUtils/Root/IPartCombItr.cxx @@ -13,12 +13,25 @@ namespace TrigCompositeUtils return true; } + bool uniqueInitialRoIs(const std::vector<LinkInfo<xAOD::IParticleContainer>> &links) + { + std::set<std::pair<uint32_t, uint32_t>> seen; + for (const auto &info : links) + { + LinkInfo<TrigRoiDescriptorCollection> roi = findLink<TrigRoiDescriptorCollection>(info.source, initialRoIString()); + if (!seen.insert(std::make_pair(roi.link.persKey(), roi.link.persIndex())).second) + // Insert returns false if that item already exists in it + return false; + } + return true; + } + bool uniqueRoIs(const std::vector<LinkInfo<xAOD::IParticleContainer>> &links) { std::set<std::pair<uint32_t, uint32_t>> seen; for (const auto &info : links) { - LinkInfo<TrigRoiDescriptorCollection> roi = findLink<TrigRoiDescriptorCollection>(info.source, "initialRoI"); + LinkInfo<TrigRoiDescriptorCollection> roi = findLink<TrigRoiDescriptorCollection>(info.source, "roi"); if (!seen.insert(std::make_pair(roi.link.persKey(), roi.link.persIndex())).second) // Insert returns false if that item already exists in it return false; diff --git a/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/IPartCombItr.h b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/IPartCombItr.h index 5c2f6048f407..e2a8b87c967c 100644 --- a/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/IPartCombItr.h +++ b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/IPartCombItr.h @@ -21,10 +21,14 @@ namespace TrigCompositeUtils UniqueObjects, /// Do not allow any two objects to share an RoI UniqueRoIs, + /// Do not allow any two objects to share an initial RoI + UniqueInitialRoIs }; /// Helper fucntion that returns true if no objects are repeated bool uniqueObjects(const std::vector<LinkInfo<xAOD::IParticleContainer>> &links); /// Helper function that returns true if no objects share an initial RoI + bool uniqueInitialRoIs(const std::vector<LinkInfo<xAOD::IParticleContainer>> &links); + /// Helper function that returns true if no objects share a final RoI bool uniqueRoIs(const std::vector<LinkInfo<xAOD::IParticleContainer>> &links); /// Get a lambda corresponding to the specified FilterType enum. -- GitLab