ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Attributes | Static Private Attributes | List of all members
D3PD::AddVariable Class Reference

Common implementation of IAddVariable. More...

#include <AddVariable.h>

Inherits D3PD::IAddVariable.

Inherited by D3PD::BlockFillerToolImpl, D3PD::ContainedAssociationFillerTool, D3PD::ContainedMultiAssociationFillerTool, D3PD::IndexAssociationFillerTool, D3PD::IndexMultiAssociationFillerTool, D3PD::MultiAssociationToolImpl, D3PD::ObjFillerTool, D3PD::SingleAssociationToolImpl, and D3PD::VoidObjFillerTool.

Collaboration diagram for D3PD::AddVariable:

Public Member Functions

 AddVariable (const std::string &prefix, const std::string &blockName=s_emptyString)
 Constructor. More...
 
 AddVariable (const std::string &prefix, const std::string &blockName, const std::string &suffix)
 Constructor. More...
 
StatusCode configureD3PD (IAddVariable *tree)
 Configure the parent tree. More...
 
virtual StatusCode addVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
 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)
 Add a variable to the tuple. More...
 
template<class T >
StatusCode addVariable (const std::string &name, T *&ptr, const std::string &docstring="")
 Make the template implementation from IAddVariable visible. More...
 
template<class T , class U >
StatusCode addVariable (const std::string &name, T *&ptr, const std::string &docstring, const U &defval)
 Make the template implementation from IAddVariable visible. More...
 
virtual StatusCode addVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)=0
 Make the template implementation from IAddVariable visible. 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...
 
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)=0
 Add a variable 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...
 

Protected Attributes

ObjectMetadata m_metadata
 Metadata about the variables created by this object. More...
 

Private Attributes

const std::string & m_prefix
 Reference to the variable prefix. More...
 
const std::string & m_suffix
 Reference to the variable suffix. More...
 
IAddVariablem_tree
 Reference to the block name. More...
 

Static Private Attributes

static const std::string s_emptyString
 Used to provide a default value for blockName. More...
 

Detailed Description

Common implementation of IAddVariable.

This implements the IAddVariable interface for the common case where we just need to add a prefix/suffix to the variable name and forward to another IAddVariable.

References to the prefix/suffix and block name are passed to the constructor (these will typically be tool properties) and the parent IAddVariable is passed to configureD3PD.

Definition at line 36 of file AddVariable.h.

Constructor & Destructor Documentation

◆ AddVariable() [1/2]

D3PD::AddVariable::AddVariable ( const std::string &  prefix,
const std::string &  blockName = s_emptyString 
)

Constructor.

Parameters
prefixReference to the variable prefix.
blockNameReference to the block name for this tool.

Definition at line 29 of file AddVariable.cxx.

31  : m_metadata (),
32  m_prefix (prefix),
34  //m_blockName (blockName),
35  m_tree (0)
36 {
37 }

◆ AddVariable() [2/2]

D3PD::AddVariable::AddVariable ( const std::string &  prefix,
const std::string &  blockName,
const std::string &  suffix 
)

Constructor.

Parameters
prefixReference to the variable prefix.
blockNameReference to the block name for this tool.
suffixReference to the variable suffix.
prefixReference to the variable prefix.
blockNameReference to the block name for this tool.

Definition at line 45 of file AddVariable.cxx.

48  : m_metadata (),
49  m_prefix (prefix),
50  m_suffix (suffix),
51  //m_blockName (blockName),
52  m_tree (0)
53 {
54 }

Member Function Documentation

◆ addDimensionedVariable() [1/6]

StatusCode D3PD::AddVariable::addDimensionedVariable ( const std::string &  name,
const std::type_info &  ti,
void *&  ptr,
const std::string &  dim,
const std::string &  docstring = "",
const void *  defval = 0 
)
virtual

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer 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.

If called from the constructor, the only effect is to clear ptr.

Implements D3PD::IAddVariable.

Definition at line 123 of file AddVariable.cxx.

129 {
130  if (!m_tree) {
131  // Called from constructor --- just initialize pointer.
132  ptr = 0;
133  return StatusCode::SUCCESS;
134  }
135 
137  ti, ptr, dim,
138  docstring, defval ) );
140  ti, ptr, dim,
141  docstring, defval);
142 }

◆ addDimensionedVariable() [2/6]

virtual StatusCode D3PD::IAddVariable::addDimensionedVariable

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer 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.

If called from the constructor, the only effect is to clear ptr.

◆ addDimensionedVariable() [3/6]

template<class T , class U >
StatusCode D3PD::IAddVariable::addDimensionedVariable ( class T  ,
class U   
)

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer 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.

◆ addDimensionedVariable() [4/6]

template<class T , class U >
StatusCode D3PD::IAddVariable::addDimensionedVariable ( const std::string &  name,
T *&  ptr,
const std::string &  dim,
const std::string &  docstring,
const U &  defval 
)
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer 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.

◆ addDimensionedVariable() [5/6]

template<class T >
StatusCode D3PD::IAddVariable::addDimensionedVariable ( class T  )

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.

