|
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 bool enforceDecisionOnStartNode =
true);
371 std::set<const Decision*>& fullyExploredFrom,
373 const bool enforceDecisionOnNode);
384 const bool keepOnlyFinalFeatures,
385 const bool removeEmptySteps,
386 const std::vector<std::string>& nodesToDrop);
396 std::set<NavGraphNode*>& fullyExploredFrom,
397 const bool keepOnlyFinalFeatures,
398 const bool removeEmptySteps,
399 const std::vector<std::string>& nodesToDrop);
428 template<
class CONTAINER>
439 template<
class CONTAINER>
442 const std::string& containerSGKey =
"",
443 const bool lastFeatureOfType =
true,
454 template<
class CONTAINER>
457 std::set<const NavGraphNode*>& fullyExploredFrom,
459 const std::string& containerSGKey,
460 const bool lastFeatureOfType,
461 const std::string& navElementLinkKey,
475 const std::string& linkName,
476 const bool suppressMultipleLinksWarning =
false);
492 const std::string& linkName,
494 unsigned int behaviour = TrigDefs::allFeaturesOfType,
495 std::set<const xAOD::TrigComposite*>* fullyExploredFrom =
nullptr);
508 std::vector<LinkInfo<T>>
510 const std::string& linkName,
511 unsigned int behaviour = TrigDefs::allFeaturesOfType);
527 const std::string& linkName,
532 const bool suppressMultipleLinksWarning =
false);
539 const std::string& linkName,
544 const bool suppressMultipleLinksWarning =
false);
562 const std::string& linkName,
563 std::vector<sgkey_t>& keyVec,
564 std::vector<uint32_t>& clidVec,
565 std::vector<Decision::index_type>& indexVec,
566 std::vector<const Decision*>& sourceVec,
567 const unsigned int behaviour = TrigDefs::allFeaturesOfType,
568 std::set<const Decision*>* fullyExploredFrom =
nullptr);
574 const std::string& linkName,
575 std::vector<sgkey_t>&
key,
576 std::vector<uint32_t>& clid,
577 std::vector<Decision::index_type>&
index,
578 std::vector<const Decision*>& sourceVec,
579 const unsigned int behaviour = TrigDefs::allFeaturesOfType,
580 std::set<const Decision*>* fullyExploredFrom =
nullptr);
587 const std::string& linkName,
588 std::vector<sgkey_t>& keyVec,
589 std::vector<uint32_t>& clidVec,
590 std::vector<Decision::index_type>& indexVec,
591 std::vector<const Decision*>& sourceVec);
609 const std::vector<std::size_t>& legMultiplicities,
628 const std::vector<std::size_t>& legMultiplicities,
677 std::string
dump(
const Decision* tc,
const std::function< std::string(
const Decision* )>& printerFnc );
683 #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()
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
void recursiveGetDecisions(const Decision *start, NavGraph &navGraph, 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 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()
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
bool typelessFindLinksCommonLinkCollection(const Decision *start, const std::string &linkName, std::vector< sgkey_t > &keyVec, std::vector< uint32_t > &clidVec, std::vector< Decision::index_type > &indexVec, std::vector< const Decision * > &sourceVec)
Common functionality shared by both typelessFindLinks interfaces Returns true if at least one link wa...
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 ...
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'
bool typelessFindLinks(const Decision *start, const std::string &linkName, std::vector< sgkey_t > &keyVec, std::vector< uint32_t > &clidVec, std::vector< Decision::index_type > &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...
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()
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()
void recursiveGetDecisionsInternal(const Decision *node, const Decision *comingFrom, NavGraph &navGraph, std::set< const Decision * > &fullyExploredFrom, const DecisionIDContainer &ids, const bool enforceDecisionOnNode)
Used by recursiveGetDecisions.
bool typelessFindLink(const Decision *start, const std::string &linkName, sgkey_t &key, uint32_t &clid, Decision::index_type &index, const Decision *&source, const bool suppressMultipleLinksWarning)
Perform a recursive search for ElementLinks of any time and name 'linkName', starting from Decision o...