ATLAS Offline Software
Loading...
Searching...
No Matches
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
 Internal structure to keep configuration organised conveniently. More...
class  TruncationInfo
 Internal structure to keep information for truncation debugging. More...

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 AuxIdTypeMap_t
 A thread-safe map to store the AuxId to Address mapping for dynamic variables.
using TruncationInfoMap = std::unordered_map<uint16_t, std::vector<TruncationInfo>>
 Typedef for collection of TruncationInfo objects for full event.

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.
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.
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.
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.
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.
StatusCode serialiseDynAux (DataObject *dObject, const Address &address, std::vector< uint32_t > &buffer, size_t &nDynWritten) const
 Add dynamic variables to the payload.
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.
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.
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.

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.
static std::string version (const std::string &name)
 Obtain version from the actual type name.
static std::set< uint16_t > activeModuleIDs (const HLT::HLTResultMT &result)
 Build a list of module IDs to serialise based on the stream tags.

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.
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainerm_debugNavigationSummaryRHKey
 StoreGate key for the navigation summary object - with this we can print which chains accepted the event which truncated.
AuxIdTypeMap_t m_dynAuxAddress ATLAS_THREAD_SAFE
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 40 of file TriggerEDMSerialiserTool.h.

Member Typedef Documentation

◆ AuxIdTypeMap_t

Initial value:
std::hash<SG::auxid_t>,
std::equal_to<SG::auxid_t>,
Simple (non-deleting) Updater implementation.
ConcurrentToValMap(Updater_t &&updater, size_type capacity=64, const Context_t &ctx=Updater_t::defaultContext())
Hash map from pointers/integers to arbitrary objects allowing concurrent, lockless reads.
static const auxid_t null_auxid
To signal no aux data item.
Definition AuxTypes.h:30
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27
Internal structure to keep configuration organised conveniently.

A thread-safe map to store the AuxId to Address mapping for dynamic variables.

Definition at line 112 of file TriggerEDMSerialiserTool.h.

◆ 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 131 of file TriggerEDMSerialiserTool.h.

Constructor & Destructor Documentation

◆ TriggerEDMSerialiserTool()

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

Definition at line 31 of file TriggerEDMSerialiserTool.cxx.

34 : base_class( type, name, parent ),
35 m_dynAuxAddress(AuxIdTypeMap_t::Updater_t()) {}

◆ ~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 661 of file TriggerEDMSerialiserTool.cxx.

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

