ATLAS Offline Software
Loading...
Searching...
No Matches
TriggerEDMDeserialiserAlg Class Reference

from the HLTResultMT Each serialised collection is a chunk of words with the content as described below. More...

#include <TriggerEDMDeserialiserAlg.h>

Inheritance diagram for TriggerEDMDeserialiserAlg:
Collaboration diagram for TriggerEDMDeserialiserAlg:

Classes

class  WritableAuxStore

Public Types

using Payload = std::vector<uint32_t>
using PayloadIterator = Payload::const_iterator

Public Member Functions

 TriggerEDMDeserialiserAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~TriggerEDMDeserialiserAlg () override=default
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &context) const override
virtual StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Attributes

static constexpr size_t CLIDOffset = 1
static constexpr size_t NameLengthOffset = 2
static constexpr size_t NameOffset = 3
static std::unique_ptr< TList > s_streamerInfoList ATLAS_THREAD_SAFE
static std::mutex s_mutex

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

void add_bs_streamerinfos ()
StatusCode deserialise (const EventContext &ctx, const Payload *dataptr) const
 Performs actual deserialisation loop.
StatusCode deserialiseDynAux (const EventContext &ctx, const std::string &transientTypeName, const std::string &persistentTypeName, const std::string &decorationName, void *obj, WritableAuxStore *currentAuxStore, SG::AuxVectorBase *interface) const
 Handle decoration.
StatusCode checkSanity (const std::string &transientTypeName, bool isxAODInterfaceContainer, bool isxAODAuxContainer, bool isDecoration, bool isTPContainer) const
 Checker for data integrity, one and only one of the passed booleans can be true, else FAILURE is returned and relevant diagnostics printed.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< HLT::HLTResultMT > m_resultKey
Gaudi::Property< std::string > m_prefix
Gaudi::Property< int > m_moduleID
Gaudi::Property< int > m_initialSerialisationBufferSize
Gaudi::Property< bool > m_skipDuplicates
Gaudi::Property< bool > m_permitMissingModule
ServiceHandle< IClassIDSvc > m_clidSvc
ServiceHandle< IAthenaSerializeSvc > m_serializerSvc
ToolHandle< TrigSerTPTool > m_tpTool
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Friends

StatusCode tester (TriggerEDMDeserialiserAlg *)

Detailed Description

from the HLTResultMT Each serialised collection is a chunk of words with the content as described below.

The [] == one word, the [...] more words. Format is as follows: [fragment size in words][CLID][size of serialised collection name][...serialised collection name ...][data payload in bytes][....data payload...] It follows from the TrigEDMSerialiserTool implementation.

Definition at line 28 of file TriggerEDMDeserialiserAlg.h.

Member Typedef Documentation

◆ Payload

using TriggerEDMDeserialiserAlg::Payload = std::vector<uint32_t>

Definition at line 32 of file TriggerEDMDeserialiserAlg.h.

◆ PayloadIterator

using TriggerEDMDeserialiserAlg::PayloadIterator = Payload::const_iterator

Definition at line 33 of file TriggerEDMDeserialiserAlg.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TriggerEDMDeserialiserAlg()

TriggerEDMDeserialiserAlg::TriggerEDMDeserialiserAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 212 of file TriggerEDMDeserialiserAlg.cxx.

212 :
213 AthReentrantAlgorithm(name, pSvcLocator) {}

◆ ~TriggerEDMDeserialiserAlg()

virtual TriggerEDMDeserialiserAlg::~TriggerEDMDeserialiserAlg ( )
overridevirtualdefault

Member Function Documentation

◆ add_bs_streamerinfos()

void TriggerEDMDeserialiserAlg::add_bs_streamerinfos ( )
private

Definition at line 499 of file TriggerEDMDeserialiserAlg.cxx.

