ATLAS Offline Software
NavigationCore.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include <sstream>
6 #include <iostream>
7 #include <algorithm>
8 
9 #include "GaudiKernel/IConversionSvc.h"
12 #include "CxxUtils/crc64.h"
14 
16 
19 
22 #include <unordered_map>
23 
24 
25 using namespace HLT;
26 using namespace HLTNavDetails;
27 
28 template<typename T>
29 std::ostream& operator<<( std::ostream& s, const std::vector<T>& v)
30 {
31  s<< "[";for(auto i:v){s << i << ", ";} s << "]";
32  return s;
33 }
34 
36  : TrigNavStructure(),
37  m_serializerSvc(nullptr),
38  m_storeGate(nullptr),
39  m_objectsKeyPrefix("HLT"),
40  m_objectsIndexOffset(0),
41  m_holderfactory(nullptr),
42  m_logger(logger)
43 {
44 }
45 
46 /*****************************************************************************
47  *
48  * PRETTY PRINTING
49  *
50  *****************************************************************************/
51 
52 MsgStream& HLT::operator<< ( MsgStream& m, const NavigationCore& nav ) {
53  std::string str;
54  nav.printASCIIArt(str);
55 
56  m << str;
57  return m;
58 }
59 
60 bool NavigationCore::extractBlob(const std::vector<uint32_t>& input, std::vector<uint32_t>::const_iterator& it, std::vector<uint32_t>& blob) const {
61  blob.clear();
62  if ( it == input.end() )
63  return false;
64 
65  unsigned sizeOfBlob = *it;
66  std::vector<uint32_t>::const_iterator begin = it;
67  ++begin;
68  std::vector<uint32_t>::const_iterator end = it;
69  ++end;
70  advance(end, sizeOfBlob);
71  if ( end <= input.end()) {
72  blob.reserve(end-begin);
73  blob.insert(blob.end(), begin, end);
74  it = end; // update iterator
75  return true;
76  }
77  return false; // failed to get blob
78 }
79 
80 
81 bool NavigationCore::serialize( std::vector<uint32_t>& output) const {
82  std::vector<unsigned int> cuts;
83  return serialize(output,cuts);
84 }
85 
86 bool NavigationCore::serialize( std::vector<uint32_t>& output, std::vector<unsigned int>& cuts ) const {
87  std::vector<std::pair<CLID, std::string> > clid_name;
88  clid_name.clear();
89  return serialize(output, cuts, clid_name);
90 }
91 
92 bool NavigationCore::serialize( std::vector<uint32_t>& output, std::vector<unsigned int>& cuts, std::vector<std::pair<CLID, std::string> >& clid_name ) const {
93  std::vector<uint32_t> holderdata;
94  std::vector<unsigned int> holderblobsizes;
95 
96  std::lock_guard<std::recursive_mutex> lock(getMutex());
97  const TrigHolderStructure& holderstorage = getHolderStorage();
98 
99  bool status = false;
100  if ( m_classesToPayload.empty() ) { // this is offline case
101  status = serializeHoldersWithoutPayload(holderstorage.getAllHolders<IHolder>(),holderdata, holderblobsizes, clid_name);
102  } else { // this is online case when list of classes to payload is not empty
103  status = serializeHoldersWithPayload(m_classesToPayload,holderdata,holderblobsizes,clid_name);
104  }
105 
106  if(!status){
107  ATH_MSG_WARNING("holder serialization failed");
108  return false;
109  }
110 
111  status = serializeWithHolderSection(holderdata,holderblobsizes,output,cuts,clid_name);
112 
113  if(!status){
114  ATH_MSG_WARNING("full serialization failed");
115  return false;
116  }
117 
118  ATH_MSG_DEBUG("total size of serialized navigation: " << output.size());
119 
120  return true;
121 }
122 
123 bool NavigationCore::serialize_DSonly( std::vector<uint32_t>& output, std::vector<unsigned int>& cuts, std::vector<std::pair<CLID, std::string> >& clid_name ) const {
124  std::vector<uint32_t> holderdata;
125  std::vector<unsigned int> holderblobsizes;
126 
127  bool status = serializeHoldersWithPayload(m_classesToPayload_DSonly,holderdata,holderblobsizes,clid_name);
128  if(!status){
129  ATH_MSG_WARNING("holder serialization failed");
130  return false;
131  }
132 
133  status = serializeWithHolderSection(holderdata,holderblobsizes,output,cuts,clid_name);
134  if(!status){
135  ATH_MSG_WARNING("full serialization failed");
136  return false;
137  }
138 
139  ATH_MSG_DEBUG("total size of serialized navigation (DS only): " << output.size());
140 
141  return true;
142 }
143 
144 
145 /*****************************************************************************
146  *
147  * DESERIALIZATION
148  *
149  *****************************************************************************/
150 
151 bool NavigationCore::deserialize( const std::vector<uint32_t>& input ) {
152  std::lock_guard<std::recursive_mutex> lock(getMutex());
153  TrigHolderStructure& holderstorage = getHolderStorage();
154 
155  std::vector<uint32_t>::const_iterator inputIt = input.begin();
156 
157  ATH_MSG_DEBUG("deserialize: deserializing input of size: " << input.size());
158 
159 
160  if (input.size()==0) {
161  ATH_MSG_WARNING("Cannot work on empty payload");
162  return false;
163  }
164  unsigned int version = *inputIt++; // ignore version
165 
166  ATH_MSG_DEBUG("deserialize: the serialized input has versions " << version);
167 
168  if ( version != 3 and version !=4 ) {
169  ATH_MSG_WARNING("No backward compatibility beyond version 3 possible; data was serialized with V: " << version
170  << " while we are in version 4");
171  return true;
172  }
173  ATH_MSG_DEBUG("deserialize: deserialization of Navigation version: " << version);
174 
175  unsigned int totalSize = *inputIt++; // total size
176  if ( totalSize != input.size() )
177  ATH_MSG_WARNING("deserialize: the navigation is truncated: " << input.size()
178  << " while should be: " << totalSize );
179 
180  if ( input.size() == 2 ) { // there was only space for version and size
181  ATH_MSG_WARNING("deserialize: the navigation is truncated badly, no recovery possible " );
182  return false;
183  }
184 
185  bool tesDeserializationStatus = deserializeTEs(inputIt,input.size());
186  ATH_MSG_DEBUG("deserialize: TEs structure unpacked, status: " << tesDeserializationStatus );
187 
188 
189  ATH_MSG_DEBUG("do we have holder payload? " << (inputIt != input.end()));
190 
191  // Keep track of blobs we've deserialized for each event.
192  struct DeserializedMemo
193  {
194  std::mutex m_mutex;
195  EventContext::ContextEvt_t m_evt;
196  std::unordered_map<uint64_t, std::shared_ptr<HLT::BaseHolder>> m_holders;
197  };
199 
200  const EventContext& ctx = Gaudi::Hive::currentContext();
201  DeserializedMemo& memo = *memos.get (ctx);
202  std::scoped_lock memolock (memo.m_mutex);
203  if (memo.m_evt != ctx.evt()) {
204  memo.m_holders.clear();
205  memo.m_evt = ctx.evt();
206  }
207 
208  // EOF TEs deserialization
209  // deserialize Features
210  std::vector<uint32_t>::const_iterator it = inputIt;
211  std::vector<uint32_t> blob;
212  while ( extractBlob(input, it, blob) ) {
213  // Skip this blob if we've already deserialized it.
214  // See ATLASRECTS-6278, ATEAM-734 and ATR-25282
215  uint64_t hash = CxxUtils::crc64 ((const char*)blob.data(),
216  blob.size()*sizeof(*blob.data()));
217 
218  auto& holder = memo.m_holders[hash]; // ref(!) to empty or existing holder pointer
219  if (! holder ) {
220  ATH_MSG_DEBUG("deserializing holder blob with size/hash " << blob.size() << "/" << hash);
221  holder = std::shared_ptr<HLT::BaseHolder>(m_holderfactory->fromSerialized(version,blob.begin(),blob.end()));
222  if (! holder ) continue; // error during deserialization
223  } else {
224  ATH_MSG_DEBUG("blob with size/hash " << blob.size() << "/" << hash
225  << " already deserialized; re-using holder");
226  }
227 
228  if(!holderstorage.registerHolder(holder)){
229  ATH_MSG_WARNING("deserialize: holder registration for holder with clid: " << holder->typeClid() << " and label: " << holder->label() << " failed.");
230  }
231  }
232  return true;
233 }
234 
236  std::lock_guard<std::recursive_mutex> l2lock(l2.getMutex());
237  const TrigHolderStructure& l2Holderstorage = l2.getHolderStorage();
238 
239  // we need to pick the holders which are at L2 and move them to EF
240  for(auto l2holder : l2Holderstorage.getAllHolders<IHolder>()){
241  ATH_MSG_DEBUG("will add holder " << *l2holder);
242  std::string label(l2holder->label());
243  IHolder* efholder = getHolder(l2holder->typeClid(), label);
244  if ( efholder != 0 ) {
245  if ( (efholder->label() != l2holder->label())
246  || (efholder->subTypeIndex() != l2holder->subTypeIndex()) ) {
247 
248  ATH_MSG_DEBUG("fixing bug for " << *efholder);
249  // bug which we need to fix (some week of data in autumn 2008)
250  // we have to delete current holder
251  // and replace it by L2 one
252  //
253  // efholder->setSubTypeIndex(l2holder->subTypeIndex());
254 
255  ATH_MSG_DEBUG("after fixing " << *efholder);
256  }
257  } else {
258  ATH_MSG_DEBUG("cloning the holder from L2 " << *l2holder);
259 
260  bool status = createHolder(efholder, l2holder->typeClid(),l2holder->label(), l2holder->subTypeIndex());
261  if(!status){
262  ATH_MSG_WARNING("in merge could not create EF holder");
263  }
264 
265  //not sure if there is any possibility for this case but check anyways -Lukas
266  if(efholder->key()!=l2holder->key()){
267  ATH_MSG_WARNING("in merge the created EF holder has different SG access key than L2 holder we tried to copy");
268  }
269 
270  registerHolder(efholder);
271  }
272  }
273  return true;
274 }
275 
276 /*****************************************************************************
277  *
278  * very important RESET
279  *
280  *****************************************************************************/
281 void NavigationCore::reset(bool inFinalize) {
282  TrigNavStructure::reset(inFinalize);
283 
284  ATH_MSG_DEBUG("Navigation reset done");
285 }
286 
287 uint16_t NavigationCore::nextSubTypeIndex(CLID clid, const std::string& /*label*/) const {
288  std::lock_guard<std::recursive_mutex> lock(getMutex());
289  const TrigHolderStructure& holderstorage = getHolderStorage();
290 
291  auto holders = holderstorage.getHoldersOfClid(clid);
292 
293  if ( holders.empty() )
294  return m_objectsIndexOffset;
295 
296  std::vector<sub_index_type> sub_indices(holders.size());
297  std::transform(holders.begin(), holders.end(), sub_indices.begin(),
298  [](BaseHolder* h) -> sub_index_type { return h->subTypeIndex(); });
299 
300  return (*std::max_element(sub_indices.begin(),sub_indices.end()))+1;
301 }
302 
304 
305  ATH_MSG_VERBOSE("NavigationCore::prepare preregistering objects of clid: " << clid << " label: " << label);
306  IHolder *holder = getHolder(clid, label);
307  if ( holder ) {
308  ATH_MSG_VERBOSE("NavigationCore::prepare preregistering objects not executed as it already exists " << *holder);
309  return holder;
310  }
311 
313  ATH_MSG_VERBOSE("NavigationCore::prepare creating handler for type (CLID): " << clid
314  << " label: " << label << " index: " << index);
315 
316  if ( !createHolder(holder, clid, label, index) ) {
317  ATH_MSG_INFO("NavigationCore::prepare Can't create storage for objects of CLID: " << clid << " as it is requested by configuration");
318  return nullptr;
319  }
320 
321  ATH_MSG_VERBOSE("Holder created, registering " << holder << " " << *holder);
322 
323  if ( !registerHolder(holder) ) {
324  ATH_MSG_WARNING("Holder registration failed " << holder << " " << *holder);
325  return nullptr;
326  }
327  if ( !holder->syncWithSG() ) {
328  ATH_MSG_WARNING("Holder SG sync failed" << holder << " " << *holder);
329  return nullptr;
330  }
331 
332  return holder;
333 }
334 
336  if ( msgLvl(MSG::VERBOSE) ) {
337  for ( const auto& [clid, holder] : HLT::TypeMaps::holders() ) {
338  ATH_MSG_VERBOSE("NavigationCore::prepare Compile time known types : " << *holder);
339  }
340  }
341 
342  ATH_MSG_VERBOSE("NavigationCore::prepare Preregistering objects #:" << m_classesToPreregister.size());
343 
344  // populate structure with "must have" features
345  for ( const CSPair& conf : m_classesToPreregister ) {
346  CLID clid = conf.first;
347  std::string label = conf.second;
348  if ( prepareOneHolder(clid, label) == 0 ) {
349  ATH_MSG_WARNING("NavigationCore::prepare failed preparing the holder for CLID: " << clid << " and label " << label);
350  }
351  }
352  ATH_MSG_DEBUG("NavigationCore::prepare Navigation structure prepared for next event");
353 }
354 
356  std::lock_guard<std::recursive_mutex> lock(getMutex());
357  TrigHolderStructure& holderstorage = getHolderStorage();
358 
359  auto shared_holder = std::shared_ptr<HLT::BaseHolder>(holder);
360  holderstorage.registerHolder(shared_holder);
361  ATH_MSG_DEBUG("registerHolder for OK " << *holder);
362  return true;
363 }
364 
365 bool NavigationCore::createHolder( IHolder*& holder, CLID clid, const std::string& label, uint16_t index) const {
366  ATH_MSG_DEBUG("createHolder: creating holder for CLID: " << clid << " label: " << label << " and index: " << index);
367  //reset holder
368  holder = 0;
369  auto baseholder = m_holderfactory->createHolder(clid,label, index);
370  if(!baseholder){
371  ATH_MSG_ERROR("createHolder: creation of holder for CLID: " << clid << " label: " << label << " and index: " << index << " failed");
372  }
373 
374  holder = dynamic_cast<IHolder*>(baseholder);
375 
376  if(!holder){
377  ATH_MSG_ERROR("createHolder: cast to IHolder* failed");
378  }
379 
380  return true;
381 }
382 
383 IHolder* NavigationCore::getHolder(CLID clid, uint16_t subTypeIndex) const {
384  std::lock_guard<std::recursive_mutex> lock(getMutex());
385  const TrigHolderStructure& holderstorage = getHolderStorage();
386 
387  return holderstorage.getHolder<IHolder>(clid, subTypeIndex);
388 }
389 
390 IHolder* NavigationCore::getHolder(CLID clid, const std::string& label) const {
391  std::lock_guard<std::recursive_mutex> lock(getMutex());
392  const TrigHolderStructure& holderstorage = getHolderStorage();
393 
394  return holderstorage.getHolder<IHolder>(clid, label);
395 }
396 
397 uint32_t NavigationCore::string2hash( const std::string& s, const std::string& category) {
399 }
400 
401 void NavigationCore::getAllOfType ( const std::string& id, std::vector< HLT::TriggerElement* >& output,
402  const bool activeOnly) const {
403  if ( id == "" )
404  return getAll(output, activeOnly);
405 
406  return TrigNavStructure::getAllOfType( string2hash(id, "TE"), output, activeOnly);
407 }
408 
409 
411  const index_or_label_type& index_or_label,
412  bool only_single_feature,
413  TriggerElement::FeatureVec& features,
414  bool travel_backward_recursively,
415  const TriggerElement*& source,
416  std::string& sourcelabel) const {
417 
418  return TrigNavStructure::getFeatureAccessors(te,clid,index_or_label,only_single_feature,features,travel_backward_recursively,source,sourcelabel);
419 }
420 
422  const index_or_label_type& index_or_label,
423  bool only_single_feature,
424  TriggerElement::FeatureVec& features,
425  const TriggerElement*& source,
426  std::string& sourcelabel ) const {
427 
428  bool status = TrigNavStructure::getFeatureAccessorsSingleTE(te,clid,index_or_label,only_single_feature,features,source,sourcelabel);
429 
430  //if query was via subindex we don't cache the query (no support yet)
431  if(index_or_label.index() == 0) return status;
432 
433  return status;
434 }
435 
436 bool NavigationCore::serializeWithHolderSection(const std::vector<uint32_t>& holderdata, const std::vector<unsigned int>& holderblobsizes, std::vector<uint32_t>& output,
437  std::vector<unsigned int>& cuts ,std::vector<std::pair<CLID, std::string> >& /*clid_name*/) const {
438  cuts.clear();
439  // clid_name.clear(); Don't reset this vector here since the vector is not remade. Otherwise datascouting stops working.
440 
441  unsigned int version=4;
442  ATH_MSG_DEBUG("NavigationCore::serialize: serializing with version " << version);
443 
444  output.push_back(version);
445 
446  unsigned int totalSizeIndex = output.size();
447  output.push_back(0); // reserve one word (accessible under the index totalSize), it is 0 if there was truncation here
448  // and != output.size() if truncation using cuts
449 
450  cuts.push_back(output.size()); // mark a cut place
451 
452  bool tesSerializationStatus = serializeTEs(output);
453 
454  ATH_MSG_DEBUG("serializes: TE serialization status: " << tesSerializationStatus << " size: " << output.size());
455 
456  cuts.push_back(output.size()); // mark a cut place
457 
458  output.insert(output.end(),holderdata.begin(),holderdata.end());
459 
460  for(auto hc : holderblobsizes){cuts.push_back(cuts.back()+hc);}
461 
462  output[totalSizeIndex] = output.size();
463 
464  ATH_MSG_DEBUG("serialization done");
465  return true;
466 }
467 
468 bool NavigationCore::serializeHoldersWithPayload(const std::vector<CSPair>& payload, std::vector<uint32_t>& output,
469  std::vector<uint32_t>& holderblobsizes,
470  std::vector<std::pair<CLID, std::string> >& clid_name) const {
471 
472  ATH_MSG_DEBUG("serialization: number of classes to payload: " << payload.size());
473  for ( auto& cl : payload) {
474  ATH_MSG_DEBUG("serialization (ordered) of featue attempting : " << cl.first << " " << cl.second);
475 
476  IHolder *holder = getHolder(cl.first,cl.second);
477  if ( ! holder ) {
478  ATH_MSG_DEBUG("serialization (ordered) of feature skipped, nothing know on this objects" );
479  continue;
480  }
481  ATH_MSG_DEBUG("serialization (ordered) of feature: " << holder->typeClid() << " label: " << holder->label()
482  << " size of payload up to now: " << output.size());
483 
484  std::vector<uint32_t> holderblob;
485  size_t payloadsize = 0;
486  bool status = holder->serializeWithPayload(cl.sel,holderblob,payloadsize);
487  if(!status){
488  ATH_MSG_WARNING("problem serializing holder: " << *holder);
489  return false;
490  }
491 
492  output.push_back(holderblob.size()); //leading bit indicates size
493  output.insert(output.end(),holderblob.begin(),holderblob.end());
494 
495  holderblobsizes.push_back(1+holderblob.size()); //one for leading size bit
496  clid_name.push_back(std::pair < CLID, std::string> (holder->typeClid(), holder->label()));
497  }
498 
499  return true;
500 }
501 
502 bool NavigationCore::serializeHoldersWithoutPayload(const std::vector<IHolder*>& holders, std::vector<uint32_t>& output, std::vector<uint32_t>& holderblobsizes, std::vector<std::pair<CLID, std::string> >& clid_name) const {
503  for(auto& holder : holders){
504  ATH_MSG_DEBUG("serialization of feature: " << holder->typeClid() << " label: " << holder->label()
505  << " size of payload: " << output.size());
506 
507  std::vector<uint32_t> holderblob;
508  bool status = holder->serialize(holderblob);
509  if(!status){
510  ATH_MSG_WARNING("problem serializing holder: " << *holder);
511  return false;
512  }
513  output.push_back(holderblob.size()); //leading bit indicates size
514  output.insert(output.end(),holderblob.begin(),holderblob.end());
515 
516  holderblobsizes.push_back(1+holderblob.size()); //one for leading size bit
517  clid_name.push_back(std::pair < CLID, std::string> (holder->typeClid(), holder->label()));
518  }
519  return true;
520 }
HLT::NavigationCore::prepareOneHolder
HLTNavDetails::IHolder * prepareOneHolder(CLID clid, const std::string &label)
Definition: NavigationCore.cxx:303
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
HLT::TrigNavStructure::getAll
void getAll(std::vector< TriggerElement * > &output, const bool activeOnly=true) const
The query returning a collection of all TriggerElements.
Definition: TrigNavStructure.cxx:363
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
HLTNavDetails
Definition: Holder.cxx:118
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
HLTNavDetails::IHolder::label
const std::string & label() const
returns the label of objects stores by this holder
Definition: Holder.h:85
HLT::TrigNavStructure::getAllOfType
void getAllOfType(const te_id_type id, std::vector< TriggerElement * > &output, const bool activeOnly=true) const
The query returning a collection of all TriggerElements if name is given.
Definition: TrigNavStructure.cxx:344
HLT::TrigNavStructure::label
std::string label(class_id_type clid, const index_or_label_type &sti_or_label) const
Definition: TrigNavStructure.cxx:775
HLT::NavigationCore::m_objectsIndexOffset
unsigned m_objectsIndexOffset
small integer used to generate sub type index
Definition: NavigationCore.h:372
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
DataBucketBase.h
index
Definition: index.py:1
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
HLT::TrigNavStructure::printASCIIArt
void printASCIIArt(std::string &str, const TriggerElement *te=0, int offset=0) const
pretty printing of the navigational structure (heavy)
Definition: TrigNavStructure.cxx:152
HLT::NavigationCore::serialize_DSonly
bool serialize_DSonly(std::vector< uint32_t > &output, std::vector< unsigned int > &cuts, std::vector< std::pair< CLID, std::string > > &clid_name) const
Definition: NavigationCore.cxx:123
HLT::NavigationCore::extractBlob
bool extractBlob(const std::vector< uint32_t > &input, std::vector< uint32_t >::const_iterator &it, std::vector< uint32_t > &blob) const
Definition: NavigationCore.cxx:60
HLT::TrigHolderStructure
Definition: TrigHolderStructure.h:21
HLT::TriggerElement::FeatureVec
std::vector< FeatureAccessHelper > FeatureVec
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:233
HLT::TrigNavStructure::getMutex
std::recursive_mutex & getMutex()
Definition: TrigNavStructure.h:371
HLT::NavigationCore::deserialize
bool deserialize(const std::vector< uint32_t > &input)
Definition: NavigationCore.cxx:151
HLT::NavigationCore::getFeatureAccessors
virtual bool getFeatureAccessors(const TriggerElement *te, class_id_type clid, const index_or_label_type &index_or_label, bool only_single_feature, TriggerElement::FeatureVec &features, bool travel_backward_recursively, const TriggerElement *&source=m_unspecifiedTE, std::string &sourcelabel=m_unspecifiedLabel) const
retrieve features accessors according to the requrements This method is actually workhorse for all ab...
Definition: NavigationCore.cxx:410
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:423
HLT::TypeMaps::holders
static const CLIDtoHolderMap & holders()
Definition: TypeMaps.h:30
HLT::TrigNavStructure::getFeatureAccessorsSingleTE
virtual bool getFeatureAccessorsSingleTE(const TriggerElement *te, class_id_type clid, const index_or_label_type &index_or_label, bool only_single_feature, TriggerElement::FeatureVec &features, const TriggerElement *&source, std::string &sourcelabel) const
Definition: TrigNavStructure.cxx:810
HLT::TrigNavStructure::reset
virtual void reset(bool inFinalize=false)
resets all the navigation, goes to the factory and asks to withdraw all produced objects
Definition: TrigNavStructure.cxx:756
HLT::NavigationCore::string2hash
static uint32_t string2hash(const std::string &, const std::string &category="TE")
convert strin g to hash.
Definition: NavigationCore.cxx:397
HLT::TrigHolderStructure::getHoldersOfClid
std::vector< HolderType * > getHoldersOfClid(class_id_type clid) const
Definition: TrigHolderStructure.h:51
HLT::NavigationCore::merge
bool merge(const NavigationCore &l2)
attemtps to merge two trees
Definition: NavigationCore.cxx:235
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
HLT::TrigNavStructure
Definition: TrigNavStructure.h:40
HLT::NavigationCore::createHolder
bool createHolder(HLTNavDetails::IHolder *&holder, CLID clid, const std::string &label, uint16_t idx) const
creates holder for type given by CLID
Definition: NavigationCore.cxx:365
HLT::TrigHolderStructure::registerHolder
bool registerHolder(const std::shared_ptr< BaseHolder > &holder)
Definition: TrigHolderStructure.cxx:34
HLT::TrigNavStructure::getFeatureAccessors
virtual bool getFeatureAccessors(const TriggerElement *te, class_id_type clid, const index_or_label_type &index_or_label, bool only_single_feature, TriggerElement::FeatureVec &features, bool travel_backward_recursively, const TriggerElement *&source=m_unspecifiedTE, std::string &sourcelabel=m_unspecifiedLabel) const
Definition: TrigNavStructure.cxx:842
HLT::NavigationCore::reset
virtual void reset(bool inFinalize=false)
resets all the navigation, goes to the factory and asks to withdraw all produced objects
Definition: NavigationCore.cxx:281
HLT::NavigationCore::prepare
virtual void prepare()
prepapres the navigation for next event
Definition: NavigationCore.cxx:335
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TriggerElement.h
HLT::NavigationCore::getHolder
HLTNavDetails::Holder< T > * getHolder(uint16_t subTypeIndex) const
as above but does not create holder on demand (return 0 if not found)
HLTNavDetails::IHolder::syncWithSG
virtual bool syncWithSG(SG::OwnershipPolicy policy=SG::OWN_ELEMENTS)=0
HLT::operator<<
MsgStream & operator<<(MsgStream &m, const Navigation &nav)
Definition: Navigation.cxx:168
HLT::NavigationCore
The NavigationCore class, adds on top of the TrigNavStructure the EDM read-only handling.
Definition: NavigationCore.h:96
HLT::NavigationCore::NavigationCore
NavigationCore(const AthAlgTool &logger)
constructor with parent AlgTool for printing
Definition: NavigationCore.cxx:35
HLT::NavigationCore::m_classesToPayload
std::vector< CSPair > m_classesToPayload
classess are put to payload according to that priority list (CLID + key)
Definition: NavigationCore.h:389
python.ConfigurableDb.conf
def conf
Definition: ConfigurableDb.py:282
SG::SlotSpecificObj
Maintain a set of objects, one per slot.
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:70
skel.l2
l2
Definition: skel.GENtoEVGEN.py:426
HLT::TrigNavStructure::deserializeTEs
bool deserializeTEs(std::vector< uint32_t >::const_iterator &start, unsigned int totalSize)
Definition: TrigNavStructure.cxx:264
HLT::NavigationCore::serializeHoldersWithPayload
bool serializeHoldersWithPayload(const std::vector< CSPair > &payload, std::vector< uint32_t > &output, std::vector< uint32_t > &holderblobsizes, std::vector< std::pair< CLID, std::string > > &clid_name) const
Definition: NavigationCore.cxx:468
HLT::TrigNavStructure::serializeTEs
bool serializeTEs(std::vector< uint32_t > &output) const
method serizlizes the navigation structure
Definition: TrigNavStructure.cxx:217
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
HLTUtils.h
TrigConf::HLTUtils::string2hash
static HLTHash string2hash(const std::string &, const std::string &category="TE")
hash function translating TE names into identifiers
TrigStreamAddress.h
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
HLT::index_or_label_type
std::variant< sub_index_type, std::string > index_or_label_type
Definition: Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/Types.h:16
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
lumiFormat.i
int i
Definition: lumiFormat.py:92
HLT::NavigationCore::m_holderfactory
ITrigHolderFactory * m_holderfactory
Definition: NavigationCore.h:375
h
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ReweightUtils.category
category
Definition: ReweightUtils.py:15
HLT::TriggerElement
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:27
NavigationCore.h
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
plotBeamSpotVert.cuts
string cuts
Definition: plotBeamSpotVert.py:93
HLT::TrigNavStructure::ATLAS_THREAD_SAFE
static const TriggerElement *m_unspecifiedTE ATLAS_THREAD_SAFE
Definition: TrigNavStructure.h:377
HLT::NavigationCore::nextSubTypeIndex
uint16_t nextSubTypeIndex(CLID clid, const std::string &label) const
Definition: NavigationCore.cxx:287
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
HLT::TrigNavStructure::getHolderStorage
TrigHolderStructure & getHolderStorage()
Definition: TrigNavStructure.h:370
HLT::BaseHolder
Definition: BaseHolder.h:14
HLT::class_id_type
uint32_t class_id_type
Definition: Trigger/TrigEvent/TrigNavStructure/Root/Types.h:11
HLT::NavigationCore::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: NavigationCore.h:411
HLT::sub_index_type
uint16_t sub_index_type
Definition: Trigger/TrigEvent/TrigNavStructure/Root/Types.h:9
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
CxxUtils::crc64
uint64_t crc64(const CRCTable &table, const char *data, size_t data_len)
Find the CRC-64 of a string,.
Definition: crc64.cxx:696
merge.output
output
Definition: merge.py:17
HLT::NavigationCore::getAllOfType
void getAllOfType(const std::string &id, std::vector< HLT::TriggerElement * > &output, const bool activeOnly=true) const
return trigger elements given the name of TEs
Definition: NavigationCore.cxx:401
HLT::NavigationCore::serializeWithHolderSection
bool serializeWithHolderSection(const std::vector< uint32_t > &holderdata, const std::vector< unsigned int > &holderblobsizes, std::vector< uint32_t > &output, std::vector< unsigned int > &cuts, std::vector< std::pair< CLID, std::string > > &clid_name) const
Definition: NavigationCore.cxx:436
HLT::ITrigHolderFactory::createHolder
virtual BaseHolder * createHolder(class_id_type clid, const std::string &label, sub_index_type index) const =0
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
HLT::NavigationCore::m_classesToPreregister
std::vector< CSPair > m_classesToPreregister
classes mentioned here will be put to SG irrespectively of thier presence in event
Definition: NavigationCore.h:397
HLT::NavigationCore::serialize
virtual bool serialize(std::vector< uint32_t > &output) const
method serizlizes the navigation structure The structure is serrizlized in following order ....
Definition: NavigationCore.cxx:81
HLT::NavigationCore::getFeatureAccessorsSingleTE
virtual bool getFeatureAccessorsSingleTE(const TriggerElement *te, CLID clid, const index_or_label_type &index_or_label, bool only_single_feature, TriggerElement::FeatureVec &features, const TriggerElement *&source=::HLT::TrigNavStructure::m_unspecifiedTE, std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
Definition: NavigationCore.cxx:421
python.PyAthena.v
v
Definition: PyAthena.py:157
get_generator_info.version
version
Definition: get_generator_info.py:33
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
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
Definition: Holder.h:58
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
HLT::NavigationCore::registerHolder
bool registerHolder(HLTNavDetails::IHolder *holder)
Definition: NavigationCore.cxx:355
SlotSpecificObj.h
Maintain a set of objects, one per slot.
str
Definition: BTagTrackIpAccessor.cxx:11
python.copyTCTOutput.totalSize
totalSize
Definition: copyTCTOutput.py:93
merge.status
status
Definition: merge.py:17
HLT::ITrigHolderFactory::fromSerialized
virtual BaseHolder * fromSerialized(int version, const std::vector< uint32_t >::const_iterator &start, const std::vector< uint32_t >::const_iterator &end)=0
HLT::TrigHolderStructure::getAllHolders
std::vector< HolderType * > getAllHolders() const
Definition: TrigHolderStructure.h:40
crc64.h
A crc-64 implementation, using pclmul where possible.
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
HLTNavDetails::IHolder::key
virtual const std::string & key() const =0
returns the containers StoreGate key
HLT::NavigationCore::m_classesToPayload_DSonly
std::vector< CSPair > m_classesToPayload_DSonly
classess are put to payload according to that priority list (CLID + key)
Definition: NavigationCore.h:392
AthAlgTool
Definition: AthAlgTool.h:26
HLT::TrigHolderStructure::getHolder
HolderType * getHolder(class_id_type clid, const std::variant< sub_index_type, std::string > &stiOrLabel) const
Definition: TrigHolderStructure.h:30
checker_macros.h
Define macros for attributes used to control the static checker.
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
HLT::NavigationCore::CSPair
Definition: NavigationCore.h:378
python.iconfTool.gui.pad.logger
logger
Definition: pad.py:14
CaloCondBlobAlgs_fillNoiseFromASCII.blob
blob
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:96
HLT::NavigationCore::serializeHoldersWithoutPayload
bool serializeHoldersWithoutPayload(const std::vector< HLTNavDetails::IHolder * > &holders, std::vector< uint32_t > &output, std::vector< uint32_t > &holderblobsizes, std::vector< std::pair< CLID, std::string > > &clid_name) const
Definition: NavigationCore.cxx:502
HLTNavDetails::IHolder::serializeWithPayload
bool serializeWithPayload(const xAOD::AuxSelection &sel, std::vector< uint32_t > &output, size_t &payloadsize)
serializes this Holder including payload
Definition: Holder.cxx:79
StringSerializer.h