ATLAS Offline Software
Public Types | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
xAOD::Experimental::REvent Class Reference

Tool for accessing xAOD files outside of Athena, version RNTuple. More...

#include <REvent.h>

Inheritance diagram for xAOD::Experimental::REvent:
Collaboration diagram for xAOD::Experimental::REvent:

Public Types

using sgkey_t = SG::sgkey_t
 

Public Member Functions

 REvent ()
 Default constructor. More...
 
virtual ~REvent ()
 Destructor. More...
 
template<typename T >
bool retrieve (const T *&obj, sgkey_t key=DEFAULT_KEY, bool silent=false)
 Function retrieving an object from the event (constant version) More...
 
template<typename T >
bool retrieve (const T *&obj, const std::string &key, bool silent=false)
 Function retrieving an object from the event (constant version) More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Static Public Attributes

static constexpr sgkey_t DEFAULT_KEY = ~static_cast<sgkey_t>(0)
 Key for retrieving the "default" object of a given type. More...
 
static constexpr sgkey_t KEY_MASK = DEFAULT_KEY >> 2
 Mask for the keys, used mostly internally. More...
 

Protected Types

using Object_t = std::unordered_map< std::string, std::unique_ptr< TVirtualManager > >
 Definition of the internal data structure type. More...
 

Protected Member Functions

bool contains (const std::string &key, const std::type_info &ti, bool metadata)
 Internal function checking if an object is in the input. More...
 
bool transientContains (const std::string &key, const std::type_info &ti, bool metadata) const
 Internal function checking if an object is already in memory. More...
 
void * getOutputObject (const std::string &key, const std::type_info &ti, bool metadata) const
 Function for retrieving an output object in a non-template way. More...
 
const void * getInputObject (const std::string &key, const std::type_info &ti, bool silent, bool metadata)
 Function for retrieving an input object in a non-template way. More...
 
StatusCode recordTypeless (void *obj, const std::string &typeName, const std::string &key, bool overwrite=false, bool metadata=true, bool isOwner=true)
 Internal function for recording an object into the output. More...
 

Protected Attributes

Object_t m_inputObjects
 Collection of all the managed input objects. More...
 
std::set< std::string > m_inputMissingObjects
 Objects that have been asked for, but were found to be missing in the current input. More...
 
Object_t m_outputObjects
 Collection of all the managed output object. More...
 
Object_t m_inputMetaObjects
 Collection of all the managed input meta-objects. More...
 
Object_t m_outputMetaObjects
 Collection of all the managed output meta-objects. More...
 
EventFormat m_inputEventFormat
 Format of the current input file. More...
 
EventFormatm_outputEventFormat = nullptr
 Format of the current output file. More...
 
std::unordered_map< std::string, std::set< std::string > > m_auxItemList
 Rules for selecting which auxiliary branches to write. More...
 
std::vector< TVirtualIncidentListener * > m_listeners
 Listeners who should be notified when certain incidents happen. More...
 
std::unordered_map< std::string, std::string > m_nameRemapping
 Container name re-mapping rules. More...
 
bool m_printEventProxyWarnings = false
 Option to silence common warnings that seem to be harmless. More...
 

Private Member Functions

StatusCode initStats ()
 Function to initialise the statistics for all Tree content. More...
 
StatusCode setUpDynamicStore (RObjectManager &mgr, ROOT::RNTupleReader &ntupleReader)
 event uses RNTupleReader: More...
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

std::unique_ptr< ROOT::RNTupleReader > m_eventReader
 The main event data reader. More...
 
bool m_inputNTupleIsMissing = false
 Whether the input has an event RNTuple or not. More...
 
std::unique_ptr< ROOT::RNTupleReader > m_metaReader
 The metadata reader. More...
 
::Long64_t m_entry
 The entry to look at from the input tree. More...
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 

Functions implementing the @c xAOD::TVirtualEvent interface

SG::sgkey_t getHash (const std::string &key) const override
 Function returning the hash describing an object name. More...
 
SG::sgkey_t getKey (const void *obj) const override
 Function returning the hash describing a known object. More...
 
const std::string & getName (const void *obj) const override
 Function returning the key describing a known object. More...
 
const std::string & getName (SG::sgkey_t hash) const override
 Function returning the key describing a known object. More...
 
void * getOutputObject (SG::sgkey_t key, const std::type_info &ti) override
 Function for retrieving an output object in a non-template way. More...
 
const void * getInputObject (SG::sgkey_t key, const std::type_info &ti, bool silent) override
 Function for retrieving an input object in a non-template way. More...
 

Variable(s) used in the @c IProxyDict implementation

using upgrade_mutex_t = AthContainers_detail::upgrade_mutex
 Mutex type for multithread synchronization. More...
 
using upgrading_lock_t = AthContainers_detail::upgrading_lock< upgrade_mutex_t >
 Lock type for multithread synchronization. More...
 
upgrade_mutex_t m_branchesMutex
 Mutex for multithread synchronization. More...
 
SG::SGKeyMap< BranchInfo > m_branches ATLAS_THREAD_SAFE
 Map from hashed sgkey to BranchInfo. More...
 

Detailed Description

Tool for accessing xAOD files outside of Athena, version RNTuple.

Proper access to xAOD files in ROOT (outside of Athena) needs to be done through such an object. It takes care of reading and writing xAOD files together with their file format metadata, setting up smart pointers correctly, etc.

Definition at line 28 of file REvent.h.

Member Typedef Documentation

◆ Object_t

using xAOD::Event::Object_t = std::unordered_map<std::string, std::unique_ptr<TVirtualManager> >
protectedinherited

Definition of the internal data structure type.

Definition at line 304 of file Event.h.

◆ sgkey_t

Definition at line 29 of file TVirtualEvent.h.

◆ upgrade_mutex_t

using xAOD::Event::upgrade_mutex_t = AthContainers_detail::upgrade_mutex
protectedinherited

Mutex type for multithread synchronization.

Definition at line 349 of file Event.h.

◆ upgrading_lock_t

Lock type for multithread synchronization.

Definition at line 351 of file Event.h.

Constructor & Destructor Documentation

◆ REvent()

xAOD::Experimental::REvent::REvent ( )

Default constructor.

Definition at line 73 of file REvent.cxx.

73 : Event("xAOD::Experimental::REvent") {}

◆ ~REvent()

xAOD::Experimental::REvent::~REvent ( )
virtual

Destructor.

Definition at line 75 of file REvent.cxx.

75  {
76 
77  // Clear the input and output objects before the input/output files would be
78  // closed. Otherwise we can be left with RNTuple view objects pointing
79  // nowhere.
80  m_inputObjects.clear();
81  m_outputObjects.clear();
82 }

Member Function Documentation

◆ addListener()

StatusCode Event::addListener ( TVirtualIncidentListener listener)
inherited

Register an incident listener object.

This function works pretty much like IIncidentSvc::addListener does in Athena.

It tells the TEvent object that when certain "interesting incidents" happen, a given object should be notified about it.

Parameters
listenerPointer to the object that should be notified
Returns
The usual StatusCode types

Definition at line 97 of file EventCore.cxx.

97  {
98 
99  // Check that we received a valid pointer:
100  if (listener == nullptr) {
101  ATH_MSG_ERROR("Received a null pointer for the listener");
102  return StatusCode::FAILURE;
103  }
104 
105  // Check whether we already have this listener.
106  auto itr = std::find(m_listeners.begin(), m_listeners.end(), listener);
107  if (itr != m_listeners.end()) {
108  ATH_MSG_WARNING("Listener " << static_cast<void*>(listener)
109  << " is already registered");
110  return StatusCode::SUCCESS;
111  }
112 
113  // Add the listener.
114  m_listeners.push_back(listener);
115 
116  // Return gracefully:
117  return StatusCode::SUCCESS;
118 }

◆ addNameRemap()

StatusCode Event::addNameRemap ( const std::string &  onfile,
const std::string &  newName 
)
inherited

Add a name re-mapping rule.

The names of containers can change during the lifetime of the experiment.

One such change happened after the DC14 exercise, when many containers got a new name. (Like "ElectronCollection" became simply "Electrons".)

This function allows us to create aliases with which certain containers should be accessible. So that the analyser would be able to access older files, while using the latest container name(s).

Parameters
onfileThe name of the container as it was saved into the input file
newNameThe alias with which the object/container should be accessible
Returns
The usual StatusCode types

Save the new name association:

Definition at line 162 of file EventCore.cxx.

163  {
164 
165  // Check if this name is known on the input or output already. As that's
166  // not good.
168  ATH_MSG_ERROR("Can't use \"" << newName << "\" as the target name in the \""
169  << onfile << "\" -> \"" << newName
170  << "\" remapping");
171  return StatusCode::FAILURE;
172  }
173 
174  // Check if this name was remapped to something already.
175  auto itr = m_nameRemapping.find(newName);
176  if (itr != m_nameRemapping.end()) {
177  ATH_MSG_WARNING("Overriding existing name remapping \""
178  << itr->second << "\" -> \"" << itr->first << "\" with: \""
179  << onfile << "\" -> \"" << newName << "\"");
180  }
181 
183  m_nameRemapping[newName] = onfile;
184 
185  // Return gracefully:
186  return StatusCode::SUCCESS;
187 }

◆ addToStore()

StatusCode Event::addToStore ( CLID  clid,
SG::DataProxy proxy 
)
overrideprotectedinherited

Add a new proxy to the store.

Smart pointers to objects that don't exist in the input event, can end up calling this function.

In this case warn the user that something fishy is happening, and take posession of the received proxy.

Parameters
clidThe CLID of the type. Not taken into account.
proxyThe proxy to take posession of. Not used for anything useful.

Definition at line 249 of file EventIProxyDict.cxx.

249  {
250 
252 
253  // Warn the user that the function got called:
254  static std::atomic_flag warningPrinted ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT;
255  if (!warningPrinted.test_and_set() && m_printEventProxyWarnings) {
257  "Function should only be called through an invalid ElementLink");
258  }
259 
260  // Hold on to the proxy with some non-existent, hopefully unique key:
261  const ::TString uniqueKey =
262  ::TString::Format("NonExistentKey_%lu", m_branches.size());
263  BranchInfo bi;
264  bi.m_proxy.reset(proxy);
265  lock.upgrade();
266  m_branches.insert(
267  std::make_pair(stringToKey(uniqueKey.Data(), clid), std::move(bi)));
268 
269  // Return gracefully:
270  return StatusCode::SUCCESS;
271 }

◆ clearListeners()

void Event::clearListeners ( )
inherited

Remove all listeners from the object.

This function can be used to remove all the listeners from the internal list.

Should not be necessary under regular circumstances.

Definition at line 143 of file EventCore.cxx.

143  {
144 
145  m_listeners.clear();
146 }

◆ clearNameRemap()

void Event::clearNameRemap ( )
inherited

Clear the current name re-mapping.

This function simply clears out any existing name remapping declarations.

In case the remapping rules need to be changed in the code in some complicated way.

Definition at line 193 of file EventCore.cxx.

193  {
194 
195  m_nameRemapping.clear();
196 }

◆ connectAux()

StatusCode xAOD::Experimental::REvent::connectAux ( const std::string &  prefix,
bool  standalone 
)
overrideprivatevirtual

Function setting up access to a set of auxiliary branches.

This function is used internally to connect an auxiliary object to the input.

Based on the configuration of the object it will either use TAuxStore, or the EDM object that was used to write the auxiliary information in Athena.

Parameters
prefixThe prefix (main branch name) of the auxiliary data
standaloneType of the auxiliary store that should be created
Returns
kTRUE if the connection was successful, or kFALSE if it was not

Implements xAOD::Event.

Definition at line 576 of file REvent.cxx.

