ATLAS Offline Software
Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
TriggerEDMSerialiserTool Class Reference

Tool responsible for filling an HLT result object with serialised EDM collections. More...

#include <TriggerEDMSerialiserTool.h>

Inheritance diagram for TriggerEDMSerialiserTool:
Collaboration diagram for TriggerEDMSerialiserTool:

Classes

class  Address
 
class  TruncationInfo
 

Public Member Functions

 TriggerEDMSerialiserTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~TriggerEDMSerialiserTool () override=default
 
virtual StatusCode fill (HLT::HLTResultMT &resultToFill, const EventContext &ctx) const override
 
virtual StatusCode initialize () override
 

Private Types

using TruncationInfoMap = std::unordered_map< uint16_t, std::vector< TruncationInfo > >
 Typedef for collection of TruncationInfo objects for full event. More...
 

Private Member Functions

StatusCode addCollectionToSerialise (const std::string &typeKeyAuxIDs, std::vector< Address > &addressVec) const
 Parse entry from m_collectionsToSerialize and add it to m_toSerialise. More...
 
StatusCode fillPayload (const void *data, size_t sz, std::vector< uint32_t > &buffer) const
 Copy bytes from the memory into the buffer converting from char[] to uint32_t[] This function is candidate to be made global function at some point and we will need also readPayload function. More...
 
StatusCode serialiseContainer (void *data, const Address &address, std::vector< uint32_t > &buffer) const
 Place inside the buffer the serialised container (can be either TP, xAOD) involves simple invocation of serialiser. More...
 
StatusCode serialisexAODAuxContainer (void *data, const Address &address, std::vector< uint32_t > &buffer, SGImplSvc *evtStore) const
 Place inside the buffer serialised the xAOD Aux container involves selection and recording of dynamic variables. More...
 
StatusCode serialiseTPContainer (void *data, const Address &address, std::vector< uint32_t > &buffer) const
 Place inside the buffer the serialised old type of container involves T/P conversion. More...
 
StatusCode serialiseDynAux (DataObject *dObject, const Address &address, std::vector< uint32_t > &buffer, size_t &nDynWritten) const
 Add dynamic variables to the payload. More...
 
StatusCode serialise (const Address &address, std::vector< uint32_t > &buffer, SGImplSvc *evtStore) const
 Retrieve data from event store, serialise and fill the buffer using one of the specific serialise methods, depending on the data type. More...
 
StatusCode tryAddData (HLT::HLTResultMT &hltResult, const uint16_t id, const std::vector< uint32_t > &data, Address::Truncation truncationMode, const std::unordered_map< uint16_t, std::vector< uint32_t >> &deferredInterfaceBuffer) const
 Try appending serialised data to HLT result. More...
 
StatusCode fillDebugInfo (const TruncationInfoMap &truncationInfoMap, xAOD::TrigCompositeContainer &debugInfoCont, HLT::HLTResultMT &resultToFill, SGImplSvc *evtStore) const
 Parse the truncation debug information, fill monitoring histograms, fill and record the debug info collection. More...
 

Static Private Member Functions

static StatusCode makeHeader (const TriggerEDMSerialiserTool::Address &address, std::vector< uint32_t > &buffer)
 Given the ID of the collection (in address arg) insert basic streaming info into the buffer. More...
 
static std::string version (const std::string &name)
 Obtain version from the actual type name. More...
 
static std::set< uint16_t > activeModuleIDs (const HLT::HLTResultMT &result)
 Build a list of module IDs to serialise based on the stream tags. More...
 

Private Attributes

Gaudi::Property< std::vector< std::string > > m_collectionsToSerialize
 
Gaudi::Property< bool > m_saveDynamic
 
Gaudi::Property< std::map< uint16_t, uint32_t > > m_truncationThresholds
 
Gaudi::Property< int > m_eventSizeHardLimitMB
 
Gaudi::Property< float > m_fullResultTruncationFrac
 
SG::WriteHandleKey< xAOD::TrigCompositeContainerm_debugInfoWHKey
 StoreGate key for the truncation debug info object. More...
 
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainerm_debugNavigationSummaryRHKey
 StoreGate key for the navigation summary object - with this we can print which chains accepted the event which truncated. More...
 
std::vector< Addressm_toSerialise
 
ServiceHandle< IClassIDSvc > m_clidSvc
 
ServiceHandle< IAthenaSerializeSvcm_serializerSvc
 
ToolHandle< TrigSerTPToolm_tpTool
 
ToolHandle< GenericMonitoringToolm_monTool { this, "MonTool", "", "Monitoring tool" }
 

Friends

StatusCode tester (TriggerEDMSerialiserTool *)
 

Detailed Description

Tool responsible for filling an HLT result object with serialised EDM collections.

Its configuration is a list of EDM classes + keys + designation of dynamic variables + HLT result IDs. According to this list, objects are looked up in the main store and if found the serialisation service is used to convert the collections into arrays of bytes. Serialised data is wrapped info a vector of 32-bit integers and prefixed with header containing description of the payload (details may change). Such fragments for subsequent collections are concatenated together to form EDM payload in HLTResultMT. The HLTResultMT object stores serialised payload for all HLT result ROBs and all of them are filled together following the IDs in the configuration list.

For unpacking, the

See also
TriggerEDMDeserialiserAlg is used

Definition at line 37 of file TriggerEDMSerialiserTool.h.

Member Typedef Documentation

◆ TruncationInfoMap

using TriggerEDMSerialiserTool::TruncationInfoMap = std::unordered_map<uint16_t, std::vector<TruncationInfo> >
private

Typedef for collection of TruncationInfo objects for full event.

Definition at line 118 of file TriggerEDMSerialiserTool.h.

Constructor & Destructor Documentation

◆ TriggerEDMSerialiserTool()

TriggerEDMSerialiserTool::TriggerEDMSerialiserTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 32 of file TriggerEDMSerialiserTool.cxx.

35  : base_class( type, name, parent ) {}

◆ ~TriggerEDMSerialiserTool()

virtual TriggerEDMSerialiserTool::~TriggerEDMSerialiserTool ( )
overridevirtualdefault

Member Function Documentation

◆ activeModuleIDs()

std::set< uint16_t > TriggerEDMSerialiserTool::activeModuleIDs ( const HLT::HLTResultMT result)
staticprivate

Build a list of module IDs to serialise based on the stream tags.

Definition at line 655 of file TriggerEDMSerialiserTool.cxx.

655  {
656  std::set<uint16_t> activeIDs;
657  for (const eformat::helper::StreamTag& st : result.getStreamTags()) {
658  if (st.robs.empty() && st.dets.empty()) { // Full Event Building stream
659  activeIDs.insert(0); // 0 is the main result ID
660  continue;
661  }
662  for (const uint32_t robid : st.robs) {
663  eformat::helper::SourceIdentifier sid(robid);
664  if (sid.subdetector_id() != eformat::SubDetector::TDAQ_HLT) {
665  continue;
666  }
667  activeIDs.insert(sid.module_id());
668  }
669  }
670  return activeIDs;
671 }

◆ addCollectionToSerialise()

StatusCode TriggerEDMSerialiserTool::addCollectionToSerialise ( const std::string &  typeKeyAuxIDs,
std::vector< Address > &  addressVec 
) const
private

Parse entry from m_collectionsToSerialize and add it to m_toSerialise.

Definition at line 89 of file TriggerEDMSerialiserTool.cxx.

