ATLAS Offline Software
DecisionCollectorTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
9  ATH_CHECK( m_decisionsKey.initialize() );
11  return StatusCode::SUCCESS;
12 }
13 
14 void DecisionCollectorTool::getSequencesNames( std::set<std::string>& output ) const {
15  for (const auto& decisionKey: m_decisionsKey) {
16  output.insert(decisionKey.key());
17  }
18 }
19 
20 namespace {
21  // Helper to avoid code duplication
23  std::vector<TrigCompositeUtils::DecisionID>& output) {
24  for ( const TrigCompositeUtils::Decision* d : *handle.cptr() ) {
25  output.insert( output.end(),
28  }
29  }
30 }
31 
32 void DecisionCollectorTool::getDecisions( std::vector<TrigCompositeUtils::DecisionID>& output,
33  const EventContext& ctx ) const {
34  for (const auto& decisionKey: m_decisionsKey ) {
35  auto handle = SG::makeHandle( decisionKey, ctx );
36  if ( handle.isValid() ) {
37  fillDecisions(handle, output);
38  }
39  }
40 }
41 
42 void DecisionCollectorTool::getDecisions( std::vector<TrigCompositeUtils::DecisionID>& decisions,
43  std::set<std::string>& sequences,
44  const EventContext& ctx ) const {
45  for (const auto& decisionKey: m_decisionsKey ) {
46  auto handle = SG::makeHandle( decisionKey, ctx );
47  if ( handle.isValid() ) {
48  fillDecisions(handle, decisions);
49  sequences.insert(decisionKey.key());
50  }
51  }
52 }
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
hist_file_dump.d
d
Definition: hist_file_dump.py:142
DecisionCollectorTool::initialize
virtual StatusCode initialize() override
Definition: DecisionCollectorTool.cxx:8
DecisionCollectorTool::getDecisions
void getDecisions(std::vector< TrigCompositeUtils::DecisionID > &, const EventContext &) const
Get decision IDs for the current event.
Definition: DecisionCollectorTool.cxx:32
DecisionCollectorTool::m_decisionsKey
SG::ReadHandleKeyArray< TrigCompositeUtils::DecisionContainer > m_decisionsKey
Definition: DecisionCollectorTool.h:33
AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray
void renounceArray(SG::VarHandleKeyArray &handlesArray)
remove all handles from I/O resolution
Definition: AthCommonDataStore.h:364
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:274
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::decisions
decisions
Definition: TrigComposite_v1.cxx:101
merge.output
output
Definition: merge.py:16
DecisionCollectorTool.h
TrigCompositeUtils::decisionIDs
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Definition: TrigCompositeUtilsRoot.cxx:64
DecisionCollectorTool::getSequencesNames
void getSequencesNames(std::set< std::string > &) const
Get configured sequence names.
Definition: DecisionCollectorTool.cxx:14