499 {
500 std::lock_guard<std::mutex> lock(s_mutex);
501
502 if (s_streamerInfoList) {
503 return;
504 }
505
506 std::string extStreamerInfos = "bs-streamerinfos.root";
507 std::string extFilePath = PathResolver::find_file(extStreamerInfos, "DATAPATH");
508 ATH_MSG_DEBUG( "Using " << extFilePath );
509 TFile extFile(extFilePath.c_str());
510
511 s_streamerInfoList = std::unique_ptr<TList>(extFile.GetStreamerInfoList());
512 for(const auto&& infObj: *s_streamerInfoList) {
513 TString t_name=infObj->GetName();
514 if (t_name.BeginsWith("listOfRules")){
515 ATH_MSG_WARNING( "Could not re-load class " << t_name );
516 continue;
517 }
518
519 TStreamerInfo* inf = static_cast<TStreamerInfo*>(infObj);
520 inf->BuildCheck();
521 TClass *cl = inf->GetClass();
522 if (cl != nullptr) {
523 ATH_MSG_DEBUG( "external TStreamerInfo for " << cl->GetName() <<
524 " checksum: " << std::hex << inf->GetCheckSum() << std::dec );
525 }
526 }
527}
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
TStreamerInfo * inf
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]

◆ checkSanity()

StatusCode TriggerEDMDeserialiserAlg::checkSanity ( const std::string & transientTypeName,
bool isxAODInterfaceContainer,
bool isxAODAuxContainer,
bool isDecoration,
bool isTPContainer ) const
private

Checker for data integrity, one and only one of the passed booleans can be true, else FAILURE is returned and relevant diagnostics printed.

Definition at line 473 of file TriggerEDMDeserialiserAlg.cxx.

473 {
474 ATH_MSG_DEBUG( "Recognised type " << transientTypeName <<" as: "
475 << (isxAODInterfaceContainer ? "xAOD Interface Container":"" )
476 << (isxAODAuxContainer ? "xAOD Aux Container ":"" )
477 << ( isDecoration ? "xAOD Decoration" : "")
478 << ( isTPContainer ? "T/P Container " : "") );
479
480 const std::vector<bool> typeOfContainer( { isxAODInterfaceContainer, isxAODAuxContainer, isDecoration, isTPContainer } );
481 const size_t count = std::count( typeOfContainer.begin(), typeOfContainer.end(), true );
482 if ( count == 0 ) {
483 ATH_MSG_ERROR( "Could not recognise the kind of container " << transientTypeName );
484 return StatusCode::FAILURE;
485 }
486 if (count > 1 ) {
487 ATH_MSG_ERROR( "Ambiguous container kind deduced from the transient type name " << transientTypeName );
488 ATH_MSG_ERROR( "Recognised type as: "
489 << (isxAODInterfaceContainer ? "xAOD Interface Context":"" )
490 << (isxAODAuxContainer ? " xAOD Aux Container ":"" )
491 << ( isDecoration ? "xAOD Decoration" : "")
492 << ( isTPContainer ? "T/P Container " : "") );
493 return StatusCode::FAILURE;
494 }
495 return StatusCode::SUCCESS;
496}
#define ATH_MSG_ERROR(x,...)
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148
virtual bool isDecoration(auxid_t auxid) const override
Test if a particular variable is tagged as a decoration.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ deserialise()

StatusCode TriggerEDMDeserialiserAlg::deserialise ( const EventContext & ctx,
const Payload * dataptr ) const
private

Performs actual deserialisation loop.

Definition at line 254 of file TriggerEDMDeserialiserAlg.cxx.