89  {
90  ATH_MSG_DEBUG("Parsing " << typeKeyAuxIDs);
91 
92  // Syntax: 'collectionKeyType;module1,module2,...[;allowTruncation]'
93  std::vector<std::string> def;
94  boost::split( def, typeKeyAuxIDs, boost::is_any_of(";") );
95 
96  if ( def.size() < 2 ) {
97  ATH_MSG_ERROR("Invalid EDM collection specification: " << typeKeyAuxIDs);
98  return StatusCode::FAILURE;
99  }
100 
101  const std::string typeKeyAux = def[0];
102  const std::string configuredType = typeKeyAux.substr( 0, typeKeyAux.find('#') );
103  const std::string key = typeKeyAux.substr( typeKeyAux.find('#')+1, typeKeyAux.find('.')-typeKeyAux.find('#') );
104 
105  std::string transientType;
106  std::string persistentType;
108 
109  if ( configuredType.find('_') == std::string::npos ) {
110  transientType = configuredType;
111  } else {
112  transientType = configuredType.substr( 0, configuredType.find('_') );
113  }
114  CLID clid{0};
115  if ( m_clidSvc->getIDOfTypeName(transientType, clid).isFailure() ) {
116  ATH_MSG_ERROR( "Can not find CLID for " << transientType << " that is needed for serialisation " << key );
117  return StatusCode::FAILURE;
118  }
119  ATH_MSG_VERBOSE("Decoded transient type: " << transientType << " with the CLID " << clid );
120  if ( transientType == configuredType ) {
121  std::string realTypeName;
122  if( m_clidSvc->getTypeInfoNameOfID( clid, realTypeName ).isFailure() ) {
123  ATH_MSG_ERROR( "Can not find real type name for " << transientType << " that is needed for serialisation " << key );
124  return StatusCode::FAILURE;
125  }
126  persistentType = transientType + version( realTypeName );
127  ATH_MSG_VERBOSE(transientType << " = "<< configuredType << " thus obtained real type name from clid svc " << realTypeName << " forming persistent type name "<< persistentType );
128  } else {
129  persistentType = configuredType;
130  }
131 
132  ATH_MSG_DEBUG( "Persistent type: " << persistentType );
133 
134  RootType classDesc = RootType::ByNameNoQuiet( persistentType );
135  if ( ! classDesc.IsComplete() ) {
136  ATH_MSG_ERROR( "The type " << persistentType << " is not known to ROOT serialiser" );
137  return StatusCode::FAILURE;
138  }
139 
140  // Set truncation mode
141  if ( def.size() > 2 && def[2].find("allowTruncation") != std::string::npos ) {
142  ATH_MSG_DEBUG("Truncation allowed for " << configuredType << "#" << key);
143  truncationMode = Address::Truncation::Allowed;
144  }
145 
146  std::vector<std::string> splitModuleIDs;
147  boost::split( splitModuleIDs, def[1], boost::is_any_of(",") );
148  std::vector<uint16_t> moduleIdVec;
149  for ( const auto& module: splitModuleIDs ) moduleIdVec.push_back( std::stoi( module ) );
150  std::sort(moduleIdVec.begin(), moduleIdVec.end());
151 
152  if (moduleIdVec.empty()) {
153  ATH_MSG_ERROR( "No HLT result module IDs given for " << typeKeyAux );
154  return StatusCode::FAILURE;
155  }
156 
157  ATH_MSG_DEBUG( "Transient type " << transientType << " persistent type " << persistentType << " will be written to " << moduleIdVec.size() << " result ROBFragments with IDs: "
158  << moduleIdVec << "" );
159 
160  if ( persistentType.rfind("xAOD", 0) != std::string::npos ) { // xAOD - either interface of Aux
162  if ( typeKeyAux.find('.') != std::string::npos ) { // Aux, possibly with selection of variables
163  ATH_MSG_DEBUG( "with aux content: " );
164  const std::string allVars = typeKeyAux.substr( typeKeyAux.find('.')+1 );
165  if (!allVars.empty()) {
166  std::set<std::string> variableNames;
167  boost::split( variableNames, allVars, [](const char c){ return c == '.'; } );
168  if (msgLvl(MSG::DEBUG)) {
169  for ( const auto& el: variableNames ) {
170  ATH_MSG_DEBUG( " \"" << el << "\"" );
171  }
172  }
173  sel.selectAux( variableNames );
174  }
175  addressVec.push_back( {transientType, persistentType, clid, key, moduleIdVec, Address::Category::xAODAux, truncationMode, sel} );
176  } else {
177  addressVec.push_back( {transientType, persistentType, clid, key, moduleIdVec, Address::Category::xAODInterface, truncationMode} );
178  }
179  } else { // an old T/P type
180  addressVec.push_back( {transientType, persistentType, clid, key, moduleIdVec, Address::Category::OldTP, truncationMode} );
181  }
182  return StatusCode::SUCCESS;
183 }

◆ fill()