576  {
577 
578  // A little sanity check.
579  if (!m_eventReader) {
580  ATH_MSG_ERROR("Function called on un-initialised object");
581  return StatusCode::FAILURE;
582  }
583 
584  // Check if the field is already connected.
585  if (m_inputObjects.contains(prefix)) {
586  return StatusCode::SUCCESS;
587  }
588 
589  // Connect to the field as we would for any other.
590  static constexpr bool SILENT = false;
591  ATH_CHECK(connectObject(prefix, SILENT));
592 
593  // Access the object's manager.
594  Object_t::const_iterator mgr_itr = m_inputObjects.find(prefix);
595  if (mgr_itr == m_inputObjects.end()) {
596  ATH_MSG_FATAL("There's a logic error in the code");
597  return StatusCode::FAILURE;
598  }
599  const Details::IObjectManager* omgr =
600  dynamic_cast<const RObjectManager*>(mgr_itr->second.get());
601  if (omgr == nullptr) {
602  ATH_MSG_FATAL("There's a logic error in the code");
603  return StatusCode::FAILURE;
604  }
605 
606  // Check if we can switch out the internal store of this object.
607  static const TClass* const holderClass =
608  TClass::GetClass(typeid(SG::IAuxStoreHolder));
609  if (omgr->holder()->getClass()->InheritsFrom(holderClass) == false) {
610  // Nope... So let's just end the journey here.
611  return StatusCode::SUCCESS;
612  }
613 
614  // Try to get the object as an IAuxStoreHolder.
615  SG::IAuxStoreHolder* storeHolder = reinterpret_cast<SG::IAuxStoreHolder*>(
616  omgr->holder()->getAs(typeid(SG::IAuxStoreHolder)));
617  if (!storeHolder) {
618  ATH_MSG_FATAL("There's a logic error in the code");
619  return StatusCode::FAILURE;
620  }
621 
622  // A sanity check to see whether the store's type is in sync with the
623  // object's type that it will be connected to:
624  if ((standalone &&
625  (storeHolder->getStoreType() != SG::IAuxStoreHolder::AST_ObjectStore)) ||
626  ((!standalone) && (storeHolder->getStoreType() !=
628  ATH_MSG_ERROR("Requested store types inconsistent for: " << prefix);
629  ATH_MSG_ERROR("standalone = "
630  << standalone << ", getStoreType() = "
631  << static_cast<int>(storeHolder->getStoreType()));
632  return StatusCode::FAILURE;
633  }
634 
635  // Return gracefully.
636  return StatusCode::SUCCESS;
637 }

◆ connectMetaAux()

StatusCode xAOD::Experimental::REvent::connectMetaAux ( const std::string &  prefix,
bool  standalone 
)
overrideprivatevirtual

Function setting up access to a set of auxiliary branches for a metadata object.

This function is used internally to connect an auxiliary metadata object to the input.

Based on the configuration of the object it will either use TAuxStore, or the EDM object that was used to write the auxiliary information in Athena.

Parameters
prefixThe prefix (main branch name) of the auxiliary data
standaloneType of the auxiliary store that should be created
Returns
The usual StatusCode types

Implements xAOD::Event.

Definition at line 648 of file REvent.cxx.

649  {
650 
651  // A little sanity check.
652  if (!m_metaReader) {
653  ATH_MSG_ERROR("Function called on un-initialised object");
654  return StatusCode::FAILURE;
655  }
656 
657  // Check if the field is already connected.
658  if (m_inputMetaObjects.contains(prefix)) {
659  return StatusCode::SUCCESS;
660  }
661 
662  // Connect to the field as we would for any other.
663  static constexpr bool SILENT = false;
665 
666  // Access the object's manager.
667  Object_t::const_iterator mgr_itr = m_inputMetaObjects.find(prefix);
668  if (mgr_itr == m_inputMetaObjects.end()) {
669  ATH_MSG_FATAL("There's a logic error in the code");
670  return StatusCode::FAILURE;
671  }
672  const Details::IObjectManager* omgr =
673  dynamic_cast<const RObjectManager*>(mgr_itr->second.get());
674  if (omgr == nullptr) {
675  ATH_MSG_FATAL("There's a logic error in the code");
676  return StatusCode::FAILURE;
677  }
678 
679  // Check if we can switch out the internal store of this object.
680  static const TClass* const holderClass =
681  TClass::GetClass(typeid(SG::IAuxStoreHolder));
682  if (omgr->holder()->getClass()->InheritsFrom(holderClass) == false) {
683  // Nope... So let's just end the journey here.
684  return StatusCode::SUCCESS;
685  }
686 
687  // Try to get the object as an IAuxStoreHolder.
688  SG::IAuxStoreHolder* storeHolder = reinterpret_cast<SG::IAuxStoreHolder*>(
689  omgr->holder()->getAs(typeid(SG::IAuxStoreHolder)));
690  if (!storeHolder) {
691  ATH_MSG_FATAL("There's a logic error in the code");
692  return StatusCode::FAILURE;
693  }
694 
695  // A sanity check to see whether the store's type is in sync with the
696  // object's type that it will be connected to:
697  if ((standalone &&
698  (storeHolder->getStoreType() != SG::IAuxStoreHolder::AST_ObjectStore)) ||
699  ((!standalone) && (storeHolder->getStoreType() !=
701  ATH_MSG_ERROR("Requested store types inconsistent for: " << prefix);
702  ATH_MSG_ERROR("standalone = "
703  << standalone << ", getStoreType() = "
704  << static_cast<int>(storeHolder->getStoreType()));
705  return StatusCode::FAILURE;
706  }
707 
708  // Return gracefully.
709  return StatusCode::SUCCESS;
710 }

◆ connectMetaObject()

StatusCode xAOD::Experimental::REvent::connectMetaObject ( const std::string &  key,
bool  silent 
)
overrideprivatevirtual

Function setting up access to a particular metadata object.

This is the function doing the heavy lifting with creating metadata objects in memory out of the payload of the input file.

Parameters
keyThe key (branch name) of the metadata object to retrieve
silentSet to kTRUE to make the code fail silently in case the branch can't be connected to
Returns
The usual StatusCode types

Implements xAOD::Event.

Definition at line 490 of file REvent.cxx.

490  {
491 
492  // A little sanity check.
493  if (!m_metaReader) {
494  ATH_MSG_ERROR("Function called on un-initialised object");
495  return StatusCode::FAILURE;
496  }
497 
498  // Check if the branch is already connected.
499  if (m_inputMetaObjects.contains(key)) {
500  return StatusCode::SUCCESS;
501  }
502 
503  // RNTuples store fields with an "Aux:" postfix instead of "Aux.".
504  std::string key_to_read = key;
505  if (key.ends_with("Aux.")) {
506  key_to_read.replace(key_to_read.size() - 1, 1, ":");
507  }
508 
509  // Check if the field exists in our input RNTuple.
510  if (m_metaReader->GetDescriptor().FindFieldId(key_to_read.c_str()) ==
511  ROOT::kInvalidDescriptorId) {
512  // Field doesn't exist
513  if (!silent) {
514  ATH_MSG_WARNING("Field \"" << key_to_read << "\" not available on input");
515  }
516  return StatusCode::RECOVERABLE;
517  }
518 
519  // RDS: may need some logic here to get type from inputEventFormat rather than
520  // the view
521  // to read in with automatic schema evolution
522 
523  // Get class name from the field
524  ROOT::RNTupleView<void> view =
525  m_metaReader->GetView<void>(key_to_read.c_str(), nullptr);
526  std::string className = view.GetField().GetTypeName();
527  if (className == "") {
529  "Couldn't find an appropriate type with a dictionary for field \""
530  << key_to_read << "\"");
531  return StatusCode::FAILURE;
532  }
533  ::TClass* realClass = ::TClass::GetClass(className.c_str());
534  if ((!realClass) || (!realClass->IsLoaded())) {
535  // Now we're in trouble...
537  "Couldn't find an appropriate type with a dictionary for field \""
538  << key_to_read << "\"");
539  return StatusCode::FAILURE;
540  }
541 
542  // Create the object and the manager(s) around it.
543  void* ptr = realClass->New();
544  static const ::Long64_t FIRST_ENTRY = 0;
545  auto mgr = std::make_unique<RObjectManager>(
546  m_metaReader->GetView(key_to_read, ptr, className), FIRST_ENTRY,
547  std::make_unique<THolder>(ptr, realClass));
548  RObjectManager* mgrPtr = mgr.get();
549  m_inputMetaObjects[key] = std::move(mgr);
550 
551  // If it's an auxiliary store object, set it up correctly.
552  if (Details::isAuxStore(*(mgrPtr->holder()->getClass()))) {
554  }
555 
556  // If it (probably) has an associated auxiliary store, set it up as well.
557  if (Details::hasAuxStore(*(mgrPtr->holder()->getClass()))) {
559  key + "Aux.", Details::isStandalone(*(mgrPtr->holder()->getClass()))));
560  }
561 
562  // Return gracefully.
563  return StatusCode::SUCCESS;
564 }

◆ connectObject()

StatusCode xAOD::Experimental::REvent::connectObject ( const std::string &  key,
bool  silent 
)
overrideprivatevirtual

Function setting up access to a particular object.

This is one of the more important functions of the class.

It connects the event object to a given field of the input RNTuple.

The type that is read in to memory is not actually determined by the type written to the ntuple itself, but from the xAOD::EventFormat object. Which is there to make it possible to possibly use ROOT read rules to read a different type than what's on disk.

Everything else is fairly basic ROOT stuff, the code just has to make sure that the memory management is set up correctly for the created object.

Parameters
keyThe name of the branch to connect to
silentSet to true to make the code fail silently in case the field can't be connected to
Returns
The usual StatusCode values

Implements xAOD::Event.

Definition at line 352 of file REvent.cxx.

352  {
353 
354  // A little sanity check.
355  if (!m_eventReader) {
356  ATH_MSG_ERROR("Function called on un-initialised object");
357  return StatusCode::FAILURE;
358  }
359 
360  // Increment the access counter on this container.
362 
363  // Check if the branch is already connected.
364  if (m_inputObjects.contains(key)) {
365  return StatusCode::SUCCESS;
366  }
367  // Check if it was already found to be missing.
368  if (m_inputMissingObjects.contains(key)) {
369  if (!silent) {
370  ATH_MSG_WARNING("Field \"" << key << "\" not available on input");
371  }
372  return StatusCode::RECOVERABLE;
373  }
374 
375  // Tell the user what's happening.
376  ATH_MSG_DEBUG("Connecting to branch \"" << key << "\"");
377 
378  // Check if we have metadata about this branch.
379  const xAOD::EventFormatElement* ef = nullptr;
380 
381  // RNTuples store fields with an "Aux:" postfix instead of "Aux.".
382  std::string key_to_read = key;
383  if (key.ends_with("Aux.")) {
384  key_to_read.replace(key_to_read.size() - 1, 1, ":");
385  }
386 
387  if (m_inputEventFormat.exists(key) == false) {
388  if (!silent) {
389  ATH_MSG_WARNING("No metadata available for object: " << key);
390  }
391  } else {
393  }
394 
395  // Check if the field exists in our input RNTuple.
396  if (m_eventReader->GetDescriptor().FindFieldId(key_to_read.c_str()) ==
397  ROOT::kInvalidDescriptorId) {
398  // Field doesn't exist
399  if (!silent) {
400  ATH_MSG_WARNING("Field \"" << key_to_read << "\" not available on input");
401  }
402  m_inputMissingObjects.insert(key);
403  return StatusCode::RECOVERABLE;
404  }
405 
406  // RDS: may need some logic here to get type from inputEventFormat rather than
407  // the view
408  // to read in with automatic schema evolution
409 
410  // Get class name from the field
411  ROOT::RNTupleView<void> view =
412  m_eventReader->GetView<void>(key_to_read.c_str(), nullptr);
413  std::string className = view.GetField().GetTypeName();
414  if (className == "") {
415  if (ef) {
416  // This is a fairly weird situation, but let's fall back to taking
417  // the class name from the metadata object in this case.
418  className = ef->className();
419  } else {
421  "Couldn't find an appropriate type with a dictionary for field \""
422  << key_to_read << "\"");
423  return StatusCode::FAILURE;
424  }
425  }
426  ::TClass* realClass = ::TClass::GetClass(className.c_str());
427  if (((!realClass) || (!realClass->IsLoaded())) && ef) {
428  // We may need to do an actual schema evolution here, in which
429  // case let's fall back on the class name coming from the metadata
430  // object.
431  className = ef->className();
432  realClass = ::TClass::GetClass(className.c_str());
433  }
434  if ((!realClass) || (!realClass->IsLoaded())) {
435  // Now we're in trouble...
437  "Couldn't find an appropriate type with a dictionary for field \""
438  << key_to_read << "\"");
439  return StatusCode::FAILURE;
440  }
441 
442  // Make sure that the current object is the "active event":
443  setActive();
444 
445  // Check if the output already has this object. If it does, let's
446  // assume that we have been copying the object to the output. Which
447  // means that we need to resume filling the same memory address that
448  // the output holder points to.
449  void* ptr = nullptr;
450 
451  // Handle the case where an output object with this key already exists.
452 
453  // If there is no output object, then let's create one ourselves.
454  // This is the only way in which we can have the memory management of
455  // THolder do the right thing with this object.
456  if (ptr == nullptr) {
457  ptr = realClass->New();
458  }
459 
460  // Create the new manager object that will hold this EDM object.
461  auto mgr = std::make_unique<RObjectManager>(
462  m_eventReader->GetView(key_to_read, ptr, className), m_entry,
463  std::make_unique<THolder>(ptr, realClass));
464  RObjectManager* mgrPtr = mgr.get();
465  m_inputObjects[key] = std::move(mgr);
466 
467  // If it's an auxiliary store object, set it up correctly.
468  if (Details::isAuxStore(*(mgrPtr->holder()->getClass()))) {
470  }
471 
472  // If it (probably) has an associated auxiliary store, set it up as well.
473  if (Details::hasAuxStore(*(mgrPtr->holder()->getClass()))) {
475  key + "Aux.", Details::isStandalone(*(mgrPtr->holder()->getClass()))));
476  }
477 
478  // Return gracefully.
479  return StatusCode::SUCCESS;
480 }

◆ contains() [1/2]

template<typename T >
bool xAOD::Event::contains ( const std::string &  key)
inherited

Function checking if an object is available from the store.

◆ contains() [2/2]

bool xAOD::Event::contains ( const std::string &  key,
const std::type_info &  ti,
bool  metadata 
)
protectedinherited

Internal function checking if an object is in the input.

◆ containsMeta()

template<typename T >
bool xAOD::Event::containsMeta ( const std::string &  key)
inherited

Function checking if a meta-object is available from the store.

◆ copy()

StatusCode Event::copy ( const std::string &  pattern = ".*")
inherited

Copy an object directly from the input to the output.

