ATLAS Offline Software
Loading...
Searching...
No Matches
HLTNavDetails::HolderImp< STORED, CONTAINER > Class Template Referenceabstract

This is an implementation class for all Holders It is templated with 2 arguments STORED which is type of stored objects Another type is CONTAINER for that type. More...

#include <Holder.h>

Inheritance diagram for HLTNavDetails::HolderImp< STORED, CONTAINER >:
Collaboration diagram for HLTNavDetails::HolderImp< STORED, CONTAINER >:

Classes

struct  MemoryMgr

Public Types

typedef Holder< STORED > base_type
typedef STORED stored_type
typedef CONTAINER container_type
typedef HLTNavDetails::TypeProxy< STORED > FeatureProxy
typedef HLTNavDetails::TypeProxy< CONTAINER > ContainerProxy
typedef std::multimap< HLT::TriggerElement::ObjectIndex, MemoryMgrMemoryMgrMap

Public Member Functions

 HolderImp ()
 HolderImp (const std::string &prefix, const std::string &label, uint16_t idx)
virtual ~HolderImp ()
virtual IHolderclone (const std::string &prefix, const std::string &label, uint16_t idx) const
virtual HLT::TriggerElement::ObjectIndex add (const STORED *f, bool inSG=false, const std::string &="")
 adds object(s) to be holded
virtual bool get (const STORED *&dest, HLT::TriggerElement::ObjectIndex idx)
 gets object(s) holded
virtual bool contains (const STORED *obj, HLT::TriggerElement::ObjectIndex &idx)
 check if object(s) in dest are held by this holder
bool getElementLinks (ElementLinkVector< CONTAINER > &cont, HLT::TriggerElement::ObjectIndex idx)
bool getElementLinks (ElementLinkVector< CONTAINER > &cont)
bool getWithLink (typename set_link< STORED, CONTAINER, std::is_same< STORED, CONTAINER >::value >::type &link, HLT::TriggerElement::ObjectIndex &idx)
virtual std::string getUniqueKey ()
virtual std::string getNextKey ()
virtual void prepare (const asg::AsgMessaging &logger, HLT::AccessProxy *sg, IConversionSvc *objSerializer, bool readonly=false)
 prepares this holder by setting messaging, StoreGate access and providing serializer
virtual bool syncWithSG (SG::OwnershipPolicy policy=SG::OWN_ELEMENTS)
virtual bool checkAndSetOwnership (SG::OwnershipPolicy policy)
virtual bool serialize (std::vector< uint32_t > &output) const
 serializes this Holder
virtual const std::string & key () const
 returns the containers StoreGate key
virtual void print (MsgStream &m) const
virtual DataObject * getDataObject ()
virtual DataObject * getAuxDataObject ()
virtual bool setDataObject (DataObject *dobj)
virtual bool setAuxDataObject (DataObject *dobjaux)
virtual CLID typeClid () const
 returns the CLID of objects stores by this holder
virtual const std::string & typeName () const
 returns the object's name stored by this holder
virtual CLID containerClid () const
virtual const std::string & collectionName () const
 returns the collection's name stored by this holder
virtual CLID auxClidOrZero () const
virtual const ITypeProxycontainerTypeProxy () const
 Get the proxy for the container.
virtual HLT::TriggerElement::ObjectIndex add ATLAS_NOT_THREAD_SAFE (const STORED *f, bool inSG, const std::string &="")=0
 saved object in this holder
template<class CONTAINER2>
bool get (ElementLinkVector< CONTAINER2 > &cont)
template<class CONTAINER2>
bool get (ElementLinkVector< CONTAINER2 > &cont, HLT::TriggerElement::ObjectIndex idx)
template<class CONTAINER2>
bool getWithLink (typename set_link< STORED, CONTAINER2, std::is_same< STORED, CONTAINER2 >::value >::type &link, HLT::TriggerElement::ObjectIndex &idx)
const std::string & label () const
 returns the label of objects stores by this holder
virtual const std::string & prefix () const
 returns the containers StoreGate prefix
uint16_t subTypeIndex () const
 returns the index (short number used when linking object to the TE) of objects stores by this holder
std::string generateAliasKey (CLID c, uint16_t sti, const std::string &label, unsigned size)
bool serializeWithPayload (const xAOD::AuxSelection &sel, std::vector< uint32_t > &output, size_t &payloadsize)
 serializes this Holder including payload
bool serializePayload (std::vector< uint32_t > &dataBlob, const xAOD::AuxSelection &sel)
 serializes the payload of this Holder
bool deserializePayload (const std::vector< uint32_t > &dataBlob, int version)
 deserialization of holder payload

Static Public Member Functions

static bool 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)

Public Attributes

ContainerProxy m_containerProxy
MemoryMgrMap m_memMgr

Protected Member Functions

MsgStream & msg () const
MsgStream & msg (const MSG::Level lvl) const
bool msgLvl (const MSG::Level lvl) const

Protected Attributes

