ATLAS Offline Software
Loading...
Searching...
No Matches
TrigDecisionToolLite.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
8
10
11std::atomic<bool> Trig::TrigDecisionToolLite::s_printWarningMessages = true;
12
14
16 ATH_CHECK(m_HLTSummaryKeyIn.initialize());
17 return StatusCode::SUCCESS;
18}
19
20StatusCode Trig::TrigDecisionToolLite::fillPassingChainsSet(TrigCompositeUtils::DecisionIDContainer& setOfAllPassingChains, const EventContext& ctx) const {
22 if ( not navigationRH.isValid() ) {
23 ATH_MSG_ERROR("Cannot read trigger navigation container " << m_HLTSummaryKeyIn.key());
24 return StatusCode::FAILURE;
25 }
26 const TrigCompositeUtils::Decision* terminusNode = TrigCompositeUtils::getTerminusNode(navigationRH);
27 if ( not terminusNode ) {
28 ATH_MSG_ERROR("Cannot locate terminus node within " << m_HLTSummaryKeyIn.key() << ", the navigation graph has " << navigationRH->size() << " nodes.");
29 return StatusCode::FAILURE;
30 }
31 TrigCompositeUtils::decisionIDs(terminusNode, setOfAllPassingChains); // Populate setOfAllPassingChains from the vector of passing chain IDs in terminusNode
32 return StatusCode::SUCCESS;
33}
34
35bool Trig::TrigDecisionToolLite::isPassed(const std::vector<HLT::Identifier>& chainIDs, const EventContext& ctx) const {
36 TrigCompositeUtils::DecisionIDContainer setOfAllPassingChains;
37 if ( fillPassingChainsSet(setOfAllPassingChains, ctx).isFailure() ) {
38 return false;
39 }
40 for ( const HLT::Identifier& chainID : chainIDs ) { // Return the OR of the vector of supplied chains
41 if ( setOfAllPassingChains.count( chainID.numeric() ) ) {
42 return true;
43 }
44 }
45 return false;
46}
47
48bool Trig::TrigDecisionToolLite::isPassed(const HLT::Identifier& chainID, const EventContext& ctx) const {
49 TrigCompositeUtils::DecisionIDContainer setOfAllPassingChains;
50 if ( fillPassingChainsSet(setOfAllPassingChains, ctx).isFailure() ) {
51 return false;
52 }
53 return setOfAllPassingChains.count( chainID.numeric() );
54}
55
56bool Trig::TrigDecisionToolLite::isPassed(const std::vector<std::string>& chains, const EventContext& ctx) const {
57 std::vector<HLT::Identifier> chainIDs;
58 for ( const std::string& chain : chains ) {
59 chainIDs.emplace_back(chain);
60 }
61 return isPassed( chainIDs, ctx );
62}
63
64bool Trig::TrigDecisionToolLite::isPassed(const std::string& chain, const EventContext& ctx) const {
65 return isPassed( HLT::Identifier(chain), ctx );
66}
67
68std::vector<TrigCompositeUtils::TypelessLinkInfo>
69Trig::TrigDecisionToolLite::typelessFeatures(const Trig::FeatureRequestDescriptor& frd, const CLID clid, const EventContext& ctx) const {
70 return FeatureRequestHelpers::typelessFeaturesImplimentation(frd, clid, m_HLTSummaryKeyIn, msg(), ctx, getEventStore(), s_printWarningMessages);
71}
72
74 return &*evtStore(); // Service handle to pointer (in Athena)
75}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
uint32_t CLID
The Class ID type.
ServiceHandle< StoreGateSvc > & evtStore()
TrigCompositeUtils::DecisionID numeric() const
numeric ID
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual bool isPassed(const HLT::Identifier &chain, const EventContext &ctx=Gaudi::Hive::currentContext()) const final
true if the given HLT chain passed for physics
StatusCode initialize()
Dummy implementation of the initialisation function.
virtual const asg::EventStoreType * getEventStore() const final
Internal call to obtain event store pointer from concrete tool implementation. Note that evtStore() i...
StatusCode fillPassingChainsSet(TrigCompositeUtils::DecisionIDContainer &setOfAllPassingChains, const EventContext &ctx) const
Internal.
virtual std::vector< TrigCompositeUtils::TypelessLinkInfo > typelessFeatures(const Trig::FeatureRequestDescriptor &frd, const CLID clid, const EventContext &ctx) const final
Internal type erased features retrieval implementation call.
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_HLTSummaryKeyIn
TrigDecisionToolLite(const std::string &name)
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
std::vector< TrigCompositeUtils::TypelessLinkInfo > typelessFeaturesImplimentation(const Trig::FeatureRequestDescriptor &frd, const CLID clid, const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > &navRHKey, MsgStream &msg, const EventContext &ctx, const asg::EventStoreType *eventStore, const bool printWarningMessages)
Standalone implementation of feature retrieval, common between TrigDecisionTool and TrigDecisionToolL...
std::set< DecisionID > DecisionIDContainer
const Decision * getTerminusNode(SG::ReadHandle< DecisionContainer > &container)
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
StoreGateSvc EventStoreType
the type returned by AsgTool::evtStore
MsgStream & msg
Definition testRead.cxx:32