This function can be used to easily copy a given (set of) object/container(s) to the output, without modifying the contents of it/them.

It only needs to be called on the interface object/container(s), the copying of the auxiliary data is done automatically, and is steered by the xAOD::Event::setAuxItemList function.

Parameters
patternRegular expression for the key(s)/name(s) of the object(s)/container(s) to copy

Definition at line 28 of file EventIO.cxx.

28  {
29 
30  // Tell the user what's happening.
31  ATH_MSG_DEBUG("Copying objects matching pattern \"" << pattern
32  << "\" to the output");
33 
34  // Collect a list of keys to copy.
35  std::set<std::string> keys;
36 
37  // The regular expression to use.
39 
40  // Loop over the known input containers.
41  for (const auto& [key, efe] : m_inputEventFormat) {
42 
43  // Tell the user what's happening.
44  ATH_MSG_VERBOSE("Considering input object with key \"" << key << "\"");
45 
46  // Check if the class in question matches the requested pattern.
47  if (std::regex_match(key, re) == false) {
48  continue;
49  }
50  // Ignore objects that don't exist on the input.
51  static const bool SILENT = true;
52  if (connectObject(key, SILENT).isSuccess() == false) {
53  continue;
54  }
55  // Skip all branches ending in "Aux.":
56  if (key.ends_with("Aux.")) {
57  continue;
58  }
59  // Also skip dynamic branches:
60  if (efe.parentName() != "") {
61  continue;
62  }
63  // Add the key to the list.
64  ATH_MSG_VERBOSE("Matched key \"" << key << "\"");
65  keys.insert(key);
66  }
67 
68  // Check if the pattern matches any of the name remapping rules.
69  for (const auto& [newname, onfile] : m_nameRemapping) {
70 
71  // Tell the user what's happening.
72  ATH_MSG_VERBOSE("Considering remapped key \"" << newname << "\"");
73 
74  // Check if the remapped name matches the pattern.
75  if (std::regex_match(newname, re) == false) {
76  continue;
77  }
78  // Ignore objects that don't exist on the input.
79  static const bool SILENT = true;
80  if (connectObject(onfile, SILENT).isSuccess() == false) {
81  continue;
82  }
83  // Add the remapped name to the list.
84  ATH_MSG_VERBOSE("Matched remapped key \"" << newname << "\"");
85  keys.insert(newname);
86  }
87 
88  // Now loop over all of the found keys.
89  for (const std::string& key : keys) {
90 
91  // Check if a name re-mapping should be applied or not.
92  std::string keyToUse = key;
93  auto remap_itr = m_nameRemapping.find(key);
94  if ((remap_itr != m_nameRemapping.end()) &&
96  m_inputEventFormat.exists(remap_itr->second)) {
97  keyToUse = remap_itr->second;
98  }
99 
100  // Make sure that the input object got connected to.
101  static const bool SILENT = false;
102  ATH_CHECK(connectObject(keyToUse, SILENT));
103 
104  // Make sure that the input object is properly updated.
105  Object_t::const_iterator vobjMgr = m_inputObjects.find(keyToUse);
106  if (vobjMgr == m_inputObjects.end()) {
107  ATH_MSG_FATAL("Internal logic error detected");
108  return StatusCode::FAILURE;
109  }
110  Details::IObjectManager* objMgr =
111  dynamic_cast<Details::IObjectManager*>(vobjMgr->second.get());
112  if (objMgr == nullptr) {
113  ATH_MSG_FATAL("Internal logic error detected");
114  return StatusCode::FAILURE;
115  }
116  static const bool METADATA = false;
117  if (getInputObject(keyToUse, *(objMgr->holder()->getClass()->GetTypeInfo()),
118  SILENT, METADATA) == nullptr) {
119  ATH_MSG_FATAL("Internal logic error detected");
120  return StatusCode::FAILURE;
121  }
122 
123  // Put the interface object into the output.
124  static const bool OVERWRITE = true;
125  static const bool IS_OWNER = true;
126  ATH_CHECK(record(objMgr->object(), objMgr->holder()->getClass()->GetName(),
127  key, OVERWRITE, METADATA, IS_OWNER));
128 
129  // If there is also an auxiliary store for this object/container, copy that
130  // as well.
131  const std::string auxKey = keyToUse + "Aux.";
132  if (m_inputObjects.contains(auxKey)) {
133  ATH_CHECK(
134  recordAux(*(m_inputObjects.at(auxKey)), key + "Aux.", METADATA));
135  }
136  }
137 
138  // Return gracefully:
139  return StatusCode::SUCCESS;
140 }

◆ dump()

std::string Event::dump ( )
inherited

Function creating a user-readable dump of the current input.

This function behaves exactly like StoreGateSvc::dump().

It doesn't actually print anything to the screen, it just returns a user readable dump of the contents of the current input file/chain.

It is a pretty dumb implementation for the moment. Should be made nicer later on.

Returns
The user-readable contents of the current input file/chain

Definition at line 250 of file EventCore.cxx.

250  {
251 
252  // The internal stream object.
253  std::ostringstream ost;
254  ost << "<<<<<<<<<<<<<<<<<<<< xAOD::TEvent Dump >>>>>>>>>>>>>>>>>>>>\n";
255 
256  // Loop over the input EventFormat object.
257  for (const auto& [key, element] : m_inputEventFormat) {
258 
259  // Get the type.
260  ::TClass* cl = ::TClass::GetClass(element.className().c_str());
261  const std::type_info* ti = (cl ? cl->GetTypeInfo() : nullptr);
262  if ((cl == nullptr) || (cl->IsLoaded() == false) || (ti == nullptr)) {
263  ATH_MSG_WARNING("Unknown type (" << element.className()
264  << ") found in the event format");
265  continue;
266  }
267 
268  // Skip containers that are not available anyway.
269  static const bool METADATA = false;
270  if (!contains(element.branchName(), *ti, METADATA)) {
271  continue;
272  }
273 
274  // Do the printout.
275  ost << " Hash: 0x" << std::setw(8) << std::setfill('0') << std::hex
276  << element.hash() << " Key: \"" << element.branchName() << "\"\n";
277 
278  ost << " type: " << element.className() << "\n";
279  const bool isNonConst =
280  transientContains(element.branchName(), *ti, METADATA);
281  ost << " isConst: " << (isNonConst ? "No" : "Yes") << "\n";
282  static const bool SILENT = false;
283  ost << " Data: "
284  << (isNonConst
285  ? getOutputObject(element.branchName(), *ti, METADATA)
286  : getInputObject(element.branchName(), *ti, SILENT, METADATA))
287  << "\n";
288  }
289 
290  // Finish with the construction:
291  ost << "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";
292  return ost.str();
293 }

◆ getBranchInfo()

const Event::BranchInfo * Event::getBranchInfo ( SG::sgkey_t  sgkey) const
protectedinherited

Get the object describing one object/branch.

Definition at line 345 of file EventIProxyDict.cxx.

345  {
346 
347  {
348  // We can only hold the lock (even though it's a shared lock) for
349  // this limited scope because the call to getInputObject below
350  // leads to a recursion and dead-lock if not released immediately.
352 
353  // If the object already exists, return it:
354  auto it = m_branches.find(sgkey);
355  if (it != m_branches.end()) {
356  return &(it->second);
357  }
358  }
359 
360  // If not, construct it now:
361  BranchInfo bi;
363  if (!efe) {
364  // Apparently this key is not known:
365  return nullptr;
366  }
367 
368  // Helper variable(s).
369  static const bool SILENT = true;
370  static const bool METADATA = false;
371 
372  // The name of the requested object.
373  const std::string& name = getName(sgkey);
374  // This is a bit perverse... In order to let the "base class" figure
375  // out the exact type of this object, we ask for it with an "Event
376  // pointer". I use that type because I need something that has a
377  // dictionary, and which should always be available when this code
378  // runs. In the end it doesn't matter that the object can't be
379  // retrieved as that type (of course...), it only matters that it gets
380  // "set up" following these calls.
381  Event* nc_this = const_cast<Event*>(this);
382  static const std::type_info& dummy = typeid(Event);
383  nc_this->getInputObject(name, dummy, SILENT, METADATA);
384  auto itr = m_outputObjects.find(name);
385  if (itr == m_outputObjects.end()) {
386  itr = m_inputObjects.find(name);
387  if (itr == m_inputObjects.end()) {
388  // We didn't find this object in the store...
389  return nullptr;
390  }
391  }
392  const Details::IObjectManager* mgr =
393  dynamic_cast<const Details::IObjectManager*>(itr->second.get());
394  if (!mgr) {
395  ATH_MSG_ERROR("Internal logic error found");
396  return nullptr;
397  }
398  bi.m_class = mgr->holder()->getClass();
399  // There's no need to check whether this is a "proper" dictionary
400  // at this point, since if TEvent is holding on to it, the type
401  // must have a proper compiled dictionary.
402 
403 #ifndef XAOD_STANDALONE
404  // Create a proper proxy for the input branch:
406  CLID_NULL, efe->branchName(), new GenericAddress());
407  taddr->setSGKey(sgkey);
409  *nc_this, getName(sgkey), *bi.m_class->GetTypeInfo());
410  bi.m_proxy.reset(new SG::DataProxy(taddr, loader));
411  loader->setProxy(*bi.m_proxy.get());
412 #endif // not XAOD_STANDALONE
413 
414  // Add the branch info to our list:
416  lock.upgrade();
417  auto ret = m_branches.insert(std::make_pair(sgkey, std::move(bi)));
418 
419  // Return a pointer to the branch info:
420  return &(ret.first->second);
421 }

◆ getEntries()

Long64_t xAOD::Experimental::REvent::getEntries ( ) const

Get how many entries are available from the current input file(s)

Returns
The number of events in the input file(s)

Definition at line 252 of file REvent.cxx.

252  {
253 
254  if (m_eventReader) {
255  return m_eventReader->GetNEntries();
256  } else if (m_inputNTupleIsMissing) {
257  return 0u;
258  } else {
259  ATH_MSG_ERROR("Function called on an uninitialised object");
260  return 0u;
261  }
262 }

◆ getEntry()

Int_t xAOD::Experimental::REvent::getEntry ( ::Long64_t  entry,
::Int_t  getall = 0 
)

Function loading a given entry of the input TTree.

This function is used to move to looking at a new entry from the input ntuple.

It doesn't do any I/O operation at this point, it just remembers which entry the objects should be loaded from later on.

Unless one calls the function with getall==1. In that case all input is force-read. This is necessary when writing out an event that was processed in a load-on-request manner.

Parameters
entryThe entry from the input tree to load
getallParameter deciding if partial reading should be used or not.
Returns
The number of bytes read, or a negative number in case of an error

Definition at line 278 of file REvent.cxx.

278  {
279 
280  // A little sanity check:
281  if (!m_eventReader) {
282  ATH_MSG_ERROR("Function called on an uninitialised object");
283  return -1;
284  }
285 
286  // Check if anything needs to be done.
287  if (entry == m_entry) {
288  ATH_MSG_DEBUG("Entry " << entry << " is already the active one");
289  return 0;
290  }
291 
292  // Set entry value
293  m_entry = entry;
294 
295  // Stats counter needs to know it's the next event.
297 
298  // Loop over all input object managers, and force them to load their
299  // content. But only if getall was used.
300  ::Int_t result = 0;
301  if (getall) {
302  for (auto& [key, inObj] : m_inputObjects) {
303  result += inObj->getEntry(getall);
304  }
305  }
306 
307  // Notify the listeners that a new event was loaded.
308  const TIncident incident(IncidentType::BeginEvent);
309  for (TVirtualIncidentListener* listener : m_listeners) {
310  listener->handle(incident);
311  }
312 
313  // Return the number of bytes read.
314  return result;
315 }

◆ getEventFormatElement()

const xAOD::EventFormatElement * Event::getEventFormatElement ( SG::sgkey_t  sgkey) const
protectedinherited

Get the metadata object for a given "SG key".

Definition at line 319 of file EventIProxyDict.cxx.

320  {
321 
322  const xAOD::EventFormatElement* efe = nullptr;
323  static const bool QUIET = true;
324  if (m_outputEventFormat) {
325  efe = m_outputEventFormat->get(sgkey, QUIET);
326  }
327  if (!efe) {
328  efe = m_inputEventFormat.get(sgkey, QUIET);
329  }
330  if (!efe) {
331  static SG::SGKeySet missingSGKeys ATLAS_THREAD_SAFE;
332  static mutex_t mutex;
333  guard_t lock(mutex);
334  if (missingSGKeys.emplace(sgkey).second) {
337  "Can't find EventFormatElement for hashed SG key: " << sgkey);
338  }
339  return 0;
340  }
341  }
342  return efe;
343 }

◆ getHash()

SG::sgkey_t Event::getHash ( const std::string &  key) const
overridevirtualinherited

Function returning the hash describing an object name.

This helper function is mostly needed by the smart pointers of the xAOD EDM.

Right now it very simply just calculates the hash just based on the key given to the function. But later on it might be good to do some tests here, checking if the event format knows about the specified key or not. This is why it's not made to be a static function

Parameters
keyString key to turn into a hash
Returns
A hash corresponding to the specified string key

Implements xAOD::TVirtualEvent.

Definition at line 27 of file EventTVirtualEvent.cxx.