255 {
256
257 size_t buffSize = m_initialSerialisationBufferSize;
258 std::unique_ptr<char[]> buff = std::make_unique<char[]>(buffSize);
259
260 // returns a char* buffer that is at minimum as large as specified in the argument
261 auto resize = [&buffSize, &buff]( const size_t neededSize ) -> void {
262 if ( neededSize > buffSize ) {
263 buffSize = neededSize;
264 buff = std::make_unique<char[]>(buffSize);
265 }
266 };
267
268 // the pointers defined below need to be used in decoding consecutive fragments of xAOD containers:
269 // 1) xAOD interface, 2) Aux store, 3) decorations
270 // invalid conditions are: invalid interface pointer when decoding Aux store
271 // invalid aux store and interface when decoding the decoration
272 // these pointer should be invalidated when: decoding TP containers, aux store when decoding the xAOD interface
273 std::unique_ptr<WritableAuxStore> currentAuxStoreOwner; // set when decoding Aux
274 WritableAuxStore* currentAuxStore = nullptr; //need to hang on to an observing ptr
275 SG::AuxVectorBase* xAODInterfaceContainer = nullptr; // set when decoding xAOD interface
276
277 size_t fragmentCount = 0;
278 PayloadIterator start = dataptr->begin();
279 std::string previousKey;
280 while ( start != dataptr->end() ) {
282 const CLID clid{ PayloadHelpers::collectionCLID( start ) };
283 std::string transientTypeName, transientTypeInfoName;
284 ATH_CHECK( m_clidSvc->getTypeNameOfID( clid, transientTypeName ) );
285 ATH_CHECK( m_clidSvc->getTypeInfoNameOfID( clid, transientTypeInfoName ) ); // version
286
287 const std::vector<std::string> descr( PayloadHelpers::collectionDescription( start ) );
288 ATH_CHECK( descr.size() == 2 );
289 std::string persistentTypeName{ descr[0] };
290 const std::string key{ descr[1] };
291 const size_t bsize{ PayloadHelpers::dataSize( start ) };
292
293 if( m_skipDuplicates && evtStore()->contains(clid,m_prefix+key) ) {
294 ATH_MSG_DEBUG("Skipping duplicate record " << m_prefix+key);
295 // Advance
297 continue;
298 }
299
300 ATH_MSG_DEBUG( "fragment #" << fragmentCount <<
301 " type: "<< transientTypeName << " (" << transientTypeInfoName << ")" <<
302 " persistent type: " << persistentTypeName << " key: " << key << " size: " << bsize );
303 resize( bsize );
304 PayloadHelpers::toBuffer( start, buff.get() );
305
306 // point the start to the next chunk, irrespectively of what happens in deserialisation below
308
309 RootType classDesc = RootType::ByNameNoQuiet( persistentTypeName );
310 ATH_CHECK( classDesc.IsComplete() );
311
312 // Many variables in this class were changed from double to float.
313 // However, we wrote data in the past which contained values
314 // that were valid doubles but which were out of range for floats.
315 // So we can get FPEs when we read them.
316 // Disable FPEs when we're reading an instance of this class.
317 CxxUtils::FPControl fpcontrol;
318 if (persistentTypeName == "xAOD::BTaggingTrigAuxContainer_v1") {
319 fpcontrol.holdExceptions();
320 }
321
322 size_t usedBytes{ bsize };
323 void* obj{ nullptr };
324 {
325 // Temporary error handler to debug ATR-25049
326 RootUtils::WithRootErrorHandler hand( handleError(buff.get(), usedBytes, dataptr, &*start) );
327 obj = m_serializerSvc->deserialize( buff.get(), usedBytes, classDesc );
328 }
329
330 ATH_MSG_DEBUG( "Deserialised object of ptr: " << obj << " which used: " << usedBytes <<
331 " bytes from available: " << bsize );
332 if ( obj == nullptr ) {
333 ATH_MSG_ERROR( "Deserialisation of object of CLID " << clid << " and transientTypeName " <<
334 transientTypeName << " # " << key << " failed" );
335 return StatusCode::FAILURE;
336 }
337 const bool isxAODInterfaceContainer = (transientTypeName.starts_with("xAOD") and
338 not transientTypeName.contains("Aux") and
339 not transientTypeName.contains("ElementLink"));
340 const bool isxAODAuxContainer = (transientTypeName.starts_with("xAOD") and
341 transientTypeName.contains("Aux"));
342 const bool isxAODDecoration = transientTypeName.contains("vector");
343 const bool isTPContainer = persistentTypeName.contains("_p");
344 const bool isVersionChange = versionChange(persistentTypeName, transientTypeInfoName);
345
346 ATH_CHECK( checkSanity( transientTypeName, isxAODInterfaceContainer,
347 isxAODAuxContainer, isxAODDecoration, isTPContainer ) );
348
349 if ( isTPContainer or isVersionChange ) {
350 if ( isVersionChange ) ATH_MSG_DEBUG( "Version change detected from " << persistentTypeName << " to "
351 << transientTypeInfoName << ". Will invoke PT converter." );
352
353 std::string decodedTransientName;
354 void * converted = m_tpTool->convertPT( persistentTypeName, obj, decodedTransientName );
355 ATH_CHECK( converted != nullptr );
356 classDesc.Destruct( obj );
357
358 // from now on in case of T/P class we deal with a new class, the transient one
359 classDesc = RootType::ByNameNoQuiet( transientTypeName );
360 ATH_CHECK( classDesc.IsComplete() );
361 obj = converted;
362 }
363
364 if ( isxAODInterfaceContainer or isxAODAuxContainer or isTPContainer ) {
365 BareDataBucket* dataBucket = new BareDataBucket( obj, clid, std::move(classDesc) );
366 const std::string outputName = m_prefix + key;
367 auto proxyPtr = evtStore()->recordObject( SG::DataObjectSharedPtr<BareDataBucket>( dataBucket ),
368 outputName, false, false );
369 if ( proxyPtr == nullptr ) {
370 ATH_MSG_WARNING( "Recording of object of CLID " << clid << " and name " << outputName << " failed" );
371 }
372
373 if ( isxAODInterfaceContainer ) {
374 // If the container of the previous iteration was supposed to have an Aux store (trackIndices)
375 // but we didn't find one, then create at least a DataLink with the correct key name.
376 // The EDMCreatorAlg will take care of creating an empty Aux store with the correct type.
377 if (xAODInterfaceContainer!=nullptr &&
378 xAODInterfaceContainer->trackIndices() && currentAuxStore==nullptr) {
379 ATH_MSG_DEBUG("Container with key " << previousKey << " is missing its Aux store");
380 xAODInterfaceContainer->setStore( DataLink<SG::IConstAuxStore>(previousKey+"Aux.") );
381 }
382 currentAuxStore = nullptr; // the store will be following, setting it to nullptr assure we catch issue with of missing Aux
383 const SG::BaseInfoBase* bib = getBaseInfo(clid);
384 if(!bib){
385 ATH_MSG_WARNING("No BaseInfoBase for CLID "<< clid << " and name " << outputName);
386 }
387 xAODInterfaceContainer =
388 bib ? reinterpret_cast<SG::AuxVectorBase*>(
389 bib->cast(dataBucket->object(),
391 : nullptr;
392 } else if (isxAODAuxContainer) {
393 // key contains exactly one '.' at the end
394 ATH_CHECK( key.find('.') == key.size()-1 );
395 ATH_CHECK( currentAuxStore == nullptr and xAODInterfaceContainer != nullptr );
396 const SG::BaseInfoBase* bib = getBaseInfo(clid);
397 SG::IAuxStore* auxHolder =
398 reinterpret_cast<SG::IAuxStore*>(
399 bib->cast(dataBucket->object(), ClassID_traits<SG::IAuxStore>::ID()));
400 ATH_CHECK(auxHolder != nullptr);
401 auxHolder->toTransient(ctx);
402 //coverity[FORWARD_NULL:FALSE]
403 xAODInterfaceContainer->setStore(auxHolder);
404 currentAuxStoreOwner = std::make_unique<WritableAuxStore>();
405 currentAuxStore = currentAuxStoreOwner.get();
406 auto p = dynamic_cast<SG::IAuxStoreHolder*>(auxHolder);
407 ATH_CHECK(p != nullptr);
408 //coverity[FORWARD_NULL:FALSE]
409 p->setStore( currentAuxStoreOwner.release() ); //IAuxStoreHolder takes ownership
410 } else {
411 currentAuxStore = nullptr;
412 xAODInterfaceContainer = nullptr; // invalidate xAOD related pointers
413 }
414
415 } else if ( isxAODDecoration ) {
416 if(m_skipDuplicates and (currentAuxStore == nullptr || xAODInterfaceContainer == nullptr)) {
417 ATH_MSG_DEBUG("Decoration " << key << " encountered with no active container. Assume this was already handled.");
418 } else {
419 ATH_CHECK( currentAuxStore != nullptr and xAODInterfaceContainer != nullptr );
421 transientTypeName, persistentTypeName, key, obj,
422 currentAuxStore, xAODInterfaceContainer ) );
423 }
424 }
425 previousKey = key;
426 }
427 return StatusCode::SUCCESS;
428}
#define ATH_CHECK
Evaluate an expression and check for errors.
uint32_t CLID
The Class ID type.
TTypeAdapter RootType
Definition RootType.h:211
int fragmentCount(uint32_t data, int id)
ServiceHandle< StoreGateSvc > & evtStore()
virtual void * object() override
void setStore(SG::IAuxStore *store)
Set the store associated with this object.
bool trackIndices() const
Return true if index tracking is enabled for this container.
void * cast(void *p, CLID clid) const
Cast to a base pointer.
Definition BaseInfo.cxx:169
virtual void toTransient(const EventContext &ctx)=0
Perform post-read processing on this store.
static TScopeAdapter ByNameNoQuiet(const std::string &name, Bool_t load=kTRUE)
Definition RootType.cxx:584
void Destruct(void *place) const
Definition RootType.cxx:675
Bool_t IsComplete() const
Definition RootType.cxx:892
Gaudi::Property< int > m_initialSerialisationBufferSize
Payload::const_iterator PayloadIterator
ServiceHandle< IAthenaSerializeSvc > m_serializerSvc
StatusCode deserialiseDynAux(const EventContext &ctx, const std::string &transientTypeName, const std::string &persistentTypeName, const std::string &decorationName, void *obj, WritableAuxStore *currentAuxStore, SG::AuxVectorBase *interface) const
Handle decoration.
ToolHandle< TrigSerTPTool > m_tpTool
Gaudi::Property< std::string > m_prefix
Gaudi::Property< bool > m_skipDuplicates
StatusCode checkSanity(const std::string &transientTypeName, bool isxAODInterfaceContainer, bool isxAODAuxContainer, bool isDecoration, bool isTPContainer) const
Checker for data integrity, one and only one of the passed booleans can be true, else FAILURE is retu...
ServiceHandle< IClassIDSvc > m_clidSvc
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:116
constexpr TDA::PayloadIterator toNextFragment(TDA::PayloadIterator start)
Returns starting point of the next fragment, can be == end().
constexpr size_t dataSize(TDA::PayloadIterator start)
Size in bytes of the buffer that is needed to decode next fragment data content.
std::vector< std::string > collectionDescription(TDA::PayloadIterator start)
String description of the collection stored in the next fragment, returns persistent type name and th...
constexpr CLID collectionCLID(TDA::PayloadIterator start)
CLID of the collection stored in the next fragment.
void toBuffer(TDA::PayloadIterator start, char *buffer)
Copies fragment to the buffer, no size checking, use dataSize to do so.
CxxUtils::RefCountedPtr< T > DataObjectSharedPtr
virtual bool resize(size_t sz) override
Change the size of all aux data vectors.
str outputName
Definition lumiFormat.py:65
list descr
print "%s.properties()" % self.__name__