const asg::AsgMessagingm_logger {0}
IConversionSvc * m_objectserializerSvc {0}
 pointer to object serializer
HLT::AccessProxym_storeGate {0}
 pointer to SG
bool m_readonly {false}
ITypeProxym_aux {0}

Private Member Functions

bool serializeDynVars (const SG::IAuxStoreIO &iio, const xAOD::AuxSelection &sel, std::vector< uint32_t > &dataBlob)
 Serialize all selected dynamic variables for an xAOD object.
bool deserializeDynVars (const std::vector< uint32_t > &dataBlob, size_t offs, SG::IAuxStore &store)
 Read dynamic auxiliary variables from a serialized buffer.
std::unique_ptr< SG::IAuxStoredeserializeDynVars (const std::vector< uint32_t > &dataBlob, size_t offs)
 Read dynamic auxiliary variables from a serialized buffer.
const std::type_info * getElementType (const std::string &tname, std::string &elementTypeName) const
 Find the type of an element of a vector.

Private Attributes

std::string m_key
std::string m_prefix
 prefix for key given to the objects
std::string m_label
 label given to the objects in this holder (labels given at attachFeature)
uint16_t m_subTypeIndex {0}
 index to notify how many objects of given type we have (we need to record it in case of slimming will be done latter)
int m_uniqueCounter {0}
ToolHandle< ITrigSerializerToolBasem_serializer
 Serializer tool; used for dynamic variables.

Detailed Description

template<class STORED, class CONTAINER>
class HLTNavDetails::HolderImp< STORED, CONTAINER >

This is an implementation class for all Holders It is templated with 2 arguments STORED which is type of stored objects Another type is CONTAINER for that type.

Examples when it works are: HolderImp<A, DataVector > — typical HolderImp< A, Acontainer> > — as above, Acontainer is either typedef for DataVector or inherits from it HolderImp< DataVector, DataVector > — when both are of the same type HolderImp< Acontainer, Acontainer> > — as above

Definition at line 328 of file Holder.h.

Member Typedef Documentation

◆ base_type

template<class STORED, class CONTAINER>
typedef Holder<STORED> HLTNavDetails::HolderImp< STORED, CONTAINER >::base_type

Definition at line 330 of file Holder.h.

◆ container_type

template<class STORED, class CONTAINER>
typedef CONTAINER HLTNavDetails::HolderImp< STORED, CONTAINER >::container_type

Definition at line 332 of file Holder.h.

◆ ContainerProxy

template<class STORED, class CONTAINER>
typedef HLTNavDetails::TypeProxy<CONTAINER> HLTNavDetails::HolderImp< STORED, CONTAINER >::ContainerProxy

Definition at line 334 of file Holder.h.

◆ FeatureProxy

template<class STORED, class CONTAINER>
typedef HLTNavDetails::TypeProxy<STORED> HLTNavDetails::HolderImp< STORED, CONTAINER >::FeatureProxy

Definition at line 333 of file Holder.h.

◆ MemoryMgrMap

template<class STORED, class CONTAINER>
typedef std::multimap<HLT::TriggerElement::ObjectIndex, MemoryMgr> HLTNavDetails::HolderImp< STORED, CONTAINER >::MemoryMgrMap

Definition at line 399 of file Holder.h.

◆ stored_type

template<class STORED, class CONTAINER>
typedef STORED HLTNavDetails::HolderImp< STORED, CONTAINER >::stored_type

Definition at line 331 of file Holder.h.

Constructor & Destructor Documentation

◆ HolderImp() [1/2]

template<class STORED, class CONTAINER>
HLTNavDetails::HolderImp< STORED, CONTAINER >::HolderImp ( )

◆ HolderImp() [2/2]

template<class STORED, class CONTAINER>
HLTNavDetails::HolderImp< STORED, CONTAINER >::HolderImp ( const std::string & prefix,
const std::string & label,
uint16_t idx )

◆ ~HolderImp()

template<class STORED, class CONTAINER>
virtual HLTNavDetails::HolderImp< STORED, CONTAINER >::~HolderImp ( )
virtual

Member Function Documentation

◆ add()

template<class STORED, class CONTAINER>
virtual HLT::TriggerElement::ObjectIndex HLTNavDetails::HolderImp< STORED, CONTAINER >::add ( const STORED * f,
bool inSG = false,
const std::string & = "" )
virtual

adds object(s) to be holded

◆ ATLAS_NOT_THREAD_SAFE()

template<class STORED>
virtual HLT::TriggerElement::ObjectIndex add HLTNavDetails::Holder< STORED >::ATLAS_NOT_THREAD_SAFE ( const STORED * f,
bool inSG,
const std::string & = "" )
pure virtualinherited

saved object in this holder

◆ auxClidOrZero()

template<class STORED, class CONTAINER>
virtual CLID HLTNavDetails::HolderImp< STORED, CONTAINER >::auxClidOrZero ( ) const
virtual

◆ checkAndSetOwnership()