StatusCode TriggerEDMSerialiserTool::fill ( HLT::HLTResultMT resultToFill,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 402 of file TriggerEDMSerialiserTool.cxx.

402  {
403 
404  // Leave this check until there is a justified case for appending data to an existing result
405  if (not resultToFill.getSerialisedData().empty()) {
406  ATH_MSG_ERROR("Trying to fill a result which is not empty! Likely misconfiguration, returning a FAILURE");
407  return StatusCode::FAILURE;
408  }
409 
410  SGImplSvc* evtStore = dynamic_cast<SGImplSvc*>(Atlas::getExtendedEventContext(ctx).proxy());
411  ATH_CHECK( evtStore != nullptr );
412 
413  // Map storing information to be written out in case of truncation for each module
414  TruncationInfoMap truncationInfoMap;
415 
416  // Record debug info container to be filled in case of truncation
417  auto debugInfo = SG::makeHandle(m_debugInfoWHKey, ctx);
418  auto debugInfoData = std::make_unique<xAOD::TrigCompositeContainer>();
419  auto debugInfoAux = std::make_unique<xAOD::TrigCompositeAuxContainer>();
420  debugInfoData->setStore(debugInfoAux.get());
421  ATH_CHECK(debugInfo.record(std::move(debugInfoData), std::move(debugInfoAux)));
422 
423  // Find a list of active moduleIDs in this event to skip inactive ones
424  std::set<uint16_t> activeModules = activeModuleIDs(resultToFill);
425  if (activeModules.empty()) {
426  ATH_MSG_DEBUG("No active module IDs in this event. This is normal for events accepted "
427  << "only to calibration streams. Skip all EDM serialisation.");
428  return StatusCode::SUCCESS;
429  }
430 
431  // Create buffer for serialised data
432  std::vector<uint32_t> buffer;
433  buffer.reserve(1000);
434 
435  std::unordered_map<uint16_t, std::vector<uint32_t>> deferredInterfaceBuffer;
436  for ( const Address& address: m_toSerialise ) {
437  // Check if we need to serialise this object for this event
438  std::vector<uint16_t> addressActiveModuleIds;
439  std::set_intersection(address.moduleIdVec.begin(), address.moduleIdVec.end(),
440  activeModules.begin(), activeModules.end(),
441  std::back_inserter(addressActiveModuleIds));
442  if (addressActiveModuleIds.empty()) {
443  ATH_MSG_DEBUG("Streaming of " << address.persTypeName() << " is skipped "
444  << "because its module IDs are not active in this event");
445  continue;
446  }
447 
448  buffer.clear();
449  ATH_MSG_DEBUG( "Streaming " << address.persTypeName() );
450  ATH_CHECK( serialise(address, buffer, evtStore) );
451  if (buffer.empty()) {
452  ATH_MSG_DEBUG("Streaming of " << address.persTypeName() << " is skipped");
453  continue;
454  }
455 
456  const size_t thisFragmentSize = buffer.size()*sizeof(uint32_t);
457  ATH_MSG_DEBUG( "Serialised size of " << address.persTypeName() << " is " << thisFragmentSize << " bytes" );
458  for (const uint16_t id : addressActiveModuleIds) {
459  // If result not yet truncated, try adding the serialised data
460  if (resultToFill.getTruncatedModuleIds().count(id)==0) {
461  // for truncation allowed collections, save the interface for a deferred addition
462  if (address.truncationMode==Address::Truncation::Allowed &&
464  deferredInterfaceBuffer[id]=buffer;
465  continue;
466  }
467  else {
468  ATH_CHECK(tryAddData(resultToFill, id, buffer, address.truncationMode, deferredInterfaceBuffer));
469  // clean up the deferred interface buffer, if used
470  deferredInterfaceBuffer.erase(id);
471  }
472  }
473  // Check for truncation after adding data
474  if (resultToFill.getTruncatedModuleIds().count(id)==0) {
475  ATH_MSG_DEBUG("Module " << id << " payload after inserting " << address.persTypeName() << " has "
476  << resultToFill.getSerialisedData().at(id).size()*sizeof(uint32_t) << " bytes");
477  truncationInfoMap[id].push_back({&address, thisFragmentSize, true});
478  }
479  else {
480  ATH_MSG_WARNING("HLTResult with module ID " << id <<
481  " truncated - could not add " << address.persTypeName() <<
482  (address.truncationMode==Address::Truncation::Allowed ? " (truncation allowed)" : ""));
483  truncationInfoMap[id].push_back({&address, thisFragmentSize, false});
484  }
485  }
486  }
487 
488  // Handle truncation
489  ATH_CHECK(fillDebugInfo(truncationInfoMap, *debugInfo, resultToFill, evtStore));
490 
491  return StatusCode::SUCCESS;
492 }

◆ fillDebugInfo()

StatusCode TriggerEDMSerialiserTool::fillDebugInfo ( const TruncationInfoMap truncationInfoMap,
xAOD::TrigCompositeContainer debugInfoCont,
HLT::HLTResultMT resultToFill,
SGImplSvc evtStore 
) const
private

Parse the truncation debug information, fill monitoring histograms, fill and record the debug info collection.

Definition at line 538 of file TriggerEDMSerialiserTool.cxx.

541  {
542  // If full result truncation happened, flag all results as truncated to produce debug info for all
543  if (resultToFill.getTruncatedModuleIds().count(fullResultTruncationID)>0) {
544  ATH_MSG_ERROR("HLT result truncation on total size! Limit of "
545  << m_truncationThresholds.value().at(fullResultTruncationID)/1024./1024.
546  << " MB exceeded. Flagging all module IDs as truncated.");
547  for (const auto& [id, data] : resultToFill.getSerialisedData()) {
548  resultToFill.addTruncatedModuleId(id);
549  }
550  }
551  // Loop over truncation info and fill histograms and debug info objects
552  for (const auto& [id, truncationInfoVec] : truncationInfoMap) {
553  if (resultToFill.getTruncatedModuleIds().count(id)>0) {
554  // Create and fill a debug info object
555  xAOD::TrigComposite* debugInfoThisModule = new xAOD::TrigComposite;
556  debugInfoCont.push_back(debugInfoThisModule); // the container in event store takes ownership of debugInfoThisModule
557  xAOD::TrigComposite::Accessor<uint16_t> moduleId("moduleId");
561  xAOD::TrigComposite::Accessor<std::vector<char>> isRecordedVec("isRecorded");
562  std::pair<std::string, size_t> largestRecorded{"None", 0};
563  std::pair<std::string, size_t> largestDropped{"None", 0};
564  std::pair<std::string, size_t> firstDropped{"None", 0};
565  moduleId(*debugInfoThisModule) = id;
566  uint32_t sizeSum = 0;
567  bool severeTruncation = false;
568  bool truncated = false;
569  for (const TruncationInfo& truncationInfo : truncationInfoVec) {
570  // Store typeName and size information
571  sizeSum += truncationInfo.size;
572  typeNameVec(*debugInfoThisModule).push_back(truncationInfo.addrPtr->persTypeName());
573  sizeVec(*debugInfoThisModule).push_back(truncationInfo.size);
574  isRecordedVec(*debugInfoThisModule).push_back(static_cast<char>(truncationInfo.recorded));
575  if (truncationInfo.recorded && truncationInfo.size > largestRecorded.second) {
576  largestRecorded = {truncationInfo.addrPtr->persTypeName(), truncationInfo.size};
577  }
578  if (!truncationInfo.recorded && truncationInfo.size > largestDropped.second) {
579  largestDropped = {truncationInfo.addrPtr->persTypeName(), truncationInfo.size};
580  }
581  if (!truncationInfo.recorded && !truncated) {
582  firstDropped = {truncationInfo.addrPtr->persTypeName(), truncationInfo.size};
583  truncated = true;
584  }
585  // Decide if this was a severe truncation (event goes to debug stream)
586  if (!truncationInfo.recorded) {
587  severeTruncation |= (truncationInfo.addrPtr->truncationMode==Address::Truncation::Error);
588  }
589  }
590  totalSize(*debugInfoThisModule) = sizeSum;
591  msg(severeTruncation ? MSG::ERROR : MSG::WARNING)
592  << "HLT result truncation" << (severeTruncation ? "." : " in low priority collections.")
593  << " Module ID: " << id << ", limit: "
594  << m_truncationThresholds.value().at(id)/1024. << " kB, total size: "
595  << sizeSum/1024. << " kB, largest recorded collection: " << largestRecorded.first
596  << " (" << largestRecorded.second/1024. << " kB), largest dropped collection: "
597  << largestDropped.first << " (" << largestDropped.second/1024. << " kB), "
598  << " first dropped collection: " <<firstDropped.first << " (" << firstDropped.second/1024. << " kB)"
599  << endmsg;
600  // Give more information on the chains which accepted this event
601  using namespace TrigCompositeUtils;
602  SG::ReadHandle<DecisionContainer> navigation(m_debugNavigationSummaryRHKey); // Implicit ctx lookup - OK, rare code path
603  const Decision* terminus = getTerminusNode(navigation);
604  if (terminus) {
605  std::stringstream ss;
606  ss << "Passing chains in this event: ";
607  for (const DecisionID chainID : decisionIDs(terminus)) {
608  ss << HLT::Identifier(chainID).name() << ", ";
609  addDecisionID(chainID, debugInfoThisModule); // Save this list also into the output, it is then accessible offline too
610  }
611  ATH_MSG_WARNING(ss.str());
612  }
613  // Monitoring
614  const std::string prefix = severeTruncation ? "" : "Allowed";
615  auto monModuleId = Monitored::Scalar<int>(prefix+"Truncation_ModuleId", id);
616  auto monTotalSize = Monitored::Scalar<float>(prefix+"Truncation_TotalSize", sizeSum/1024.);
617  auto monLargestName = Monitored::Scalar<std::string>(
618  prefix+"Truncation_LargestName",
619  largestRecorded.second > largestDropped.second ? largestRecorded.first : largestDropped.first);
620  auto monLargestSize = Monitored::Scalar<float>(
621  prefix+"Truncation_LargestSize",
622  largestRecorded.second > largestDropped.second ? largestRecorded.second/1024. : largestDropped.second/1024.);
623  auto mon = Monitored::Group(m_monTool, monModuleId, monTotalSize, monLargestName, monLargestSize);
624  }
625  }
626  // Serialise and write the debug info only in case of truncation
627  if (!debugInfoCont.empty()) {
628  std::vector<Address> debugInfoAddressVec;
629  const std::string debugInfoID = std::string("xAOD::TrigCompositeContainer#")+m_debugInfoWHKey.key()+";0";
630  const std::string debugInfoAuxID = std::string("xAOD::TrigCompositeAuxContainer#")+m_debugInfoWHKey.key()+"Aux.;0";
631  ATH_CHECK(addCollectionToSerialise(debugInfoID, debugInfoAddressVec));
632  ATH_CHECK(addCollectionToSerialise(debugInfoAuxID, debugInfoAddressVec));
633  std::vector<uint32_t> buffer;
634  for (const Address& address : debugInfoAddressVec) {
635  buffer.clear();
636  ATH_CHECK( serialise(address, buffer, evtStore) );
637  resultToFill.addSerialisedData(0, buffer); // 0 is the main result ID
638  // It would be better to avoid hard-coding main result ID but it should not be configurable either
639  }
640  }
641  return StatusCode::SUCCESS;
642 }

◆ fillPayload()

StatusCode TriggerEDMSerialiserTool::fillPayload ( const void *  data,
size_t  sz,
std::vector< uint32_t > &  buffer 
) const
private

Copy bytes from the memory into the buffer converting from char[] to uint32_t[] This function is candidate to be made global function at some point and we will need also readPayload function.

Definition at line 198 of file TriggerEDMSerialiserTool.cxx.

198  {
199  ATH_CHECK( sz != 0 );
200  ATH_CHECK( data != nullptr );
201 
202  buffer.push_back( sz ); // size in bytes
203  const size_t neededSize = std::ceil( double(sz)/sizeof(uint32_t) );
204  const size_t existingSize = buffer.size();
205  buffer.resize(existingSize + neededSize);
206  std::memcpy(buffer.data() + existingSize, data, sz);
207  return StatusCode::SUCCESS;
208 }

◆ initialize()

StatusCode TriggerEDMSerialiserTool::initialize ( )
overridevirtual

Definition at line 37 of file TriggerEDMSerialiserTool.cxx.

37  {
38  // Initialise tools and services
39  ATH_CHECK( m_serializerSvc.retrieve() );
40  ATH_CHECK( m_clidSvc.retrieve() );
41  ATH_CHECK( m_debugInfoWHKey.initialize() );
43  if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
44  // Parse the list of collections to serialise
45  for ( const std::string& typeKeyAuxIDs : m_collectionsToSerialize.value() ) {
47  }
48 
49  // Retrieve the total result size limit from DataFlowConfig which is a special object
50  // used online to hold DF properties passed from TDAQ to HLT as run parameters
51  auto jobOptionsSvc = service<Gaudi::Interfaces::IOptionsSvc>("JobOptionsSvc", /*createIf=*/ false);
52  if (!jobOptionsSvc.isValid()) {
53  ATH_MSG_WARNING("Could not retrieve JobOptionsSvc, will not update the EventSizeHardLimitMB property");
54  }
55  else {
56  if (jobOptionsSvc->has("DataFlowConfig.DF_MaxEventSizeMB")) {
57  if (m_eventSizeHardLimitMB.fromString(jobOptionsSvc->get("DataFlowConfig.DF_MaxEventSizeMB")).isSuccess()) {
58  ATH_MSG_DEBUG("Updated EventSizeHardLimitMB to " << m_eventSizeHardLimitMB.value()
59  << " from DataFlowConfig.DF_MaxEventSizeMB");
60  }
61  else {
62  ATH_MSG_ERROR("Could not convert DataFlowConfig.DF_MaxEventSizeMB to integer. Leaving EventSizeHardLimitMB="
63  << m_eventSizeHardLimitMB.value());
64  }
65  }
66  else {
67  ATH_MSG_DEBUG("Could not retrieve DataFlowConfig.DF_MaxEventSizeMB from JobOptionsSvc. This is fine if running "
68  << "offline, but should not happen online. Leaving EventSizeHardLimitMB="
69  << m_eventSizeHardLimitMB.value());
70  }
71  }
72 
73  // Add the total result size limit to truncation threshold map
74  if (m_eventSizeHardLimitMB >= 0) {
75  if (m_fullResultTruncationFrac > 1.0) {
76  ATH_MSG_ERROR("Fraction cannot be > 1.0, but FullResultTruncationFrac is set to " << m_fullResultTruncationFrac);
77  return StatusCode::FAILURE;
78  }
79  float totalResultSizeLimitBytes = m_fullResultTruncationFrac * m_eventSizeHardLimitMB * 1024. * 1024.;
80  m_truncationThresholds[fullResultTruncationID] = static_cast<uint32_t>(totalResultSizeLimitBytes);
81  }
82  else {
84  }
85 
86  return StatusCode::SUCCESS;
87 }

◆ makeHeader()

StatusCode TriggerEDMSerialiserTool::makeHeader ( const TriggerEDMSerialiserTool::Address address,
std::vector< uint32_t > &  buffer 
)
staticprivate

Given the ID of the collection (in address arg) insert basic streaming info into the buffer.

Definition at line 185 of file TriggerEDMSerialiserTool.cxx.

185  {
186  buffer.push_back(0); // fragment size placeholder
187  buffer.push_back( address.clid ); // type info via CLID
188 
189  std::vector<uint32_t> serializedLabel;
190  StringSerializer ss;
191  std::vector<std::string> descr({address.persType, address.key});
192  ss.serialize( descr, serializedLabel );
193  buffer.push_back( serializedLabel.size() );
194  buffer.insert( buffer.end(), serializedLabel.begin(), serializedLabel.end() ); // plain SG key
195  return StatusCode::SUCCESS;
196 }

◆ serialise()

StatusCode TriggerEDMSerialiserTool::serialise ( const Address address,
std::vector< uint32_t > &  buffer,
SGImplSvc evtStore 
) const
private

Retrieve data from event store, serialise and fill the buffer using one of the specific serialise methods, depending on the data type.

Definition at line 375 of file TriggerEDMSerialiserTool.cxx.

375  {
376  DataObject* dObj = evtStore->accessData( address.clid, address.key );
377  if ( dObj == nullptr ) {
378  ATH_MSG_DEBUG("Data Object with the CLID " << address.clid << " and the key " << address.key << " is missing");
379  return StatusCode::SUCCESS;
380  }
381 
382  void* rawptr = SG::fromStorable( dObj, address.clid, nullptr, msgLvl(MSG::DEBUG) );
383  if ( rawptr == nullptr ) {
384  ATH_MSG_DEBUG( "Data Object with key " << address.key << " can not be converted to void* for streaming" );
385  return StatusCode::SUCCESS;
386  }
387  ATH_MSG_DEBUG("Obtained raw pointer " << rawptr );
388 
389  if ( address.category == Address::Category::xAODInterface ) {
390  return serialiseContainer( rawptr, address, buffer );
391  }
392  if ( address.category == Address::Category::xAODAux ) {
393  return serialisexAODAuxContainer( rawptr, address, buffer, evtStore );
394  }
395  if ( address.category == Address::Category::OldTP ) {
396  return serialiseTPContainer( rawptr, address, buffer );
397  }
398  ATH_MSG_ERROR("Unknown Address category - neither of xAODInterface, xAODAux, OldTP");
399  return StatusCode::FAILURE;
400 }

◆ serialiseContainer()

StatusCode TriggerEDMSerialiserTool::serialiseContainer ( void *  data,
const Address address,
std::vector< uint32_t > &  buffer 
) const
private

Place inside the buffer the serialised container (can be either TP, xAOD) involves simple invocation of serialiser.

Definition at line 287 of file TriggerEDMSerialiserTool.cxx.

287  {
288 
289  RootType classDesc = RootType::ByNameNoQuiet( address.persType );
290  size_t sz=0;
291  void* mem = m_serializerSvc->serialize( data, classDesc, sz );
292 
293  ATH_MSG_DEBUG( "Streamed to buffer at address " << mem << " of " << sz << " bytes" );
294 
295  if ( mem == nullptr or sz == 0 ) {
296  ATH_MSG_ERROR( "Serialisation of " << address.persType << " " << address.key << " unsuccessful" );
297  return StatusCode::FAILURE;
298  }
299 
300  // prepare fragment
301  std::vector<uint32_t> fragment;
302  ATH_CHECK( makeHeader( address, fragment ) );
303  ATH_CHECK( fillPayload( mem, sz, fragment ) );
304  if ( mem != nullptr ) delete [] static_cast<const char*>( mem );
305 
306 
307  ATH_MSG_DEBUG( address.transType << "#" << address.key << " Fragment size: " << fragment.size()*sizeof(uint32_t) << " bytes");
308  fragment[0] = fragment.size();
309  buffer.insert( buffer.end(), fragment.begin(), fragment.end() );
310 
311  return StatusCode::SUCCESS;
312 }

◆ serialiseDynAux()

StatusCode TriggerEDMSerialiserTool::serialiseDynAux ( DataObject *  dObject,
const Address address,
std::vector< uint32_t > &  buffer,
size_t &  nDynWritten 
) const
private

Add dynamic variables to the payload.

Definition at line 212 of file TriggerEDMSerialiserTool.cxx.

212  {
213  ATH_MSG_DEBUG( "" );
214  ATH_MSG_DEBUG( "About to start streaming aux data of " << address.key );
215  DataBucketBase* dObjAux = dynamic_cast<DataBucketBase*>(dObj);
216  ATH_CHECK( dObjAux != nullptr );
217 
218  const SG::IAuxStoreIO* auxStoreIO = dObjAux->template cast<SG::IAuxStoreIO> (nullptr, true);
219  if ( auxStoreIO == nullptr ) {
220  ATH_MSG_DEBUG( "Can't obtain AuxContainerBase of " << address.key << " no dynamic variables presumably" );
221  return StatusCode::SUCCESS;
222  }
223 
224  const SG::auxid_set_t& selected = address.sel.getSelectedAuxIDs( auxStoreIO->getDynamicAuxIDs() );
225 
226  if ( selected.empty() ) {
227  ATH_MSG_VERBOSE( "Empty set of dynamic variables to store, do nothing" );
228  return StatusCode::SUCCESS;
229  }
230  ATH_MSG_DEBUG("Ready for serialisation of " << selected.size() << " dynamic variables");
231 
232  for (SG::auxid_t auxVarID : selected ) {
233 
234  const std::string decorationName = SG::AuxTypeRegistry::instance().getName(auxVarID);
235  const std::type_info* tinfo = auxStoreIO->getIOType (auxVarID);
236  const std::string typeName = SG::AuxTypeRegistry::instance().getVecTypeName(auxVarID);
237  const std::string fullTypeName = System::typeinfoName( *tinfo );
238 
239  ATH_CHECK( tinfo != nullptr );
240  TClass* cls = TClass::GetClass (*tinfo);
241  ATH_CHECK( cls != nullptr );
242  ATH_MSG_DEBUG( "" );
243  ATH_MSG_DEBUG( "Streaming '" << decorationName << "' of type '" << typeName
244  << "' fulltype '" << fullTypeName << "' aux ID '" << auxVarID << "' class '" << cls->GetName() );
245 
246  CLID clid{0};
247  if ( m_clidSvc->getIDOfTypeName(typeName, clid).isFailure() ) { // First try
248  if ( m_clidSvc->getIDOfTypeInfoName(fullTypeName, clid).isFailure() ) { // Second try
249  ATH_MSG_ERROR("Unable to obtain CLID for either typeName:" << typeName << " or fullTypeName:" << fullTypeName);
250  ATH_MSG_ERROR("Please check if this is something which should obtain a CLID via TriggerEDMCLIDs.h");
251  return StatusCode::FAILURE;
252  }
253  }
254  ATH_MSG_DEBUG( "CLID " << clid );
255 
256  RootType classDesc = RootType::ByNameNoQuiet( cls->GetName() );
257 
258  const void* rawptr = auxStoreIO->getIOData( auxVarID );
259  ATH_CHECK( rawptr != nullptr );
260 
261  size_t sz=0;
262  void* mem = m_serializerSvc->serialize( rawptr, classDesc, sz );
263 
264  if ( mem == nullptr or sz == 0 ) {
265  ATH_MSG_ERROR( "Serialisation of " << address.persType <<"#" << address.key << "."<< decorationName << " unsuccessful" );
266  return StatusCode::FAILURE;
267  }
268  ATH_MSG_DEBUG( "Serialised " << address.persType <<"#" << address.key << "."<< decorationName << " memory size " << sz );
269 
270  std::vector<uint32_t> fragment;
271 
272  Address auxAddress { typeName, cls->GetName(), clid, decorationName, address.moduleIdVec, Address::Category::xAODDecoration };
273 
274  ATH_CHECK( makeHeader( auxAddress, fragment ) );
275  ATH_CHECK( fillPayload( mem, sz, fragment ) );
276  fragment[0] = fragment.size();
277 
278  delete [] static_cast<const char*>( mem );
279 
280  buffer.insert( buffer.end(), fragment.begin(), fragment.end() );
281  ++nDynWritten;
282  }
283  return StatusCode::SUCCESS;
284 }

◆ serialiseTPContainer()

StatusCode TriggerEDMSerialiserTool::serialiseTPContainer ( void *  data,
const Address address,
std::vector< uint32_t > &  buffer 
) const
private

Place inside the buffer the serialised old type of container involves T/P conversion.

Definition at line 360 of file TriggerEDMSerialiserTool.cxx.

360  {
361 
362  ATH_MSG_DEBUG("TP Container, converting from: " << address.transType << " to " << address.persType );
363  std::string converterPersistentType;
364  void * persistent = m_tpTool->convertTP( address.transType, data, converterPersistentType );
365  ATH_CHECK( persistent != nullptr );
366  ATH_CHECK ( converterPersistentType == address.persType );
368 
369  RootType classDesc = RootType::ByNameNoQuiet( address.persType );
370  classDesc.Destruct( persistent );
371 
372  return StatusCode::SUCCESS;
373 }

◆ serialisexAODAuxContainer()

StatusCode TriggerEDMSerialiserTool::serialisexAODAuxContainer ( void *  data,
const Address address,
std::vector< uint32_t > &  buffer,
SGImplSvc evtStore 
) const
private

Place inside the buffer serialised the xAOD Aux container involves selection and recording of dynamic variables.

Definition at line 314 of file TriggerEDMSerialiserTool.cxx.

319 {
320  ATH_MSG_DEBUG("xAOD Aux Container");
321 
322  void* copy = data;
323  RootType classDesc = RootType::ByNameNoQuiet( address.persType );
324  //Get the Base Info given clid.
325  const SG::BaseInfoBase* bib = SG::BaseInfoBase::find (address.clid);
326  //cast data to xAOD::AuxContainerBase
327  void* data_interface = bib->cast (data, ClassID_traits<xAOD::AuxContainerBase>::ID());
328  if (data_interface != nullptr) {
329  const xAOD::AuxContainerBase* store = reinterpret_cast<const xAOD::AuxContainerBase*> (data_interface);
330  copy = classDesc.Construct();
331  //cast copy to xAOD::AuxContainerBase
332  void* copy_interface = bib->cast (copy, ClassID_traits<xAOD::AuxContainerBase>::ID());
333  xAOD::AuxContainerBase* copy_store = reinterpret_cast<xAOD::AuxContainerBase*> (copy_interface);
335  *copy_store,
336  nullptr);
337  }
338 
340 
341  if (copy != data) {
342  classDesc.Destruct (copy);
343  }
344 
345  size_t baseSize = buffer.size();
346  if ( not m_saveDynamic )
347  return StatusCode::SUCCESS;
348 
349  DataObject* dObj = evtStore->accessData( address.clid, address.key );
350  ATH_CHECK( dObj != nullptr );
351  size_t nDynWritten = 0;
352  ATH_CHECK( serialiseDynAux( dObj, address, buffer, nDynWritten ) );
353  if ( nDynWritten > 0 ) {
354  ATH_MSG_DEBUG( " Fragment size including " << (buffer.size() - baseSize)*sizeof(uint32_t) << " bytes from "
355  << nDynWritten << "x DynAux : " << buffer.size()*sizeof(uint32_t) );
356  }
357  return StatusCode::SUCCESS;
358 }

