4#ifndef HLTSEEDING_ROISUNPACKINGTOOLPHASE1_H
5#define HLTSEEDING_ROISUNPACKINGTOOLPHASE1_H
22template<
typename T_RoI,
typename T_RoIContainer, auto F_RoIWordGetter, const
char* N_RoIContainer, const
char* N_ThresholdType>
26 this,
"L1RoILinkName", N_RoIContainer,
27 "Name of the link to read from L1TriggerResult for L1 xAOD RoI container"};
30 this,
"L1RoIThresholdPatternsKey", std::string(N_RoIContainer)+
".thresholdPatterns",
31 "Name of the L1 xAOD RoI container decoration for the threshold patterns"};
34 this,
"RoIHalfWidthEta", 0.1,
"Size of RoI in eta"};
37 this,
"RoIHalfWidthPhi", 0.1,
"Size of RoI in phi"};
50 return StatusCode::SUCCESS;
54 virtual StatusCode
start()
override {
58 return StatusCode::SUCCESS;
63 virtual StatusCode
unpack(
const EventContext& ctx,
65 const HLT::IDSet& activeChains)
const override {
78 ATH_MSG_DEBUG(
"No " << N_ThresholdType <<
" RoIs in this event");
81 return StatusCode::SUCCESS;
94 std::optional<ThrVecRef> thresholds;
98 for (
const T_RoI* roi : rois) {
100 roiDescriptors->push_back(std::make_unique<TrigRoiDescriptor>(
101 static_cast<unsigned int>((roi->*F_RoIWordGetter)()), 0u, 0u,
122 std::vector<TrigCompositeUtils::DecisionID> passedThresholdIDs;
125 uint64_t thresholdPattern = thrPatternAcc(*roi);
126 ATH_MSG_DEBUG(
"RoI #" << linkIndex <<
" threshold pattern: " << thresholdPattern);
127 for (
const std::shared_ptr<TrigConf::L1Threshold>& thr : thresholds.value().get()) {
128 if ((thresholdPattern & (1_u64 << thr->mapping())) == 0_u64) {
continue;}
130 ATH_MSG_DEBUG(
"RoI #" << linkIndex <<
" passed threshold number " << thr->mapping()
131 <<
" name" << (doProbe ?
"s " :
" ") << thr->name()
137 decisionMain->
setDetail(
"thresholds", passedThresholdIDs);
138 if (doProbe) decisionProbe->
setDetail(
"thresholds", passedThresholdIDs);
151 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
xAOD::TrigComposite Decision
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
Header file to be included by clients of the Monitored infrastructure.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Handle class for reading a decoration on an object.
ElementLink implementation for ROOT usage.
BaseConstReference getStorableObjectRef() const
Return a reference to the currently-referenced container object.
bool isValid() const
Test to see if the link can be dereferenced.
virtual double eta() const =0
virtual double phi() const =0
Methods to retrieve data members.
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
pointer_type ptr()
Dereference the pointer.
bool setObjectLink(const std::string &name, const ElementLink< CONTAINER > &link)
Set the link to an object.
bool hasObjectLink(const std::string &name, const CLID clid=CLID_NULL) const
Check if a link to an object with a given name and type exists. CLID_NULL to not check type.
bool setDetail(const std::string &name, const TYPE &value)
Set an TYPE detail on the object.
ElementLink< CONTAINER > objectLink(const std::string &name) const
Get the link with the requested name.
std::set< HLT::Identifier > IDSet
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
SG::WriteHandle< CONT > createAndStoreNoAux(const SG::WriteHandleKey< CONT > &key, const EventContext &ctx)
Creates and right away records the Container CONT with the key.
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.
const std::string & initialRecRoIString()
const std::string & initialRoIString()
const std::string & hltSeedingNodeName()
TrigComposite_v1 TrigComposite
Declare the latest version of the class.