ATLAS Offline Software
TrigNavSlimmingMTAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGNAVSLIMMINGMT_TRIGNAVSLIMMINGMTALG_H
6 #define TRIGNAVSLIMMINGMT_TRIGNAVSLIMMINGMTALG_H
7 
9 
10 #include "StoreGate/WriteHandle.h"
11 #include "StoreGate/ReadHandle.h"
12 
16 
20 
22 
35 public:
36  TrigNavSlimmingMTAlg(const std::string& name, ISvcLocator* pSvcLocator);
37  virtual StatusCode initialize() override;
38  virtual StatusCode execute (const EventContext& ctx) const override;
39 
40 private:
41 
42  typedef std::map<const TrigCompositeUtils::Decision*, TrigCompositeUtils::Decision*> IOCacheMap;
43 
44  struct Outputs {
49  };
50 
52  this, "PrimaryInputCollection", "HLTNav_Summary",
53  "Input collection containing the HLTPassRaw terminus node of the navigation."};
54 
56  this, "OutputCollection", "HLTNav_Summary_ESDSlimmed",
57  "Single output collection containing the slimmed navigation nodes."};
58 
60  this, "RepackROIsOutputCollection", "HLTNav_RepackedROIs",
61  "Single output collection containing any repacked ROIs (use with RepackROIs)."};
62 
64  this, "RepackFeaturesOutputCollection_Particle", "HLTNav_RepackedFeatures_Particle",
65  "Single output collection containing any repacked Particle features (use with RepackFeatures)."};
66 
68  this, "RepackFeaturesOutputCollection_MET", "HLTNav_RepackedFeatures_MET",
69  "Single output collection containing any repacked IParticle features (use with RepackFeatures)."};
70 
71  Gaudi::Property<bool> m_keepFailedBranches{
72  this, "KeepFailedBranched", true,
73  "Keep nodes which are in branches of the graph which fail selection for all triggers, these are used by T0 monitoring."};
74 
75  Gaudi::Property<bool> m_keepOnlyFinalFeatures{
76  this, "KeepOnlyFinalFeatures", false,
77  "Keeps only the final features which accepted a chain. Fine for analysis-use."};
78 
79  Gaudi::Property<bool> m_removeEmptySteps{
80  this, "RemoveEmptySteps", false,
81  "Slim away ComboHypo->InputMaker empty step pairs which come from parallel chain alignment (special case: keep if C.H. adds a feature, e.g. BLS). Fine for analysis-use."};
82 
83  Gaudi::Property<bool> m_repackROIs{
84  this, "RepackROIs", false,
85  "Re-pack the target of all 'roi' and 'initialRoI' edges into a single container (WriteHandle defined above)"};
86 
87  Gaudi::Property<bool> m_repackMET{
88  this, "RepackMET", false,
89  "Re-pack the target of all 'feature' edges to xAOD::TrigMissingET objects into a single container (WriteHandle defined above)"};
90 
91  Gaudi::Property<bool> m_repackFeatures{
92  this, "RepackFeatures", false,
93  "Re-pack the target of all 'feature' edges into a small number of containers (WriteHandle defined above)"};
94 
95  Gaudi::Property<std::vector<std::string>> m_edgesToDrop{
96  this, "EdgesToDrop", {"view"},
97  "Any edges within the set of names will be dropped as part of the thinning"};
98 
99  Gaudi::Property<std::vector<std::string>> m_nodesToDrop{
100  this, "NodesToDrop", {"F"},
101  "Any nodes within the set of names will be dropped as part of the thinning and the navigation re-wired around them"};
102 
103  Gaudi::Property<std::vector<std::string>> m_allOutputContainers{
104  this, "AllOutputContainers", {},
105  "List of SG keys of all possible output containers at differing verbosity. Used to stop different instances of the alg interfering with each other."};
106 
107  Gaudi::Property<std::vector<std::string>> m_chainsFilter{
108  this, "ChainsFilter", {},
109  "Optional list of HLT chains. If provided, only navigation data corresponding to these chains will be kept. "
110  "Matching multiple chains via regular expressions is supported."};
111 
112  PublicToolHandle<Trig::TrigDecisionTool> m_trigDec{
113  this, "TrigDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool",
114  "Trigger Decision Tool, used to apply the ChainsFilter"};
115 
116  Gaudi::Property<bool> m_runtimeValidation{
117  this, "RuntimeValidation", false,
118  "Perform additional validation checks on the navigation, and print WARNINGs if anything out of the ordinary is found."};
119 
120  std::set<std::string> m_allOutputContainersSet;
121 
128 
142  IOCacheMap& cache,
145  const EventContext& ctx) const;
146 
157 
168  const TrigCompositeUtils::DecisionIDContainer& chainIDs) const;
169 
180  const TrigCompositeUtils::NavGraphNode* inputNode,
181  IOCacheMap& cache,
182  const EventContext& ctx) const;
183 
192  Outputs& outputContainers) const;
193 
199  const std::string& when) const;
200 
204  std::vector<size_t> lookupHardCodedLegMultiplicities(const std::string& chain) const;
205 
213  template< typename COLLECTION >
215  SG::WriteHandle<COLLECTION>* writeHandle,
216  const std::string& edgeName) const;
217 
222  template< typename COLLECTION >
223  StatusCode doRepackCopy(const typename COLLECTION::base_value_type* object,
224  SG::WriteHandle<COLLECTION>* writeHandle) const;
225 
226 };
227 
228 #include "TrigNavSlimmingMTAlg.icc"
229 
230 #endif // TRIGNAVSLIMMINGMT_TRIGNAVSLIMMINGMTALG_H
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
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
TrigNavSlimmingMTAlg::m_keepFailedBranches
Gaudi::Property< bool > m_keepFailedBranches
Definition: TrigNavSlimmingMTAlg.h:71
TrigNavSlimmingMTAlg.icc
TrigNavSlimmingMTAlg::m_allOutputContainersSet
std::set< std::string > m_allOutputContainersSet
Processed form of m_allOutputContainers.
Definition: TrigNavSlimmingMTAlg.h:120
TrigDecisionTool.h
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
TrigNavSlimmingMTAlg::Outputs::rois
SG::WriteHandle< TrigRoiDescriptorCollection > * rois
Definition: TrigNavSlimmingMTAlg.h:45
TrigNavSlimmingMTAlg::lookupHardCodedLegMultiplicities
std::vector< size_t > lookupHardCodedLegMultiplicities(const std::string &chain) const
Supplemental leg multiplicity information to support MC20.
Definition: TrigNavSlimmingMTAlg.cxx:275
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
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...
TrigNavSlimmingMTAlg::m_outputCollection
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_outputCollection
Definition: TrigNavSlimmingMTAlg.h:55
TrigNavSlimmingMTAlg::Outputs::particles
SG::WriteHandle< xAOD::ParticleContainer > * particles
Definition: TrigNavSlimmingMTAlg.h:46
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
TrigNavSlimmingMTAlg::TrigNavSlimmingMTAlg
TrigNavSlimmingMTAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrigNavSlimmingMTAlg.cxx:71
TrigCompositeUtils.h
WriteHandle.h
Handle class for recording to StoreGate.
TrigNavSlimmingMTAlg::m_outputRepackedFeaturesCollectionKey_Particle
SG::WriteHandleKey< xAOD::ParticleContainer > m_outputRepackedFeaturesCollectionKey_Particle
Definition: TrigNavSlimmingMTAlg.h:63
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
ParticleContainer.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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
TrigNavSlimmingMTAlg::m_repackMET
Gaudi::Property< bool > m_repackMET
Definition: TrigNavSlimmingMTAlg.h:87
TrigNavSlimmingMTAlg::m_chainsFilter
Gaudi::Property< std::vector< std::string > > m_chainsFilter
Definition: TrigNavSlimmingMTAlg.h:107
TrigMissingETContainer.h
TrigNavSlimmingMTAlg::m_allOutputContainers
Gaudi::Property< std::vector< std::string > > m_allOutputContainers
Definition: TrigNavSlimmingMTAlg.h:103
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
AthReentrantAlgorithm.h
merge.output
output
Definition: merge.py:17
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
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
TrigNavSlimmingMTAlg
Consumes a set of Run 3 trigger navigation collection(s), applies slimming/thinning,...
Definition: TrigNavSlimmingMTAlg.h:34
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
SG::WriteHandle< TrigRoiDescriptorCollection >
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition: TrigComposite_v1.h:28
TrigNavSlimmingMTAlg::m_removeEmptySteps
Gaudi::Property< bool > m_removeEmptySteps
Definition: TrigNavSlimmingMTAlg.h:79
TrigNavSlimmingMTAlg::Outputs::nav
SG::WriteHandle< xAOD::TrigCompositeContainer > * nav
Definition: TrigNavSlimmingMTAlg.h:48
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
HLTIdentifier.h
NavGraph.h
TrigNavSlimmingMTAlg::initialize
virtual StatusCode initialize() override
Definition: TrigNavSlimmingMTAlg.cxx:77
ReadHandle.h
Handle class for reading from StoreGate.
TrigNavSlimmingMTAlg::propagateLinks
StatusCode propagateLinks(const TrigCompositeUtils::Decision *input, TrigCompositeUtils::Decision *output) const
Copy links (graph edges) from input to output.
Definition: TrigNavSlimmingMTAlg.cxx:386
TrigNavSlimmingMTAlg::Outputs::mets
SG::WriteHandle< xAOD::TrigMissingETContainer > * mets
Definition: TrigNavSlimmingMTAlg.h:47
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
TrigRoiDescriptorCollection.h
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
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