ATLAS Offline Software
|
Object filler tool for a collection of objects, saved as vectors. More...
#include <VectorFillerTool.h>
Public Member Functions | |
VectorFillerTool (const std::string &type, const std::string &name, const IInterface *parent) | |
Standard Gaudi tool constructor. More... | |
virtual StatusCode | initialize () |
Standard Gaudi initialize method. More... | |
virtual StatusCode | configureD3PD (IAddVariable *tree) |
Configure the tool. More... | |
virtual StatusCode | book () |
Declare tuple variables. More... | |
virtual StatusCode | fill () |
Fill one object. More... | |
virtual bool | isContainerFiller () const |
Find out if the filler handles containers or single objects. More... | |
virtual void | handle (const Incident &inc) |
Handle end of run incidents to save the metadata at that point. More... | |
Private Attributes | |
ToolHandle< ICollectionGetterTool > | m_getter |
Property: The collection getter tool. More... | |
std::string | m_objectName |
Property: the name of the D3PDObject that created this tool. More... | |
bool | m_allowMissing |
Property: If true, the input object is allowed to be missing. More... | |
bool | m_saveMetadata |
Property: If true, the metadata about the variables is saved. More... | |
ID3PD * | m_tree |
Pointer to the ID3PD object used. More... | |
Object filler tool for a collection of objects, saved as vectors.
This is an object filler tool for a collection of objects. The object variables are saved as vectors. I.e., if a block books a variable of type ‘int’, the variable we actually create is of type ‘vector<int>’. An additional variable giving the object count is added automatically (can be controlled via the NrowName
property).
This tool has the following properties:
Getter - ICollectionGetterTool instance. AllowMissing - If true, then it is not considered an error for the requested input object to be missing.
and the following inherited from VectorFillerToolBase:
BlockFillers - List of IBlockFillerTool instances. Prefix - Prefix to add to variable names for this block. NrowName - Name of the variable for the count of rows. Omitted if empty. Default: ‘n’. NobjName - Name of the variable for the count of objects. (May be less than the number of rows if AGAIN is used.) Omitted if empty (default). ObjIndexName - Name of the variable for the object index. Omitted if empty (default).
For each event, we call the getter to retrieve the collection. We then loop over the objects in the collection. For each object, we set the variable pointers to point to the proper locations within the vectors. Then we loop over all block filler tools, passing the object to each.
Definition at line 68 of file VectorFillerTool.h.
D3PD::VectorFillerTool::VectorFillerTool | ( | 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 30 of file VectorFillerTool.cxx.
|
virtual |
Declare tuple variables.
This is called at the start of the first event.
Definition at line 94 of file VectorFillerTool.cxx.
|
virtual |
Configure the tool.
tree | The parent D3PD tree. |
This is called during initialization.
Definition at line 78 of file VectorFillerTool.cxx.
|
virtual |
Fill one object.
This is called once per event. It should:
Definition at line 119 of file VectorFillerTool.cxx.
|
virtual |
Handle end of run incidents to save the metadata at that point.
The metadata saving is now done when seeing an end of run incident.
This is needed because of MC11b...
Basically, we can't do this in finalize(), because the output TTree is no longer accessible by then. So it has to be done just before the event loop is finished.
Definition at line 150 of file VectorFillerTool.cxx.
|
virtual |
|
virtual |
Find out if the filler handles containers or single objects.
This is used by the D3PDReader code generator to know how to create the generated source files exactly.
Definition at line 136 of file VectorFillerTool.cxx.
|
private |
Property: If true, the input object is allowed to be missing.
Definition at line 141 of file VectorFillerTool.h.
|
private |
Property: The collection getter tool.
Definition at line 135 of file VectorFillerTool.h.
|
private |
Property: the name of the D3PDObject that created this tool.
Definition at line 138 of file VectorFillerTool.h.
|
private |
Property: If true, the metadata about the variables is saved.
Definition at line 144 of file VectorFillerTool.h.
|
private |
Pointer to the ID3PD object used.
Definition at line 147 of file VectorFillerTool.h.