ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
HLTNavDetails::IHolder Class Referenceabstract

#include <Holder.h>

Inheritance diagram for HLTNavDetails::IHolder:
Collaboration diagram for HLTNavDetails::IHolder:

Public Member Functions

 IHolder ()
 
 IHolder (const std::string &prefix, const std::string &label, uint16_t idx)
 
virtual ~IHolder ()
 
virtual IHolderclone (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 ITypeProxycontainerTypeProxy () 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
 

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)
 

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 More...
 
HLT::AccessProxym_storeGate {0}
 pointer to SG More...
 
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. More...
 
bool deserializeDynVars (const std::vector< uint32_t > &dataBlob, size_t offs, SG::IAuxStore &store)
 Read dynamic auxiliary variables from a serialized buffer. More...
 
std::unique_ptr< SG::IAuxStoredeserializeDynVars (const std::vector< uint32_t > &dataBlob, size_t offs)
 Read dynamic auxiliary variables from a serialized buffer. More...
 
const std::type_info * getElementType (const std::string &tname, std::string &elementTypeName) const
 Find the type of an element of a vector. More...
 

Private Attributes

std::string m_prefix
 prefix for key given to the objects More...
 
std::string m_label
 label given to the objects in this holder (labels given at attachFeature) More...
 
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) More...
 
int m_uniqueCounter {0}
 
ToolHandle< ITrigSerializerToolBasem_serializer
 Serializer tool; used for dynamic variables. More...
 

Detailed Description

Definition at line 58 of file Holder.h.

Constructor & Destructor Documentation

◆ IHolder() [1/2]

IHolder::IHolder ( )

Definition at line 38 of file Holder.cxx.

39  : m_serializer("TrigTSerializer/TrigTSerializer")
40 {}

◆ IHolder() [2/2]

IHolder::IHolder ( const std::string &  prefix,
const std::string &  label,
uint16_t  idx 
)

Definition at line 42 of file Holder.cxx.

43  : m_prefix(prefix),
44  m_label(label),
46  m_serializer("TrigTSerializer/TrigTSerializer")
47 {
48 }

◆ ~IHolder()

IHolder::~IHolder ( )
virtual

Definition at line 51 of file Holder.cxx.

51  {
52  if ( m_aux ) { delete m_aux; }
53 }

Member Function Documentation

◆ auxClidOrZero()

virtual CLID HLTNavDetails::IHolder::auxClidOrZero ( ) const
pure virtual

◆ checkAndSetOwnership()

virtual bool HLTNavDetails::IHolder::checkAndSetOwnership ( SG::OwnershipPolicy  policy)
pure virtual

◆ 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
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;
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 = []() {
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 }

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

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

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((IOpaqueAddress*)&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((IOpaqueAddress*)&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 }

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

◆ generateAliasKey()

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

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);
103  m_uniqueCounter++;
104  return st;
105 }

◆ 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
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()

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

returns the label of objects stores by this holder

Implements HLT::BaseHolder.

Definition at line 85 of file Holder.h.

85 { return m_label; }

◆ msg() [1/2]

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

Definition at line 169 of file Holder.h.

169 { return m_logger->msg(); }

◆ msg() [2/2]

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

Definition at line 170 of file Holder.h.

170 { return msg() << lvl; }

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

90 { return m_prefix; }

◆ prepare()

void IHolder::prepare ( const asg::AsgMessaging logger,
HLT::AccessProxy sg,
IConversionSvc *  objSerializer,
bool  readonly 
)
virtual

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

Definition at line 55 of file Holder.cxx.

55  {
56  m_storeGate = sg;
57  m_logger = &logger;
58  m_objectserializerSvc = objSerializer;
59  m_readonly = readonly;
60 }

◆ print()

void IHolder::print ( MsgStream &  m) const
virtual

Definition at line 107 of file Holder.cxx.

107  {
108  m << "type: " << typeName() << "(" << typeClid() << ")" << " container: " << collectionName() << "(" << containerClid() << ")"
109  << "label: \"" << label() << "\" subTypeIndex: " << subTypeIndex();
110 }

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

