Project

General

Profile

Bug #7055

Bug #6394: Verify that association query objects are created outside tight loops

FindManyP() usage in PrimaryVertexFinder module

Added by Gianluca Petrillo over 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Reconstruction
Target version:
-
Start date:
09/22/2014
Due date:
% Done:

0%

Estimated time:
1.00 h
Occurs In:
Experiment:
LArSoft
Co-Assignees:
Duration:

Description

PrimaryVertexFinder module show non-optimal usage of associations.

larreco/VertexFinder/PrimaryVertexFinder_module.cc

I notice dubious practise in PrimaryVertexFinder::produce().

The action I recommend:
- since you use it, #include "art/Framework/Core/FindMany.h" and #include "art/Framework/Core/FindManyP.h"
- bring the instances FindMany and FindManyP out of the loops
- use const std::vector<art::Ptr<T>>& to store the result of FindManyP::at(), that returns a constant reference, if possible

The author is Saima Farooq, roughly two years ago. I don't know if she is still maintaining this code, so I am picking VertexFinder librarians as contact people: Jonathan Asaadi (), Wesley Ketchum ().

History

#1 Updated by Gianluca Petrillo almost 6 years ago

  • Status changed from Assigned to Rejected

A detailed analysis of the code shows that performing the suggested change would yield complex structure.
Given that the new FindManyP implementation has reduced complexity, the gain of this change would be questionable.

#2 Updated by Gianluca Petrillo almost 6 years ago

  • Status changed from Rejected to Closed

Also available in: Atom PDF