◆ tryAddData()

StatusCode TriggerEDMSerialiserTool::tryAddData ( HLT::HLTResultMT hltResult,
const uint16_t  id,
const std::vector< uint32_t > &  data,
Address::Truncation  truncationMode,
const std::unordered_map< uint16_t, std::vector< uint32_t >> &  deferredInterfaceBuffer 
) const
private

Try appending serialised data to HLT result.

If data would exceed truncation threshold, don't add and flag the corresponding module ID as truncated.

Returns
FAILURE in case the truncation threshold is undefined

Definition at line 494 of file TriggerEDMSerialiserTool.cxx.

498  {
499  if (m_truncationThresholds.value().count(id)==0) {
500  ATH_MSG_ERROR("Module ID " << id << " missing from TruncationThresholds map. Cannot determine if result needs truncation");
501  return StatusCode::FAILURE;
502  }
503 
504  // Size in this module
505  const uint32_t currentSizeBytes = hltResult.getSerialisedData().count(id)==0
506  ? 0 : hltResult.getSerialisedData().at(id).size()*sizeof(uint32_t);
507  // Total size
508  size_t currentTotalSizeWords = 0;
509  for (const auto& [id, data] : hltResult.getSerialisedData()) currentTotalSizeWords += data.size();
510  const uint32_t currentTotalSizeBytes = currentTotalSizeWords*sizeof(uint32_t);
511  // Size to be added
512  const uint32_t extraSizeBytes = data.size()*sizeof(uint32_t);
513 
514  bool severeTruncation = truncationMode==Address::Truncation::Error;
515  if (currentTotalSizeBytes+extraSizeBytes > m_truncationThresholds.value().at(fullResultTruncationID)) {
516  // The data doesn't fit, flag the full result as truncated
517  ATH_MSG_DEBUG("Skipping adding data to result with module ID " << id << " because of full-result truncation");
518  hltResult.addTruncatedModuleId(fullResultTruncationID, severeTruncation);
519  hltResult.addTruncatedModuleId(id, severeTruncation);
520  }
521  else if (currentSizeBytes+extraSizeBytes > m_truncationThresholds.value().at(id)) {
522  // The data doesn't fit, flag this module's result as truncated
523  ATH_MSG_DEBUG("Skipping adding data to truncated result with module ID " << id);
524  hltResult.addTruncatedModuleId(id, severeTruncation);
525  }
526  else {
527  // for truncation allowed collections, add first the interface, only if the Aux is can be stored
528  if (truncationMode==Address::Truncation::Allowed){
529  hltResult.addSerialisedData(id, deferredInterfaceBuffer.at(id));
530  }
531  // The data fits, so add it to the result
532  ATH_MSG_DEBUG("Adding data to result with module ID " << id);
533  hltResult.addSerialisedData(id, data);
534  }
535  return StatusCode::SUCCESS;
536 }