◆ 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_view> def = CxxUtils::tokenize<std::string_view, char>(typeKeyAuxIDs, ';');
94
95 if ( def.size() < 2 ) {
96 ATH_MSG_ERROR("Invalid EDM collection specification: " << typeKeyAuxIDs);
97 return StatusCode::FAILURE;
98 }
99
100 const std::string_view typeKeyAux = def[0];
101 const std::string_view configuredType = typeKeyAux.substr( 0, typeKeyAux.find('#') );
102 const std::string_view key = typeKeyAux.substr( typeKeyAux.find('#')+1, typeKeyAux.find('.')-typeKeyAux.find('#') );
103
105
106 const size_t pos = configuredType.find('_');
107 const std::string transientType{ pos==std::string::npos ? configuredType : configuredType.substr(0, pos) };
108
109 CLID clid{0};
110 std::string persistentType;
111 if ( m_clidSvc->getIDOfTypeName(transientType, clid).isFailure() ) {
112 ATH_MSG_ERROR( "Can not find CLID for " << transientType << " that is needed for serialisation " << key );
113 return StatusCode::FAILURE;
114 }
115 ATH_MSG_VERBOSE("Decoded transient type: " << transientType << " with the CLID " << clid );
116
117 if ( transientType == configuredType ) {
118 std::string realTypeName;
119 if( m_clidSvc->getTypeInfoNameOfID( clid, realTypeName ).isFailure() ) {
120 ATH_MSG_ERROR( "Can not find real type name for " << transientType << " that is needed for serialisation " << key );
121 return StatusCode::FAILURE;
122 }
123 persistentType = transientType + version( realTypeName );
124 ATH_MSG_VERBOSE(transientType << " = "<< configuredType << " thus obtained real type name from clid svc " << realTypeName << " forming persistent type name "<< persistentType );
125 } else {
126 persistentType = configuredType;
127 }
128
129 ATH_MSG_DEBUG( "Persistent type: " << persistentType );
130
131 RootType classDesc = RootType::ByNameNoQuiet( persistentType );
132 if ( ! classDesc.IsComplete() ) {
133 ATH_MSG_ERROR( "The type " << persistentType << " is not known to ROOT serialiser" );
134 return StatusCode::FAILURE;
135 }
136
137 // Set truncation mode
138 if ( def.size() > 2 && def[2].contains("allowTruncation") ) {
139 ATH_MSG_DEBUG("Truncation allowed for " << configuredType << "#" << key);
140 truncationMode = Address::Truncation::Allowed;
141 }
142
143 std::vector<uint16_t> moduleIdVec = CxxUtils::tokenize<uint16_t, char>(def[1], ',');
144 std::sort(moduleIdVec.begin(), moduleIdVec.end());
145
146 if (moduleIdVec.empty()) {
147 ATH_MSG_ERROR( "No HLT result module IDs given for " << typeKeyAux );
148 return StatusCode::FAILURE;
149 }
150
151 ATH_MSG_DEBUG( "Transient type " << transientType << " persistent type " << persistentType << " will be written to " << moduleIdVec.size() << " result ROBFragments with IDs: "
152 << moduleIdVec << "" );
153
154 if ( persistentType.starts_with("xAOD") ) { // xAOD - either interface of Aux
155 xAOD::AuxSelection sel;
156 if ( typeKeyAux.contains('.') ) { // Aux, possibly with selection of variables
157 ATH_MSG_DEBUG( "with aux content: " );
158 const std::string allVars = std::string(typeKeyAux.substr( typeKeyAux.find('.')+1 ));
159 if (!allVars.empty()) {
160 const auto variableNames = allVars | std::views::split('.') | std::ranges::to<std::set<std::string>>();
161 if (msgLvl(MSG::DEBUG)) {
162 for ( const auto& el: variableNames ) {
163 ATH_MSG_DEBUG( " \"" << el << "\"" );
164 }
165 }
166 sel.selectAux( variableNames );
167 }
168 addressVec.push_back( {transientType, std::move(persistentType), std::move(classDesc), clid,
169 std::string(key), std::move(moduleIdVec), Address::Category::xAODAux, truncationMode, std::move(sel)} );
170 } else {
171 addressVec.push_back( {transientType, std::move(persistentType), std::move(classDesc), clid,
172 std::string(key), std::move(moduleIdVec), Address::Category::xAODInterface, truncationMode} );
173 }
174 } else { // an old T/P type
175 addressVec.push_back( {transientType, std::move(persistentType), std::move(classDesc), clid,
176 std::string(key), std::move(moduleIdVec), Address::Category::OldTP, truncationMode} );
177 }
178 return StatusCode::SUCCESS;
179}
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_VERBOSE(x,...)
uint32_t CLID
The Class ID type.
TTypeAdapter RootType
Definition RootType.h:211
static TScopeAdapter ByNameNoQuiet(const std::string &name, Bool_t load=kTRUE)
Definition RootType.cxx:586
Bool_t IsComplete() const
Definition RootType.cxx:895
static std::string version(const std::string &name)
Obtain version from the actual type name.
ServiceHandle< IClassIDSvc > m_clidSvc
std::vector< std::string > tokenize(std::string_view the_str, std::string_view delimiters)
Splits the string into smaller substrings.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ fill()

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

Definition at line 409 of file TriggerEDMSerialiserTool.cxx.

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

