ATLAS Offline Software
Public Types | Static Public Member Functions | List of all members
CP::detail::ShallowCopy< T, 3 > Struct Template Reference

#include <CopyHelpers.h>

Collaboration diagram for CP::detail::ShallowCopy< T, 3 >:

Public Types

typedef std::decay< decltype(*(std::declval< EL::AnaAlgorithm >).evtStore()))>::type StoreType
 the type of the event store we use More...
 

Static Public Member Functions

static StatusCode getCopy (MsgStream &msgStream, StoreType &store, T *&object, const T *inputObject, const std::string &outputName, const std::string &auxName)
 

Detailed Description

template<typename T>
struct CP::detail::ShallowCopy< T, 3 >

Definition at line 274 of file SystematicsHandles/SystematicsHandles/CopyHelpers.h.

Member Typedef Documentation

◆ StoreType

template<typename T >
typedef std::decay<decltype( *(std::declval<EL::AnaAlgorithm>).evtStore()))>::type CP::detail::ShallowCopy< T, 3 >::StoreType

the type of the event store we use

Definition at line 279 of file SystematicsHandles/SystematicsHandles/CopyHelpers.h.

Member Function Documentation

◆ getCopy()

template<typename T >
static StatusCode CP::detail::ShallowCopy< T, 3 >::getCopy ( MsgStream &  msgStream,
StoreType store,
T *&  object,
const T *  inputObject,
const std::string &  outputName,
const std::string &  auxName 
)
inlinestatic

Definition at line 282 of file SystematicsHandles/SystematicsHandles/CopyHelpers.h.

285  {
286  // Define the msg(...) function as a lambda.
287  // Suppress thread-checker warning because this provides just a wrapper to MsgStream.
288  const auto msg = [&] ATLAS_NOT_THREAD_SAFE (MSG::Level lvl) -> MsgStream& {
289  msgStream << lvl;
290  return msgStream;
291  };
292 
293  // We can just copy the object as is.
294  auto copy = xAOD::shallowCopyObject( *inputObject );
295  if (!copy.first || !copy.second)
296  {
297  ANA_MSG_ERROR ("failed to shallow copy object: " << outputName);
298  ANA_MSG_ERROR ("likely shallow copying a view container");
299  return StatusCode::FAILURE;
300  }
301 
302  ANA_CHECK (store.record (copy.second, auxName));
303  ANA_CHECK (store.record (copy.first, outputName));
304  object = copy.first;
305  return StatusCode::SUCCESS;
306  }

The documentation for this struct was generated from the following file:
StoreGateSvc::record
StatusCode record(T *p2BRegistered, const TKEY &key)
Record an object with a key.
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
xAOD::shallowCopyObject
std::pair< T *, ShallowAuxInfo * > shallowCopyObject(const T &obj)
Function making a shallow copy of a constant standalone object.
Definition: ShallowCopy.h:163
lumiFormat.outputName
string outputName
Definition: lumiFormat.py:71
calibdata.copy
bool copy
Definition: calibdata.py:27
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7