◆ version()

std::string TriggerEDMSerialiserTool::version ( const std::string &  name)
staticprivate

Obtain version from the actual type name.

Definition at line 644 of file TriggerEDMSerialiserTool.cxx.

644  {
645  if ( name.find("DataVector") != std::string::npos ) {
646  size_t start = name.find('_');
647  return name.substr( start, name.find('>') - start );
648  }
649  if ( name.find('_') != std::string::npos ) {
650  return name.substr( name.find('_') );
651  }
652  return "";
653 }

Friends And Related Function Documentation

◆ tester

StatusCode tester ( TriggerEDMSerialiserTool )
friend

Member Data Documentation

◆ m_clidSvc

ServiceHandle<IClassIDSvc> TriggerEDMSerialiserTool::m_clidSvc
private
Initial value:
{ this, "ClassIDSvc", "ClassIDSvc",
"Service to translate class name to CLID" }

Definition at line 122 of file TriggerEDMSerialiserTool.h.

◆ m_collectionsToSerialize

Gaudi::Property< std::vector< std::string > > TriggerEDMSerialiserTool::m_collectionsToSerialize
private
Initial value:
{
this, "CollectionsToSerialize", {},
"EDM streaming configuration \'collectionKeyType;module1,module2,...[;allowTruncation]\' where collectionKeyType is a string "
"formatted like for AthenaOutputStream, e.g. TYPE#SG.aux1.aux2..etc. For xAOD classes the typedef type should be "
"used and the _vN version number is automatically detected. For old T/P classes the persistent version has to be "
"given. Module IDs following the semicolon are the HLT result ROB module IDs to which the collection should be "
"written. ID=0 is the main result, other IDs are used for data scouting. The optional allowTruncation "
"indicates if the collection can be truncated without raising an ERROR.",
"OrderedSet<std::string>"
}

