ant
A2 ant: class-based analysis framework
ant::WrapTFile Class Reference

#include <WrapTFile.h>

+ Inheritance diagram for ant::WrapTFile:
+ Collaboration diagram for ant::WrapTFile:

Classes

struct  ENotARootFile
 
struct  ENotReadable
 
struct  Exception
 

Public Member Functions

void Traverse (std::function< void(TKey *)> func) const
 Traverse applies given function to each leaf in the tree of TDirectory. More...
 
template<class T >
std::list< T * > GetListOf () const
 GetListOf Generate a list with all Object in File of provided Type. More...
 
template<typename T >
bool GetObject (const std::string &name, T *&ptr) const
 Find TObject of type T and given name in the file(s). More...
 
template<typename Hist >
std::shared_ptr< Hist > GetSharedHist (const std::string &name) const
 
template<typename T >
std::shared_ptr< T > GetSharedClone (const std::string &name) const
 
template<typename T >
bool GetObjectClone (const std::string &name, T &object) const
 
virtual ~WrapTFile ()
 
 WrapTFile (const WrapTFile &)=delete
 
WrapTFileoperator= (const WrapTFile &)=delete
 

Protected Member Functions

std::unique_ptr< TFile > openFile (const std::string &filename, const std::string mode)
 
 WrapTFile ()
 

Static Protected Member Functions

static bool hasROOTmagic (const std::string &filename)
 

Protected Attributes

std::list< std::unique_ptr< TFile > > files
 

Constructor & Destructor Documentation

◆ WrapTFile() [1/2]

WrapTFile::WrapTFile ( )
protected

◆ ~WrapTFile()

WrapTFile::~WrapTFile ( )
virtual

◆ WrapTFile() [2/2]

ant::WrapTFile::WrapTFile ( const WrapTFile )
delete

Member Function Documentation

◆ GetListOf()

template<class T >
std::list<T*> ant::WrapTFile::GetListOf ( ) const
inline

GetListOf Generate a list with all Object in File of provided Type.

Returns
list with pointers to object;

◆ GetObject()

template<typename T >
bool ant::WrapTFile::GetObject ( const std::string &  name,
T *&  ptr 
) const
inline

Find TObject of type T and given name in the file(s).

Parameters
nameName of the object to get
ptrReference where to store the pointer to the found object
Returns
true if object was found, false otherwise

◆ GetObjectClone()

template<typename T >
bool ant::WrapTFile::GetObjectClone ( const std::string &  name,
T &  object 
) const
inline

◆ GetSharedClone()

template<typename T >
std::shared_ptr<T> ant::WrapTFile::GetSharedClone ( const std::string &  name) const
inline

◆ GetSharedHist()

template<typename Hist >
std::shared_ptr<Hist> ant::WrapTFile::GetSharedHist ( const std::string &  name) const
inline

◆ hasROOTmagic()

bool WrapTFile::hasROOTmagic ( const std::string &  filename)
staticprotected

◆ openFile()

std::unique_ptr< TFile > WrapTFile::openFile ( const std::string &  filename,
const std::string  mode 
)
protected

◆ operator=()

WrapTFile& ant::WrapTFile::operator= ( const WrapTFile )
delete

◆ Traverse()

void WrapTFile::Traverse ( std::function< void(TKey *)>  func) const

Traverse applies given function to each leaf in the tree of TDirectory.

Parameters
funcuse TKey to inspect anything of that object
Note
A TKey may exist more than once under the same name but with different cycle number

Member Data Documentation

◆ files

std::list<std::unique_ptr<TFile> > ant::WrapTFile::files
protected

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