62  {
63 
64  ATH_MSG_DEBUG("Holder<T> serialize, " << *this );
65  // if feature to be forgotten then indication of it is simply 0 size of serialized vector
66 
67  output.push_back( typeClid() );
68  output.push_back( m_subTypeIndex );
69 
70  // label
71  std::vector<uint32_t> serializedLabel;
72  StringSerializer ss;
73  ss.serialize( m_label, serializedLabel );
74  output.push_back( serializedLabel.size() );
75  output.insert(output.end(), serializedLabel.begin(), serializedLabel.end());
76  return true;
77 }

◆ serializeDynVars()

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

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

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

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 }

◆ serializeWithPayload()

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

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 }

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

111 { return m_subTypeIndex; }

◆ syncWithSG()

virtual bool HLTNavDetails::IHolder::syncWithSG ( SG::OwnershipPolicy  policy = SG::OWN_ELEMENTS)
pure virtual

◆ 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

Member Data Documentation

◆ m_aux

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

Definition at line 166 of file Holder.h.

◆ 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

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

Definition at line 161 of file Holder.h.

◆ 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

Definition at line 165 of file Holder.h.

◆ m_serializer

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

Serializer tool; used for dynamic variables.

Definition at line 247 of file Holder.h.

◆ m_storeGate

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

pointer to SG

Definition at line 163 of file Holder.h.

◆ 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

Definition at line 244 of file Holder.h.


