4#ifndef HLTSEEDING_IROITHRESHOLDSTOOL_H
5#define HLTSEEDING_IROITHRESHOLDSTOOL_H
13#include "GaudiKernel/IAlgTool.h"
21template<
typename T_RoI,
typename T_RoIContainer, const
char* N_RoIContainer, const
char* N_ThresholdType>
24 using ThrVec = std::vector<std::shared_ptr<TrigConf::L1Threshold>>;
25 using ThrVecRef = std::reference_wrapper<const ThrVec>;
26 using ExtraInfoRef = std::reference_wrapper<const TrigConf::L1ThrExtraInfoBase>;
29 : base_class(
type, name, parent) {}
34 return StatusCode::SUCCESS;
39 std::optional<ThrVecRef> menuThresholds;
43 catch (
const std::exception& ex) {
44 ATH_MSG_ERROR(
"Failed to retrieve " << N_ThresholdType <<
" thresholds from L1 menu. Exception:" << ex.what());
47 return menuThresholds;
52 std::optional<ExtraInfoRef> menuExtraInfo;
56 catch (
const std::exception& ex) {
57 ATH_MSG_ERROR(
"Failed to retrieve " << N_ThresholdType <<
" threshold extra info from L1 menu. Exception:" << ex.what());
74 for (
const T_RoI* roi: *thresholdPatterns) {
76 thresholdPatterns(*roi) =
getPattern(eventContext, *roi, menuThresholds.value().get(), menuExtraInfo.value().get());
78 catch (
const std::exception& ex) {
79 ATH_MSG_ERROR(
"getPattern() for " << N_RoIContainer <<
" failed with exception: " << ex.what());
80 return StatusCode::FAILURE;
84 return StatusCode::SUCCESS;
90 const ThrVec& menuThresholds,
95 this,
"L1TriggerMenu",
"DetectorStore+L1TriggerMenu",
96 "Name of the L1Menu object to read configuration from"};
99 this,
"ThresholdPatternsDecorKey", std::string(N_RoIContainer)+
".thresholdPatterns",
100 "Decoration for the threshold patterns"};
#define ATH_CHECK
Evaluate an expression and check for errors.
Property holding a SG store/key/clid from which a ReadHandle is made.
Handle class for reading from StoreGate.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
Property holding a SG store/key/clid from which a ReadHandle is made.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())