ATLAS Offline Software
EventViewCreatorAlgorithm.cxx
Go to the documentation of this file.
1 /*
2  General-purpose view creation algorithm <bwynne@cern.ch>
3 
4  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5 */
6 
8 #include "AthLinks/ElementLink.h"
9 #include "AthViews/ViewHelper.h"
10 #include "AthViews/View.h"
12 
13 #include <sstream>
14 
15 using namespace TrigCompositeUtils;
16 
17 EventViewCreatorAlgorithm::EventViewCreatorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
18 : InputMakerBase( name, pSvcLocator ) {}
19 
21 
23  ATH_MSG_DEBUG("Will produce views=" << m_viewsKey << " roIs=" << m_inViewRoIs );
26  ATH_CHECK( m_roiTool.retrieve() );
28  if (not m_cachedViewsKey.empty()) {
29  renounce(m_cachedViewsKey); // Reading in and using cached inputs is optional, not guarenteed to be produced in every event.
30  }
31 
32  if (m_isEmptyStep) {
33  ATH_MSG_ERROR("The EventViewCreatorAlgorithm class cannot be used as the InputMaker for an empty step.");
34  return StatusCode::FAILURE;
35  }
36 
37  // Muon slice code
40 
41  // Jet slice code
43 
44  return StatusCode::SUCCESS;
45 }
46 
47 
48 StatusCode EventViewCreatorAlgorithm::execute( const EventContext& context ) const {
49 
50  // create the output decisions from the input collections
51  ATH_MSG_DEBUG("Starting to merge " << decisionInputs().size() << " inputs to the " << decisionOutputs().key() << " output.");
53  ATH_CHECK(outputHandle.isValid());
54  ATH_CHECK(decisionInputToOutput(context, outputHandle));
55  ATH_MSG_DEBUG("Merging complete");
56 
57  // make the views
58  auto viewsHandle = SG::makeHandle( m_viewsKey, context );
59  ATH_CHECK( viewsHandle.record( std::make_unique<ViewContainer>() ) );
60  auto viewVector = viewsHandle.ptr();
61 
62  // Check for an optional input handle to use as a source of cached, already-executed, views.
63  const DecisionContainer* cachedViews = nullptr;
64  MatchingCache matchingCache; // Used to remember temporarily which hash is associated with each DecisionObject when performing maching in a PROBE IM to TAG IM DecisionObjects
65  if (!m_cachedViewsKey.empty()) {
67  // Even if the handle is configured, this precursor EventViewCreatorAlg may not have executed in a given event
68  if (cachedRH.isValid()) {
69  cachedViews = cachedRH.ptr();
70  ATH_CHECK(populateMatchingCacheWithCachedViews(cachedViews, matchingCache, context));
71  }
72  }
73 
74  // Keep track of the ROIs we spawn a View for, do not spawn duplicates.
75  // For many cases, this will be covered by the Merging operation preceding this.
76  std::vector<ElementLink<TrigRoiDescriptorCollection>> RoIsFromDecision;
77 
78  if( outputHandle->size() == 0) {
79  ATH_MSG_DEBUG( "Have no decisions in output handle "<< outputHandle.key() << ". Handle is valid but container is empty. "
80  << "This can happen if a ROI-based HLT chain leg was activated in a chain whose L1 item which does not explicitly require the ROI.");
81  } else {
82  ATH_MSG_DEBUG( "Have output " << outputHandle.key() << " with " << outputHandle->size() << " elements" );
83  }
84 
85  // Find and link to the output Decision objects the ROIs to run over
86  ATH_CHECK( m_roiTool->attachROILinks(*outputHandle, context) );
87 
88  for ( Decision* outputDecision : *outputHandle ) {
89 
90  if (!outputDecision->hasObjectLink(roiString(), ClassID_traits<TrigRoiDescriptorCollection>::ID())) {
91  ATH_MSG_ERROR("No '" << roiString() << "'link was attached by the ROITool. Decision object dump:" << *outputDecision);
92  return StatusCode::FAILURE;
93  }
94  const ElementLink<TrigRoiDescriptorCollection> roiEL = outputDecision->objectLink<TrigRoiDescriptorCollection>(roiString());
95  ATH_CHECK(roiEL.isValid());
96 
97  // We do one of three things here, either...
98  // a) We realise that an identically configured past EVCA has already run a View on an equivalent ROI. If so we can re-use this.
99  // b) We encounter a new ROI and hence need to spawn a new view.
100  // c) We encounter a ROI that we have already seen in looping over this outputHandle, we can re-use a view.
101 
102  // cachedIndex and useCached are to do with a)
103  size_t cachedIndex = std::numeric_limits<std::size_t>::max();
104  const bool useCached = checkCache(cachedViews, outputDecision, cachedIndex, matchingCache, context);
105 
106  // roiIt is to do with b) and c)
107  auto roiIt = find(RoIsFromDecision.begin(), RoIsFromDecision.end(), roiEL);
108 
109  if (useCached) {
110 
111  // Re-use an already processed view from a previously executed EVCA instance
112  const Decision* cached = cachedViews->at(cachedIndex);
113  ElementLink<ViewContainer> cachedViewEL = cached->objectLink<ViewContainer>(viewString());
115  ATH_CHECK(cachedViewEL.isValid());
116  ATH_CHECK(cachedROIEL.isValid());
117  ATH_MSG_DEBUG("Re-using cached existing view from " << cachedViewEL.dataID() << ", index:" << cachedViewEL.index() << " on ROI " << **cachedROIEL);
118  outputDecision->setObjectLink( viewString(), cachedViewEL );
119  outputDecision->setObjectLink( roiString(), cachedROIEL );
120  // Note: This overwrites the link created in the above tool with what should be a spatially identical ROI (check?)
121 
122  } else if ( roiIt == RoIsFromDecision.end() ) {
123 
124  // We have not yet spawned an ROI on this View. Do it now.
125  RoIsFromDecision.push_back(roiEL);
126  ATH_MSG_DEBUG("Found RoI:" << **roiEL << " FS=" << (*roiEL)->isFullscan() << ". Making View.");
127  SG::View* newView = ViewHelper::makeView( name()+"_view", viewVector->size() /*view counter*/, m_viewFallThrough );
128  viewVector->push_back( newView );
129  // Use a fall-through filter if one is provided
130  if ( m_viewFallFilter.size() ) {
131  newView->setFilter( m_viewFallFilter );
132  }
133  // Set parent view, if required. Note: Must be called before we link the new view to outputDecision.
134  ATH_CHECK(linkViewToParent(outputDecision, newView));
135  // Add the single ROI into the view to seed it.
136  ATH_CHECK(placeRoIInView(roiEL, viewVector->back(), context));
137  // Special muon case - following from a FullScan view, seed each new View with its MuonCombined::MuonCandidate
138  if (m_placeMuonInView) {
139  std::vector<LinkInfo<xAOD::MuonContainer>> muonELInfo = findLinks<xAOD::MuonContainer>(outputDecision, featureString(), TrigDefs::lastFeatureOfType);
140  ATH_CHECK( muonELInfo.size() == 1 );
141  ATH_CHECK( muonELInfo.at(0).isValid() );
142  ATH_CHECK( placeMuonInView( *(muonELInfo.at(0).link), viewVector->back(), context ) );
143  }
144  // Special jet case - following from a FullScan view, seed each new View with its xAOD::Jet
145  if (m_placeJetInView) {
146  std::vector<LinkInfo<xAOD::JetContainer>> jetELInfo = findLinks<xAOD::JetContainer>(outputDecision, featureString(), TrigDefs::lastFeatureOfType);
147  ATH_CHECK( jetELInfo.size() == 1 );
148  ATH_CHECK( jetELInfo.at(0).isValid() );
149  ATH_CHECK( placeJetInView( *(jetELInfo.at(0).link), viewVector->back(), context ) );
150  }
151  // Link the view to the Decision object
152  outputDecision->setObjectLink( viewString(), ElementLink<ViewContainer>(m_viewsKey.key(), viewVector->size()-1 ));
153  ATH_MSG_DEBUG( "Made new View, storing view in viewVector " << m_viewsKey.key() << " index:" << viewVector->size()-1 );
154 
155  } else {
156 
157  // We have already spawned a ROI in this View. Link it here too.
158  const size_t existingIndex = std::distance(RoIsFromDecision.begin(), roiIt);
159  ATH_MSG_DEBUG("Found existing View, stored in view in viewVector " << m_viewsKey.key() << " index:" << existingIndex );
160  outputDecision->setObjectLink( viewString(), ElementLink<ViewContainer>(m_viewsKey.key(), existingIndex )); //adding View link to Decision
161 
162  }
163  } // loop over output decisions
164 
165  // launch view execution
166  ATH_MSG_DEBUG( "Launching execution in " << viewVector->size() << " unique views" );
167  ATH_CHECK( ViewHelper::scheduleViews( viewVector, // Vector containing views
168  m_viewNodeName, // CF node to attach views to
169  context, // Source context
170  getScheduler(), // Scheduler to launch with
171  m_reverseViews ) ); // Debug option
172 
173  return StatusCode::SUCCESS;
174 }
175 
176 bool endsWith(const std::string& value, const std::string& ending) {
177  if (ending.size() > value.size()) {
178  return false;
179  }
180  return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
181 }
182 
183 std::vector<LinkInfo<ViewContainer>> EventViewCreatorAlgorithm::viewsToLink(const Decision* outputDecision) const {
184  return findLinks<ViewContainer>(outputDecision, viewString(), TrigDefs::lastFeatureOfType);
185 }
186 
187 bool EventViewCreatorAlgorithm::checkCache(const DecisionContainer* cachedViews, const Decision* outputDecision, size_t& cachedIndex, MatchingCache& matchingCache, const EventContext& context) const {
188  if (cachedViews == nullptr or m_cacheDisabled) {
189  return false; // No cached input configured, which is fine.
190  }
191 
192  // If we ever stop using cached views mid-processing of a chain, then it is by far safer to continue to not use cached views in all following steps. See for example towards the end of ATR-25996
193  // We can tell this by querying for View instances in previous steps and looking for evidence of the instance being cached (no "_probe" postfix, from initiall "tag" pass)
194  // or not cached (with "_probe" postfix, from second "probe" pass)
195  std::vector<LinkInfo<ViewContainer>> previousStepViews = findLinks<ViewContainer>(outputDecision, viewString(), TrigDefs::allFeaturesOfType);
196  // If this collection is empty then we're the 1st step, so OK to look for a cached EventView to re-use. Otherwise...
197  if (previousStepViews.size()) {
198  // If there are one or more prior steps, we want to focus on the most recent which will be the first entry in the vector
199  ElementLink<ViewContainer> previousView = previousStepViews.at(0).link;
200  const bool previousStepDidNotUsedCachedView = endsWith(previousView.dataID(), "_probe");
201  if (previousStepDidNotUsedCachedView) {
202  // If we are not the 1st step, and the previous step did not use a cached view, then we are safer here to not use one either. Don't search for one. Just say no to caching here.
203  ATH_MSG_DEBUG("Previous probe step used a probe EventView for this decision object. Do not attempt to use a cached EventView in this step.");
204  return false;
205  }
206  }
207 
208  bool usedROIMatchingFlag{false}; // Sanity check
209  bool result = matchInCollection(cachedViews, outputDecision, cachedIndex, usedROIMatchingFlag, matchingCache, context);
210  if (usedROIMatchingFlag and m_mergeUsingFeature) {
211  ATH_MSG_ERROR("Called matchInCollection in an EVCA configured with mergeUsingFeature=True, however ROI matching was used instead?! Should not be possible.");
212  }
213 
214  if (result) {
215  // We have another check we have to make before we are confident that we can re-use this View
216  // The view will have originally be launched linked to N proxies (N>=0), which are the previous Steps which the View
217  // needs to link to (in which one might need to later search for physics collections needed in this or later Steps).
218  //
219  // But the list of proxies in the probe pass might be different than what it was in the tag pass.
220  // We cannot change the list of proxies in the existing tag EventView (it is now immutable)
221  //
222  // So if we are missing required proxies then we cannot re-use this EventView and have to reject the cached EV.
223  const SG::View* view = *(cachedViews->at(cachedIndex)->objectLink<ViewContainer>(viewString()));
224 
225  // What prior views would we have linked if we were spawning a new View here in probe?
226  std::vector<LinkInfo<ViewContainer>> viewsToLinkVector = viewsToLink(outputDecision);
227  for (const LinkInfo<ViewContainer>& toLinkLI : viewsToLinkVector) {
228  const SG::View* toLink = *(toLinkLI.link);
229  // Was toLink linked as a proxy back in the tag stage?
230  bool foundIt = false;
231  for (const SG::View* prevLinked : view->getParentLinks()) {
232  if (prevLinked == toLink) {
233  foundIt = true;
234  break;
235  }
236  }
237  if (!foundIt) {
238  ATH_MSG_DEBUG("The cached view from the tag step is not linked to the required views from earlier steps which we need in the probe processing, we cannot re-use it.");
239  result = false;
240  break;
241  }
242  }
243  }
244 
245  return result;
246 }
247 
248 StatusCode EventViewCreatorAlgorithm::populateMatchingCacheWithCachedViews(const DecisionContainer* cachedViews, MatchingCache& matchingCache, const EventContext& context) const {
249  const std::string linkNameToMatch = m_mergeUsingFeature ? featureString() : m_roisLink.value();
250  for (const Decision* cachedView : *cachedViews) {
251  const uint64_t matchingHash = getMatchingHashForDecision(cachedView, linkNameToMatch, context);
252  if (matchingHash == std::numeric_limits<std::size_t>::max()) {
253  return StatusCode::FAILURE;
254  }
255  matchingCache.setMatchingHash(cachedView, matchingHash);
256  // There is no output-to-input redirection required when we're matching against the old TAG collection in the PROBE EVCA, so we can set key=value in this redirection map
257  matchingCache.linkOutputToInput(cachedView, cachedView);
258  }
259  return StatusCode::SUCCESS;
260 }
261 
262 
264  if (!m_requireParentView) {
265  ATH_MSG_DEBUG("Parent view linking not required");
266  return StatusCode::SUCCESS;
267  }
268  // We must call this BEFORE having added the new link, check
269  if (outputDecision->hasObjectLink(viewString())) {
270  ATH_MSG_ERROR("Called linkViewToParent on a Decision object which already has been given a '"
271  << viewString() << "' link. Call this fn BEFORE linking the new View.");
272  return StatusCode::FAILURE;
273  }
274  std::vector<LinkInfo<ViewContainer>> viewsToLinkVector = viewsToLink(outputDecision);
275  if (viewsToLinkVector.size() == 0) {
276  ATH_MSG_ERROR("Could not find the parent View, but 'RequireParentView' is true.");
277  return StatusCode::FAILURE;
278  }
279  // Note: Some Physics Objects will have diverging reco paths, but later re-combine.
280  // Examples include an ROI processed as both Electron and Photon re-combining for PrecisionCalo.
281  // Or, a tau ROI processed with different algorithms for different chains in an earlier Step.
282  // This will only cause a problem if downstream a collection is requested which was produced in more that one
283  // of the linked parent Views (or their parents...) as it is then ambiguous which collection should be read.
284  ATH_MSG_DEBUG( "Will link " << viewsToLinkVector.size() << " parent view(s)" );
285  for (const LinkInfo<ViewContainer>& toLinkLI : viewsToLinkVector) {
286  ATH_CHECK(toLinkLI.isValid());
287  newView->linkParent( *(toLinkLI.link) );
288  ATH_MSG_DEBUG( "Parent view linked (" << toLinkLI.link.dataID() << ", index:" << toLinkLI.link.index() << ")" );
289  }
290 
291  return StatusCode::SUCCESS;
292 }
293 
295  // fill the RoI output collection
296  auto oneRoIColl = std::make_unique< ConstDataVector<TrigRoiDescriptorCollection> >();
297  oneRoIColl->clear( SG::VIEW_ELEMENTS ); //Don't delete the RoIs
298  oneRoIColl->push_back( *roiEL );
299 
300  view->setROI(roiEL);
301 
302  //store the RoI in the view
303  auto handle = SG::makeHandle( m_inViewRoIs, context );
304  ATH_CHECK( handle.setProxyDict( view ) );
305  ATH_CHECK( handle.record( std::move( oneRoIColl ) ) );
306  return StatusCode::SUCCESS;
307 }
308 
309 
310 StatusCode EventViewCreatorAlgorithm::placeMuonInView( const xAOD::Muon* theObject, SG::View* view, const EventContext& context ) const {
311  // fill the Muon output collection
312  ATH_MSG_DEBUG( "Adding Muon To View : " << m_inViewMuons.key()<<" and "<<m_inViewMuonCandidates.key() );
313  auto oneObjectCollection = std::make_unique< xAOD::MuonContainer >();
314  auto oneObjectAuxCollection = std::make_unique< xAOD::MuonAuxContainer >();
315  oneObjectCollection->setStore( oneObjectAuxCollection.get() );
316 
317  xAOD::Muon* copiedMuon = new xAOD::Muon();
318  oneObjectCollection->push_back( copiedMuon );
319  *copiedMuon = *theObject;
320 
321  auto muonCandidate = std::make_unique< ConstDataVector< MuonCandidateCollection > >();
322  auto msLink = theObject->muonSpectrometerTrackParticleLink();
323  auto extTrackLink = theObject->extrapolatedMuonSpectrometerTrackParticleLink();
324  if(msLink.isValid() && extTrackLink.isValid()) muonCandidate->push_back( new MuonCombined::MuonCandidate(msLink, (*extTrackLink)->trackLink(), (*extTrackLink)->index()) );
325 
326  //store both in the view
327  auto handleMuon = SG::makeHandle( m_inViewMuons,context );
328  ATH_CHECK( handleMuon.setProxyDict( view ) );
329  ATH_CHECK( handleMuon.record( std::move( oneObjectCollection ), std::move( oneObjectAuxCollection )) );
330 
331  auto handleCandidate = SG::makeHandle( m_inViewMuonCandidates,context );
332  ATH_CHECK( handleCandidate.setProxyDict( view ) );
333  ATH_CHECK( handleCandidate.record( std::move( muonCandidate ) ) );
334 
335  return StatusCode::SUCCESS;
336 }
337 
338 // TODO - Template this?
339 StatusCode EventViewCreatorAlgorithm::placeJetInView( const xAOD::Jet* theObject, SG::View* view, const EventContext& context ) const {
340 
341  // fill the Jet output collection
342  ATH_MSG_DEBUG( "Adding Jet To View : " << m_inViewJets.key() );
343 
344  auto oneObjectCollection = std::make_unique< xAOD::JetContainer >();
345  auto oneObjectAuxCollection = std::make_unique< xAOD::JetAuxContainer >();
346  oneObjectCollection->setStore( oneObjectAuxCollection.get() );
347 
348  xAOD::Jet* copiedJet = new xAOD::Jet();
349  oneObjectCollection->push_back( copiedJet );
350  *copiedJet = *theObject;
351 
352  auto handle = SG::makeHandle( m_inViewJets,context );
353  ATH_CHECK( handle.setProxyDict( view ) );
354  ATH_CHECK( handle.record( std::move(oneObjectCollection),std::move(oneObjectAuxCollection) ) );
355 
356  return StatusCode::SUCCESS;
357 }
EventViewCreatorAlgorithm::m_inViewMuonCandidates
SG::WriteHandleKey< ConstDataVector< MuonCandidateCollection > > m_inViewMuonCandidates
Definition: EventViewCreatorAlgorithm.h:92
InputMakerBase::matchInCollection
bool matchInCollection(const TrigCompositeUtils::DecisionContainer *outDecisions, const TrigCompositeUtils::Decision *toMatch, size_t &matchIndex, bool &usedROIMatchingFlag, MatchingCache &matchingCache, const EventContext &ctx) const
Wrapper around matchDecision. Returns boolean if the match was successful.
Definition: InputMakerBase.cxx:120
EventViewCreatorAlgorithm::m_requireParentView
Gaudi::Property< bool > m_requireParentView
Definition: EventViewCreatorAlgorithm.h:71
InputMakerBase::m_mergeUsingFeature
Gaudi::Property< bool > m_mergeUsingFeature
Definition: InputMakerBase.h:53
EventViewCreatorAlgorithm::populateMatchingCacheWithCachedViews
StatusCode populateMatchingCacheWithCachedViews(const TrigCompositeUtils::DecisionContainer *cachedViews, MatchingCache &matchingCache, const EventContext &context) const
We look for matching Decision Objects in a matchingCache.
Definition: EventViewCreatorAlgorithm.cxx:248
InputMakerBase::decisionInputToOutput
StatusCode decisionInputToOutput(const EventContext &context, SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle) const
does the standard handling of input decisions: read from handles with all the checks,...
Definition: InputMakerBase.cxx:43
get_generator_info.result
result
Definition: get_generator_info.py:21
max
#define max(a, b)
Definition: cfImp.cxx:41
EventViewCreatorAlgorithm::m_viewFallFilter
Gaudi::Property< std::vector< std::string > > m_viewFallFilter
Definition: EventViewCreatorAlgorithm.h:68
EventViewCreatorAlgorithm::~EventViewCreatorAlgorithm
virtual ~EventViewCreatorAlgorithm()
Definition: EventViewCreatorAlgorithm.cxx:20
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
TrigCompositeUtils.h
EventViewCreatorAlgorithm::linkViewToParent
StatusCode linkViewToParent(const TrigCompositeUtils::Decision *outputDecision, SG::View *newView) const
Makes sure the views are linked, if configuration requireParentView is set.
Definition: EventViewCreatorAlgorithm.cxx:263
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
EventViewCreatorAlgorithm.h
EventViewCreatorAlgorithm::m_cachedViewsKey
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_cachedViewsKey
Definition: EventViewCreatorAlgorithm.h:77
EventViewCreatorAlgorithm::getScheduler
SmartIF< IScheduler > getScheduler() const
Obtain smart pointer to scheduler in order to schedule newly spawned views.
InputMakerBase
Input Makers are used at the start of a sequence: retrieve filtered collection via the input decision...
Definition: InputMakerBase.h:20
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
Definition: AthCommonDataStore.h:380
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:226
athena.value
value
Definition: athena.py:122
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
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
InputMakerBase::decisionInputs
const SG::ReadHandleKeyArray< TrigCompositeUtils::DecisionContainer > & decisionInputs() const
methods for derived classes to access handles of the base class input and output decisions; other rea...
Definition: InputMakerBase.cxx:17
EventViewCreatorAlgorithm::placeMuonInView
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...
Definition: EventViewCreatorAlgorithm.cxx:310
ViewHelper.h
EventViewCreatorAlgorithm::m_inViewJets
SG::WriteHandleKey< xAOD::JetContainer > m_inViewJets
Definition: EventViewCreatorAlgorithm.h:112
endsWith
bool endsWith(const std::string &value, const std::string &ending)
Definition: EventViewCreatorAlgorithm.cxx:176
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
EventViewCreatorAlgorithm::m_reverseViews
Gaudi::Property< bool > m_reverseViews
Definition: EventViewCreatorAlgorithm.h:74
CxxUtils::fpcompare::equal
bool equal(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition: fpcompare.h:114
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
SG::View::linkParent
void linkParent(const IProxyDict *parent)
Definition: View.h:66
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
EventViewCreatorAlgorithm::m_roiTool
ToolHandle< IViewCreatorROITool > m_roiTool
Definition: EventViewCreatorAlgorithm.h:80
EventViewCreatorAlgorithm::m_inViewMuons
SG::WriteHandleKey< xAOD::MuonContainer > m_inViewMuons
Definition: EventViewCreatorAlgorithm.h:89
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonCombined::MuonCandidate
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/MuonCombinedEvent/MuonCandidate.h:25
EventViewCreatorAlgorithm::m_inViewRoIs
SG::WriteHandleKey< ConstDataVector< TrigRoiDescriptorCollection > > m_inViewRoIs
Definition: EventViewCreatorAlgorithm.h:59
ViewHelper::makeView
SG::View * makeView(const std::string &common_name, int const unique_index=-1, bool const allowFallThrough=true)
Definition: ViewHelper.h:241
EventViewCreatorAlgorithm::initialize
virtual StatusCode initialize() override
Definition: EventViewCreatorAlgorithm.cxx:22
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
EventViewCreatorAlgorithm::execute
virtual StatusCode execute(const EventContext &) const override
Definition: EventViewCreatorAlgorithm.cxx:48
InputMakerBase::MatchingCache::linkOutputToInput
void linkOutputToInput(const TrigCompositeUtils::Decision *outputDecision, const TrigCompositeUtils::Decision *inputDecision)
Definition: InputMakerBase.cxx:235
ViewHelper::scheduleViews
StatusCode scheduleViews(ViewContainer *viewVector, std::string const &nodeName, EventContext const &sourceContext, SmartIF< IScheduler > scheduler, bool reverseOrder=false)
Definition: ViewHelper.h:84
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
xAOD::Muon_v1::muonSpectrometerTrackParticleLink
const ElementLink< TrackParticleContainer > & muonSpectrometerTrackParticleLink() const
Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
EventViewCreatorAlgorithm::m_viewFallThrough
Gaudi::Property< bool > m_viewFallThrough
Definition: EventViewCreatorAlgorithm.h:66
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
EventViewCreatorAlgorithm::viewsToLink
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.
Definition: EventViewCreatorAlgorithm.cxx:183
EventViewCreatorAlgorithm::m_viewsKey
SG::WriteHandleKey< ViewContainer > m_viewsKey
Definition: EventViewCreatorAlgorithm.h:56
SG::View::setFilter
void setFilter(std::vector< std::string > const &inputFilter)
Definition: View.h:74
EventViewCreatorAlgorithm::m_viewNodeName
Gaudi::Property< std::string > m_viewNodeName
Definition: EventViewCreatorAlgorithm.h:64
EventViewCreatorAlgorithm::EventViewCreatorAlgorithm
EventViewCreatorAlgorithm()
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
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
InputMakerBase::m_roisLink
StringProperty m_roisLink
Definition: InputMakerBase.h:50
TrigCompositeUtils::featureString
const std::string & featureString()
Definition: TrigCompositeUtilsRoot.cxx:886
EventViewCreatorAlgorithm::m_cacheDisabled
Gaudi::Property< bool > m_cacheDisabled
Definition: EventViewCreatorAlgorithm.h:108
SG::WriteHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::Muon
Muon_v1 Muon
Reference the current persistent version:
Definition: Event/xAOD/xAODMuon/xAODMuon/Muon.h:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
InputMakerBase::decisionOutputs
const SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > & decisionOutputs() const
methods for derived classes to access handles of the base class input and output decisions; other rea...
Definition: InputMakerBase.cxx:21
python.decorators.cached.cached
def cached(func)
Decorator to cache function return value.
Definition: cached.py:6
InputMakerBase::getMatchingHashForDecision
uint64_t getMatchingHashForDecision(const TrigCompositeUtils::Decision *toMatch, const std::string &linkNameToMatch, const EventContext &ctx) const
Searches from toMatch to locate a single (type-less) Element Link with given edge name....
Definition: InputMakerBase.cxx:162
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
SG::ReadHandle::ptr
const_pointer_type ptr()
Dereference the pointer.
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
EventViewCreatorAlgorithm::placeJetInView
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 ...
Definition: EventViewCreatorAlgorithm.cxx:339
TrigCompositeUtils::LinkInfo
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
Definition: LinkInfo.h:28
EventViewCreatorAlgorithm::m_placeMuonInView
Gaudi::Property< bool > m_placeMuonInView
Definition: EventViewCreatorAlgorithm.h:85
InputMakerBase::m_isEmptyStep
Gaudi::Property< bool > m_isEmptyStep
Definition: InputMakerBase.h:56
TrigRoiDescriptorCollection
Definition: TrigRoiDescriptorCollection.h:21
TrigCompositeUtils
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:19
xAOD::Muon_v1::extrapolatedMuonSpectrometerTrackParticleLink
const ElementLink< TrackParticleContainer > & extrapolatedMuonSpectrometerTrackParticleLink() const
Returns an ElementLink to the Extrapolated Muon Spectrometer TrackParticle used in identification of ...
InputMakerBase::MatchingCache::setMatchingHash
void setMatchingHash(const TrigCompositeUtils::Decision *inputDecision, const uint64_t matchingHash)
Definition: InputMakerBase.cxx:230
TrigCompositeUtils::roiString
const std::string & roiString()
Definition: TrigCompositeUtilsRoot.cxx:878
EventViewCreatorAlgorithm::m_placeJetInView
Gaudi::Property< bool > m_placeJetInView
Definition: EventViewCreatorAlgorithm.h:104
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
View.h
EventViewCreatorAlgorithm::placeRoIInView
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.
Definition: EventViewCreatorAlgorithm.cxx:294
SG::View
Definition: View.h:25
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
EventViewCreatorAlgorithm::checkCache
bool checkCache(const TrigCompositeUtils::DecisionContainer *cachedViews, const TrigCompositeUtils::Decision *outputDecision, size_t &cachedIndex, MatchingCache &matchingCache, const EventContext &context) const
Allow for the re-use of EventViews run in a previous Step in another EVCA instance configured to spaw...
Definition: EventViewCreatorAlgorithm.cxx:187
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TrigCompositeUtils::viewString
const std::string & viewString()
Definition: TrigCompositeUtilsRoot.cxx:882
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition: Event/xAOD/xAODJet/xAODJet/Jet.h:17
InputMakerBase::MatchingCache
Used to cache each incoming Decision object's ElementLink which is being used to identify the Decisio...
Definition: InputMakerBase.h:35
drawFromPickle.view
view
Definition: drawFromPickle.py:294
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
ViewContainer
Definition: View.h:161