The documentation for this class was generated from the following files:
HLTNavDetails::IHolder::containerClid
virtual CLID containerClid() const =0
beamspotman.r
def r
Definition: beamspotman.py:676
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:71
common.sgkey
def sgkey(tool)
Definition: common.py:1028
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
HLTNavDetails::IHolder::serialize
virtual bool serialize(std::vector< uint32_t > &output) const
serializes this Holder
Definition: Holder.cxx:62
HLT::BaseHolder::label
virtual const std::string & label() const =0
HLTNavDetails::IHolder::deserializeDynVars
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
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
CxxUtils::ClassName::Rules::add
void add(const ClassName &pattern, const ClassName &replacement)
Add a new transformation rule.
Definition: ClassName.cxx:60
HLTNavDetails::IHolder::label
const std::string & label() const
returns the label of objects stores by this holder
Definition: Holder.h:85
DataBucketBase
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
Definition: DataBucketBase.h:24
HLTNavDetails::IHolder::typeName
virtual const std::string & typeName() const =0
returns the object's name stored by this holder
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:640
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:396
xAOD::AuxContainerBase
Common base class for the auxiliary containers.
Definition: AuxContainerBase.h:59
CaloClusterListBadChannel.cls
cls
Definition: CaloClusterListBadChannel.py:8
HLTNavDetails::IHolder::m_serializer
ToolHandle< ITrigSerializerToolBase > m_serializer
Serializer tool; used for dynamic variables.
Definition: Holder.h:247
HLTNavDetails::IHolder::m_label
std::string m_label
label given to the objects in this holder (labels given at attachFeature)
Definition: Holder.h:242
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::IAuxStoreIO::getIOType
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.
HLTNavDetails::IHolder::m_storeGate
HLT::AccessProxy * m_storeGate
pointer to SG
Definition: Holder.h:163
HLTNavDetails::IHolder::m_aux
ITypeProxy * m_aux
Definition: Holder.h:166
SG::IAuxStoreIO
Interface providing I/O for a generic auxiliary store.
Definition: IAuxStoreIO.h:44
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
HLTNavDetails::IHolder::syncWithSG
virtual bool syncWithSG(SG::OwnershipPolicy policy=SG::OWN_ELEMENTS)=0
SG::AuxTypeRegistry
Handle mappings between names and auxid_t.
Definition: AuxTypeRegistry.h:61
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
HLTNavDetails::IHolder::m_prefix
std::string m_prefix
prefix for key given to the objects
Definition: Holder.h:241
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::getDynamicAuxID
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.
Definition: getDynamicAuxID.cxx:64
HLTNavDetails::IHolder::m_objectserializerSvc
IConversionSvc * m_objectserializerSvc
pointer to object serializer
Definition: Holder.h:162
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:27
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HLTNavDetails::IHolder::setAuxDataObject
virtual bool setAuxDataObject(DataObject *dobjaux)=0
sel
sel
Definition: SUSYToolsTester.cxx:97
HLTNavDetails::IHolder::getAuxDataObject
virtual DataObject * getAuxDataObject()=0
asg::AsgMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AsgMessaging.cxx:49
CxxUtils::ClassName::Rules::apply
std::string apply(const std::string &name) const
Apply transformations to a class name.
Definition: ClassName.cxx:127
HLT::class_id_type
uint32_t class_id_type
Definition: Trigger/TrigEvent/TrigNavStructure/Root/Types.h:11
HLTNavDetails::IHolder::m_readonly
bool m_readonly
Definition: Holder.h:165
CxxUtils::ClassName::Rules
A set of transformation rules to use with ClassName.
Definition: CxxUtils/CxxUtils/ClassName.h:130
SG::IAuxStoreIO::getDynamicAuxIDs
virtual const SG::auxid_set_t & getDynamicAuxIDs() const =0
Get the list of all dynamically created variables.
HLTNavDetails::IHolder::m_logger
const asg::AsgMessaging * m_logger
Definition: Holder.h:161
StoreGateSvc::transientContains
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...
SG::IAuxStoreHolder::setStore
virtual void setStore(IAuxStore *store)=0
Give an auxiliary store object to the holder object.
merge.output
output
Definition: merge.py:17
HLTNavDetails::IHolder::setDataObject
virtual bool setDataObject(DataObject *dobj)=0
HLTNavDetails::IHolder::getDataObject
virtual DataObject * getDataObject()=0
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
HLT::StringSerializer::deserialize
std::size_t deserialize(std::vector< uint32_t >::const_iterator first, std::vector< uint32_t >::const_iterator last, std::vector< std::string > &strings)
Definition: TrigEvent/TrigNavStructure/Root/StringSerializer.cxx:66
SG::IAuxStoreIO::getIOData
virtual const void * getIOData(SG::auxid_t auxid) const =0
Return a pointer to the data to be stored for one aux data item.
HLTNavDetails::IHolder::serializePayload
bool serializePayload(std::vector< uint32_t > &dataBlob, const xAOD::AuxSelection &sel)
serializes the payload of this Holder
Definition: Holder.cxx:254
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
HLTNavDetails::IHolder::collectionName
virtual const std::string & collectionName() const =0
returns the collection's name stored by this holder
SG::IAuxStore
Interface for non-const operations on an auxiliary store.
Definition: IAuxStore.h:48
get_generator_info.version
version
Definition: get_generator_info.py:33
HLTNavDetails::IHolder::msg
MsgStream & msg() const
Definition: Holder.h:169
HLTNavDetails::IHolder::typeClid
virtual CLID typeClid() const =0
returns the CLID of objects stores by this holder
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
HLTNavDetails::IHolder::m_uniqueCounter
int m_uniqueCounter
Definition: Holder.h:244
DeMoScan.first
bool first
Definition: DeMoScan.py:536
HLTNavDetails::IHolder::subTypeIndex
uint16_t subTypeIndex() const
returns the index (short number used when linking object to the TE) of objects stores by this holder
Definition: Holder.h:111
HLTNavDetails::IHolder::auxClidOrZero
virtual CLID auxClidOrZero() const =0
TrigStreamAddress
IOpaqueAddress for TrigSerializenCnvSvc.
Definition: TrigStreamAddress.h:23
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
RootUtils::Type
Wrapper for ROOT types.
Definition: Type.h:40
DataBucketBase::relinquish
virtual void relinquish()=0
Give up ownership of the DataBucket contents.
SG::auxid_set_t
A set of aux data identifiers.
Definition: AuxTypes.h:47
HLTNavDetails::IHolder::key
virtual const std::string & key() const =0
returns the containers StoreGate key
HLTNavDetails::IHolder::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
python.PyAthena.obj
obj
Definition: PyAthena.py:132
SG::IAuxStoreHolder
Interface for objects taking part in direct ROOT I/O.
Definition: IAuxStoreHolder.h:36
HLTNavDetails::IHolder::serializeDynVars
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
python.compressB64.c
def c
Definition: compressB64.py:93
python.iconfTool.gui.pad.logger
logger
Definition: pad.py:14
HLTNavDetails::IHolder::getElementType
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
HLTNavDetails::IHolder::prefix
virtual const std::string & prefix() const
returns the containers StoreGate prefix
Definition: Holder.h:90