18 m_trigDecTool.setTypeAndName(
"Trig::TrigDecisionTool/TrigDecisionTool");
28 return StatusCode::SUCCESS;
32 const std::vector<const xAOD::IParticle *> &recoObjects,
33 const std::string &
chain,
34 double matchThreshold,
37 if (recoObjects.size() == 0)
42 using VecLinkInfo_t = std::vector<IPartLinkInfo_t>;
52 std::vector<std::map<std::pair<uint32_t, uint32_t>,
bool>> cachedComparisons(recoObjects.size());
60 if (!
m_trigDecTool->isPassed(
chainName, rerun ? TrigDefs::Physics | TrigDefs::allowResurrectedDecision : TrigDefs::Physics))
70 for (IPartLinkInfo_t &linkInfo : features)
72 if (!linkInfo.isValid())
75 throw std::runtime_error(
"Bad link info");
90 "Chain " <<
chainName <<
" (matching pattern " <<
chain <<
") has too few objects ("
91 <<
combinations.size() <<
") to match the number of provided reco objects (" << recoObjects.size() <<
")");
98 std::vector<std::size_t> onlineIndices(combination.size());
99 std::iota(onlineIndices.begin(), onlineIndices.end(), 0);
103 for (std::size_t recoIdx = 0; recoIdx < recoObjects.size(); ++recoIdx)
105 std::size_t onlineIdx = onlineIndices[recoIdx];
107 recoObjects[recoIdx],
108 combination[onlineIdx].link,
109 chainInfo.second[onlineIdx],
110 cachedComparisons[recoIdx],
119 }
while (std::next_permutation(onlineIndices.begin(), onlineIndices.end()));
129 const std::string &
chain,
130 double matchThreshold,
133 std::vector<const xAOD::IParticle *> tmpVec{&recoObject};
134 return match(tmpVec,
chain, matchThreshold, rerun);
141 std::map<std::pair<uint32_t, uint32_t>,
bool> &cache,
142 double scoreThreshold)
const
149 std::pair<uint32_t, uint32_t> linkIndices(onlineLink.persKey(), onlineLink.persIndex());
150 auto cacheItr = cache.find(linkIndices);
151 if (cacheItr == cache.end())
163 throw std::runtime_error(
"Failed to cast to egamma object");
168 ATH_MSG_WARNING(
"Cannot retrieve egamma object's primary calorimeter cluster, will match to the egamma object");
173 cacheItr = cache.insert(std::make_pair(linkIndices,
match)).first;
175 return cacheItr->second;
180 std::lock_guard<std::mutex> guard(m_chainInfoMutex);
181 auto cacheItr = m_chainInfoCache.find(
chain);
182 if (cacheItr == m_chainInfoCache.end())
191 info.first.push_back(0);
195 info.first.push_back(legInfo.multiplicity);
196 for (std::size_t
idx = 0;
idx < legInfo.multiplicity; ++
idx)
200 cacheItr = m_chainInfoCache.insert(std::make_pair(
chain, std::move(
info))).first;
202 return cacheItr->second;