◆ 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 546 of file TriggerEDMSerialiserTool.cxx.

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

◆ 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 194 of file TriggerEDMSerialiserTool.cxx.

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

◆ 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) {
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 {
83 m_truncationThresholds[fullResultTruncationID] = std::numeric_limits<uint32_t>::max();
84 }
85
86 return StatusCode::SUCCESS;
87}
Gaudi::Property< int > m_eventSizeHardLimitMB
Gaudi::Property< std::vector< std::string > > m_collectionsToSerialize
ServiceHandle< IAthenaSerializeSvc > m_serializerSvc
Gaudi::Property< float > m_fullResultTruncationFrac

◆ 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 181 of file TriggerEDMSerialiserTool.cxx.

181 {
182 buffer.push_back(0); // fragment size placeholder
183 buffer.push_back( address.clid ); // type info via CLID
184
185 std::vector<uint32_t> serializedLabel;
186 StringSerializer ss;
187 std::vector<std::string> descr({address.persType, address.key});
188 ss.serialize( descr, serializedLabel );
189 buffer.push_back( serializedLabel.size() );
190 buffer.insert( buffer.end(), serializedLabel.begin(), serializedLabel.end() ); // plain SG key
191 return StatusCode::SUCCESS;
192}
list descr
print "%s.properties()" % self.__name__

◆ 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 382 of file TriggerEDMSerialiserTool.cxx.

382 {
383 DataObject* dObj = evtStore->accessData( address.clid, address.key );
384 if ( dObj == nullptr ) {
385 ATH_MSG_DEBUG("Data Object with the CLID " << address.clid << " and the key " << address.key << " is missing");
386 return StatusCode::SUCCESS;
387 }
388
389 void* rawptr = SG::fromStorable( dObj, address.clid, nullptr, msgLvl(MSG::DEBUG) );
390 if ( rawptr == nullptr ) {
391 ATH_MSG_DEBUG( "Data Object with key " << address.key << " can not be converted to void* for streaming" );
392 return StatusCode::SUCCESS;
393 }
394 ATH_MSG_DEBUG("Obtained raw pointer " << rawptr );
395
396 if ( address.category == Address::Category::xAODInterface ) {
397 return serialiseContainer( rawptr, address, buffer );
398 }
399 if ( address.category == Address::Category::xAODAux ) {
400 return serialisexAODAuxContainer( rawptr, address, buffer, evtStore );
401 }
402 if ( address.category == Address::Category::OldTP ) {
403 return serialiseTPContainer( rawptr, address, buffer );
404 }
405 ATH_MSG_ERROR("Unknown Address category - neither of xAODInterface, xAODAux, OldTP");
406 return StatusCode::FAILURE;
407}
DataObject * accessData(const CLID &id) const
find proxy and access its data. Returns 0 to flag failure
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.
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 ...
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...
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)

◆ 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 297 of file TriggerEDMSerialiserTool.cxx.

297 {
298
299 size_t sz=0;
300 void* mem = m_serializerSvc->serialize( data, address.classDesc, sz );
301
302 ATH_MSG_DEBUG( "Streamed to buffer at address " << mem << " of " << sz << " bytes" );
303
304 if ( mem == nullptr or sz == 0 ) {
305 ATH_MSG_ERROR( "Serialisation of " << address.persType << " " << address.key << " unsuccessful" );
306 return StatusCode::FAILURE;
307 }
308
309 // prepare fragment
310 std::vector<uint32_t> fragment;
311 ATH_CHECK( makeHeader( address, fragment ) );
312 ATH_CHECK( fillPayload( mem, sz, fragment ) );
313 if ( mem != nullptr ) delete [] static_cast<const char*>( mem );
314
315
316 ATH_MSG_DEBUG( address.transType << "#" << address.key << " Fragment size: " << fragment.size()*sizeof(uint32_t) << " bytes");
317 fragment[0] = fragment.size();
318 buffer.insert( buffer.end(), fragment.begin(), fragment.end() );
319
320 return StatusCode::SUCCESS;
321}
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.
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...