template<class STORED, class CONTAINER>
virtual bool HLTNavDetails::HolderImp< STORED, CONTAINER >::checkAndSetOwnership ( SG::OwnershipPolicy policy)
virtual

◆ clone()

template<class STORED, class CONTAINER>
virtual IHolder * HLTNavDetails::HolderImp< STORED, CONTAINER >::clone ( const std::string & prefix,
const std::string & label,
uint16_t idx ) const
virtual

◆ collectionName()

template<class STORED, class CONTAINER>
virtual const std::string & HLTNavDetails::HolderImp< STORED, CONTAINER >::collectionName ( ) const
inlinevirtual

returns the collection's name stored by this holder

Implements HLTNavDetails::IHolder.

Definition at line 383 of file Holder.h.

◆ containerClid()

template<class STORED, class CONTAINER>
virtual CLID HLTNavDetails::HolderImp< STORED, CONTAINER >::containerClid ( ) const
inlinevirtual

Implements HLTNavDetails::IHolder.

Definition at line 382 of file Holder.h.

◆ containerTypeProxy()

template<class STORED, class CONTAINER>
virtual const ITypeProxy & HLTNavDetails::HolderImp< STORED, CONTAINER >::containerTypeProxy ( ) const
inlinevirtual

Get the proxy for the container.

Implements HLTNavDetails::IHolder.

Definition at line 386 of file Holder.h.

386{ return m_containerProxy; }
ContainerProxy m_containerProxy
Definition Holder.h:397

◆ contains()

template<class STORED, class CONTAINER>
virtual bool HLTNavDetails::HolderImp< STORED, CONTAINER >::contains ( const STORED * obj,
HLT::TriggerElement::ObjectIndex & idx )
virtual

check if object(s) in dest are held by this holder

Implements HLTNavDetails::Holder< STORED >.

◆ deserializeDynVars() [1/2]

std::unique_ptr< SG::IAuxStore > IHolder::deserializeDynVars ( const std::vector< uint32_t > & dataBlob,
size_t offs )
privateinherited

Read dynamic auxiliary variables from a serialized buffer.

Parameters
dataBlobSerialized data.
offsOffset in dataBlob where dynamic variables start.
szNumber 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.

454{
455 StringSerializer ss;
456 SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
457
458 // New dynamic store.
459 auto store = std::make_unique<HLTNavDetails::TrigAuxStore>();
460
461 // Read through the buffer starting at @c offs.
462 std::vector<uint32_t>::const_iterator it = dataBlob.begin() + offs;
463 while (it < dataBlob.end()) {
464 // Read the attribute and type names from the buffer.
465 size_t name_size = *it++;
466 std::string name;
467 ss.deserialize (it, it+name_size, name);
468 it += name_size;
469
470 size_t tname_size = *it++;
471 std::string tname;
472 ss.deserialize (it, it+tname_size, tname);
473 it += tname_size;
474
475 // Object size.
476 size_t var_size = *it++;
477
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) {
482 // Convert from SG::PackedContainer<T> to vector<T>.
483 // Also strip out a std::allocator<T> argument, but leave
484 // any other allocator.
485 auto makeRules = []() {
486 CxxUtils::ClassName::Rules rules;
487 rules.add ("SG::PackedContainer<$T, std::allocator<$T> >",
488 "vector<$T>");
489 rules.add ("SG::PackedContainer<$T, allocator<$T> >",
490 "vector<$T>");
491 rules.add ("SG::PackedContainer<$T, $ALLOC>",
492 "vector<$T, $ALLOC>");
493 return rules;
494 };
495 const static CxxUtils::ClassName::Rules rules = makeRules();
496 vecname = rules.apply (vecname);
497 }
498
499 // Handle schema evolution. If we're expecting a different
500 // type for the variable, then use that name instead.
501 SG::auxid_t id = r.findAuxID (name);
502 if (id != SG::null_auxid && stripStdVec(r.getVecTypeName(id)) != stripStdVec(vecname)) {
503 vecname = r.getVecTypeName (id);
504 tname = vecname;
505 }
506
507 // Handle the case where we don't have a registered type for this
508 // auxiliary variable.
509 if (id == SG::null_auxid)
510 {
511 std::string elementTypeName;
512 const std::type_info* elt_tinfo = getElementType (vecname, elementTypeName);
513 if (elt_tinfo)
514 id = SG::getDynamicAuxID (*elt_tinfo, name, elementTypeName, tname, false, SG::null_auxid);
515 if (id == SG::null_auxid) {
516 ATH_MSG_ERROR("deserialize aux dyn var failed; can't find auxid for:" << name);
517 return std::unique_ptr<SG::IAuxStore> (std::move(store));
518 }
519 }
520
521 // Read the object from the buffer.
522 std::vector<uint32_t> buf (it, it+var_size);
523 void* obj = m_serializer->deserialize (tname, buf);
524 it += var_size;
525
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);
530 }
531
532 return std::unique_ptr<SG::IAuxStore> (std::move(store));
533}
#define ATH_MSG_ERROR(x)
std::vector< size_t > vec
static Double_t ss
std::string apply(const std::string &name) const
Apply transformations to a class name.
void add(const ClassName &pattern, const ClassName &replacement)
Add a new transformation rule.
ToolHandle< ITrigSerializerToolBase > m_serializer
Serializer tool; used for dynamic variables.
Definition Holder.h:247
const std::type_info * getElementType(const std::string &tname, std::string &elementTypeName) const
Find the type of an element of a vector.
Definition Holder.cxx:544
static AuxTypeRegistry & instance()
Return the singleton registry instance.
int r
Definition globals.cxx:22
TestStore store
Definition TestStore.cxx:23
static const auxid_t null_auxid
To signal no aux data item.
Definition AuxTypes.h:30
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.
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27