◆ deserialiseDynAux()

StatusCode TriggerEDMDeserialiserAlg::deserialiseDynAux ( const EventContext & ctx,
const std::string & transientTypeName,
const std::string & persistentTypeName,
const std::string & decorationName,
void * obj,
WritableAuxStore * currentAuxStore,
SG::AuxVectorBase * interface ) const
private

Handle decoration.

Definition at line 432 of file TriggerEDMDeserialiserAlg.cxx.

434 {
435 const bool isPacked = persistentTypeName.contains("SG::PackedContainer");
436
437 SG::AuxTypeRegistry& registry = SG::AuxTypeRegistry::instance();
438 SG::auxid_t id = registry.findAuxID ( decorationName );
439 if (id != SG::null_auxid ) {
440 std::string regTypeName = stripStdVec( registry.getVecTypeName(id) );
441 if ( regTypeName != stripStdVec(transientTypeName) and not transientTypeName.contains("ElementLink") )
442 {
443 // Before giving up, also translate any typedefs in the transient name.
444 RootUtils::Type tname (transientTypeName);
445 if ( regTypeName != stripStdVec(tname.getTypeName()) ) {
446 ATH_MSG_INFO( "Schema evolution required for decoration \"" << decorationName << "\" from " << transientTypeName << " to " << registry.getVecTypeName( id ) << " not handled yet");
447 return StatusCode::SUCCESS;
448 }
449 }
450 } else {
451 std::string elementTypeName;
452 const std::type_info* elt_tinfo = getElementType( transientTypeName, elementTypeName );
453 ATH_CHECK( elt_tinfo != nullptr );
454 ATH_MSG_DEBUG( "Dynamic decoration: \"" << decorationName << "\" of type " << transientTypeName << " will create a dynamic ID, stored type" << elementTypeName );
455 id = SG::getDynamicAuxID ( *elt_tinfo, decorationName, elementTypeName, transientTypeName, false, SG::null_auxid );
456 }
457 ATH_MSG_DEBUG( "Unstreaming decoration \"" << decorationName << "\" of type " << transientTypeName << " aux ID " << id << " class " << persistentTypeName << " packed " << isPacked );
458 std::unique_ptr<SG::IAuxTypeVector> vec( registry.makeVectorFromData (id, obj, nullptr, isPacked, true) );
459 ATH_CHECK( vec.get() != nullptr );
460 ATH_MSG_DEBUG("Size for \"" << decorationName << "\" " << vec->size() << " interface " << interfaceContainer->size_v() );
461 ATH_CHECK( vec->size() == interfaceContainer->size_v() );
462 if ( vec->size() != 0 ) {
463 vec->toTransient( ctx );
464 ATH_CHECK( currentAuxStore != nullptr );
465 currentAuxStore->addVector(std::move(vec), false);
466 // trigger loading of the dynamic variables
467 SG::AuxElement::TypelessConstAccessor accessor( decorationName );
468 accessor.getDataArray( *interfaceContainer );
469 }
470 return StatusCode::SUCCESS;
471}
#define ATH_MSG_INFO(x,...)
std::vector< size_t > vec
static AuxTypeRegistry & instance()
Return the singleton registry instance.
static const auxid_t null_auxid
To signal no aux data item.
Definition AuxTypes.h:30
SG::auxid_t getDynamicAuxID(const std::type_info &ti, const std::string &name, const std::string &elementTypeName, const std::string &branch_type_name, bool standalone, SG::auxid_t linked_auxid)
Find the auxid for a dynamic branch.
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27
const AccessorWrapper< T > * accessor(xAOD::JetAttribute::AttributeID id)
Returns an attribute accessor corresponding to an AttributeID.

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode TriggerEDMDeserialiserAlg::execute ( const EventContext & context) const
overridevirtual