27  {
28 
29  // For empty keys let's finish quickly.
30  if (key == "") {
31  return 0;
32  }
33 
34  // If the key is used in the input file, let's use the same hash for
35  // the output file as well.
37  return m_inputEventFormat.get(key)->hash();
38  }
39 
40  // If it's a new key, make a new hash for it from scratch:
41  return Utils::hash(key);
42 }

◆ getInputObject() [1/2]

const void * Event::getInputObject ( const std::string &  key,
const std::type_info &  ti,
bool  silent,
bool  metadata 
)
protectedinherited

Function for retrieving an input object in a non-template way.

This is the function doing the heavy lifting to retrieve objects from the input file.

Parameters
keyThe key (branch name) of the object to retrieve
tiThe type as which the object is to be retrieved
silentSet to kTRUE to make the code fail silently in case the object can't be retrieved
metadataFlag deciding whether we're looking for a metadata or event data object
Returns
A pointer to the input object if successful, or a null pointer if not

Definition at line 218 of file EventIO.cxx.

220  {
221 
222  // Check if a name remapping should be applied or not:
223  std::string keyToUse = key;
224  auto remap_itr = m_nameRemapping.find(key);
225  if ((remap_itr != m_nameRemapping.end()) &&
227  m_inputEventFormat.exists(remap_itr->second)) {
228  keyToUse = remap_itr->second;
229  }
230 
231  // The following catches the cases when we ask for a transient
232  // ConstDataVector object to be returned as "const DataVector".
233  TStore* store = TActiveStore::store();
234  if (store && store->contains(keyToUse, ti) && store->isConst(keyToUse, ti)) {
235  const void* result = store->getConstObject(keyToUse, ti);
236  return result;
237  }
238 
239  // A sanity check before checking for an object from the input file.
240  if (hasInput() == false) {
241  if (silent == false) {
242  ATH_MSG_WARNING("No input file connected to the Event object");
243  }
244  return nullptr;
245  }
246 
247  // Make sure that the requested input is connected to.
248  const StatusCode sc = (metadata ? connectMetaObject(keyToUse, silent)
249  : connectObject(keyToUse, silent));
250  if (sc.isSuccess() == false) {
251  return nullptr;
252  }
253 
254  // Select which object container to use:
256 
257  // Access the object's manager:
258  auto itr = objects.find(keyToUse);
259  if (itr == objects.end()) {
260  ATH_MSG_FATAL("There is an internal logic error in the code...");
261  return nullptr;
262  }
263 
264  // This has to be an ObjectManager object:
265  Details::IObjectManager* mgr =
266  dynamic_cast<Details::IObjectManager*>(itr->second.get());
267  if (mgr == nullptr) {
268  if (key == keyToUse) {
269  ATH_MSG_ERROR("Object of wrong type found for key \"" << key << "\"");
270  } else {
271  ATH_MSG_ERROR("Object of wrong type found for key \""
272  << key << "\"/\"" << keyToUse << "\"");
273  }
274  return nullptr;
275  }
276 
277  // Make sure that the current entry is loaded for event data objects.
278  if (metadata == false) {
279  const Int_t readBytes = mgr->getEntry();
280  if (readBytes > 0) {
281  // Connect the auxiliary store to objects needing it. This call also
282  // takes care of updating the dynamic store of auxiliary containers,
283  // when they are getting accessed directly.
284  static const bool IS_METADATA = false;
285  if (setAuxStore(key, *mgr, IS_METADATA).isSuccess() == false) {
286  ATH_MSG_ERROR("Failed to set the auxiliary store for "
287  << mgr->holder()->getClass()->GetName() << "/"
288  << keyToUse);
289  return nullptr;
290  }
291  } else if (readBytes < 0) {
292  ATH_MSG_ERROR("Failed to load current entry for object "
293  << mgr->holder()->getClass()->GetName() << "/" << keyToUse);
294  return nullptr;
295  }
296  }
297 
298  // Ask the holder object for the object of this type:
299  const void* result = mgr->holder()->getAsConst(ti, silent);
300  if (result == nullptr) {
301  if (!silent) {
302  ATH_MSG_WARNING("Could not retrieve object with key \""
303  << keyToUse << "\" as \""
304  << SG::normalizedTypeinfoName(ti) << "\"");
305  }
306  return nullptr;
307  }
308 
309  // We succeeded:
310  return result;
311 }

◆ getInputObject() [2/2]

const void * Event::getInputObject ( SG::sgkey_t  key,
const std::type_info &  ti,
bool  silent 
)
overrideprotectedvirtualinherited

Function for retrieving an input object in a non-template way.

This function is used by the TVirtualEvent interface to access an input object with a given hashed key.

The function looks up the string key belonging to the hash, and then calls the other GetInputObject(...) function in the class with that parameter.

Parameters
keyThe hashed key of the input object
tiThe type description of the object requested
silentSwitch for being silent about failures or not
Returns
A pointer to the requested object, or a null pointer in case of failure

Implements xAOD::TVirtualEvent.

Definition at line 162 of file EventTVirtualEvent.cxx.

163  {
164 
165  // Get a string name for this key:
166  const std::string& name = getName(key);
167  if (name.empty() && (silent == false)) {
168  ATH_MSG_WARNING("Key 0x" << std::hex << key << " unknown");
169  return nullptr;
170  }
171 
172  // Forward the call to the function using an std::string key:
173  static const bool METADATA = false;
174  return getInputObject(name, ti, silent, METADATA);
175 }

◆ getKey()

SG::sgkey_t Event::getKey ( const void *  obj) const
overridevirtualinherited

Function returning the hash describing a known object.

This function is used by the smart pointer code to find the identifier of an object that's already in the event in some way.

Parameters
objPointer to the object that we want to look up
Returns
The hashed identifier of the object, or 0 if the object was not found in the event

Implements xAOD::TVirtualEvent.

Definition at line 51 of file EventTVirtualEvent.cxx.

51  {
52 
53  // Make use of the getName function.
54  return getHash(getName(obj));
55 }

◆ getName() [1/2]

const std::string & Event::getName ( const void *  obj) const
overridevirtualinherited

Function returning the key describing a known object.

This function is used by the smart pointer code to find the identifier of an object that's already in the event in some way.

Parameters
objPointer to the object that we want to look up
Returns
The name of the object, or an empty string if the object was not found in the event

Implements xAOD::TVirtualEvent.

Definition at line 64 of file EventTVirtualEvent.cxx.

64  {
65 
66  // First look among the output objects.
67  for (const auto& [key, manager] : m_outputObjects) {
68  // Check if this is our object.
69  if (manager->object() == obj) {
70  // If it is, let's return right away.
71  return key;
72  }
73  }
74 
75  // Now look among the input objects.
76  for (const auto& [key, manager] : m_inputObjects) {
77  // Check if this is our object.
78  if (manager->object() == obj) {
79  // If it is, let's return.
80  return key;
81  }
82  }
83 
84  // If it's not there either, check if it's in an active TStore object:
85  const TStore* store = TActiveStore::store();
86  if (store && store->contains(obj)) {
87  // Get the name from the store then:
88  return store->getName(obj);
89  }
90 
91  // We didn't find the object in the event...
92  ATH_MSG_WARNING("Didn't find object with pointer \"" << obj
93  << "\" in the event");
94  static const std::string dummy;
95  return dummy;
96 }

◆ getName() [2/2]

const std::string & Event::getName ( SG::sgkey_t  hash) const
overridevirtualinherited

Function returning the key describing a known object.

This function is used primarily when getting the string key of a smart pointer that we read in from a file, or access it in memory.

Parameters
hashThe hashed key for the container/object
Returns
The name of the object, or an empty string if the object was not found in the event

Implements xAOD::TVirtualEvent.

Definition at line 105 of file EventTVirtualEvent.cxx.

105  {
106 
107  // If the branch is known from the input:
110  }
111 
112  // If the branch is known on the output:
115  }
116 
117  // If this is an object in the active store:
118  const TStore* store = TActiveStore::store();
119  if (store && store->contains(hash)) {
120  return store->getName(hash);
121  }
122 
123  // If it is unknown:
124  static const std::string dummy;
125  return dummy;
126 }

◆ getNames()

StatusCode xAOD::Experimental::REvent::getNames ( const std::string &  targetClassName,
std::vector< std::string > &  vkeys,
bool  metadata 
) const
overrideprivatevirtual

Function determining the list keys associated with a type name.

Implements xAOD::Event.

Definition at line 327 of file REvent.cxx.

329  {
330 
331  ATH_MSG_ERROR("xAOD::REvent::getNames not yet implemented");
332  return StatusCode::FAILURE;
333 }

◆ getOutputObject() [1/2]

void * Event::getOutputObject ( const std::string &  key,
const std::type_info &  ti,
bool  metadata 
) const
protectedinherited

Function for retrieving an output object in a non-template way.

This function does the heavy lifting of retrieving object from the list of output objects.

While it returns a typeless pointer, that pointer can be cast directly to the type described by the second parameter in the caller code.

Parameters
keyThe key (branch name) of the object to retrieve
tiThe type as which the object is to be retrieved
metadataFlag deciding whether we're looking for a metadata or event data object
Returns
A pointer to the output object if successful, or a null pointer if not

Definition at line 154 of file EventIO.cxx.

155  {
156 
157  // Select which object container to use:
159 
160  // Check if the object can be found:
161  auto itr = objects.find(key);
162  if (itr == objects.end()) {
163  // Do the following only for event data:
164  if (!metadata) {
165  // It's not in the event. Let's check if we find it in an active
166  // TStore object...
167  TStore* store = TActiveStore::store();
168  if ((!store) || (!store->contains(key, ti)) || store->isConst(key, ti)) {
169  // Nope, not there either...
170  return nullptr;
171  }
172  // Let's return the object from the TStore:
173  void* result = store->getObject(key, ti);
174  return result;
175  } else {
176  // For metadata we don't use external resources.
177  return nullptr;
178  }
179  }
180 
181  // If the object is not set in this event yet, we can't continue:
182  if (itr->second->isSet() == false) {
183  return nullptr;
184  }
185 
186  // If it does exist, check if it's the right kind of object:
187  Details::IObjectManager* mgr =
188  dynamic_cast<Details::IObjectManager*>(itr->second.get());
189  if (mgr == nullptr) {
190  ATH_MSG_ERROR("Object of wrong type found for key \"" << key << "\"");
191  return nullptr;
192  }
193 
194  // Ask the holder object for the object of this type:
195  void* result = mgr->holder()->getAs(ti);
196  if (result == nullptr) {
197  ATH_MSG_WARNING("Couldn't retrieve object as \""
198  << SG::normalizedTypeinfoName(ti) << "\"");
199  return nullptr;
200  }
201 
202  // Return the object:
203  return result;
204 }

◆ getOutputObject() [2/2]

void * Event::getOutputObject ( SG::sgkey_t  key,
const std::type_info &  ti 
)
overrideprotectedvirtualinherited

Function for retrieving an output object in a non-template way.

This function is used by the TVirtualEvent interface to access an output object with a given hashed key.

The function looks up the string key belonging to the hash, and then calls the other GetOutputObject(...) function in the class with that parameter.

Parameters
keyThe hashed key of the output object
tiThe type description of the object requested
Returns
A pointer to the requested object, or a null pointer in case of failure

Implements xAOD::TVirtualEvent.

Definition at line 138 of file EventTVirtualEvent.cxx.

138  {
139 
140  // Get a string name for this key.
141  const std::string& name = getName(key);
142  if (name.empty()) {
143  return nullptr;
144  }
145 
146  // Forward the call to the function using an std::string key.
147  static const bool METADATA = false;
148  return getOutputObject(name, ti, METADATA);
149 }

◆ hasInput()

bool xAOD::Experimental::REvent::hasInput ( ) const
overrideprivatevirtual

Check if an input file is connected to the object.

Implements xAOD::Event.

Definition at line 317 of file REvent.cxx.

317  {
318 
320 }

◆ hasOutput()

bool xAOD::Experimental::REvent::hasOutput ( ) const
overrideprivatevirtual

Check if an output file is connected to the object.

Implements xAOD::Event.

Definition at line 322 of file REvent.cxx.

322  {
323 
324  return false;
325 }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ initStats()

StatusCode xAOD::Experimental::REvent::initStats ( )
private

Function to initialise the statistics for all Tree content.

This function is used internally to initialise the reading of an input file.

It prepares the "monitoring information" in memory that gets filled while the code is running, with information about xAOD I/O.

Returns
The usual StatusCode values

Definition at line 850 of file REvent.cxx.