◆ deserializeDynVars() [2/2]

bool IHolder::deserializeDynVars ( const std::vector< uint32_t > & dataBlob,
size_t offs,
SG::IAuxStore & store )
privateinherited

Read dynamic auxiliary variables from a serialized buffer.

Parameters
dataBlobSerialized data.
offsOffset in dataBlob where dynamic variables start.
[out]storeAuxiliary 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.

408{
409 SG::IAuxStoreHolder* holder = dynamic_cast<SG::IAuxStoreHolder*> (&store);
410 if (!holder) {
411 ATH_MSG_ERROR("deserialize aux dyn vars failed: can't convert to IAuxStoreHolder.");
412 return false;
413 }
414
415 std::unique_ptr<SG::IAuxStore> newstore = deserializeDynVars (dataBlob, offs);
416 if (!newstore) return false;
417 holder->setStore (newstore.release());
418 return true;
419}
bool deserializeDynVars(const std::vector< uint32_t > &dataBlob, size_t offs, SG::IAuxStore &store)
Read dynamic auxiliary variables from a serialized buffer.
Definition Holder.cxx:405
virtual void setStore(IAuxStore *store)=0
Give an auxiliary store object to the holder object.

◆ deserializePayload()

bool HLTNavDetails::IHolder::deserializePayload ( const std::vector< uint32_t > & dataBlob,
int version )
inherited

deserialization of holder payload

Definition at line 148 of file Holder.cxx.

148 {
149 const std::string sgkey = key();
150 ::HLT::class_id_type feature_clid = typeClid();
151 ::HLT::class_id_type container_clid = containerClid();
152 const std::string container_typename = collectionName();
153
154 if ( m_storeGate->transientContains(container_clid, sgkey) ) {
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");
157 syncWithSG();
158 }
159
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);
162
163 if (container_clid<1){
164 ATH_MSG_WARNING("holder type clid " << feature_clid << " collection clid: " << container_clid);
165 }
166
167 typedef std::vector<uint32_t>::const_iterator it_type;
168 it_type it = std::begin(dataBlob);
169
170 if(!dataBlob.size()) return false;
171
172 std::vector<uint32_t> first, second;
173
174 if(version == 4){
175 auto firstsize = *(it++);
176 ATH_MSG_VERBOSE("first part has size: " << firstsize);
177
178 first = std::vector<uint32_t>(it,it+firstsize);
179
180 std::advance(it,firstsize);
181
182 if(!(it!=dataBlob.end())){
183 ATH_MSG_VERBOSE("this datablob only has a first part (non xAOD case)");
184 }
185 else{
186 auto secondsize = *(it++);
187 ATH_MSG_VERBOSE("second part has size: " << secondsize);
188 second = std::vector<uint32_t>(it,it+secondsize);
189 std::advance(it,secondsize);
190 }
191 }
192 else{
193 first = std::vector<uint32_t>(dataBlob.begin(),dataBlob.end());
194 }
195
196 TrigStreamAddress addr(container_clid, sgkey, "", 0, 0);
197 addr.add(first);
198 DataObject* dobj(0);
199
200 if (m_objectserializerSvc->createObj(&addr, dobj).isFailure() ){
201 ATH_MSG_WARNING("deserialize main: failed");
202 return false;
203 }
204
205 bool setcontainer = setDataObject(dobj);
206 if (DataBucketBase* dbb = dynamic_cast<DataBucketBase*> (dobj)) {
207 dbb->relinquish();
208 delete dbb;
209 }
210 if(!setcontainer) return false;
211
212 DataObject* dobjaux(0);
213 if(!second.empty()){
214 std::string sgkeyaux = sgkey+"Aux.";
215 ATH_MSG_VERBOSE("aux clid was deduced to be: " << auxClidOrZero());
216 TrigStreamAddress auxaddr(auxClidOrZero(), sgkeyaux, "", 0, 0);
217 auxaddr.add(second);
218
219 if (m_objectserializerSvc->createObj(&auxaddr, dobjaux).isFailure() ){
220 ATH_MSG_WARNING("Aux Store deserialization failed");
221 return false;
222 }
223
224 // Handle dynamic variables.
225 if (it != dataBlob.end()) {
226 DataBucketBase* dobjBaseAux = static_cast<DataBucketBase*>(dobjaux);
227
228 SG::IAuxStore* istore = nullptr;
229 if (xAOD::AuxContainerBase* auxstore =
230 dobjBaseAux->template cast<xAOD::AuxContainerBase> (nullptr, false))
231 {
232 istore = auxstore;
233 }
234
235 if (!istore || !deserializeDynVars (dataBlob,
236 it - dataBlob.begin(),
237 *istore))
238 {
239 ATH_MSG_WARNING("Aux Store dynamic var deserialization failed");
240 return false;
241 }
242 }
243
244 bool setaux = setAuxDataObject(dobjaux);
245 if (DataBucketBase* dbb = dynamic_cast<DataBucketBase*> (dobjaux)) {
246 dbb->relinquish();
247 delete dbb;
248 }
249 if(!setaux) return false;
250 }
251 return true;
252}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
virtual const std::string & key() const =0
returns the containers StoreGate key
virtual CLID containerClid() const =0
virtual bool syncWithSG(SG::OwnershipPolicy policy=SG::OWN_ELEMENTS)=0
virtual bool setDataObject(DataObject *dobj)=0
HLT::AccessProxy * m_storeGate
pointer to SG
Definition Holder.h:163
virtual CLID auxClidOrZero() const =0
IConversionSvc * m_objectserializerSvc
pointer to object serializer
Definition Holder.h:162
virtual CLID typeClid() const =0
returns the CLID of objects stores by this holder
virtual const std::string & collectionName() const =0
returns the collection's name stored by this holder
virtual bool setAuxDataObject(DataObject *dobjaux)=0
bool first
Definition DeMoScan.py:534
sgkey(tool)
Definition common.py:1027

