35 {
36 using namespace TrigCompositeUtils;
37
41
42
45 std::optional<ThrVecRef> jetThresholds;
47
48
49 bool overflow{false};
50 constexpr static unsigned int s_maxJetTOBs{4};
51 std::unordered_map<unsigned int, std::unordered_map<unsigned int, unsigned int>> tobCounts;
52
53
55 for ( const auto & roi : jetFragment.roIVec() ) {
58 ATH_MSG_DEBUG(
"Skipping RoI as it is not JET threshold " << roIWord <<
" Type "<< roi.roIType() );
59 continue;
60 }
61
62 if (!overflow) {
65 overflow = (++tobCounts[crate][
module] > s_maxJetTOBs);
66 }
67
68 recRoIs->push_back( std::make_unique<LVL1::RecJetRoI>(roIWord, l1Menu.
cptr()) );
69 const LVL1::RecJetRoI* recRoI = recRoIs->back();
70
71 trigRoIs->push_back( std::make_unique<TrigRoiDescriptor>(
72 roIWord, 0u ,0u,
75
76 ATH_MSG_DEBUG(
"RoI word: 0x" << MSG::hex << std::setw( 8 ) << roIWord << MSG::dec );
77
78
80
81 std::vector<unsigned> passedThresholdIDs;
82
83 for (const auto& th : jetThresholds.value().get()) {
86 passedThresholdIDs.push_back( HLT::Identifier(
th->name() ) );
92 return std::vector<TrigCompositeUtils::DecisionID>(
ids.begin(),
ids.end() ); }() );
93 }
94 }
95 static const std::string thresholdsStr{"thresholds"};
96 decision->
setDetail( thresholdsStr, passedThresholdIDs );
98 ElementLink<TrigRoiDescriptorCollection>(
m_trigRoIsKey.key(), trigRoIs->size()-1, ctx) );
101 }
102 }
103
104
105 if (overflow) {
107 }
108 const std::string overflowStr{"overflow"};
109 for (
Decision* decision : *decisionOutput) {
110 decision->
setDetail(overflowStr,
static_cast<char>(overflow));
111 }
112
113 if ( msgLvl(MSG::DEBUG) ) {
114 for ( auto roi: *trigRoIs ) {
115 ATH_MSG_DEBUG(
"RoI Eta: " << roi->eta() <<
" Phi: " << roi->phi() <<
" RoIWord: " << roi->roiWord() );
116 }
117 }
118
119
120 {
121 auto RoIsCount = Monitored::Scalar( "count", trigRoIs->size() );
124 Monitored::Group(
m_monTool, RoIsCount, RoIsEta, RoIsPhi );
125 }
126
128
129 return StatusCode::SUCCESS;
130}
ElementLink()
Default constructor.
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
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.
virtual double eta() const =0
virtual double phi() const =0
Methods to retrieve data members.
virtual double eta() const
returns eta coord of ROI
virtual double phi() const
returns phi coord of ROI
bool passedThreshold(unsigned int thresholdNumber) const
returns TRUE if threshold number threshold_number has been passed by this ROI.
const std::vector< JetEnergyResult > & jetEnergyResult() const
Gets the jet/energy part of the L1 RDO.
const_pointer_type cptr()
Dereference the pointer.
pointer_type ptr()
Dereference the pointer.
bool setObjectLink(const std::string &name, const ElementLink< CONTAINER > &link)
Set the link to an object.
bool setDetail(const std::string &name, const TYPE &value)
Set an TYPE detail on the object.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
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()