850  {
851 
852  // A little sanity check.
853  if (!m_eventReader) {
854  ATH_MSG_ERROR("Function called on an uninitialised object");
855  return StatusCode::FAILURE;
856  }
857 
858  // Reset the number of input branches information.
860 
861  // Loop over the EventFormat information.
862  for (const auto& [key, format] : m_inputEventFormat) {
863 
864  ATH_MSG_DEBUG("Investigating object \"" << key << "\" of class \""
865  << format.className() << "\"");
866 
867  // If it's an auxiliary container, scan it using RAuxStore.
868  if (key.ends_with("Aux.")) {
869 
870  // But first decide whether it describes a container, or just
871  // a single object. For that, first get the class that it was
872  // written with.
873  TClass* cl = TClass::GetClass(format.className().c_str());
874  if ((cl == nullptr) || (cl->IsLoaded() == false)) {
876  "Couldn't find the dictionary for type: " << format.className());
877  continue;
878  }
879 
880  // And then check if it inherits from xAOD::AuxContainerBase or from
881  // xAOD::AuxInfoBase.
882  static TClass* const auxContCl = TClass::GetClass(
884  static TClass* const auxInfoCl = TClass::GetClass(
886  if ((auxContCl == nullptr) || (auxInfoCl == nullptr)) {
888  "Couldn't get dictionary for xAOD::AuxContainerBase or "
889  "xAOD::AuxInfoBase");
890  return StatusCode::FAILURE;
891  }
892  const bool isContainer = cl->InheritsFrom(auxContCl);
893  const bool isInfo = cl->InheritsFrom(auxInfoCl);
894  if ((isContainer == false) && (isInfo == false)) {
895  ATH_MSG_WARNING("Auxiliary store \""
896  << key
897  << "\" is of an unknown type: " << format.className());
898  continue;
899  }
900  ATH_MSG_VERBOSE("isContainer = " << isContainer
901  << ", isInfo = " << isInfo);
902 
903  // Scan the branches using a temporary RAuxStore instance.
904  const std::string fieldName = key.substr(0, key.size() - 1) + ":";
908  static constexpr bool TOP_STORE = true;
909  RAuxStore temp(fieldName, TOP_STORE, mode);
910  ATH_CHECK(temp.readFrom(*m_eventReader));
911 
912  // Add all the auxids to the statistics object:
913  ReadStats& stats = IOStats::instance().stats();
914  for (SG::auxid_t id : temp.getAuxIDs()) {
915  stats.branch(fieldName, id);
916  }
917 
918  // Increment the number of known branches.
919  stats.setBranchNum(stats.branchNum() + temp.getAuxIDs().size());
920  }
921  // If it's an interface container.
922  else {
923  // Check if it's part of the input ntuple.
924  if (m_eventReader->GetDescriptor().FindFieldId(key) !=
925  ROOT::kInvalidDescriptorId) {
927  }
928  }
929  }
930 
931  // Return gracefully:
932  return StatusCode::SUCCESS;
933 }

◆ inputEventFormat()

const EventFormat * Event::inputEventFormat ( ) const
inherited

Get information about the input objects.

Definition at line 228 of file EventCore.cxx.

228  {
229 
230  if (hasInput()) {
231  return &m_inputEventFormat;
232  }
233  return nullptr;
234 }

◆ keys()

template<typename T >
StatusCode xAOD::Event::keys ( std::vector< std::string > &  vkeys,
bool  metadata 
) const
inherited

Provide a list of all data object keys associated with a specific type.

◆ keyToString() [1/2]

const std::string * Event::keyToString ( SG::sgkey_t  key) const
overrideprotectedinherited

Find the string corresponding to a given key.

Definition at line 292 of file EventIProxyDict.cxx.

292  {
293 
294  return &(getName(key));
295 }

◆ keyToString() [2/2]

const std::string * Event::keyToString ( SG::sgkey_t  key,
CLID clid 
) const
overrideprotectedinherited

Find the string and CLID corresponding to a given key.

Definition at line 297 of file EventIProxyDict.cxx.

297  {
298 
299  return &(getName(key));
300 }

◆ metaKeys()

template<typename T >
StatusCode xAOD::Event::metaKeys ( std::vector< std::string > &  vkeys) const
inherited

Provide a list of all metadata object keys associated with a specific type.

◆ msg() [1/2]

MsgStream & asg::AsgMessaging::msg ( ) const
inherited

The standard message stream.

Returns
A reference to the default message stream of this object.

Definition at line 49 of file AsgMessaging.cxx.

49  {
50 #ifndef XAOD_STANDALONE
52 #else // not XAOD_STANDALONE
53  return m_msg;
54 #endif // not XAOD_STANDALONE
55  }

◆ msg() [2/2]

MsgStream & asg::AsgMessaging::msg ( const MSG::Level  lvl) const
inherited

The standard message stream.

Parameters
lvlThe message level to set the stream to
Returns
A reference to the default message stream, set to level "lvl"

Definition at line 57 of file AsgMessaging.cxx.

57  {
58 #ifndef XAOD_STANDALONE
60 #else // not XAOD_STANDALONE
61  m_msg << lvl;
62  return m_msg;
63 #endif // not XAOD_STANDALONE
64  }

◆ msgLvl()

bool asg::AsgMessaging::msgLvl ( const MSG::Level  lvl) const
inherited

Test the output level of the object.

Parameters
lvlThe message level to test against
Returns
boolean Indicting if messages at given level will be printed
true If messages at level "lvl" will be printed

Definition at line 41 of file AsgMessaging.cxx.

41  {
42 #ifndef XAOD_STANDALONE
43  return ::AthMessaging::msgLvl( lvl );
44 #else // not XAOD_STANDALONE
45  return m_msg.msgLevel( lvl );
46 #endif // not XAOD_STANDALONE
47  }

◆ name()

const std::string & Event::name ( ) const
overrideprotectedinherited

Get the name of the instance.

Definition at line 313 of file EventIProxyDict.cxx.

313  {
314 
315  static const std::string result{"xAOD::Event"};
316  return result;
317 }

◆ outputEventFormat()

const EventFormat * Event::outputEventFormat ( ) const
inherited

Get information about the output objects.

Definition at line 236 of file EventCore.cxx.

236  {
237 
238  return m_outputEventFormat;
239 }

◆ printIOStats()

void Event::printIOStats ( ) const
inherited

Function printing the I/O statistics of the current process.

This is a convenience function for printing basic I/O information about the current job.

It can be called at the end of a job to get an overview of what the job did exactly I/O-wise.

Definition at line 298 of file EventCore.cxx.

298  {
299 
300  // Simply do this via the xAODCore code:
301  IOStats::instance().stats().Print("Summary");
302 }

◆ printNameRemap()

void Event::printNameRemap ( ) const
inherited

Print the current name re-mapping rules.

This function can be used for debugging, to check what container/object name remapping rules are in place for the current TEvent object.

Definition at line 201 of file EventCore.cxx.

201  {
202 
203  // Print a header.
204  ATH_MSG_INFO("Name remapping rules:");
205 
206  // In case no remapping rules have been set.
207  if (m_nameRemapping.empty()) {
208  ATH_MSG_INFO(" NONE");
209  return;
210  }
211 
212  // Otherwise.
213  for (const auto& [newName, onfile] : m_nameRemapping) {
214  ATH_MSG_INFO(" \"" << newName << "\" -> \"" << onfile << "\"");
215  }
216 }

◆ printProxyWarnings()

void Event::printProxyWarnings ( bool  value = true)
inherited

Enable warnings associated with broken element links.

These appear harmless so long as you don't actually try to access the links.

Which will cause other errors anyway.

Parameters
valueThe new value for the option

Definition at line 223 of file EventCore.cxx.

223  {
224 
226 }

◆ proxies()

std::vector< const SG::DataProxy * > Event::proxies ( ) const
overrideprotectedinherited

return the list of all current proxies in store

Definition at line 273 of file EventIProxyDict.cxx.

273  {
274 
276 
277  std::vector<const SG::DataProxy*> ret;
278  for (const auto& p : m_branches) {
279  const SG::DataProxy* proxy = p.second.m_proxy.get();
280  if (proxy) {
281  ret.push_back(proxy);
282  }
283  }
284  return ret;
285 }

◆ proxy() [1/2]

SG::DataProxy * Event::proxy ( const CLID id,
const std::string &  key 
) const
overrideprotectedinherited

get proxy with given id and key. Returns 0 to flag failure

Definition at line 211 of file EventIProxyDict.cxx.

211  {
212 
213  const SG::sgkey_t sgkey = getHash(key);
214  if (!sgkey) {
215  return 0;
216  }
217  return proxy_exact(sgkey);
218 }

◆ proxy() [2/2]

SG::DataProxy * Event::proxy ( const void *const  pTransient) const
overrideprotectedinherited

get proxy for a given data object address in memory

Definition at line 183 of file EventIProxyDict.cxx.

183  {
184 
185  // Look up the name of this object
186  std::string name = getName(pTransient);
187  if (name.empty()) {
188  // Apparently the object is not known...
189  return nullptr;
190  }
191 
192  // Get the metadata object for it:
193  const xAOD::EventFormatElement* efe = 0;
194  static const bool QUIET = true;
195  if (m_outputEventFormat) {
196  efe = m_outputEventFormat->get(name, QUIET);
197  }
198  if (!efe) {
199  efe = m_inputEventFormat.get(name, QUIET);
200  }
201  if (!efe) {
202  // No metadata found...
203  return nullptr;
204  }
205 
206  // Return the proxy:
207  const BranchInfo* bi = getBranchInfo(efe->hash());
208  return bi->m_proxy.get();
209 }

◆ proxy_exact()

SG::DataProxy * Event::proxy_exact ( SG::sgkey_t  sgkey) const
overrideprotectedinherited

Get proxy given a hashed key+clid.

Definition at line 220 of file EventIProxyDict.cxx.

220  {
221 
222  // Get the object describing this branch/object:
223  const BranchInfo* bi = getBranchInfo(sgkey);
224  if (!bi) {
225  static SG::SGKeySet missingSGKeys ATLAS_THREAD_SAFE;
226  static mutex_t mutex;
227  guard_t lock(mutex);
228  if (missingSGKeys.emplace(sgkey).second && m_printEventProxyWarnings) {
229  ATH_MSG_WARNING("Can't find BranchInfo for: " << sgkey);
230  }
231  return 0;
232  }
233 
234  // Access its data proxy:
235  SG::DataProxy* proxy = bi->m_proxy.get();
236 
237  // Return the proxy:
238  return proxy;
239 }

◆ readFrom()

StatusCode xAOD::Experimental::REvent::readFrom ( std::string_view  fileName)

Set up the reading of an input file.

This function takes care of connecting the event object to a new input file.

It reads in the metadata of the input file needed for reading the file.

Parameters
fileNamename of file needed for metadata access

Definition at line 90 of file REvent.cxx.

