ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
InDetPerfNtupleBranch< std::vector< branchType > > Class Template Reference

#include <InDetPerfNtupleBranch.h>

Inheritance diagram for InDetPerfNtupleBranch< std::vector< branchType > >:
Collaboration diagram for InDetPerfNtupleBranch< std::vector< branchType > >:

Public Types

enum  attachmentOutcome { attachmentOutcome::Success, attachmentOutcome::InvalidTree, attachmentOutcome::FailedToBranch }
 

Public Member Functions

 InDetPerfNtupleBranch (const std::string &branchName, InDetPerfNtuple &mgr)
 
std::vector< branchType > & operator() ()
 
const std::vector< branchType > & get ()
 
branchType operator() (size_t i)
 
branchType get (size_t i)
 
const std::vector< branchType >::const_iterator begin ()
 
const std::vector< branchType >::const_iterator end ()
 
void set (const std::vector< branchType > &in)
 
void setDummy ()
 
void fill ()
 
const std::string & getName () const
 
TBranch * getBranch () const
 
attachmentOutcome attach (TTree *targetTree)
 

Protected Member Functions

virtual TBranch * addPayloadAsBranch (TTree *targetTree)
 

Private Attributes

std::shared_ptr< std::vector< branchType > > m_content
 
const std::string m_branchName
 
TBranch * m_branch {nullptr}
 

Detailed Description

template<typename branchType>
class InDetPerfNtupleBranch< std::vector< branchType > >

Definition at line 89 of file InDetPerfNtupleBranch.h.

Member Enumeration Documentation

◆ attachmentOutcome

Enumerator
Success 
InvalidTree 
FailedToBranch 

Definition at line 36 of file InDetPerfNtupleBranch.h.

36  {
37  Success,
38  InvalidTree,
39  FailedToBranch
40  };

Constructor & Destructor Documentation

◆ InDetPerfNtupleBranch()

template<typename branchType >
InDetPerfNtupleBranch< std::vector< branchType > >::InDetPerfNtupleBranch ( const std::string &  branchName,
InDetPerfNtuple mgr 
)
inline

Definition at line 92 of file InDetPerfNtupleBranch.h.

92  :
93  InDetPerfNtupleBranchBase(branchName, mgr) {
94  }

Member Function Documentation

◆ addPayloadAsBranch()

template<typename branchType >
virtual TBranch* InDetPerfNtupleBranch< std::vector< branchType > >::addPayloadAsBranch ( TTree *  targetTree)
inlineprotectedvirtual

Implements InDetPerfNtupleBranchBase.

Definition at line 115 of file InDetPerfNtupleBranch.h.

115  {
116  return (targetTree ? targetTree->Branch(getName().c_str(), m_content.get()) : nullptr);
117  }

◆ attach()

InDetPerfNtupleBranchBase::attachmentOutcome InDetPerfNtupleBranchBase::attach ( TTree *  targetTree)
inherited

Definition at line 9 of file InDetPerfNtupleBranch.cxx.

9  {
10  if (targetTree) {
11  m_branch = this->addPayloadAsBranch(targetTree);
13  }
14  else {
16  }
17 }

◆ begin()

template<typename branchType >
const std::vector<branchType>::const_iterator InDetPerfNtupleBranch< std::vector< branchType > >::begin ( )
inline

Definition at line 105 of file InDetPerfNtupleBranch.h.

105 { return get().begin(); }

◆ end()

template<typename branchType >
const std::vector<branchType>::const_iterator InDetPerfNtupleBranch< std::vector< branchType > >::end ( )
inline

Definition at line 106 of file InDetPerfNtupleBranch.h.

106 { return get().end(); }

◆ fill()

void InDetPerfNtupleBranchBase::fill ( )
inlineinherited

Definition at line 23 of file InDetPerfNtupleBranch.h.

23 { if (m_branch) m_branch->Fill(); }

◆ get() [1/2]

template<typename branchType >
const std::vector<branchType>& InDetPerfNtupleBranch< std::vector< branchType > >::get ( )
inline

