45 {
46 using namespace TrigCompositeUtils;
47
48
53
54
57 std::optional<ThrVecRef> tauThresholds;
59
60
61 bool overflow{false};
62 constexpr static unsigned int s_maxTauTOBs{5};
63 std::unordered_map<unsigned int, std::unordered_map<unsigned int, unsigned int>> tobCounts;
64
65
66 for (
const auto & emTauFragment : roib.
eMTauResult() ) {
67 for ( const auto & roi : emTauFragment.roIVec() ) {
70 ATH_MSG_DEBUG(
"Skipping RoI as it is not TAU threshold " << roIWord );
71 continue;
72 }
73
74 if (!overflow) {
77 overflow = (++tobCounts[crate][
module] > s_maxTauTOBs);
78 }
79
80 recRoIs->push_back( std::make_unique<LVL1::RecEmTauRoI>(roIWord, l1Menu.
cptr()) );
81 const LVL1::RecEmTauRoI* recRoI = recRoIs->back();
82
83 trigRoIs->push_back( std::make_unique<TrigRoiDescriptor>(
84 roIWord, 0u ,0u,
87
88 ATH_MSG_DEBUG(
"RoI word: 0x" << MSG::hex << std::setw( 8 ) << roIWord << MSG::dec );
89
90
93
94 std::vector<TrigCompositeUtils::DecisionID> passedThresholdIDs;
95
96 for (const auto& th : tauThresholds.value().get()) {
99 passedThresholdIDs.push_back(HLT::Identifier(
th->name()));
101 ATH_MSG_DEBUG(
"Passed Threshold names " <<
th->name() <<
" and " << thresholdProbeName);
104 }
105 }
106
107 decisionMain->
setDetail(
"thresholds", passedThresholdIDs);
109 ElementLink<TrigRoiDescriptorCollection>(
m_trigRoIsKey.key(), trigRoIs->size()-1, ctx) );
111 ElementLink<DataVector<LVL1::RecEmTauRoI>>(
m_recRoIsKey.key(), recRoIs->size()-1, ctx) );
112
113 decisionProbe->
setDetail(
"thresholds", passedThresholdIDs);
115 ElementLink<TrigRoiDescriptorCollection>(
m_trigRoIsKey.key(), trigRoIs->size()-1, ctx) );
117 ElementLink<DataVector<LVL1::RecEmTauRoI>>(
m_recRoIsKey.key(), recRoIs->size()-1, ctx) );
118 }
119 }
120
121
122 if (overflow) {
124 }
125 for (
Decision* decision : *decisionOutput) {
126 decision->setDetail("overflow", static_cast<char>(overflow));
127 }
128
129 for ( auto roi: *trigRoIs ) {
130 ATH_MSG_DEBUG(
"RoI Eta: " << roi->eta() <<
" Phi: " << roi->phi() <<
" RoIWord: " << roi->roiWord() );
131 }
132
133
134 {
135 auto RoIsCount = Monitored::Scalar( "count", trigRoIs->size() );
138 Monitored::Group(
m_monTool, RoIsCount, RoIsEta, RoIsPhi );
139 }
140
142
143 return StatusCode::SUCCESS;
144}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(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
bool passedThreshold(unsigned int threshold_number) const
returns TRUE if threshold number threshold_number has been passed by this ROI.
virtual double phi() const
returns phi coord of ROI
const std::vector< EMTauResult > & eMTauResult() const
Gets the egamma 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()