|
ATLAS Offline Software
|
Object filler tool for a single object.
More...
#include <ObjFillerTool.h>
|
| ObjFillerTool (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...
|
|
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...
|
|
Object filler tool for a single object.
This is an object filler tool for a single object. It has the following properties:
Getter - IObjGetterTool instance. BlockFillers - List of IBlockFillerTool instances. Prefix - Prefix to add to variable names for this block.
For each event, we call the getter to retrieve the object. Then we loop over all block filler tools, passing the object to each.
Definition at line 49 of file ObjFillerTool.h.
◆ ObjFillerTool()
D3PD::ObjFillerTool::ObjFillerTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Standard Gaudi tool constructor.
- Parameters
-
type | The name of the tool type. |
name | The tool name. |
parent | The tool's Gaudi parent. |
Definition at line 30 of file ObjFillerTool.cxx.
40 "The IObjGetterTool instance.");
42 "List of contained block filler tools.");
43 declareProperty (
"Prefix",
m_prefix =
"",
44 "Variable name prefix for the contained blocks.");
46 "The name of this block.");
48 "Name of the D3PDObject that created this filler.");
50 "If true, then it is not considered an error for the "
51 "requested input object to be missing.");
53 "Set to true to get metadata into the output D3PD "
54 "about the variables created by this tool");
◆ 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 |
|
) |
| |
|
virtualinherited |
Add a variable to the tuple.
- Parameters
-
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.
133 return StatusCode::SUCCESS;
138 docstring, defval ) );
◆ addDimensionedVariable() [2/6]
virtual StatusCode D3PD::IAddVariable::addDimensionedVariable |
|
inherited |
Add a variable to the tuple.
- Parameters
-
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
.
◆ addDimensionedVariable() [3/6]
template<class T , class U >
StatusCode D3PD::IAddVariable::addDimensionedVariable |
( |
class T |
, |
|
|
class U |
|
|
) |
| |
|
inherited |
Add a variable to the tuple.
- Parameters
-
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
.
◆ 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
-
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
.
◆ addDimensionedVariable() [5/6]
template<class T >
StatusCode D3PD::IAddVariable::addDimensionedVariable |
( |
class T |
| ) |
|
|
inherited |
Add a variable to the tuple.
- Parameters
-
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
.
◆ 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
-
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
.
◆ 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 |
|
) |
| |
|
virtualinherited |
Add a variable to the tuple.
- Parameters
-
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.
94 return StatusCode::SUCCESS;
98 ti,
ptr, docstring, defval ) );
100 ti,
ptr, docstring, defval);
◆ addVariable() [2/6]
virtual StatusCode D3PD::IAddVariable::addVariable |
|
inherited |
◆ addVariable() [3/6]
template<class T , class U >
StatusCode D3PD::IAddVariable::addVariable |
( |
class T |
, |
|
|
class U |
|
|
) |
| |
|
inherited |
◆ 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
-
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
.
◆ addVariable() [5/6]
template<class T >
StatusCode D3PD::IAddVariable::addVariable |
( |
class T |
| ) |
|
|
inherited |
◆ 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
-
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
.
◆ book()
StatusCode D3PD::ObjFillerTool::book |
( |
| ) |
|
|
virtual |
Declare tuple variables.
This is called at the start of the first event.
Definition at line 105 of file ObjFillerTool.cxx.
118 return StatusCode::SUCCESS;
◆ configureD3PD()
StatusCode D3PD::ObjFillerTool::configureD3PD |
( |
IAddVariable * |
tree | ) |
|
|
virtual |
Configure the tool.
- Parameters
-
tree | The parent D3PD tree. |
This is called during initialization.
Definition at line 84 of file ObjFillerTool.cxx.
87 const std::type_info& ti =
m_getter->typeinfo();
96 return StatusCode::SUCCESS;
◆ fill()
StatusCode D3PD::ObjFillerTool::fill |
( |
| ) |
|
|
virtual |
Fill one object.
This is called once per event. It should:
- Fetch the input.
- If it's a container, loop over the contents.
- Loop over the contained block filler tools.
Definition at line 131 of file ObjFillerTool.cxx.
136 return StatusCode::SUCCESS;
138 return StatusCode::FAILURE;
146 return StatusCode::SUCCESS;
◆ handle()
void D3PD::ObjFillerTool::handle |
( |
const Incident & |
inc | ) |
|
|
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 170 of file ObjFillerTool.cxx.
172 if( inc.type() ==
"EndEvtLoop" ) {
180 <<
"Couldn't add object metadata information to the output!";
◆ initialize()
StatusCode D3PD::ObjFillerTool::initialize |
( |
| ) |
|
|
virtual |
Standard Gaudi initialize
method.
Definition at line 62 of file ObjFillerTool.cxx.
70 CHECK( p_incSvc.retrieve() );
71 p_incSvc->addListener(
this,
"EndEvtLoop" );
73 return StatusCode::SUCCESS;
◆ isContainerFiller()
bool D3PD::ObjFillerTool::isContainerFiller |
( |
| ) |
const |
|
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 156 of file ObjFillerTool.cxx.
◆ m_allowMissing
bool D3PD::ObjFillerTool::m_allowMissing |
|
private |
◆ m_blockFillers
◆ m_blockName
std::string D3PD::ObjFillerTool::m_blockName |
|
private |
◆ m_getter
◆ m_metadata
Metadata about the variables created by this object.
Definition at line 129 of file AddVariable.h.
◆ m_objectName
std::string D3PD::ObjFillerTool::m_objectName |
|
private |
◆ m_prefix
std::string D3PD::ObjFillerTool::m_prefix |
|
private |
◆ m_saveMetadata
bool D3PD::ObjFillerTool::m_saveMetadata |
|
private |
◆ m_suffix
const std::string& D3PD::AddVariable::m_suffix |
|
privateinherited |
◆ m_tree
ID3PD* D3PD::ObjFillerTool::m_tree |
|
private |
◆ s_emptyString
const std::string D3PD::AddVariable::s_emptyString |
|
staticprivateinherited |
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:
virtual StatusCode addMetadata(const std::string &key, const void *obj, const std::type_info &ti)=0
Add a new piece of metadata to the tuple.
StatusCode configureD3PD(IAddVariable *tree)
Configure the parent tree.
AddVariable(const std::string &prefix, const std::string &blockName=s_emptyString)
Constructor.
const std::string & m_suffix
Reference to the variable suffix.
const std::string & m_prefix
Reference to the variable prefix.
IAddVariable * m_tree
Reference to the block name.
ObjectMetadata m_metadata
Metadata about the variables created by this object.
#define CHECK(...)
Evaluate an expression and check for errors.
#define REPORT_MESSAGE(LVL)
Report a message.
StatusCode addVariable(const std::string &name, T *&ptr, const std::string &docstring="")
Add a variable to the tuple.
StatusCode addDimensionedVariable(const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring="")
Add a variable to the tuple.
#define ATLAS_THREAD_SAFE