◆ 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 208 of file TriggerEDMSerialiserTool.cxx.

208 {
209 ATH_MSG_DEBUG( "About to start streaming aux data of " << address.key );
210 DataBucketBase* dObjAux = dynamic_cast<DataBucketBase*>(dObj);
211 ATH_CHECK( dObjAux != nullptr );
212 //coverity[FORWARD_NULL:FALSE]
213 const SG::IAuxStoreIO* auxStoreIO = dObjAux->template cast<SG::IAuxStoreIO> (nullptr, true);
214 if ( auxStoreIO == nullptr ) {
215 ATH_MSG_DEBUG( "Can't obtain AuxContainerBase of " << address.key << " no dynamic variables presumably" );
216 return StatusCode::SUCCESS;
217 }
218
219 const SG::auxid_set_t& selected = address.sel.getSelectedAuxIDs( auxStoreIO->getDynamicAuxIDs() );
220
221 if ( selected.empty() ) {
222 ATH_MSG_VERBOSE( "Empty set of dynamic variables to store, do nothing" );
223 return StatusCode::SUCCESS;
224 }
225 ATH_MSG_DEBUG("Ready for serialisation of " << selected.size() << " dynamic variables");
226
227 for (SG::auxid_t auxVarID : selected ) {
228
229 const Address* auxAddress{};
230
231 // Find type information for dynamic variable
232 const auto itr = m_dynAuxAddress.find(auxVarID);
233 if ( itr != m_dynAuxAddress.end() ) {
234 auxAddress = &(itr->second);
235 }
236 // Or create and cache it on first encounter. We cannot do this during addCollectionToSerialise
237 // because variables with AuxDataOptions set (e.g. PackedContainer) don't report their actual
238 // type through the AuxTypeRegistry (see ATR-32953).
239 else {
240 const std::string decorationName = SG::AuxTypeRegistry::instance().getName(auxVarID);
241 const std::string typeName = SG::AuxTypeRegistry::instance().getVecTypeName(auxVarID);
242 const std::type_info* tinfo = auxStoreIO->getIOType (auxVarID);
243
244 ATH_CHECK( tinfo != nullptr );
245 TClass* cls = TClass::GetClass (*tinfo);
246 ATH_CHECK( cls != nullptr );
247
248 CLID clid{0};
249 if ( m_clidSvc->getIDOfTypeName(typeName, clid).isFailure() ) { // First try
250 const std::string fullTypeName = System::typeinfoName( *tinfo );
251 if ( m_clidSvc->getIDOfTypeInfoName(fullTypeName, clid).isFailure() ) { // Second try
252 ATH_MSG_ERROR("Unable to obtain CLID for either typeName:" << typeName << " or fullTypeName:" << fullTypeName);
253 ATH_MSG_ERROR("Please check if this is something which should obtain a CLID via TriggerEDMCLIDs.h");
254 return StatusCode::FAILURE;
255 }
256 }
257
258 // Create the type information for the dynamic variable
259 Address addr { typeName, cls->GetName(), RootType(cls), clid,
260 decorationName, address.moduleIdVec, Address::Category::xAODDecoration };
261
262 // Store type and get pointer to it
263 const auto& [itr, inserted] = m_dynAuxAddress.emplace( auxVarID, std::move(addr) );
264 auxAddress = &(itr->second);
265 }
266
267 ATH_MSG_DEBUG( "Streaming '" << auxAddress->key << "' of type '" << auxAddress->transType <<
268 "', aux ID " << auxVarID << ", class '" << auxAddress->classDesc.Class()->GetName() <<
269 "'" << ", CLID " << auxAddress->clid );
270
271 const void* rawptr = auxStoreIO->getIOData( auxVarID );
272 ATH_CHECK( rawptr != nullptr );
273
274 size_t sz=0;
275 void* mem = m_serializerSvc->serialize( rawptr, auxAddress->classDesc, sz );
276
277 if ( mem == nullptr or sz == 0 ) {
278 ATH_MSG_ERROR( "Serialisation of " << address.persTypeName() << "."<< auxAddress->key << " unsuccessful" );
279 return StatusCode::FAILURE;
280 }
281 ATH_MSG_DEBUG( "Serialised " << address.persTypeName() << "."<< auxAddress->key << " memory size " << sz );
282
283 std::vector<uint32_t> fragment;
284 ATH_CHECK( makeHeader( *auxAddress, fragment ) );
285 ATH_CHECK( fillPayload( mem, sz, fragment ) );
286 fragment[0] = fragment.size();
287
288 delete [] static_cast<const char*>( mem );
289
290 buffer.insert( buffer.end(), fragment.begin(), fragment.end() );
291 ++nDynWritten;
292 }
293 return StatusCode::SUCCESS;
294}
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
std::string getVecTypeName(SG::auxid_t auxid) const
Return the type of the STL vector used to hold an aux data item.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
virtual const std::type_info * getIOType(SG::auxid_t auxid) const =0
Return the type of the data to be stored for one aux data item.
virtual const void * getIOData(SG::auxid_t auxid) const =0
Return a pointer to the data to be stored for one aux data item.
virtual const SG::auxid_set_t & getDynamicAuxIDs() const =0
Get the list of all dynamically created variables.

