SFrame 3.6
|
Base class for tools that can be used during the analysis. More...
#include <plug-ins/include/SToolBase.h>
Public Types | |
typedef Type | ParentType |
Declaration of the used type. | |
Public Member Functions | |
SToolBaseT () | |
Defaul Constructor. | |
SToolBaseT (ParentType *parent) | |
Constructor specifying the parent of the tool. | |
virtual | ~SToolBaseT () |
Destructor (needed to make vtable happy) | |
ParentType * | GetParent () const |
Get a pointer to the parent cycle of this tool. | |
void | SetParent (ParentType *parent) |
Get a pointer to the parent cycle of this tool. | |
Protected Member Functions | |
template<class T > | |
T * | Book (const T &histo, const char *directory=0) throw ( SError ) |
Function placing a ROOT object in the output file. | |
template<class T > | |
T * | Retrieve (const char *name, const char *directory=0, Bool_t outputOnly=kFALSE) throw ( SError ) |
Function searching for a ROOT object in the output file. | |
template<class T > | |
std::vector< T * > | RetrieveAll (const char *name, const char *directory=0) throw ( SError ) |
Function retrieving all ROOT objects of this name from the input file. | |
void | WriteObj (const TObject &obj, const char *directory=0) throw ( SError ) |
Function for persistifying a ROOT object to the output. | |
TH1 * | Hist (const char *name, const char *dir=0) |
Function searching for 1-dimensional histograms in the output file. | |
template<typename T > | |
bool | ConnectVariable (const char *treeName, const char *branchName, T &variable) throw ( SError ) |
Connect an input variable. | |
template<typename T > | |
TBranch * | DeclareVariable (T &obj, const char *name, const char *treeName=0) throw ( SError ) |
Declare an output variable. | |
virtual TTree * | GetMetadataTree (const char *name) const throw ( SError ) |
Access one of the metadata trees. | |
virtual TTree * | GetInputMetadataTree (const char *name) const throw ( SError ) |
Access one of the input metadata trees. | |
virtual TTree * | GetOutputMetadataTree (const char *name) const throw ( SError ) |
Access one of the output metadata trees. | |
virtual TTree * | GetInputTree (const char *treeName) const throw ( SError ) |
Access one of the input trees. | |
virtual TTree * | GetOutputTree (const char *treeName) const throw ( SError ) |
Access one of the output trees. | |
template<typename T > | |
void | DeclareProperty (const std::string &name, T &value) |
Declare a property. | |
void | AddConfigObject (TObject *object) |
Add a configuration object that should be available on the PROOF nodes. | |
TObject * | GetConfigObject (const char *name) const |
Get a configuration object on the PROOF nodes. | |
void | SetLogName (const char *name) |
Set the name under which the tool's log messages should appear. | |
Protected Attributes | |
SLogger | m_logger |
Logger object for the tool. | |
Friends | |
class | SInputVariables< SToolBaseT< SCycleBase > > |
To enable the usage of the protected functions for SInputVariables. | |
class | SOutputVariables< SToolBaseT< SCycleBase > > |
To enable the usage of the protected functions for SOutputVariables. | |
class | SToolBaseT< SToolBaseT< SCycleBase > > |
To enable the instantiation of SToolBaseT< SToolBase > tools. |
Base class for tools that can be used during the analysis.
The idea is that people will probably want to make their analysis code modular by breaking it into many classes. To make it easy to do common "SFrame tasks" in these classes (which are not cycles themselves), one can use this base class. It provides much of the same convenience functionality that SCycleBase does.
Definition at line 40 of file SToolBase.h.
typedef Type SToolBaseT< Type >::ParentType |
Declaration of the used type.
Definition at line 51 of file SToolBase.h.
SToolBaseT< Type >::SToolBaseT | ( | ) |
Defaul Constructor.
Definition at line 18 of file SToolBase.icc.
SToolBaseT< Type >::SToolBaseT | ( | ParentType * | parent | ) |
Constructor specifying the parent of the tool.
Definition at line 24 of file SToolBase.icc.
virtual SToolBaseT< Type >::~SToolBaseT | ( | ) | [inline, virtual] |
Destructor (needed to make vtable happy)
Definition at line 58 of file SToolBase.h.
void SToolBaseT< Type >::AddConfigObject | ( | TObject * | object | ) | [protected] |
Add a configuration object that should be available on the PROOF nodes.
Definition at line 142 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
T * SToolBaseT< Type >::Book | ( | const T & | histo, |
const char * | directory = 0 |
||
) | throw ( SError ) [protected] |
Function placing a ROOT object in the output file.
Definition at line 51 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
bool SToolBaseT< Type >::ConnectVariable | ( | const char * | treeName, |
const char * | branchName, | ||
T & | variable | ||
) | throw ( SError ) [protected] |
Connect an input variable.
Definition at line 89 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
void SToolBaseT< Type >::DeclareProperty | ( | const std::string & | name, |
T & | value | ||
) | [protected] |
Declare a property.
Definition at line 135 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
TBranch * SToolBaseT< Type >::DeclareVariable | ( | T & | obj, |
const char * | name, | ||
const char * | treeName = 0 |
||
) | throw ( SError ) [protected] |
Declare an output variable.
Definition at line 97 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
TObject * SToolBaseT< Type >::GetConfigObject | ( | const char * | name | ) | const [protected] |
Get a configuration object on the PROOF nodes.
Definition at line 149 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
TTree * SToolBaseT< Type >::GetInputMetadataTree | ( | const char * | name | ) | const throw ( SError ) [protected, virtual] |
Access one of the input metadata trees.
Definition at line 110 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
TTree * SToolBaseT< Type >::GetInputTree | ( | const char * | treeName | ) | const throw ( SError ) [protected, virtual] |
Access one of the input trees.
Definition at line 122 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
TTree * SToolBaseT< Type >::GetMetadataTree | ( | const char * | name | ) | const throw ( SError ) [protected, virtual] |
Access one of the metadata trees.
Definition at line 104 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
TTree * SToolBaseT< Type >::GetOutputMetadataTree | ( | const char * | name | ) | const throw ( SError ) [protected, virtual] |
Access one of the output metadata trees.
Definition at line 116 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
TTree * SToolBaseT< Type >::GetOutputTree | ( | const char * | treeName | ) | const throw ( SError ) [protected, virtual] |
Access one of the output trees.
Definition at line 128 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
SToolBaseT< Type >::ParentType * SToolBaseT< Type >::GetParent | ( | ) | const |
Get a pointer to the parent cycle of this tool.
Definition at line 30 of file SToolBase.icc.
References REPORT_ERROR.
Referenced by SToolBaseT< Type >::AddConfigObject(), SToolBaseT< Type >::Book(), SToolBaseT< Type >::ConnectVariable(), SToolBaseT< Type >::DeclareProperty(), SToolBaseT< Type >::DeclareVariable(), SToolBaseT< Type >::GetConfigObject(), SToolBaseT< Type >::GetInputMetadataTree(), SToolBaseT< Type >::GetInputTree(), SToolBaseT< Type >::GetMetadataTree(), SToolBaseT< Type >::GetOutputMetadataTree(), SToolBaseT< Type >::GetOutputTree(), SToolBaseT< Type >::Hist(), SToolBaseT< Type >::Retrieve(), SToolBaseT< Type >::RetrieveAll(), and SToolBaseT< Type >::WriteObj().
TH1 * SToolBaseT< Type >::Hist | ( | const char * | name, |
const char * | dir = 0 |
||
) | [protected] |
Function searching for 1-dimensional histograms in the output file.
Definition at line 82 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
T * SToolBaseT< Type >::Retrieve | ( | const char * | name, |
const char * | directory = 0 , |
||
Bool_t | outputOnly = kFALSE |
||
) | throw ( SError ) [protected] |
Function searching for a ROOT object in the output file.
Definition at line 58 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
std::vector< T * > SToolBaseT< Type >::RetrieveAll | ( | const char * | name, |
const char * | directory = 0 |
||
) | throw ( SError ) [protected] |
Function retrieving all ROOT objects of this name from the input file.
Definition at line 67 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
void SToolBaseT< Type >::SetLogName | ( | const char * | name | ) | [protected] |
Set the name under which the tool's log messages should appear.
Definition at line 155 of file SToolBase.icc.
References SToolBaseT< Type >::m_logger, and SLogger::SetSource().
void SToolBaseT< Type >::SetParent | ( | ParentType * | parent | ) |
Get a pointer to the parent cycle of this tool.
Definition at line 43 of file SToolBase.icc.
void SToolBaseT< Type >::WriteObj | ( | const TObject & | obj, |
const char * | directory = 0 |
||
) | throw ( SError ) [protected] |
Function for persistifying a ROOT object to the output.
Definition at line 74 of file SToolBase.icc.
References SToolBaseT< Type >::GetParent().
friend class SInputVariables< SToolBaseT< SCycleBase > > [friend] |
To enable the usage of the protected functions for SInputVariables.
Definition at line 43 of file SToolBase.h.
friend class SOutputVariables< SToolBaseT< SCycleBase > > [friend] |
To enable the usage of the protected functions for SOutputVariables.
Definition at line 45 of file SToolBase.h.
friend class SToolBaseT< SToolBaseT< SCycleBase > > [friend] |
To enable the instantiation of SToolBaseT< SToolBase > tools.
Definition at line 47 of file SToolBase.h.
SLogger SToolBaseT< Type >::m_logger [mutable, protected] |
Logger object for the tool.
Definition at line 138 of file SToolBase.h.
Referenced by SToolBaseT< Type >::SetLogName().