ATLAS Offline Software
Loading...
Searching...
No Matches
Athena::RootNtupleEventContext Class Reference

ROOT specific event selector context. More...

Inheritance diagram for Athena::RootNtupleEventContext:
Collaboration diagram for Athena::RootNtupleEventContext:

Public Types

typedef std::vector< std::string > FileNames_t
 definition of the file container

Public Member Functions

 RootNtupleEventContext (const RootNtupleEventSelector *sel)
 standard c-tor with initialization
virtual ~RootNtupleEventContext ()
 standard d-tor
const FileNames_tfiles () const
virtual void * identifier () const
 context identifier
std::size_t fileIndex () const
 access to the file iterator
void setFileIndex (std::size_t idx)
 set file iterator
std::size_t tupleIndex () const
void setTupleIndex (std::size_t idx)
int64_t entry () const
 access to the current event entry number
void setFID (const std::string &fid)
 set connection FID
const std::string & fid () const
 access to the connection FID
TTree * tree () const
 access to the tree used to iterate
void setTree (TTree *tree)
 set the tree used to iterate

Private Attributes

const RootNtupleEventSelectorm_evtsel
 reference to the hosting event selector instance
long m_collIdx
 current collection index (into m_inputCollectionsName)
long m_tupleIdx
 current tuple index (into ‘m_tupleNames’)
std::string m_fid
 connection FID

Detailed Description

ROOT specific event selector context.

Definition at line 129 of file RootNtupleEventSelector.cxx.

Member Typedef Documentation

◆ FileNames_t

typedef std::vector<std::string> Athena::RootNtupleEventContext::FileNames_t

definition of the file container

Definition at line 134 of file RootNtupleEventSelector.cxx.

Constructor & Destructor Documentation

◆ RootNtupleEventContext()

Athena::RootNtupleEventContext::RootNtupleEventContext ( const RootNtupleEventSelector * sel)
inline

standard c-tor with initialization

Definition at line 152 of file RootNtupleEventSelector.cxx.

152 :
153 m_evtsel(sel),
154 m_collIdx(0),
155 m_tupleIdx(0),
156 m_fid("")
157 {}
long m_tupleIdx
current tuple index (into ‘m_tupleNames’)
long m_collIdx
current collection index (into m_inputCollectionsName)
const RootNtupleEventSelector * m_evtsel
reference to the hosting event selector instance

◆ ~RootNtupleEventContext()

virtual Athena::RootNtupleEventContext::~RootNtupleEventContext ( )
inlinevirtual

standard d-tor

Definition at line 160 of file RootNtupleEventSelector.cxx.

160{}

Member Function Documentation

◆ entry()

int64_t Athena::RootNtupleEventContext::entry ( ) const
inline

access to the current event entry number

Definition at line 185 of file RootNtupleEventSelector.cxx.

185{ return m_evtsel->m_curEvt; }

◆ fid()

const std::string & Athena::RootNtupleEventContext::fid ( ) const
inline

access to the connection FID

Definition at line 191 of file RootNtupleEventSelector.cxx.

191{ return m_fid; }

◆ fileIndex()

std::size_t Athena::RootNtupleEventContext::fileIndex ( ) const
inline

access to the file iterator

Definition at line 171 of file RootNtupleEventSelector.cxx.

172 { return m_collIdx; }

◆ files()

const FileNames_t & Athena::RootNtupleEventContext::files ( ) const
inline

Definition at line 163 of file RootNtupleEventSelector.cxx.

164 { return m_evtsel->m_inputCollectionsName.value(); }

◆ identifier()

virtual void * Athena::RootNtupleEventContext::identifier ( ) const
inlinevirtual

context identifier

Definition at line 167 of file RootNtupleEventSelector.cxx.

168 { return (void*)(m_evtsel); }

◆ setFID()

void Athena::RootNtupleEventContext::setFID ( const std::string & fid)
inline

set connection FID

Definition at line 188 of file RootNtupleEventSelector.cxx.

188{ m_fid = fid; }
const std::string & fid() const
access to the connection FID

◆ setFileIndex()

void Athena::RootNtupleEventContext::setFileIndex ( std::size_t idx)
inline

set file iterator

Definition at line 175 of file RootNtupleEventSelector.cxx.

◆ setTree()

void Athena::RootNtupleEventContext::setTree ( TTree * tree)
inline

set the tree used to iterate

Definition at line 197 of file RootNtupleEventSelector.cxx.

197 {
198 // make sure we clean-up and close the file holding
199 // the previous tree, if any.
200 // dont close if it is the same tree though!
201 TTree *cur = m_evtsel->m_tuple;
202 if (cur && tree != cur) {
203 TFile *old_file = cur->GetCurrentFile();
204 if (old_file) {
205 old_file->Close();
206 }
207 }
208
209 m_evtsel->m_tuple = tree;
210 }
TTree * tree() const
access to the tree used to iterate

◆ setTupleIndex()

void Athena::RootNtupleEventContext::setTupleIndex ( std::size_t idx)
inline

Definition at line 181 of file RootNtupleEventSelector.cxx.

182 { m_tupleIdx = idx; }

◆ tree()

TTree * Athena::RootNtupleEventContext::tree ( ) const
inline

access to the tree used to iterate

Definition at line 194 of file RootNtupleEventSelector.cxx.

194{ return m_evtsel->m_tuple; }

◆ tupleIndex()

std::size_t Athena::RootNtupleEventContext::tupleIndex ( ) const
inline

Definition at line 178 of file RootNtupleEventSelector.cxx.

179 { return m_tupleIdx; }

Member Data Documentation

◆ m_collIdx

long Athena::RootNtupleEventContext::m_collIdx
private

current collection index (into m_inputCollectionsName)

Definition at line 141 of file RootNtupleEventSelector.cxx.

◆ m_evtsel

const RootNtupleEventSelector* Athena::RootNtupleEventContext::m_evtsel
private

reference to the hosting event selector instance

Definition at line 138 of file RootNtupleEventSelector.cxx.

◆ m_fid

std::string Athena::RootNtupleEventContext::m_fid
private

connection FID

Definition at line 147 of file RootNtupleEventSelector.cxx.

◆ m_tupleIdx

long Athena::RootNtupleEventContext::m_tupleIdx
private

current tuple index (into ‘m_tupleNames’)

Definition at line 144 of file RootNtupleEventSelector.cxx.


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