NAIA  1.0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Public Member Functions | Private Attributes | List of all members
NAIA::SkimTreeHandle< T > Class Template Reference

Helper class to ease skimming operations. More...

#include <SkimTreeHandle.h>

Public Member Functions

 SkimTreeHandle (std::unique_ptr< TFile > outFile, std::unique_ptr< T > chain, T *originalChain)
 Construct a new SkimTreeHandle. More...
 
int Fill ()
 Fills the underlying event in the output tree. More...
 
int Write ()
 Writes the skimmed tree on the output rootfile. More...
 
TFile * RootFile ()
 Get a non-owning pointer to the underlying rootfile. More...
 

Private Attributes

std::unique_ptr< TFile > m_outFile
 
std::unique_ptr< T > m_chain
 
T * m_originalChain
 

Detailed Description

template<class T>
class NAIA::SkimTreeHandle< T >

Helper class to ease skimming operations.

This class is meant to automate most of the work when the user has to skim a tree from an existing NAIA file. It will automatically setup the branches in the new tree.

Template Parameters
T

Definition at line 25 of file SkimTreeHandle.h.

Constructor & Destructor Documentation

template<class T>
NAIA::SkimTreeHandle< T >::SkimTreeHandle ( std::unique_ptr< TFile >  outFile,
std::unique_ptr< T >  chain,
T *  originalChain 
)
inline

Construct a new SkimTreeHandle.

Used internally. SkimTreeHandles should always be created by the parent NAIAChain

Parameters
outFileThe rootfile where the new tree will be resident
chainThe new NAIA chain to be filled
originalChainThe original NAIA chain from which events will be copied

Definition at line 35 of file SkimTreeHandle.h.

Member Function Documentation

template<class T>
int NAIA::SkimTreeHandle< T >::Fill ( )
inline

Fills the underlying event in the output tree.

Returns
Whatever returned by TTree::Fill

Definition at line 43 of file SkimTreeHandle.h.

References NAIA::SkimTreeHandle< T >::m_chain, and NAIA::SkimTreeHandle< T >::m_originalChain.

template<class T>
TFile* NAIA::SkimTreeHandle< T >::RootFile ( )
inline

Get a non-owning pointer to the underlying rootfile.

Returns
A raw pointer to the underlying output rootfile. Please don't delete it :)

Definition at line 98 of file SkimTreeHandle.h.

References NAIA::SkimTreeHandle< T >::m_outFile.

template<class T>
int NAIA::SkimTreeHandle< T >::Write ( )
inline

Writes the skimmed tree on the output rootfile.

Returns
Whatever returned by TTree::Write

Definition at line 53 of file SkimTreeHandle.h.

References NAIA::SkimTreeHandle< T >::m_chain, NAIA::SkimTreeHandle< T >::m_originalChain, and NAIA::SkimTreeHandle< T >::m_outFile.

Member Data Documentation

template<class T>
std::unique_ptr<T> NAIA::SkimTreeHandle< T >::m_chain
private
template<class T>
T* NAIA::SkimTreeHandle< T >::m_originalChain
private
template<class T>
std::unique_ptr<TFile> NAIA::SkimTreeHandle< T >::m_outFile
private

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