ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
xAOD::TAuxManager Class Reference

Manager for TAuxStore objects. More...

#include <TAuxManager.h>

Inheritance diagram for xAOD::TAuxManager:
Collaboration diagram for xAOD::TAuxManager:

Public Member Functions

 TAuxManager (TAuxStore *store, ::Bool_t sharedOwner=kTRUE)
 Constructor getting hold of an auxiliary store object. More...
 
 TAuxManager (const TAuxManager &parent)
 Copy constructor. More...
 
TAuxManageroperator= (const TAuxManager &rhs)
 Assignment operator. 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...
 
TAuxStoregetStore ()
 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< TAuxStorem_store
 The auxiliary store object. More...
 
TAuxStorem_storePtr
 Pointer to the auxiliary store object. More...
 

Detailed Description

Manager for TAuxStore objects.

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

Author
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h

Definition at line 33 of file TAuxManager.h.

Constructor & Destructor Documentation

◆ TAuxManager() [1/2]

xAOD::TAuxManager::TAuxManager ( TAuxStore store,
::Bool_t  sharedOwner = kTRUE 
)

Constructor getting hold of an auxiliary store object.

Definition at line 16 of file TAuxManager.cxx.

17  : m_store(), m_storePtr( store ) {
18 
19  if( sharedOwner ) {
20  m_store.reset( store );
21  }
22  }

◆ TAuxManager() [2/2]

xAOD::TAuxManager::TAuxManager ( const TAuxManager parent)

Copy constructor.

Definition at line 24 of file TAuxManager.cxx.

25  : m_store( parent.m_store ), m_storePtr( parent.m_storePtr ) {
26 
27  }

Member Function Documentation

◆ create()

Bool_t xAOD::TAuxManager::create ( )
overridevirtual

Create the object for the current event.

There is no need for a default object.

Implements xAOD::TVirtualManager.

Definition at line 70 of file TAuxManager.cxx.

70  {
71 
72  return kTRUE;
73  }

◆ getConstStore()

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

Get a convenience pointer to the managed object.

Definition at line 104 of file TAuxManager.cxx.

104  {
105 
106  return m_storePtr;
107  }

◆ getEntry()

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

Function for updating the object in memory if needed.

Implements xAOD::TVirtualManager.

Definition at line 43 of file TAuxManager.cxx.

43  {
44 
45  return m_storePtr->getEntry( getall );
46  }

◆ getStore()

TAuxStore * xAOD::TAuxManager::getStore ( )

Get a type-specific pointer to the managed object.

Definition at line 99 of file TAuxManager.cxx.

99  {
100 
101  return m_storePtr;
102  }

◆ isSet()

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

Check if the object was set for the current event.

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

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

Implements xAOD::TVirtualManager.

Definition at line 79 of file TAuxManager.cxx.

79  {
80 
81  return kTRUE;
82  }

◆ object() [1/2]

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

Function getting a const pointer to the object being handled.

Implements xAOD::TVirtualManager.

Definition at line 48 of file TAuxManager.cxx.

48  {
49 
50  return m_storePtr;
51  }

◆ object() [2/2]

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

Function getting a pointer to the object being handled.

Implements xAOD::TVirtualManager.

Definition at line 53 of file TAuxManager.cxx.

53  {
54 
55  return m_storePtr;
56  }

◆ operator=()

TAuxManager & xAOD::TAuxManager::operator= ( const TAuxManager rhs)

Assignment operator.

Definition at line 29 of file TAuxManager.cxx.

29  {
30 
31  // Check if anything needs to be done:
32  if( this == &rhs ) {
33  return *this;
34  }
35 
36  // Do the assignment:
37  m_store = rhs.m_store;
38  m_storePtr = rhs.m_storePtr;
39 
40  return *this;
41  }

◆ reset()

void xAOD::TAuxManager::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 88 of file TAuxManager.cxx.

88  {
89 
90  // Clear the store if it's a container store:
92  m_storePtr->resize( 0 );
93  m_storePtr->reset();
94  }
95 
96  return;
97  }

◆ setObject()

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

Function replacing the object being handled.

Implements xAOD::TVirtualManager.

Definition at line 58 of file TAuxManager.cxx.

58  {
59 
60  if( m_store.get() ) {
61  m_store.reset( reinterpret_cast< TAuxStore* >( ptr ) );
62  }
63  m_storePtr = reinterpret_cast< TAuxStore* >( ptr );
64 
65  return;
66  }

Member Data Documentation

◆ m_store

std::shared_ptr< TAuxStore > xAOD::TAuxManager::m_store
private

The auxiliary store object.

Definition at line 68 of file TAuxManager.h.

◆ m_storePtr

TAuxStore* xAOD::TAuxManager::m_storePtr
private

Pointer to the auxiliary store object.

Definition at line 70 of file TAuxManager.h.


The documentation for this class was generated from the following files:
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:71
xAOD::TAuxStore::resize
virtual bool resize(size_t size) override
Resize the arrays to a given size.
Definition: TAuxStore.cxx:611
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
xAOD::TAuxStore::reset
void reset()
Tell the object that all branches will need to be re-read.
Definition: TAuxStore.cxx:274
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::TAuxStore::getEntry
Int_t getEntry(Int_t getall=0)
Read the values from the TTree entry that was loaded with TTree::LoadTree()
Definition: TAuxStore.cxx:228
xAOD::TAuxStore::kContainerStore
@ kContainerStore
The object describes an entire container.
Definition: TAuxStore.h:55
xAOD::TAuxManager::m_storePtr
TAuxStore * m_storePtr
Pointer to the auxiliary store object.
Definition: TAuxManager.h:70
xAOD::TAuxStore::structMode
EStructMode structMode() const
Get what structure mode the object was constructed with.
Definition: TAuxStore.cxx:88
xAOD::TAuxManager::m_store
std::shared_ptr< TAuxStore > m_store
The auxiliary store object.
Definition: TAuxManager.h:68