If called from the constructor, the only effect is to clear ptr.

◆ addDimensionedVariable() [6/6]

template<class T >
StatusCode D3PD::IAddVariable::addDimensionedVariable ( const std::string &  name,
T *&  ptr,
const std::string &  dim,
const std::string &  docstring = "" 
)
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.

If called from the constructor, the only effect is to clear ptr.

◆ addVariable() [1/6]

StatusCode D3PD::AddVariable::addVariable ( const std::string &  name,
const std::type_info &  ti,
void *&  ptr,
const std::string &  docstring = "",
const void *  defval = 0 
)
virtual

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
docstringDocumentation string for this variable.
defvalPointer 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.

If called from the constructor, the only effect is to clear ptr.

Implements D3PD::IAddVariable.

Definition at line 85 of file AddVariable.cxx.

90 {
91  if (!m_tree) {
92  // Called from constructor --- just initialize pointer.
93  ptr = 0;
94  return StatusCode::SUCCESS;
95  }
96 
98  ti, ptr, docstring, defval ) );
100  ti, ptr, docstring, defval);
101 }

◆ addVariable() [2/6]

virtual StatusCode D3PD::IAddVariable::addVariable

Make the template implementation from IAddVariable visible.

◆ addVariable() [3/6]

template<class T , class U >
StatusCode D3PD::IAddVariable::addVariable ( class T  ,
class U   
)

Make the template implementation from IAddVariable visible.

◆ addVariable() [4/6]

template<class T , class U >
StatusCode D3PD::IAddVariable::addVariable ( const std::string &  name,
T *&  ptr,
const std::string &  docstring,
const U &  defval 
)
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
docstringDocumentation string for this variable.
defvalPointer 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.

◆ addVariable() [5/6]

template<class T >
StatusCode D3PD::IAddVariable::addVariable ( class T  )

Make the template implementation from IAddVariable visible.

◆ addVariable() [6/6]

template<class T >
StatusCode D3PD::IAddVariable::addVariable ( const std::string &  name,
T *&  ptr,
const std::string &  docstring = "" 
)
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
docstringDocumentation string for this variable.

If called from the constructor, the only effect is to clear ptr.

◆ configureD3PD()

StatusCode D3PD::AddVariable::configureD3PD ( IAddVariable tree)

Configure the parent tree.

Parameters
treeThe parent IAddVariable instance.

Definition at line 61 of file AddVariable.cxx.

62 {
63  m_tree = tree;
64  m_metadata.clear();
65  return StatusCode::SUCCESS;
66 }

Member Data Documentation

◆ m_metadata

ObjectMetadata D3PD::AddVariable::m_metadata
protected

Metadata about the variables created by this object.

Definition at line 129 of file AddVariable.h.

◆ m_prefix

const std::string& D3PD::AddVariable::m_prefix
private

Reference to the variable prefix.

Definition at line 134 of file AddVariable.h.

◆ m_suffix

const std::string& D3PD::AddVariable::m_suffix
private

Reference to the variable suffix.

Definition at line 137 of file AddVariable.h.

◆ m_tree

IAddVariable* D3PD::AddVariable::m_tree
private

Reference to the block name.

The parent IAddVariable instance.

Definition at line 143 of file AddVariable.h.

◆ s_emptyString

const std::string D3PD::AddVariable::s_emptyString
staticprivate

Used to provide a default value for blockName.

Definition at line 41 of file AddVariable.h.


The documentation for this class was generated from the following files:
D3PD::ObjectMetadata::addDimensionedVariable
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)
The object doesn't support dimensioned variables at the moment, like most of the D3PDMaker code doesn...
Definition: ObjectMetadata.cxx:157
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:186
D3PD::AddVariable::m_suffix
const std::string & m_suffix
Reference to the variable suffix.
Definition: AddVariable.h:137
tree
TChain * tree
Definition: tile_monitor.h:30
D3PD::AddVariable::m_prefix
const std::string & m_prefix
Reference to the variable prefix.
Definition: AddVariable.h:134
D3PD::AddVariable::m_tree
IAddVariable * m_tree
Reference to the block name.
Definition: AddVariable.h:143
D3PD::AddVariable::m_metadata
ObjectMetadata m_metadata
Metadata about the variables created by this object.
Definition: AddVariable.h:129
D3PD::AddVariable::s_emptyString
static const std::string s_emptyString
Used to provide a default value for blockName.
Definition: AddVariable.h:41
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
D3PD::ObjectMetadata::clear
void clear()
Function clearing the object.
Definition: ObjectMetadata.cxx:352
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
D3PD::ObjectMetadata::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
This function can be used to save the metadata about a D3PD variable.
Definition: ObjectMetadata.cxx:109
D3PD::IAddVariable::addVariable
StatusCode addVariable(const std::string &name, T *&ptr, const std::string &docstring="")
Add a variable to the tuple.
D3PD::IAddVariable::addDimensionedVariable
StatusCode addDimensionedVariable(const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring="")
Add a variable to the tuple.