ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AthenaBaseComps::AthAlgorithmDHUpdate Class Reference

Update output dependencies to include symlinks. More...

#include <AthAlgorithmDHUpdate.h>

Inheritance diagram for AthenaBaseComps::AthAlgorithmDHUpdate:
Collaboration diagram for AthenaBaseComps::AthAlgorithmDHUpdate:

Public Member Functions

 AthAlgorithmDHUpdate (DataObjIDColl &linkedObjs, std::unique_ptr< IDataHandleVisitor > chain)
 Constructor. More...
 
virtual void visit (const IDataHandleHolder *dhh) override
 Walk over the dependencies of an algorithm. More...
 

Private Member Functions

void handle (CLID clid, const std::string &key)
 Handle one output dependency. More...
 

Private Attributes

DataObjIDColl & m_linkedObjs
 Set of additional output dependencies represented by links. More...
 
std::unique_ptr< IDataHandleVisitor > m_chain
 Hook to call after this one. More...
 

Detailed Description

Update output dependencies to include symlinks.

This is intended to be installed in an algorithm via the m_updateDataHandles hook, to run before Algorithm::sysInitialize merges the sets of input and output dependencies.

It makes a first pass over all the output dependences. For each, it examines the CLID to see if there are any other CLIDs to which it is convertable, and if so, adds them to the linkedObjs list. The intention is that the algorithm will then override extraOutputDeps so that it will include these extra entries.

Definition at line 40 of file AthAlgorithmDHUpdate.h.

Constructor & Destructor Documentation

◆ AthAlgorithmDHUpdate()

AthenaBaseComps::AthAlgorithmDHUpdate::AthAlgorithmDHUpdate ( DataObjIDColl &  linkedObjs,
std::unique_ptr< IDataHandleVisitor >  chain 
)

Constructor.

Parameters
linkedObjsSet to which entries for symlinks will be added.
chainHook to call after this one completes.

Definition at line 25 of file AthAlgorithmDHUpdate.cxx.

27  : m_linkedObjs (linkedObjs),
28  m_chain (std::move (chain))
29 {
30 }

Member Function Documentation

◆ handle()

void AthenaBaseComps::AthAlgorithmDHUpdate::handle ( CLID  clid,
const std::string &  key 
)
private

Handle one output dependency.

Parameters
clidThe CLID of the output.
keyThe SG key of the output.

If CLID has symlinks available, enter these links in linkedObjs.

Definition at line 81 of file AthAlgorithmDHUpdate.cxx.

82 {
83  const SG::BaseInfoBase* bib = SG::BaseInfoBase::find (clid);
84  if (!bib) return;
85  for (CLID clid2 : bib->get_bases()) {
86  if (clid2 != clid) {
87  m_linkedObjs.emplace (clid2, key);
88  }
89  }
90 }

◆ visit()

void AthenaBaseComps::AthAlgorithmDHUpdate::visit ( const IDataHandleHolder *  dhh)
overridevirtual

Walk over the dependencies of an algorithm.

Parameters
dhhThe algorithm object.

Finds output dependencies of the algorithms that have symlinks available and enters these links in linkedObjs.

Definition at line 40 of file AthAlgorithmDHUpdate.cxx.

41 {
42  // Make a copy, as usually linkedObjs will be extraOutputDeps().
43  DataObjIDColl ex = dhh->extraOutputDeps();
44 
45  // Process all output dependencies.
46  for (const Gaudi::DataHandle* h : dhh->outputHandles()) {
47  if (!h->objKey().empty())
48  handle (h->fullKey().clid(), h->objKey());
49  }
50 
51  for (const DataObjID& dobj : ex) {
52  if (!dobj.key().empty())
53  handle (dobj.clid(), dobj.key());
54  }
55 
56  for (const DataObjID& dobj : dhh->outputDataObjs()) {
57  if (!dobj.key().empty())
58  handle (dobj.clid(), dobj.key());
59  }
60 
61  // If we put anything in linkedObjs, also add the contents
62  // of extraOutputDeps.
63  if (!m_linkedObjs.empty()) {
64  m_linkedObjs.insert (ex.begin(), ex.end());
65  }
66 
67  // Call the next hook function, if any.
68  if (m_chain) {
69  m_chain->visit (dhh);
70  }
71 }

Member Data Documentation

◆ m_chain

std::unique_ptr<IDataHandleVisitor> AthenaBaseComps::AthAlgorithmDHUpdate::m_chain
private

Hook to call after this one.

Definition at line 78 of file AthAlgorithmDHUpdate.h.

◆ m_linkedObjs

DataObjIDColl& AthenaBaseComps::AthAlgorithmDHUpdate::m_linkedObjs
private

Set of additional output dependencies represented by links.

Definition at line 75 of file AthAlgorithmDHUpdate.h.


The documentation for this class was generated from the following files:
AthenaBaseComps::AthAlgorithmDHUpdate::handle
void handle(CLID clid, const std::string &key)
Handle one output dependency.
Definition: AthAlgorithmDHUpdate.cxx:81
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
AthenaBaseComps::AthAlgorithmDHUpdate::m_linkedObjs
DataObjIDColl & m_linkedObjs
Set of additional output dependencies represented by links.
Definition: AthAlgorithmDHUpdate.h:75
SG::BaseInfoBase::get_bases
const std::vector< CLID > & get_bases() const
Return the class IDs of all known bases of T (that have class IDs).
Definition: BaseInfo.cxx:304
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
AthenaBaseComps::AthAlgorithmDHUpdate::m_chain
std::unique_ptr< IDataHandleVisitor > m_chain
Hook to call after this one.
Definition: AthAlgorithmDHUpdate.h:78
SG::BaseInfoBase::find
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Definition: BaseInfo.cxx:569
h
SG::BaseInfoBase
The non-template portion of the BaseInfo implementation.
Definition: Control/AthenaKernel/AthenaKernel/BaseInfo.h:451
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37