ATLAS Offline Software
|
#include <RootD3PD.h>
Public Types | |
typedef unsigned int | Dim_t |
Currently unimplemented — see design note. More... | |
Public Member Functions | |
RootD3PD (TTree *tree, const std::string &master, const std::vector< std::string > &allowedNames=std::vector< std::string >(), const std::vector< std::string > &vetoedNames=std::vector< std::string >(), int basketSize=-1, int entryOffsetLen=-1) | |
Constructor. More... | |
~RootD3PD () | |
Destructor. More... | |
virtual StatusCode | addVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0) override |
Add a variable to the tuple. More... | |
virtual StatusCode | addDimensionedVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &dim, const std::string &docstring="", const void *defval=0) override |
Add a variable to the tuple. More... | |
virtual StatusCode | capture () override |
Capture the current state of all variables and write to the tuple. More... | |
virtual StatusCode | clear () override |
Clear all the tuple variables. More... | |
virtual StatusCode | redim (const Dim_t *ptr) override |
Currently unimplemented — see design note. More... | |
const TTree * | tree () const |
Return the underlying root tree. More... | |
TTree * | tree () |
const std::string & | master () const |
Return the name of the master tree. More... | |
virtual StatusCode | addMetadata (const std::string &key, const void *obj, const std::type_info &ti) override |
Add a new piece of metadata to the tuple. More... | |
void | setPoolFile (const std::string &poolFile) |
Set the name of a pool file to which we should attach. More... | |
StatusCode | attachPoolFile () |
Try to attach to a pool file, if we haven't yet done so. More... | |
template<class T > | |
StatusCode | addMetadata (const std::string &key, const T *obj) |
Add a new piece of metadata to the tuple. More... | |
template<class T > | |
StatusCode | addVariable (const std::string &name, T *&ptr, const std::string &docstring="") |
Add a variable to the tuple. More... | |
template<class T , class U > | |
StatusCode | addVariable (const std::string &name, T *&ptr, const std::string &docstring, const U &defval) |
Add a variable to the tuple. More... | |
template<class T > | |
StatusCode | addDimensionedVariable (const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring="") |
Add a variable to the tuple. More... | |
template<class T , class U > | |
StatusCode | addDimensionedVariable (const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring, const U &defval) |
Add a variable to the tuple. More... | |
Private Member Functions | |
TClass * | getClass (const std::type_info &ti) |
Try to convert from a std::type_info to a TClass. More... | |
bool | isAllowed (const std::string &name) |
Decide if a given variable name is allowed. More... | |
StatusCode | addFakeVariable (const std::string &name, const std::type_info &ti, void *&ptr) |
Create a variable in memory only. More... | |
RootD3PD (const RootD3PD &)=delete | |
RootD3PD & | operator= (const RootD3PD &)=delete |
Private Attributes | |
TTree * | m_tree |
The underlying root tree. More... | |
std::string | m_master |
The name of the master tree. More... | |
int | m_basketSize |
Specified basket size. More... | |
int | m_entryOffsetLen |
Specified entry offset buffer length. More... | |
Root::Cleartable * | m_cleartable |
Helper to clear variables. More... | |
std::vector< std::string > | m_allowedNames |
List of names/regular expressions allowed to be put into the output tree. More... | |
std::vector< std::string > | m_vetoedNames |
List of names/regular expressions not allowed to be put into the output tree. More... | |
std::map< std::string, FakeProxy * > | m_fakeVars |
"Fake" variables, only kept in memory More... | |
std::string | m_poolFile |
If set, the name of a pool data file to which we should attach ourself. More... | |
Root-based D3PD tree.
This provides an ID3PD
interface for a Root tree. The tree is passed to the constructor. Ownership of the tree remains with Root.
If there are several trees being made, one may be designated as the master; the other trees will be made friends of it. (For AANT, this is generally CollectionTree.)
Definition at line 50 of file RootD3PD.h.
|
inherited |
D3PD::RootD3PD::RootD3PD | ( | TTree * | tree, |
const std::string & | master, | ||
const std::vector< std::string > & | allowedNames = std::vector< std::string >() , |
||
const std::vector< std::string > & | vetoedNames = std::vector< std::string >() , |
||
int | basketSize = -1 , |
||
int | entryOffsetLen = -1 |
||
) |
Constructor.
tree | The underlying Root tree. |
master | The name of the master tree. Null if no master. |
allowedNames | Names allowed to be put into the output tree |
vetoedNames | Names not allowed to end up in the output tree |
basketSize | The branch basket size. -1 to use Root default. |
entryOffsetLen | The branch entry offset buffer size. -1 to use Root default. |
tree | The underlying Root tree. |
master | The name of the master tree. Null if no master. |
basketSize | The branch basket size. -1 to use Root default. |
entryOffsetLen | The branch entry offset buffer size. -1 to use Root default. |
Definition at line 439 of file RootD3PD.cxx.
D3PD::RootD3PD::~RootD3PD | ( | ) |
|
overridevirtual |
Add a variable to the tuple.
name | The name of the variable. |
type | The type of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
dim | Dimension for the variable. (Presently unimplemented!) |
docstring | Documentation string for this variable. |
defval | Pointer to the default value to use for this variable. Null for no default (generally means to fill with zeros). Of the type given by ti . Only works for basic types. |
Implements D3PD::IAddVariable.
Definition at line 605 of file RootD3PD.cxx.
|
inherited |
Add a variable to the tuple.
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
dim | Dimension for the variable. (Presently unimplemented!) |
docstring | Documentation string for this variable. |
defval | Pointer to the default value to use for this variable. Only works for basic types. |
If called from the constructor, the only effect is to clear ptr
.
|
inherited |
Add a variable to the tuple.
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
dim | Dimension for the variable. (Presently unimplemented!) |
docstring | Documentation string for this variable. |
If called from the constructor, the only effect is to clear ptr
.
|
private |
|
inherited |
Add a new piece of metadata to the tuple.
key | - The key for this object. Any existing object will be overwritten. |
obj | - Pointer to the object to write. |
The interpretation of the key
parameter is up to the concrete D3PD implementation. However, a key name with a trailing slash NAME/ indicates that all metadata items with this name should be grouped together in a collection called NAME (for example, in a Root directory with that name).
|
overridevirtual |
Add a new piece of metadata to the tuple.
key | - The key for this object. Any existing object will be overwritten. |
obj | - Pointer to the object to write. |
ti | - Type of the object to write. |
The interpretation of the key
parameter is up to the concrete D3PD implementation. However, a key name with a trailing slash NAME/ indicates that all metadata items with this name should be grouped together in a collection called NAME (for example, in a Root directory with that name).
Implements D3PD::ID3PD.
Definition at line 709 of file RootD3PD.cxx.
|
overridevirtual |
Add a variable to the tuple.
name | The name of the variable. |
type | The type of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
docstring | Documentation string for this variable. |
defval | Pointer to the default value to use for this variable. Null for no default (generally means to fill with zeros). Of the type given by ti . Only works for basic types. |
Implements D3PD::IAddVariable.
Definition at line 485 of file RootD3PD.cxx.
|
inherited |
Add a variable to the tuple.
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
docstring | Documentation string for this variable. |
defval | Pointer to the default value to use for this variable. Only works for basic types. |
If called from the constructor, the only effect is to clear ptr
.
|
inherited |
Add a variable to the tuple.
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
docstring | Documentation string for this variable. |
If called from the constructor, the only effect is to clear ptr
.
StatusCode D3PD::RootD3PD::attachPoolFile | ( | ) |
Try to attach to a pool file, if we haven't yet done so.
Definition at line 635 of file RootD3PD.cxx.
|
overridevirtual |
Capture the current state of all variables and write to the tuple.
Implements D3PD::ID3PD.
Definition at line 621 of file RootD3PD.cxx.
|
overridevirtual |
|
private |
Try to convert from a std::type_info to a TClass.
On failure, write an error and return null.
ti | The type to convert. |
On failure, write an error and return null.
Definition at line 788 of file RootD3PD.cxx.
|
private |
Decide if a given variable name is allowed.
This function is used to decide if a variable with a given name is allowed to be put into the output tree or not.
name | The name of the variable |
true
if the variable should be put into the output, and false
if it shouldn't Definition at line 815 of file RootD3PD.cxx.
const std::string & D3PD::RootD3PD::master | ( | ) | const |
Return the name of the master tree.
Definition at line 690 of file RootD3PD.cxx.
Currently unimplemented — see design note.
Implements D3PD::ID3PD.
Definition at line 667 of file RootD3PD.cxx.
void D3PD::RootD3PD::setPoolFile | ( | const std::string & | poolFile | ) |
Set the name of a pool file to which we should attach.
poolFile | The name of the pool file to which we should attach. |
If we want a D3PD tree to end up in a pool file, we can't in general do it from RootD3PDSvc::make, since the file usually won't have been opened yet. Instead, call this method to have the RootD3PD object remember the name of the pool file. On the first capture(), we'll look for the pool file in root's list of files and then associate the tree with it.
Definition at line 885 of file RootD3PD.cxx.
TTree * D3PD::RootD3PD::tree | ( | ) |
Definition at line 681 of file RootD3PD.cxx.
const TTree * D3PD::RootD3PD::tree | ( | ) | const |
Return the underlying root tree.
Definition at line 676 of file RootD3PD.cxx.
|
private |
List of names/regular expressions allowed to be put into the output tree.
Definition at line 221 of file RootD3PD.h.
|
private |
Specified basket size.
Definition at line 211 of file RootD3PD.h.
|
private |
Helper to clear variables.
Definition at line 217 of file RootD3PD.h.
|
private |
Specified entry offset buffer length.
Definition at line 214 of file RootD3PD.h.
|
private |
"Fake" variables, only kept in memory
Definition at line 228 of file RootD3PD.h.
|
private |
The name of the master tree.
Definition at line 208 of file RootD3PD.h.
|
private |
If set, the name of a pool data file to which we should attach ourself.
Definition at line 231 of file RootD3PD.h.
|
private |
The underlying root tree.
Definition at line 205 of file RootD3PD.h.
|
private |
List of names/regular expressions not allowed to be put into the output tree.
Definition at line 225 of file RootD3PD.h.