ATLAS Offline Software
Loading...
Searching...
No Matches
TrigNavigationThinningSvc.h
Go to the documentation of this file.
1// -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef TRIGNAVTOOLS_TRIGNAVIGATIONTHINNINGSVC_H
8#define TRIGNAVTOOLS_TRIGNAVIGATIONTHINNINGSVC_H
9
10#include "GaudiKernel/IIncidentListener.h"
15
16namespace HLT {
17 class NavigationCore;
18}
19
20
53class TrigNavigationThinningSvc : public extends<AthService, ITrigNavigationThinningSvc>
54{
55public:
56 TrigNavigationThinningSvc( const std::string& name, ISvcLocator* pSvcLocator );
57
58 virtual StatusCode initialize() override;
59 virtual StatusCode finalize() override;
60
61 virtual StatusCode doSlimming( const EventContext& /*ctx*/,
62 std::vector<uint32_t>& slimmed_and_serialized ) const override;
63
64
65private:
66 ToolHandle<Trig::TrigDecisionTool> m_trigDecisionTool;
67
68 std::vector<std::string> m_featureInclusionList;
69 std::vector<std::string> m_featureExclusionList;
70 std::set<std::string> m_featureKeepSet;
71 std::set<std::string> m_featureDropSet;
72
73 struct State
74 {
75 State (const EventContext& the_ctx,
76 HLT::NavigationCore& the_navigation,
77 std::vector<uint32_t>& the_destinationNavigation)
78 : ctx (the_ctx),
79 navigation (the_navigation),
80 destinationNavigation (the_destinationNavigation)
81 {}
82 const EventContext& ctx;
84 std::vector<uint32_t>& destinationNavigation;
85 std::vector<uint32_t> originalNavigation;
86 std::set<HLT::te_id_type> tesToProtect;
87 };
88
89 std::vector<std::string> m_actions;
90 typedef StatusCode (TrigNavigationThinningSvc::*Action)(State& state) const;
91 std::map<std::string, Action> m_actionsMap;
92 std::string m_chainsRegex;
93
94
95 bool m_report;
96
100 StatusCode lateFillConfiguration(State& state) const;
101
102
107 StatusCode drop(State& state) const;
111 StatusCode reload(State& state) const;
112
116 StatusCode restore(State& state) const;
117
121
122 StatusCode save(State& state) const;
123
124 StatusCode print(State& state) const;
128 StatusCode squeeze(State& state) const;
129
137 StatusCode dropFeatures(State& state) const;
143 StatusCode dropRoIs(State& state) const;
147 StatusCode dropEmptyRoIs(State& state) const;
151 StatusCode dropFeatureless(State& state) const;
155 StatusCode dropInactive();
156
160 StatusCode syncThinning(State& state) const;
161
165 StatusCode dropChains(State& state) const;
166
172 StatusCode removeTriggerElement(State& state,
174 bool propagateFeatures = true) const;
175
176
182
188
197 public:
199 bool operator()( const HLT::TriggerElement* te );
200
201 private:
202 unsigned int m_id;
204 };
205
211
218 StatusCode removeFeatures( State& state,
219 const std::set<std::pair<CLID, uint16_t> >& doDelete) const;
220
226 StatusCode retainFeatures(State& state,
227 const std::set<std::pair<CLID, uint16_t> >& toRetain) const;
228
234 StatusCode removeTriggerElementFromVector(HLT::TriggerElement *te, std::vector<HLT::TriggerElement*>& v) const;
235
240 bool toBeIncluded(State& state, HLT::TriggerElement *te, std::vector<std::string> *inclusionList,
241 std::vector<std::string> *exclusionList);
242 bool toBeIncluded(State& state, HLT::TriggerElement *te, std::vector<HLT::TriggerElement*> *inclusionList,
243 std::vector<HLT::TriggerElement*> *exclusionList);
244
248 StatusCode propagateFeaturesToChildren(const HLT::TriggerElement *te) const;
249
250 // store the CLID and subtype ids of all the of the deleted features so we can
251 // remove their holders from the navigation structure.
252 //std::vector<std::pair<CLID, uint16_t> > *m_deletedFeatures;
253
254 // internal functions
255 // virtual std::vector<HLT::TriggerElement*> *getTEsFromFailedChains();
256 // virtual std::vector<HLT::TriggerElement*> *getTEsFromChainGroup(const Trig::ChainGroup *cg);
257 // internal data
258};
259
260
261#endif
Define interface for doing TrigNavigation thinning.
The NavigationCore class, adds on top of the TrigNavStructure the EDM read-only handling.
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
std::vector< std::string > m_actions
StatusCode lateFillConfiguration(State &state) const
configures at the first event
StatusCode syncThinning(State &state) const
reset indexes in the after the thinning
bool toBeIncluded(State &state, HLT::TriggerElement *te, std::vector< std::string > *inclusionList, std::vector< std::string > *exclusionList)
Returns true if the TriggerElement should be included in the navigation tree and false if it should n...
StatusCode save(State &state) const
Save the result of the slimming in the doSlimming argument (vector<uint32_t>)
StatusCode drop(State &state) const
clear the result of the slimming in the doSliming argument (vector<uint32_t>) Makes no sense to combi...
virtual StatusCode finalize() override
StatusCode removeTriggerElement(State &state, HLT::TriggerElement *te, bool propagateFeatures=true) const
Removes the passed trigger element from the navigation structure by removing all references to it in ...
std::map< std::string, Action > m_actionsMap
StatusCode removeFeaturelessTriggerElements(State &state, HLT::TriggerElement *te=0)
Removes all trigger elements with no features from the navigation structure.
StatusCode dropInactive()
Removes TEs which are inactive (rejected by hypothesis)
StatusCode dropRoIs(State &state) const
Removes RoI nodes, rather aggressive option, should be use as one of last actions as it makes impossi...
StatusCode dropChains(State &state) const
remove info not related to the specified chains
StatusCode removeFeatures(State &state, const std::set< std::pair< CLID, uint16_t > > &doDelete) const
This is a helper function for removeFeatures(HLT::NavigationCore*, ...).
std::vector< std::string > m_featureInclusionList
StatusCode dropFeatures(State &state) const
Removes references to features from the navigation structure.
virtual StatusCode doSlimming(const EventContext &, std::vector< uint32_t > &slimmed_and_serialized) const override
StatusCode retainFeatures(State &state, const std::set< std::pair< CLID, uint16_t > > &toRetain) const
This is a helper function for removeFeatures(HLT::NavigationCore*, ...).
virtual StatusCode initialize() override
StatusCode reload(State &state) const
Reload the slimmed navigation in TDT so that all clients of current job see the chage.
std::set< std::string > m_featureKeepSet
computed from above
StatusCode squeeze(State &state) const
Remove intermediate TEs leaving very flat structure with event node, rois and terminals.
StatusCode dropFeatureless(State &state) const
Removes TEs which have no features (combine wiht squeeze)
StatusCode print(State &state) const
StatusCode removeTriggerElementFromVector(HLT::TriggerElement *te, std::vector< HLT::TriggerElement * > &v) const
Removes all instances of the supplied TriggerElement from the supplied vector.
StatusCode propagateFeaturesToChildren(const HLT::TriggerElement *te) const
Propagates the features on given TE to its children.
bool m_report
TE operations verbosity flag.
StatusCode(TrigNavigationThinningSvc::* Action)(State &state) const
StatusCode dropEmptyRoIs(State &state) const
Removes RoI nodes, which do not seed anything.
std::vector< std::string > m_featureExclusionList
StatusCode removeGhostTriggerElements(HLT::TriggerElement *te=0)
Removes all trigger elements with the flag ghost set to true from the navigation structure.
ToolHandle< Trig::TrigDecisionTool > m_trigDecisionTool
StatusCode recursivelyRemoveNodesFromNavigation(HLT::TriggerElement *te)
Removes the passed te and all children from the navigation structure.
std::set< std::string > m_featureDropSet
computed from above
TrigNavigationThinningSvc(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode restore(State &state) const
Restore the original navigation structure.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
std::vector< uint32_t > & destinationNavigation
State(const EventContext &the_ctx, HLT::NavigationCore &the_navigation, std::vector< uint32_t > &the_destinationNavigation)
std::set< HLT::te_id_type > tesToProtect