ATLAS Offline Software
Loading...
Searching...
No Matches
EventViewCreatorAlgorithm.h
Go to the documentation of this file.
1/*
2 General-purpose view creation algorithm <bwynne@cern.ch>
3
4 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef ViewAlgs_EventViewCreatorAlgorithm_h
8#define ViewAlgs_EventViewCreatorAlgorithm_h
9
10#include <vector>
11#include <string>
12
17
19
20#include "GaudiKernel/IAlgResourcePool.h"
21#include "GaudiKernel/IScheduler.h"
22#include "AthViews/View.h"
23
25
26// Muon specifics
30
31// Jet specifics
34
42
43
45{
46 public:
47 EventViewCreatorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
49 virtual StatusCode initialize() override;
50 virtual StatusCode execute(const EventContext&) const override;
51 virtual StatusCode finalize() override { return StatusCode::SUCCESS; }
52 protected:
53
55
56 SG::WriteHandleKey< ViewContainer > m_viewsKey{ this, "Views", "Unspecified",
57 "The key of views collection produced" };
58
60 "Name of the collection which should be inserted into the just-spawned views to seed them with their ROI" };
61
62 // needs for views
63 Gaudi::Property< std::string > m_schedulerName { this, "SchedulerName", "AvalancheSchedulerSvc", "Name of the scheduler" };
64 Gaudi::Property< std::string > m_viewNodeName{ this, "ViewNodeName", "", "Name of the ControlFlow node to attach new views to" };
65
66 Gaudi::Property< bool > m_viewFallThrough { this, "ViewFallThrough", false,
67 "Set whether views may access StoreGate directly to retrieve data" };
68 Gaudi::Property< std::vector< std::string > > m_viewFallFilter { this, "FallThroughFilter", {},
69 "An optional list of SG keys (or parts of them) that can come from StoreGate via FallThrough" };
70
71 Gaudi::Property< bool > m_requireParentView { this, "RequireParentView", false,
72 "For each new view, locate and link any parent views (previous step). Fail if no parent view can not be found." };
73
74 Gaudi::Property< bool > m_reverseViews { this, "ReverseViewsDebug", false,
75 "Reverse order of views, as a debugging option" };
76
78 "Optional ReadHandle on the output (InputMakerOutputDecisions) of an EVCA in a previous Step, whose Views can be re-used. Not currently used." };
79
80 ToolHandle<IViewCreatorROITool> m_roiTool{this, "RoITool", "",
81 "Tool used to supply per-Decision Object the RoI on which the Decision Object's view is to be spawned"};
82
85 Gaudi::Property< bool > m_placeMuonInView { this, "PlaceMuonInView", false,
86 "Muon slice specific option. Place Muon and MuonCandidate inside newly spawned View instance. See also InViewMuons, InViewMuonCandidates" };
87
88 // TODO - phase this out by reading the muon from the parent View. Remove any ambiguity.
90 "Name with which the Muon should be inserted into the views"};
91
93 "Name with which the Muon Candidate should be inserted into the views"};
94
99 StatusCode placeMuonInView( const xAOD::Muon* theObject, SG::View* view, const EventContext& context ) const;
101
104 Gaudi::Property< bool > m_placeJetInView { this, "PlaceJetInView", false,
105 "Jet slice specific option. Place Jet inside newly spawned View instance. See also InViewJets" };
106
107 //switch off the use of cached EventViews
108 Gaudi::Property< bool > m_cacheDisabled { this, "CacheDisabled", false,
109 "Set whether cached EventViews are to be accessed" };
110
111 // TODO. In the next iteration, start to use this. Remove "_PROPERTY" which is there to catch against algs with identical properties
113 "Name with which the Jet should be inserted into the views"};
114
118 StatusCode placeJetInView( const xAOD::Jet* theObject, SG::View* view, const EventContext& context ) const;
120
124 StatusCode linkViewToParent( const TrigCompositeUtils::Decision* outputDecision, SG::View* newView ) const;
125
129 StatusCode placeRoIInView( const ElementLink<TrigRoiDescriptorCollection>& roi, SG::View* view, const EventContext& context ) const;
130
134 SmartIF<IScheduler> getScheduler() const;
135
140 bool checkCache(const TrigCompositeUtils::DecisionContainer* cachedViews,
141 const TrigCompositeUtils::Decision* outputDecision,
142 size_t& cachedIndex,
143 MatchingCache& matchingCache) const;
144
150 StatusCode populateMatchingCacheWithCachedViews(const TrigCompositeUtils::DecisionContainer* cachedViews, MatchingCache& matchingCache) const;
151
152 private:
153
157 std::vector<TrigCompositeUtils::LinkInfo<ViewContainer>> viewsToLink(const TrigCompositeUtils::Decision* outputDecision) const;
158
159};
160
162
163#endif
164
DataVector adapter that acts like it holds const pointers.
SG::WriteHandleKey< xAOD::MuonContainer > m_inViewMuons
Gaudi::Property< bool > m_placeJetInView
StatusCode linkViewToParent(const TrigCompositeUtils::Decision *outputDecision, SG::View *newView) const
Makes sure the views are linked, if configuration requireParentView is set.
Gaudi::Property< bool > m_placeMuonInView
std::vector< TrigCompositeUtils::LinkInfo< ViewContainer > > viewsToLink(const TrigCompositeUtils::Decision *outputDecision) const
Obtain view(s) from most recent prior step(s) which are to be wired up.
Gaudi::Property< std::vector< std::string > > m_viewFallFilter
StatusCode placeRoIInView(const ElementLink< TrigRoiDescriptorCollection > &roi, SG::View *view, const EventContext &context) const
Seeds a newly created view with an ROI collection containing the single seeding ROI.
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_cachedViewsKey
SG::WriteHandleKey< ConstDataVector< TrigRoiDescriptorCollection > > m_inViewRoIs
Gaudi::Property< bool > m_requireParentView
virtual StatusCode initialize() override
Gaudi::Property< std::string > m_schedulerName
StatusCode placeJetInView(const xAOD::Jet *theObject, SG::View *view, const EventContext &context) const
Creates a SG::VIEW_ELEMENTS collection inside a newly created View populated by the jet used to seed ...
virtual StatusCode execute(const EventContext &) const override
SG::WriteHandleKey< ViewContainer > m_viewsKey
bool checkCache(const TrigCompositeUtils::DecisionContainer *cachedViews, const TrigCompositeUtils::Decision *outputDecision, size_t &cachedIndex, MatchingCache &matchingCache) const
Allow for the re-use of EventViews run in a previous Step in another EVCA instance configured to spaw...
SG::WriteHandleKey< ConstDataVector< MuonCandidateCollection > > m_inViewMuonCandidates
Gaudi::Property< bool > m_reverseViews
EventViewCreatorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< bool > m_cacheDisabled
virtual StatusCode finalize() override
Gaudi::Property< bool > m_viewFallThrough
ToolHandle< IViewCreatorROITool > m_roiTool
SG::WriteHandleKey< xAOD::JetContainer > m_inViewJets
StatusCode placeMuonInView(const xAOD::Muon *theObject, SG::View *view, const EventContext &context) const
Creates a SG::VIEW_ELEMENTS collection inside a newly created View populated by the MuonCombined::Muo...
SmartIF< IScheduler > getScheduler() const
Obtain smart pointer to scheduler in order to schedule newly spawned views.
Gaudi::Property< std::string > m_viewNodeName
StatusCode populateMatchingCacheWithCachedViews(const TrigCompositeUtils::DecisionContainer *cachedViews, MatchingCache &matchingCache) const
We look for matching Decision Objects in a matchingCache.
InputMakerBase(const std::string &name, ISvcLocator *pSvcLocator)
constructor, to be called by sub-class constructors
Property holding a SG store/key/clid from which a ReadHandle is made.
A "view" of the event store (IProxyDict).
Definition View.h:46
Property holding a SG store/key/clid from which a WriteHandle is made.
Jet_v1 Jet
Definition of the current "jet version".
Muon_v1 Muon
Reference the current persistent version:
Used to cache each incoming Decision object's ElementLink which is being used to identify the Decisio...