Definition at line 231 of file TriggerEDMDeserialiserAlg.cxx.

231 {
232
233 auto resultHandle = SG::makeHandle( m_resultKey, ctx );
234 if ( not resultHandle.isValid() ) {
235 ATH_MSG_ERROR("Failed to obtain HLTResultMT with key " << m_resultKey.key());
236 return StatusCode::FAILURE;
237 }
238 ATH_MSG_DEBUG("Obtained HLTResultMT with key " << m_resultKey.key());
239
240 const Payload* dataptr = nullptr;
241 if ( resultHandle->getSerialisedData( m_moduleID, dataptr ).isFailure() ) {
242 if ( m_permitMissingModule ) {
243 ATH_MSG_DEBUG("No payload available with moduleId " << m_moduleID << " in this event, ignored");
244 return StatusCode::SUCCESS;
245 } else {
246 ATH_MSG_ERROR("No payload available with moduleId " << m_moduleID << " in this event");
247 return StatusCode::FAILURE;
248 }
249 }
250 ATH_CHECK( deserialise( ctx, dataptr ) );
251 return StatusCode::SUCCESS;
252}
Gaudi::Property< bool > m_permitMissingModule
SG::ReadHandleKey< HLT::HLTResultMT > m_resultKey
StatusCode deserialise(const EventContext &ctx, const Payload *dataptr) const
Performs actual deserialisation loop.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode TriggerEDMDeserialiserAlg::finalize ( )
overridevirtual

