ATLAS Offline Software
|
Common code for wrapping filled variables up into a vector. More...
#include <VectorFillerToolBase.h>
Classes | |
class | Var |
Description for a single variable. More... | |
struct | Vars |
Description for the list of variables. More... | |
Public Member Functions | |
VectorFillerToolBase (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 | finalize () |
Standard Gaudi finalize method. 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... | |
ServiceHandle< StoreGateSvc > & | evtStore () |
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More... | |
const ServiceHandle< StoreGateSvc > & | evtStore () const |
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More... | |
const ServiceHandle< StoreGateSvc > & | detStore () const |
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More... | |
virtual StatusCode | sysInitialize () override |
Perform system initialization for an algorithm. More... | |
virtual StatusCode | sysStart () override |
Handle START transition. More... | |
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
Return this algorithm's input handles. More... | |
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
Return this algorithm's output handles. More... | |
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
Declare a new Gaudi property. More... | |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
Declare a new Gaudi property. More... | |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
Declare a new Gaudi property. More... | |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
Declare a new Gaudi property. More... | |
void | updateVHKA (Gaudi::Details::PropertyBase &) |
MsgStream & | msg () const |
MsgStream & | msg (const MSG::Level lvl) const |
bool | msgLvl (const MSG::Level lvl) const |
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 Member Functions | |
StatusCode | doConfigure (IAddVariable *tree, IIteration &it) |
Configure the tool. More... | |
StatusCode | doBook () |
Declare tuple variables. More... | |
StatusCode | doFill (IIteration &it, size_t sizeHint) |
Fill objects from an IIteration . More... | |
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
remove all handles from I/O resolution More... | |
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > | renounce (T &h) |
void | extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps) |
Add StoreName to extra input/output deps as needed. More... | |
Protected Attributes | |
ObjectMetadata | m_metadata |
Metadata about the variables created by this tool. More... | |
std::string | m_prefix |
Property: Variable prefix for this block. More... | |
Private Types | |
typedef ServiceHandle< StoreGateSvc > | StoreGateSvc_t |
Private Member Functions | |
void | maybeExtend (size_t &n, size_t &sz) |
Extend vectors if needed. More... | |
StatusCode | fillOnce (const void *obj, size_t objndx, size_t &n, size_t &sz, const std::vector< unsigned long > &codes_in, std::vector< unsigned long > &codes_out) |
Make one loop over block filler tools. More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
specialization for handling Gaudi::Property<SG::VarHandleKey> More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
specialization for handling Gaudi::Property<SG::VarHandleBase> More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More... | |
Private Attributes | |
ToolHandleArray< IBlockFillerTool > | m_blockFillers |
Property: The list of block filler tools. More... | |
std::string | m_nrowName |
Property: Name of the variable for the count of rows. More... | |
std::string | m_nobjName |
Property: Name of the variable for the count of objects. More... | |
std::string | m_objIndexName |
Property: Name of the variable for the object index. More... | |
IAddVariable * | m_tree |
The parent tree. More... | |
int * | m_nrow |
Variable for the row count. More... | |
int * | m_nobj |
Variable for the object count. More... | |
int * | m_objIndex |
Variable for the object index. More... | |
Vars | m_vars |
All booked variables. More... | |
StoreGateSvc_t | m_evtStore |
Pointer to StoreGate (event store by default) More... | |
StoreGateSvc_t | m_detStore |
Pointer to StoreGate (detector store by default) More... | |
std::vector< SG::VarHandleKeyArray * > | m_vhka |
bool | m_varHandleArraysDeclared |
Common code for wrapping filled variables up into a vector.
In several places we want to be able to run a set of block filler tools over a set of objects and wrap the results up in vectors. This is used at least in VectorFillerTool
and ContainedVectorMultiAssociationFillerTool
. This class factors out the common behavior involved in wrapping results up in vectors.
The actual iteration over a set of objects is expressed by the interface IIteration
. The way this class is used is as follows:
doConfigure
from your configureD3PD
method. Pass in the IIteration
instance.doBook
from your book
method.To do a fill, first do whatever's needed to prepare the IIteration
instance to iterate over the desired object set. Then pass it to doFill
.
doFill
will iterate over the objects in the IIteration
; for each of these, it will loop over the block filler tools.
The results will be collected inside of vectors.
This tool has the following properties:
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).
Definition at line 77 of file VectorFillerToolBase.h.
|
privateinherited |
Definition at line 388 of file AthCommonDataStore.h.
D3PD::VectorFillerToolBase::VectorFillerToolBase | ( | 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 56 of file VectorFillerToolBase.cxx.
|
virtual |
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 383 of file VectorFillerToolBase.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
.
|
virtual |
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
.
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 306 of file VectorFillerToolBase.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
.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>
Definition at line 199 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
|
inlineinherited |
Definition at line 259 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
|
inlineinherited |
Definition at line 145 of file AthCommonDataStore.h.
|
inlineinherited |
The standard StoreGateSvc/DetectorStore
Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 95 of file AthCommonDataStore.h.
|
protected |
Declare tuple variables.
This is called at the start of the first event.
Definition at line 112 of file VectorFillerToolBase.cxx.
|
protected |
Configure the tool.
tree | The parent D3PD tree. |
it | The iteration object we'll use. (Used to get the elt type.) |
This is called during initialization.
Definition at line 147 of file VectorFillerToolBase.cxx.
|
protected |
Fill objects from an IIteration
.
it | Iteration object. Must have already been reset. |
sizeHint | Hint for the expected size of the iteration. |
This will loop over the objects in the iteration; for each object, it will loop over the contained block filler tools.
it | Iteration object. Must have already been reset. |
This will loop over the objects in the iteration; for each object, it will loop over the contained block filler tools.
Definition at line 244 of file VectorFillerToolBase.cxx.
|
inlineinherited |
The standard StoreGateSvc
(event store) Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 85 of file AthCommonDataStore.h.
|
inlineinherited |
The standard StoreGateSvc
(event store) Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 90 of file AthCommonDataStore.h.
|
protectedinherited |
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
|
private |
Make one loop over block filler tools.
obj | Object being processed. |
objndx | The index of the object we're currently processing. |
n | Number of entries currently made in the vectors. |
sz | Current size of the vectors. |
codes_in | Vector of status returns for each tool from the first fill call. |
codes_out[out] | Vector of status returns for each tool from this fill call. |
This function may be called more than once for an object if AGAIN
was requested.
We loop over all block filler tools. For each, we call fillUntyped
with the again
parameter set depending on whether codes_in
for this tool is AGAIN
. We collect the return codes from each tool in codes_out
.
Definition at line 196 of file VectorFillerToolBase.cxx.
|
virtual |
Standard Gaudi finalize
method.
Definition at line 99 of file VectorFillerToolBase.cxx.
|
virtual |
|
overridevirtualinherited |
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
|
private |
|
inlineinherited |
Definition at line 24 of file AthCommonMsg.h.
|
inlineinherited |
Definition at line 27 of file AthCommonMsg.h.
|
inlineinherited |
Definition at line 30 of file AthCommonMsg.h.
|
overridevirtualinherited |
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
|
inlineprotectedinherited |
Definition at line 380 of file AthCommonDataStore.h.
|
inlineprotectedinherited |
remove all handles from I/O resolution
Definition at line 364 of file AthCommonDataStore.h.
|
overridevirtualinherited |
Perform system initialization for an algorithm.
We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.
Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.
|
overridevirtualinherited |
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
|
inlineinherited |
Definition at line 308 of file AthCommonDataStore.h.
|
private |
Property: The list of block filler tools.
Definition at line 189 of file VectorFillerToolBase.h.
|
privateinherited |
Pointer to StoreGate (detector store by default)
Definition at line 393 of file AthCommonDataStore.h.
|
privateinherited |
Pointer to StoreGate (event store by default)
Definition at line 390 of file AthCommonDataStore.h.
|
protected |
Metadata about the variables created by this tool.
Definition at line 180 of file VectorFillerToolBase.h.
|
private |
Variable for the object count.
Definition at line 210 of file VectorFillerToolBase.h.
|
private |
Property: Name of the variable for the count of objects.
Omitted if empty.
Definition at line 197 of file VectorFillerToolBase.h.
|
private |
Variable for the row count.
Definition at line 207 of file VectorFillerToolBase.h.
|
private |
Property: Name of the variable for the count of rows.
Omitted if empty.
Definition at line 193 of file VectorFillerToolBase.h.
|
private |
Variable for the object index.
Definition at line 213 of file VectorFillerToolBase.h.
|
private |
Property: Name of the variable for the object index.
Omitted if empty.
Definition at line 201 of file VectorFillerToolBase.h.
|
protected |
Property: Variable prefix for this block.
Definition at line 184 of file VectorFillerToolBase.h.
|
private |
The parent tree.
Definition at line 204 of file VectorFillerToolBase.h.
|
privateinherited |
Definition at line 399 of file AthCommonDataStore.h.
|
private |
All booked variables.
Definition at line 346 of file VectorFillerToolBase.h.
|
privateinherited |
Definition at line 398 of file AthCommonDataStore.h.