ATLAS Offline Software
|
Represent a multiple association by index. More...
#include <IndexMultiAssociationFillerTool.h>
Public Member Functions | |
IndexMultiAssociationFillerTool (const std::string &type, const std::string &name, const IInterface *parent) | |
Standard Gaudi tool constructor. More... | |
virtual StatusCode | initialize () override |
Standard Gaudi initialize method. More... | |
virtual StatusCode | configureD3PD (IAddVariable *tree, const std::type_info &ti) override |
Configure during initialization: type-check. More... | |
virtual StatusCode | book () override |
Declare tuple variables. More... | |
virtual StatusCode | fillUntyped (const void *p, bool again=false) override |
Fill one block. 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... | |
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 | 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... | |
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 | 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 | 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 | |
ToolHandle< IMultiAssociationTool > | m_associator |
Property: The association tool instance. More... | |
std::string | m_targetLabel |
Property: The label of the collection getter defining the collection within which to index. More... | |
std::string | m_prefix |
Property: The variable name prefix. More... | |
std::string | m_blockName |
Property: the name of this block. More... | |
ToolHandle< ICollectionGetterRegistryTool > | m_registry |
Property: The ICollectionGetterRegistryTool instance. More... | |
bool | m_allowMissing |
Property: Don't give an error if the target getter fails to find the input objects. More... | |
std::vector< int > * | m_index |
Index collection variable. More... | |
TypeConverter | m_converter |
Helper to convert from pointer returned by the associator to pointer into the index container. More... | |
IndexMap | m_map |
Map from objects to indices. More... | |
const std::string & | m_suffix |
Reference to the variable suffix. More... | |
IAddVariable * | m_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... | |
Represent a multiple association by index.
This is a block filler tool which represents a multiple association by a collection of indices.
It takes as a property an IMultiAssociationTool
. For each input object, it asks the association tool which objects are associated with it; the result is a collection of 0 or more objects. It also takes as a property a collection getter label. This defines an ‘index’ collection. The tool searches this collection for each target of the association and finds the index of that object within that collection. The result is booked as a vector of ints.
Objects that aren't found in the index collection are omitted from the index vector.
Properties: Associator - The IMultiAssociationTool instance. Target - Label of the collection getter defining the collection within which to index. Prefix - Variable name prefix for the contained blocks. CollectionGetterRegistry - The ICollectionGetterRegistryTool instance.
Definition at line 63 of file IndexMultiAssociationFillerTool.h.
D3PD::IndexMultiAssociationFillerTool::IndexMultiAssociationFillerTool | ( | const std::string & | type, |
const std::string & | name, | ||
const IInterface * | parent | ||
) |
Standard Gaudi tool constructor.
type | The name of the tool type. |
name | The tool name. |
parent | The tool's Gaudi parent. |
Definition at line 28 of file IndexMultiAssociationFillerTool.cxx.
|
virtualinherited |
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. |
If called from the constructor, the only effect is to clear ptr
.
Implements D3PD::IAddVariable.
Definition at line 123 of file AddVariable.cxx.
|
inherited |
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. |
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. |
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. |
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
.
|
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
.
|
virtualinherited |
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. |
If called from the constructor, the only effect is to clear ptr
.
Implements D3PD::IAddVariable.
Definition at line 85 of file AddVariable.cxx.
|
inherited |
Make the template implementation from IAddVariable
visible.
|
inherited |
Make the template implementation from IAddVariable
visible.
|
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 |
Make the template implementation from IAddVariable
visible.
|
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
.
|
overridevirtual |
Declare tuple variables.
This is called at the start of the first event.
Definition at line 111 of file IndexMultiAssociationFillerTool.cxx.
|
inherited |
Configure the parent tree.
tree | The parent IAddVariable instance. |
Definition at line 61 of file AddVariable.cxx.
|
overridevirtual |
Configure during initialization: type-check.
tree | Our parent for tuple making. |
ti | Gives the type of the object being passed to fillUntyped . |
configureD3PD
should check that the type of the object coming as input is compatible with what it expects, and raise an error otherwise.
Definition at line 85 of file IndexMultiAssociationFillerTool.cxx.
|
overridevirtual |
Fill one block.
p | The input object. |
again | Set if this is a subsequent call requested by an AGAIN return |
This is called once per object. The type of the object at which p
points is given by the ti
argument to configureD3PD
. The caller is responsible for arranging that all the pointers for booked variables are set appropriately upon entry.
If the return status is the special code AGAIN
(defined above), then this filler tool wants to make multiple entries. The parent should set up to capture a new ‘row’ and run through the list of block filler tools again, but for this tool call fillAgainUntyped
instead of fillUntyped
. This should be repeated as long as fillAgainUntyped
returns AGAIN
.
Once fillUntyped
returns AGAIN
, the parent should call fillUntyped
with the same p argument and again
set to true
. This continues until fillUntyped
returns something other than AGAIN
.
Not all parents may support this. In that case, returning AGAIN
will be treated as an error.
Definition at line 150 of file IndexMultiAssociationFillerTool.cxx.
|
overridevirtual |
Standard Gaudi initialize
method.
Definition at line 59 of file IndexMultiAssociationFillerTool.cxx.
|
private |
Property: Don't give an error if the target getter fails to find the input objects.
Definition at line 151 of file IndexMultiAssociationFillerTool.h.
|
private |
Property: The association tool instance.
Definition at line 134 of file IndexMultiAssociationFillerTool.h.
|
private |
Property: the name of this block.
Definition at line 144 of file IndexMultiAssociationFillerTool.h.
|
private |
Helper to convert from pointer returned by the associator to pointer into the index container.
Definition at line 158 of file IndexMultiAssociationFillerTool.h.
|
private |
Index collection variable.
Definition at line 154 of file IndexMultiAssociationFillerTool.h.
|
private |
Map from objects to indices.
Definition at line 161 of file IndexMultiAssociationFillerTool.h.
|
protectedinherited |
Metadata about the variables created by this object.
Definition at line 129 of file AddVariable.h.
|
private |
Property: The variable name prefix.
Definition at line 141 of file IndexMultiAssociationFillerTool.h.
|
private |
Property: The ICollectionGetterRegistryTool instance.
Definition at line 147 of file IndexMultiAssociationFillerTool.h.
|
privateinherited |
Reference to the variable suffix.
Definition at line 137 of file AddVariable.h.
|
private |
Property: The label of the collection getter defining the collection within which to index.
Definition at line 138 of file IndexMultiAssociationFillerTool.h.
|
privateinherited |
Reference to the block name.
The parent IAddVariable
instance.
Definition at line 143 of file AddVariable.h.
|
staticprivateinherited |
Used to provide a default value for blockName.
Definition at line 41 of file AddVariable.h.