Definition at line 53 of file TriggerEDMSerialiserTool.h.

◆ m_debugInfoWHKey

SG::WriteHandleKey<xAOD::TrigCompositeContainer> TriggerEDMSerialiserTool::m_debugInfoWHKey
private
Initial value:
{
this, "DebugInfoWHKey", "TruncationDebugInfo"
}

StoreGate key for the truncation debug info object.

Definition at line 79 of file TriggerEDMSerialiserTool.h.

◆ m_debugNavigationSummaryRHKey

SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> TriggerEDMSerialiserTool::m_debugNavigationSummaryRHKey
private
Initial value:
{
this, "NavigationSummaryRHKey", "HLTNav_Summary"
}

StoreGate key for the navigation summary object - with this we can print which chains accepted the event which truncated.

Definition at line 83 of file TriggerEDMSerialiserTool.h.

◆ m_eventSizeHardLimitMB

Gaudi::Property<int> TriggerEDMSerialiserTool::m_eventSizeHardLimitMB
private
Initial value:
{
this, "EventSizeHardLimitMB", -1,
"Hard limit for output event size in megabytes. Set automatically in initialize from run parameters. "
"In partition, it corresponds to DCM sbaBlockSize_MiB. Value <0 means no limit."
}

Definition at line 69 of file TriggerEDMSerialiserTool.h.

