61 {
62
63 using namespace TrigCompositeUtils;
64
66 auto container = outputHandle.
ptr();
67
71
73
74
77 if ( not handle.isValid() ) {
78 ATH_MSG_DEBUG(
"Input " <<
key.key() <<
" not present, did not run in this event.");
79 continue;
80 }
83 ATH_MSG_WARNING(
"The collection " <<
key.key() <<
" is not configured to contain any final decision,"
84 <<
"remove it from the configuration of " <<
name() <<
" to save time" );
85 continue;
86 }
87
88 for (
const Decision* decisionObject: *handle ) {
89
91
92 if (passingFinalIDs.empty()) {
93 continue;
94 }
95
96
97
98
99
100
101
104
105
107
108
109 allPassingFinalIDs.insert( passingFinalIDs.begin(), passingFinalIDs.end() );
110 }
111 }
112
113
115 allPassingFinalIDs.begin(), allPassingFinalIDs.end() );
116
118 ATH_MSG_DEBUG(
"Number of positive decisions " << allPassingFinalIDs.size() <<
" passing chains");
119 for ( auto d: allPassingFinalIDs ) {
121 }
122 }
123
124
126
127
129 const Decision* l1SeededChains =
nullptr;
130 const Decision* activeChains =
nullptr;
131 const Decision* prescaledChains =
nullptr;
132 for (
const Decision* d : *hltSeedingSummary) {
133 if (
d->name() ==
"l1seeded") {
135 }
else if (
d->name() ==
"unprescaled") {
137 }
else if (
d->name() ==
"prescaled") {
139 } else {
140 ATH_MSG_ERROR(
"DecisionSummaryMakerAlg encountered an unknown set of decisions from the HLTSeeding, name '" <<
d->name() <<
"'");
141 return StatusCode::FAILURE;
142 }
143 }
144
145 if (l1SeededChains == nullptr || activeChains == nullptr || prescaledChains == nullptr) {
146 ATH_MSG_ERROR(
"Unable to read in the summary from the HLTSeeding. Cannot write to the HLT output summary the prescale status of HLT chains.");
147 return StatusCode::FAILURE;
148 }
149
150
151
152
153
154
158 prescaledIDs.begin(), prescaledIDs.end() );
159
160
161
162 HLT::IDVec allPassingFinalIDsVec{allPassingFinalIDs.begin(),allPassingFinalIDs.end()};
166 for (const HLT::Identifier& id : expressIDsVec) {
167 expressIDs.insert(id.numeric());
168 }
170 expressIDs.begin(),
171 expressIDs.end() );
172
173
174 std::unordered_set<std::string> passStreamsSet;
175 for (
const DecisionID chainID : allPassingFinalIDs) {
177 for (
const std::string& streamName :
it->second) {
178 passStreamsSet.insert(streamName);
179 }
180 } else {
181 ATH_MSG_ERROR(
"Passed chain " << HLT::Identifier(chainID).
name() <<
" not in m_chainToStreamsMap");
182 }
183 }
184
185 if (!expressIDs.empty()) {
186 passStreamsSet.insert(s_expressStreamName);
187 }
189 ATH_CHECK(passStreams.
record(std::make_unique<std::vector<std::string>>(passStreamsSet.begin(),passStreamsSet.end())));
190
194 for (const std::string& s : passStreamsSet) {
195 if (first) {
first=
false;}
198 }
200 }
201
202
203
204 bool filterStatus = true;
206 filterStatus = (not allPassingFinalIDs.empty());
207 }
209
210 return StatusCode::SUCCESS;
211}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
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.
std::set< DecisionID > DecisionIDContainer
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
void decisionIDs(const Decision *d, DecisionIDContainer &id)
Extracts DecisionIDs stored in the Decision object.
void linkToPrevious(Decision *d, const std::string &previousCollectionKey, size_t previousIndex)
Links to the previous object, location of previous 'seed' decision supplied by hand.
DecisionIDContainer passedDecisionIDs(const Decision *d, const T &required)
return DecisionIDs in Decision object that match the required ones
bool msgLvl(const MSG::Level lvl) const
virtual void setFilterPassed(bool state, const EventContext &ctx) const
SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > m_summaryKey
Gaudi::Property< bool > m_setFilterStatus
SG::WriteHandleKey< std::vector< std::string > > m_streamsSummaryKey
void monitorRoIs(const TrigCompositeUtils::Decision *terminusNode) const
Monitor RoI updates between initial and final RoI.
ToolHandle< IPrescalingTool > m_prescaler
std::unordered_map< TrigCompositeUtils::DecisionID, std::vector< std::string > > m_chainToStreamsMap
Chain to streams map filled from the HLT Menu JSON.
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_hltSeedingSummaryKey
std::map< std::string, TrigCompositeUtils::DecisionIDContainer > m_collectionFilter
SG::ReadHandleKeyArray< TrigCompositeUtils::DecisionContainer > m_finalDecisionKeys
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
std::vector< HLT::Identifier > IDVec
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
const std::string & summaryPrescaledNodeName()
const std::string & summaryFilterNodeName()
const std::string & summaryPassNodeName()
const std::string & summaryPassExpressNodeName()