8#ifndef TRIGNAVSTRUCTURE_TRIGNAVSTRUCTURE_H
9#define TRIGNAVSTRUCTURE_TRIGNAVSTRUCTURE_H
48 virtual void reset(
bool inFinalize =
false);
85 TriggerElement*
addNode( std::vector<TriggerElement* >& seeds,
unsigned int id,
bool ghost=
false,
bool nofwd=
false );
144 bool serializeTEs( std::vector<uint32_t>& output )
const;
154 virtual bool serialize( std::vector<uint32_t>&)
const = 0;
185 void getAll( std::vector< TriggerElement* >& output,
const bool activeOnly =
true )
const;
190 std::vector<TriggerElement*>&
getAllTEs();
195 const std::vector<TriggerElement*>&
getAllTEs()
const;
201 void getAllOfType(
const te_id_type id, std::vector< TriggerElement* >& output,
const bool activeOnly =
true )
const;
293 std::vector< std::vector<TriggerElement*> >& output,
294 unsigned int maxResults = 1000,
bool onlyActive =
true);
315 std::vector<const TriggerElement*>& children,
const bool activeOnly =
true )
const;
334 bool only_single_feature,
336 bool travel_backward_recursively,
338 std::string& sourcelabel = m_unspecifiedLabel)
const;
343 bool only_single_feature,
346 std::string& sourcelabel )
const ;
361 bool addOneLevel(std::vector< std::vector<TriggerElement*> >& currentCombs,
362 std::vector< std::vector<std::pair<unsigned int, unsigned int> > >& currentIdxs,
364 std::vector< std::vector<TriggerElement*> >& newCombs,
365 std::vector< std::vector<std::pair<unsigned int, unsigned int> > >& newIdxs,
366 unsigned int maxResults = 1000,
bool onlyActive = 1);
static unsigned int totalSize(const MultiDimArray< T, N > &ht)
static const std::vector< std::string > types
Define macros for attributes used to control the static checker.
static bool haveCommonSeed(const TriggerElement *te1, const TriggerElement *te2)
checks that there is any common predecessor of two TriggerElements
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 overlaps(const TriggerElement *t1, const TriggerElement *t2) const
Check overlap between trigger elements (pointer equality or RoI overlap)
static bool isCompatibleTree(const TriggerElement *te1, const TriggerElement *te2)
check compatibility of 2 navigation structures
std::recursive_mutex & getMutex() const
static bool haveDistinctRoI(const TriggerElement *te1, const TriggerElement *te2)
inversion of haveCommonRoI
static bool haveAllCommonRoIs(const HLT::TriggerElement *te1, const HLT::TriggerElement *te2)
bool matchFeature(const TriggerElement::FeatureAccessHelper &fea, class_id_type clid, const index_or_label_type &index_or_label) const
void getAllRoIThresholdTEs(std::vector< TriggerElement * > &output) const
The query returns a vector of all TriggerElements that represent a LVL1 RoI threshold.
SG::SlotSpecificObj< TriggerElementFactory > m_factory
factory of trigger elements (one per processing slot)
static bool isInitialNode(const TriggerElement *te)
queries if node is an initial one
virtual void reset(bool inFinalize=false)
resets all the navigation, goes to the factory and asks to withdraw all produced objects
void printASCIIArt(std::string &str, const TriggerElement *te=0, int offset=0) const
pretty printing of the navigational structure (heavy)
static std::recursive_mutex s_rmutex
TriggerElement::FeatureAccessHelper getFeature(const TriggerElement *te, class_id_type clid, const index_or_label_type &index_or_label) const
typeless feature access metod
bool addOneLevel(std::vector< std::vector< TriggerElement * > > ¤tCombs, std::vector< std::vector< std::pair< unsigned int, unsigned int > > > ¤tIdxs, 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.
bool propagateDeactivation(const TrigNavStructure *nav)
propagates deactivation of TE state This finction should be used after Trigger is rerurn on L2 and th...
sub_index_type subType(class_id_type clid, const index_or_label_type &sti_or_label) const
virtual bool deserialize(const std::vector< uint32_t > &)=0
virtual bool serialize(std::vector< uint32_t > &) const =0
method serizlizes entire navigation
static const TriggerElement * getSuccessor(const TriggerElement *te, unsigned int id)
returns successor of given type beeing seeded from this TE
const BaseHolder * getHolder(const TriggerElement::FeatureAccessHelper &fea) const
bool serializeTEs(std::vector< uint32_t > &output) const
method serizlizes the navigation structure
std::vector< TriggerElement * > & getAllTEs()
access needed by slimming tools.
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.
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
TriggerElement * addNode(TriggerElement *seed, unsigned int id)
adds nodes seeded form the one given as an argument,
static bool haveCommonRoI(const TriggerElement *te1, const TriggerElement *te2)
does this 2 share RoI
TriggerElement * addRoINode(TriggerElement *initial)
gets RoI node (attached to initial)
void fillSameRoIRelation(TriggerElement *roi, TriggerElement *te)
rebuilds the sameRoIRelation between trigger elements (used internally by deserialize)
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
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)
static bool hasIdFromTheSet(const TriggerElement *te, std::vector< unsigned int > ids)
simple helper
virtual ~TrigNavStructure()
SG::SlotSpecificObj< TrigHolderStructure > m_holderstorage
structure for feature holders (one per processing slot)
unsigned int copyAllFeatures(const TriggerElement *sourceTE, TriggerElement *destTE)
gets all features from the sourceTE and copies a reference (FeatureAccessHelper) to the destTE
bool deserializeTEs(std::vector< uint32_t >::const_iterator &start, unsigned int totalSize)
static bool isNotActive(const TriggerElement *te)
helper for the STL
static bool decreasingOrderByTEId(const TriggerElement *te1, const TriggerElement *te2)
void getAll(std::vector< TriggerElement * > &output, const bool activeOnly=true) const
The query returning a collection of all TriggerElements.
static const TriggerElement *m_unspecifiedTE ATLAS_THREAD_SAFE
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
TriggerElement * getInitialNode()
gets initial node, if node is not there then it is created on fly
TriggerElementFactory & getFactory()
static bool increasingOrderByTEId(const TriggerElement *te1, const TriggerElement *te2)
for sorting TriggerElements according to their id
static const std::vector< TriggerElement * > & getRoINodes(const TriggerElement *somenode)
gets all RoI type nodes seeding indirectly this TriggerElement
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 ...
const TriggerElementFactory & getFactory() const
static const std::vector< TriggerElement * > & getDirectPredecessors(const TriggerElement *te)
returns list of direct predecessors (nodes seeding me)
static bool haveDistinctSeed(const TriggerElement *te1, const TriggerElement *te2)
inversion of haveCommonSeed
static bool isTerminalNode(const TriggerElement *te)
queries if node is terminal (no more TriggerElement are seeded by it)
static const std::vector< TriggerElement * > & getDirectSuccessors(const TriggerElement *te)
returns list of direct predecessors (nodes I seed)
std::recursive_mutex & getMutex()
const TrigHolderStructure & getHolderStorage() const
static bool isRoINode(const TriggerElement *te)
queries if node is an RoI type one
TrigHolderStructure & getHolderStorage()
static bool isTopological(const TriggerElement *te)
std::string label(class_id_type clid, const index_or_label_type &sti_or_label) const
The factory of TriggerElements Creation in controlled way.
the FeatureAccessHelper is a class used to keep track of features attached to this TE.
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
bool getActiveState() const
get state of the TriggerElement
std::vector< FeatureAccessHelper > FeatureVec
Maintain a set of objects, one per slot.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
std::variant< sub_index_type, std::string > index_or_label_type
FillSize(std::vector< uint32_t > &o)
std::vector< uint32_t > & m_output