ATLAS Offline Software
Loading...
Searching...
No Matches
InDetPerfNtupleBranch< branchType > Class Template Reference

This defines a helper class used for writing output ntuples in IDPVM. More...

#include <InDetPerfNtupleBranch.h>

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

Public Types

enum class  attachmentOutcome { Success , InvalidTree , FailedToBranch }

Public Member Functions

 InDetPerfNtupleBranch (const std::string &branchName, branchType defaultValue, InDetPerfNtuple &mgr)
branchType & operator() ()
branchType & get ()
void set (const branchType &in)
void operator= (const 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

const branchType m_default
branchType m_content {m_default}
const std::string m_branchName
TBranch * m_branch {nullptr}

Detailed Description

template<typename branchType>
class InDetPerfNtupleBranch< branchType >

This defines a helper class used for writing output ntuples in IDPVM.

Definition at line 58 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< branchType >::InDetPerfNtupleBranch ( const std::string & branchName,
branchType defaultValue,
InDetPerfNtuple & mgr )
inline

Definition at line 61 of file InDetPerfNtupleBranch.h.

61 :
64 }
InDetPerfNtupleBranchBase(const std::string &branchName, InDetPerfNtuple &mgr)
This defines a helper class used for writing output ntuples in IDPVM.

Member Function Documentation

◆ addPayloadAsBranch()

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

Implements InDetPerfNtupleBranchBase.

Definition at line 79 of file InDetPerfNtupleBranch.h.

79 {
80 return (targetTree ? targetTree->Branch(getName().c_str(), &m_content) : nullptr);
81 }
const std::string & getName() const

◆ attach()

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

◆ fill()

void InDetPerfNtupleBranchBase::fill ( )
inlineinherited

Definition at line 23 of file InDetPerfNtupleBranch.h.

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

◆ get()

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

Definition at line 68 of file InDetPerfNtupleBranch.h.

68{ return m_content; }

◆ 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()()

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

Definition at line 67 of file InDetPerfNtupleBranch.h.

67{ return get(); }

◆ operator=()

template<typename branchType>
void InDetPerfNtupleBranch< branchType >::operator= ( const branchType & in)
inline

Definition at line 72 of file InDetPerfNtupleBranch.h.

72{ set(in); }
void set(const branchType &in)

◆ set()

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

Definition at line 71 of file InDetPerfNtupleBranch.h.

71{ m_content=in; }

◆ setDummy()

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

Implements InDetPerfNtupleBranchBase.

Definition at line 75 of file InDetPerfNtupleBranch.h.

75{ set(m_default); }

Member Data Documentation

◆ m_branch

TBranch* InDetPerfNtupleBranchBase::m_branch {nullptr}
privateinherited

Definition at line 54 of file InDetPerfNtupleBranch.h.

54{nullptr};

◆ m_branchName

const std::string InDetPerfNtupleBranchBase::m_branchName
privateinherited

Definition at line 52 of file InDetPerfNtupleBranch.h.

◆ m_content

template<typename branchType>
branchType InDetPerfNtupleBranch< branchType >::m_content {m_default}
private

Definition at line 85 of file InDetPerfNtupleBranch.h.

85{m_default};

◆ m_default

template<typename branchType>
const branchType InDetPerfNtupleBranch< branchType >::m_default
private

Definition at line 84 of file InDetPerfNtupleBranch.h.


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