HLT::TrigNavStructure Class Reference

Inheritance diagram for HLT::TrigNavStructure:
HLT::StandaloneNavigation

List of all members.

Public Member Functions

virtual void reset ()
 resets all the navigation, goes to the factory and asks to withdraw all produced objects
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)
virtual bool serialize (std::vector< uint32_t > &) const =0
 method serizlizes entire navigation
virtual bool deserialize (const std::vector< uint32_t > &)=0
TriggerElement::FeatureAccessHelper getFeature (const TriggerElement *te, class_id_type clid, const index_or_label_type &index_or_label) const
 typeless feature access metod
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. It stops on RoI nodes.
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.
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.
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. The deactivated lines must be propagated ahead.
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< 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
const BaseHoldergetHolder (const TriggerElement::FeatureAccessHelper &fea) const
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
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 with_cache_recording, bool travel_backward_recursively, const TriggerElement *&source=m_unspecifiedTE, std::string &sourcelabel=m_unspecifiedLabel) const

Static Public Member Functions

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)
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)
static bool isNotActive (const TriggerElement *te)
static bool isTopological (const TriggerElement *te)
static bool isCompatibleTree (const TriggerElement *te1, const TriggerElement *te2)
 check compatibility of 2 navigation structures

Protected Member Functions

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, bool with_cache_recording, const TriggerElement *&source, std::string &sourcelabel) 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)
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.

Protected Attributes

TriggerElementFactory m_factory
 factory of trigger elements
TrigHolderStructure m_holderstorage
 structure for feature holders

Static Protected Attributes

static const TriggerElementm_unspecifiedTE = 0
static std::string m_unspecifiedLabel = ""

Member Function Documentation

TriggerElement * TrigNavStructure::addNode ( 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

Parameters:
seeds are all TriggerElements which seed newly created
id the id to give for the created TriggerElement
ghost flag is saying that this TE is a light weight one, no features attaching to it is allowed
nofwd flag is saying that this TE will not be deactivated automatically in fwd deactivation process(rerunning)
TriggerElement * TrigNavStructure::addNode ( TriggerElement seed,
unsigned int  id 
)

adds nodes seeded form the one given as an argument,

Parameters:
seed a TriggerElement which direct predecessor of newly created
id an id to give newly created TriggerElement
bool TrigNavStructure::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).

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.

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

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
void TrigNavStructure::fillSameRoIRelation ( TriggerElement roi,
TriggerElement te 
) [protected]

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

Warning:
should be called for each RoI like node
void TrigNavStructure::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.

Parameters:
id name of TE, if "" given all TEs are returned
const std::vector< TriggerElement * > & TrigNavStructure::getDirectPredecessors ( const TriggerElement te  )  [static]

returns list of direct predecessors (nodes seeding me)

Parameters:
te TriggerElement to query
Returns:
collection of TriggerElements (if empty then node is initial)
const std::vector< TriggerElement * > & TrigNavStructure::getDirectSuccessors ( const TriggerElement te  )  [static]

returns list of direct predecessors (nodes I seed)

Parameters:
te TriggerElement to query
Returns:
collection of TriggerElements (if empty then node is terminal)
TriggerElement::FeatureAccessHelper TrigNavStructure::getFeature ( const TriggerElement te,
class_id_type  clid,
const index_or_label_type &  index_or_label 
) const

typeless feature access metod

Parameters:
te the TE from which the search should be done
clid the class ID of searched type
sub feature 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
TriggerElement::FeatureAccessHelper TrigNavStructure::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. It stops on RoI nodes.

Parameters:
sourceTE is the TE where the feature was found
const std::vector< TriggerElement * > & TrigNavStructure::getRoINodes ( const TriggerElement somenode  )  [static]

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
const TriggerElement * TrigNavStructure::getSuccessor ( const TriggerElement te,
unsigned int  id 
) [static]

returns successor of given type beeing seeded from this TE

Parameters:
te TriggerElement to query
id the id of the successor TreiggerElement to find
Returns:
TriggerElement pointer which can be 0
Warning:
the implementation is recursive
bool TrigNavStructure::getTopologicallySpannedBy ( const TriggerElement te,
const std::vector< unsigned int > &  types,
std::vector< TriggerElement * > &  children,
const bool  activeOnly = true 
) const

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

Parameters:
te topological TE from which to start
types vector of types to search for
childs vector of retrieved TEs; empty in case some of the required TEs cannot be found or are not active (see the activeOnly parameter)
activeOnly optional parameter specifying whether inactive TEs should be discarded from the search; true by default
bool TrigNavStructure::hasIdFromTheSet ( const TriggerElement te,
std::vector< unsigned int >  ids 
) [static]

simple helper

bool TrigNavStructure::haveCommonRoI ( const TriggerElement te1,
const TriggerElement te2 
) [static]

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
bool TrigNavStructure::haveCommonSeed ( const TriggerElement te1,
const TriggerElement te2 
) [static]

checks that there is any common predecessor of two TriggerElements

Warning:
See comments on haveCommonRoI. The same applies.
bool TrigNavStructure::haveDistinctRoI ( const TriggerElement te1,
const TriggerElement te2 
) [static]

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.

bool TrigNavStructure::haveDistinctSeed ( const TriggerElement te1,
const TriggerElement te2 
) [static]

inversion of haveCommonSeed

bool TrigNavStructure::increasingOrderByTEId ( const TriggerElement te1,
const TriggerElement te2 
) [static]

for sorting TriggerElements according to their id

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

bool TrigNavStructure::isCompatibleTree ( const TriggerElement te1,
const TriggerElement te2 
) [static]

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)

bool TrigNavStructure::isInitialNode ( const TriggerElement te  )  [static]

queries if node is an initial one

Parameters:
te node to be queried
Returns:
true if passed node is initial
static bool HLT::TrigNavStructure::isNotActive ( const TriggerElement te  )  [inline, static]

helper for the STL

bool TrigNavStructure::isRoINode ( const TriggerElement te  )  [static]

queries if node is an RoI type one

Parameters:
te node to be queried
Returns:
true if passed node is RoI type
bool TrigNavStructure::isTerminalNode ( const TriggerElement te  )  [static]

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

Parameters:
te node to be queried
Returns:
true if passed node is terminal
bool TrigNavStructure::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. The deactivated lines must be propagated ahead.

Parameters:
nav is 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
virtual bool HLT::TrigNavStructure::serialize ( std::vector< uint32_t > &   )  const [pure virtual]

method serizlizes entire navigation

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

Implemented in HLT::StandaloneNavigation.

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

method serizlizes the navigation structure

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

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 15 Apr 2017 for RootCore Packages by  doxygen 1.6.1