ATLAS Offline Software
Functions
xAOD::detail Namespace Reference

Functions

template<class T >
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainerImpl (const T &cont, DataLink< SG::IConstAuxStore > &link)
 Impl function for shallow copy container. More...
 
template<class VARTYPE , class AUXBASE >
VARTYPE initAuxVar2 (AUXBASE *auxcont, std::true_type)
 
template<class VARTYPE , class AUXBASE >
VARTYPE initAuxVar2 (AUXBASE *, std::false_type)
 
template<class VARTYPE , class AUXBASE >
VARTYPE initAuxVar1 (AUXBASE *auxcont)
 
template<const char * NAME, class AUXBASE , class VARTYPE >
VARTYPE initAuxVar (AUXBASE *auxcont, VARTYPE &var, SG::AuxVarFlags flags=SG::AuxVarFlags::None)
 

Function Documentation

◆ initAuxVar()

template<const char * NAME, class AUXBASE , class VARTYPE >
VARTYPE xAOD::detail::initAuxVar ( AUXBASE *  auxcont,
VARTYPE &  var,
SG::AuxVarFlags  flags = SG::AuxVarFlags::None 
)

Definition at line 81 of file AuxVariable.h.

84 {
85  static const SG::auxid_t auxid = auxcont->getAuxID( NAME, var, flags );
86  auxcont->regAuxVar (auxid, NAME, var);
87  return initAuxVar1<VARTYPE>( auxcont );
88 }

◆ initAuxVar1()

template<class VARTYPE , class AUXBASE >
VARTYPE xAOD::detail::initAuxVar1 ( AUXBASE *  auxcont)

Definition at line 74 of file AuxVariable.h.

75 {
76  return initAuxVar2<VARTYPE> ( auxcont, std::is_constructible<VARTYPE, std::pmr::memory_resource*>() );
77 }

◆ initAuxVar2() [1/2]

template<class VARTYPE , class AUXBASE >
VARTYPE xAOD::detail::initAuxVar2 ( AUXBASE *  ,
std::false_type   
)

Definition at line 66 of file AuxVariable.h.

68 {
69  return VARTYPE();
70 }

◆ initAuxVar2() [2/2]

template<class VARTYPE , class AUXBASE >
VARTYPE xAOD::detail::initAuxVar2 ( AUXBASE *  auxcont,
std::true_type   
)

Definition at line 58 of file AuxVariable.h.

60 {
61  return VARTYPE (auxcont->memResource());
62 }

◆ shallowCopyContainerImpl()

template<class T >
std::pair<std::unique_ptr<T>, std::unique_ptr<ShallowAuxContainer> > xAOD::detail::shallowCopyContainerImpl ( const T &  cont,
DataLink< SG::IConstAuxStore > &  link 
)

Impl function for shallow copy container.

Parameters
contThe container to make a shallow copy of
ctxThe currentEventContext
Returns
A pair of unique_ptr to the created objects.

Definition at line 54 of file ShallowCopy.h.

55  {
56 
57  if (!link.cptr()) {
58  // This can happen when we read the input file in standalone
59  // mode in branch access mode. That's unfortunately not
60  // compatible with using a shallow copy auxiliary store.
61  std::cout << "xAOD::shallowCopyContainer ERROR Couldn't set up "
62  << "DataLink to the original container's auxiliary store"
63  << std::endl;
64  std::cout << "xAOD::shallowCopyContainer ERROR Are you using the "
65  << "xAOD::TEvent::kBranchAccess access mode?" << std::endl;
66  return {};
67  }
68 
69  // Create the new DV container:
70  auto newCont = std::make_unique<T>();
71 
72  // Add the required number of elements to it:
73  newCont->reserve(cont.size());
74  for (size_t i = 0; i < cont.size(); ++i) {
75  newCont->push_back(prepareElementForShallowCopy(cont[i]));
76  }
77 
78  // Create a new shallow auxiliary container:
79  auto aux = std::make_unique<ShallowAuxContainer>(link);
80 
81  // Connect it to the interface container:
82  newCont->setStore(aux.get());
83 
84  // Return the new objects:
85  return std::make_pair(std::move(newCont), std::move(aux));
86  }
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
xAOD::prepareElementForShallowCopy
std::unique_ptr< T > prepareElementForShallowCopy(const T *)
Function to prepare an object to be stored in a shallow-copy container.
Definition: ShallowCopy.h:43
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
lumiFormat.i
int i
Definition: lumiFormat.py:92