90  {
91 
92  // Clear the cached input objects.
93  m_inputObjects.clear();
94  m_inputMissingObjects.clear();
95  m_inputMetaObjects.clear();
96  {
98  lock.upgrade();
99  m_branches.clear();
100  }
101  m_eventReader.reset();
102 
103  // Reset the internal flags.
104  m_entry = -1;
105  m_inputNTupleIsMissing = false;
106 
107  // Clear out the current object.
108  m_inputEventFormat = {};
109 
110  // Set up a reader for the metadata ntuple.
111  m_metaReader = ROOT::RNTupleReader::Open(METADATA_NTUPLE_NAME, fileName);
112  if (!m_metaReader) {
113  ATH_MSG_ERROR("Couldn't find \"" << METADATA_NTUPLE_NAME
114  << "\" tree in input file: " << fileName);
115  return StatusCode::FAILURE;
116  }
117  ATH_MSG_DEBUG("Created RNTupleReader for \"" << METADATA_NTUPLE_NAME
118  << "\" in file: " << fileName);
119 
120  // Make sure that the xAOD::EventFormat dictonary is loaded.
121  // This may not be the case if streamer information reading is turned
122  // off.
123  static const std::string eventFormatTypeName =
125  if (::TClass::GetClass(eventFormatTypeName.c_str()) == nullptr) {
126  ATH_MSG_WARNING("Couldn't load the EventFormat dictionary");
127  }
128  ATH_MSG_VERBOSE("Loaded the xAOD::EventFormat dictionary");
129 
130  // Helper lambda for collecting the event format metadata from an RNTuple
131  // with a given name.
132  auto readEventFormatMetadata = [&](std::string_view tupleName) -> StatusCode {
133  // Set up a reader. This may technically be the same as m_metaReader, but
134  // it's easier to write the code this way.
135  auto metaReader = ROOT::RNTupleReader::Open(tupleName, fileName);
136  if (!metaReader) {
137  ATH_MSG_ERROR("Couldn't find \""
138  << tupleName << "\" ntuple in input file: " << fileName);
139  return StatusCode::FAILURE;
140  }
141  ATH_MSG_VERBOSE("Created temporary RNTupleReader for \""
142  << tupleName << "\" in file: " << fileName);
143 
144  // Try to read in the event format metadata.
145  const std::string eventFormatFieldName =
146  getFirstFieldMatch(*m_metaReader, "EventFormat");
147  try {
148  // Add its elements to m_inputEventFormat.
149  auto ef = m_metaReader->GetView<xAOD::EventFormat>(eventFormatFieldName);
150  for (const auto& [key, element] : ef(0u)) {
151  m_inputEventFormat.add(element);
152  }
153  } catch (const ROOT::RException&) {
154  ATH_MSG_WARNING("Input file provides no event or metadata");
155  return StatusCode::RECOVERABLE;
156  }
157  ATH_MSG_VERBOSE("Merged event format metadata from \"" << tupleName
158  << "\" ntuple");
159 
160  // Return gracefully.
161  return StatusCode::SUCCESS;
162  };
163 
164  // Read in the metadata from the "main" metadata ntuple.
165  const StatusCode sc = readEventFormatMetadata(METADATA_NTUPLE_NAME);
166  if (sc.isRecoverable()) {
167  m_inputNTupleIsMissing = true;
168  return StatusCode::SUCCESS;
169  }
170  ATH_CHECK(sc);
171 
172  // List all the other Metadata RNTuples in the input file.
173  // Having several metadata tuples can happen for augmented files
174  // as one metadata tree per stream is produced.
175  std::set<std::string> lOtherMetaTupleNames;
176  {
177  std::unique_ptr<TFile> inFile(TFile::Open(fileName.data(), "READ"));
178  TList* lKeys = inFile->GetListOfKeys();
179  if (lKeys == nullptr) {
180  ATH_MSG_ERROR("Could not get list of keys for input file: " << fileName);
181  return StatusCode::FAILURE;
182  }
183  for (const TObject* obj : *lKeys) {
184  const std::string keyName = obj->GetName();
185  // Make sure the key corresponds to a metadata ntuple but
186  // do not add the current metadata tree in the list of other trees
187  // and do not add the metadata tree handlers to the list
188  if ((keyName != METADATA_NTUPLE_NAME) &&
189  (keyName.find("MetaData") != std::string::npos) &&
190  (keyName.find("MetaDataHdr") == std::string::npos)) {
191  // Make sure key corresponds to an RNTuple
192  const TKey* key = dynamic_cast<const TKey*>(obj);
193  if (key == nullptr) {
194  ATH_MSG_ERROR("Object describing \"" << keyName << "\" in file \""
195  << fileName
196  << "\" is not a TKey?");
197  return StatusCode::FAILURE;
198  }
199  const char* className = key->GetClassName();
200  static constexpr bool LOAD = kFALSE;
201  static constexpr bool SILENT = kTRUE;
202  ::TClass* cl = ::TClass::GetClass(className, LOAD, SILENT);
203  if ((cl != nullptr) && cl->InheritsFrom(ROOT::RNTuple::Class())) {
204  lOtherMetaTupleNames.insert(keyName);
205  }
206  }
207  }
208  }
209 
210  // Read in the metadata from any additonal NTuples found (if any).
211  for (const std::string& tupleName : lOtherMetaTupleNames) {
212  ATH_CHECK(readEventFormatMetadata(tupleName));
213  }
214 
215  // Set up the main ntuple reader.
216  m_eventReader = ROOT::RNTupleReader::Open(EVENT_NTUPLE_NAME, fileName);
217  if (!m_eventReader) {
218  ATH_MSG_ERROR("Couldn't access RNTuple \"" << EVENT_NTUPLE_NAME
219  << "\" in file: " << fileName);
220  return StatusCode::FAILURE;
221  }
222  ATH_MSG_DEBUG("Created RNTupleReader for \"" << EVENT_NTUPLE_NAME
223  << "\" in file: " << fileName);
224 
225  // Init the statistics collection.
226  ATH_CHECK(initStats());
227  // Update the event counter in the statistics object:
229  stats.setNEvents(stats.nEvents() + m_eventReader->GetNEntries());
230 
231  // Notify the listeners that a new file was opened:
232  const TIncident beginIncident(IncidentType::BeginInputFile);
233  for (TVirtualIncidentListener* listener : m_listeners) {
234  listener->handle(beginIncident);
235  }
236  // For now implement a very simple scheme in which we claim already
237  // at the start that the entire file was processed. Since we have no way
238  // of ensuring that the user indeed does this. And we can't delay calling
239  // this function, as the user may likely close his/her output file before
240  // closing the last opened input file.
241  const TIncident endIncident(IncidentType::EndInputFile);
242  for (TVirtualIncidentListener* listener : m_listeners) {
243  listener->handle(endIncident);
244  }
245 
246  // The initialisation was successful:
247  return StatusCode::SUCCESS;
248 }

◆ record() [1/3]

template<typename T >
StatusCode xAOD::Event::record ( std::unique_ptr< T >  obj,
const std::string &  key 
)
inherited

Add an output object to the event, explicitly taking ownership of it.

◆ record() [2/3]

template<typename T >
StatusCode xAOD::Event::record ( T *  obj,
const std::string &  key 
)
inherited

Add an output object to the event.

◆ record() [3/3]

StatusCode xAOD::Experimental::REvent::record ( void *  obj,
const std::string &  typeName,
const std::string &  key,
bool  overwrite,
bool  metadata,
bool  isOwner 
)
overrideprivatevirtual

Record an object into a connected output file.

Implements xAOD::Event.

Definition at line 831 of file REvent.cxx.

832  {
833 
834  ATH_MSG_ERROR("xAOD::REvent::record not yet implemented");
835  return StatusCode::FAILURE;
836 }

◆ recordAux()

StatusCode xAOD::Experimental::REvent::recordAux ( TVirtualManager mgr,
const std::string &  key,
bool  metadata 
)
overrideprivatevirtual

Record an auxiliary store into a connected output file.

Implements xAOD::Event.

Definition at line 838 of file REvent.cxx.

838  {
839 
840  ATH_MSG_ERROR("xAOD::REvent::recordAux not yet implemented");
841  return StatusCode::FAILURE;
842 }

◆ recordMeta() [1/2]

template<typename T >
StatusCode xAOD::Event::recordMeta ( std::unique_ptr< T >  obj,
const std::string &  key 
)
inherited

Add an object to the output file's metadata, explicitly taking ownership of it.

◆ recordMeta() [2/2]

template<typename T >
StatusCode xAOD::Event::recordMeta ( T *  obj,
const std::string &  key 
)
inherited

Add an object to the output file's metadata.

◆ recordObject()

SG::DataProxy * Event::recordObject ( SG::DataObjectSharedPtr< DataObject >  obj,
const std::string &  key,
bool  allowMods,
bool  returnExisting 
)
overrideprotectedinherited

Record an object in the store.

Definition at line 307 of file EventIProxyDict.cxx.

308  {
309 
310  throw std::runtime_error("xAOD::Event::recordObject is not implemented");
311 }

◆ recordTypeless()

StatusCode xAOD::Event::recordTypeless ( void *  obj,
const std::string &  typeName,
const std::string &  key,
bool  overwrite = false,
bool  metadata = true,
bool  isOwner = true 
)
protectedinherited

Internal function for recording an object into the output.

◆ registerKey()

void Event::registerKey ( SG::sgkey_t  key,
const std::string &  str,
CLID  clid 
)
overrideprotectedinherited

Remember an additional mapping from key to string/CLID.

Definition at line 302 of file EventIProxyDict.cxx.

302  {
303 
304  return;
305 }

◆ removeListener()

StatusCode Event::removeListener ( TVirtualIncidentListener listener)
inherited

Remove an incident listener object.

This function allows us to remove a listener when for instance a metadata tool is deleted during a job.

Parameters
listenerPointer to the listener that should be removed
Returns
The usual StatusCode types

Definition at line 126 of file EventCore.cxx.

126  {
127 
128  // Remove the listener. Or at least try to...
129  auto itr = std::find(m_listeners.begin(), m_listeners.end(), listener);
130  if (itr == m_listeners.end()) {
131  ATH_MSG_ERROR("Listener " << static_cast<void*>(listener) << " not known");
132  return StatusCode::FAILURE;
133  }
134  m_listeners.erase(itr);
135 
136  // Return gracefully:
137  return StatusCode::SUCCESS;
138 }

◆ retrieve() [1/4]

template<typename T >
StatusCode xAOD::Event::retrieve ( const T *&  obj,
const std::string &  key 
)
inherited

Retrieve either an input or an output object from the event.

◆ retrieve() [2/4]

template<typename T >
bool xAOD::TVirtualEvent::retrieve ( const T *&  obj,
const std::string &  key,
bool  silent = false 
)
inherited

Function retrieving an object from the event (constant version)

◆ retrieve() [3/4]

template<typename T >
bool xAOD::TVirtualEvent::retrieve ( const T *&  obj,
sgkey_t  key = DEFAULT_KEY,
bool  silent = false 
)
inherited

Function retrieving an object from the event (constant version)

◆ retrieve() [4/4]

template<typename T >
StatusCode xAOD::Event::retrieve ( T *&  obj,
const std::string &  key 
)
inherited

Retrieve an output object from the event.

◆ retrieveMetaInput()

template<typename T >
StatusCode xAOD::Event::retrieveMetaInput ( const T *&  obj,
const std::string &  key 
)
inherited

Retrieve an input metadata object.

◆ retrieveMetaOutput() [1/2]

template<typename T >
StatusCode xAOD::Event::retrieveMetaOutput ( const T *&  obj,
const std::string &  key 
)
inherited

Retrieve an output metadata object.

◆ retrieveMetaOutput() [2/2]

template<typename T >
StatusCode xAOD::Event::retrieveMetaOutput ( T *&  obj,
const std::string &  key 
)
inherited

Retrieve an output metadata object.

◆ setActive()

void Event::setActive ( ) const
inherited

Set this event object as the currently active one.

Definition at line 54 of file EventCore.cxx.

54  {
55 
56  // The active event and current store are thread-local globals.
57  Event* nc_this ATLAS_THREAD_SAFE = const_cast<Event*>(this);
58  TActiveEvent::setEvent(static_cast<TVirtualEvent*>(nc_this));
59 #ifndef XAOD_STANDALONE
61 #endif // not XAOD_STANDALONE
62 }

◆ setAuxItemList()

void Event::setAuxItemList ( const std::string &  containerKey,
const std::string &  itemList 
)
inherited

Configure which dynamic variables to write out for a given store.

This function receives the rules for selecting which dynamic auxiliary branches should be written for a given container, in the exact same format in which we need to set it in the Athena output ItemList.

Parameters
containerKeyThe name of the auxiliary container in question
itemListThe variable list according to the formatting rules

Definition at line 71 of file EventCore.cxx.

72  {
73 
74  // Decoded attributes.
75  std::set<std::string> attributes;
76 
77  // Split up the received string using "." as the separator.
78  if (itemList.size()) {
79  std::istringstream ss(itemList);
80  std::string attr;
81  while (std::getline(ss, attr, '.')) {
82  attributes.insert(attr);
83  }
84  }
85 
86  // Remember the setting.
87  m_auxItemList[containerKey] = std::move(attributes);
88 }

◆ setAuxStore()

StatusCode xAOD::Experimental::REvent::setAuxStore ( const std::string &  key,
Details::IObjectManager mgr,
bool  metadata 
)
overrideprivatevirtual

Function connecting a DV object to its auxiliary store.

Every time a DataVector is read in from the input for a new RNTuple entry, one needs to re-connect it with its auxiliary store.

This function takes care of this.

Parameters
keyThe key (field name) of the object whose auxiliary store should be set up
mgrThe manager object of the DV container
metadataFlag specifying whether we're dealing with a metadata or event data object
Returns
The usual StatusCode types

Implements xAOD::Event.

Definition at line 723 of file REvent.cxx.

724  {
725 
726  // Check if we need to do anything:
727  if ((Details::hasAuxStore(*(mgr.holder()->getClass())) == false) &&
728  (Details::isAuxStore(*(mgr.holder()->getClass())) == false)) {
729  return StatusCode::SUCCESS;
730  }
731 
732  // Select which object container to use:
734 
735  // Look up the auxiliary object's manager:
736  TVirtualManager* auxMgr = nullptr;
737  std::string auxKey;
738  if (Details::isAuxStore(*(mgr.holder()->getClass()))) {
739  auxMgr = &mgr;
740  auxKey = key;
741  } else {
742  auto itr = objects.find(key + "Aux.");
743  if (itr == objects.end()) {
744  // Apparently there's no auxiliary object for this DV, so let's
745  // give up.
746  return StatusCode::SUCCESS;
747  }
748  auxMgr = itr->second.get();
749  auxKey = key + "Aux:";
750  }
751 
752  if (!metadata) {
753  // Make sure the auxiliary object is up to date.
754  ::Int_t readBytes = auxMgr->getEntry();
755 
756  // Check if there is a separate auxiliary object for the dynamic
757  // variables, which would need to be updated.
758  const std::string dynAuxKey = auxKey + "Dynamic";
759  auto dynAuxMgr = objects.find(dynAuxKey);
760  if ((dynAuxMgr != objects.end()) && (readBytes || (auxMgr == &mgr))) {
761 
762  // Tell the dynamic store object to switch to a new entry.
763  dynAuxMgr->second->getEntry();
764  }
765  }
766 
767  // Stop here if we've set up an auxiliary store.
768  if (auxMgr == &mgr) {
769  return StatusCode::SUCCESS;
770  }
771 
772  // Access the auxiliary base class of the object/vector:
773  SG::AuxVectorBase* vec = 0;
774  SG::AuxElement* aux = 0;
775  switch (mgr.holder()->typeKind()) {
776  case THolder::DATAVECTOR: {
777  void* vvec = mgr.holder()->getAs(typeid(SG::AuxVectorBase));
778  vec = reinterpret_cast<SG::AuxVectorBase*>(vvec);
779  } break;
780  case THolder::AUXELEMENT: {
781  void* vaux = mgr.holder()->getAs(typeid(SG::AuxElement));
782  aux = reinterpret_cast<SG::AuxElement*>(vaux);
783  } break;
784  default:
785  break;
786  }
787 
788  // Check whether index tracking is enabled for the type. If not, then
789  // we need to fix it...
790  if (vec && (!vec->trackIndices())) {
791  Details::forceTrackIndices(*vec);
792  }
793 
794  // Check if we were successful:
795  if ((!vec) && (!aux)) {
796  ATH_MSG_FATAL("Couldn't access class \""
797  << mgr.holder()->getClass()->GetName()
798  << "\" as SG::AuxVectorBase or SG::AuxElement");
799  return StatusCode::FAILURE;
800  }
801 
802  // Get the concrete auxiliary manager:
803  RObjectManager* omgr = dynamic_cast<RObjectManager*>(auxMgr);
804  if (!omgr) {
805  ATH_MSG_FATAL("Auxiliary manager for \"" << auxKey
806  << "\" is not of the right type");
807  return StatusCode::FAILURE;
808  }
809  void* p = omgr->holder()->getAs(typeid(SG::IConstAuxStore));
810  const SG::IConstAuxStore* store =
811  reinterpret_cast<const SG::IConstAuxStore*>(p);
812  if (store == nullptr) {
813  ATH_MSG_FATAL("There's a logic error in the code");
814  return StatusCode::FAILURE;
815  }
816 
817  // Connect the two:
818  if (vec) {
819  vec->setStore(store);
820  } else if (aux) {
821  aux->setStore(store);
822  } else {
823  ATH_MSG_FATAL("There's a logic error in the code");
824  return StatusCode::FAILURE;
825  }
826 
827  // We succeeded:
828  return StatusCode::SUCCESS;
829 }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ setUpDynamicStore()