◆ 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.

15 {
16 using namespace std;
17 if ( fromHere == end ) return false;
18
19 c = *fromHere++;
20 if ( fromHere == end ) return false;
21
22 subtypeIndex = *fromHere++;
23 if ( fromHere == end ) return false;
24
25 unsigned labelSize = *fromHere++;
26 if ( fromHere == end ) return false;
27 if ( fromHere+labelSize > end ) return false;
28
29 std::vector<uint32_t>::const_iterator stringEnd = fromHere+labelSize;
30 HLT::StringSerializer::deserialize(fromHere, stringEnd, label);
31
32 //advance iterator to end of label
33 std::advance(fromHere,labelSize);
34
35 return true;
36}
virtual const std::string & label() const =0
std::size_t deserialize(std::vector< uint32_t >::const_iterator first, std::vector< uint32_t >::const_iterator last, std::vector< std::string > &strings)

◆ generateAliasKey()

std::string IHolder::generateAliasKey ( CLID c,
uint16_t sti,
const std::string & label,
unsigned size )
inherited

Definition at line 98 of file Holder.cxx.

98 {
99 std::ostringstream ss;
100 ss << "HLTAutoKey_" << label << "_" << c << "_" << sti << "_" << (size == 0xffffffff ? "back" : "to") << "_" << m_uniqueCounter;
101 std::string st = ss.str();
102 ATH_MSG_DEBUG("IHolder::generateAliasKey generated key: " << st);
104 return st;
105}
const std::string & label() const
returns the label of objects stores by this holder
Definition Holder.h:85

◆ get() [1/3]

template<class STORED>
template<class CONTAINER2>
bool HLTNavDetails::Holder< STORED >::get ( ElementLinkVector< CONTAINER2 > & cont)
inherited

◆ get() [2/3]

template<class STORED>
template<class CONTAINER2>
bool HLTNavDetails::Holder< STORED >::get ( ElementLinkVector< CONTAINER2 > & cont,
HLT::TriggerElement::ObjectIndex idx )
inherited

◆ get() [3/3]

template<class STORED, class CONTAINER>
virtual bool HLTNavDetails::HolderImp< STORED, CONTAINER >::get ( const STORED *& dest,
HLT::TriggerElement::ObjectIndex idx )
virtual

gets object(s) holded

Implements HLTNavDetails::Holder< STORED >.

◆ getAuxDataObject()

template<class STORED, class CONTAINER>
virtual DataObject * HLTNavDetails::HolderImp< STORED, CONTAINER >::getAuxDataObject ( )
virtual

◆ getDataObject()

template<class STORED, class CONTAINER>
virtual DataObject * HLTNavDetails::HolderImp< STORED, CONTAINER >::getDataObject ( )
virtual

◆ getElementLinks() [1/2]

template<class STORED, class CONTAINER>
bool HLTNavDetails::HolderImp< STORED, CONTAINER >::getElementLinks ( ElementLinkVector< CONTAINER > & cont)

◆ getElementLinks() [2/2]

template<class STORED, class CONTAINER>
bool HLTNavDetails::HolderImp< STORED, CONTAINER >::getElementLinks ( ElementLinkVector< CONTAINER > & cont,
HLT::TriggerElement::ObjectIndex idx )

◆ getElementType()

const std::type_info * IHolder::getElementType ( const std::string & tname,
std::string & elementTypeName ) const
privateinherited

