12#include "GaudiKernel/EventContext.h"
25 ATH_MSG_INFO(
"RoIBResult and L1TriggerResult keys both empty: assume we're running with CTP emulation" );
56 return StatusCode::SUCCESS;
63 ATH_CHECK( timeStampHandle.record( std::make_unique<TrigTimeStamp>() ) );
79 if (!l1TriggerResultCont.isValid()) {
81 return StatusCode::FAILURE;
83 if (l1TriggerResultCont->size() != 1) {
84 ATH_MSG_ERROR(
"Size of the L1TriggerResultContainer is " << l1TriggerResultCont->size() <<
" but 1 expected");
85 return StatusCode::FAILURE;
87 l1TriggerResult = l1TriggerResultCont->at(0);
89 const std::vector<std::string>& linkNames = l1TriggerResult->
linkColNames();
90 const std::vector<uint32_t>& linkClids = l1TriggerResult->
linkColClids();
91 ATH_MSG_DEBUG(
"L1TriggerResult has " << linkNames.size() <<
" links:");
92 for (
size_t i=0; i<linkNames.size(); ++i) {
93 ATH_MSG_DEBUG(
"--> " << linkNames.at(i) <<
" CLID: " << linkClids.at(i));
99 auto *chainsInfo = handle.
ptr();
109 std::sort( l1SeededChains.begin(), l1SeededChains.end() );
112 HLT::IDVec::iterator removeFrom =
std::unique(l1SeededChains.begin(), l1SeededChains.end());
113 l1SeededChains.erase(removeFrom, l1SeededChains.end());
121 std::sort( activeChains.begin(), activeChains.end() );
123 std::set_difference(l1SeededChains.begin(), l1SeededChains.end(),
124 activeChains.begin(), activeChains.end(),
125 std::back_inserter(prescaledChains));
129 if (std::find(activeChains.begin(), activeChains.end(),
id) != activeChains.end()) {
130 ATH_MSG_ERROR(
"Prescaled chain cannot also be an active chain (" <<
id <<
")");
142 const auto activeCostMonIt = std::find(activeChains.begin(), activeChains.end(), costMonitorChain);
143 if (activeCostMonIt == activeChains.end()){
149 HLT::IDSet activeChainSet( activeChains.begin(), activeChains.end() );
152 ATH_CHECK( unpacker->unpack( ctx, *roib, activeChainSet ) );
157 ATH_CHECK( unpacker->unpack( ctx, roib, activeChainSet ) );
163 ATH_CHECK( unpacker->unpack( ctx, *l1TriggerResult, activeChainSet ) );
164 }
catch (
const std::exception& ex) {
165 ATH_MSG_ERROR(
"Exception in " << unpacker->name() <<
"::unpack: " << ex.what());
166 return StatusCode::FAILURE;
179 return StatusCode::SUCCESS;
185 const std::string&
type) {
188 for (
auto c: chains) {
191 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
xAOD::TrigComposite Decision
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name="")
Helper method to create a Decision object, place it in the container and return a pointer to it.
Handle class for recording to StoreGate.
bool msgLvl(const MSG::Level lvl) const
An algorithm that can be simultaneously executed in multiple threads.
virtual StatusCode execute(const EventContext &ctx) const override
ToolHandle< TrigConf::IKeyWriterTool > m_keyWriterTool
ToolHandle< L1DataConsistencyChecker > m_consistencyChecker
ServiceHandle< ITrigCostSvc > m_trigCostSvcHandle
static StatusCode saveChainsInfo(const HLT::IDVec &chains, xAOD::TrigCompositeContainer *storage, const std::string &type)
ToolHandleArray< IRoIsUnpackingTool > m_roiUnpackers_xaod
ToolHandle< ICTPUnpackingTool > m_ctpUnpacker
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_l1TriggerResultKey
Level-1 result with RoIs from Run-3 hardware systems.
SG::ReadHandleKey< ROIB::RoIBResult > m_RoIBResultKey
Gaudi::Property< std::string > m_costMonitoringChain
virtual StatusCode initialize() override
SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > m_summaryKey
ToolHandleArray< IRoIsUnpackingTool > m_roiUnpackers_roib
Gaudi::Property< float > m_roiZedWidthDefault
HLTSeeding(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteHandleKey< TrigTimeStamp > m_startStampKey
ToolHandle< IPrescalingTool > m_prescaler
Gaudi::Property< bool > m_doCostMonitoring
Class holding the LVL1 RoIB result build by the RoIBuilder.
static double zedWidthDefault()
const_pointer_type cptr()
Dereference the pointer.
pointer_type ptr()
Dereference the pointer.
const std::vector< std::string > & linkColNames() const
Raw access to the persistent link names.
const std::vector< uint32_t > & linkColClids() const
Raw access to the persistent link CLIDs.
std::vector< HLT::Identifier > IDVec
std::set< HLT::Identifier > IDSet
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
TrigCompositeContainer_v1 TrigCompositeContainer
Declare the latest version of the container.
TrigComposite_v1 TrigComposite
Declare the latest version of the class.