ATLAS Offline Software
Classes | Typedefs | Functions | Variables
SG::detail Namespace Reference

Classes

class  AuxDataConstSpan
 Auxiliary variable span wrapper (const). More...
 
class  AuxDataSpan
 Auxiliary variable span wrapper. More...
 
class  DataVectorAllocDummy
 
class  ELProxyConverter
 Extend PackedLinkConverter with a (non-const) conversion from PackedLink to a proxy object. More...
 
class  ELProxyRefBase
 Base class for ELProxyT, with the converter held by reference. More...
 
class  ELProxyT
 Proxy for ElementLink. More...
 
class  ELProxyValBase
 Base class for ELProxyT, with the converter held by value. More...
 
class  ELSpanConverter
 Converter from a vector of PackedLink to a range of ElementLink proxies. More...
 
class  ELSpanProxy
 Proxy for a span of ElementLinks. More...
 
class  IteratorBase
 
class  JaggedVecConstConverter
 Helper: Make a span from a jagged vector element. More...
 
class  JaggedVecConverter
 Helper: Make a span — either read-only or writable — from a jagged vector element. More...
 
class  JaggedVecProxyBase
 Base class for jagged vector proxies. More...
 
class  JaggedVecProxyRefBase
 Adapter for holding the proxy base information by reference. More...
 
class  JaggedVecProxyT
 Proxy for jagged vectors. More...
 
class  JaggedVecProxyValBase
 Adapter for holding the proxy base information by value. More...
 
class  LinkedVarAccessorBase
 Base class usable for accessors for variables with linked variables. More...
 
class  PackedLinkConstConverter
 Helper: Convert a PackedLink to an ElementLink. More...
 
class  PackedLinkConverter
 Helper: Convert a PackedLink to an ElementLink and vice-versa. More...
 
class  PackedLinkVectorConstConverter
 Helper: Convert a vector of PackedLink to a span over ElementLinks. More...
 
class  PackedLinkVectorHelper
 Helper functions for managing PackedLink variables. More...
 
class  PackedLinkVectorHelperBase
 Helper functions for managing PackedLink variables. More...
 
class  WDHScan
 Helper to scan a tree of components to search for another handle key potentially conflicting with the container key part of a WriteDecorHandleKey. More...
 

Typedefs

template<class CONT >
using ELProxyInSpan = detail::ELProxyT< detail::ELProxyRefBase< CONT > >
 Proxy holding the converter by reference — meant to be used when we have a proxy as a member of a span. More...
 
template<class CONT >
using ELProxyInSpanConverter = detail::ELProxyConverter< detail::ELProxyInSpan< CONT > >
 Converter producing a proxy — meant to be used when we have a proxy as a member of a span. More...
 
template<class CONT , class PLINK_ALLOC >
using PackedLink_span = typename AuxDataTraits< PackedLink< CONT >, PLINK_ALLOC >::span
 A span over PackedLink. More...
 
template<class CONT , class PLINK_ALLOC >
using ELSpanProxyBase = CxxUtils::transform_view_with_at< PackedLink_span< CONT, PLINK_ALLOC >, std::reference_wrapper< detail::ELProxyInSpanConverter< CONT > > >
 A range transforming a span over PackedLink to ElementLink proxies. More...
 

Functions

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. More...
 
const IDataHandleHolder * findParent (const IDataHandleHolder *h)
 Find the top-level Gaudi component for H. More...
 
void registerWriteDecorHandleKey (IDataHandleHolder *owner, const DataObjID &contHandleKey)
 Optionally register read dependency of a WriteDecorHandleKey. More...
 

Variables

template<class RANGE , class CONT >
concept ElementLinkRange = CxxUtils::InputRangeOverT<RANGE, ElementLink<CONT> >
 Concept for a range of things that can convert to ElementLink<CONT>. More...
 

Typedef Documentation

◆ ELProxyInSpan

template<class CONT >
using SG::detail::ELProxyInSpan = typedef detail::ELProxyT<detail::ELProxyRefBase<CONT> >

Proxy holding the converter by reference — meant to be used when we have a proxy as a member of a span.

Definition at line 287 of file ELProxy.h.

◆ ELProxyInSpanConverter

Converter producing a proxy — meant to be used when we have a proxy as a member of a span.

Definition at line 293 of file ELProxy.h.

◆ ELSpanProxyBase

template<class CONT , class PLINK_ALLOC >
using SG::detail::ELSpanProxyBase = typedef CxxUtils::transform_view_with_at<PackedLink_span<CONT, PLINK_ALLOC>, std::reference_wrapper<detail::ELProxyInSpanConverter<CONT> > >

A range transforming a span over PackedLink to ElementLink proxies.

Definition at line 307 of file ELProxy.h.

◆ PackedLink_span