StatusCode xAOD::Experimental::REvent::setUpDynamicStore ( RObjectManager mgr,
ROOT::RNTupleReader &  reader 
)
private

event uses RNTupleReader:

This function is used by connectObject(...) and connectMetaObject(...) to set up auxiliary store type objects correctly for accessing dynamic variables from the input file.

Parameters
mgrThe object manager of the auxiliary store object
readerThe RNTuple reader to read dynamic variables from
Returns
The usual StatusCode types

Definition at line 943 of file REvent.cxx.

944  {
945 
946  // The name of the field that the object is connected to.
947  const std::string fieldName = mgr.field().GetField().GetFieldName();
948 
949  // Check if we can call setName(...) on the object.
950  ::TMethodCall setNameCall;
951  setNameCall.InitWithPrototype(mgr.holder()->getClass(), "setName",
952  "const char*");
953  if (setNameCall.IsValid()) {
954  // Yes, there is such a function. Let's call it with the field
955  // name.
956  const ::TString params = ::TString::Format("\"%s\"", fieldName.c_str());
957  const char* charParams = params.Data();
958  setNameCall.Execute(mgr.holder()->get(), charParams);
959  } else {
960  // This is weird. What sort of auxiliary container is this? :-/
961  ATH_MSG_WARNING("Couldn't find setName(...) function for container \""
962  << fieldName << "\" (type: "
963  << mgr.holder()->getClass()->GetName() << ")");
964  }
965 
966  // Check if we can switch out the internal store of this object:
967  static const TClass* const holderClass =
968  TClass::GetClass(typeid(SG::IAuxStoreHolder));
969  if (!mgr.holder()->getClass()->InheritsFrom(holderClass)) {
970  // Nope... So let's just end the journey here.
971  return StatusCode::SUCCESS;
972  }
973 
974  // Try to get the object as an IAuxStoreHolder:
975  SG::IAuxStoreHolder* storeHolder = reinterpret_cast<SG::IAuxStoreHolder*>(
976  mgr.holder()->getAs(typeid(SG::IAuxStoreHolder)));
977  if (!storeHolder) {
978  ATH_MSG_FATAL("There's a logic error in the code");
979  return StatusCode::FAILURE;
980  }
981 
982  // Create an RAuxStore instance that will read the dynamic variables
983  // of this container. Notice that the RAuxManager doesn't own the
984  // RAuxStore object. It will be owned by the SG::IAuxStoreHolder
985  // object.
986  static constexpr bool TOP_STORE = false;
987  auto store = std::make_unique<RAuxStore>(
988  fieldName, TOP_STORE,
992  // This object is used to read data from the input, it needs to be
993  // locked:
994  store->lock();
995 
996  // Set it up to read from the input RNTuple.
997  ATH_CHECK(store->readFrom(reader));
998  // Tell the auxiliary store which entry to use. This is essential for
999  // metadata objects, and non-important for event data objects, which will
1000  // get a possibly different entry loaded in setAuxStore(...).
1001  ATH_CHECK(store->getEntry(0));
1002 
1003  // Set up a manager for it.
1004  static constexpr bool SHARED_OWNER = false;
1005  m_inputObjects[fieldName + "Dynamic"] =
1006  std::make_unique<RAuxManager>(store.get(), m_entry, SHARED_OWNER);
1007 
1008  // Give this object to the store holder.
1009  storeHolder->setStore(store.release());
1010 
1011  // Return gracefully:
1012  return StatusCode::SUCCESS;
1013 }

◆ stringToKey()

SG::sgkey_t Event::stringToKey ( const std::string &  str,
CLID  clid 
)
overrideprotectedinherited

Find the string corresponding to a given key.

Definition at line 287 of file EventIProxyDict.cxx.

287  {
288 
289  return getHash(str);
290 }

◆ transientContains() [1/2]

template<typename T >
bool xAOD::Event::transientContains ( const std::string &  key) const
inherited

Function checking if an object is already in memory.

◆ transientContains() [2/2]

bool xAOD::Event::transientContains ( const std::string &  key,
const std::type_info &  ti,
bool  metadata 
) const
protectedinherited

Internal function checking if an object is already in memory.

◆ transientContainsMeta()

template<typename T >
bool xAOD::Event::transientContainsMeta ( const std::string &  key) const
inherited

Function checking if a meta-object is already in memory.

Member Data Documentation

◆ ATLAS_THREAD_SAFE

SG::SGKeyMap<BranchInfo> m_branches xAOD::Event::ATLAS_THREAD_SAFE
mutableprotectedinherited

Map from hashed sgkey to BranchInfo.

Definition at line 358 of file Event.h.

◆ DEFAULT_KEY

constexpr sgkey_t xAOD::TVirtualEvent::DEFAULT_KEY = ~static_cast<sgkey_t>(0)
staticconstexprinherited

Key for retrieving the "default" object of a given type.

Definition at line 35 of file TVirtualEvent.h.

◆ KEY_MASK

constexpr sgkey_t xAOD::TVirtualEvent::KEY_MASK = DEFAULT_KEY >> 2
staticconstexprinherited

Mask for the keys, used mostly internally.

Definition at line 37 of file TVirtualEvent.h.

◆ m_auxItemList

std::unordered_map<std::string, std::set<std::string> > xAOD::Event::m_auxItemList
protectedinherited

Rules for selecting which auxiliary branches to write.

Definition at line 326 of file Event.h.

◆ m_branchesMutex

upgrade_mutex_t xAOD::Event::m_branchesMutex
mutableprotectedinherited

Mutex for multithread synchronization.

Definition at line 354 of file Event.h.

◆ m_entry

::Long64_t xAOD::Experimental::REvent::m_entry
private

The entry to look at from the input tree.

Definition at line 109 of file REvent.h.

◆ m_eventReader

std::unique_ptr<ROOT::RNTupleReader> xAOD::Experimental::REvent::m_eventReader
private

The main event data reader.

Definition at line 102 of file REvent.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_inputEventFormat

EventFormat xAOD::Event::m_inputEventFormat
protectedinherited

Format of the current input file.

Definition at line 321 of file Event.h.

◆ m_inputMetaObjects

Object_t xAOD::Event::m_inputMetaObjects
protectedinherited

Collection of all the managed input meta-objects.

Definition at line 316 of file Event.h.

◆ m_inputMissingObjects

std::set<std::string> xAOD::Event::m_inputMissingObjects
protectedinherited

Objects that have been asked for, but were found to be missing in the current input.

Definition at line 311 of file Event.h.

◆ m_inputNTupleIsMissing

bool xAOD::Experimental::REvent::m_inputNTupleIsMissing = false
private

Whether the input has an event RNTuple or not.

Definition at line 104 of file REvent.h.

◆ m_inputObjects

Object_t xAOD::Event::m_inputObjects
protectedinherited

Collection of all the managed input objects.

Definition at line 308 of file Event.h.

◆ m_listeners

std::vector<TVirtualIncidentListener*> xAOD::Event::m_listeners
protectedinherited

Listeners who should be notified when certain incidents happen.

Definition at line 329 of file Event.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_metaReader

std::unique_ptr<ROOT::RNTupleReader> xAOD::Experimental::REvent::m_metaReader
private

The metadata reader.

Definition at line 106 of file REvent.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nameRemapping

std::unordered_map<std::string, std::string> xAOD::Event::m_nameRemapping
protectedinherited

Container name re-mapping rules.

Definition at line 332 of file Event.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_outputEventFormat

EventFormat* xAOD::Event::m_outputEventFormat = nullptr
protectedinherited

Format of the current output file.

Definition at line 323 of file Event.h.

◆ m_outputMetaObjects

Object_t xAOD::Event::m_outputMetaObjects
protectedinherited

Collection of all the managed output meta-objects.

Definition at line 318 of file Event.h.

◆ m_outputObjects

Object_t xAOD::Event::m_outputObjects
protectedinherited

Collection of all the managed output object.

Definition at line 313 of file Event.h.

◆ m_printEventProxyWarnings

bool xAOD::Event::m_printEventProxyWarnings = false
protectedinherited

Option to silence common warnings that seem to be harmless.

Definition at line 335 of file Event.h.


The documentation for this class was generated from the following files:
xAOD::AuxInfoBase
Common base class for auxiliary info objects.
Definition: AuxInfoBase.h:49
xAOD::Event::keys
StatusCode keys(std::vector< std::string > &vkeys, bool metadata) const
Provide a list of all data object keys associated with a specific type.
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:25
SGTest::store
TestStore store
Definition: TestStore.cxx:23
common.sgkey
def sgkey(tool)
Definition: common.py:1027
xAOD::Event::getEventFormatElement
const xAOD::EventFormatElement * getEventFormatElement(SG::sgkey_t sgkey) const
Get the metadata object for a given "SG key".
Definition: EventIProxyDict.cxx:319
xAOD::EventFormat_v1::get
const EventFormatElement * get(const std::string &key, bool quiet=false) const
Get the description of a given branch.
Definition: EventFormat_v1.cxx:91
xAOD::THolder::AUXELEMENT
@ AUXELEMENT
A type inheriting from SG::AuxElement.
Definition: THolder.h:106
xAOD::Experimental::REvent::connectObject
StatusCode connectObject(const std::string &key, bool silent) override
Function setting up access to a particular object.
Definition: REvent.cxx:352
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
xAODPrivate::Loader
Definition: EventIProxyDict.cxx:142
xAOD::Event::ATLAS_THREAD_SAFE
SG::SGKeyMap< BranchInfo > m_branches ATLAS_THREAD_SAFE
Map from hashed sgkey to BranchInfo.
Definition: Event.h:358
python.trigbs_prescaleL1.ost
ost
Definition: trigbs_prescaleL1.py:104
get_generator_info.result
result
Definition: get_generator_info.py:21
SG::IAuxStoreHolder::getStoreType
virtual AuxStoreType getStoreType() const =0
Return the type of the store object.
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
LArConditions2Ntuple.objects
objects
Definition: LArConditions2Ntuple.py:64
xAOD::Event::setAuxStore
virtual StatusCode setAuxStore(const std::string &key, Details::IObjectManager &mgr, bool metadata)=0
Function connecting a DV object to its auxiliary store.
vtune_athena.format
format
Definition: vtune_athena.py:14
xAOD::Experimental::REvent::connectMetaAux
StatusCode connectMetaAux(const std::string &prefix, bool standalone) override
Function setting up access to a set of auxiliary branches for a metadata object.
Definition: REvent.cxx:648
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
xAOD::IOStats::stats
ReadStats & stats()
Access the object belonging to the current thread.
Definition: IOStats.cxx:17
L1CaloPhase1Monitoring.standalone
standalone
Definition: L1CaloPhase1Monitoring.py:139
xAOD::Event::name
const std::string & name() const override
Get the name of the instance.
Definition: EventIProxyDict.cxx:313
xAOD::Experimental::REvent::connectMetaObject
StatusCode connectMetaObject(const std::string &key, bool silent) override
Function setting up access to a particular metadata object.
Definition: REvent.cxx:490
CP::OutOfValidityAction::SILENT
@ SILENT
don't print anything and return success
xAOD::TActiveEvent::setEvent
static void setEvent(TVirtualEvent *ptr)
Set the active event pointer.
Definition: TActiveEvent.cxx:21
xAOD::Event::m_inputObjects
Object_t m_inputObjects
Collection of all the managed input objects.
Definition: Event.h:308
SG::normalizedTypeinfoName
std::string normalizedTypeinfoName(const std::type_info &info)
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
Definition: normalizedTypeinfoName.cxx:120
xAOD::Event::m_outputMetaObjects
Object_t m_outputMetaObjects
Collection of all the managed output meta-objects.
Definition: Event.h:318
xAOD::Event::m_inputEventFormat
EventFormat m_inputEventFormat
Format of the current input file.
Definition: Event.h:321
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:483
xAOD::THolder::DATAVECTOR
@ DATAVECTOR
A DataVector container.
Definition: THolder.h:105
Event
Definition: trigbs_orderedMerge.cxx:42
makeTOC.inFile
string inFile
Definition: makeTOC.py:5
StateLessPT_NewConfig.Format
Format
Definition: StateLessPT_NewConfig.py:149
xAOD::Event::setActive
void setActive() const
Set this event object as the currently active one.
Definition: EventCore.cxx:54
xAODPrivate::Loader::setProxy
void setProxy(SG::DataProxy &proxy)
Definition: EventIProxyDict.cxx:151
xAOD::Event::Event
Event(std::string_view name)
Constructor with a name.
Definition: EventCore.cxx:27
xAOD::ReadStats::Print
void Print(::Option_t *option="") const
Print information about the collected statistics.
xAOD::details::AuxStoreBase::EStructMode
EStructMode
"Structural" modes of the object
Definition: AuxStoreBase.h:30
skel.it
it
Definition: skel.GENtoEVGEN.py:407
xAOD::AuxContainerBase
Common base class for the auxiliary containers.
Definition: AuxContainerBase.h:59
SG::TransientAddress
Definition: TransientAddress.h:34
SG::CurrentEventStore::setStore
static IProxyDict * setStore(IProxyDict *store)
Set the current store.
Definition: CurrentEventStore.cxx:36
xAOD::TActiveStore::store
static TStore * store()
Access the currently active TStore object.
Definition: TActiveStore.cxx:16
athena.value
value
Definition: athena.py:124
xAOD::ReadStats::container
BranchStats * container(const std::string &name)
Access the description of a container. Creating it if necessary.
xAOD::EventFormatElement
Class describing one branch of the ROOT file.
Definition: EventFormatElement.h:39
xAOD::Event::stringToKey
SG::sgkey_t stringToKey(const std::string &str, CLID clid) override
Find the string corresponding to a given key.
Definition: EventIProxyDict.cxx:287
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:9
xAOD::Event::m_nameRemapping
std::unordered_map< std::string, std::string > m_nameRemapping
Container name re-mapping rules.
Definition: Event.h:332
python.RatesEmulationExample.lock
lock
Definition: RatesEmulationExample.py:148
xAOD::Experimental::REvent::m_inputNTupleIsMissing
bool m_inputNTupleIsMissing
Whether the input has an event RNTuple or not.
Definition: REvent.h:104
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
xAOD::EventFormatElement::branchName
const std::string & branchName() const
Get the branch/key name.
Definition: EventFormatElement.cxx:30
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
xAOD::Experimental::REvent::connectAux
StatusCode connectAux(const std::string &prefix, bool standalone) override
Function setting up access to a set of auxiliary branches.
Definition: REvent.cxx:576
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
xAOD::details::AuxStoreBase::EStructMode::kObjectStore
@ kObjectStore
The object describes a single object.
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
xAOD::Event::m_listeners
std::vector< TVirtualIncidentListener * > m_listeners
Listeners who should be notified when certain incidents happen.
Definition: Event.h:329
xAOD::details::AuxStoreBase::EStructMode::kContainerStore
@ kContainerStore
The object describes an entire container.
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
SG::AuxVectorBase
Manage index tracking and synchronization of auxiliary data.
Definition: AuxVectorBase.h:98
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
xAOD::Event::Object_t
std::unordered_map< std::string, std::unique_ptr< TVirtualManager > > Object_t
Definition of the internal data structure type.
Definition: Event.h:305
xAOD::EventFormatElement::hash
sgkey_t hash() const
Get the hash belonging to this branch/key.
Definition: EventFormatElement.cxx:48
xAOD::Event::m_inputMetaObjects
Object_t m_inputMetaObjects
Collection of all the managed input meta-objects.
Definition: Event.h:316
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
xAOD::ReadStats::nextEvent
void nextEvent()
Function incrementing the processed event counter.
xAOD::Event::getName
const std::string & getName(const void *obj) const override
Function returning the key describing a known object.
Definition: EventTVirtualEvent.cxx:64
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
python.checkMetadata.metadata
metadata
Definition: checkMetadata.py:175
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
xAOD::Event::m_printEventProxyWarnings
bool m_printEventProxyWarnings
Option to silence common warnings that seem to be harmless.
Definition: Event.h:335
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::Event::m_auxItemList
std::unordered_map< std::string, std::set< std::string > > m_auxItemList
Rules for selecting which auxiliary branches to write.
Definition: Event.h:326
xAOD::Utils::getTypeName
std::string getTypeName(const std::type_info &ti)
This function is necessary in order to create type names that ROOT can understand.
Definition: Control/xAODRootAccess/Root/Utils.cxx:354
SG::AuxElement::setStore
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
Definition: AuxElement.cxx:241
guard_t
AthContainers_detail::lock_guard< mutex_t > guard_t
Guard type for multithreaded synchronisation.
Definition: EventIProxyDict.cxx:36
xAOD::Event::connectMetaObject
virtual StatusCode connectMetaObject(const std::string &key, bool silent)=0
Function setting up access to a particular metadata object.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
vertexingJO_ITK_init.itemList
list itemList
Definition: vertexingJO_ITK_init.py:95
taskman.fieldName
fieldName
Definition: taskman.py:489
xAOD::Event::m_branchesMutex
upgrade_mutex_t m_branchesMutex
Mutex for multithread synchronization.
Definition: Event.h:354
xAOD::Event::getOutputObject
void * getOutputObject(SG::sgkey_t key, const std::type_info &ti) override
Function for retrieving an output object in a non-template way.
Definition: EventTVirtualEvent.cxx:138
CalibDbCompareRT.dummy
dummy
Definition: CalibDbCompareRT.py:59
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
xAOD::Event::recordAux
virtual StatusCode recordAux(TVirtualManager &mgr, const std::string &key, bool metadata)=0
Record an auxiliary store into a connected output file.
xAOD::Details::isStandalone
bool isStandalone(const TClass &cl)
Helper function deciding if a given type "is a standalone object".
Definition: IOUtils.cxx:65
xAOD::Event::proxy_exact
SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override
Get proxy given a hashed key+clid.
Definition: EventIProxyDict.cxx:220
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Preparation.mode
mode
Definition: Preparation.py:107
xAOD::ReadStats::setBranchNum
void setBranchNum(::Int_t num)
Set the total number of branches on the input.
xAOD::Experimental::REvent::setUpDynamicStore
StatusCode setUpDynamicStore(RObjectManager &mgr, ROOT::RNTupleReader &ntupleReader)
event uses RNTupleReader:
Definition: REvent.cxx:943
plotmaker.keyName
keyName
Definition: plotmaker.py:145
xAOD::IOStats::instance
static IOStats & instance()
Singleton object accessor.
Definition: IOStats.cxx:11
xAOD::Event::getInputObject
const void * getInputObject(SG::sgkey_t key, const std::type_info &ti, bool silent) override
Function for retrieving an input object in a non-template way.
Definition: EventTVirtualEvent.cxx:162
xAOD::Event::hasInput
virtual bool hasInput() const =0
Check if an input file is connected to the object.
EL::Detail::SubmitDirMode::OVERWRITE
@ OVERWRITE
create the directory as is, removing existing directories if needed
xAOD::Event::record
StatusCode record(T *obj, const std::string &key)
Add an output object to the event.
SG::IAuxStoreHolder::setStore
virtual void setStore(IAuxStore *store)=0
Give an auxiliary store object to the holder object.
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
xAOD::Event::m_inputMissingObjects
std::set< std::string > m_inputMissingObjects
Objects that have been asked for, but were found to be missing in the current input.
Definition: Event.h:311
xAOD::Event::m_outputObjects
Object_t m_outputObjects
Collection of all the managed output object.
Definition: Event.h:313
xAOD::Event::upgrading_lock_t
AthContainers_detail::upgrading_lock< upgrade_mutex_t > upgrading_lock_t
Lock type for multithread synchronization.
Definition: Event.h:352
SG::SGKeySet
std::unordered_set< sgkey_t > SGKeySet
A set of sgkey_t values.
Definition: CxxUtils/CxxUtils/sgkey_t.h:97
xAOD::EventFormat_v1
Event format metadata for xAOD files.
Definition: EventFormat_v1.h:38
xAOD::Event::connectObject
virtual StatusCode connectObject(const std::string &key, bool silent)=0
Function setting up access to a particular object.
xAOD::ReadStats::readContainer
void readContainer(const std::string &name)
Function incrementing the read counter on a specific container.
MakeNewFileFromOldAndSubstitution.newName
dictionary newName
Definition: ICHEP2016/MakeNewFileFromOldAndSubstitution.py:95
SG::sgkey_t
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition: CxxUtils/CxxUtils/sgkey_t.h:32
xAOD::Event::contains
bool contains(const std::string &key)
Function checking if an object is available from the store.
xAOD::Experimental::REvent::m_entry
::Long64_t m_entry
The entry to look at from the input tree.
Definition: REvent.h:109
xAOD::Event::m_outputEventFormat
EventFormat * m_outputEventFormat
Format of the current output file.
Definition: Event.h:323
python.trfDecorators.silent
def silent(func)
Redirect stdout/err to /dev/null Useful wrapper to get rid of ROOT verbosity...
Definition: trfDecorators.py:24
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:108
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
mutex_t
AthContainers_detail::mutex mutex_t
Mutex type for multithread synchronization.
Definition: EventIProxyDict.cxx:34
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:15
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
xAOD::EventFormat
EventFormat_v1 EventFormat
Definition of the current event format version.
Definition: EventFormat.h:16
re
const boost::regex re(r_e)
SG::TransientAddress::setSGKey
void setSGKey(sgkey_t sgkey)
check if it is a transient ID (primary or symLinked):
Definition: TransientAddress.h:235
xAOD::Experimental::REvent::m_metaReader
std::unique_ptr< ROOT::RNTupleReader > m_metaReader
The metadata reader.
Definition: REvent.h:106
createCoolChannelIdFile.newname
newname
Definition: createCoolChannelIdFile.py:105
xAOD::Event::proxy
SG::DataProxy * proxy(const void *const pTransient) const override
get proxy for a given data object address in memory
Definition: EventIProxyDict.cxx:183
xAOD::Event::getHash
SG::sgkey_t getHash(const std::string &key) const override
Function returning the hash describing an object name.
Definition: EventTVirtualEvent.cxx:27
str
Definition: BTagTrackIpAccessor.cxx:11
xAOD::Details::hasAuxStore
bool hasAuxStore(const TClass &cl)
Helper function deciding if a given type "has an auxiliary store".
Definition: IOUtils.cxx:40
python.Logging.manager
manager
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/Logging.py:92
xAOD::Experimental::REvent::initStats
StatusCode initStats()
Function to initialise the statistics for all Tree content.
Definition: REvent.cxx:850
xAOD::Event::getBranchInfo
const BranchInfo * getBranchInfo(SG::sgkey_t sgkey) const
Get the object describing one object/branch.
Definition: EventIProxyDict.cxx:345
jobOptions.fileName
fileName
Definition: jobOptions.SuperChic_ALP2.py:39
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
collisions.reader
reader
read the goodrunslist xml file(s)
Definition: collisions.py:22
xAOD::EventFormat_v1::add
void add(const EventFormatElement &element, bool updatePersistent=true)
Add the description of a new branch.
Definition: EventFormat_v1.cxx:43
xAOD::ReadStats
Class describing the access statistics of a collection of branches.
Definition: ReadStats.h:123
SG::IConstAuxStore
Interface for const operations on an auxiliary store.
Definition: IConstAuxStore.h:64
python.PyAthena.obj
obj
Definition: PyAthena.py:132
SG::DataProxy
Definition: DataProxy.h:45
SG::IAuxStoreHolder::AST_ObjectStore
@ AST_ObjectStore
The store describes a single object.
Definition: IAuxStoreHolder.h:67
SG::IAuxStoreHolder
Interface for objects taking part in direct ROOT I/O.
Definition: IAuxStoreHolder.h:36
xAOD::Experimental::REvent::m_eventReader
std::unique_ptr< ROOT::RNTupleReader > m_eventReader
The main event data reader.
Definition: REvent.h:102
xAOD::Utils::hash
SG::sgkey_t hash(const std::string &name)
This function provides a hashed version of the key (branch) names used in the xAOD file,...
Definition: Control/xAODRootAccess/Root/Utils.cxx:125
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:25
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
LArL1Calo_ComputeHVCorr.className
className
Definition: LArL1Calo_ComputeHVCorr.py:135
python.TransformConfig.attributes
def attributes(self)
Definition: TransformConfig.py:383
xAOD::Event::transientContains
bool transientContains(const std::string &key) const
Function checking if an object is already in memory.
LheEventFiller_Common.ef
ef
Definition: SFGen_i/share/common/LheEventFiller_Common.py:7
xAOD::EventFormat_v1::exists
bool exists(const std::string &key) const
Check if a description exists about a given branch.
Definition: EventFormat_v1.cxx:65
SG::IAuxStoreHolder::AST_ContainerStore
@ AST_ContainerStore
The store describes a container.
Definition: IAuxStoreHolder.h:68
drawFromPickle.view
view
Definition: drawFromPickle.py:294
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
xAOD::Details::isAuxStore
bool isAuxStore(const TClass &cl)
Helper function deciding if a given type "is an auxiliary store".
Definition: IOUtils.cxx:53