Definition at line 225 of file TriggerEDMDeserialiserAlg.cxx.

225 {
226 s_streamerInfoList.reset();
227 return StatusCode::SUCCESS;
228}

◆ initialize()

StatusCode TriggerEDMDeserialiserAlg::initialize ( )
overridevirtual

Definition at line 215 of file TriggerEDMDeserialiserAlg.cxx.

215 {
216 ATH_CHECK( m_resultKey.initialize() );
217 ATH_CHECK( m_clidSvc.retrieve() );
218 ATH_CHECK( m_serializerSvc.retrieve() );
219 ATH_CHECK( m_tpTool.retrieve() );
221 return StatusCode::SUCCESS;
222}

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

◆ tester

StatusCode tester ( TriggerEDMDeserialiserAlg * )
friend

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::unique_ptr<TList> s_streamerInfoList TriggerEDMDeserialiserAlg::ATLAS_THREAD_SAFE
static

Definition at line 37 of file TriggerEDMDeserialiserAlg.h.

◆ CLIDOffset

size_t TriggerEDMDeserialiserAlg::CLIDOffset = 1
staticconstexpr

Definition at line 34 of file TriggerEDMDeserialiserAlg.h.

◆ m_clidSvc

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

Definition at line 65 of file TriggerEDMDeserialiserAlg.h.