template<class CONT , class PLINK_ALLOC >
using SG::detail::PackedLink_span = typedef typename AuxDataTraits<PackedLink<CONT>, PLINK_ALLOC>::span

A span over PackedLink.

Definition at line 302 of file ELProxy.h.

Function Documentation

◆ findParent()

const IDataHandleHolder* SG::detail::findParent ( const IDataHandleHolder *  h)

Find the top-level Gaudi component for H.

Parameters
HThe component at which to start the search.

We're given a Gaudi component H as an IDataHandleHolder. If this is an algorithm, return it. Otherwise, search up the list of parents to find either the owning algorithm or a top-level public tool or service.

Definition at line 58 of file WriteDecorHandleKey.cxx.

59 {
60  while (true) {
61  const IAlgTool* astool = dynamic_cast<const IAlgTool*> (h);
62  if (!astool) return h;
63  const IInterface* parent = astool->parent();
64  if (!parent) return h;
65  auto pdh = dynamic_cast<const IDataHandleHolder*> (parent);
66  if (!pdh) return h;
67  if (dynamic_cast<const Gaudi::Algorithm*> (parent)) return pdh;
68  h = pdh;
69  }
70 }

◆ handleInHolder()

bool SG::detail::handleInHolder ( const DataObjID &  contHandleKey,
const IDataHandleHolder &  holder 
)

Test to see if HOLDER has registered a handle key matching CONTHANDLEKEY, as either input or output.

Parameters
contHandleKeyThe handle key to test.
holderThe component to search.

Definition at line 30 of file WriteDecorHandleKey.cxx.

32 {
33  for (const Gaudi::DataHandle* h : holder.inputHandles()) {
34  if (h->fullKey() == contHandleKey) {
35  return true;
36  }
37  }
38 
39  for (const Gaudi::DataHandle* h : holder.outputHandles()) {
40  if (h->fullKey() == contHandleKey) {
41  return true;
42  }
43  }
44 
45  return false;
46 }

◆ registerWriteDecorHandleKey()

void SG::detail::registerWriteDecorHandleKey ( IDataHandleHolder *  owner,
const DataObjID &  contHandleKey 
)

Optionally register read dependency of a WriteDecorHandleKey.

A WriteDecorHandle logically has a read dependency on the container itself. However, just declaring this as a usual ReadHandleKey will cause problems if used in an algorithm that also creates the container: we'll get complaints from the Algorithm base class about circular dependencies.

To deal with this, we don't declare the container ReadHandleKey in declareProperty. Instead, we wait until initialize and declare the dependency with addDependency only if it is not already on a handle list.

This issue also comes up across multiple tools in a single algorithm. For example, if an algorithm that has one tool that creates an container and another tool with a WriteDecorHandleKey, we can get a warning about a circular dependency. To suppress this for the common case, we also search the component tree under the algorithm and avoid adding the ReadHandleKey if there's a matching component in the tree before the one owning the WriteDecorHandleKey. (We only do it for components earlier in the tree walk to make it less likely that we'll suppress the warning for a genuine use-before-write misconfiguration.)

Definition at line 154 of file WriteDecorHandleKey.cxx.

156 {
157  if (!owner) return;
158 
159  // Does this component already have a key matching @c contHandleKey?
160  bool found = handleInHolder (contHandleKey, *owner);
161 
162  if (!found) {
163  // No --- now search the complete component tree up to @c owner for a match.
164  const IDataHandleHolder* parent = findParent (owner);
165  if (parent && parent != owner) {
166  WDHScan scan (contHandleKey, owner);
167  parent->acceptDHVisitor (&scan);
168  found = scan.m_found;
169  }
170  }
171 
172  if (!found) {
173  owner->addDependency (contHandleKey, Gaudi::DataHandle::Reader);
174  }
175 }

Variable Documentation

◆ ElementLinkRange

template<class RANGE , class CONT >
concept SG::detail::ElementLinkRange = CxxUtils::InputRangeOverT<RANGE, ElementLink<CONT> >

Concept for a range of things that can convert to ElementLink<CONT>.

Definition at line 35 of file PackedLinkVectorHelper.h.

SG::detail::findParent
const IDataHandleHolder * findParent(const IDataHandleHolder *h)
Find the top-level Gaudi component for H.
Definition: WriteDecorHandleKey.cxx:58
extractSporadic.h
list h
Definition: extractSporadic.py:97
LHEF::Reader
Pythia8::Reader Reader
Definition: Prophecy4fMerger.cxx:11
test_pyathena.parent
parent
Definition: test_pyathena.py:15
SG::detail::handleInHolder
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.
Definition: WriteDecorHandleKey.cxx:30
h
scan
void scan(TDirectory *td=0, int depth=0)
Definition: listroot.cxx:440
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101