14#include "GaudiKernel/IAlgTool.h"
15#include "GaudiKernel/IDataHandleHolder.h"
16#include "GaudiKernel/Algorithm.h"
30 const IDataHandleHolder& holder)
32 for (
const Gaudi::DataHandle*
h : holder.inputHandles()) {
33 if (
h->fullKey() == contHandleKey) {
38 for (
const Gaudi::DataHandle*
h : holder.outputHandles()) {
39 if (
h->fullKey() == contHandleKey) {
57const IDataHandleHolder*
findParent (
const IDataHandleHolder*
h)
60 const IAlgTool* astool =
dynamic_cast<const IAlgTool*
> (
h);
61 if (!astool)
return h;
62 const IInterface* parent = astool->parent();
63 if (!parent)
return h;
64 auto pdh =
dynamic_cast<const IDataHandleHolder*
> (parent);
66 if (
dynamic_cast<const Gaudi::Algorithm*
> (parent))
return pdh;
81 :
public IDataHandleVisitor
89 WDHScan (
const DataObjID& contHandleKey,
const IDataHandleHolder* owner)
90 : m_contHandleKey (contHandleKey),
96 virtual void visit (
const IDataHandleHolder*
h)
override;
99 const DataObjID& m_contHandleKey;
102 const IDataHandleHolder* m_owner;
105 bool m_found =
false;
108 bool m_sawOwner =
false;
116void WDHScan::visit (
const IDataHandleHolder*
h)
119 if (m_found || m_sawOwner)
return;
154 const DataObjID& contHandleKey)
163 const IDataHandleHolder* parent =
findParent (owner);
164 if (parent && parent != owner) {
166 parent->acceptDHVisitor (&
scan);
167 found =
scan.m_found;
172 owner->addDependency (contHandleKey, Gaudi::DataHandle::Reader);
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Header file for AthHistogramAlgorithm.
Helper to scan a tree of components to search for another handle key potentially conflicting with the...
void scan(TDirectory *td=0, int depth=0)
void registerWriteDecorHandleKey(IDataHandleHolder *owner, const DataObjID &contHandleKey)
Optionally register read dependency of a WriteDecorHandleKey.
const IDataHandleHolder * findParent(const IDataHandleHolder *h)
Find the top-level Gaudi component for H.
bool handleInHolder(const DataObjID &contHandleKey, const IDataHandleHolder &holder)
Test to see if HOLDER has registered a handle key matching CONTHANDLEKEY, as either input or output.