◆ m_fullResultTruncationFrac

Gaudi::Property<float> TriggerEDMSerialiserTool::m_fullResultTruncationFrac
private
Initial value:
{
this, "FullResultTruncationFrac", 0.8,
"Fraction of EventSizeHardLimitMB which defines the limit on the total size of HLT output (sum of all modules)"
}

Definition at line 74 of file TriggerEDMSerialiserTool.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> TriggerEDMSerialiserTool::m_monTool { this, "MonTool", "", "Monitoring tool" }
private

Definition at line 130 of file TriggerEDMSerialiserTool.h.

◆ m_saveDynamic

Gaudi::Property<bool> TriggerEDMSerialiserTool::m_saveDynamic
private
Initial value:
{
this, "SaveDynamic", true, "If false skips serialising of dynamic variables. Use for test purpose only."
}

Definition at line 63 of file TriggerEDMSerialiserTool.h.

◆ m_serializerSvc

ServiceHandle<IAthenaSerializeSvc> TriggerEDMSerialiserTool::m_serializerSvc
private
Initial value:
{ this, "Serializer", "AthenaRootSerializeSvc",
"Service to translate transient to persistent representation" }

Definition at line 124 of file TriggerEDMSerialiserTool.h.

◆ m_toSerialise

std::vector< Address > TriggerEDMSerialiserTool::m_toSerialise
private

Definition at line 120 of file TriggerEDMSerialiserTool.h.

◆ m_tpTool

ToolHandle<TrigSerTPTool> TriggerEDMSerialiserTool::m_tpTool
private
Initial value:
{ this, "TPTool", "TrigSerTPTool/TrigSerTPTool",
"Tool to do Transient/Persistent conversion (Old EDM)"}

Definition at line 127 of file TriggerEDMSerialiserTool.h.

◆ m_truncationThresholds

Gaudi::Property<std::map<uint16_t,uint32_t> > TriggerEDMSerialiserTool::m_truncationThresholds
private
Initial value:
{
this, "TruncationThresholds", {}, "HLT result truncation thresholds. Key is module ID, value is max size in bytes"
}

Definition at line 66 of file TriggerEDMSerialiserTool.h.


