ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::Experimental::ROutObjManager Class Reference

Manager for EDM objects to be written to RNTuple. More...

#include <ROutObjManager.h>

Inheritance diagram for xAOD::Experimental::ROutObjManager:
Collaboration diagram for xAOD::Experimental::ROutObjManager:

Public Member Functions

 ROutObjManager (std::string_view key, std::unique_ptr< THolder > holder)
 Constructor, getting hold of the created objects.
 ~ROutObjManager ()
 Destructor.
const std::string & key ()
virtual::Int_t getEntry (::Int_t getall=0) override
 Function for updating the object in memory if needed.
virtual const void * object () const override
 Function getting a const pointer to the object being handled.
virtual void * object () override
 Function getting a pointer to the object being handled.
virtual void setObject (void *obj) override
 Function replacing the object being handled.
virtual::Bool_t create () override
 Create the object for the current event.
virtual::Bool_t isSet () const override
 Check if the object was set for the current event.
virtual void reset () override
 Reset the object at the end of processing of an event.
const THolderholder () const
 Accessor to the Holder object.
THolderholder ()
 Accessor to the Holder object.

Private Attributes

std::string m_key
 The name of the (SG) key.
::Bool_t m_isSet
 Was the object set for the current event?
std::unique_ptr< THolderm_holder
 Object holding onto an EDM object in memory.

Detailed Description

Manager for EDM objects to be written to RNTuple.

This class is used when an EDM object is meant to be created by ROOT's schema evolution system, behind the scenes.

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
RD Schaffer R.D.S.nosp@m.chaf.nosp@m.fer@c.nosp@m.ern..nosp@m.ch

Definition at line 27 of file ROutObjManager.h.

Constructor & Destructor Documentation

◆ ROutObjManager()

xAOD::Experimental::ROutObjManager::ROutObjManager ( std::string_view key,
std::unique_ptr< THolder > holder )

Constructor, getting hold of the created objects.

Definition at line 18 of file ROutObjManager.cxx.

19 :
20 IObjectManager(std::move(holder)),
21 m_key( key ),
22 m_isSet( kTRUE ) {}
IObjectManager(std::unique_ptr< THolder > holder)
Constructor.
const THolder * holder() const
Accessor to the Holder object.
::Bool_t m_isSet
Was the object set for the current event?
std::string m_key
The name of the (SG) key.

◆ ~ROutObjManager()

xAOD::Experimental::ROutObjManager::~ROutObjManager ( )
default

Destructor.

Member Function Documentation

◆ create()

Bool_t xAOD::Experimental::ROutObjManager::create ( )
overridevirtual

Create the object for the current event.

Dummy implementation as full objects can't be missing.

Implements xAOD::TVirtualManager.

Definition at line 74 of file ROutObjManager.cxx.

74 {
75
76 return m_isSet;
77}

◆ getEntry()

Int_t xAOD::Experimental::ROutObjManager::getEntry ( ::Int_t getall = 0)
overridevirtual

Function for updating the object in memory if needed.

RDS: not exactly sure of the description here. We always get the entry for the field view.

This function is used to load the contents of a branch only when it needs to be done. It keeps track of which entry was already loaded for a branch/object, and only asks the branch to load an entry when it really has to be done.

Returns
0 if no new entry was read, the number of read bytes otherwise

Implements xAOD::TVirtualManager.

Definition at line 40 of file ROutObjManager.cxx.

40 {
41
42 return 0;
43}

◆ holder() [1/2]

THolder * xAOD::Details::IObjectManager::holder ( )
inherited

Accessor to the Holder object.

Definition at line 48 of file IObjectManager.cxx.

48 {
49
50 return m_holder.get();
51}
std::unique_ptr< THolder > m_holder
Object holding onto an EDM object in memory.

◆ holder() [2/2]

const THolder * xAOD::Details::IObjectManager::holder ( ) const
inherited

Accessor to the Holder object.

Definition at line 43 of file IObjectManager.cxx.

43 {
44
45 return m_holder.get();
46}

◆ isSet()

Bool_t xAOD::Experimental::ROutObjManager::isSet ( ) const
overridevirtual

Check if the object was set for the current event.

Returns
kTRUE if the object for this event was set, kFALSE otherwise

Implements xAOD::TVirtualManager.

Definition at line 82 of file ROutObjManager.cxx.

82 {
83
84 return m_isSet;
85}

◆ key()

const std::string & xAOD::Experimental::ROutObjManager::key ( )
Returns
field name

Definition at line 27 of file ROutObjManager.cxx.

27 {
28 return m_key;
29}

◆ object() [1/2]

const void * xAOD::Experimental::ROutObjManager::object ( ) const
overridevirtual

Function getting a const pointer to the object being handled.

This function gives an easy access to the object managed by this object.

Returns
A typeless pointer to the object being managed

Implements xAOD::TVirtualManager.

Definition at line 51 of file ROutObjManager.cxx.

51 {
52
53 return holder()->get();
54}
const void * get() const
Return a typeless const pointer to the held object.
Definition THolder.cxx:216

◆ object() [2/2]

void * xAOD::Experimental::ROutObjManager::object ( )
overridevirtual

Function getting a pointer to the object being handled.

Implements xAOD::TVirtualManager.

Definition at line 56 of file ROutObjManager.cxx.

56 {
57
58 return holder()->get();
59}

◆ reset()

void xAOD::Experimental::ROutObjManager::reset ( )
overridevirtual

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

This function needs to be called after an event was filled into the output TTree.

It tells the manager object that it needs to wait for another object to be set up for the upcoming event.

Implements xAOD::TVirtualManager.

Definition at line 91 of file ROutObjManager.cxx.

91 {
92
93 m_isSet = kFALSE;
94 return;
95}

◆ setObject()

void xAOD::Experimental::ROutObjManager::setObject ( void * obj)
overridevirtual

Function replacing the object being handled.

This is just a convenient way of calling THolder::Set from TEvent.

Parameters
objThe object to replace the previously managed one

Implements xAOD::TVirtualManager.

Definition at line 65 of file ROutObjManager.cxx.

65 {
66
67 holder()->set( obj );
68 m_isSet = kTRUE;
69 return;
70}
virtual void set(void *obj)
Replace the managed object.
Definition THolder.cxx:231

Member Data Documentation

◆ m_holder

std::unique_ptr<THolder> xAOD::Details::IObjectManager::m_holder
privateinherited

Object holding onto an EDM object in memory.

Definition at line 44 of file IObjectManager.h.

◆ m_isSet

::Bool_t xAOD::Experimental::ROutObjManager::m_isSet
private

Was the object set for the current event?

Definition at line 60 of file ROutObjManager.h.

◆ m_key

std::string xAOD::Experimental::ROutObjManager::m_key
private

The name of the (SG) key.

Definition at line 58 of file ROutObjManager.h.


The documentation for this class was generated from the following files: