ATLAS Offline Software
TrigNavSlimmingMTAlg.cxx
Go to the documentation of this file.
1 
2 /*
3  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
4 */
5 
6 #include "TrigNavSlimmingMTAlg.h"
7 
9 
12 
13 using namespace TrigCompositeUtils;
14 
15 
16 // Particle Specialization
17 // We transiently interact via the xAOD::IParticle interface.
18 // There is code inside the TrigCompositeUtils::Decision to check
19 // at runtime if this inheritance is possible.
20 // But we copy into a xAOD::Particle object.
21 template<>
24  const std::string& edgeName) const
25 {
26 
27  if (not decision->hasObjectLink(edgeName, ClassID_traits<xAOD::IParticleContainer>::ID())) { // Note: IParticle
28  // Nothing to do
29  return StatusCode::SUCCESS;
30  }
31 
32  ElementLink<xAOD::IParticleContainer> currentEL = decision->objectLink<xAOD::IParticleContainer>(edgeName); // Note: IParticle
33 
34  if (!currentEL.isValid()) {
35  // TODO: Upgrade this first message to a WARNING once the TriggerAPI for Run3 is filtering on the chains whose final-features get saved into the DAOD_PHYS
36  ATH_MSG_DEBUG("Unable to repack '" << edgeName << "' of container type xAOD::IParticleContainer for '"
37  << decision->name() << "' node, the link is invalid.");
38  ATH_MSG_DEBUG("Dump of DecisionObject: " << *decision);
39  return StatusCode::SUCCESS;
40  }
41 
42  (**writeHandle).push_back( new xAOD::Particle() ); // Need to do this before performing the copy to assign with the Aux store
43 
44  const xAOD::IParticle* current = *currentEL;
45  xAOD::Particle* remapped = (**writeHandle).back();
46 
47  remapped->setP4( current->p4() );
48 
49  ElementLink<xAOD::ParticleContainer> remappedEL(**writeHandle, (**writeHandle).size()-1);
50  decision->setObjectLink<xAOD::ParticleContainer>(edgeName, remappedEL); // Overwrite the existing link
51 
52  ATH_MSG_VERBOSE("Repacked from index:" << currentEL.index() << " from key:" << currentEL.dataID()
53  << ", to index:" << remappedEL.index() << " to key:" << remappedEL.dataID());
54 
55  return StatusCode::SUCCESS;
56 }
57 
58 
59 // ROI Specialization.
60 // Not an xAOD object, can use a direct copy constructor.
61 template<>
64 {
65  // Specialization for ROIs, utilize copy constructor (no Aux store here)
66  (**writeHandle).push_back( new TrigRoiDescriptor(*object) );
67  return StatusCode::SUCCESS;
68 }
69 
70 
71 TrigNavSlimmingMTAlg::TrigNavSlimmingMTAlg(const std::string& name, ISvcLocator* pSvcLocator)
72  : AthReentrantAlgorithm(name, pSvcLocator)
73 {
74 }
75 
76 
78  ATH_CHECK( m_primaryInputCollection.initialize() );
79  ATH_CHECK( m_outputCollection.initialize() );
83 
84  const bool removeRoI = (std::find(m_edgesToDrop.begin(), m_edgesToDrop.end(), roiString()) != m_edgesToDrop.end());
85  const bool removeInitialRoI = (std::find(m_edgesToDrop.begin(), m_edgesToDrop.end(), initialRoIString()) != m_edgesToDrop.end());
86 
87  if (m_repackROIs and (removeRoI or removeInitialRoI)) {
88  ATH_MSG_WARNING("Possible miss-configuration. Cannot repack ROIs in the navigation slimming if they are being dropped");
89  }
90 
91  if (not m_trigDec.empty()) {
92  ATH_CHECK( m_trigDec.retrieve() );
93  }
94  for (const std::string& output : m_allOutputContainers) {
95  if (output == m_primaryInputCollection.key()) {
96  continue; // We do want to search for failed nodes in the primary input (it may already be merged)
97  }
98  // We don't want to search for failed nodes in other possible summary keys, we might read in the
99  // summary collection from another running instance (e.g. an AODSlim alg reading in the output of
100  // ESDSlim in a RAWtoALL job).
102  }
104  msg() << MSG::INFO << "Initialized. Will *not* inspect the following SG Keys: ";
105  for (const std::string& key : m_allOutputContainersSet) {
106  msg() << key << " ";
107  }
108  msg() << endmsg;
109  return StatusCode::SUCCESS;
110 }
111 
112 
113 StatusCode TrigNavSlimmingMTAlg::execute(const EventContext& ctx) const {
114 
115  // Prepare IO
117 
121  if (m_repackROIs) {
123  outputContainers.rois = &outputROIs;
124  }
125  if (m_repackFeatures) {
126  outputParticles = createAndStoreWithAux<xAOD::ParticleContainer, xAOD::ParticleAuxContainer>(m_outputRepackedFeaturesCollectionKey_Particle, ctx);
127  outputContainers.particles = &outputParticles;
128  }
129  if (m_repackMET) {
130  outputMETs = createAndStoreWithAux<xAOD::TrigMissingETContainer, xAOD::TrigMissingETAuxContainer>(m_outputRepackedFeaturesCollectionKey_MET, ctx);
131  outputContainers.mets = &outputMETs;
132  }
133 
135  outputContainers.nav = &outputNavigation;
136 
138  ATH_CHECK(primaryInputHandle.isValid());
139 
140  const Decision* terminusNode = TrigCompositeUtils::getTerminusNode(*primaryInputHandle);
141  if (!terminusNode) {
142  ATH_MSG_ERROR("Unable to locate the HLTPassRaw from the primary input navigation collection, size:" << primaryInputHandle->size());
143  return StatusCode::FAILURE;
144  }
145 
146  const Decision* expressTerminusNode = TrigCompositeUtils::getExpressTerminusNode(*primaryInputHandle);
147 
148  // Stage 1. Build a transient representation of the navigation graph.
149  TrigTimeStamp stage1;
150  NavGraph transientNavGraph;
151 
152  // We can optionally only keep data for a given set of chains. An empty set means to keep for all chains.
153  DecisionIDContainer chainIDs = {};
154  if (not m_chainsFilter.empty()) {
155  ATH_CHECK(fillChainIDs(chainIDs));
156  ATH_MSG_DEBUG("Supplied " << m_chainsFilter.size() << " chain patterns. This converts to " << chainIDs.size() << " DecisionIDs to be preserved.");
157  }
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.");
160  }
161 
162  std::set<const Decision*> fullyExploredFrom;
163  // Note: We use the "internal" version of this call such that we maintain our own cache,
164  // as we may need to call this more than once if keepFailedBranches is true
166  nullptr, // 'Coming from' is nullptr for the first call of the recursive function
167  transientNavGraph,
168  fullyExploredFrom,
169  chainIDs,
170  /*enforce chainIDs on terminus node*/ true);
171 
172  ATH_MSG_DEBUG("Collated nodes from passing paths, now have " << transientNavGraph.nodes() << " nodes with " << transientNavGraph.edges() << " edges");
173 
174  // Stage 2. We can optionally include branches through the graph which were never accepted by any chain.
175  TrigTimeStamp stage2;
176  // These branches do not connect to the terminusNode, so we have to go hunting them explicitly.
177  // We need to pass in the evtStore as these nodes can be spread out over numerous collections.
178  // Like with the terminus node, we can restrict this search to only nodes which were rejected by certain chains.
179  // We also want to restrict the search to exclude the output collections of any other TrigNavSlimminMTAlg instances
180  // and let the function know what the primary input collection is - from the name of this we can tell if we need to search one or many containers.
181  if (m_keepFailedBranches) {
182  std::vector<const Decision*> rejectedNodes = TrigCompositeUtils::getRejectedDecisionNodes(&*evtStore(), m_primaryInputCollection.key(), chainIDs, m_allOutputContainersSet);
183  for (const Decision* rejectedNode : rejectedNodes) {
184  // We do *not* enforce that a member of chainIDs must be present in the starting node (rejectedNode)
185  // specifically because we know that at least one of chainIDs was _rejected_ here, but is active in the rejected
186  // node's seeds.
188  nullptr, // 'Coming from' is nullptr for the first call of the recursive function
189  transientNavGraph,
190  fullyExploredFrom,
191  chainIDs,
192  /*enforce chainIDs on terminus node*/ false);
193  }
194  ATH_MSG_DEBUG("Collated nodes from failing paths, now have " << transientNavGraph.nodes() << " nodes with " << transientNavGraph.edges() << " edges");
195  }
196 
197  // Stage 3. Walk all paths through the graph. Flag for thinning.
198  TrigTimeStamp stage3;
199  // Final nodes includes the terminus node, plus any rejected nodes (if these were collated).
201 
202  if (msg().level() <= MSG::VERBOSE) {
203  ATH_MSG_VERBOSE("The navigation graph entering the slimming is:");
204  transientNavGraph.printAllPaths(msg(), MSG::VERBOSE);
205  }
206 
207  // Stage 4. Do the thinning. Re-wire removed nodes as we go.
208  TrigTimeStamp stage4;
209  const size_t nodesBefore = transientNavGraph.nodes();
210  const size_t edgesBefore = transientNavGraph.edges();
211  std::vector<const Decision*> thinnedInputNodes = transientNavGraph.thin();
212 
213  // TODO - thinnedInputNodes will be dropped, these may link to "features", "roi", or other objects in other containers.
214  // Need to let the slimming svc know that we no longer need the objects pointed to here, and hence they can be thinned.
215 
216  ATH_MSG_DEBUG("Trigger navigation graph thinning going from " << nodesBefore << " nodes with " << edgesBefore << " edges, to "
217  << transientNavGraph.nodes() << " nodes with " << transientNavGraph.edges() << " edges");
218 
219  if (msg().level() <= MSG::VERBOSE) {
220  ATH_MSG_VERBOSE("The navigation graph has been slimmed to the following paths:");
221  transientNavGraph.printAllPaths(msg(), MSG::VERBOSE);
222  }
223 
224  // Stage 5. Fill the transientNavGraph structure (with NavGraphNode* nodes) back into an xAOD::DecisionContainer (with xAOD::Decision* nodes).
225  TrigTimeStamp stage5;
226  IOCacheMap cache; // Used to keep a one-to-one relationship between the const input Decision* and the mutable output Decision*
227  // Do the terminus node first - such that it ends up at index 0 of the outputNavigation (fast to locate in the future)
228  Decision* terminusNodeOut = nullptr;
229  ATH_CHECK(inputToOutput(terminusNode, &terminusNodeOut, cache, outputContainers, chainIDs, ctx));
230  if (expressTerminusNode) {
231  // Do the express terminus node second - such that it ends up at index 1 of the outputNavigation (fast to locate in the future)
232  Decision* expressTerminusNodeOut = nullptr;
233  ATH_CHECK(inputToOutput(expressTerminusNode, &expressTerminusNodeOut, cache, outputContainers, chainIDs, ctx));
234  }
235  // Don't have to walk the graph here, just iterate through the set of (thinned) nodes.
236  // We won't end up with two terminus nodes because of this (it checks that the node hasn't already been processed)
237  const std::vector<NavGraphNode*> allNodes = transientNavGraph.allNodes();
238  for (const NavGraphNode* inputNode : allNodes) {
239  Decision* outputNode = nullptr;
240  ATH_CHECK(inputToOutput(inputNode->node(), &outputNode, cache, outputContainers, chainIDs, ctx));
241  // TODO - anything else to do here with outputNode? We cannot hook up its seeding yet, we may not yet have output nodes for all of its seeds.
242  }
243  // Now we have all of the new nodes in the output collection, can link them all up with their slimmed seeding relationships.
244  for (const NavGraphNode* inputNode : allNodes) {
245  ATH_CHECK(propagateSeedingRelation(inputNode, cache, ctx));
246  }
247 
248  // We can perform an additional check on the output graph, we put a veto on the m_keepFailedBranches option as we are currently just exploring
249  // from the 'terminusNodeOut', more code would be needed to locate failing branches also in the output graph structure.
250  if (msg().level() <= MSG::VERBOSE && !m_keepFailedBranches) {
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;
253  NavGraph transientNavGraphOut;
255  nullptr, // 'Coming from' is nullptr for the first call of the recursive function
256  transientNavGraphOut,
257  fullyExploredFromOut,
258  chainIDs,
259  /*enforce chainIDs on terminus node*/ true);
260  transientNavGraphOut.printAllPaths(msg(), MSG::VERBOSE);
261  }
262 
263  if (msg().level() <= MSG::DEBUG) {
264  ATH_MSG_DEBUG("Navigation slimming and thinning timings:");
265  ATH_MSG_DEBUG(" 1. Transient Graph of Passed Nodes = " << stage1.millisecondsDifference(stage2) << " ms");
266  ATH_MSG_DEBUG(" 2. Transient Graph of Failed Nodes = " << stage2.millisecondsDifference(stage3) << " ms");
267  ATH_MSG_DEBUG(" 3. Flag Transient Graph For Thinning = " << stage3.millisecondsDifference(stage4) << " ms");
268  ATH_MSG_DEBUG(" 4. Perform Transient Graph Thinning = " << stage4.millisecondsDifference(stage5) << " ms");
269  ATH_MSG_DEBUG(" 5. Write xAOD Graph = " << stage5.millisecondsSince() << " ms");
270  }
271 
272  return StatusCode::SUCCESS;
273 }
274 
275 std::vector<size_t> TrigNavSlimmingMTAlg::lookupHardCodedLegMultiplicities(const std::string& chain) const {
276  if (chain == "HLT_id_cosmicid_L1MU11_EMPTY") return std::vector<size_t>(1,1); // size = 1, value at index 0 = 1
277  return std::vector<size_t>();
278 }
279 
281  for (const std::string& filter : m_chainsFilter) {
282  // We do this as filter->chains stage as filter could be a regexp matching a large number of chains
283  const Trig::ChainGroup* cg = m_trigDec->getChainGroup(filter);
284  std::vector<std::string> chains = cg->getListOfTriggers();
285  for (const std::string& chain : chains) {
286  const TrigConf::HLTChain* hltChain = m_trigDec->ExperimentalAndExpertMethods().getChainConfigurationDetails(chain);
287  const HLT::Identifier chainID( hltChain->chain_name() );
288  chainIDs.insert( chainID.numeric() );
289  std::vector<size_t> legMultiplicites = hltChain->leg_multiplicities();
290  ATH_MSG_VERBOSE("Including " << chain << " and its " << legMultiplicites.size() << " legs in the trigger slimming output");
291  if (legMultiplicites.size() == 0) {
292  legMultiplicites = lookupHardCodedLegMultiplicities(chain);
293  if (legMultiplicites.size() == 0) {
294  ATH_MSG_ERROR("chain " << chainID << " has invalid configuration, no multiplicity data.");
295  return StatusCode::FAILURE;
296  }
297  }
298  if (legMultiplicites.size() > 1) {
299  // For multi-leg chains, the DecisionIDs are handled per leg.
300  // We don't care here exactly how many objects are required per leg, just that there are two-or-more legs
301  for (size_t legNumeral = 0; legNumeral < legMultiplicites.size(); ++legNumeral) {
302  const HLT::Identifier legID = TrigCompositeUtils::createLegName(chainID, legNumeral);
303  chainIDs.insert( legID.numeric() );
304  }
305  }
306  }
307  }
308  return StatusCode::SUCCESS;
309 }
310 
311 
315  IOCacheMap& cache,
317  const DecisionIDContainer& chainIDs,
318  const EventContext& ctx) const
319 {
320  IOCacheMap::const_iterator it = cache.find(input);
321  if (it != cache.end()) {
322  *output = it->second;
323  } else {
324  *output = newDecisionIn(outputContainers.nav->ptr(), input, input->name(), ctx);
328  cache[input] = *output;
329  }
330  return StatusCode::SUCCESS;
331 }
332 
333 
335  const TrigCompositeUtils::NavGraphNode* inputNode,
336  IOCacheMap& cache,
337  const EventContext& ctx) const
338 {
339  const Decision* inputDecision = inputNode->node(); // The incoming Decision objects, with links into the old graph
340  Decision* outputDecision = nullptr; // The outgoing Decision object, without graph links so far
341  {
342  IOCacheMap::const_iterator it = cache.find(inputDecision);
343  ATH_CHECK( it != cache.end() );
344  outputDecision = it->second;
345  }
346  for (const NavGraphNode* seed : inputNode->seeds()) {
347  const Decision* inputSeedDecision = seed->node(); // A Decision object the incoming Decision object links to (old graph)
348  const Decision* outputSeedDecision = nullptr; // The equivalent Decision Object in the slimmed outgoing graph
349  {
350  IOCacheMap::const_iterator it = cache.find(inputSeedDecision);
351  ATH_CHECK( it != cache.end() );
352  outputSeedDecision = it->second;
353  }
354  // Perform the linking only using nodes from the slimmed output graph
355  TrigCompositeUtils::linkToPrevious(outputDecision, outputSeedDecision, ctx);
356  }
357 
358  // Don't run this check for "HLTPassRaw", this node is expected to link back to every passing physics object.
359  // Hence there may be more than 'sensibleUpperBoundOnNLinks' in aggregate here.
360  if (m_runtimeValidation and outputDecision->name() != TrigCompositeUtils::summaryPassNodeName()) {
361  const size_t sensibleUpperBoundOnNLinks = 100;
362  const size_t maxUpperBoundOnNLinks = 500;
363  // Note: Only in the NavGraphNode do we have the two-way links to check how many children link back to this node
364  const bool bad_in = inputNode->children().size() > sensibleUpperBoundOnNLinks;
365  //Note: Here we check more than "seed" links. We pick up external links too like "feature"
366  const bool bad_out = outputDecision->linkColNames().size() > sensibleUpperBoundOnNLinks;
367  const bool vbad = inputNode->children().size() > maxUpperBoundOnNLinks or outputDecision->linkColNames().size() > maxUpperBoundOnNLinks;
368  if (bad_in) {
369  ATH_MSG_WARNING("Saving a Decision object with a very large number of INCOMING graph edges. Number of in-edges: " << inputNode->children().size());
370  }
371  if (bad_out) {
372  ATH_MSG_WARNING("Saving a Decision object with a very large number of OUTGOING graph edges. Number of out-edges: " << outputDecision->linkColNames().size());
373  }
374  if (bad_in or bad_out) {
375  ATH_MSG_WARNING("Comes from: " << TrigCompositeUtils::decisionToElementLink(inputDecision, ctx).dataID());
376  ATH_MSG_DEBUG("Output Decision: " << *outputDecision);
377  }
378  if (vbad) {
379  ATH_MSG_ERROR("More than " << maxUpperBoundOnNLinks << " links, printing an ERROR such that this gets promptly investigated and reduced.");
380  }
381  }
382  return StatusCode::SUCCESS;
383 }
384 
385 
389 {
390  // ElementLinks form the edges in the graph. Start by copying all of them over.
391 
392  output->copyAllLinksFrom( input );
393 
394  // Special behaviour to save additional disk space for keepOnlyFinalFeatures mode.
395  // In keepOnlyFinalFeatures we stop at the first hypoAlgNode, hence we will drop the preceding inputMakerNode, and all prior Steps in their entirety.
396  // This means we will also drop all "roi" edges, including the final ROI.
397  // We may want to keep this final "roi", and so to do this we can copy it down one level (away from L1) to live in the hypoAlgNode along side the "feature" link.
398  // Note: If "roi" is listed in m_edgesToDrop then we will still immediately drop this new element link in the m_edgesToDrop loop below.
399  const std::vector<ElementLink<DecisionContainer>> seeds = input->objectCollectionLinks<DecisionContainer>(seedString());
400  const Decision* const firstParent = (seeds.size() ? *seeds.at(0) : nullptr);
402  input->name() == hypoAlgNodeName() &&
403  firstParent &&
404  firstParent->name() == inputMakerNodeName() &&
405  firstParent->hasObjectLink(roiString()))
406  {
407  output->copyLinkFrom( firstParent, roiString() );
408  }
409 
410  for (const std::string& toRemove : m_edgesToDrop) {
411  output->removeObjectLink(toRemove);
412  output->removeObjectCollectionLinks(toRemove);
413  // TODO - let the slimming svc know that we no longer need these objects
414  }
415 
416  // Do not propagate "seed" links - TrigNavSlimmingMTAlg will
417  // propagate these following additional logic
418  output->removeObjectCollectionLinks( seedString() );
419 
420  return StatusCode::SUCCESS;
421 }
422 
423 
427  const DecisionIDContainer& chainIDs) const
428 {
429 
430  // Get all DecisionIDs from the const input Decision*
431  DecisionIDContainer fromInput;
432  decisionIDs(input, fromInput);
433 
434  DecisionIDContainer toOutput;
435 
436  if (chainIDs.size()) {
437  // Applying ChainsFilter to the set of DecisionIDs
438  std::set_intersection(fromInput.begin(), fromInput.end(), chainIDs.begin(), chainIDs.end(),
439  std::inserter(toOutput, toOutput.begin()));
440  } else {
441  // Copying all DecisionIDs from input to output
442  toOutput.insert(fromInput.begin(), fromInput.end());
443  }
444 
445  // Set the DecisionIDs into the mutable output Decision*
446  insertDecisionIDs(toOutput, output);
447 
448  return StatusCode::SUCCESS;
449 }
450 
452  if (not msgLvl(MSG::DEBUG)) return;
455  if (link.isValid()) {
456  const xAOD::IParticle& l = **link;
457  ATH_MSG_DEBUG("IParticle repacking debug. " << when << " : "
458  << "(pt:" << l.pt() << ",eta:" << l.eta() << ",phi:" << l.phi() << ",m:" << l.m() << ",e:" << l.e() << ")"
459  << " from:" << link.dataID());
460  if (when == " After") ATH_MSG_DEBUG("--");
461  }
462  }
463 }
464 
465 
468  Outputs& outputContainers) const
469 {
470 
471  if (m_repackROIs) {
472  ATH_CHECK( doRepack<TrigRoiDescriptorCollection>(output, outputContainers.rois, roiString()) );
473  ATH_CHECK( doRepack<TrigRoiDescriptorCollection>(output, outputContainers.rois, initialRoIString()) );
474  }
475 
476  if (m_repackFeatures) {
477  // Debug printing. Look at the four-momentum of any feature before the repacking.
478  // Note: Transiently we interact with the IParticle interface.
480 
481  // Do any IParticle repacking
482  ATH_CHECK( doRepack<xAOD::ParticleContainer>(output, outputContainers.particles, featureString()) );
483 
484  // Debug printing. Look at the four-momentum of any feature after the repacking (the stored link is re-written)
486  }
487 
488  // Some features do not support an IParticle interface. These need their own containers.
489  // TODO. Apply some thinning?
490  if (m_repackMET) {
491  ATH_CHECK( doRepack<xAOD::TrigMissingETContainer>(output, outputContainers.mets, featureString()) );
492  }
493 
494  return StatusCode::SUCCESS;
495 }
fillPileUpNoiseLumi.current
current
Definition: fillPileUpNoiseLumi.py:52
TrigNavSlimmingMTAlg::m_outputRepackedFeaturesCollectionKey_MET
SG::WriteHandleKey< xAOD::TrigMissingETContainer > m_outputRepackedFeaturesCollectionKey_MET
Definition: TrigNavSlimmingMTAlg.h:67
TrigNavSlimmingMTAlg::m_runtimeValidation
Gaudi::Property< bool > m_runtimeValidation
Definition: TrigNavSlimmingMTAlg.h:116
TrigNavSlimmingMTAlg::IOCacheMap
std::map< const TrigCompositeUtils::Decision *, TrigCompositeUtils::Decision * > IOCacheMap
Definition: TrigNavSlimmingMTAlg.h:42
TrigTimeStamp::millisecondsDifference
double millisecondsDifference(const TrigTimeStamp &other) const
Definition: TrigTimeStamp.cxx:11
TrigNavSlimmingMTAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: TrigNavSlimmingMTAlg.cxx:113
TrigNavSlimmingMTAlg::m_primaryInputCollection
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_primaryInputCollection
Definition: TrigNavSlimmingMTAlg.h:51
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
TrigNavSlimmingMTAlg::m_repackROIs
Gaudi::Property< bool > m_repackROIs
Definition: TrigNavSlimmingMTAlg.h:83
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
TrigNavSlimmingMTAlg::m_keepFailedBranches
Gaudi::Property< bool > m_keepFailedBranches
Definition: TrigNavSlimmingMTAlg.h:71
TrigConf::HLTChain::chain_name
const std::string & chain_name() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:72
HLT::Identifier::numeric
TrigCompositeUtils::DecisionID numeric() const
numeric ID
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:47
xAOD::TrigComposite_v1::objectLink
ElementLink< CONTAINER > objectLink(const std::string &name) const
Get the link with the requested name.
TrigCompositeUtils::newDecisionIn
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.
Definition: TrigCompositeUtilsRoot.cxx:46
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TrigNavSlimmingMTAlg::m_allOutputContainersSet
std::set< std::string > m_allOutputContainersSet
Processed form of m_allOutputContainers.
Definition: TrigNavSlimmingMTAlg.h:120
TrigCompositeUtils::hypoAlgNodeName
const std::string & hypoAlgNodeName()
Definition: TrigCompositeUtilsRoot.cxx:904
TrigCompositeUtils::NavGraphNode::seeds
const std::vector< NavGraphNode * > & seeds() const
Return a vector of const pointers to the Decision object nodes which this NavGraphNode seeds from.
Definition: NavGraph.cxx:47
xAOD::TrigComposite_v1::hasObjectLink
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.
Definition: TrigComposite_v1.cxx:246
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TrigCompositeUtils::insertDecisionIDs
void insertDecisionIDs(const Decision *src, Decision *dest)
Appends the decision IDs of src to the dest decision object.
Definition: TrigCompositeUtilsRoot.cxx:80
AthCommonMsg< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
TrigCompositeUtils::NavGraph::allNodes
std::vector< NavGraphNode * > allNodes()
Get all nodes.
Definition: NavGraph.cxx:104
TrigCompositeUtils::createAndStore
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
Definition: TrigCompositeUtilsRoot.cxx:30
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
TrigNavSlimmingMTAlg::m_repackFeatures
Gaudi::Property< bool > m_repackFeatures
Definition: TrigNavSlimmingMTAlg.h:91
TrigNavSlimmingMTAlg::m_edgesToDrop
Gaudi::Property< std::vector< std::string > > m_edgesToDrop
Definition: TrigNavSlimmingMTAlg.h:95
TrigCompositeUtils::NavGraph::printAllPaths
void printAllPaths(MsgStream &log, MSG::Level msgLevel=MSG::VERBOSE) const
Helper function.
Definition: NavGraph.cxx:166
TrigNavSlimmingMTAlg::lookupHardCodedLegMultiplicities
std::vector< size_t > lookupHardCodedLegMultiplicities(const std::string &chain) const
Supplemental leg multiplicity information to support MC20.
Definition: TrigNavSlimmingMTAlg.cxx:275
TrigNavSlimmingMTAlg.h
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TrigConf::HLTChain
HLT chain configuration information.
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:35
TrigNavSlimmingMTAlg::doRepack
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...
TrigTimeStamp::millisecondsSince
double millisecondsSince() const
Definition: TrigTimeStamp.cxx:7
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
TrigCompositeUtils::NavGraph::edges
size_t edges() const
Definition: NavGraph.cxx:120
TrigNavSlimmingMTAlg::m_outputCollection
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_outputCollection
Definition: TrigNavSlimmingMTAlg.h:55
TrigCompositeUtils::NavGraphNode::children
const std::vector< NavGraphNode * > & children() const
Return a vector of const pointers to the Decision object nodes which are the children of this NavGrap...
Definition: NavGraph.cxx:51
TrigConf::HLTChain::leg_multiplicities
const std::vector< size_t > & leg_multiplicities() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:82
ParticleAuxContainer.h
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
covarianceTool.filter
filter
Definition: covarianceTool.py:514
TrigNavSlimmingMTAlg::TrigNavSlimmingMTAlg
TrigNavSlimmingMTAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrigNavSlimmingMTAlg.cxx:71
TrigCompositeUtils::getTerminusNode
const Decision * getTerminusNode(SG::ReadHandle< DecisionContainer > &container)
Definition: TrigCompositeUtilsRoot.cxx:243
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
TrigNavSlimmingMTAlg::m_outputRepackedFeaturesCollectionKey_Particle
SG::WriteHandleKey< xAOD::ParticleContainer > m_outputRepackedFeaturesCollectionKey_Particle
Definition: TrigNavSlimmingMTAlg.h:63
TrigCompositeUtils::NavGraph::nodes
size_t nodes() const
Definition: NavGraph.cxx:115
xAOD::Particle_v1::setP4
void setP4(const FourMom_t &vec)
Set the 4-vec.
Definition: Particle_v1.cxx:71
python.UpdateManyBadChannelIOVs.toRemove
tuple toRemove
Definition: UpdateManyBadChannelIOVs.py:87
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TrigCompositeUtils::getRejectedDecisionNodes
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...
Definition: TrigCompositeUtilsRoot.cxx:261
xAOD::TrigComposite_v1::setObjectLink
bool setObjectLink(const std::string &name, const ElementLink< CONTAINER > &link)
Set the link to an object.
TrigCompositeUtils::initialRoIString
const std::string & initialRoIString()
Definition: TrigCompositeUtilsRoot.cxx:868
TrigTimeStamp
utility class to measure time duration in AthenaMT The pattern when it is useful: AlgA tags the begin...
Definition: TrigTimeStamp.h:23
TrigCompositeUtils::getExpressTerminusNode
const Decision * getExpressTerminusNode(const DecisionContainer &container)
Returns the express-accept navigation node from a collection or nullptr if missing.
Definition: TrigCompositeUtilsRoot.cxx:251
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigNavSlimmingMTAlg::propagateSeedingRelation
StatusCode propagateSeedingRelation(const TrigCompositeUtils::NavGraphNode *inputNode, IOCacheMap &cache, const EventContext &ctx) const
Copy the subset of "seed" links which are present in the inputNode.
Definition: TrigNavSlimmingMTAlg.cxx:334
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
TrigNavSlimmingMTAlg::m_repackMET
Gaudi::Property< bool > m_repackMET
Definition: TrigNavSlimmingMTAlg.h:87
TrigCompositeUtils::decisionToElementLink
ElementLink< DecisionContainer > decisionToElementLink(const Decision *d, const EventContext &ctx)
Takes a raw pointer to a Decision and returns an ElementLink to the Decision.
Definition: TrigCompositeUtilsRoot.cxx:122
TrigCompositeUtils::NavGraph
Structure to hold a transient Directed Acyclic Graph (DAG) structure. NavGraph is populated from,...
Definition: NavGraph.h:111
TrigNavSlimmingMTAlg::m_chainsFilter
Gaudi::Property< std::vector< std::string > > m_chainsFilter
Definition: TrigNavSlimmingMTAlg.h:107
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigNavSlimmingMTAlg::m_allOutputContainers
Gaudi::Property< std::vector< std::string > > m_allOutputContainers
Definition: TrigNavSlimmingMTAlg.h:103
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
TrigCompositeUtils::createAndStoreNoAux
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.
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
xAOD::Particle_v1
Description of a generic particle.
Definition: Particle_v1.h:31
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
merge.output
output
Definition: merge.py:17
Trig::ChainGroup
Definition: ChainGroup.h:51
TrigCompositeUtils::featureString
const std::string & featureString()
Definition: TrigCompositeUtilsRoot.cxx:884
TrigNavSlimmingMTAlg::printIParticleRepackingDebug
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.
Definition: TrigNavSlimmingMTAlg.cxx:451
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigCompositeUtils::NavGraphNode::node
const Decision * node() const
Return a const pointer to the Decision object node which this NavGraphNode is shadowing.
Definition: NavGraph.cxx:42
TrigNavSlimmingMTAlg::inputToOutput
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...
Definition: TrigNavSlimmingMTAlg.cxx:312
TrigCompositeUtils::summaryPassNodeName
const std::string & summaryPassNodeName()
Definition: TrigCompositeUtilsRoot.cxx:916
xAOD::TrigComposite_v1::linkColNames
const std::vector< std::string > & linkColNames() const
Raw access to the persistent link names.
TrigCompositeUtils::createLegName
HLT::Identifier createLegName(const HLT::Identifier &chainIdentifier, size_t counter)
Generate the HLT::Identifier which corresponds to a specific leg of a given chain.
Definition: TrigCompositeUtilsRoot.cxx:166
TrigNavSlimmingMTAlg::m_trigDec
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
Definition: TrigNavSlimmingMTAlg.h:112
TrigNavSlimmingMTAlg::m_outputRepackedROICollectionKey
SG::WriteHandleKey< TrigRoiDescriptorCollection > m_outputRepackedROICollectionKey
Definition: TrigNavSlimmingMTAlg.h:59
TrigCaloRecConfig.outputContainers
outputContainers
Definition: TrigCaloRecConfig.py:557
python.copyTCTOutput.chains
chains
Definition: copyTCTOutput.py:81
xAOD::TrigComposite_v1::name
const std::string & name() const
Get a human-readable name for the object.
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
TrigCompositeUtils::linkToPrevious
void linkToPrevious(Decision *d, const std::string &previousCollectionKey, size_t previousIndex)
Links to the previous object, location of previous 'seed' decision supplied by hand.
Definition: TrigCompositeUtilsRoot.cxx:139
TrigCompositeUtils::seedString
const std::string & seedString()
Definition: TrigCompositeUtilsRoot.cxx:888
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition: TrigComposite_v1.h:28
TrigNavSlimmingMTAlg::m_removeEmptySteps
Gaudi::Property< bool > m_removeEmptySteps
Definition: TrigNavSlimmingMTAlg.h:79
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TrigCompositeUtils::NavGraphNode
Transient utility class to represent a node in a graph (m_decisionObject), and a vector of edges (m_f...
Definition: NavGraph.h:20
TrigNavSlimmingMTAlg::doRepackCopy
StatusCode doRepackCopy(const typename COLLECTION::base_value_type *object, SG::WriteHandle< COLLECTION > *writeHandle) const
Performs the xAOD Copy.
TrigNavSlimmingMTAlg::m_keepOnlyFinalFeatures
Gaudi::Property< bool > m_keepOnlyFinalFeatures
Definition: TrigNavSlimmingMTAlg.h:75
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
TrigCompositeUtils::decisionIDs
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Definition: TrigCompositeUtilsRoot.cxx:67
TrigMissingETAuxContainer.h
TrigCompositeUtils::recursiveFlagForThinning
void recursiveFlagForThinning(NavGraph &graph, const bool keepOnlyFinalFeatures, const bool removeEmptySteps, const std::vector< std::string > &nodesToDrop)
Used by trigger navigation thinning.
Definition: TrigCompositeUtilsRoot.cxx:435
TrigCompositeUtils
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:19
TrigCompositeUtils::roiString
const std::string & roiString()
Definition: TrigCompositeUtilsRoot.cxx:876
TrigNavSlimmingMTAlg::initialize
virtual StatusCode initialize() override
Definition: TrigNavSlimmingMTAlg.cxx:77
TrigRoiDescriptor
Athena::TPCnvVers::Current TrigRoiDescriptor
Definition: TrigSteeringEventTPCnv.cxx:68
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
TrigNavSlimmingMTAlg::propagateLinks
StatusCode propagateLinks(const TrigCompositeUtils::Decision *input, TrigCompositeUtils::Decision *output) const
Copy links (graph edges) from input to output.
Definition: TrigNavSlimmingMTAlg.cxx:386
Trig::ChainGroup::getListOfTriggers
std::vector< std::string > getListOfTriggers() const
Definition: ChainGroup.cxx:467
set_intersection
Set * set_intersection(Set *set1, Set *set2)
Perform an intersection of two sets.
TrigNavSlimmingMTAlg::repackLinks
StatusCode repackLinks(TrigCompositeUtils::Decision *output, Outputs &outputContainers) const
Repacks ElementLinks in the DecisionObject to point to compact output containers written by this alg.
Definition: TrigNavSlimmingMTAlg.cxx:466
TrigTimeStamp.h
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TrigCompositeUtils::NavGraph::thin
std::vector< const Decision * > thin()
Perform thinning.
Definition: NavGraph.cxx:124
TrigNavSlimmingMTAlg::Outputs
Definition: TrigNavSlimmingMTAlg.h:44
TrigNavSlimmingMTAlg::propagateDecisionIDs
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.
Definition: TrigNavSlimmingMTAlg.cxx:424
TrigCompositeUtils::inputMakerNodeName
const std::string & inputMakerNodeName()
Definition: TrigCompositeUtilsRoot.cxx:900
TrigCompositeUtils::recursiveGetDecisionsInternal
void recursiveGetDecisionsInternal(const Decision *node, const Decision *comingFrom, NavGraph &navGraph, std::set< const Decision * > &fullyExploredFrom, const DecisionIDContainer &ids, const bool enforceDecisionOnNode)
Used by recursiveGetDecisions.
Definition: TrigCompositeUtilsRoot.cxx:383
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
TrigNavSlimmingMTAlg::m_nodesToDrop
Gaudi::Property< std::vector< std::string > > m_nodesToDrop
Definition: TrigNavSlimmingMTAlg.h:99
TrigNavSlimmingMTAlg::fillChainIDs
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...
Definition: TrigNavSlimmingMTAlg.cxx:280