The documentation for this class was generated from the following files:
SG::copyAuxStoreThinned
void copyAuxStoreThinned(const SG::IConstAuxStore &orig, SG::IAuxStore &copy, const SG::ThinningInfo *info)
Helper to copy an aux store while applying thinning.
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
python.TriggerEDMRun3.persistent
def persistent(transient)
Definition: TriggerEDMRun3.py:1171
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
fitman.sz
sz
Definition: fitman.py:527
get_generator_info.result
result
Definition: get_generator_info.py:21
TScopeAdapter::ByNameNoQuiet
static TScopeAdapter ByNameNoQuiet(const std::string &name, Bool_t load=kTRUE)
Definition: RootType.cxx:581
TriggerEDMSerialiserTool::addCollectionToSerialise
StatusCode addCollectionToSerialise(const std::string &typeKeyAuxIDs, std::vector< Address > &addressVec) const
Parse entry from m_collectionsToSerialize and add it to m_toSerialise.
Definition: TriggerEDMSerialiserTool.cxx:89
TriggerEDMSerialiserTool::m_eventSizeHardLimitMB
Gaudi::Property< int > m_eventSizeHardLimitMB
Definition: TriggerEDMSerialiserTool.h:69
max
#define max(a, b)
Definition: cfImp.cxx:41
TrigCompositeUtils::DecisionID
unsigned int DecisionID
Definition: TrigComposite_v1.h:27
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
TriggerEDMSerialiserTool::m_truncationThresholds
Gaudi::Property< std::map< uint16_t, uint32_t > > m_truncationThresholds
Definition: TriggerEDMSerialiserTool.h:66
DataBucketBase
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
Definition: DataBucketBase.h:24
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:49
xAOD::TrigComposite
TrigComposite_v1 TrigComposite
Declare the latest version of the class.
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:16
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
SG::fromStorable
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
Definition: StorableConversions.h:180
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TriggerEDMSerialiserTool::m_clidSvc
ServiceHandle< IClassIDSvc > m_clidSvc
Definition: TriggerEDMSerialiserTool.h:122
SG::AuxTypeRegistry::getName
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
Definition: AuxTypeRegistry.cxx:277
TrigCompositeUtils::addDecisionID
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Definition: TrigCompositeUtilsRoot.cxx:61
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
TriggerEDMSerialiserTool::TruncationInfoMap
std::unordered_map< uint16_t, std::vector< TruncationInfo > > TruncationInfoMap
Typedef for collection of TruncationInfo objects for full event.
Definition: TriggerEDMSerialiserTool.h:118
SG::AuxTypeRegistry::getVecTypeName
std::string getVecTypeName(SG::auxid_t auxid) const
Return the type of the STL vector used to hold an aux data item.
Definition: AuxTypeRegistry.cxx:343
xAOD::AuxContainerBase
Common base class for the auxiliary containers.
Definition: AuxContainerBase.h:59
CaloClusterListBadChannel.cls
cls
Definition: CaloClusterListBadChannel.py:8
TriggerEDMSerialiserTool::m_collectionsToSerialize
Gaudi::Property< std::vector< std::string > > m_collectionsToSerialize
Definition: TriggerEDMSerialiserTool.h:53
TriggerEDMSerialiserTool::m_debugNavigationSummaryRHKey
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_debugNavigationSummaryRHKey
StoreGate key for the navigation summary object - with this we can print which chains accepted the ev...
Definition: TriggerEDMSerialiserTool.h:83
TriggerEDMSerialiserTool::tryAddData
StatusCode tryAddData(HLT::HLTResultMT &hltResult, const uint16_t id, const std::vector< uint32_t > &data, Address::Truncation truncationMode, const std::unordered_map< uint16_t, std::vector< uint32_t >> &deferredInterfaceBuffer) const
Try appending serialised data to HLT result.
Definition: TriggerEDMSerialiserTool.cxx:494
TriggerEDMSerialiserTool::serialiseTPContainer
StatusCode serialiseTPContainer(void *data, const Address &address, std::vector< uint32_t > &buffer) const
Place inside the buffer the serialised old type of container involves T/P conversion.
Definition: TriggerEDMSerialiserTool.cxx:360
TriggerEDMSerialiserTool::makeHeader
static StatusCode makeHeader(const TriggerEDMSerialiserTool::Address &address, std::vector< uint32_t > &buffer)
Given the ID of the collection (in address arg) insert basic streaming info into the buffer.
Definition: TriggerEDMSerialiserTool.cxx:185
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TriggerEDMSerialiserTool::fillPayload
StatusCode fillPayload(const void *data, size_t sz, std::vector< uint32_t > &buffer) const
Copy bytes from the memory into the buffer converting from char[] to uint32_t[] This function is cand...
Definition: TriggerEDMSerialiserTool.cxx:198
SG::IAuxStoreIO::getIOType
virtual const std::type_info * getIOType(SG::auxid_t auxid) const =0
Return the type of the data to be stored for one aux data item.
SG::BaseInfoBase::cast
void * cast(void *p, CLID clid) const
Cast to a base pointer.
Definition: BaseInfo.cxx:166
TriggerEDMSerialiserTool::Address::Category::xAODAux
@ xAODAux
SG::IAuxStoreIO
Interface providing I/O for a generic auxiliary store.
Definition: IAuxStoreIO.h:44
TriggerEDMSerialiserTool::m_debugInfoWHKey
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_debugInfoWHKey
StoreGate key for the truncation debug info object.
Definition: TriggerEDMSerialiserTool.h:79
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
Atlas::getExtendedEventContext
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
Definition: ExtendedEventContext.cxx:32
TrigCompositeUtils::getTerminusNode
const Decision * getTerminusNode(SG::ReadHandle< DecisionContainer > &container)
Definition: TrigCompositeUtilsRoot.cxx:243
TriggerEDMSerialiserTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TriggerEDMSerialiserTool.h:130
python.PyAthena.module
module
Definition: PyAthena.py:134
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
CxxUtils::ConcurrentBitset::size
bit_t size() const
Count the number of 1 bits in the set.
TriggerEDMSerialiserTool::activeModuleIDs
static std::set< uint16_t > activeModuleIDs(const HLT::HLTResultMT &result)
Build a list of module IDs to serialise based on the stream tags.
Definition: TriggerEDMSerialiserTool.cxx:655
HLT::HLTResultMT::getTruncatedModuleIds
const std::set< uint16_t > & getTruncatedModuleIds() const
Getter for the truncation information.
Definition: HLTResultMT.cxx:251
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
TriggerEDMSerialiserTool::serialise
StatusCode serialise(const Address &address, std::vector< uint32_t > &buffer, SGImplSvc *evtStore) const
Retrieve data from event store, serialise and fill the buffer using one of the specific serialise met...
Definition: TriggerEDMSerialiserTool.cxx:375
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
sel
sel
Definition: SUSYToolsTester.cxx:92
HLT::HLTResultMT::addTruncatedModuleId
void addTruncatedModuleId(const uint16_t moduleId, bool severeTruncation=true)
Add module ID to the list of truncated results.
Definition: HLTResultMT.cxx:256
HLT::HLTResultMT::addSerialisedData
void addSerialisedData(const uint16_t moduleId, const std::vector< uint32_t > &data)
Append serialised data (copy of input) for a given moduleId, doesn't remove existing data.
Definition: HLTResultMT.cxx:173
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
TriggerEDMSerialiserTool::version
static std::string version(const std::string &name)
Obtain version from the actual type name.
Definition: TriggerEDMSerialiserTool.cxx:644
TriggerEDMSerialiserTool::m_serializerSvc
ServiceHandle< IAthenaSerializeSvc > m_serializerSvc
Definition: TriggerEDMSerialiserTool.h:124
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
test_pyathena.parent
parent
Definition: test_pyathena.py:15
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TriggerEDMSerialiserTool::m_tpTool
ToolHandle< TrigSerTPTool > m_tpTool
Definition: TriggerEDMSerialiserTool.h:127
CxxUtils::ConcurrentBitset::empty
bool empty() const
Return true if there are no 1 bits in the set.
python.TransformConfig.descr
descr
print "%s.properties()" % self.__name__
Definition: TransformConfig.py:360
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
SG::IAuxStoreIO::getDynamicAuxIDs
virtual const SG::auxid_set_t & getDynamicAuxIDs() const =0
Get the list of all dynamically created variables.
TScopeAdapter::Construct
void * Construct() const
Definition: RootType.cxx:661
TriggerEDMSerialiserTool::serialisexAODAuxContainer
StatusCode serialisexAODAuxContainer(void *data, const Address &address, std::vector< uint32_t > &buffer, SGImplSvc *evtStore) const
Place inside the buffer serialised the xAOD Aux container involves selection and recording of dynamic...
Definition: TriggerEDMSerialiserTool.cxx:314
TriggerEDMSerialiserTool::Address::Category::xAODDecoration
@ xAODDecoration
xAOD::AuxSelection
Class helping in dealing with dynamic branch selection.
Definition: AuxSelection.h:31
TriggerEDMSerialiserTool::m_toSerialise
std::vector< Address > m_toSerialise
Definition: TriggerEDMSerialiserTool.h:120
TriggerEDMSerialiserTool::Address::Category::xAODInterface
@ xAODInterface
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
HLT::HLTResultMT::getSerialisedData
const std::unordered_map< uint16_t, std::vector< uint32_t > > & getSerialisedData() const
Serialised data getter.
Definition: HLTResultMT.cxx:147
SG::BaseInfoBase::find
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Definition: BaseInfo.cxx:569
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
TriggerEDMSerialiserTool::m_saveDynamic
Gaudi::Property< bool > m_saveDynamic
Definition: TriggerEDMSerialiserTool.h:63
SG::IAuxStoreIO::getIOData
virtual const void * getIOData(SG::auxid_t auxid) const =0
Return a pointer to the data to be stored for one aux data item.
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
TriggerEDMSerialiserTool::Address::Truncation::Error
@ Error
TriggerEDMSerialiserTool::Address::Truncation
Truncation
Definition: TriggerEDMSerialiserTool.h:93
TriggerEDMSerialiserTool::m_fullResultTruncationFrac
Gaudi::Property< float > m_fullResultTruncationFrac
Definition: TriggerEDMSerialiserTool.h:74
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
TScopeAdapter::Destruct
void Destruct(void *place) const
Definition: RootType.cxx:672
plotBeamSpotMon.mon
mon
Definition: plotBeamSpotMon.py:67
SG::BaseInfoBase
The non-template portion of the BaseInfo implementation.
Definition: Control/AthenaKernel/AthenaKernel/BaseInfo.h:451
TrigCompositeUtils::decisionIDs
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Definition: TrigCompositeUtilsRoot.cxx:67
HLT::Identifier::name
std::string name() const
reports human redable name if it is enabled or, empty string
Definition: HLTIdentifier.cxx:14
TrigCompositeUtils
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:19
ReadCalibFromCool.typeName
typeName
Definition: ReadCalibFromCool.py:477
SG::auxid_set_t
A set of aux data identifiers.
Definition: AuxTypes.h:47
python.copyTCTOutput.totalSize
totalSize
Definition: copyTCTOutput.py:93
TriggerEDMSerialiserTool::Address::Truncation::Allowed
@ Allowed
TriggerEDMSerialiserTool::fillDebugInfo
StatusCode fillDebugInfo(const TruncationInfoMap &truncationInfoMap, xAOD::TrigCompositeContainer &debugInfoCont, HLT::HLTResultMT &resultToFill, SGImplSvc *evtStore) const
Parse the truncation debug information, fill monitoring histograms, fill and record the debug info co...
Definition: TriggerEDMSerialiserTool.cxx:538
calibdata.copy
bool copy
Definition: calibdata.py:27
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
set_intersection
Set * set_intersection(Set *set1, Set *set2)
Perform an intersection of two sets.
TScopeAdapter::IsComplete
Bool_t IsComplete() const
Definition: RootType.cxx:890
TriggerEDMSerialiserTool::serialiseDynAux
StatusCode serialiseDynAux(DataObject *dObject, const Address &address, std::vector< uint32_t > &buffer, size_t &nDynWritten) const
Add dynamic variables to the payload.
Definition: TriggerEDMSerialiserTool.cxx:212
TriggerEDMSerialiserTool::Address::Category::OldTP
@ OldTP
python.compressB64.c
def c
Definition: compressB64.py:93
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TriggerEDMSerialiserTool::serialiseContainer
StatusCode serialiseContainer(void *data, const Address &address, std::vector< uint32_t > &buffer) const
Place inside the buffer the serialised container (can be either TP, xAOD) involves simple invocation ...
Definition: TriggerEDMSerialiserTool.cxx:287
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
TScopeAdapter
Definition: RootType.h:119