Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
xAOD::RAuxManager Class Reference

Manager for RAuxStore objects. More...

#include <RAuxManager.h>

Inheritance diagram for xAOD::RAuxManager:
Collaboration diagram for xAOD::RAuxManager:

Public Member Functions

 RAuxManager (RAuxStore *store, ::Long64_t &entry, ::Bool_t sharedOwner=kTRUE)
 Constructor getting hold of an auxiliary store object. More...
 
virtual ::Int_t getEntry (::Int_t getall=0) override
 Function for updating the object in memory if needed. More...
 
virtual const void * object () const override
 Function getting a const pointer to the object being handled. More...
 
virtual void * object () override
 Function getting a pointer to the object being handled. More...
 
virtual void setObject (void *obj) override
 Function replacing the object being handled. More...
 
virtual ::Bool_t create () override
 Create the object for the current event. More...
 
virtual ::Bool_t isSet () const override
 Check if the object was set for the current event. More...
 
virtual void reset () override
 Reset the object at the end of processing of an event. More...
 
RAuxStoregetStore ()
 Get a type-specific pointer to the managed object. More...
 
const SG::IConstAuxStoregetConstStore () const
 Get a convenience pointer to the managed object. More...
 

Private Attributes

std::shared_ptr< RAuxStorem_store
 The auxiliary store object. More...
 
RAuxStorem_storePtr
 Pointer to the auxiliary store object. More...
 
std::reference_wrapper<::Long64_t > m_entry
 Entry number. More...
 

Detailed Description

Manager for RAuxStore objects.

This class is used when connecting RAuxStore objects to the input ntuple as the auxiliary store of a DV container.

Definition at line 27 of file RAuxManager.h.

Constructor & Destructor Documentation

◆ RAuxManager()

xAOD::RAuxManager::RAuxManager ( RAuxStore store,
::Long64_t &  entry,
::Bool_t  sharedOwner = kTRUE 
)

Constructor getting hold of an auxiliary store object.

Definition at line 11 of file RAuxManager.cxx.

14 
15  if (sharedOwner) {
16  m_store.reset(store);
17  }
18 }

Member Function Documentation

◆ create()

Bool_t xAOD::RAuxManager::create ( )
overridevirtual

Create the object for the current event.

There is no need for a default object.

Implements xAOD::TVirtualManager.

Definition at line 51 of file RAuxManager.cxx.

51  {
52 
53  return kTRUE;
54 }

◆ getConstStore()

const SG::IConstAuxStore * xAOD::RAuxManager::getConstStore ( ) const

Get a convenience pointer to the managed object.

Definition at line 85 of file RAuxManager.cxx.

85  {
86 
87  return m_storePtr;
88 }

◆ getEntry()

Int_t xAOD::RAuxManager::getEntry ( ::Int_t  getall = 0)
overridevirtual

Function for updating the object in memory if needed.

Implements xAOD::TVirtualManager.

Definition at line 20 of file RAuxManager.cxx.

20  {
21 
22  if (m_storePtr->getEntry(m_entry.get(), getall).isFailure()) {
23  return -1;
24  } else {
25  return 0;
26  }
27 }

◆ getStore()

RAuxStore * xAOD::RAuxManager::getStore ( )

Get a type-specific pointer to the managed object.

Definition at line 80 of file RAuxManager.cxx.

80  {
81 
82  return m_storePtr;
83 }

◆ isSet()

Bool_t xAOD::RAuxManager::isSet ( ) const
overridevirtual

Check if the object was set for the current event.

The state of a RAuxStore object is always "set".

So this interface unfortunately doesn't make much sense for this manager class...

Implements xAOD::TVirtualManager.

Definition at line 60 of file RAuxManager.cxx.

60  {
61 
62  return kTRUE;
63 }

◆ object() [1/2]

const void * xAOD::RAuxManager::object ( ) const
overridevirtual

Function getting a const pointer to the object being handled.

Implements xAOD::TVirtualManager.

Definition at line 29 of file RAuxManager.cxx.

29  {
30 
31  return m_storePtr;
32 }

◆ object() [2/2]

void * xAOD::RAuxManager::object ( )
overridevirtual

Function getting a pointer to the object being handled.

Implements xAOD::TVirtualManager.

Definition at line 34 of file RAuxManager.cxx.

34  {
35 
36  return m_storePtr;
37 }

◆ reset()

void xAOD::RAuxManager::reset ( )
overridevirtual

Reset the object at the end of processing of an event.

Resetting an auxiliary store needs to be done in a smart way.

Container stores need to be emptied, while object stores don't need to be touched.

Implements xAOD::TVirtualManager.

Definition at line 69 of file RAuxManager.cxx.

69  {
70 
71  // Clear the store if it's a container store:
73  m_storePtr->resize(0);
74  m_storePtr->reset();
75  }
76 
77  return;
78 }

◆ setObject()

void xAOD::RAuxManager::setObject ( void *  obj)
overridevirtual

Function replacing the object being handled.

Implements xAOD::TVirtualManager.

Definition at line 39 of file RAuxManager.cxx.

39  {
40 
41  if (m_store.get()) {
42  m_store.reset(reinterpret_cast<RAuxStore*>(ptr));
43  }
44  m_storePtr = reinterpret_cast<RAuxStore*>(ptr);
45 
46  return;
47 }

Member Data Documentation

◆ m_entry

std::reference_wrapper<::Long64_t> xAOD::RAuxManager::m_entry
private

Entry number.

Definition at line 62 of file RAuxManager.h.

◆ m_store

std::shared_ptr<RAuxStore> xAOD::RAuxManager::m_store
private

The auxiliary store object.

Definition at line 58 of file RAuxManager.h.

◆ m_storePtr

RAuxStore* xAOD::RAuxManager::m_storePtr
private

Pointer to the auxiliary store object.

Definition at line 60 of file RAuxManager.h.


The documentation for this class was generated from the following files:
SGTest::store
TestStore store
Definition: TestStore.cxx:23
xAOD::RAuxManager::m_entry
std::reference_wrapper<::Long64_t > m_entry
Entry number.
Definition: RAuxManager.h:62
xAOD::RAuxManager::m_storePtr
RAuxStore * m_storePtr
Pointer to the auxiliary store object.
Definition: RAuxManager.h:60
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
xAOD::RAuxStore::getEntry
StatusCode getEntry(std::int64_t entry, int getall=0)
Get entry from the input RNTuple.
Definition: RAuxStore.cxx:663
xAOD::details::AuxStoreBase::structMode
EStructMode structMode() const
Get what structure mode the object was constructed with.
Definition: AuxStoreBase.cxx:27
xAOD::details::AuxStoreBase::EStructMode::kContainerStore
@ kContainerStore
The object describes an entire container.
xAOD::RAuxManager::m_store
std::shared_ptr< RAuxStore > m_store
The auxiliary store object.
Definition: RAuxManager.h:58
xAOD::details::AuxStoreBase::resize
virtual bool resize(std::size_t size) override
Resize the arrays to a given size.
Definition: AuxStoreBase.cxx:371
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
xAOD::RAuxStore::reset
virtual void reset() override
Tell the object that all branches will need to be re-read.
Definition: RAuxStore.cxx:734