![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef TrigCompositeUtils_TrigCompositeUtils_h
6 #define TrigCompositeUtils_TrigCompositeUtils_h
13 #include "AthLinks/ElementLink.h"
24 #ifdef XAOD_STANDALONE
42 #define TRIGCOMPUTILS_ENABLE_EARLY_EXIT 1
283 bool operator()(
const Decision* )
const;
342 const std::string& summaryCollectionKey,
344 const std::set<std::string>& keysToIgnore = std::set<std::string>());
359 const EventContext& ctx,
361 const bool enforceDecisionOnStartNode =
true);
373 const EventContext& ctx,
374 std::set<const Decision*>& fullyExploredFrom,
376 const bool enforceDecisionOnNode);
387 const bool keepOnlyFinalFeatures,
388 const bool removeEmptySteps,
389 const std::vector<std::string>& nodesToDrop);
399 std::set<NavGraphNode*>& fullyExploredFrom,
400 const bool keepOnlyFinalFeatures,
401 const bool removeEmptySteps,
402 const std::vector<std::string>& nodesToDrop);
431 template<
class CONTAINER>
442 template<
class CONTAINER>
445 const std::string& containerSGKey =
"",
446 const bool lastFeatureOfType =
true,
457 template<
class CONTAINER>
460 std::set<const NavGraphNode*>& fullyExploredFrom,
462 const std::string& containerSGKey,
463 const bool lastFeatureOfType,
464 const std::string& navElementLinkKey,
478 const std::string& linkName,
479 const bool suppressMultipleLinksWarning =
false);
495 const std::string& linkName,
497 unsigned int behaviour = TrigDefs::allFeaturesOfType,
498 std::set<const xAOD::TrigComposite*>* fullyExploredFrom =
nullptr);
511 std::vector<LinkInfo<T>>
513 const std::string& linkName,
514 unsigned int behaviour = TrigDefs::allFeaturesOfType);
530 const std::string& linkName,
535 const bool suppressMultipleLinksWarning =
false);
542 const std::string& linkName,
547 const bool suppressMultipleLinksWarning =
false);
565 const std::string& linkName,
566 std::vector<sgkey_t>& keyVec,
567 std::vector<uint32_t>& clidVec,
568 std::vector<uint16_t>& indexVec,
569 std::vector<const Decision*>& sourceVec,
570 const unsigned int behaviour = TrigDefs::allFeaturesOfType,
571 std::set<const Decision*>* fullyExploredFrom =
nullptr);
577 const std::string& linkName,
578 std::vector<sgkey_t>&
key,
579 std::vector<uint32_t>& clid,
580 std::vector<uint16_t>&
index,
581 std::vector<const Decision*>& sourceVec,
582 const unsigned int behaviour = TrigDefs::allFeaturesOfType,
583 std::set<const Decision*>* fullyExploredFrom =
nullptr);
590 const std::string& linkName,
591 std::vector<sgkey_t>& keyVec,
592 std::vector<uint32_t>& clidVec,
593 std::vector<uint16_t>& indexVec,
594 std::vector<const Decision*>& sourceVec);
612 const std::vector<std::size_t>& legMultiplicities,
631 const std::vector<std::size_t>& legMultiplicities,
680 std::string
dump(
const Decision* tc,
const std::function< std::string(
const Decision* )>& printerFnc );
686 #endif // TrigCompositeUtils_TrigCompositeUtils_h
const std::string & summaryPrescaledNodeName()
Combinations buildCombinations(const std::string &chainName, const std::vector< LinkInfo< xAOD::IParticleContainer >> &features, const std::vector< std::size_t > &legMultiplicities, const std::function< bool(const std::vector< LinkInfo< xAOD::IParticleContainer >> &)> &filter)
Produce the combinations for a set of features.
const std::string & summaryFilterNodeName()
void recursiveGetDecisionsInternal(const Decision *node, const Decision *comingFrom, NavGraph &navGraph, const EventContext &ctx, std::set< const Decision * > &fullyExploredFrom, const DecisionIDContainer &ids, const bool enforceDecisionOnNode)
Used by recursiveGetDecisions.
const Decision * find(const Decision *start, const std::function< bool(const Decision *)> &filter)
traverses Decision object links for another Decision object fulfilling the prerequisite specified by ...
Prerequisite object usable with.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
bool typelessFindLink(const Decision *start, const std::string &linkName, sgkey_t &key, uint32_t &clid, uint16_t &index, const Decision *&source, const bool suppressMultipleLinksWarning)
Perform a recursive search for ElementLinks of any time and name 'linkName', starting from Decision o...
const std::string & summaryPassExpressNodeName()
const std::vector< LinkInfo< CONTAINER > > recursiveGetFeaturesOfType(const NavGraph &navGraph, const std::string &containerSGKey="", const bool lastFeatureOfType=true, const std::string &navElementLinkKey=featureString(), const DecisionIDContainer &chainIDs=DecisionIDContainer())
Extract features from the supplied linkVector (obtained through recursiveGetDecisions).
const std::string & hltSeedingNodeName()
bool operator()(const Decision *) const
checks if the arg Decision object has link collection of name specified at construction
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name)
Helper method to create a Decision object, place it in the container and return a pointer to it.
@ UniqueObjects
Do not allow any repeated objects.
const std::string & hypoAlgNodeName()
bool typelessFindLinksCommonLinkCollection(const Decision *start, const std::string &linkName, std::vector< sgkey_t > &keyVec, std::vector< uint32_t > &clidVec, std::vector< uint16_t > &indexVec, std::vector< const Decision * > &sourceVec)
Common functionality shared by both typelessFindLinks interfaces Returns true if at least one link wa...
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
HasObject(const std::string &name)
constructor specifying the link name
void insertDecisionIDs(const Decision *src, Decision *dest)
Appends the decision IDs of src to the dest decision object.
DecisionIDContainer passedDecisionIDs(const Decision *d, const T &required)
return DecisionIDs in Decision object that match the required ones
void findLinks(const Decision *start, const std::string &linkName, std::vector< LinkInfo< T >> &links, unsigned int behaviour=TrigDefs::allFeaturesOfType, std::set< const xAOD::TrigComposite * > *fullyExploredFrom=nullptr)
search back the TC links for the object of type T linked to the one of TC (recursively) Populates pro...
const std::string & comboHypoAlgNodeName()
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
const std::string & initialRecRoIString()
void recursiveFlagForThinningInternal(NavGraphNode *node, bool modeKeep, std::set< NavGraphNode * > &fullyExploredFrom, const bool keepOnlyFinalFeatures, const bool removeEmptySteps, const std::vector< std::string > &nodesToDrop)
Used by recursiveFlagForThinning.
bool const RAWDATA *ch2 const
HLT chain configuration information.
void filterLinkVectorByContainerKey(const std::string &containerSGKey, std::vector< ElementLink< CONTAINER >> &vector)
Removes ElementLinks from the supplied vector if they do not come from the specified collection (sub-...
const Decision * getTerminusNode(SG::ReadHandle< DecisionContainer > &container)
Prerequisite object usable with.
The Athena Transient Store API.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
bool typelessFindLinks(const Decision *start, const std::string &linkName, std::vector< sgkey_t > &keyVec, std::vector< uint32_t > &clidVec, std::vector< uint16_t > &indexVec, std::vector< const Decision * > &sourceVec, const unsigned int behaviour, std::set< const Decision * > *fullyExploredFrom)
search back the TC links for the object of type T linked to the one of TC (recursively) Returns the l...
std::vector< const Decision * > getRejectedDecisionNodes(const asg::EventStoreType *eventStore, const std::string &summaryCollectionKey, const DecisionIDContainer &ids, const std::set< std::string > &keysToIgnore)
Query all DecisionCollections in the event store, locate all Decision nodes in the graph where an obj...
const std::string & initialRoIString()
const std::vector< ElementLink< DecisionContainer > > getLinkToPrevious(const Decision *d)
returns links to previous decision object 'seed'
const Decision * getExpressTerminusNode(const DecisionContainer &container)
Returns the express-accept navigation node from a collection or nullptr if missing.
bool copyLinks(const Decision *src, Decision *dest)
copy all links from src to dest TC objects
ElementLink< DecisionContainer > decisionToElementLink(const Decision *d, const EventContext &ctx)
Takes a raw pointer to a Decision and returns an ElementLink to the Decision.
Structure to hold a transient Directed Acyclic Graph (DAG) structure. NavGraph is populated from,...
SG::WriteHandle< CONT > createAndStoreNoAux(const SG::WriteHandleKey< CONT > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Creates and right away records the Container CONT with the key.
Class used to describe composite objects in the HLT.
ElementLink implementation for ROOT usage.
const std::string & featureString()
bool isChainId(const HLT::Identifier &chainIdentifier)
Recognise whether the HLT identifier corresponds to a whole chain.
xAOD::TrigComposite Decision
const std::string & summaryPassNodeName()
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
HLT::Identifier createLegName(const HLT::Identifier &chainIdentifier, size_t counter)
Generate the HLT::Identifier which corresponds to a specific leg of a given chain.
HasObjectCollection(const std::string &name)
constructor specifying the link name
bool hasLinkToPrevious(const Decision *d)
checks if there is at least one 'seed' link to previous object
const std::string & filterNodeName()
void linkToPrevious(Decision *d, const std::string &previousCollectionKey, size_t previousIndex)
Links to the previous object, location of previous 'seed' decision supplied by hand.
const std::string & seedString()
bool isLegId(const HLT::Identifier &legIdentifier)
Recognise whether the chain ID is a leg ID.
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
Define the type used for hashed StoreGate key+CLID pairs.
int32_t getIndexFromLeg(const HLT::Identifier &legIdentifier)
Extract the numeric index of a leg identifier.
std::set< DecisionID > DecisionIDContainer
Transient utility class to represent a node in a graph (m_decisionObject), and a vector of edges (m_f...
LinkInfo< T > findLink(const Decision *start, const std::string &linkName, const bool suppressMultipleLinksWarning=false)
Perform a recursive search for ElementLinks of type T and name 'linkName', starting from Decision obj...
bool allFailed(const Decision *d)
return true if there is no positive decision stored
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
void recursiveGetFeaturesOfTypeInternal(std::vector< LinkInfo< CONTAINER > > &features, std::set< const NavGraphNode * > &fullyExploredFrom, const NavGraphNode *navGraphNode, const std::string &containerSGKey, const bool lastFeatureOfType, const std::string &navElementLinkKey, const DecisionIDContainer &chainIDs)
Internal implimentation called by recursiveGetFeaturesOfType, and by itself.
void recursiveFlagForThinning(NavGraph &graph, const bool keepOnlyFinalFeatures, const bool removeEmptySteps, const std::vector< std::string > &nodesToDrop)
Used by trigger navigation thinning.
=============================================================================
std::string dump(const Decision *tc, const std::function< std::string(const Decision *)> &printerFnc)
Prints the Decision object including the linked seeds @warnign expensive call.
const std::string & roiString()
void recursiveGetDecisions(const Decision *start, NavGraph &navGraph, const EventContext &ctx, const DecisionIDContainer &ids, const bool enforceDecisionOnStartNode)
Search back in time from "node" and locate all paths back through Decision objects for a given chain.
const Decision * getNodeByName(const DecisionContainer &container, const std::string &nodeName)
Returns the navigation node with a given name from a collection or nullptr if missing.
SG::WriteHandle< CONT > createAndStoreWithAux(const SG::WriteHandleKey< CONT > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Creates and right away records the Container CONT with the key.
HLT::Identifier getIDFromLeg(const HLT::Identifier &legIdentifier)
Generate the HLT::Identifier which corresponds to the chain name from the leg name.
void uniqueDecisionIDs(Decision *dest)
Make unique list of decision IDs of dest Decision object.
bool isAnyIDPassing(const Decision *d, const DecisionIDContainer &required)
Checks if any of the DecisionIDs passed in arg required is availble in Decision object.
const std::string & viewString()
Base class for elements of a container that can have aux data.
const std::string & inputMakerNodeName()