Find the type of an element of a vector.

Parameters
tnameThe 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_inThe name of the type to analyze.
[out]elementTypeNameThe 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.

546{
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();
554 }
555 RootUtils::Type typ (prox->GetType());
556 elementTypeName = typ.getTypeName();
557 return typ.getTypeInfo();
558}

◆ getNextKey()

template<class STORED, class CONTAINER>
virtual std::string HLTNavDetails::HolderImp< STORED, CONTAINER >::getNextKey ( )
virtual

◆ getUniqueKey()

template<class STORED, class CONTAINER>
virtual std::string HLTNavDetails::HolderImp< STORED, CONTAINER >::getUniqueKey ( )
virtual

◆ getWithLink() [1/2]

template<class STORED>
template<class CONTAINER2>
bool HLTNavDetails::Holder< STORED >::getWithLink ( typename set_link< STORED, CONTAINER2, std::is_same< STORED, CONTAINER2 >::value >::type & link,
HLT::TriggerElement::ObjectIndex & idx )
inlineinherited

Definition at line 305 of file Holder.h.

306 {
307
308 bool result = static_cast<HolderImp<STORED,CONTAINER2>*>(this)->getWithLink(link,idx);
309 return result;
310 }
bool getWithLink(typename set_link< STORED, CONTAINER2, std::is_same< STORED, CONTAINER2 >::value >::type &link, HLT::TriggerElement::ObjectIndex &idx)
Definition Holder.h:305

◆ getWithLink() [2/2]

template<class STORED, class CONTAINER>
bool HLTNavDetails::HolderImp< STORED, CONTAINER >::getWithLink ( typename set_link< STORED, CONTAINER, std::is_same< STORED, CONTAINER >::value >::type & link,
HLT::TriggerElement::ObjectIndex & idx )

◆ key()

template<class STORED, class CONTAINER>
virtual const std::string & HLTNavDetails::HolderImp< STORED, CONTAINER >::key ( ) const
inlinevirtual

returns the containers StoreGate key

Implements HLTNavDetails::IHolder.

Definition at line 372 of file Holder.h.

372{ return m_key; }

◆ label()

const std::string & HLTNavDetails::IHolder::label ( ) const
inlinevirtualinherited

returns the label of objects stores by this holder

Implements HLT::BaseHolder.

Definition at line 85 of file Holder.h.

85{ return m_label; }
std::string m_label
label given to the objects in this holder (labels given at attachFeature)
Definition Holder.h:242

◆ msg() [1/2]

MsgStream & HLTNavDetails::IHolder::msg ( ) const
inlineprotectedinherited

Definition at line 169 of file Holder.h.

169{ return m_logger->msg(); }
const asg::AsgMessaging * m_logger
Definition Holder.h:161

◆ msg() [2/2]

MsgStream & HLTNavDetails::IHolder::msg ( const MSG::Level lvl) const
inlineprotectedinherited

Definition at line 170 of file Holder.h.

170{ return msg() << lvl; }
MsgStream & msg() const
Definition Holder.h:169

◆ msgLvl()

bool HLTNavDetails::IHolder::msgLvl ( const MSG::Level lvl) const
inlineprotectedinherited

Definition at line 171 of file Holder.h.

171{ return msg().level() <= lvl; }

◆ prefix()

virtual const std::string & HLTNavDetails::IHolder::prefix ( ) const
inlinevirtualinherited

returns the containers StoreGate prefix

Definition at line 90 of file Holder.h.

90{ return m_prefix; }
std::string m_prefix
prefix for key given to the objects
Definition Holder.h:241

◆ prepare()

template<class STORED, class CONTAINER>
virtual void HLTNavDetails::HolderImp< STORED, CONTAINER >::prepare ( const asg::AsgMessaging & logger,
HLT::AccessProxy * sg,
IConversionSvc * objSerializer,
bool readonly = false )
virtual

prepares this holder by setting messaging, StoreGate access and providing serializer

Reimplemented from HLTNavDetails::IHolder.

◆ print()

template<class STORED, class CONTAINER>
virtual void HLTNavDetails::HolderImp< STORED, CONTAINER >::print ( MsgStream & m) const
virtual

Reimplemented from HLTNavDetails::IHolder.

◆ serialize()

template<class STORED, class CONTAINER>
virtual bool HLTNavDetails::HolderImp< STORED, CONTAINER >::serialize ( std::vector< uint32_t > & output) const
virtual

serializes this Holder

Reimplemented from HLTNavDetails::IHolder.

◆ serializeDynVars()

bool IHolder::serializeDynVars ( const SG::IAuxStoreIO & iio,
const xAOD::AuxSelection & sel,
std::vector< uint32_t > & dataBlob )
privateinherited

Serialize all selected dynamic variables for an xAOD object.

Parameters
iioThe auxiliary store for the xAOD object.
selSelection object for variables to write.
[out]dataBlobSerialized 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.

