ATLAS Offline Software
|
Helper for holding non-const raw data prior to recording in SG. More...
#include <TileMutableDataContainer.h>
Public Types | |
typedef BASE_T | BASE |
typedef BASE::TYPE | TYPE |
typedef BASE::UNIT | UNIT |
typedef BASE::IDENTIFIABLE | Collection |
typedef BASE::TElement | Element |
Public Member Functions | |
TileMutableDataContainer (bool createColl=false, TYPE type=TileFragHash::Default, UNIT unit=TileRawChannelUnit::ADCcounts, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS) | |
Constructor. More... | |
TileMutableDataContainer (const BASE &other) | |
Copy constructor. More... | |
TileMutableDataContainer (const TileMutableDataContainer &)=delete | |
TileMutableDataContainer & | operator= (const TileMutableDataContainer &)=delete |
StatusCode | addCollection (std::unique_ptr< Collection > coll, IdentifierHash hash) |
Add a collection to the container. More... | |
StatusCode | push_back (std::unique_ptr< Element > rch) |
Add a new channel. More... | |
StatusCode | push_back (Element *rch) |
Add a new channel. More... | |
Collection * | indexFindPtr (IdentifierHash hash) |
Look up a (non-const) collection via hash. More... | |
StatusCode | status () const |
Return the error status from the constructors. More... | |
virtual void | lock () override |
Lock this object. More... | |
Protected Member Functions | |
void | recycle () |
Recycle this object for use in another event. More... | |
Private Attributes | |
std::vector< Collection * > | m_mutableCollections |
Non-const references to collections, indexed by hash value. More... | |
bool | m_locked |
Is the container locked? More... | |
StatusCode | m_sc |
StatusCode from constructors. More... | |
TYPE | m_defaultType |
Default type; reset to this on recycle. More... | |
UNIT | m_defaultUnit |
Default unit; reset to this on recycle. More... | |
Helper for holding non-const raw data prior to recording in SG.
Sometimes one wants to construct a tile raw data container and then, before it is recorded in SG, modify the contents. This is problematic as the container classes only support const access to the contents.
This helper derives from a specific tile raw data container and also maintains non-const pointers to the collections, which we can return. However, once the object has been made const in SG, we set a flag so that non-const access is no longer possible.
After constructing one of these objects, one should call status() to check for errors.
This class does not have its own CLID. Record in SG via a handle of type matching the base tile raw data container.
Definition at line 50 of file TileMutableDataContainer.h.
typedef BASE_T TileMutableDataContainer< BASE_T >::BASE |
Definition at line 54 of file TileMutableDataContainer.h.
typedef BASE::IDENTIFIABLE TileMutableDataContainer< BASE_T >::Collection |
Definition at line 57 of file TileMutableDataContainer.h.
typedef BASE::TElement TileMutableDataContainer< BASE_T >::Element |
Definition at line 58 of file TileMutableDataContainer.h.
typedef BASE::TYPE TileMutableDataContainer< BASE_T >::TYPE |
Definition at line 55 of file TileMutableDataContainer.h.
typedef BASE::UNIT TileMutableDataContainer< BASE_T >::UNIT |
Definition at line 56 of file TileMutableDataContainer.h.
TileMutableDataContainer< BASE_T >::TileMutableDataContainer | ( | bool | createColl = false , |
TYPE | type = TileFragHash::Default , |
||
UNIT | unit = TileRawChannelUnit::ADCcounts , |
||
SG::OwnershipPolicy | ownPolicy = SG::OWN_ELEMENTS |
||
) |
Constructor.
createColl | If true, create all collections now. |
type | Hash type (from TileFragHash::TYPE). |
unit | Measurement units for amplitude data. |
ownPolicy | Ownership mode for collections. |
Call status() after this to check for errors.
TileMutableDataContainer< BASE_T >::TileMutableDataContainer | ( | const BASE & | other | ) |
Copy constructor.
other | Container to copy. |
This is a deep copy; all contained collections and channels will be copied. Call status() after this to check for errors.
|
delete |
StatusCode TileMutableDataContainer< BASE_T >::addCollection | ( | std::unique_ptr< Collection > | coll, |
IdentifierHash | hash | ||
) |
Add a collection to the container.
coll | Collection ot add. |
hash | Hash value for the collection. |
We maintain a non-const reference to the collection.
Collection* TileMutableDataContainer< BASE_T >::indexFindPtr | ( | IdentifierHash | hash | ) |
Look up a (non-const) collection via hash.
hash | Hash value to find. |
|
overridevirtual |
|
delete |
StatusCode TileMutableDataContainer< BASE_T >::push_back | ( | Element * | rch | ) |
Add a new channel.
rch | Channel to add. |
This should be used for non-owning container (created with SG::VIEW_ELEMENTS). A new collection will be created if needed. In that case, we maintain a non-const reference to it.
StatusCode TileMutableDataContainer< BASE_T >::push_back | ( | std::unique_ptr< Element > | rch | ) |
Add a new channel.
rch | Channel to add. |
This should be used for owning container (created with SG::OWN_ELEMENTS). A new collection will be created if needed. In that case, we maintain a non-const reference to it.
|
protected |
Recycle this object for use in another event.
This is called from AthenaKernel/RecyclableDataObject when this object is released by StoreGate. Unlock the object so that non-const access is again possible, and clear out the contents if the collections.
StatusCode TileMutableDataContainer< BASE_T >::status | ( | ) | const |
Return the error status from the constructors.
|
private |
Default type; reset to this on recycle.
Definition at line 175 of file TileMutableDataContainer.h.
|
private |
Default unit; reset to this on recycle.
Definition at line 178 of file TileMutableDataContainer.h.
|
private |
Is the container locked?
Definition at line 169 of file TileMutableDataContainer.h.
|
private |
Non-const references to collections, indexed by hash value.
Definition at line 166 of file TileMutableDataContainer.h.
|
private |
StatusCode from constructors.
Definition at line 172 of file TileMutableDataContainer.h.