|
ATLAS Offline Software
|
#include <Holder.h>
|
| IHolder () |
|
| IHolder (const std::string &prefix, const std::string &label, uint16_t idx) |
|
virtual | ~IHolder () |
|
virtual IHolder * | clone (const std::string &prefix, const std::string &label, uint16_t idx) const =0 |
|
virtual void | prepare (const asg::AsgMessaging &logger, HLT::AccessProxy *sg, IConversionSvc *objSerializer, bool readonly) |
| prepares this holder by setting messaging, StoreGate access and providing serializer More...
|
|
virtual bool | syncWithSG (SG::OwnershipPolicy policy=SG::OWN_ELEMENTS)=0 |
|
virtual CLID | typeClid () const =0 |
| returns the CLID of objects stores by this holder More...
|
|
virtual CLID | containerClid () const =0 |
|
virtual CLID | auxClidOrZero () const =0 |
|
const std::string & | label () const |
| returns the label of objects stores by this holder More...
|
|
virtual const std::string & | prefix () const |
| returns the containers StoreGate prefix More...
|
|
virtual const std::string & | key () const =0 |
| returns the containers StoreGate key More...
|
|
virtual const std::string & | typeName () const =0 |
| returns the object's name stored by this holder More...
|
|
virtual const std::string & | collectionName () const =0 |
| returns the collection's name stored by this holder More...
|
|
uint16_t | subTypeIndex () const |
| returns the index (short number used when linking object to the TE) of objects stores by this holder More...
|
|
std::string | generateAliasKey (CLID c, uint16_t sti, const std::string &label, unsigned size) |
|
virtual bool | serialize (std::vector< uint32_t > &output) const |
| serializes this Holder More...
|
|
bool | serializeWithPayload (const xAOD::AuxSelection &sel, std::vector< uint32_t > &output, size_t &payloadsize) |
| serializes this Holder including payload More...
|
|
bool | serializePayload (std::vector< uint32_t > &dataBlob, const xAOD::AuxSelection &sel) |
| serializes the payload of this Holder More...
|
|
virtual void | print (MsgStream &m) const |
|
bool | deserializePayload (const std::vector< uint32_t > &dataBlob, int version) |
| deserialization of holder payload More...
|
|
virtual DataObject * | getDataObject ()=0 |
|
virtual DataObject * | getAuxDataObject ()=0 |
|
virtual bool | setDataObject (DataObject *dobj)=0 |
|
virtual bool | setAuxDataObject (DataObject *dobjaux)=0 |
|
virtual const ITypeProxy & | containerTypeProxy () const =0 |
| Get the proxy for the container. More...
|
|
virtual bool | checkAndSetOwnership (SG::OwnershipPolicy policy)=0 |
|
virtual std::string | getUniqueKey ()=0 |
|
virtual std::string | getNextKey ()=0 |
|
Definition at line 58 of file Holder.h.
◆ IHolder() [1/2]
◆ IHolder() [2/2]
IHolder::IHolder |
( |
const std::string & |
prefix, |
|
|
const std::string & |
label, |
|
|
uint16_t |
idx |
|
) |
| |
◆ ~IHolder()
◆ auxClidOrZero()
virtual CLID HLTNavDetails::IHolder::auxClidOrZero |
( |
| ) |
const |
|
pure virtual |
◆ checkAndSetOwnership()
◆ clone()
virtual IHolder* HLTNavDetails::IHolder::clone |
( |
const std::string & |
prefix, |
|
|
const std::string & |
label, |
|
|
uint16_t |
idx |
|
) |
| const |
|
pure virtual |
◆ collectionName()
virtual const std::string& HLTNavDetails::IHolder::collectionName |
( |
| ) |
const |
|
pure virtual |
returns the collection's name stored by this holder
◆ containerClid()
virtual CLID HLTNavDetails::IHolder::containerClid |
( |
| ) |
const |
|
pure virtual |
◆ containerTypeProxy()
virtual const ITypeProxy& HLTNavDetails::IHolder::containerTypeProxy |
( |
| ) |
const |
|
pure virtual |
Get the proxy for the container.
◆ deserializeDynVars() [1/2]
std::unique_ptr< SG::IAuxStore > IHolder::deserializeDynVars |
( |
const std::vector< uint32_t > & |
dataBlob, |
|
|
size_t |
offs |
|
) |
| |
|
private |
Read dynamic auxiliary variables from a serialized buffer.
- Parameters
-
dataBlob | Serialized data. |
offs | Offset in dataBlob where dynamic variables start. |
sz | Number of elements in the xAOD container. |
dataBlob
should be formatted as described in the documentation for serializeDynVars
starting at offs
. Returns a new dynamic store.
Definition at line 452 of file Holder.cxx.
459 auto store = std::make_unique<HLTNavDetails::TrigAuxStore>();
462 std::vector<uint32_t>::const_iterator
it = dataBlob.begin() + offs;
463 while (
it < dataBlob.end()) {
465 size_t name_size = *
it++;
470 size_t tname_size = *
it++;
472 ss.deserialize (
it,
it+tname_size, tname);
476 size_t var_size = *
it++;
478 const static char*
const packed_pref =
"SG::PackedContainer<";
479 const static unsigned int packed_preflen = strlen(packed_pref);
480 std::string vecname = tname;
481 if (strncmp (vecname.c_str(), packed_pref, packed_preflen) == 0) {
485 auto makeRules = []() {
487 rules.
add (
"SG::PackedContainer<$T, std::allocator<$T> >",
489 rules.
add (
"SG::PackedContainer<$T, allocator<$T> >",
491 rules.
add (
"SG::PackedContainer<$T, $ALLOC>",
492 "vector<$T, $ALLOC>");
496 vecname = rules.
apply (vecname);
502 if (
id != SG::null_auxid && stripStdVec(
r.getVecTypeName(
id)) != stripStdVec(vecname)) {
503 vecname =
r.getVecTypeName (
id);
509 if (
id == SG::null_auxid)
511 std::string elementTypeName;
512 const std::type_info* elt_tinfo =
getElementType (vecname, elementTypeName);
515 if (
id == SG::null_auxid) {
517 return std::unique_ptr<SG::IAuxStore> (std::move(
store));
522 std::vector<uint32_t>
buf (
it,
it+var_size);
526 bool isPacked = (strncmp (tname.c_str(), packed_pref, packed_preflen) == 0);
527 std::unique_ptr<SG::IAuxTypeVector>
vec
528 (
r.makeVectorFromData (
id,
obj,
nullptr, isPacked,
true));
529 store->addVector (std::move(
vec),
false);
532 return std::unique_ptr<SG::IAuxStore> (std::move(
store));
◆ deserializeDynVars() [2/2]
bool IHolder::deserializeDynVars |
( |
const std::vector< uint32_t > & |
dataBlob, |
|
|
size_t |
offs, |
|
|
SG::IAuxStore & |
store |
|
) |
| |
|
private |
Read dynamic auxiliary variables from a serialized buffer.
- Parameters
-
| dataBlob | Serialized data. |
| offs | Offset in dataBlob where dynamic variables start. |
[out] | store | Auxiliary store for the object being read. |
dataBlob
should be formatted as described in the documentation for serializeDynVars
starting at offs
. store
should be convertable to IAuxStoreHolder
. A new dynamic store will be created and registered with store
via setStore
.
Returns true on success, false on failure.
Definition at line 405 of file Holder.cxx.
411 ATH_MSG_ERROR(
"deserialize aux dyn vars failed: can't convert to IAuxStoreHolder.");
416 if (!newstore)
return false;
417 holder->
setStore (newstore.release());
◆ deserializePayload()
bool HLTNavDetails::IHolder::deserializePayload |
( |
const std::vector< uint32_t > & |
dataBlob, |
|
|
int |
version |
|
) |
| |
deserialization of holder payload
Definition at line 148 of file Holder.cxx.
155 ATH_MSG_VERBOSE(
"deserialize: while working on: " << container_typename <<
" and key: " <<
sgkey
156 <<
" from serialized form found it in SG already, sync with it");
160 ATH_MSG_VERBOSE(
"deserializing a data blob of size " << dataBlob.size() <<
" navi version is " <<
version);
161 ATH_MSG_DEBUG(
"holder type clid " << feature_clid<<
" collection clid: " << container_clid);
163 if (container_clid<1){
164 ATH_MSG_WARNING(
"holder type clid " << feature_clid <<
" collection clid: " << container_clid);
167 typedef std::vector<uint32_t>::const_iterator it_type;
170 if(!dataBlob.size())
return false;
175 auto firstsize = *(
it++);
178 first = std::vector<uint32_t>(
it,
it+firstsize);
180 std::advance(
it,firstsize);
182 if(!(
it!=dataBlob.end())){
183 ATH_MSG_VERBOSE(
"this datablob only has a first part (non xAOD case)");
186 auto secondsize = *(
it++);
188 second = std::vector<uint32_t>(
it,
it+secondsize);
189 std::advance(
it,secondsize);
193 first = std::vector<uint32_t>(dataBlob.begin(),dataBlob.end());
210 if(!setcontainer)
return false;
212 DataObject* dobjaux(0);
214 std::string sgkeyaux =
sgkey+
"Aux.";
225 if (
it != dataBlob.end()) {
230 dobjBaseAux->template cast<xAOD::AuxContainerBase> (
nullptr,
false))
236 it - dataBlob.begin(),
249 if(!setaux)
return false;
◆ enquireSerialized()
bool BaseHolder::enquireSerialized |
( |
std::vector< uint32_t >::const_iterator & |
fromHere, |
|
|
const std::vector< uint32_t >::const_iterator & |
end, |
|
|
class_id_type & |
c, |
|
|
std::string & |
label, |
|
|
sub_index_type & |
subtypeIndex |
|
) |
| |
|
staticinherited |
Definition at line 12 of file BaseHolder.cxx.
17 if ( fromHere ==
end )
return false;
20 if ( fromHere ==
end )
return false;
22 subtypeIndex = *fromHere++;
23 if ( fromHere ==
end )
return false;
25 unsigned labelSize = *fromHere++;
26 if ( fromHere ==
end )
return false;
27 if ( fromHere+labelSize >
end )
return false;
29 std::vector<uint32_t>::const_iterator stringEnd = fromHere+labelSize;
33 std::advance(fromHere,labelSize);
◆ generateAliasKey()
std::string IHolder::generateAliasKey |
( |
CLID |
c, |
|
|
uint16_t |
sti, |
|
|
const std::string & |
label, |
|
|
unsigned |
size |
|
) |
| |
Definition at line 98 of file Holder.cxx.
99 std::ostringstream
ss;
101 std::string st =
ss.str();
102 ATH_MSG_DEBUG(
"IHolder::generateAliasKey generated key: " << st);
◆ getAuxDataObject()
virtual DataObject* HLTNavDetails::IHolder::getAuxDataObject |
( |
| ) |
|
|
pure virtual |
◆ getDataObject()
virtual DataObject* HLTNavDetails::IHolder::getDataObject |
( |
| ) |
|
|
pure virtual |
◆ getElementType()
const std::type_info * IHolder::getElementType |
( |
const std::string & |
tname, |
|
|
std::string & |
elementTypeName |
|
) |
| const |
|
private |
Find the type of an element of a vector.
- Parameters
-
tname | The name of the type to analyze. |
[out[ | elementTypeName The name of the type of an element of the vector. |
Returns the type_info
for an element of the vector.
- Parameters
-
| tname_in | The name of the type to analyze. |
[out] | elementTypeName | The name of the type of an element of the vector. |
Returns the type_info
for an element of the vector.
Definition at line 544 of file Holder.cxx.
547 TClass*
cls = TClass::GetClass (tname.c_str());
548 if (!
cls)
return nullptr;
549 TVirtualCollectionProxy* prox =
cls->GetCollectionProxy();
550 if (!prox)
return nullptr;
551 if (prox->GetValueClass()) {
552 elementTypeName = prox->GetValueClass()->GetName();
553 return prox->GetValueClass()->GetTypeInfo();
556 elementTypeName = typ.getTypeName();
557 return typ.getTypeInfo();
◆ getNextKey()
virtual std::string HLTNavDetails::IHolder::getNextKey |
( |
| ) |
|
|
pure virtual |
◆ getUniqueKey()
virtual std::string HLTNavDetails::IHolder::getUniqueKey |
( |
| ) |
|
|
pure virtual |
◆ key()
virtual const std::string& HLTNavDetails::IHolder::key |
( |
| ) |
const |
|
pure virtual |
returns the containers StoreGate key
◆ label()
const std::string& HLTNavDetails::IHolder::label |
( |
| ) |
const |
|
inlinevirtual |
◆ msg() [1/2]
MsgStream& HLTNavDetails::IHolder::msg |
( |
| ) |
const |
|
inlineprotected |
◆ msg() [2/2]
MsgStream& HLTNavDetails::IHolder::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineprotected |
◆ msgLvl()
bool HLTNavDetails::IHolder::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineprotected |
Definition at line 171 of file Holder.h.
171 {
return msg().level() <= lvl; }
◆ prefix()
virtual const std::string& HLTNavDetails::IHolder::prefix |
( |
| ) |
const |
|
inlinevirtual |
returns the containers StoreGate prefix
Definition at line 90 of file Holder.h.
◆ prepare()
prepares this holder by setting messaging, StoreGate access and providing serializer
Definition at line 55 of file Holder.cxx.
◆ print()
void IHolder::print |
( |
MsgStream & |
m | ) |
const |
|
virtual |
◆ serialize()
bool IHolder::serialize |
( |
std::vector< uint32_t > & |
output | ) |
const |
|
virtual |
serializes this Holder
Reimplemented from HLT::BaseHolder.
Definition at line 62 of file Holder.cxx.
71 std::vector<uint32_t> serializedLabel;
74 output.push_back( serializedLabel.size() );
75 output.insert(
output.end(), serializedLabel.begin(), serializedLabel.end());
◆ serializeDynVars()
Serialize all selected dynamic variables for an xAOD object.
- Parameters
-
| iio | The auxiliary store for the xAOD object. |
| sel | Selection object for variables to write. |
[out] | dataBlob | Serialized data. |
Returns true on success, false on failure.
Each selected dynamic variable is concatenated to dataBlob
as follows.
- Length serialized name data (1 word).
- Serialized name data.
- Length of serialized type name (1 word).
- Serialized type name data.
- Length of serialized variable data (1 word).
- Serialized data for the variable, as produced by TrigTSerializer.
Definition at line 345 of file Holder.cxx.
354 const std::type_info* tinfo = iio.
getIOType (
id);
356 ATH_MSG_ERROR(
"serialize aux dyn vars failed: can't get type_info.");
359 TClass*
cls = TClass::GetClass (*tinfo);
361 ATH_MSG_ERROR(
"serialize aux dyn vars failed: can't get TClass.");
366 std::vector<uint32_t> serialized =
372 std::vector<uint32_t> serializedName;
373 ss.serialize (
r.getName(
id), serializedName);
374 dataBlob.push_back (serializedName.size());
375 dataBlob.insert(dataBlob.end(), serializedName.begin(), serializedName.end());
377 std::vector<uint32_t> serializedType;
378 ss.serialize (
cls->GetName(), serializedType);
379 dataBlob.push_back (serializedType.size());
380 dataBlob.insert(dataBlob.end(), serializedType.begin(), serializedType.end());
383 dataBlob.push_back (serialized.size());
384 dataBlob.insert(dataBlob.end(), serialized.begin(), serialized.end());
◆ serializePayload()
bool HLTNavDetails::IHolder::serializePayload |
( |
std::vector< uint32_t > & |
dataBlob, |
|
|
const xAOD::AuxSelection & |
sel |
|
) |
| |
serializes the payload of this Holder
Definition at line 254 of file Holder.cxx.
267 ATH_MSG_VERBOSE(
"serialization of feature (object) successful, blob size: " << addr->get().size());
268 dataBlob.push_back(addr->get().size());
269 dataBlob.insert(dataBlob.end(), addr->get().begin(), addr->get().end());
292 ATH_MSG_VERBOSE(
"aux conversion success! aux blob has size: " << auxaddr->get().size());
293 dataBlob.push_back(auxaddr->get().size());
294 dataBlob.insert(dataBlob.end(), auxaddr->get().begin(), auxaddr->get().end());
304 dobjBaseAux->template cast<xAOD::AuxContainerBase> (
nullptr,
true))
317 ATH_MSG_ERROR(
"Serialization of dynamic aux variables failed.");
322 ATH_MSG_VERBOSE(
"finished serializing payload. size: " << dataBlob.size());
◆ serializeWithPayload()
bool IHolder::serializeWithPayload |
( |
const xAOD::AuxSelection & |
sel, |
|
|
std::vector< uint32_t > & |
output, |
|
|
size_t & |
payloadsize |
|
) |
| |
◆ setAuxDataObject()
virtual bool HLTNavDetails::IHolder::setAuxDataObject |
( |
DataObject * |
dobjaux | ) |
|
|
pure virtual |
◆ setDataObject()
virtual bool HLTNavDetails::IHolder::setDataObject |
( |
DataObject * |
dobj | ) |
|
|
pure virtual |
◆ subTypeIndex()
uint16_t HLTNavDetails::IHolder::subTypeIndex |
( |
| ) |
const |
|
inlinevirtual |
returns the index (short number used when linking object to the TE) of objects stores by this holder
Implements HLT::BaseHolder.
Definition at line 111 of file Holder.h.
◆ syncWithSG()
◆ typeClid()
virtual CLID HLTNavDetails::IHolder::typeClid |
( |
| ) |
const |
|
pure virtual |
returns the CLID of objects stores by this holder
Implements HLT::BaseHolder.
◆ typeName()
virtual const std::string& HLTNavDetails::IHolder::typeName |
( |
| ) |
const |
|
pure virtual |
returns the object's name stored by this holder
◆ m_aux
◆ m_label
std::string HLTNavDetails::IHolder::m_label |
|
private |
label given to the objects in this holder (labels given at attachFeature)
Definition at line 242 of file Holder.h.
◆ m_logger
◆ m_objectserializerSvc
IConversionSvc* HLTNavDetails::IHolder::m_objectserializerSvc {0} |
|
protected |
pointer to object serializer
Definition at line 162 of file Holder.h.
◆ m_prefix
std::string HLTNavDetails::IHolder::m_prefix |
|
private |
prefix for key given to the objects
Definition at line 241 of file Holder.h.
◆ m_readonly
bool HLTNavDetails::IHolder::m_readonly {false} |
|
protected |
◆ m_serializer
Serializer tool; used for dynamic variables.
Definition at line 247 of file Holder.h.
◆ m_storeGate
◆ m_subTypeIndex
uint16_t HLTNavDetails::IHolder::m_subTypeIndex {0} |
|
private |
index to notify how many objects of given type we have (we need to record it in case of slimming will be done latter)
Definition at line 243 of file Holder.h.
◆ m_uniqueCounter
int HLTNavDetails::IHolder::m_uniqueCounter {0} |
|
private |
The documentation for this class was generated from the following files:
virtual CLID containerClid() const =0
virtual bool serialize(std::vector< uint32_t > &output) const
serializes this Holder
virtual const std::string & label() const =0
bool deserializeDynVars(const std::vector< uint32_t > &dataBlob, size_t offs, SG::IAuxStore &store)
Read dynamic auxiliary variables from a serialized buffer.
void add(const ClassName &pattern, const ClassName &replacement)
Add a new transformation rule.
const std::string & label() const
returns the label of objects stores by this holder
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
virtual const std::string & typeName() const =0
returns the object's name stored by this holder
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Common base class for the auxiliary containers.
ToolHandle< ITrigSerializerToolBase > m_serializer
Serializer tool; used for dynamic variables.
std::string m_label
label given to the objects in this holder (labels given at attachFeature)
std::vector< size_t > vec
#define ATH_MSG_VERBOSE(x)
virtual const std::type_info * getIOType(SG::auxid_t auxid) const =0
Return the type of the data to be stored for one aux data item.
HLT::AccessProxy * m_storeGate
pointer to SG
Interface providing I/O for a generic auxiliary store.
virtual bool syncWithSG(SG::OwnershipPolicy policy=SG::OWN_ELEMENTS)=0
Handle mappings between names and auxid_t.
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
size_t auxid_t
Identifier for a particular aux data item.
std::string m_prefix
prefix for key given to the objects
SG::auxid_t getDynamicAuxID(const std::type_info &ti, const std::string &name, const std::string &elementTypeName, const std::string &branch_type_name, bool standalone, SG::auxid_t linked_auxid)
Find the auxid for a dynamic branch.
IConversionSvc * m_objectserializerSvc
pointer to object serializer
virtual bool setAuxDataObject(DataObject *dobjaux)=0
virtual DataObject * getAuxDataObject()=0
MsgStream & msg() const
The standard message stream.
std::string apply(const std::string &name) const
Apply transformations to a class name.
A set of transformation rules to use with ClassName.
virtual const SG::auxid_set_t & getDynamicAuxIDs() const =0
Get the list of all dynamically created variables.
const asg::AsgMessaging * m_logger
bool transientContains(const TKEY &key) const
Look up a transient data object in TDS only (no Proxy lookup) returns false if object not available i...
virtual void setStore(IAuxStore *store)=0
Give an auxiliary store object to the holder object.
virtual bool setDataObject(DataObject *dobj)=0
virtual DataObject * getDataObject()=0
std::size_t deserialize(std::vector< uint32_t >::const_iterator first, std::vector< uint32_t >::const_iterator last, std::vector< std::string > &strings)
virtual const void * getIOData(SG::auxid_t auxid) const =0
Return a pointer to the data to be stored for one aux data item.
bool serializePayload(std::vector< uint32_t > &dataBlob, const xAOD::AuxSelection &sel)
serializes the payload of this Holder
virtual const std::string & collectionName() const =0
returns the collection's name stored by this holder
Interface for non-const operations on an auxiliary store.
virtual CLID typeClid() const =0
returns the CLID of objects stores by this holder
#define ATH_MSG_WARNING(x)
uint16_t subTypeIndex() const
returns the index (short number used when linking object to the TE) of objects stores by this holder
virtual CLID auxClidOrZero() const =0
IOpaqueAddress for TrigSerializenCnvSvc.
virtual void relinquish()=0
Give up ownership of the DataBucket contents.
A set of aux data identifiers.
virtual const std::string & key() const =0
returns the containers StoreGate key
uint16_t m_subTypeIndex
index to notify how many objects of given type we have (we need to record it in case of slimming will...
Interface for objects taking part in direct ROOT I/O.
bool serializeDynVars(const SG::IAuxStoreIO &iio, const xAOD::AuxSelection &sel, std::vector< uint32_t > &dataBlob)
Serialize all selected dynamic variables for an xAOD object.
const std::type_info * getElementType(const std::string &tname, std::string &elementTypeName) const
Find the type of an element of a vector.
virtual const std::string & prefix() const
returns the containers StoreGate prefix