348{
349 // Loop over all selected variables.
350 const SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
351 SG::auxid_set_t auxids = sel.getSelectedAuxIDs (iio.getDynamicAuxIDs());
352 for (SG::auxid_t id : auxids) {
353 // Get the TClass of the object being saved.
354 const std::type_info* tinfo = iio.getIOType (id);
355 if (!tinfo) {
356 ATH_MSG_ERROR("serialize aux dyn vars failed: can't get type_info.");
357 return false;
358 }
359 TClass* cls = TClass::GetClass (*tinfo);
360 if (!cls) {
361 ATH_MSG_ERROR("serialize aux dyn vars failed: can't get TClass.");
362 return false;
363 }
364
365 // Serialize the object data to a temp buffer.
366 std::vector<uint32_t> serialized =
367 m_serializer->serialize (cls->GetName(), iio.getIOData (id));
368
369 // Concatenate header header information to the output buffer:
370 // attribute name and data type.
371 StringSerializer ss;
372 std::vector<uint32_t> serializedName;
373 ss.serialize (r.getName(id), serializedName); // FIXME: handle class part?
374 dataBlob.push_back (serializedName.size());
375 dataBlob.insert(dataBlob.end(), serializedName.begin(), serializedName.end());
376
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());
381
382 // Add the object data itself to the output buffer.
383 dataBlob.push_back (serialized.size());
384 dataBlob.insert(dataBlob.end(), serialized.begin(), serialized.end());
385 }
386
387 return true;
388}
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.
virtual const void * getIOData(SG::auxid_t auxid) const =0
Return a pointer to the data to be stored for one aux data item.
virtual const SG::auxid_set_t & getDynamicAuxIDs() const =0
Get the list of all dynamically created variables.

◆ serializePayload()

bool HLTNavDetails::IHolder::serializePayload ( std::vector< uint32_t > & dataBlob,
const xAOD::AuxSelection & sel )
inherited

serializes the payload of this Holder

Definition at line 254 of file Holder.cxx.

255 {
256 DataObject* dobj = getDataObject();
257
258 if(!dobj){
259 ATH_MSG_WARNING("data object points to null. can't serialize");
260 }
261
262 ATH_MSG_VERBOSE("creating serialized representation for " << dobj);
263
264
265 TrigStreamAddress* addr(0);
266 if ( m_objectserializerSvc->createRep(dobj, *pp_cast<IOpaqueAddress>(&addr) ).isSuccess() ) {
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());
270 // above should be optimized (need to know if in case of failed serialization addr->get() contains empty data vector)
271 }
272 else{
273 ATH_MSG_ERROR("Container serialization Failure");
274 return false;
275 }
276 DataBucketBase* dobjBase = static_cast<DataBucketBase*>(dobj);
277 if ( dobjBase ) {
278 dobjBase->relinquish();
279 ATH_MSG_VERBOSE("serialization giving up the ownership");
280 }
281 delete dobj;
282 delete addr;
283
284 DataObject* dobjaux = getAuxDataObject();
285
286 ATH_MSG_VERBOSE("aux object: " << dobjaux);
287
288 TrigStreamAddress* auxaddr(0);
289 if(dobjaux){
290 ATH_MSG_VERBOSE("AuxStore serialization");
291 if(m_objectserializerSvc->createRep(dobjaux,*pp_cast<IOpaqueAddress>(&auxaddr) ).isSuccess() ){
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());
295 }
296 else{
297 ATH_MSG_ERROR("AuxStore serialization Failure");
298 return false;
299 }
300 DataBucketBase* dobjBaseAux = static_cast<DataBucketBase*>(dobjaux);
301
302 const SG::IAuxStoreIO* iio = nullptr;
303 if (const xAOD::AuxContainerBase* auxstore =
304 dobjBaseAux->template cast<xAOD::AuxContainerBase> (nullptr, true))
305 {
306 iio = auxstore;
307 }
308
309 dobjBaseAux->relinquish();
310 ATH_MSG_VERBOSE("serialization giving up the ownership of Aux");
311 delete dobjaux;
312 delete auxaddr;
313
314 // Handle dynamic variables.
315 if (iio) {
316 if (!serializeDynVars (*iio, sel, dataBlob)) {
317 ATH_MSG_ERROR("Serialization of dynamic aux variables failed.");
318 return false;
319 }
320 }
321 }
322 ATH_MSG_VERBOSE("finished serializing payload. size: " << dataBlob.size());
323
324 return true;
325}
virtual void relinquish()=0
Give up ownership of the DataBucket contents.
virtual DataObject * getAuxDataObject()=0
bool serializeDynVars(const SG::IAuxStoreIO &iio, const xAOD::AuxSelection &sel, std::vector< uint32_t > &dataBlob)
Serialize all selected dynamic variables for an xAOD object.
Definition Holder.cxx:345
virtual DataObject * getDataObject()=0

◆ serializeWithPayload()

bool IHolder::serializeWithPayload ( const xAOD::AuxSelection & sel,
std::vector< uint32_t > & output,
size_t & payloadsize )
inherited