65 { this, "ClassIDSvc", "ClassIDSvc",
66 "Service to translate CLID to class name" };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_initialSerialisationBufferSize

Gaudi::Property<int> TriggerEDMDeserialiserAlg::m_initialSerialisationBufferSize
private
Initial value:
{ this, "InitialSerialisationBufferSize", 1024*1024,
"Initial serialisation buffer size in bytes, can be set large to avoid reallocations in every event" }

Definition at line 58 of file TriggerEDMDeserialiserAlg.h.

58 { this, "InitialSerialisationBufferSize", 1024*1024,
59 "Initial serialisation buffer size in bytes, can be set large to avoid reallocations in every event" };

◆ m_moduleID

Gaudi::Property<int> TriggerEDMDeserialiserAlg::m_moduleID
private
Initial value:
{ this, "ModuleID", 0,
"Module ID of HLT result ROB, default 0 is the main HLT result, others are for TLA, calibration etc." }

Definition at line 56 of file TriggerEDMDeserialiserAlg.h.

56 { this, "ModuleID", 0,
57 "Module ID of HLT result ROB, default 0 is the main HLT result, others are for TLA, calibration etc." };

◆ m_permitMissingModule

Gaudi::Property<bool> TriggerEDMDeserialiserAlg::m_permitMissingModule
private
Initial value:
{ this, "PermitMissingModule", false,
"Silently ignore absent HLT results (when handling multiple HLT results)" }

Definition at line 62 of file TriggerEDMDeserialiserAlg.h.

62 { this, "PermitMissingModule", false,
63 "Silently ignore absent HLT results (when handling multiple HLT results)" };

◆ m_prefix

Gaudi::Property<std::string> TriggerEDMDeserialiserAlg::m_prefix
private
Initial value:
{ this, "Prefix", "",
"Set for testing to avoid clash with the input collections" }

Definition at line 54 of file TriggerEDMDeserialiserAlg.h.

54 { this, "Prefix", "",
55 "Set for testing to avoid clash with the input collections" };

◆ m_resultKey

SG::ReadHandleKey<HLT::HLTResultMT> TriggerEDMDeserialiserAlg::m_resultKey
private
Initial value:
{ this, "ResultKey", "HLTResultMT",
"Key of the HLT result object" }

Definition at line 52 of file TriggerEDMDeserialiserAlg.h.

52 { this, "ResultKey", "HLTResultMT",
53 "Key of the HLT result object" };

◆ m_serializerSvc

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

Definition at line 68 of file TriggerEDMDeserialiserAlg.h.

68 { this, "Serializer", "AthenaRootSerializeSvc",
69 "Service that translates persistent to transient representation" };

◆ m_skipDuplicates

Gaudi::Property<bool> TriggerEDMDeserialiserAlg::m_skipDuplicates
private
Initial value:
{ this, "SkipDuplicateRecords", false,
"Silently ignore collections that ware already in StoreGate (when handling multiple HLT results)" }

Definition at line 60 of file TriggerEDMDeserialiserAlg.h.

60 { this, "SkipDuplicateRecords", false,
61 "Silently ignore collections that ware already in StoreGate (when handling multiple HLT results)" };

◆ m_tpTool

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

Definition at line 71 of file TriggerEDMDeserialiserAlg.h.

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

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.

◆ NameLengthOffset

size_t TriggerEDMDeserialiserAlg::NameLengthOffset = 2
staticconstexpr

Definition at line 35 of file TriggerEDMDeserialiserAlg.h.

◆ NameOffset

size_t TriggerEDMDeserialiserAlg::NameOffset = 3
staticconstexpr

Definition at line 36 of file TriggerEDMDeserialiserAlg.h.

◆ s_mutex

std::mutex TriggerEDMDeserialiserAlg::s_mutex
static

Definition at line 38 of file TriggerEDMDeserialiserAlg.h.


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