Definition at line 98 of file InDetPerfNtupleBranch.h.

98 { return *m_content; }

◆ get() [2/2]

template<typename branchType >
branchType InDetPerfNtupleBranch< std::vector< branchType > >::get ( size_t  i)
inline

Definition at line 102 of file InDetPerfNtupleBranch.h.

102 { return m_content->at(i); }

◆ getBranch()

TBranch* InDetPerfNtupleBranchBase::getBranch ( ) const
inlineinherited

Definition at line 33 of file InDetPerfNtupleBranch.h.

33 { return m_branch; }

◆ getName()

const std::string& InDetPerfNtupleBranchBase::getName ( ) const
inlineinherited

Definition at line 30 of file InDetPerfNtupleBranch.h.

30 { return m_branchName; }

◆ operator()() [1/2]

template<typename branchType >
std::vector<branchType>& InDetPerfNtupleBranch< std::vector< branchType > >::operator() ( )
inline

Definition at line 97 of file InDetPerfNtupleBranch.h.

97 { return get(); }

◆ operator()() [2/2]

template<typename branchType >
branchType InDetPerfNtupleBranch< std::vector< branchType > >::operator() ( size_t  i)
inline

Definition at line 101 of file InDetPerfNtupleBranch.h.

101 { return get(i); }

◆ set()

template<typename branchType >
void InDetPerfNtupleBranch< std::vector< branchType > >::set ( const std::vector< branchType > &  in)
inline

Definition at line 109 of file InDetPerfNtupleBranch.h.

109 { *m_content = in; }

◆ setDummy()

template<typename branchType >
void InDetPerfNtupleBranch< std::vector< branchType > >::setDummy ( )
inlinevirtual

Implements InDetPerfNtupleBranchBase.

Definition at line 112 of file InDetPerfNtupleBranch.h.

112 { m_content->clear(); }

Member Data Documentation

◆ m_branch

TBranch* InDetPerfNtupleBranchBase::m_branch {nullptr}
privateinherited

Definition at line 54 of file InDetPerfNtupleBranch.h.

◆ m_branchName

const std::string InDetPerfNtupleBranchBase::m_branchName
privateinherited

Definition at line 52 of file InDetPerfNtupleBranch.h.

◆ m_content

template<typename branchType >
std::shared_ptr<std::vector<branchType> > InDetPerfNtupleBranch< std::vector< branchType > >::m_content
private

Definition at line 120 of file InDetPerfNtupleBranch.h.


The documentation for this class was generated from the following file:
InDetPerfNtupleBranchBase::attachmentOutcome::FailedToBranch
@ FailedToBranch
InDetPerfNtupleBranchBase::m_branchName
const std::string m_branchName
Definition: InDetPerfNtupleBranch.h:52
InDetPerfNtupleBranchBase::attachmentOutcome::InvalidTree
@ InvalidTree
InDetPerfNtupleBranchBase::InDetPerfNtupleBranchBase
InDetPerfNtupleBranchBase(const std::string &branchName, InDetPerfNtuple &mgr)
Definition: InDetPerfNtupleBranch.cxx:4
InDetPerfNtupleBranch< std::vector< branchType > >::m_content
std::shared_ptr< std::vector< branchType > > m_content
Definition: InDetPerfNtupleBranch.h:120
InDetPerfNtupleBranchBase::addPayloadAsBranch
virtual TBranch * addPayloadAsBranch(TTree *targetTree)=0
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
InDetPerfNtupleBranch< std::vector< branchType > >::get
const std::vector< branchType > & get()
Definition: InDetPerfNtupleBranch.h:98
InDetPerfNtupleBranchBase::m_branch
TBranch * m_branch
Definition: InDetPerfNtupleBranch.h:54
lumiFormat.i
int i
Definition: lumiFormat.py:92
InDetPerfNtupleBranchBase::attachmentOutcome::Success
@ Success
InDetPerfNtupleBranchBase::getName
const std::string & getName() const
Definition: InDetPerfNtupleBranch.h:30