◆ 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 368 of file TriggerEDMSerialiserTool.cxx.

368 {
369
370 ATH_MSG_DEBUG("TP Container, converting from: " << address.transType << " to " << address.persType );
371 std::string converterPersistentType;
372 void * persistent = m_tpTool->convertTP( address.transType, data, converterPersistentType );
373 ATH_CHECK( persistent != nullptr );
374 ATH_CHECK ( converterPersistentType == address.persType );
375 ATH_CHECK( serialiseContainer( persistent, address, buffer ) );
376
377 address.classDesc.Destruct( persistent );
378
379 return StatusCode::SUCCESS;
380}
ToolHandle< TrigSerTPTool > m_tpTool

◆ 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 323 of file TriggerEDMSerialiserTool.cxx.

328{
329 ATH_MSG_DEBUG("xAOD Aux Container");
330
331 void* copy = data;
332 //Get the Base Info given clid.
333 const SG::BaseInfoBase* bib = SG::BaseInfoBase::find (address.clid);
334 //cast data to xAOD::AuxContainerBase
335 void* data_interface = bib->cast (data, ClassID_traits<xAOD::AuxContainerBase>::ID());
336 if (data_interface != nullptr) {
337 const xAOD::AuxContainerBase* store = reinterpret_cast<const xAOD::AuxContainerBase*> (data_interface);
338 copy = address.classDesc.Construct();
339 //cast copy to xAOD::AuxContainerBase
340 void* copy_interface = bib->cast (copy, ClassID_traits<xAOD::AuxContainerBase>::ID());
341 xAOD::AuxContainerBase* copy_store = reinterpret_cast<xAOD::AuxContainerBase*> (copy_interface);
343 *copy_store,
344 nullptr);
345 }
346
347 ATH_CHECK( serialiseContainer( copy, address, buffer ) );
348
349 if (copy != data) {
350 address.classDesc.Destruct (copy);
351 }
352
353 size_t baseSize = buffer.size();
354 if ( not m_saveDynamic )
355 return StatusCode::SUCCESS;
356
357 DataObject* dObj = evtStore->accessData( address.clid, address.key );
358 ATH_CHECK( dObj != nullptr );
359 size_t nDynWritten = 0;
360 ATH_CHECK( serialiseDynAux( dObj, address, buffer, nDynWritten ) );
361 if ( nDynWritten > 0 ) {
362 ATH_MSG_DEBUG( " Fragment size including " << (buffer.size() - baseSize)*sizeof(uint32_t) << " bytes from "
363 << nDynWritten << "x DynAux : " << buffer.size()*sizeof(uint32_t) );
364 }
365 return StatusCode::SUCCESS;
366}
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Definition BaseInfo.cxx:570
void * cast(void *p, CLID clid) const
Cast to a base pointer.
Definition BaseInfo.cxx:166
Gaudi::Property< bool > m_saveDynamic
StatusCode serialiseDynAux(DataObject *dObject, const Address &address, std::vector< uint32_t > &buffer, size_t &nDynWritten) const
Add dynamic variables to the payload.
TestStore store
Definition TestStore.cxx:23
void copyAuxStoreThinned(const SG::IConstAuxStore &orig, SG::IAuxStore &copy, const SG::ThinningInfo *info)
Helper to copy an aux store while applying thinning.
bool copy
Definition calibdata.py:26