serializes this Holder including payload

Definition at line 79 of file Holder.cxx.

81 {
82 bool header_ser = serialize(output);
83 if(!header_ser){
84 ATH_MSG_ERROR(" header serialization failed ");
85 return false;
86 }
87 std::vector<uint32_t> payload;
88 bool payload_ser = serializePayload(payload, sel);
89 if(!payload_ser){
90 ATH_MSG_ERROR(" payload serialization failed ");
91 return false;
92 }
93 payloadsize = payload.size();
94 output.insert(output.end(), payload.begin(), payload.end());
95 return true;
96}
virtual bool serialize(std::vector< uint32_t > &output) const
serializes this Holder
Definition Holder.cxx:62
bool serializePayload(std::vector< uint32_t > &dataBlob, const xAOD::AuxSelection &sel)
serializes the payload of this Holder
Definition Holder.cxx:254
output
Definition merge.py:16

◆ setAuxDataObject()

template<class STORED, class CONTAINER>
virtual bool HLTNavDetails::HolderImp< STORED, CONTAINER >::setAuxDataObject ( DataObject * dobjaux)
virtual

◆ setDataObject()

template<class STORED, class CONTAINER>
virtual bool HLTNavDetails::HolderImp< STORED, CONTAINER >::setDataObject ( DataObject * dobj)
virtual

◆ subTypeIndex()

uint16_t HLTNavDetails::IHolder::subTypeIndex ( ) const
inlinevirtualinherited

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.

111{ return m_subTypeIndex; }
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...
Definition Holder.h:243

◆ syncWithSG()

template<class STORED, class CONTAINER>
virtual bool HLTNavDetails::HolderImp< STORED, CONTAINER >::syncWithSG ( SG::OwnershipPolicy policy = SG::OWN_ELEMENTS)
virtual

◆ typeClid()

template<class STORED, class CONTAINER>
virtual CLID HLTNavDetails::HolderImp< STORED, CONTAINER >::typeClid ( ) const
inlinevirtual

returns the CLID of objects stores by this holder

Implements HLTNavDetails::IHolder.

Definition at line 380 of file Holder.h.

380{ return ClassID_traits<STORED>::ID(); }

◆ typeName()

template<class STORED, class CONTAINER>
virtual const std::string & HLTNavDetails::HolderImp< STORED, CONTAINER >::typeName ( ) const
inlinevirtual

returns the object's name stored by this holder

Implements HLTNavDetails::IHolder.

Definition at line 381 of file Holder.h.

Member Data Documentation

◆ m_aux

ITypeProxy* HLTNavDetails::IHolder::m_aux {0}
protectedinherited

Definition at line 166 of file Holder.h.

166{0};

◆ m_containerProxy

template<class STORED, class CONTAINER>
ContainerProxy HLTNavDetails::HolderImp< STORED, CONTAINER >::m_containerProxy

Definition at line 397 of file Holder.h.

◆ m_key

template<class STORED, class CONTAINER>
std::string HLTNavDetails::HolderImp< STORED, CONTAINER >::m_key
private

Definition at line 403 of file Holder.h.

◆ m_label

std::string HLTNavDetails::IHolder::m_label
privateinherited

label given to the objects in this holder (labels given at attachFeature)

Definition at line 242 of file Holder.h.

◆ m_logger

const asg::AsgMessaging* HLTNavDetails::IHolder::m_logger {0}
protectedinherited

Definition at line 161 of file Holder.h.

161{0};

◆ m_memMgr

template<class STORED, class CONTAINER>
MemoryMgrMap HLTNavDetails::HolderImp< STORED, CONTAINER >::m_memMgr

Definition at line 400 of file Holder.h.

◆ m_objectserializerSvc

IConversionSvc* HLTNavDetails::IHolder::m_objectserializerSvc {0}
protectedinherited

pointer to object serializer

Definition at line 162 of file Holder.h.

162{0};

◆ m_prefix

std::string HLTNavDetails::IHolder::m_prefix
privateinherited

prefix for key given to the objects

Definition at line 241 of file Holder.h.

◆ m_readonly

bool HLTNavDetails::IHolder::m_readonly {false}
protectedinherited

Definition at line 165 of file Holder.h.

165{false};

◆ m_serializer

ToolHandle<ITrigSerializerToolBase> HLTNavDetails::IHolder::m_serializer
privateinherited

Serializer tool; used for dynamic variables.

Definition at line 247 of file Holder.h.

◆ m_storeGate

HLT::AccessProxy* HLTNavDetails::IHolder::m_storeGate {0}
protectedinherited

pointer to SG

Definition at line 163 of file Holder.h.

163{0};

◆ m_subTypeIndex

uint16_t HLTNavDetails::IHolder::m_subTypeIndex {0}
privateinherited

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.

243{0};

◆ m_uniqueCounter

int HLTNavDetails::IHolder::m_uniqueCounter {0}
privateinherited

Definition at line 244 of file Holder.h.

244{0};

The documentation for this class was generated from the following file: