ATLAS Offline Software
Loading...
Searching...
No Matches
HLT::Navigation Class Reference

The Navigation class, organizes TriggerElements into the tree structure. More...

#include <Navigation.h>

Inheritance diagram for HLT::Navigation:
Collaboration diagram for HLT::Navigation:

Public Types

enum  MemoryManagement { ObjectInStoreGate = 1 , ObjectToStoreGate = 2 , ObjectCreatedByNew = 3 }
 defines 3 possible origins of the objects which are attached to TEs This should be used like this: More...

Public Member Functions

 Navigation (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~Navigation ()
virtual StatusCode initialize () override
template<class T>
bool attachFeature (TriggerElement *te, const T *feature, MemoryManagement, std::string &key, const std::string &label="")
 attaches feature to given TriggerElement
template<class T>
bool attachFeature (TriggerElement *te, const ConstDataVector< T > *feature, MemoryManagement, std::string &key, const std::string &label="")
template<class T>
bool associateExternalCollection (const std::string &label)
template<class T>
bool findOwners (const T *obj, std::vector< const TriggerElement * > &owners, unsigned int id=0)
 find all TriggerElements which have this object attached given feature
template<class T>
const std::string getNextKey (const std::string &label="")
 Get the next key for a given object.
template<class T>
const std::string getUniqueKey (const std::string &label="")
 Get a unique key (not in the usual series) for a given object.
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 sysInitialize () override
 Perform system initialization for an algorithm.
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
virtual void prepare ()
 prepapres the navigation for next event
virtual void reset (bool inFinalize=false)
 resets all the navigation, goes to the factory and asks to withdraw all produced objects
virtual bool serialize (std::vector< uint32_t > &output) const
 method serizlizes the navigation structure The structure is serrizlized in following order ...
bool serialize (std::vector< uint32_t > &output, std::vector< unsigned int > &cuts) const
bool serialize (std::vector< uint32_t > &output, std::vector< unsigned int > &cuts, std::vector< std::pair< CLID, std::string > > &clid_name) const
bool serialize_DSonly (std::vector< uint32_t > &output, std::vector< unsigned int > &cuts, std::vector< std::pair< CLID, std::string > > &clid_name) const
bool deserialize (const std::vector< uint32_t > &input)
template<class T>
bool getFeatures (const TriggerElement *te, std::vector< const T * > &features, const std::string &label="", std::map< const T *, std::string > *labels=0) const
 retrieve features attached to given TriggerElement
template<class T>
bool getFeature (const TriggerElement *te, const T *&features, const std::string &label="", std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
template<class T>
bool getFeature (const TriggerElement *te, const ConstDataVector< T > *&features, const std::string &label="", std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
TriggerElement::FeatureAccessHelper getFeature (const TriggerElement *te, class_id_type clid, const index_or_label_type &index_or_label) const
 typeless feature access metod
template<class T>
const T * featureLink2Object (const TrigFeatureLink &) const
template<class T>
TrigFeatureLink object2FeatureLink (const TriggerElement *te, const std::string &label, const T *obj) const
template<class C>
TrigFeatureLink object2FeatureLink (const TriggerElement *te, const std::string &label, const typename Container2Object< C >::type *obj, const C *container) const
template<class C, class T>
bool getFeaturesLinks (const TriggerElement *te, ElementLinkVector< C > &links, const std::string &label="") const
template<class T>
bool getRecentFeatures (const TriggerElement *te, std::vector< const T * > &features, const std::string &label="", std::map< const T *, std::string > *labels=0) const
 retrieve features attached to given TriggerElement or its predecessors the algorithm will go recursively to all predecessors and once the feature is found attached to given TE returns all features (of this type and label) attached to this TE
template<class T>
bool getRecentFeature (const TriggerElement *te, const T *&feature, const std::string &label="", const TriggerElement *&source=::HLT::TrigNavStructure::m_unspecifiedTE, std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
template<class LinkType>
bool getRecentFeatureDataOrElementLink (const TriggerElement *te, LinkType &link, const std::string &label="", const TriggerElement *&source=::HLT::TrigNavStructure::m_unspecifiedTE, std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
template<class C, class T>
bool getRecentFeaturesLinks (const TriggerElement *te, ElementLinkVector< C > &links, const std::string &label="") const
template<class C, class T>
bool getRecentFeatureLink (const TriggerElement *te, ElementLink< C > &link, const std::string &label="", const TriggerElement *&source=::HLT::TrigNavStructure::m_unspecifiedTE, std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
virtual bool getFeatureAccessors (const TriggerElement *te, class_id_type clid, const index_or_label_type &index_or_label, bool only_single_feature, TriggerElement::FeatureVec &features, bool travel_backward_recursively, const TriggerElement *&source=m_unspecifiedTE, std::string &sourcelabel=m_unspecifiedLabel) const
 retrieve features accessors according to the requrements This method is actually workhorse for all above.
virtual bool getFeatureAccessorsSingleTE (const TriggerElement *te, CLID clid, const index_or_label_type &index_or_label, bool only_single_feature, TriggerElement::FeatureVec &features, const TriggerElement *&source=::HLT::TrigNavStructure::m_unspecifiedTE, std::string &sourcelabel=::HLT::TrigNavStructure::m_unspecifiedLabel) const
template<class T>
bool getFeaturesInRoI (const TriggerElement *te, std::vector< const T * > &features, const std::string &label="", std::map< const T *, std::string > *labels=0) const
 retrieve features attached to the RoIs seeding this TriggerElement
template<class C, class T>
bool getAllFeatures (ElementLinkVector< C > &features, const std::string &label="") const
 gets all features of type T atachedd to whichever TE
bool merge (const NavigationCore &l2)
 attemtps to merge two trees
void getAllOfType (const std::string &id, std::vector< HLT::TriggerElement * > &output, const bool activeOnly=true) const
 return trigger elements given the name of TEs
void getAllOfType (const te_id_type id, std::vector< TriggerElement * > &output, const bool activeOnly=true) const
 The query returning a collection of all TriggerElements if name is given.
const AccessProxygetAccessProxy () const
 gets the access proxy
template<class T>
HLTNavDetails::Holder< T > * getHolder (uint16_t subTypeIndex) const
 as above but does not create holder on demand (return 0 if not found)
const BaseHoldergetHolder (const TriggerElement::FeatureAccessHelper &fea) const
TriggerElementgetInitialNode ()
 gets initial node, if node is not there then it is created on fly
const TriggerElementgetInitialNode () const
TriggerElementaddRoINode (TriggerElement *initial)
 gets RoI node (attached to initial)
TriggerElementaddNode (TriggerElement *seed, unsigned int id)
 adds nodes seeded form the one given as an argument,
TriggerElementaddNode (std::vector< TriggerElement * > &seeds, unsigned int id, bool ghost=false, bool nofwd=false)
 adds node which is seeded from several other Needed by Topological algorithms
void printASCIIArt (std::string &str, const TriggerElement *te=0, int offset=0) const
 pretty printing of the navigational structure (heavy)
bool serializeTEs (std::vector< uint32_t > &output) const
 method serizlizes the navigation structure
bool deserializeTEs (std::vector< uint32_t >::const_iterator &start, unsigned int totalSize)
TriggerElement::FeatureAccessHelper getFeatureRecursively (const TriggerElement *startTE, class_id_type clid, const index_or_label_type &index_or_label, const TriggerElement *&sourceTE) const
 recursive search for features the function is similar to the above butif th features is not found at the startTE the search descends the structure of TEs until it is found.
void getAllRoIThresholdTEs (std::vector< TriggerElement * > &output) const
 The query returns a vector of all TriggerElements that represent a LVL1 RoI threshold.
void getAll (std::vector< TriggerElement * > &output, const bool activeOnly=true) const
 The query returning a collection of all TriggerElements.
std::vector< TriggerElement * > & getAllTEs ()
 access needed by slimming tools.
const std::vector< TriggerElement * > & getAllTEs () const
 access needed by slimming tools.
unsigned int countAllOfType (const te_id_type id, const bool activeOnly=true) const
 The query counting a collection of all TriggerElement of a given type.
bool propagateDeactivation (const TrigNavStructure *nav)
 propagates deactivation of TE state This finction should be used after Trigger is rerurn on L2 and then the reruning on L2 is required.
bool combine (std::vector< unsigned int > &types, std::vector< std::vector< TriggerElement * > > &output, unsigned int maxResults=1000, bool onlyActive=true)
 For Algorithms: return all the possible n-tuples of TE* objects (te0, te1..., ten)
bool overlaps (const TriggerElement *t1, const TriggerElement *t2) const
 Check overlap between trigger elements (pointer equality or RoI overlap)
bool overlaps (const TriggerElement *t1, const std::vector< TriggerElement * > &teVec) const
 Check overlap between a TE and a vector of TEs, using the method above.
bool getTopologicallySpannedBy (const TriggerElement *te, const std::vector< unsigned int > &types, std::vector< const TriggerElement * > &children, const bool activeOnly=true) const
 gets the TEs whose predecessors were used to built a given topological TE
unsigned int copyAllFeatures (const TriggerElement *sourceTE, TriggerElement *destTE)
 gets all features from the sourceTE and copies a reference (FeatureAccessHelper) to the destTE
sub_index_type subType (class_id_type clid, const index_or_label_type &sti_or_label) const
std::string label (class_id_type clid, const index_or_label_type &sti_or_label) const

Static Public Member Functions

template<class T, class C>
static void registerFeatureContainer ()
 Specialized by type and container for this type.
static uint32_t string2hash (const std::string &, const std::string &category="TE")
 convert strin g to hash.
static const std::vector< TriggerElement * > & getRoINodes (const TriggerElement *somenode)
 gets all RoI type nodes seeding indirectly this TriggerElement
static const std::vector< TriggerElement * > & getDirectPredecessors (const TriggerElement *te)
 returns list of direct predecessors (nodes seeding me)
static const std::vector< TriggerElement * > & getDirectSuccessors (const TriggerElement *te)
 returns list of direct predecessors (nodes I seed)
static const TriggerElementgetSuccessor (const TriggerElement *te, unsigned int id)
 returns successor of given type beeing seeded from this TE
static bool isInitialNode (const TriggerElement *te)
 queries if node is an initial one
static bool isRoINode (const TriggerElement *te)
 queries if node is an RoI type one
static bool isTerminalNode (const TriggerElement *te)
 queries if node is terminal (no more TriggerElement are seeded by it)
static bool haveCommonRoI (const TriggerElement *te1, const TriggerElement *te2)
 does this 2 share RoI
static bool haveDistinctRoI (const TriggerElement *te1, const TriggerElement *te2)
 inversion of haveCommonRoI
static bool haveAllCommonRoIs (const HLT::TriggerElement *te1, const HLT::TriggerElement *te2)
static bool haveCommonSeed (const TriggerElement *te1, const TriggerElement *te2)
 checks that there is any common predecessor of two TriggerElements
static bool haveDistinctSeed (const TriggerElement *te1, const TriggerElement *te2)
 inversion of haveCommonSeed
static bool increasingOrderByTEId (const TriggerElement *te1, const TriggerElement *te2)
 for sorting TriggerElements according to their id
static bool decreasingOrderByTEId (const TriggerElement *te1, const TriggerElement *te2)
static bool hasIdFromTheSet (const TriggerElement *te, std::vector< unsigned int > ids)
 simple helper
static bool isNotActive (const TriggerElement *te)
 helper for the STL
static bool isTopological (const TriggerElement *te)
static bool isCompatibleTree (const TriggerElement *te1, const TriggerElement *te2)
 check compatibility of 2 navigation structures

Protected Member Functions

 Navigation ()
 Navigation (const Navigation &)
Navigationoperator= (const Navigation &)
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.
template<class T>
HLTNavDetails::Holder< T > * getHolder (const std::string &label, uint16_t suggestedIndex) const
 aware holder discovery, creates holder if needed
HLTNavDetails::IHoldergetHolder (CLID clid, uint16_t subTypeIndex) const
 as above but not type wise holder returned
HLTNavDetails::IHoldergetHolder (CLID clid, const std::string &label) const
 as above
bool createHolder (HLTNavDetails::IHolder *&holder, CLID clid, const std::string &label, uint16_t idx) const
 creates holder for type given by CLID
bool registerHolder (HLTNavDetails::IHolder *holder)
bool addOneLevel (std::vector< std::vector< TriggerElement * > > &currentCombs, std::vector< std::vector< std::pair< unsigned int, unsigned int > > > &currentIdxs, unsigned int type, std::vector< std::vector< TriggerElement * > > &newCombs, std::vector< std::vector< std::pair< unsigned int, unsigned int > > > &newIdxs, unsigned int maxResults=1000, bool onlyActive=1)
 Helper method for "combine": add one "level" of multiplicity to the results.
uint16_t nextSubTypeIndex (CLID clid, const std::string &label) const
bool extractBlob (const std::vector< uint32_t > &input, std::vector< uint32_t >::const_iterator &it, std::vector< uint32_t > &blob) const
bool matchFeature (const TriggerElement::FeatureAccessHelper &fea, class_id_type clid, const index_or_label_type &index_or_label) const
void fillSameRoIRelation (TriggerElement *roi, TriggerElement *te)
 rebuilds the sameRoIRelation between trigger elements (used internally by deserialize)
TriggerElementFactorygetFactory ()
const TriggerElementFactorygetFactory () const
TrigHolderStructuregetHolderStorage ()
const TrigHolderStructuregetHolderStorage () const
std::recursive_mutex & getMutex ()
std::recursive_mutex & getMutex () const

Protected Attributes

IConversionSvc * m_serializerSvc
StoreGateSvcm_storeGate
std::string m_objectsKeyPrefix
 property setting prefix which is to be given to all trigger EDM objects
unsigned m_objectsIndexOffset
 small integer used to generate sub type index
ITrigHolderFactorym_holderfactory
std::vector< std::string > m_classesToPayloadProperty
 list of classes#keys to be put to BS payload
std::vector< CSPairm_classesToPayload
 classess are put to payload according to that priority list (CLID + key)
std::vector< std::string > m_classesToPayloadProperty_DSonly
 list of classes#keys to be put to DS payload
std::vector< CSPairm_classesToPayload_DSonly
 classess are put to payload according to that priority list (CLID + key)
std::vector< std::string > m_classesFromPayloadIgnoreProperty
 list of classes#keys to ignore on deserialization
std::vector< std::string > m_classesToPreregisterProperty
 as above but for preregistration
std::vector< CSPairm_classesToPreregister
 classes mentioned here will be put to SG irrespectively of thier presence in event

Static Protected Attributes

static const TriggerElement *m_unspecifiedTE ATLAS_THREAD_SAFE
static std::string m_unspecifiedLabel ATLAS_THREAD_SAFE

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode classKey2CLIDKey (const std::vector< std::string > &property, std::vector< CSPair > &decoded)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>
HLTNavDetails::IHolderprepareOneHolder (CLID clid, const std::string &label)
bool serializeWithHolderSection (const std::vector< uint32_t > &holderdata, const std::vector< unsigned int > &holderblobsizes, std::vector< uint32_t > &output, std::vector< unsigned int > &cuts, std::vector< std::pair< CLID, std::string > > &clid_name) const
bool serializeHoldersWithoutPayload (const std::vector< HLTNavDetails::IHolder * > &holders, std::vector< uint32_t > &output, std::vector< uint32_t > &holderblobsizes, std::vector< std::pair< CLID, std::string > > &clid_name) const
bool serializeHoldersWithPayload (const std::vector< CSPair > &payload, std::vector< uint32_t > &output, std::vector< uint32_t > &holderblobsizes, std::vector< std::pair< CLID, std::string > > &clid_name) const

Private Attributes

ServiceHandle< IConversionSvc > m_serializerServiceHandle
ServiceHandle< IClassIDSvc > m_clidSvc
Gaudi::Property< std::vector< std::string > > m_dlls {this, "Dlls", {}, "Libraries to load (with trigger EDM)", "OrderedSet<T>"}
FullHolderFactory m_fullholderfactory
bool m_readonly
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
const AthAlgToolm_logger
SG::SlotSpecificObj< TriggerElementFactorym_factory
 factory of trigger elements (one per processing slot)
SG::SlotSpecificObj< TrigHolderStructurem_holderstorage
 structure for feature holders (one per processing slot)

Static Private Attributes

static std::recursive_mutex s_rmutex

Detailed Description

The Navigation class, organizes TriggerElements into the tree structure.

Author
Tomasz Bold Tomas.nosp@m.z.Bo.nosp@m.ld@ce.nosp@m.rn.c.nosp@m.h - U. of California - Irvine
Till Eifert Till..nosp@m.Eife.nosp@m.rt@ce.nosp@m.rn.c.nosp@m.h - U. of Geneva, Switzerland
Nicolas Berger Nicol.nosp@m.as.B.nosp@m.erger.nosp@m.@cer.nosp@m.n.ch - CERN
Lukas Heinrich lukas.nosp@m..hei.nosp@m.nrich.nosp@m.@cer.nosp@m.n.ch - NYU

The class is providing an interface to the whole navigation. The internal ingredients of the navigation which are TriggerElements are well hidden. All operations on the navigation structure are possible only via trick class. This operations are basically:

  1. creation of TriggerElements
    • creation of the initial (root) node
    • creation of RoI nodes (one per RoI, also for secondary RoIs)
    • creation of normal nodes (seed by one TriggerElement)
    • creation of normal nodes suitable for topological selection (being seed by 2 TriggerElements)

The created nodes are given to user with all the navigational links prepared

  1. features attaching and retrieval
    • attaching feature to node
    • attaching feature to RoI node ( therefore all TE originating from node can use it )
    • attaching feature to initial (root) node for global (event wide) features
    • retrieval of features attached to given node
    • retrieval of features attached to given node or any predecessor (back to an initial node)
    • retrieval of features attached to given node or any predecessor (traversing back to an initial node)
    • retrieval of recent feature attached to given node or any predecessor (traversing back to an initial node)
    • retrieval of features attached to RoI nodes of given TriggerElement
    • retrieval of features attached to initial (root) node
  1. queering methods
    • simple queries (isInitial, isTerminal, isRoI)
    • more complicated queries for 2 TriggerElements (if they share RoI etc)
    • global comparison for 2 navigation structures (needed up to the moment only for validation of serialization)
    • query for all TriggerElements of a given type Queries are designed to be usable with STL algorithms.

Documentation of EDM related upgrade:

  1. objects storage
    • all possible types are known at compile time (Scott's magic)
    • some collections are placed in the SG always independently of the event content
    • there can be more collection of given type (one for each user label i.e. number of tracks collections)
    • if in navigation config this is given: TrigVertexCollection#HLTAutoKey_T2HistoPrmVtx --> then DataVector<TrigVertexCollection> of label "HLTAutoKey_T2HistoPrmVtx" is placed in the SG in every event
    • if in config only type is mentioned TrigVertexCollection#HLTAutoKey ---> then DataVector<TrigVertexCollection> of label HLTAutoKey is placed in SG for each event
    • if nothing is mentioned in config the DataVector<TrigVertexCollection> labeled at runtime depending on user labels will be placed in SG (one per label)
    • the object of given type are then organized then as follows: there is many collections of given type per event (each for one label) this collections are accessible by label or "SubTypeIndex" second is to keep the TE -> feature link unchanged if we remove obe of collection during slimming or we simply not record it

      Is is like this collection of type T |XXXXXXX| label: ID subTypeIndex: 0 collection of type T |XXXX| label: MS subTypeIndex: 1 collection of type T |XXXXXXXXXXXXX| label: Muons subTypeIndex: 2 collection of type T |XXXXXXXX| label: Calo subTypeIndex: 3

  2. the features <-> TE link
    • Features are located in supercontainers DataVector<TrigVertexCollection>
    • each label yields in one supercontainer (the unlabeled objects are in the container with HLTAutoKey_ label)
    • The link to object in the TE is composed out of 2 numbers CLID, and index
    • index (from above) is composed out of 2 parts collection coordinate and second is coordinate within collection
    • this way we do not need to touch TE serialization/desetialization
    • collection index and inter-collection index are uint16_t word which means we are limited to 65000 collections of given type and same number of objects in each sub collection

Definition at line 100 of file Navigation.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ MemoryManagement

defines 3 possible origins of the objects which are attached to TEs This should be used like this:

  1. All the objects which are produced out of blue using "new" operator should be attached with ObjectCreatedByNew switch. This objects may also go to SG depending on configuration.
  2. All objects which needs to be registered in the StoreGate should be registered using switch "ObjectToStoreGate" which tells basically thet SG take control over the cleanup. All objects registered like this will for sure go to SG.
  3. the switch "ObjectInStoreGate" should be used for objects which are already in SG. (i.e. put there by offline reco. tools).
Enumerator
ObjectInStoreGate 
ObjectToStoreGate 
ObjectCreatedByNew 

Definition at line 157 of file NavigationCore.h.

Constructor & Destructor Documentation

◆ Navigation() [1/3]

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

Definition at line 18 of file Navigation.cxx.

20 : AthAlgTool(type, name, parent),
21 NavigationCore(static_cast<AthAlgTool&>(*this)),
22 m_serializerServiceHandle("TrigSerializeCnvSvc", name),
23 m_clidSvc("ClassIDSvc", name),
25{
26
28 "List of classes which need to be serialized together with the Navigation.");
29
30 declareProperty("ClassesToPayload_DSonly", m_classesToPayloadProperty_DSonly,
31 "List of classes which need to be serialized together with the Navigation (Only in DataScouting collection).");
32
33 declareProperty("ClassesFromPayloadIgnore", m_classesFromPayloadIgnoreProperty,
34 "List of classes (Type[#Key]) to ignore on deserialization of the Navigation.");
35
36 declareProperty("ClassesToPreregister", m_classesToPreregisterProperty,
37 "List of classes which need to be put in SG independently if they appear in event.");
38
39 declareProperty("ObjectsKeyPrefix", m_objectsKeyPrefix="HLT", "The prefix which all Trigger EDM objects will get, by default it is HLT");
40 declareProperty("ObjectsIndexOffset", m_objectsIndexOffset=0, "The offset with which the objects idx is be shifted.");
41 declareProperty("ReadonlyHolders", m_readonly = false, "read only flag for holders (cannot create new feature containers");
42}
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
NavigationCore(const AthAlgTool &logger)
constructor with parent AlgTool for printing
std::vector< std::string > m_classesFromPayloadIgnoreProperty
list of classes::keys to ignore on deserialization
unsigned m_objectsIndexOffset
small integer used to generate sub type index
std::vector< std::string > m_classesToPayloadProperty_DSonly
list of classes::keys to be put to DS payload
std::vector< std::string > m_classesToPayloadProperty
list of classes::keys to be put to BS payload
std::vector< std::string > m_classesToPreregisterProperty
as above but for preregistration
std::string m_objectsKeyPrefix
property setting prefix which is to be given to all trigger EDM objects
ServiceHandle< IClassIDSvc > m_clidSvc
Definition Navigation.h:168
FullHolderFactory m_fullholderfactory
Definition Navigation.h:170
ServiceHandle< IConversionSvc > m_serializerServiceHandle
Definition Navigation.h:167

◆ ~Navigation()

Navigation::~Navigation ( )
virtual

Definition at line 44 of file Navigation.cxx.

44 {
45}

◆ Navigation() [2/3]

HLT::Navigation::Navigation ( )
protected

◆ Navigation() [3/3]

HLT::Navigation::Navigation ( const Navigation & )
protected

Member Function Documentation

◆ addNode() [1/2]

TriggerElement * TrigNavStructure::addNode ( std::vector< TriggerElement * > & seeds,
unsigned int id,
bool ghost = false,
bool nofwd = false )
inherited

adds node which is seeded from several other Needed by Topological algorithms

Parameters
seedsare all TriggerElements which seed newly created
idthe id to give for the created TriggerElement
ghostflag is saying that this TE is a light weight one, no features attaching to it is allowed
nofwdflag is saying that this TE will not be deactivated automatically in fwd deactivation process(rerunning)

Definition at line 85 of file TrigNavStructure.cxx.

85 {
86 std::lock_guard<std::recursive_mutex> lock(getMutex());
87 TriggerElementFactory& factory = getFactory();
88
89 TriggerElement* te = factory.produce(id, ghost, nofwd);
90
91
92 std::vector<TriggerElement* >::iterator it;
93 for ( it = seeds.begin(); it != seeds.end(); ++it ) {
94 // relate to it
95 TriggerElement* seednode = *it;
98 // add previous Features
99 te->getPreviousFeatures().insert(te->getPreviousFeatures().end(),
100 seednode->getPreviousFeatures().begin(),
101 seednode->getPreviousFeatures().end());
102
103 // copy RoI relations
104 if ( isRoINode(seednode) ) {
107 } else {
108 std::vector<TriggerElement*>::const_iterator itbegin = seednode->getRelated( TriggerElement::sameRoIRelation ).begin();
109 std::vector<TriggerElement*>::const_iterator itend = seednode->getRelated( TriggerElement::sameRoIRelation ).end();
110
111 for ( ; itbegin != itend; ++itbegin ) {
113 (*itbegin)->relate( te, TriggerElement::sameRoIRelation );
114 }
115 }
116 }
117 return te;
118}
TriggerElementFactory & getFactory()
std::recursive_mutex & getMutex()
static bool isRoINode(const TriggerElement *te)
queries if node is an RoI type one
TriggerElement * produce(unsigned int id, bool ghost=false, bool nofwd=false)
@ sameRoIRelation
equilateral relation of all TEs rooted in one RoI
const std::vector< TriggerElement * > & getRelated(Relation rel) const
returns reference to the likns to other TriggerElements related by relation r
const std::vector< FeatureAccessHelper > & getPreviousFeatures() const
void relate(TriggerElement *te, Relation r)
reates given TE to other TE

◆ addNode() [2/2]

TriggerElement * TrigNavStructure::addNode ( TriggerElement * seed,
unsigned int id )
inherited

adds nodes seeded form the one given as an argument,

Parameters
seeda TriggerElement which direct predecessor of newly created
idan id to give newly created TriggerElement

Definition at line 79 of file TrigNavStructure.cxx.

79 {
80 std::vector<TriggerElement*> list;
81 list.push_back(seednode);
82 return addNode(list, id);
83}
TriggerElement * addNode(TriggerElement *seed, unsigned int id)
adds nodes seeded form the one given as an argument,
list(name, path='/')
Definition histSizes.py:38

◆ addOneLevel()

bool HLT::NavigationCore::addOneLevel ( std::vector< std::vector< TriggerElement * > > & currentCombs,
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > & currentIdxs,
unsigned int type,
std::vector< std::vector< TriggerElement * > > & newCombs,
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > & newIdxs,
unsigned int maxResults = 1000,
bool onlyActive = 1 )
protectedinherited

Helper method for "combine": add one "level" of multiplicity to the results.

◆ addRoINode()

TriggerElement * TrigNavStructure::addRoINode ( TriggerElement * initial)
inherited

gets RoI node (attached to initial)

Definition at line 58 of file TrigNavStructure.cxx.

58 {
59 std::lock_guard<std::recursive_mutex> lock(getMutex());
60 TriggerElementFactory& factory = getFactory();
61
62 if ( isInitialNode(initial) ) {
63 TriggerElement* te = factory.produce(0);
64
65 // build seeds, seeededBy relations
68 return te;
69 }
70 return 0;
71}
static bool isInitialNode(const TriggerElement *te)
queries if node is an initial one
@ initial
this is just the initial step we do, nothing really happens here
Definition ManagerStep.h:45

◆ associateExternalCollection()

template<class T>
bool HLT::Navigation::associateExternalCollection ( const std::string & label)

◆ attachFeature() [1/2]

template<class T>
bool HLT::Navigation::attachFeature ( TriggerElement * te,
const ConstDataVector< T > * feature,
MemoryManagement ,
std::string & key,
const std::string & label = "" )

◆ attachFeature() [2/2]

template<class T>
bool HLT::Navigation::attachFeature ( TriggerElement * te,
const T * feature,
MemoryManagement ,
std::string & key,
const std::string & label = "" )

attaches feature to given TriggerElement

Parameters
teTriggerElement to which attach feature
featureis feature ptr to attach
keyis filled up by the key used to put into SG (if not SG is involved then untouched)
labelfor additional marking of this feature
Returns
false if error enountered, true if no error encountered if this feature is on the list of classes to be serialized by reference then it is put into the SG (using SG->record)

◆ classKey2CLIDKey()

StatusCode Navigation::classKey2CLIDKey ( const std::vector< std::string > & property,
std::vector< CSPair > & decoded )
private

Definition at line 114 of file Navigation.cxx.

115 {
116 // translate Class names into CLID numbers
117
118 for ( const std::string& cname : property ) {
119 CLID clid{0};
120 std::string key;
121 std::string type;
122
123 if ( cname.find('#') != std::string::npos ) {
124 type = cname.substr(0, cname.find('#') );
125 key = cname.substr(cname.find('#')+1 );
126 } else {
127 type = cname;
128 key = "";
129 }
130
131 if ( m_clidSvc->getIDOfTypeName(type, clid).isFailure() ) {
132 ATH_MSG_ERROR("Unable to get CLID for class: " << cname);
133 return StatusCode::FAILURE;
134 }
135
136 ATH_MSG_DEBUG("Recognized CLID : " << type << " and key: " << key);
137
138 xAOD::AuxSelection sel;
139
140 // anything after a dot is a list of dynamic Aux attributes, separated by dots
141 size_t dotpos = key.find('.');
142 if( dotpos == std::string::npos ) {
143 // If no explicit selection, we want to select nothing (this is a
144 // difference from the offline logic). But an empty selection list
145 // in AuxSelection means to accept everything. So add a dummy name
146 // that shouldn't match anything.
147 const char* dummyName = "__dummyThatShouldNotMatch";
148 [[maybe_unused]]
149 static const SG::AuxElement::Accessor<int> dummyVar (dummyName);
150 static const std::set<std::string> dummySet { dummyName };
151 sel.selectAux (dummySet);
152 }
153 else {
154 std::string aux_attr = key.substr(dotpos+1);
155 key.erase (dotpos, std::string::npos);
156
157 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
158 boost::char_separator<char> sep(".");
159 tokenizer tokens (aux_attr, sep);
160 sel.selectAux (std::set<std::string> (tokens.begin(), tokens.end()));
161 }
162
163 decoded.emplace_back (clid, key, std::move (sel));
164 }
165 return StatusCode::SUCCESS;
166}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
uint32_t CLID
The Class ID type.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572

◆ combine()

bool TrigNavStructure::combine ( std::vector< unsigned int > & types,
std::vector< std::vector< TriggerElement * > > & output,
unsigned int maxResults = 1000,
bool onlyActive = true )
inherited

For Algorithms: return all the possible n-tuples of TE* objects (te0, te1..., ten)

such that te0.id() == types[0], te1.id() == types[1]... In the case where ids appear multiple times, n-tuple permutations are counted only once. (so if te0.id() == te1.id(), (te0, te1) will appear but not (te1, te0)) "output" is populated with all the poClassID_traits<T>::ID();ssible combinations of this type. if "activeOnly" is true, only active trigger elements are used. The list is truncated at maxResults if maxResults > 0.

Definition at line 580 of file TrigNavStructure.cxx.

583{
584 // It should be empty anyways, but just in case...
585 output.clear();
586
587 std::vector< std::vector<TriggerElement*> > input;
588 std::vector< std::vector<std::pair<unsigned int, unsigned int> > > newIdxs;
589
590 for (std::vector<unsigned int>::iterator type = types.begin();
591 type != types.end(); ++type) {
592 // Use the previous iteration's output as the input for this one
593 std::vector< std::vector<TriggerElement*> > input = output;
594 std::vector< std::vector<std::pair<unsigned int, unsigned int> > > currentIdxs = newIdxs;
595
596 // Remove the old n-tuples
597 output.clear();
598 newIdxs.clear();
599 // Re-populate output with the (n+1)-tuples. If error return false immediately...
600 if (not addOneLevel(input, currentIdxs, *type, output, newIdxs,
601 maxResults, onlyActive)) return false;
602 }
603
604 return true;
605}
static const std::vector< std::string > types
bool addOneLevel(std::vector< std::vector< TriggerElement * > > &currentCombs, std::vector< std::vector< std::pair< unsigned int, unsigned int > > > &currentIdxs, unsigned int type, std::vector< std::vector< TriggerElement * > > &newCombs, std::vector< std::vector< std::pair< unsigned int, unsigned int > > > &newIdxs, unsigned int maxResults=1000, bool onlyActive=1)
Helper method for "combine": add one "level" of multiplicity to the results.
output
Definition merge.py:16

◆ copyAllFeatures()

unsigned int TrigNavStructure::copyAllFeatures ( const TriggerElement * sourceTE,
TriggerElement * destTE )
inherited

gets all features from the sourceTE and copies a reference (FeatureAccessHelper) to the destTE

Parameters
sourceTE(source) TriggerElement holding features
destTE(destiny) TriggerElement: copy feature references here
Returns
number of features that were copied

Definition at line 734 of file TrigNavStructure.cxx.

735{
736 unsigned int n_features = 0;
737 // push back all featureAccessHelpers from source to destiny TE
738 for ( std::vector< TriggerElement::FeatureAccessHelper >::const_iterator it = sourceTE->getFeatureAccessHelpers().begin();
739 it != sourceTE->getFeatureAccessHelpers().end(); ++it ) {
740 destTE->addFeature(*it);
741 n_features++;
742 }
743 return n_features;
744
745}
const std::vector< FeatureAccessHelper > & getFeatureAccessHelpers() const
returns all features which ara attached to this TE
void addFeature(class_id_type clid, const ObjectIndex &index, bool forget=false)
add helper for new feature

◆ countAllOfType()

unsigned int TrigNavStructure::countAllOfType ( const te_id_type id,
const bool activeOnly = true ) const
inherited

The query counting a collection of all TriggerElement of a given type.

Definition at line 388 of file TrigNavStructure.cxx.

388 {
389 std::lock_guard<std::recursive_mutex> lock(getMutex());
390 const TriggerElementFactory& factory = getFactory();
391
392 if ( activeOnly )
393 return factory.listOfProduced(id).size()
394 - count_if(factory.listOfProduced(id).begin(), factory.listOfProduced(id).end(), isNotActive);
395 //else
396 return factory.listOfProduced(id).size();
397}
static bool isNotActive(const TriggerElement *te)
helper for the STL
const std::vector< TriggerElement * > & listOfProduced() const

◆ createHolder()

bool NavigationCore::createHolder ( HLTNavDetails::IHolder *& holder,
CLID clid,
const std::string & label,
uint16_t idx ) const
protectedinherited

creates holder for type given by CLID

Definition at line 365 of file NavigationCore.cxx.

365 {
366 ATH_MSG_DEBUG("createHolder: creating holder for CLID: " << clid << " label: " << label << " and index: " << index);
367 //reset holder
368 holder = 0;
369 auto baseholder = m_holderfactory->createHolder(clid,label, index);
370 if(!baseholder){
371 ATH_MSG_ERROR("createHolder: creation of holder for CLID: " << clid << " label: " << label << " and index: " << index << " failed");
372 }
373
374 holder = dynamic_cast<IHolder*>(baseholder);
375
376 if(!holder){
377 ATH_MSG_ERROR("createHolder: cast to IHolder* failed");
378 }
379
380 return true;
381}
ITrigHolderFactory * m_holderfactory
std::string label(class_id_type clid, const index_or_label_type &sti_or_label) const

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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>

◆ decreasingOrderByTEId()

bool TrigNavStructure::decreasingOrderByTEId ( const TriggerElement * te1,
const TriggerElement * te2 )
staticinherited

Definition at line 487 of file TrigNavStructure.cxx.

487 {
488 return te1->getId() > te2->getId();
489}

◆ deserialize()

bool NavigationCore::deserialize ( const std::vector< uint32_t > & input)
virtualinherited

Implements HLT::TrigNavStructure.

Definition at line 151 of file NavigationCore.cxx.

151 {
152 std::lock_guard<std::recursive_mutex> lock(getMutex());
153 TrigHolderStructure& holderstorage = getHolderStorage();
154
155 std::vector<uint32_t>::const_iterator inputIt = input.begin();
156
157 ATH_MSG_DEBUG("deserialize: deserializing input of size: " << input.size());
158
159
160 if (input.size()==0) {
161 ATH_MSG_WARNING("Cannot work on empty payload");
162 return false;
163 }
164 unsigned int version = *inputIt++; // ignore version
165
166 ATH_MSG_DEBUG("deserialize: the serialized input has versions " << version);
167
168 if ( version != 3 and version !=4 ) {
169 ATH_MSG_WARNING("No backward compatibility beyond version 3 possible; data was serialized with V: " << version
170 << " while we are in version 4");
171 return true;
172 }
173 ATH_MSG_DEBUG("deserialize: deserialization of Navigation version: " << version);
174
175 unsigned int totalSize = *inputIt++; // total size
176 if ( totalSize != input.size() )
177 ATH_MSG_WARNING("deserialize: the navigation is truncated: " << input.size()
178 << " while should be: " << totalSize );
179
180 if ( input.size() == 2 ) { // there was only space for version and size
181 ATH_MSG_WARNING("deserialize: the navigation is truncated badly, no recovery possible " );
182 return false;
183 }
184
185 bool tesDeserializationStatus = deserializeTEs(inputIt,input.size());
186 ATH_MSG_DEBUG("deserialize: TEs structure unpacked, status: " << tesDeserializationStatus );
187
188
189 ATH_MSG_DEBUG("do we have holder payload? " << (inputIt != input.end()));
190
191 // Keep track of blobs we've deserialized for each event.
192 struct DeserializedMemo
193 {
194 std::mutex m_mutex;
195 EventContext::ContextEvt_t m_evt;
196 std::unordered_map<uint64_t, std::shared_ptr<HLT::BaseHolder>> m_holders;
197 };
198 static SG::SlotSpecificObj<DeserializedMemo> memos ATLAS_THREAD_SAFE;
199
200 const EventContext& ctx = Gaudi::Hive::currentContext();
201 DeserializedMemo& memo = *memos.get (ctx);
202 std::scoped_lock memolock (memo.m_mutex);
203 if (memo.m_evt != ctx.evt()) {
204 memo.m_holders.clear();
205 memo.m_evt = ctx.evt();
206 }
207
208 // EOF TEs deserialization
209 // deserialize Features
210 std::vector<uint32_t>::const_iterator it = inputIt;
211 std::vector<uint32_t> blob;
212 while ( extractBlob(input, it, blob) ) {
213 // Skip this blob if we've already deserialized it.
214 // See ATLASRECTS-6278, ATEAM-734 and ATR-25282
215 uint64_t hash = CxxUtils::crc64 (reinterpret_cast<const char*>(blob.data()),
216 blob.size()*sizeof(*blob.data()));
217
218 auto& holder = memo.m_holders[hash]; // ref(!) to empty or existing holder pointer
219 if (! holder ) {
220 ATH_MSG_DEBUG("deserializing holder blob with size/hash " << blob.size() << "/" << hash);
221 holder = std::shared_ptr<HLT::BaseHolder>(m_holderfactory->fromSerialized(version,blob.begin(),blob.end()));
222 if (! holder ) continue; // error during deserialization
223 } else {
224 ATH_MSG_DEBUG("blob with size/hash " << blob.size() << "/" << hash
225 << " already deserialized; re-using holder");
226 }
227
228 if(!holderstorage.registerHolder(holder)){
229 ATH_MSG_WARNING("deserialize: holder registration for holder with clid: " << holder->typeClid() << " and label: " << holder->label() << " failed.");
230 }
231 }
232 return true;
233}
#define ATH_MSG_WARNING(x)
static unsigned int totalSize(const MultiDimArray< T, N > &ht)
bool extractBlob(const std::vector< uint32_t > &input, std::vector< uint32_t >::const_iterator &it, std::vector< uint32_t > &blob) const
bool registerHolder(const std::shared_ptr< BaseHolder > &holder)
bool deserializeTEs(std::vector< uint32_t >::const_iterator &start, unsigned int totalSize)
static const TriggerElement *m_unspecifiedTE ATLAS_THREAD_SAFE
TrigHolderStructure & getHolderStorage()
uint64_t crc64(const CRCTable &table, const char *data, size_t data_len)
Find the CRC-64 of a string,.
Definition crc64.cxx:696

◆ deserializeTEs()

bool TrigNavStructure::deserializeTEs ( std::vector< uint32_t >::const_iterator & start,
unsigned int totalSize )
inherited

Definition at line 264 of file TrigNavStructure.cxx.

264 {
265 std::lock_guard<std::recursive_mutex> lock(getMutex());
266 TriggerElementFactory& factory = getFactory();
267
268 factory.reset();
269
270 std::vector<uint32_t>::const_iterator& inputIt = start;
271 const size_t payloadSize = *inputIt++;
272
273 if ( totalSize < payloadSize ) { // not all TEs were recorded
274 std::cerr << "size of the navigation payload smaller than the one required to save TEs. " << totalSize << " < " << payloadSize << std::endl;
275 return false;
276 }
277
278
279 const unsigned int size = *inputIt++; // size in terms of number of TEs
280 TriggerElement* previous = 0;
281 std::map<uint16_t, TriggerElement* > keys;
282
283 for ( unsigned int i = 0; i < size; ++i ) {
284 // create new TE
285 TriggerElement* te = factory.produce(TriggerElement::enquireId(inputIt)); //
286 te->deserialize(inputIt, keys, previous);
287 previous = te;
288 // keys table for deserialization of other TEs
289 keys[i] = te;
290 }
291
292 if ( not factory.empty() ) {
293 // rebuild sameRoI relations (this can't be done by TEs deserialization)
294 TriggerElement* initialNode = getInitialNode();
295 std::vector<TriggerElement*>::const_iterator roiTEit;
296 for ( roiTEit = getDirectSuccessors(initialNode).begin();
297 roiTEit != getDirectSuccessors(initialNode).end(); ++roiTEit ) {
298 fillSameRoIRelation((*roiTEit), (*roiTEit));
299 }
300 } // else this is empty structure, but this shoudl not bother us as it is may well be valid case
301
302 return true;
303}
void fillSameRoIRelation(TriggerElement *roi, TriggerElement *te)
rebuilds the sameRoIRelation between trigger elements (used internally by deserialize)
TriggerElement * getInitialNode()
gets initial node, if node is not there then it is created on fly
static const std::vector< TriggerElement * > & getDirectSuccessors(const TriggerElement *te)
returns list of direct predecessors (nodes I seed)
static unsigned int enquireId(std::vector< uint32_t >::const_iterator &inputIt)
void deserialize(std::vector< uint32_t >::const_iterator &inputIt, const std::map< uint16_t, TriggerElement * > &keys, const TriggerElement *previous)
deserialization
@ previous
Definition BinningData.h:32

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::evtStore ( )
inlineinherited

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

Definition at line 85 of file AthCommonDataStore.h.

◆ extractBlob()

bool NavigationCore::extractBlob ( const std::vector< uint32_t > & input,
std::vector< uint32_t >::const_iterator & it,
std::vector< uint32_t > & blob ) const
protectedinherited

Definition at line 60 of file NavigationCore.cxx.

60 {
61 blob.clear();
62 if ( it == input.end() )
63 return false;
64
65 unsigned sizeOfBlob = *it;
66 std::vector<uint32_t>::const_iterator begin = it;
67 ++begin;
68 std::vector<uint32_t>::const_iterator end = it;
69 ++end;
70 advance(end, sizeOfBlob);
71 if ( end <= input.end()) {
72 blob.reserve(end-begin);
73 blob.insert(blob.end(), begin, end);
74 it = end; // update iterator
75 return true;
76 }
77 return false; // failed to get blob
78}

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ featureLink2Object()

template<class T>
const T * HLT::NavigationCore::featureLink2Object ( const TrigFeatureLink & ) const
inherited

◆ fillSameRoIRelation()

void TrigNavStructure::fillSameRoIRelation ( TriggerElement * roi,
TriggerElement * te )
protectedinherited

rebuilds the sameRoIRelation between trigger elements (used internally by deserialize)

Warning
should be called for each RoI like node

Definition at line 307 of file TrigNavStructure.cxx.

307 {
308 if ( ! isRoINode(te) ) {
311 }
312 if ( isTerminalNode(te) )
313 return;
314 else { // traverse all sub nodes
315 std::vector<TriggerElement*>::const_iterator it;
316 for ( it = getDirectSuccessors(te).begin(); it != getDirectSuccessors(te).end(); ++it ) {
317 fillSameRoIRelation(roi, *it);
318 }
319 }
320}
static bool isTerminalNode(const TriggerElement *te)
queries if node is terminal (no more TriggerElement are seeded by it)

◆ findOwners()

template<class T>
bool HLT::Navigation::findOwners ( const T * obj,
std::vector< const TriggerElement * > & owners,
unsigned int id = 0 )

find all TriggerElements which have this object attached given feature

Warning
This search is costly since all TEs needs to be searched for. It can be significantly improved if search is limited to TEs with given ID
Parameters
objis a pointer to object of interest
ownersis a vector of TEs which will be filled by all owners of the feature
idthe id of TEs which should be inspected
Returns
true if no error was encountered, this does not mean that object is found, false if data access error occured

◆ getAccessProxy()

const AccessProxy * HLT::NavigationCore::getAccessProxy ( ) const
inlineinherited

gets the access proxy

Definition at line 337 of file NavigationCore.h.

337 {
338 return m_storeGate;
339 }
StoreGateSvc * m_storeGate

◆ getAll()

void TrigNavStructure::getAll ( std::vector< TriggerElement * > & output,
const bool activeOnly = true ) const
inherited

The query returning a collection of all TriggerElements.

Definition at line 361 of file TrigNavStructure.cxx.

361 {
362 std::lock_guard<std::recursive_mutex> lock(getMutex());
363 const TriggerElementFactory& factory = getFactory();
364
365 if ( not factory.listOfProduced().empty() ) {
366 std::back_insert_iterator<std::vector<TriggerElement*> > outputIt( output );
367 if (activeOnly)
368 remove_copy_if ( factory.listOfProduced().begin(), factory.listOfProduced().end(), outputIt, isNotActive );
369 else
370 copy ( factory.listOfProduced().begin(), factory.listOfProduced().end(), outputIt );
371 }
372}
bool copy
Definition calibdata.py:26

◆ getAllFeatures()

template<class C, class T>
bool HLT::NavigationCore::getAllFeatures ( ElementLinkVector< C > & features,
const std::string & label = "" ) const
inherited

gets all features of type T atachedd to whichever TE

Parameters
featuresvector of pointers to features to which will be filled up
labelthe label for a given feature
labelslist of all features of this type already in place and thier labels (of not specified) faster query
Returns
true if no errors encountered

◆ getAllOfType() [1/2]

void NavigationCore::getAllOfType ( const std::string & id,
std::vector< HLT::TriggerElement * > & output,
const bool activeOnly = true ) const
inherited

return trigger elements given the name of TEs

Definition at line 401 of file NavigationCore.cxx.

402 {
403 if ( id == "" )
404 return getAll(output, activeOnly);
405
406 return TrigNavStructure::getAllOfType( string2hash(id, "TE"), output, activeOnly);
407}
static uint32_t string2hash(const std::string &, const std::string &category="TE")
convert strin g to hash.
void getAllOfType(const te_id_type id, std::vector< TriggerElement * > &output, const bool activeOnly=true) const
The query returning a collection of all TriggerElements if name is given.
void getAll(std::vector< TriggerElement * > &output, const bool activeOnly=true) const
The query returning a collection of all TriggerElements.

◆ getAllOfType() [2/2]

void TrigNavStructure::getAllOfType ( const te_id_type id,
std::vector< TriggerElement * > & output,
const bool activeOnly = true ) const
inherited

The query returning a collection of all TriggerElements if name is given.

Parameters
idname of TE, if "" given all TEs are returned

Definition at line 201 of file TrigNavStructure.cxx.

344 {
345 std::lock_guard<std::recursive_mutex> lock(getMutex());
346 const TriggerElementFactory& factory = getFactory();
347
348 if ( not factory.listOfProduced(id).empty() ) {
349 std::back_insert_iterator<std::vector<TriggerElement*> > outputIt( output );
350
351 // 2 cases: only active ones, and all
352 // one can consider sorting the TEs according to the activation status and then assume that collection is sorted
353 // the same functor can be used as in copy_if
354 if (activeOnly)
355 remove_copy_if ( factory.listOfProduced(id).begin(), factory.listOfProduced(id).end(), outputIt, isNotActive );
356 else
357 copy ( factory.listOfProduced(id).begin(), factory.listOfProduced(id).end(), outputIt );
358 }
359}

◆ getAllRoIThresholdTEs()

void TrigNavStructure::getAllRoIThresholdTEs ( std::vector< TriggerElement * > & output) const
inherited

The query returns a vector of all TriggerElements that represent a LVL1 RoI threshold.

Definition at line 328 of file TrigNavStructure.cxx.

329{
330 const TriggerElement* initNode = getInitialNode();
331 // get first layer of TEs representing the RoIs themselves (not the thresholds!)
332 const std::vector<TriggerElement*>& rois = getDirectSuccessors(initNode);
333 for ( const TriggerElement* roi_te : rois ) {
334 // get threshold-like TEs:
335 const std::vector<TriggerElement*>& tes = getDirectSuccessors( roi_te );
336 for (TriggerElement* te : tes) {
337 output.push_back( te );
338 }
339 }
340}

◆ getAllTEs() [1/2]

std::vector< TriggerElement * > & TrigNavStructure::getAllTEs ( )
inherited

access needed by slimming tools.

Definition at line 374 of file TrigNavStructure.cxx.

374 {
375 std::lock_guard<std::recursive_mutex> lock(getMutex());
376 TriggerElementFactory& factory = getFactory();
377
378 return factory.listOfProduced();
379}

◆ getAllTEs() [2/2]

const std::vector< TriggerElement * > & TrigNavStructure::getAllTEs ( ) const
inherited

access needed by slimming tools.

Definition at line 381 of file TrigNavStructure.cxx.

381 {
382 std::lock_guard<std::recursive_mutex> lock(getMutex());
383 const TriggerElementFactory& factory = getFactory();
384
385 return factory.listOfProduced();
386}

◆ getDirectPredecessors()

const std::vector< TriggerElement * > & TrigNavStructure::getDirectPredecessors ( const TriggerElement * te)
staticinherited

returns list of direct predecessors (nodes seeding me)

Parameters
teTriggerElement to query
Returns
collection of TriggerElements (if empty then node is initial)

Definition at line 120 of file TrigNavStructure.cxx.

120 {
122}

◆ getDirectSuccessors()

const std::vector< TriggerElement * > & TrigNavStructure::getDirectSuccessors ( const TriggerElement * te)
staticinherited

returns list of direct predecessors (nodes I seed)

Parameters
teTriggerElement to query
Returns
collection of TriggerElements (if empty then node is terminal)

Definition at line 124 of file TrigNavStructure.cxx.

124 {
126}

◆ getFactory() [1/2]

TriggerElementFactory & HLT::TrigNavStructure::getFactory ( )
inlineprotectedinherited

Definition at line 369 of file TrigNavStructure.h.

369{ return *m_factory; }
SG::SlotSpecificObj< TriggerElementFactory > m_factory
factory of trigger elements (one per processing slot)

◆ getFactory() [2/2]

const TriggerElementFactory & HLT::TrigNavStructure::getFactory ( ) const
inlineprotectedinherited

Definition at line 373 of file TrigNavStructure.h.

373{ return *m_factory; }

◆ getFeature() [1/3]

template<class T>
bool HLT::NavigationCore::getFeature ( const TriggerElement * te,
const ConstDataVector< T > *& features,
const std::string & label = "",
std::string & sourcelabel = ::HLT::TrigNavStructure::m_unspecifiedLabel ) const
inherited

◆ getFeature() [2/3]

template<class T>
bool HLT::NavigationCore::getFeature ( const TriggerElement * te,
const T *& features,
const std::string & label = "",
std::string & sourcelabel = ::HLT::TrigNavStructure::m_unspecifiedLabel ) const
inherited

◆ getFeature() [3/3]

TriggerElement::FeatureAccessHelper TrigNavStructure::getFeature ( const TriggerElement * te,
class_id_type clid,
const index_or_label_type & index_or_label ) const
inherited

typeless feature access metod

Parameters
tethe TE from which the search should be done
clidthe class ID of searched type
subfeature sub index (
See also
TriggerElement::ObjectIndex), if invalid_sub_type is passed then it is neglected
Returns
invalid FeatureAccessHelper is returned if nothng is found, else valid one

Definition at line 781 of file TrigNavStructure.cxx.

781 {
782
783
785 bool single = true; bool recursively = false;
786 bool status = getFeatureAccessors(te, clid,index_or_label,single,features,recursively);
787
788 if(status && !features.empty()){
789 return features.front();
790 }
791 return TriggerElement::FeatureAccessHelper(); // not found
792}
virtual bool getFeatureAccessors(const TriggerElement *te, class_id_type clid, const index_or_label_type &index_or_label, bool only_single_feature, TriggerElement::FeatureVec &features, bool travel_backward_recursively, const TriggerElement *&source=m_unspecifiedTE, std::string &sourcelabel=m_unspecifiedLabel) const
status
Definition merge.py:16

◆ getFeatureAccessors()

bool NavigationCore::getFeatureAccessors ( const TriggerElement * te,
class_id_type clid,
const index_or_label_type & index_or_label,
bool only_single_feature,
TriggerElement::FeatureVec & features,
bool travel_backward_recursively,
const TriggerElement *& source = m_unspecifiedTE,
std::string & sourcelabel = m_unspecifiedLabel ) const
virtualinherited

retrieve features accessors according to the requrements This method is actually workhorse for all above.

I.e. the TEs structure traversing happens inside it.

Parameters
teis TriggerElement at which searching starts
clidis ClassID of type which is searched for
labelis object label (as used by attachFeature), empty lables (i.e. == "") means any label, nonempty label means exact matching, and noverlty label == "!" means we are specifically looking for empty label
only_single_featureif true means we are looking for only one last object (i.e. imagine several object of the same type attached to TE)
featuresvector of FeatureAccessHelper objects to fill up
travel_backward_recursivelyif true will doe actual travering TriggerElement structure to find objects, if false search will stop at the TriggerElement te
sourceTriggerElement where the object was found (or query stopped)
sourcelabelis labels which the object had (useful when calling this routine with empty label)

Reimplemented from HLT::TrigNavStructure.

Definition at line 410 of file NavigationCore.cxx.

416 {
417
418 return TrigNavStructure::getFeatureAccessors(te,clid,index_or_label,only_single_feature,features,travel_backward_recursively,source,sourcelabel);
419}

◆ getFeatureAccessorsSingleTE()

bool NavigationCore::getFeatureAccessorsSingleTE ( const TriggerElement * te,
CLID clid,
const index_or_label_type & index_or_label,
bool only_single_feature,
TriggerElement::FeatureVec & features,
const TriggerElement *& source = ::HLT::TrigNavStructure::m_unspecifiedTE,
std::string & sourcelabel = ::HLT::TrigNavStructure::m_unspecifiedLabel ) const
virtualinherited

Reimplemented from HLT::TrigNavStructure.

Definition at line 421 of file NavigationCore.cxx.

426 {
427
428 bool status = TrigNavStructure::getFeatureAccessorsSingleTE(te,clid,index_or_label,only_single_feature,features,source,sourcelabel);
429
430 //if query was via subindex we don't cache the query (no support yet)
431 if(index_or_label.index() == 0) return status;
432
433 return status;
434}
virtual bool getFeatureAccessorsSingleTE(const TriggerElement *te, class_id_type clid, const index_or_label_type &index_or_label, bool only_single_feature, TriggerElement::FeatureVec &features, const TriggerElement *&source, std::string &sourcelabel) const

◆ getFeatureRecursively()

TriggerElement::FeatureAccessHelper TrigNavStructure::getFeatureRecursively ( const TriggerElement * startTE,
class_id_type clid,
const index_or_label_type & index_or_label,
const TriggerElement *& sourceTE ) const
inherited

recursive search for features the function is similar to the above butif th features is not found at the startTE the search descends the structure of TEs until it is found.

It stops on RoI nodes.

Parameters
sourceTEis the TE where the feature was found

Definition at line 795 of file TrigNavStructure.cxx.

796 {
797
799 bool single = true; bool recursively = true;
800 bool status = getFeatureAccessors(startTE, clid,index_or_label,single,features,recursively,sourceTE);
801
802 if(status && !features.empty()){
803 return features.front();
804 }
805 return TriggerElement::FeatureAccessHelper(); // not found
806}

◆ getFeatures()

template<class T>
bool HLT::NavigationCore::getFeatures ( const TriggerElement * te,
std::vector< const T * > & features,
const std::string & label = "",
std::map< const T *, std::string > * labels = 0 ) const
inherited

retrieve features attached to given TriggerElement

Parameters
teTriggerElement from retrieve
featuresis collection to be feed
labelfor additional marking of this feature
labelslist of all features of this type already in place and thier labels
Returns
false if error enountered, true if no error encountered
Warning
No error (return true) does not mean that features were found, therefore what has to be checked is ... returned bool and size of features vector (if it has grew).

◆ getFeaturesInRoI()

template<class T>
bool HLT::NavigationCore::getFeaturesInRoI ( const TriggerElement * te,
std::vector< const T * > & features,
const std::string & label = "",
std::map< const T *, std::string > * labels = 0 ) const
inherited

retrieve features attached to the RoIs seeding this TriggerElement

Parameters
teTriggerElement from which start
featuresis collection to be feed
labelfor additional marking of this feature
Returns
false if error enountered, true if no error encountered
Parameters
labelslist of all features of this type already in place and thier labels (of not specified) faster query
Warning
No error (return true) does not mean that features were found, therefore what has to be checked is ... returned bool and size of features vector (if it has grew).

◆ getFeaturesLinks()

template<class C, class T>
bool HLT::NavigationCore::getFeaturesLinks ( const TriggerElement * te,
ElementLinkVector< C > & links,
const std::string & label = "" ) const
inherited

◆ getHolder() [1/5]

IHolder * NavigationCore::getHolder ( CLID clid,
const std::string & label ) const
protectedinherited

as above

Definition at line 390 of file NavigationCore.cxx.

390 {
391 std::lock_guard<std::recursive_mutex> lock(getMutex());
392 const TrigHolderStructure& holderstorage = getHolderStorage();
393
394 return holderstorage.getHolder<IHolder>(clid, label);
395}
HolderType * getHolder(class_id_type clid, const std::variant< sub_index_type, std::string > &stiOrLabel) const

◆ getHolder() [2/5]

IHolder * NavigationCore::getHolder ( CLID clid,
uint16_t subTypeIndex ) const
protectedinherited

as above but not type wise holder returned

Definition at line 383 of file NavigationCore.cxx.

383 {
384 std::lock_guard<std::recursive_mutex> lock(getMutex());
385 const TrigHolderStructure& holderstorage = getHolderStorage();
386
387 return holderstorage.getHolder<IHolder>(clid, subTypeIndex);
388}

◆ getHolder() [3/5]

template<class T>
HLTNavDetails::Holder< T > * HLT::NavigationCore::getHolder ( const std::string & label,
uint16_t suggestedIndex ) const
protectedinherited

aware holder discovery, creates holder if needed

◆ getHolder() [4/5]

template<class T>
HLTNavDetails::Holder< T > * HLT::NavigationCore::getHolder ( uint16_t subTypeIndex) const
inherited

as above but does not create holder on demand (return 0 if not found)

◆ getHolder() [5/5]

const BaseHolder * TrigNavStructure::getHolder ( const TriggerElement::FeatureAccessHelper & fea) const
inherited

Definition at line 921 of file TrigNavStructure.cxx.

921 {
922 std::lock_guard<std::recursive_mutex> lock(getMutex());
923 const TrigHolderStructure& holderstorage = getHolderStorage();
924
925 return holderstorage.getHolderForFeature(fea);
926}
HolderType * getHolderForFeature(const TriggerElement::FeatureAccessHelper &fea) const

◆ getHolderStorage() [1/2]

TrigHolderStructure & HLT::TrigNavStructure::getHolderStorage ( )
inlineprotectedinherited

Definition at line 370 of file TrigNavStructure.h.

370{ return *m_holderstorage; }
SG::SlotSpecificObj< TrigHolderStructure > m_holderstorage
structure for feature holders (one per processing slot)

◆ getHolderStorage() [2/2]

const TrigHolderStructure & HLT::TrigNavStructure::getHolderStorage ( ) const
inlineprotectedinherited

Definition at line 374 of file TrigNavStructure.h.

374{ return *m_holderstorage; }

◆ getInitialNode() [1/2]

TriggerElement * TrigNavStructure::getInitialNode ( )
inherited

gets initial node, if node is not there then it is created on fly

Definition at line 39 of file TrigNavStructure.cxx.

39 {
40 std::lock_guard<std::recursive_mutex> lock(getMutex());
41 TriggerElementFactory& factory = getFactory();
42
43 if ( factory.empty() )
44 factory.produce(0);
45 return factory.listOfProduced().front();
46}

◆ getInitialNode() [2/2]

const TriggerElement * TrigNavStructure::getInitialNode ( ) const
inherited

Definition at line 48 of file TrigNavStructure.cxx.

48 {
49 std::lock_guard<std::recursive_mutex> lock(getMutex());
50 const TriggerElementFactory& factory = getFactory();
51
52 if ( not factory.empty() )
53 return factory.listOfProduced().front();
54 return 0;
55}

◆ getMutex() [1/2]

std::recursive_mutex & HLT::TrigNavStructure::getMutex ( )
inlineprotectedinherited

Definition at line 371 of file TrigNavStructure.h.

371{ return s_rmutex; }
static std::recursive_mutex s_rmutex

◆ getMutex() [2/2]

std::recursive_mutex & HLT::TrigNavStructure::getMutex ( ) const
inlineprotectedinherited

Definition at line 375 of file TrigNavStructure.h.

375{ return s_rmutex; }

◆ getNextKey()

template<class T>
const std::string HLT::Navigation::getNextKey ( const std::string & label = "")

Get the next key for a given object.

◆ getRecentFeature()

template<class T>
bool HLT::NavigationCore::getRecentFeature ( const TriggerElement * te,
const T *& feature,
const std::string & label = "",
const TriggerElement *& source = ::HLT::TrigNavStructure::m_unspecifiedTE,
std::string & sourcelabel = ::HLT::TrigNavStructure::m_unspecifiedLabel ) const
inherited

◆ getRecentFeatureDataOrElementLink()

template<class LinkType>
bool HLT::NavigationCore::getRecentFeatureDataOrElementLink ( const TriggerElement * te,
LinkType & link,
const std::string & label = "",
const TriggerElement *& source = ::HLT::TrigNavStructure::m_unspecifiedTE,
std::string & sourcelabel = ::HLT::TrigNavStructure::m_unspecifiedLabel ) const
inherited

◆ getRecentFeatureLink()

template<class C, class T>
bool HLT::NavigationCore::getRecentFeatureLink ( const TriggerElement * te,
ElementLink< C > & link,
const std::string & label = "",
const TriggerElement *& source = ::HLT::TrigNavStructure::m_unspecifiedTE,
std::string & sourcelabel = ::HLT::TrigNavStructure::m_unspecifiedLabel ) const
inherited

◆ getRecentFeatures()

template<class T>
bool HLT::NavigationCore::getRecentFeatures ( const TriggerElement * te,
std::vector< const T * > & features,
const std::string & label = "",
std::map< const T *, std::string > * labels = 0 ) const
inherited

retrieve features attached to given TriggerElement or its predecessors the algorithm will go recursively to all predecessors and once the feature is found attached to given TE returns all features (of this type and label) attached to this TE

Parameters
teTriggerElement from which to start
featuresis vector to be filled up
labelfor additional marking of this feature
labelslist of all features of this type already in place and thier labels (of not specified) faster query
Returns
false if error enountered, true if no error encountered
Warning
No error (return true) does not mean that features were found, therefore what has to be checked is ... returned bool and feature ptr != 0;

◆ getRecentFeaturesLinks()

template<class C, class T>
bool HLT::NavigationCore::getRecentFeaturesLinks ( const TriggerElement * te,
ElementLinkVector< C > & links,
const std::string & label = "" ) const
inherited

◆ getRoINodes()

const std::vector< TriggerElement * > & TrigNavStructure::getRoINodes ( const TriggerElement * somenode)
staticinherited

gets all RoI type nodes seeding indirectly this TriggerElement

For getting all RoI nodes one can call getDirectrSuccessors(getIntialNode()

Warning
If this method is called for RoI node then it returns all TEs originating from it

Definition at line 73 of file TrigNavStructure.cxx.

73 {
75}

◆ getSuccessor()

const TriggerElement * TrigNavStructure::getSuccessor ( const TriggerElement * te,
unsigned int id )
staticinherited

returns successor of given type beeing seeded from this TE

Parameters
teTriggerElement to query
idthe id of the successor TreiggerElement to find
Returns
TriggerElement pointer which can be 0
Warning
the implementation is recursive

Definition at line 129 of file TrigNavStructure.cxx.

129 {
130 if ( te->getId() == id )
131 return te;
132 std::vector<TriggerElement*>::const_iterator it;
133 const TriggerElement* found(0);
135 found = getSuccessor(*it, id);
136 if (found)
137 break;
138 }
139 return found;
140}
static const TriggerElement * getSuccessor(const TriggerElement *te, unsigned int id)
returns successor of given type beeing seeded from this TE

◆ getTopologicallySpannedBy()

bool TrigNavStructure::getTopologicallySpannedBy ( const TriggerElement * te,
const std::vector< unsigned int > & types,
std::vector< const TriggerElement * > & children,
const bool activeOnly = true ) const
inherited

gets the TEs whose predecessors were used to built a given topological TE

Parameters
tetopological TE from which to start
typesvector of types to search for
childsvector of retrieved TEs; empty in case some of the required TEs cannot be found or are not active (see the activeOnly parameter)
activeOnlyoptional parameter specifying whether inactive TEs should be discarded from the search; true by default

Definition at line 712 of file TrigNavStructure.cxx.

713 {
714 if ( getDirectPredecessors(te).size() != types.size() ) {
715 return false;
716 }
717
718 for ( unsigned i = 0 ; i < types.size(); ++i ) {
719 const TriggerElement* child = getSuccessor( getDirectPredecessors(te)[i], types[i]);
720 if(child!=0) {
721 if(activeOnly && !child->getActiveState()) {
722 children.clear();
723 return true;
724 }
725 children.push_back(child);
726 } else {
727 children.clear();
728 return true;
729 }
730 }
731 return true;
732}
static const std::vector< TriggerElement * > & getDirectPredecessors(const TriggerElement *te)
returns list of direct predecessors (nodes seeding me)
bool getActiveState() const
get state of the TriggerElement

◆ getUniqueKey()

template<class T>
const std::string HLT::Navigation::getUniqueKey ( const std::string & label = "")

Get a unique key (not in the usual series) for a given object.

◆ hasIdFromTheSet()

bool TrigNavStructure::hasIdFromTheSet ( const TriggerElement * te,
std::vector< unsigned int > ids )
staticinherited

simple helper

Definition at line 491 of file TrigNavStructure.cxx.

491 {
492 if ( find(ids.begin(), ids.end(), te->getId()) != ids.end() )
493 return true;
494 return false;
495}
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138

◆ haveAllCommonRoIs()

bool TrigNavStructure::haveAllCommonRoIs ( const HLT::TriggerElement * te1,
const HLT::TriggerElement * te2 )
staticinherited

Definition at line 447 of file TrigNavStructure.cxx.

447 {
448 std::vector<TriggerElement*> vecRoINodes1 = getRoINodes(te1);
449 std::vector<TriggerElement*> vecRoINodes2 = getRoINodes(te2);
450 sort(vecRoINodes1.begin(), vecRoINodes1.end());
451 sort(vecRoINodes2.begin(), vecRoINodes2.end());
452 return vecRoINodes1 == vecRoINodes2;
453}
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
static const std::vector< TriggerElement * > & getRoINodes(const TriggerElement *somenode)
gets all RoI type nodes seeding indirectly this TriggerElement

◆ haveCommonRoI()

bool TrigNavStructure::haveCommonRoI ( const TriggerElement * te1,
const TriggerElement * te2 )
staticinherited

does this 2 share RoI

RoI node itself can be passed, then it will tell if a given TriggerElement is originating in this RoI for simple TriggerElement it is a bit overkill since it assumed that the number of RoIs can be any

Warning
this algorithm should not be used by sort or unique STL algorithms. Comparing algorithms are required to be "Strict weak ordering" i.e.return false if comparing x and x and if x < y and y < z then x < z (transitivity). Sort algorithm will simply misbehave (crash trying to access objects under address 0)
Returns
true if there is at least one common RoI

Definition at line 414 of file TrigNavStructure.cxx.

414 {
415 std::vector<const TriggerElement*> vecRoINodes;
416
417 if ( isRoINode(te1) ) {
418 vecRoINodes.push_back(te1);
419 } else {
420 std::back_insert_iterator<std::vector<const TriggerElement*> > outputIt( vecRoINodes );
422 }
423 if ( isRoINode(te2) ) {
424 vecRoINodes.push_back(te2);
425 } else {
426 std::back_insert_iterator<std::vector<const TriggerElement*> > outputIt( vecRoINodes );
428 }
429 // sort (by pointers, it is OK do not be scared)
430 sort(vecRoINodes.begin(), vecRoINodes.end());
431
432 std::vector<const TriggerElement*>::const_iterator it;
433 it = adjacent_find(vecRoINodes.begin(), vecRoINodes.end());
434
435 if ( it == vecRoINodes.end() )
436 return false;
437
438 return true;
439}

◆ haveCommonSeed()

bool TrigNavStructure::haveCommonSeed ( const TriggerElement * te1,
const TriggerElement * te2 )
staticinherited

checks that there is any common predecessor of two TriggerElements

Warning
See comments on haveCommonRoI. The same applies.

Definition at line 459 of file TrigNavStructure.cxx.

459 {
460 std::vector<const TriggerElement*> vecRoINodes;
461 std::back_insert_iterator<std::vector<const TriggerElement*> > outputIt( vecRoINodes );
462
464 te1->getRelated(TriggerElement::seededByRelation).end(), outputIt);
465
467 te2->getRelated(TriggerElement::seededByRelation).end(), outputIt);
468
469 // sort (by pointers, it is OK do not be scared) & uniq
470 sort(vecRoINodes.begin(), vecRoINodes.end());
471
472 std::vector<const TriggerElement*>::iterator it;
473 it = adjacent_find(vecRoINodes.begin(), vecRoINodes.end());
474 if ( it == vecRoINodes.end() ) // after uniquing we still are
475 return false;
476 return true;
477}

◆ haveDistinctRoI()

bool TrigNavStructure::haveDistinctRoI ( const TriggerElement * te1,
const TriggerElement * te2 )
staticinherited

inversion of haveCommonRoI

But notice it is more suitable for SLT sort etc. since for comparison 2 identical objects it returns false. However the transitivity can't be guaranteed.

Definition at line 442 of file TrigNavStructure.cxx.

442 {
443 return ! haveCommonRoI(te1, te2);
444}
static bool haveCommonRoI(const TriggerElement *te1, const TriggerElement *te2)
does this 2 share RoI

◆ haveDistinctSeed()

bool TrigNavStructure::haveDistinctSeed ( const TriggerElement * te1,
const TriggerElement * te2 )
staticinherited

inversion of haveCommonSeed

Definition at line 479 of file TrigNavStructure.cxx.

479 {
480 return ! haveCommonSeed(te1, te2);
481}
static bool haveCommonSeed(const TriggerElement *te1, const TriggerElement *te2)
checks that there is any common predecessor of two TriggerElements

◆ increasingOrderByTEId()

bool TrigNavStructure::increasingOrderByTEId ( const TriggerElement * te1,
const TriggerElement * te2 )
staticinherited

for sorting TriggerElements according to their id

Note that this methods are not complementary. (It is required to be usable for STL algorithms.)

Definition at line 483 of file TrigNavStructure.cxx.

483 {
484 return te1->getId() < te2->getId();
485}

◆ initialize()

StatusCode Navigation::initialize ( )
overridevirtual

Definition at line 48 of file Navigation.cxx.

48 {
49
50 // initialize some pointers of our base class
51 //m_log = &msg();
52 m_storeGate = evtStore().operator->();
53
56
59
60 ATH_CHECK(m_clidSvc.retrieve());
61
62 // payload def
65
66 // ignored classes
67 std::vector<CSPair> ignore;
69 if ( !ignore.empty() ) {
70 ATH_MSG_INFO( "Ignoring " << m_classesFromPayloadIgnoreProperty << " during deserialization");
71 }
72 for (const auto& c : ignore) {
73 ATH_MSG_DEBUG("Ignoring CLID " << c.first << (c.second.empty() ? "" : " with label "+c.second) <<
74 " during deserialization");
75 m_fullholderfactory.addClassToIgnore(c.first, c.second);
76 }
77
78 // initialize converters
79 for (const CSPair& p : m_classesToPayload) {
80 const CLID cl = p.first;
81 StatusCode stmp = m_serializerSvc->addConverter(cl);
82 if (stmp.isFailure())
83 ATH_MSG_WARNING("Initialization of a converter for CLID=" << cl << " failed");
84 }
85
86 // preregistration def
88
89 // print out registered holders
90 if ( msgLvl(MSG::VERBOSE) ) {
91 for (const auto& [clid, holder] : HLT::TypeMaps::holders()) {
92 if (holder==nullptr)
93 ATH_MSG_ERROR("static type information not intialized. Holder is null pointer");
94 else
95 ATH_MSG_VERBOSE(*holder);
96 }
97 }
98
99 // load libraries
100 for ( const std::string& dll : m_dlls ) {
101 System::ImageHandle handle = 0;
102 if ( System::loadDynamicLib( dll, &handle) != 1 )
103 ATH_MSG_WARNING("failed to load " << dll);
104 else
105 ATH_MSG_DEBUG("forcibly loaded library " << dll);
106 }
107
108 ATH_MSG_DEBUG(" successfully initialized Navigation");
109
110 return StatusCode::SUCCESS;
111}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
ServiceHandle< StoreGateSvc > & evtStore()
std::vector< CSPair > m_classesToPayload_DSonly
classess are put to payload according to that priority list (CLID + key)
IConversionSvc * m_serializerSvc
std::vector< CSPair > m_classesToPayload
classess are put to payload according to that priority list (CLID + key)
std::vector< CSPair > m_classesToPreregister
classes mentioned here will be put to SG irrespectively of thier presence in event
bool msgLvl(const MSG::Level lvl) const
StatusCode classKey2CLIDKey(const std::vector< std::string > &property, std::vector< CSPair > &decoded)
Gaudi::Property< std::vector< std::string > > m_dlls
Definition Navigation.h:169
static const CLIDtoHolderMap & holders()
Definition TypeMaps.h:30
::StatusCode StatusCode
StatusCode definition for legacy code.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ isCompatibleTree()

bool TrigNavStructure::isCompatibleTree ( const TriggerElement * te1,
const TriggerElement * te2 )
staticinherited

check compatibility of 2 navigation structures

This what is checked is only the id of trigger elements whether they are having the same place in the navigation structure; have identical subtrees (check is recursive)

Definition at line 524 of file TrigNavStructure.cxx.

524 {
525 using namespace std;
526 if ( te1->getId() != te2->getId() ) {
527 return false; // distinc Id
528 }
529
530 if ( ( isTerminalNode(te1) && isTerminalNode(te2) ) )
531 return true; // no more checks needs to be done
532 else if ( isTerminalNode(te1) || isTerminalNode(te2) )
533 return false; // one of both is terminal while another is not (case when both are terminal is covered above)
534
535 // continue subchecks otherwise (both nonterminal)
536
537 // folow seeds otherwise
539 return false;
540
541 std::vector<TriggerElement*>::const_iterator seededByTe1 = te1->getRelated(TriggerElement::seedsRelation).begin();
542 std::vector<TriggerElement*>::const_iterator seededByTe2 = te2->getRelated(TriggerElement::seedsRelation).begin();
543
544 for ( ; seededByTe1 != te1->getRelated(TriggerElement::seedsRelation).end(); ++seededByTe1, ++seededByTe2 ) {
545 if (isCompatibleTree(*seededByTe1, *seededByTe2) == false) // grrr,wrrr recursive call here
546 return false;
547 }
548 // there I should probably check as well the Features attached to the TEs
549
550 return true;
551}
static bool isCompatibleTree(const TriggerElement *te1, const TriggerElement *te2)
check compatibility of 2 navigation structures

◆ isInitialNode()

bool TrigNavStructure::isInitialNode ( const TriggerElement * te)
staticinherited

queries if node is an initial one

Parameters
tenode to be queried
Returns
true if passed node is initial

Definition at line 499 of file TrigNavStructure.cxx.

499 {
500 if ( te->getRelated(TriggerElement::seededByRelation).empty() and te->getId() == 0 )
501 return true;
502 return false;
503}

◆ isNotActive()

bool HLT::TrigNavStructure::isNotActive ( const TriggerElement * te)
inlinestaticinherited

helper for the STL

Definition at line 257 of file TrigNavStructure.h.

257{ return !te->getActiveState(); }

◆ isRoINode()

bool TrigNavStructure::isRoINode ( const TriggerElement * te)
staticinherited

queries if node is an RoI type one

Parameters
tenode to be queried
Returns
true if passed node is RoI type

Definition at line 505 of file TrigNavStructure.cxx.

505 {
506 if ( te->getRelated( TriggerElement::seededByRelation ).empty() ) // this s initial node
507 return false;
508
509 TriggerElement* whoSeedsMe = *(te->getRelated( TriggerElement::seededByRelation ).begin());
510 if ( isInitialNode(whoSeedsMe) )
511 return true;
512 return false;
513}

◆ isTerminalNode()

bool TrigNavStructure::isTerminalNode ( const TriggerElement * te)
staticinherited

queries if node is terminal (no more TriggerElement are seeded by it)

Parameters
tenode to be queried
Returns
true if passed node is terminal

Definition at line 515 of file TrigNavStructure.cxx.

515 {
516 if ( te->getRelated( TriggerElement::seedsRelation ).empty() )
517 return true;
518 return false;
519}

◆ isTopological()

bool HLT::TrigNavStructure::isTopological ( const TriggerElement * te)
inlinestaticinherited

Definition at line 259 of file TrigNavStructure.h.

259{ return (getDirectPredecessors(te).size() > 1 ? true : false); }

◆ label()

std::string TrigNavStructure::label ( class_id_type clid,
const index_or_label_type & sti_or_label ) const
inherited

Definition at line 773 of file TrigNavStructure.cxx.

773 {
774 std::lock_guard<std::recursive_mutex> lock(getMutex());
775 const TrigHolderStructure& holderstorage = getHolderStorage();
776
777 return holderstorage.getLabel(clid,sti_or_label);
778}
std::string getLabel(class_id_type clid, const index_or_label_type &stiOrLabel) const

◆ matchFeature()

bool TrigNavStructure::matchFeature ( const TriggerElement::FeatureAccessHelper & fea,
class_id_type clid,
const index_or_label_type & index_or_label ) const
protectedinherited

Definition at line 896 of file TrigNavStructure.cxx.

896 {
897 //we always require the CLID to match
898 if(fea.getCLID() != clid) return false;
899
900 if(index_or_label.index() == 0){
901 //subtype index case: if argument is invalid_sub_index we always match, else require exact match
902 auto index = std::get<sub_index_type>(index_or_label) ;
903 return (index == invalid_sub_index || index == fea.getIndex().subTypeIndex());
904 }
905
906 if(index_or_label.index() == 1){
907 //label case: if argument is "" we always match, else require exact match (via)
908 auto label = std::get<std::string>(index_or_label);
909 if(label.empty()){
910 return true;
911 }
912 label = (label == "!") ? "" : label;
913 auto sub = subType(clid,label);
914 if(sub == invalid_sub_index) return false;
915 return matchFeature(fea,clid,sub);
916 }
917 return false;
918}
bool matchFeature(const TriggerElement::FeatureAccessHelper &fea, class_id_type clid, const index_or_label_type &index_or_label) const
sub_index_type subType(class_id_type clid, const index_or_label_type &sti_or_label) const
const ObjectIndex & getIndex() const
index in the external ojects array
sub_index_type subTypeIndex() const
to get collection index
str index
Definition DeMoScan.py:362
static const index_type invalid_sub_index

◆ merge()

bool NavigationCore::merge ( const NavigationCore & l2)
inherited

attemtps to merge two trees

Definition at line 235 of file NavigationCore.cxx.

235 {
236 std::lock_guard<std::recursive_mutex> l2lock(l2.getMutex());
237 const TrigHolderStructure& l2Holderstorage = l2.getHolderStorage();
238
239 // we need to pick the holders which are at L2 and move them to EF
240 for(auto l2holder : l2Holderstorage.getAllHolders<IHolder>()){
241 ATH_MSG_DEBUG("will add holder " << *l2holder);
242 std::string label(l2holder->label());
243 IHolder* efholder = getHolder(l2holder->typeClid(), label);
244 if ( efholder != 0 ) {
245 if ( (efholder->label() != l2holder->label())
246 || (efholder->subTypeIndex() != l2holder->subTypeIndex()) ) {
247
248 ATH_MSG_DEBUG("fixing bug for " << *efholder);
249 // bug which we need to fix (some week of data in autumn 2008)
250 // we have to delete current holder
251 // and replace it by L2 one
252 //
253 // efholder->setSubTypeIndex(l2holder->subTypeIndex());
254
255 ATH_MSG_DEBUG("after fixing " << *efholder);
256 }
257 } else {
258 ATH_MSG_DEBUG("cloning the holder from L2 " << *l2holder);
259
260 bool status = createHolder(efholder, l2holder->typeClid(),l2holder->label(), l2holder->subTypeIndex());
261 if(!status){
262 ATH_MSG_WARNING("in merge could not create EF holder");
263 }
264
265 //not sure if there is any possibility for this case but check anyways -Lukas
266 if(efholder->key()!=l2holder->key()){
267 ATH_MSG_WARNING("in merge the created EF holder has different SG access key than L2 holder we tried to copy");
268 }
269
270 registerHolder(efholder);
271 }
272 }
273 return true;
274}
virtual const std::string & key() const =0
returns the containers StoreGate key
const std::string & label() const
returns the label of objects stores by this holder
Definition Holder.h:85
uint16_t subTypeIndex() const
returns the index (short number used when linking object to the TE) of objects stores by this holder
Definition Holder.h:111
bool registerHolder(HLTNavDetails::IHolder *holder)
HLTNavDetails::Holder< T > * getHolder(uint16_t subTypeIndex) const
as above but does not create holder on demand (return 0 if not found)
bool createHolder(HLTNavDetails::IHolder *&holder, CLID clid, const std::string &label, uint16_t idx) const
creates holder for type given by CLID
std::vector< HolderType * > getAllHolders() const

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ nextSubTypeIndex()

uint16_t NavigationCore::nextSubTypeIndex ( CLID clid,
const std::string & label ) const
protectedinherited

Definition at line 287 of file NavigationCore.cxx.

287 {
288 std::lock_guard<std::recursive_mutex> lock(getMutex());
289 const TrigHolderStructure& holderstorage = getHolderStorage();
290
291 auto holders = holderstorage.getHoldersOfClid(clid);
292
293 if ( holders.empty() )
295
296 std::vector<sub_index_type> sub_indices(holders.size());
297 std::transform(holders.begin(), holders.end(), sub_indices.begin(),
298 [](BaseHolder* h) -> sub_index_type { return h->subTypeIndex(); });
299
300 return (*std::max_element(sub_indices.begin(),sub_indices.end()))+1;
301}
std::vector< HolderType * > getHoldersOfClid(class_id_type clid) const

◆ object2FeatureLink() [1/2]

template<class T>
TrigFeatureLink HLT::NavigationCore::object2FeatureLink ( const TriggerElement * te,
const std::string & label,
const T * obj ) const
inherited

◆ object2FeatureLink() [2/2]

template<class C>
TrigFeatureLink HLT::NavigationCore::object2FeatureLink ( const TriggerElement * te,
const std::string & label,
const typename Container2Object< C >::type * obj,
const C * container ) const
inherited

◆ operator=()

Navigation & HLT::Navigation::operator= ( const Navigation & )
protected

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ overlaps() [1/2]

bool TrigNavStructure::overlaps ( const TriggerElement * t1,
const std::vector< TriggerElement * > & teVec ) const
inherited

Check overlap between a TE and a vector of TEs, using the method above.

Definition at line 698 of file TrigNavStructure.cxx.

698 {
699 for (std::vector<TriggerElement*>::const_iterator te2 = teVec.begin(); te2 != teVec.end(); ++te2)
700 if (overlaps(te1, *te2)) return true;
701
702 return false;
703}
bool overlaps(const TriggerElement *t1, const TriggerElement *t2) const
Check overlap between trigger elements (pointer equality or RoI overlap)

◆ overlaps() [2/2]

bool TrigNavStructure::overlaps ( const TriggerElement * t1,
const TriggerElement * t2 ) const
inherited

Check overlap between trigger elements (pointer equality or RoI overlap)

Definition at line 705 of file TrigNavStructure.cxx.

705 {
706 if (te1 == te2) return true;
707 if (haveCommonRoI(te1, te2)) return true;
708
709 return false;
710}

◆ prepare()

void NavigationCore::prepare ( )
virtualinherited

prepapres the navigation for next event

Definition at line 335 of file NavigationCore.cxx.

335 {
336 if ( msgLvl(MSG::VERBOSE) ) {
337 for ( const auto& [clid, holder] : HLT::TypeMaps::holders() ) {
338 ATH_MSG_VERBOSE("NavigationCore::prepare Compile time known types : " << *holder);
339 }
340 }
341
342 ATH_MSG_VERBOSE("NavigationCore::prepare Preregistering objects #:" << m_classesToPreregister.size());
343
344 // populate structure with "must have" features
345 for ( const CSPair& conf : m_classesToPreregister ) {
346 CLID clid = conf.first;
347 std::string label = conf.second;
348 if ( prepareOneHolder(clid, label) == 0 ) {
349 ATH_MSG_WARNING("NavigationCore::prepare failed preparing the holder for CLID: " << clid << " and label " << label);
350 }
351 }
352 ATH_MSG_DEBUG("NavigationCore::prepare Navigation structure prepared for next event");
353}
HLTNavDetails::IHolder * prepareOneHolder(CLID clid, const std::string &label)

◆ prepareOneHolder()

HLTNavDetails::IHolder * NavigationCore::prepareOneHolder ( CLID clid,
const std::string & label )
privateinherited

Definition at line 303 of file NavigationCore.cxx.

303 {
304
305 ATH_MSG_VERBOSE("NavigationCore::prepare preregistering objects of clid: " << clid << " label: " << label);
306 IHolder *holder = getHolder(clid, label);
307 if ( holder ) {
308 ATH_MSG_VERBOSE("NavigationCore::prepare preregistering objects not executed as it already exists " << *holder);
309 return holder;
310 }
311
313 ATH_MSG_VERBOSE("NavigationCore::prepare creating handler for type (CLID): " << clid
314 << " label: " << label << " index: " << index);
315
316 if ( !createHolder(holder, clid, label, index) ) {
317 ATH_MSG_INFO("NavigationCore::prepare Can't create storage for objects of CLID: " << clid << " as it is requested by configuration");
318 return nullptr;
319 }
320
321 ATH_MSG_VERBOSE("Holder created, registering " << holder << " " << *holder);
322
323 if ( !registerHolder(holder) ) {
324 ATH_MSG_WARNING("Holder registration failed " << holder << " " << *holder);
325 return nullptr;
326 }
327 if ( !holder->syncWithSG() ) {
328 ATH_MSG_WARNING("Holder SG sync failed" << holder << " " << *holder);
329 return nullptr;
330 }
331
332 return holder;
333}
virtual bool syncWithSG(SG::OwnershipPolicy policy=SG::OWN_ELEMENTS)=0
uint16_t nextSubTypeIndex(CLID clid, const std::string &label) const
setWord1 uint16_t

◆ printASCIIArt()

void TrigNavStructure::printASCIIArt ( std::string & str,
const TriggerElement * te = 0,
int offset = 0 ) const
inherited

pretty printing of the navigational structure (heavy)

Definition at line 152 of file TrigNavStructure.cxx.

152 {
153 using namespace std;
154 const TriggerElement* initialNode = getInitialNode();
155 if ( initialNode == 0 )
156 return;
157
158 std::lock_guard<std::recursive_mutex> lock(getMutex());
159 const TriggerElementFactory& factory = getFactory();
160
161
162 if ( !te )
163 te = initialNode;
164
165 if ( te == initialNode ) {
166 // loop over all TEs which are not seeded by anything but are not initial nodes
167 const std::vector< TriggerElement* >& allTEs = factory.listOfProduced();
168 std::vector< TriggerElement* >::const_iterator allIt;
169 for (allIt = allTEs.begin(); allIt != allTEs.end(); ++allIt) {
170 if ((*allIt)->getRelated(TriggerElement::seededByRelation).size() == 0 && *allIt != getInitialNode() )
171 printASCIIArt(str, *allIt);
172 }
173 }
174
175 ostringstream ss;
176 // pretty print
177 for ( int i=0; i < offset; i++ ) {
178 ss << "| ";
179 //cout << " ";
180 }
181 ss << "\\_";
182
183 ss << "id:" << dec << te->getId() << ";"
184 << "active:" <<(te->getActiveState() ? "1" : "0" ) << ";"
185 << "error:" <<(te->getErrorState() ? "1" : "0" ) << ";"
186 << "ptr:" << hex << te << ";"
187 << "#seeds:" << dec << te->getRelated(TriggerElement::seedsRelation).size() << ",";
188 // add all ptrs
189 std::vector<TriggerElement*>::const_iterator seedIt;
190 for ( seedIt = getDirectSuccessors(te).begin(); seedIt != getDirectSuccessors(te).end(); ++seedIt ) {
191 ss << *seedIt <<" ";
192 }
193
194 ss << "#seededBy:" << dec << te->getRelated(TriggerElement::seededByRelation).size() << ";"
195 << "#RoI:" << dec << te->getRelated(TriggerElement::sameRoIRelation).size() << ";"
196 << "#features:" << te->getFeatureAccessHelpers().size() << ";";
197 for ( auto& fea: te->getFeatureAccessHelpers() ) {
198 ss << fea;
199 }
200 ss << std::endl;
201
202 std::string str2;
203 str2 = ss.str();
204 str += str2;
205
206 if ( ! isTerminalNode(te) ) {
207 std::vector < TriggerElement* >::const_iterator it = te->getRelated( TriggerElement::seedsRelation ).begin();
208 std::vector < TriggerElement* >::const_iterator itEnd = te->getRelated( TriggerElement::seedsRelation ).end();
209 for ( ; it != itEnd; ++it ) {
210 std::string str2;
211 printASCIIArt(str, *it, offset+1);
212 str += str2;
213 }
214 }
215}
static Double_t ss
void printASCIIArt(std::string &str, const TriggerElement *te=0, int offset=0) const
pretty printing of the navigational structure (heavy)

◆ propagateDeactivation()

bool TrigNavStructure::propagateDeactivation ( const TrigNavStructure * nav)
inherited

propagates deactivation of TE state This finction should be used after Trigger is rerurn on L2 and then the reruning on L2 is required.

The deactivated lines must be propagated ahead.

Parameters
navis navigation which was reprocessed (additional branches deactivated)
Returns
true is all went fine, false in case it is spoted that the 2 navigation structures were not initially same

Definition at line 555 of file TrigNavStructure.cxx.

555 {
556 std::lock_guard<std::recursive_mutex> lock(getMutex());
557 TriggerElementFactory& factory = getFactory();
558 const TriggerElementFactory& oldFactory = nav->getFactory();
559
560
561 // basic checks first
562 if ( oldFactory.listOfProduced().size() > factory.listOfProduced().size() )
563 return false;
564
565 std::vector< TriggerElement* >::const_iterator old = oldFactory.listOfProduced().begin();
566 std::vector< TriggerElement* >::iterator me = factory.listOfProduced().begin();
567 // int i = 0;
568 do {
569 (*me)->setActiveState((*old)->getActiveState());
570 ++me;
571 ++old;
572 } while ( old != oldFactory.listOfProduced().end() );
573 return true;
574}

◆ registerFeatureContainer()

template<class T, class C>
void HLT::NavigationCore::registerFeatureContainer ( )
staticinherited

Specialized by type and container for this type.

◆ registerHolder()

bool NavigationCore::registerHolder ( HLTNavDetails::IHolder * holder)
protectedinherited

Definition at line 355 of file NavigationCore.cxx.

355 {
356 std::lock_guard<std::recursive_mutex> lock(getMutex());
357 TrigHolderStructure& holderstorage = getHolderStorage();
358
359 auto shared_holder = std::shared_ptr<HLT::BaseHolder>(holder);
360 holderstorage.registerHolder(shared_holder);
361 ATH_MSG_DEBUG("registerHolder for OK " << *holder);
362 return true;
363}

◆ 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< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ reset()

void NavigationCore::reset ( bool inFinalize = false)
virtualinherited

resets all the navigation, goes to the factory and asks to withdraw all produced objects

Reimplemented from HLT::TrigNavStructure.

Definition at line 281 of file NavigationCore.cxx.

281 {
282 TrigNavStructure::reset(inFinalize);
283
284 ATH_MSG_DEBUG("Navigation reset done");
285}
virtual void reset(bool inFinalize=false)
resets all the navigation, goes to the factory and asks to withdraw all produced objects

◆ serialize() [1/3]

bool NavigationCore::serialize ( std::vector< uint32_t > & output) const
virtualinherited

method serizlizes the navigation structure The structure is serrizlized in following order ...

  1. TEs(together with links)
  2. features in accordane to the lists given in property ClassesToPayload

The truncation mechainsm. The parameter space should be given to the method. No more space than that will be ever taken. But since the actuall space limitation is not known at the time whrn this call happens additional list of safe to cut places is returned. One may ask why no tonly this cuts. ... Answer is follwing. If the event is huge then giving this rought limit would make procedure faster since not all features will be serialized. Otherwice they would be serialized and then thrown away, which is waste of CPU. For safe operation one can easilly make space huge (like 2MB) and not care. But for online such tuning can be considered. Space can be given as a property.

Parameters
outputvector to place the result
cutsare indexes where one can safely cut the navigation
Returns
if true then OK if false then truncated because of missing space - if output.size() != 0 if false and output.size() == 0 internal error

Implements HLT::TrigNavStructure.

Definition at line 81 of file NavigationCore.cxx.

81 {
82 std::vector<unsigned int> cuts;
83 return serialize(output,cuts);
84}
virtual bool serialize(std::vector< uint32_t > &output) const
method serizlizes the navigation structure The structure is serrizlized in following order ....

◆ serialize() [2/3]

bool NavigationCore::serialize ( std::vector< uint32_t > & output,
std::vector< unsigned int > & cuts ) const
inherited

Definition at line 86 of file NavigationCore.cxx.

86 {
87 std::vector<std::pair<CLID, std::string> > clid_name;
88 clid_name.clear();
89 return serialize(output, cuts, clid_name);
90}

◆ serialize() [3/3]

bool NavigationCore::serialize ( std::vector< uint32_t > & output,
std::vector< unsigned int > & cuts,
std::vector< std::pair< CLID, std::string > > & clid_name ) const
inherited

Definition at line 92 of file NavigationCore.cxx.

92 {
93 std::vector<uint32_t> holderdata;
94 std::vector<unsigned int> holderblobsizes;
95
96 std::lock_guard<std::recursive_mutex> lock(getMutex());
97 const TrigHolderStructure& holderstorage = getHolderStorage();
98
99 bool status = false;
100 if ( m_classesToPayload.empty() ) { // this is offline case
101 status = serializeHoldersWithoutPayload(holderstorage.getAllHolders<IHolder>(),holderdata, holderblobsizes, clid_name);
102 } else { // this is online case when list of classes to payload is not empty
103 status = serializeHoldersWithPayload(m_classesToPayload,holderdata,holderblobsizes,clid_name);
104 }
105
106 if(!status){
107 ATH_MSG_WARNING("holder serialization failed");
108 return false;
109 }
110
111 status = serializeWithHolderSection(holderdata,holderblobsizes,output,cuts,clid_name);
112
113 if(!status){
114 ATH_MSG_WARNING("full serialization failed");
115 return false;
116 }
117
118 ATH_MSG_DEBUG("total size of serialized navigation: " << output.size());
119
120 return true;
121}
bool serializeHoldersWithPayload(const std::vector< CSPair > &payload, std::vector< uint32_t > &output, std::vector< uint32_t > &holderblobsizes, std::vector< std::pair< CLID, std::string > > &clid_name) const
bool serializeHoldersWithoutPayload(const std::vector< HLTNavDetails::IHolder * > &holders, std::vector< uint32_t > &output, std::vector< uint32_t > &holderblobsizes, std::vector< std::pair< CLID, std::string > > &clid_name) const
bool serializeWithHolderSection(const std::vector< uint32_t > &holderdata, const std::vector< unsigned int > &holderblobsizes, std::vector< uint32_t > &output, std::vector< unsigned int > &cuts, std::vector< std::pair< CLID, std::string > > &clid_name) const

◆ serialize_DSonly()

bool NavigationCore::serialize_DSonly ( std::vector< uint32_t > & output,
std::vector< unsigned int > & cuts,
std::vector< std::pair< CLID, std::string > > & clid_name ) const
inherited

Definition at line 123 of file NavigationCore.cxx.

123 {
124 std::vector<uint32_t> holderdata;
125 std::vector<unsigned int> holderblobsizes;
126
127 bool status = serializeHoldersWithPayload(m_classesToPayload_DSonly,holderdata,holderblobsizes,clid_name);
128 if(!status){
129 ATH_MSG_WARNING("holder serialization failed");
130 return false;
131 }
132
133 status = serializeWithHolderSection(holderdata,holderblobsizes,output,cuts,clid_name);
134 if(!status){
135 ATH_MSG_WARNING("full serialization failed");
136 return false;
137 }
138
139 ATH_MSG_DEBUG("total size of serialized navigation (DS only): " << output.size());
140
141 return true;
142}

◆ serializeHoldersWithoutPayload()

bool NavigationCore::serializeHoldersWithoutPayload ( const std::vector< HLTNavDetails::IHolder * > & holders,
std::vector< uint32_t > & output,
std::vector< uint32_t > & holderblobsizes,
std::vector< std::pair< CLID, std::string > > & clid_name ) const
privateinherited

Definition at line 502 of file NavigationCore.cxx.

502 {
503 for(auto& holder : holders){
504 ATH_MSG_DEBUG("serialization of feature: " << holder->typeClid() << " label: " << holder->label()
505 << " size of payload: " << output.size());
506
507 std::vector<uint32_t> holderblob;
508 bool status = holder->serialize(holderblob);
509 if(!status){
510 ATH_MSG_WARNING("problem serializing holder: " << *holder);
511 return false;
512 }
513 output.push_back(holderblob.size()); //leading bit indicates size
514 output.insert(output.end(),holderblob.begin(),holderblob.end());
515
516 holderblobsizes.push_back(1+holderblob.size()); //one for leading size bit
517 clid_name.push_back(std::pair < CLID, std::string> (holder->typeClid(), holder->label()));
518 }
519 return true;
520}

◆ serializeHoldersWithPayload()

bool NavigationCore::serializeHoldersWithPayload ( const std::vector< CSPair > & payload,
std::vector< uint32_t > & output,
std::vector< uint32_t > & holderblobsizes,
std::vector< std::pair< CLID, std::string > > & clid_name ) const
privateinherited

Definition at line 468 of file NavigationCore.cxx.

470 {
471
472 ATH_MSG_DEBUG("serialization: number of classes to payload: " << payload.size());
473 for ( auto& cl : payload) {
474 ATH_MSG_DEBUG("serialization (ordered) of featue attempting : " << cl.first << " " << cl.second);
475
476 IHolder *holder = getHolder(cl.first,cl.second);
477 if ( ! holder ) {
478 ATH_MSG_DEBUG("serialization (ordered) of feature skipped, nothing know on this objects" );
479 continue;
480 }
481 ATH_MSG_DEBUG("serialization (ordered) of feature: " << holder->typeClid() << " label: " << holder->label()
482 << " size of payload up to now: " << output.size());
483
484 std::vector<uint32_t> holderblob;
485 size_t payloadsize = 0;
486 bool status = holder->serializeWithPayload(cl.sel,holderblob,payloadsize);
487 if(!status){
488 ATH_MSG_WARNING("problem serializing holder: " << *holder);
489 return false;
490 }
491
492 output.push_back(holderblob.size()); //leading bit indicates size
493 output.insert(output.end(),holderblob.begin(),holderblob.end());
494
495 holderblobsizes.push_back(1+holderblob.size()); //one for leading size bit
496 clid_name.push_back(std::pair < CLID, std::string> (holder->typeClid(), holder->label()));
497 }
498
499 return true;
500}
bool serializeWithPayload(const xAOD::AuxSelection &sel, std::vector< uint32_t > &output, size_t &payloadsize)
serializes this Holder including payload
Definition Holder.cxx:79
virtual CLID typeClid() const =0
returns the CLID of objects stores by this holder

◆ serializeTEs()

bool TrigNavStructure::serializeTEs ( std::vector< uint32_t > & output) const
inherited

method serizlizes the navigation structure

Parameters
outputvector to place the result
Returns
if true then OK else some sort of failure happened (likely badly truncated structure)

Definition at line 217 of file TrigNavStructure.cxx.

217 {
218 std::lock_guard<std::recursive_mutex> lock(getMutex());
219 const TriggerElementFactory& factory = getFactory();
220
221 ::HLTNavDetails::FillSize fs(output);
222
223 const std::vector<TriggerElement*>& fullList = factory.listOfProduced();
224 std::vector<TriggerElement*> all;
225 all.reserve(fullList.size());
226
227 for(std::vector<TriggerElement*>::const_iterator iter = fullList.begin(); iter != fullList.end(); ++iter) {
228 if(! (*iter)->transient() ) {
229 all.push_back( *iter );
230 }
231 }
232
233 // reserve space (in order to be efficient it should not be resized any more, this can be studied probably later to find optimum)
234 output.reserve(10*all.size());
235
236 // SERIALZE NAVIGATION STRUCTURE
237 // size (measured in elements)
238 output.push_back(all.size());
239
240 // helper keys
241 std::map<TriggerElement*, uint16_t> keys;
242
243 const TriggerElement* previous = 0;
244 std::vector<TriggerElement*>::const_iterator it;
245 uint16_t indexForTe = 0;
246 for ( it = all.begin(); it != all.end(); ++it ) {
247 // first we stream pointer as it (this is already an unique key for this TE)
248 // output.push_back((unsigned int)(*it));
249 (*it)->serialize(output, keys, previous);
250 previous = *it;
251 keys[*it] = indexForTe;
252 indexForTe++;
253 }
254
255 return true;
256}
static Double_t fs

◆ serializeWithHolderSection()

bool NavigationCore::serializeWithHolderSection ( const std::vector< uint32_t > & holderdata,
const std::vector< unsigned int > & holderblobsizes,
std::vector< uint32_t > & output,
std::vector< unsigned int > & cuts,
std::vector< std::pair< CLID, std::string > > & clid_name ) const
privateinherited

Definition at line 436 of file NavigationCore.cxx.

437 {
438 cuts.clear();
439 // clid_name.clear(); Don't reset this vector here since the vector is not remade. Otherwise datascouting stops working.
440
441 unsigned int version=4;
442 ATH_MSG_DEBUG("NavigationCore::serialize: serializing with version " << version);
443
444 output.push_back(version);
445
446 unsigned int totalSizeIndex = output.size();
447 output.push_back(0); // reserve one word (accessible under the index totalSize), it is 0 if there was truncation here
448 // and != output.size() if truncation using cuts
449
450 cuts.push_back(output.size()); // mark a cut place
451
452 bool tesSerializationStatus = serializeTEs(output);
453
454 ATH_MSG_DEBUG("serializes: TE serialization status: " << tesSerializationStatus << " size: " << output.size());
455
456 cuts.push_back(output.size()); // mark a cut place
457
458 output.insert(output.end(),holderdata.begin(),holderdata.end());
459
460 for(auto hc : holderblobsizes){cuts.push_back(cuts.back()+hc);}
461
462 output[totalSizeIndex] = output.size();
463
464 ATH_MSG_DEBUG("serialization done");
465 return true;
466}
bool serializeTEs(std::vector< uint32_t > &output) const
method serizlizes the navigation structure

◆ string2hash()

uint32_t NavigationCore::string2hash ( const std::string & s,
const std::string & category = "TE" )
staticinherited

convert strin g to hash.

This is just making the function available, since there is no dict for TrigConf::HLTUtils

Definition at line 397 of file NavigationCore.cxx.

397 {
398 return TrigConf::HLTUtils::string2hash(s, category);
399}
static HLTHash string2hash(const std::string &, const std::string &category="TE")
hash function translating TE names into identifiers
const FeatureContainerInit< FEATURE, CONTAINER > RegisterFeatureContainerTypes< FEATURE, CONTAINER >::s

◆ subType()

sub_index_type TrigNavStructure::subType ( class_id_type clid,
const index_or_label_type & sti_or_label ) const
inherited

Definition at line 766 of file TrigNavStructure.cxx.

766 {
767 std::lock_guard<std::recursive_mutex> lock(getMutex());
768 const TrigHolderStructure& holderstorage = getHolderStorage();
769
770 return holderstorage.getSubTypeIndex(clid,sti_or_label);
771}
sub_index_type getSubTypeIndex(class_id_type clid, const index_or_label_type &stiOrLabel) const

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/2]

const TriggerElement* m_unspecifiedTE HLT::TrigNavStructure::ATLAS_THREAD_SAFE
staticprotectedinherited

Definition at line 377 of file TrigNavStructure.h.

◆ ATLAS_THREAD_SAFE [2/2]

std::string m_unspecifiedLabel HLT::TrigNavStructure::ATLAS_THREAD_SAFE
staticprotectedinherited

Definition at line 378 of file TrigNavStructure.h.

◆ m_classesFromPayloadIgnoreProperty

std::vector<std::string> HLT::NavigationCore::m_classesFromPayloadIgnoreProperty
protectedinherited

list of classes#keys to ignore on deserialization

Definition at line 394 of file NavigationCore.h.

◆ m_classesToPayload

std::vector<CSPair> HLT::NavigationCore::m_classesToPayload
protectedinherited

classess are put to payload according to that priority list (CLID + key)

Definition at line 389 of file NavigationCore.h.

◆ m_classesToPayload_DSonly

std::vector<CSPair> HLT::NavigationCore::m_classesToPayload_DSonly
protectedinherited

classess are put to payload according to that priority list (CLID + key)

Definition at line 392 of file NavigationCore.h.

◆ m_classesToPayloadProperty

std::vector<std::string> HLT::NavigationCore::m_classesToPayloadProperty
protectedinherited

list of classes#keys to be put to BS payload

Definition at line 388 of file NavigationCore.h.

◆ m_classesToPayloadProperty_DSonly

std::vector<std::string> HLT::NavigationCore::m_classesToPayloadProperty_DSonly
protectedinherited

list of classes#keys to be put to DS payload

Definition at line 391 of file NavigationCore.h.

◆ m_classesToPreregister

std::vector<CSPair> HLT::NavigationCore::m_classesToPreregister
protectedinherited

classes mentioned here will be put to SG irrespectively of thier presence in event

Definition at line 397 of file NavigationCore.h.

◆ m_classesToPreregisterProperty

std::vector<std::string> HLT::NavigationCore::m_classesToPreregisterProperty
protectedinherited

as above but for preregistration

Definition at line 396 of file NavigationCore.h.

◆ m_clidSvc

ServiceHandle<IClassIDSvc> HLT::Navigation::m_clidSvc
private

Definition at line 168 of file Navigation.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dlls

Gaudi::Property<std::vector<std::string> > HLT::Navigation::m_dlls {this, "Dlls", {}, "Libraries to load (with trigger EDM)", "OrderedSet<T>"}
private

Definition at line 169 of file Navigation.h.

169{this, "Dlls", {}, "Libraries to load (with trigger EDM)", "OrderedSet<T>"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_factory

SG::SlotSpecificObj<TriggerElementFactory> HLT::TrigNavStructure::m_factory
privateinherited

factory of trigger elements (one per processing slot)

Definition at line 382 of file TrigNavStructure.h.

◆ m_fullholderfactory

FullHolderFactory HLT::Navigation::m_fullholderfactory
private

Definition at line 170 of file Navigation.h.

◆ m_holderfactory

ITrigHolderFactory* HLT::NavigationCore::m_holderfactory
protectedinherited

Definition at line 375 of file NavigationCore.h.

◆ m_holderstorage

SG::SlotSpecificObj<TrigHolderStructure> HLT::TrigNavStructure::m_holderstorage
privateinherited

structure for feature holders (one per processing slot)

Definition at line 383 of file TrigNavStructure.h.

◆ m_logger

const AthAlgTool& HLT::NavigationCore::m_logger
privateinherited

Definition at line 406 of file NavigationCore.h.

◆ m_objectsIndexOffset

unsigned HLT::NavigationCore::m_objectsIndexOffset
protectedinherited

small integer used to generate sub type index

Definition at line 372 of file NavigationCore.h.

◆ m_objectsKeyPrefix

std::string HLT::NavigationCore::m_objectsKeyPrefix
protectedinherited

property setting prefix which is to be given to all trigger EDM objects

Definition at line 371 of file NavigationCore.h.

◆ m_readonly

bool HLT::Navigation::m_readonly
private

Definition at line 171 of file Navigation.h.

◆ m_serializerServiceHandle

ServiceHandle<IConversionSvc> HLT::Navigation::m_serializerServiceHandle
private

Definition at line 167 of file Navigation.h.

◆ m_serializerSvc

IConversionSvc* HLT::NavigationCore::m_serializerSvc
protectedinherited

Definition at line 369 of file NavigationCore.h.

◆ m_storeGate

StoreGateSvc* HLT::NavigationCore::m_storeGate
protectedinherited

Definition at line 370 of file NavigationCore.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ s_rmutex

std::recursive_mutex TrigNavStructure::s_rmutex
staticprivateinherited

Definition at line 385 of file TrigNavStructure.h.


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