◆ 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 502 of file TriggerEDMSerialiserTool.cxx.

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

◆ version()

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

Obtain version from the actual type name.

Definition at line 652 of file TriggerEDMSerialiserTool.cxx.

652 {
653 if ( name.contains("DataVector") ) {
654 const size_t start = name.find('_');
655 return name.substr( start, name.find('>') - start );
656 }
657 const size_t pos = name.find('_');
658 return (pos == std::string::npos ? std::string{} : name.substr( pos ));
659}

◆ tester

StatusCode tester ( TriggerEDMSerialiserTool * )
friend

Member Data Documentation

◆ ATLAS_THREAD_SAFE

AuxIdTypeMap_t m_dynAuxAddress TriggerEDMSerialiserTool::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 118 of file TriggerEDMSerialiserTool.h.

◆ m_clidSvc

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

Definition at line 135 of file TriggerEDMSerialiserTool.h.

135 { this, "ClassIDSvc", "ClassIDSvc",
136 "Service to translate class name to CLID" };

◆ 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 56 of file TriggerEDMSerialiserTool.h.

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

◆ 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 82 of file TriggerEDMSerialiserTool.h.

82 {
83 this, "DebugInfoWHKey", "TruncationDebugInfo"
84 };

◆ 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 86 of file TriggerEDMSerialiserTool.h.

86 {
87 this, "NavigationSummaryRHKey", "HLTNav_Summary"
88 };

◆ 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 72 of file TriggerEDMSerialiserTool.h.

72 {
73 this, "EventSizeHardLimitMB", -1,
74 "Hard limit for output event size in megabytes. Set automatically in initialize from run parameters. "
75 "In partition, it corresponds to DCM sbaBlockSize_MiB. Value <0 means no limit."
76 };

◆ 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 77 of file TriggerEDMSerialiserTool.h.

77 {
78 this, "FullResultTruncationFrac", 0.8,
79 "Fraction of EventSizeHardLimitMB which defines the limit on the total size of HLT output (sum of all modules)"
80 };

◆ m_monTool

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

Definition at line 143 of file TriggerEDMSerialiserTool.h.

143{ this, "MonTool", "", "Monitoring tool" };

◆ 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 66 of file TriggerEDMSerialiserTool.h.

66 {
67 this, "SaveDynamic", true, "If false skips serialising of dynamic variables. Use for test purpose only."
68 };

◆ m_serializerSvc

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

Definition at line 137 of file TriggerEDMSerialiserTool.h.

137 { this, "Serializer", "AthenaRootSerializeSvc",
138 "Service to translate transient to persistent representation" };

◆ m_toSerialise

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

Definition at line 133 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 140 of file TriggerEDMSerialiserTool.h.

140 { this, "TPTool", "TrigSerTPTool/TrigSerTPTool",
141 "Tool to do Transient/Persistent conversion (Old EDM)"};

◆ 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 69 of file TriggerEDMSerialiserTool.h.

69 {
70 this, "TruncationThresholds", {}, "HLT result truncation thresholds. Key is module ID, value is max size in bytes"
71 };

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