|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include <unordered_set>
14 const std::string s_expressStreamName{
"express"};
29 for (
auto& collection: collections ) {
31 ATH_MSG_DEBUG(
"Final decision of the chain " <<
chain <<
" will be read from " << collection );
40 return StatusCode::SUCCESS;
54 return StatusCode::SUCCESS;
58 return StatusCode::SUCCESS;
66 auto container = outputHandle.
ptr();
77 if ( not handle.isValid() ) {
78 ATH_MSG_DEBUG(
"Input " <<
key.key() <<
" not present, did not run in this event.");
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" );
88 for (
const Decision* decisionObject: *handle ) {
92 if (passingFinalIDs.empty()) {
109 allPassingFinalIDs.insert( passingFinalIDs.begin(), passingFinalIDs.end() );
115 allPassingFinalIDs.begin(), allPassingFinalIDs.end() );
118 ATH_MSG_DEBUG(
"Number of positive decisions " << allPassingFinalIDs.size() <<
" passing chains");
119 for (
auto d: allPassingFinalIDs ) {
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") {
140 ATH_MSG_ERROR(
"DecisionSummaryMakerAlg encountered an unknown set of decisions from the HLTSeeding, name '" <<
d->name() <<
"'");
141 return StatusCode::FAILURE;
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;
158 prescaledIDs.begin(), prescaledIDs.end() );
162 HLT::IDVec allPassingFinalIDsVec{allPassingFinalIDs.begin(),allPassingFinalIDs.end()};
167 expressIDs.insert(
id.numeric());
174 std::unordered_set<std::string> passStreamsSet;
175 for (
const DecisionID chainID : allPassingFinalIDs) {
185 if (!expressIDs.empty()) {
186 passStreamsSet.insert(s_expressStreamName);
194 for (
const std::string&
s : passStreamsSet) {
204 bool filterStatus =
true;
206 filterStatus = (not allPassingFinalIDs.empty());
210 return StatusCode::SUCCESS;
215 using RoILinkVec = std::vector<LinkInfo<TrigRoiDescriptorCollection>>;
217 auto printDecision = [
this](
const Decision*
d){
229 const RoILinkVec allFinalRoIs = findLinks<TrigRoiDescriptorCollection>(terminusNode,
roiString(), TrigDefs::lastFeatureOfType);
230 for (
const auto& finalRoILink : allFinalRoIs) {
232 if (!finalRoILink.isValid() || *(finalRoILink.link)==
nullptr) {
234 printDecision(finalRoILink.source);
243 const RoILinkVec initialRoIs = findLinks<TrigRoiDescriptorCollection>(finalRoILink.source,
initialRoIString(), TrigDefs::lastFeatureOfType);
246 if (initialRoIs.empty()) {
248 printDecisionAndRoI(finalRoILink.source, finalRoI);
251 if (initialRoIs.size()>1) {
252 ATH_MSG_WARNING(
"Encountered decision node with multiple (" << initialRoIs.size() <<
") "
254 printDecisionAndRoI(finalRoILink.source, finalRoI);
258 const auto& initialRoILink = initialRoIs.front();
259 if (!initialRoILink.isValid() || *(initialRoILink.link)==
nullptr) {
261 printDecisionAndRoI(finalRoILink.source, finalRoI);
277 if (std::abs(
dEta) > 1.0 || std::abs(
dPhi) > 1.0 || std::abs(dZed) > 200) {
279 <<
"dEta=" <<
dEta <<
", dPhi=" <<
dPhi <<
", dZed=" << dZed
280 <<
"initialRoI: " << initialRoI <<
", finalRoI: " << finalRoI);
281 printDecision(finalRoILink.source);
const std::string & summaryPrescaledNodeName()
const std::string & summaryFilterNodeName()
Group
Properties of a chain group.
ToolHandle< GenericMonitoringTool > m_monTool
const std::string & summaryPassExpressNodeName()
TrigCompositeUtils::DecisionID numeric() const
numeric ID
SG::WriteHandleKey< std::vector< std::string > > m_streamsSummaryKey
virtual StatusCode start() override
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.
Gaudi::Property< bool > m_warnOnLargeRoIUpdates
SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > m_summaryKey
virtual bool composite() const override final
SuperRoI compatability methods.
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
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
void renounceArray(SG::VarHandleKeyArray &handlesArray)
remove all handles from I/O resolution
virtual StatusCode execute(const EventContext &context) const override
Gaudi::Property< bool > m_setFilterStatus
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
std::map< std::string, TrigCompositeUtils::DecisionIDContainer > m_collectionFilter
std::vector< HLT::Identifier > IDVec
ToolHandle< IPrescalingTool > m_prescaler
const std::string & initialRoIString()
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
DecisionSummaryMakerAlg(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Class used to describe composite objects in the HLT.
std::unordered_map< TrigCompositeUtils::DecisionID, std::vector< std::string > > m_chainToStreamsMap
Chain to streams map filled from the HLT Menu JSON.
virtual double zed() const override final
T deltaPhi(T phiA, T phiB)
Return difference phiA - phiB in range [-pi, pi].
Helper for azimuthal angle calculations.
Gaudi::Property< std::map< std::string, std::vector< std::string > > > m_lastStepForChain
const std::string & summaryPassNodeName()
SG::ReadHandleKeyArray< TrigCompositeUtils::DecisionContainer > m_finalDecisionKeys
virtual StatusCode initialize() override
void linkToPrevious(Decision *d, const std::string &previousCollectionKey, size_t previousIndex)
Links to the previous object, location of previous 'seed' decision supplied by hand.
std::set< DecisionID > DecisionIDContainer
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_hltSeedingSummaryKey
#define ATH_MSG_WARNING(x)
virtual double phi() const override final
Methods to retrieve data members.
virtual StatusCode finalize() override
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
virtual bool isFullscan() const override final
is this a full scan RoI?
virtual double eta() const override final
const std::string & roiString()
Declare a monitored scalar variable.
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
void monitorRoIs(const TrigCompositeUtils::Decision *terminusNode) const
Monitor RoI updates between initial and final RoI.
SG::ReadHandleKey< TrigConf::HLTMenu > m_hltMenuKey
virtual void setFilterPassed(bool state, const EventContext &ctx) const