|
ATLAS Offline Software
|
Go to the documentation of this file.
24 const std::string& edgeName)
const
29 return StatusCode::SUCCESS;
36 ATH_MSG_DEBUG(
"Unable to repack '" << edgeName <<
"' of container type xAOD::IParticleContainer for '"
37 << decision->
name() <<
"' node, the link is invalid.");
39 return StatusCode::SUCCESS;
53 <<
", to index:" << remappedEL.
index() <<
" to key:" << remappedEL.
dataID());
55 return StatusCode::SUCCESS;
67 return StatusCode::SUCCESS;
88 ATH_MSG_WARNING(
"Possible miss-configuration. Cannot repack ROIs in the navigation slimming if they are being dropped");
104 msg() << MSG::INFO <<
"Initialized. Will *not* inspect the following SG Keys: ";
109 return StatusCode::SUCCESS;
142 ATH_MSG_ERROR(
"Unable to locate the HLTPassRaw from the primary input navigation collection, size:" << primaryInputHandle->
size());
143 return StatusCode::FAILURE;
156 ATH_MSG_DEBUG(
"Supplied " <<
m_chainsFilter.size() <<
" chain patterns. This converts to " << chainIDs.size() <<
" DecisionIDs to be preserved.");
158 if (chainIDs.size() == 0) {
159 ATH_MSG_DEBUG(
"chainIDs size is zero. No HLT-chain based filtering of the navigation graph will be performed.");
162 std::set<const Decision*> fullyExploredFrom;
172 ATH_MSG_DEBUG(
"Collated nodes from passing paths, now have " << transientNavGraph.
nodes() <<
" nodes with " << transientNavGraph.
edges() <<
" edges");
183 for (
const Decision* rejectedNode : rejectedNodes) {
194 ATH_MSG_DEBUG(
"Collated nodes from failing paths, now have " << transientNavGraph.
nodes() <<
" nodes with " << transientNavGraph.
edges() <<
" edges");
209 const size_t nodesBefore = transientNavGraph.
nodes();
210 const size_t edgesBefore = transientNavGraph.
edges();
211 std::vector<const Decision*> thinnedInputNodes = transientNavGraph.
thin();
216 ATH_MSG_DEBUG(
"Trigger navigation graph thinning going from " << nodesBefore <<
" nodes with " << edgesBefore <<
" edges, to "
217 << transientNavGraph.
nodes() <<
" nodes with " << transientNavGraph.
edges() <<
" edges");
220 ATH_MSG_VERBOSE(
"The navigation graph has been slimmed to the following paths:");
228 Decision* terminusNodeOut =
nullptr;
230 if (expressTerminusNode) {
232 Decision* expressTerminusNodeOut =
nullptr;
237 const std::vector<NavGraphNode*> allNodes = transientNavGraph.
allNodes();
251 ATH_MSG_VERBOSE(
"The output navigation graph looks like this (output terminus node search only, converted back into a NavGraph one final time for printing)");
252 std::set<const Decision*> fullyExploredFromOut;
256 transientNavGraphOut,
257 fullyExploredFromOut,
272 return StatusCode::SUCCESS;
276 if (
chain ==
"HLT_id_cosmicid_L1MU11_EMPTY")
return std::vector<size_t>(1,1);
277 return std::vector<size_t>();
288 chainIDs.insert( chainID.
numeric() );
290 ATH_MSG_VERBOSE(
"Including " <<
chain <<
" and its " << legMultiplicites.size() <<
" legs in the trigger slimming output");
291 if (legMultiplicites.size() == 0) {
293 if (legMultiplicites.size() == 0) {
294 ATH_MSG_ERROR(
"chain " << chainID <<
" has invalid configuration, no multiplicity data.");
295 return StatusCode::FAILURE;
298 if (legMultiplicites.size() > 1) {
301 for (
size_t legNumeral = 0; legNumeral < legMultiplicites.size(); ++legNumeral) {
303 chainIDs.insert( legID.
numeric() );
308 return StatusCode::SUCCESS;
318 const EventContext& ctx)
const
320 IOCacheMap::const_iterator
it = cache.find(
input);
321 if (
it != cache.end()) {
330 return StatusCode::SUCCESS;
337 const EventContext& ctx)
const
342 IOCacheMap::const_iterator
it = cache.find(inputDecision);
344 outputDecision =
it->second;
347 const Decision* inputSeedDecision = seed->node();
348 const Decision* outputSeedDecision =
nullptr;
350 IOCacheMap::const_iterator
it = cache.find(inputSeedDecision);
352 outputSeedDecision =
it->second;
361 const size_t sensibleUpperBoundOnNLinks = 100;
362 const size_t maxUpperBoundOnNLinks = 500;
364 const bool bad_in = inputNode->
children().size() > sensibleUpperBoundOnNLinks;
366 const bool bad_out = outputDecision->
linkColNames().size() > sensibleUpperBoundOnNLinks;
367 const bool vbad = inputNode->
children().size() > maxUpperBoundOnNLinks or outputDecision->
linkColNames().size() > maxUpperBoundOnNLinks;
369 ATH_MSG_WARNING(
"Saving a Decision object with a very large number of INCOMING graph edges. Number of in-edges: " << inputNode->
children().size());
372 ATH_MSG_WARNING(
"Saving a Decision object with a very large number of OUTGOING graph edges. Number of out-edges: " << outputDecision->
linkColNames().size());
374 if (bad_in or bad_out) {
379 ATH_MSG_ERROR(
"More than " << maxUpperBoundOnNLinks <<
" links, printing an ERROR such that this gets promptly investigated and reduced.");
382 return StatusCode::SUCCESS;
400 const Decision*
const firstParent = (seeds.size() ? *seeds.at(0) :
nullptr);
420 return StatusCode::SUCCESS;
436 if (chainIDs.size()) {
439 std::inserter(toOutput, toOutput.begin()));
442 toOutput.insert(fromInput.begin(), fromInput.end());
448 return StatusCode::SUCCESS;
458 <<
"(pt:" <<
l.pt() <<
",eta:" <<
l.eta() <<
",phi:" <<
l.phi() <<
",m:" <<
l.m() <<
",e:" <<
l.e() <<
")"
459 <<
" from:" << link.
dataID());
494 return StatusCode::SUCCESS;
SG::WriteHandleKey< xAOD::TrigMissingETContainer > m_outputRepackedFeaturesCollectionKey_MET
Gaudi::Property< bool > m_runtimeValidation
std::map< const TrigCompositeUtils::Decision *, TrigCompositeUtils::Decision * > IOCacheMap
double millisecondsDifference(const TrigTimeStamp &other) const
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_primaryInputCollection
Gaudi::Property< bool > m_repackROIs
std::string find(const std::string &s)
return a remapped string
Gaudi::Property< bool > m_keepFailedBranches
const std::string & chain_name() const
TrigCompositeUtils::DecisionID numeric() const
numeric ID
ElementLink< CONTAINER > objectLink(const std::string &name) const
Get the link with the requested name.
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.
std::set< std::string > m_allOutputContainersSet
Processed form of m_allOutputContainers.
const std::string & hypoAlgNodeName()
const std::vector< NavGraphNode * > & seeds() const
Return a vector of const pointers to the Decision object nodes which this NavGraphNode seeds from.
bool hasObjectLink(const std::string &name, const CLID clid=CLID_NULL) const
Check if a link to an object with a given name and type exists. CLID_NULL to not check type.
void insertDecisionIDs(const Decision *src, Decision *dest)
Appends the decision IDs of src to the dest decision object.
bool msgLvl(const MSG::Level lvl) const
std::vector< NavGraphNode * > allNodes()
Get all nodes.
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Gaudi::Property< bool > m_repackFeatures
Gaudi::Property< std::vector< std::string > > m_edgesToDrop
void printAllPaths(MsgStream &log, MSG::Level msgLevel=MSG::VERBOSE) const
Helper function.
std::vector< size_t > lookupHardCodedLegMultiplicities(const std::string &chain) const
Supplemental leg multiplicity information to support MC20.
#define ATH_MSG_VERBOSE(x)
HLT chain configuration information.
StatusCode doRepack(TrigCompositeUtils::Decision *decision, SG::WriteHandle< COLLECTION > *writeHandle, const std::string &edgeName) const
Look for an ElementLink<COLLECTION> with the given edge-name in 'decision', if found then make a copy...
double millisecondsSince() const
Class providing the definition of the 4-vector interface.
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_outputCollection
bool isValid() const
Test to see if the link can be dereferenced.
const ID_type & dataID() const
Get the key that we reference, as a string.
const std::vector< NavGraphNode * > & children() const
Return a vector of const pointers to the Decision object nodes which are the children of this NavGrap...
const std::vector< size_t > & leg_multiplicities() const
An algorithm that can be simultaneously executed in multiple threads.
TrigNavSlimmingMTAlg(const std::string &name, ISvcLocator *pSvcLocator)
const Decision * getTerminusNode(SG::ReadHandle< DecisionContainer > &container)
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
SG::WriteHandleKey< xAOD::ParticleContainer > m_outputRepackedFeaturesCollectionKey_Particle
void setP4(const FourMom_t &vec)
Set the 4-vec.
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...
bool setObjectLink(const std::string &name, const ElementLink< CONTAINER > &link)
Set the link to an object.
const std::string & initialRoIString()
utility class to measure time duration in AthenaMT The pattern when it is useful: AlgA tags the begin...
const Decision * getExpressTerminusNode(const DecisionContainer &container)
Returns the express-accept navigation node from a collection or nullptr if missing.
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode propagateSeedingRelation(const TrigCompositeUtils::NavGraphNode *inputNode, IOCacheMap &cache, const EventContext &ctx) const
Copy the subset of "seed" links which are present in the inputNode.
Default, invalid implementation of ClassID_traits.
Gaudi::Property< bool > m_repackMET
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,...
Gaudi::Property< std::vector< std::string > > m_chainsFilter
Gaudi::Property< std::vector< std::string > > m_allOutputContainers
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
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.
Description of a generic particle.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const std::string & featureString()
void printIParticleRepackingDebug(const TrigCompositeUtils::Decision *output, const std::string &when) const
Print debug information relating to the re-packing of feature links as Particle objects.
const Decision * node() const
Return a const pointer to the Decision object node which this NavGraphNode is shadowing.
StatusCode inputToOutput(const TrigCompositeUtils::Decision *input, TrigCompositeUtils::Decision **output, IOCacheMap &cache, Outputs &outputContainers, const TrigCompositeUtils::DecisionIDContainer &chainIDs, const EventContext &ctx) const
Map a const Decision object from an input collection to its equivalent in the output collection Where...
const std::string & summaryPassNodeName()
const std::vector< std::string > & linkColNames() const
Raw access to the persistent link names.
HLT::Identifier createLegName(const HLT::Identifier &chainIdentifier, size_t counter)
Generate the HLT::Identifier which corresponds to a specific leg of a given chain.
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
SG::WriteHandleKey< TrigRoiDescriptorCollection > m_outputRepackedROICollectionKey
const std::string & name() const
Get a human-readable name for the object.
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()
std::set< DecisionID > DecisionIDContainer
Gaudi::Property< bool > m_removeEmptySteps
#define ATH_MSG_WARNING(x)
Transient utility class to represent a node in a graph (m_decisionObject), and a vector of edges (m_f...
StatusCode doRepackCopy(const typename COLLECTION::base_value_type *object, SG::WriteHandle< COLLECTION > *writeHandle) const
Performs the xAOD Copy.
Gaudi::Property< bool > m_keepOnlyFinalFeatures
index_type index() const
Get the index of the element inside of its container.
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
void recursiveFlagForThinning(NavGraph &graph, const bool keepOnlyFinalFeatures, const bool removeEmptySteps, const std::vector< std::string > &nodesToDrop)
Used by trigger navigation thinning.
const std::string & roiString()
virtual StatusCode initialize() override
Athena::TPCnvVers::Current TrigRoiDescriptor
StatusCode propagateLinks(const TrigCompositeUtils::Decision *input, TrigCompositeUtils::Decision *output) const
Copy links (graph edges) from input to output.
std::vector< std::string > getListOfTriggers() const
Set * set_intersection(Set *set1, Set *set2)
Perform an intersection of two sets.
StatusCode repackLinks(TrigCompositeUtils::Decision *output, Outputs &outputContainers) const
Repacks ElementLinks in the DecisionObject to point to compact output containers written by this alg.
size_type size() const noexcept
Returns the number of elements in the collection.
std::vector< const Decision * > thin()
Perform thinning.
StatusCode propagateDecisionIDs(const TrigCompositeUtils::Decision *input, TrigCompositeUtils::Decision *output, const TrigCompositeUtils::DecisionIDContainer &chainIDs) const
Copy DecisionIDs (passing chains and passing chain-legs) from input to output.
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.
Gaudi::Property< std::vector< std::string > > m_nodesToDrop
StatusCode fillChainIDs(TrigCompositeUtils::DecisionIDContainer &chainIDs) const
Convert the ChainsFilter into the set of chain-IDd and chain-leg-IDs which comprises all of the Decis...