35 for (
const std::string &chain :
m_chains)
37 std::map<std::string, std::size_t> info;
40 info[legInfo.signature] += legInfo.multiplicity;
53 return StatusCode::FAILURE;
56 return StatusCode::SUCCESS;
63 std::map<std::string, const xAOD::IParticleContainer *> offlineInputs;
72 return StatusCode::FAILURE;
74 offlineInputs[p.first] =
handle.cptr();
79 const std::string &chain = chainPair.first;
80 if (!
m_tdt->isPassed(chain))
87 std::vector<TrigCompositeUtils::KFromNItr> idxItrs;
88 std::vector<const xAOD::IParticleContainer *> containers;
89 for (
const auto &sigPair : chainPair.second)
91 containers.push_back(offlineInputs.at(sigPair.first));
92 idxItrs.emplace_back(sigPair.second, containers.back()->size());
95 idxItrs, std::vector<TrigCompositeUtils::KFromNItr>(idxItrs.size()));
99 std::vector<const xAOD::IParticle *> particles;
100 for (std::size_t idx = 0; idx < containers.size(); ++idx)
102 idxItr->at(idx)->begin(), idxItr->at(idx)->end(), std::back_inserter(particles),
103 [
container=containers.at(idx)] (std::size_t contIdx) { return container->at(contIdx); });
111 ATH_MSG_DEBUG(
"Chain " << chain <<
" is matched? " << std::boolalpha << matched);
113 return StatusCode::SUCCESS;
121 ATH_MSG_INFO(
"Chain " << p.first <<
" had " << p.second.nEventsPassed <<
" passed events of which " << p.second.nEventsMatched <<
" were matched");
122 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Helper class that provides access to information about individual legs.
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
void handle(const Incident &inc)
receive the given incident
Iterates over all combinations of the provided input iterators.
bool exhausted() const
True if this iterator is past the end.
Gaudi::Property< std::vector< std::string > > m_chains
TrigMatchTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
ToolHandle< Trig::IMatchingTool > m_matchingTool
std::map< std::string, SG::ReadHandleKey< xAOD::IParticleContainer > > m_offlineKeys
virtual StatusCode execute() override
std::map< std::string, std::map< std::string, std::size_t > > m_chainInfos
ToolHandle< Trig::TrigDecisionTool > m_tdt
virtual StatusCode finalize() override
std::map< std::string, MatchData > m_chainData
This module defines the arguments passed from the BATCH driver to the BATCH worker.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
The common trigger namespace for trigger analysis tools.
Struct containing information on each leg of a chain.