Project

General

Profile

Feature #2536

FindOne/FindMany for a single input object

Added by Andrei Gaponenko over 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Navigation
Target version:
Start date:
10/03/2013
Due date:
% Done:

100%

Estimated time:
4.00 h
Spent time:
Scope:
Internal
Experiment:
-
SSI Package:
art
Duration:

Description

Hello,

I use the FindOne<ProdB>(...) template to find a "matching" object for
one specific Ptr<ProdA> at a time, without iterating over a collection
of ProdA. All of the FindOne constructors require to specify a
collection of ProdA among the inputs. I ended up using the "From
arbitrary sequence of Ptr<A>" constructor:

Ptr<GenParticle> gp = ...;
FindOne<StepPointMC> fo(vector<Ptr<GenParticle> >(1, gp), event, inputTag);

Accepting a non-collection input would allow a nicer syntax:

FindOne<StepPointMC> fo(gp, event, inputTag);

I suggest to add such constructors to the FindOne/FindMany family.

Andrei


Related issues

Related to cet-is - Support #4885: Assns help for Eric ChurchClosed10/04/201310/04/2013

Has duplicate art - Feature #11495: FindMany/One interface that works with art::PtrRejected01/26/2016

History

#1 Updated by Christopher Green over 7 years ago

  • Category set to Navigation
  • Status changed from New to Accepted

Per our discussion this afternoon, I think a more comprehensive feature addition to do what you need in this instance would be to allow a FindXXXX to be constructable from a temporary Assns. Unfortunately we do not have the effort available to implement this feature immediately. I would ask that Rob apply an appropriate priority to this feature request relative to the other things he needs.

In the meantime, I think a solution along the lines of the iterative function we discussed might get you where you need to be, even slightly more efficiently in this case at the cost of more design and programming effort.

#2 Updated by Christopher Green over 6 years ago

  • Due date set to 09/30/2013
  • Target version set to 1.09.00
  • Estimated time set to 4.00 h
  • Scope set to Internal
  • Experiment Mu2e added

#3 Updated by Christopher Green over 6 years ago

Disregarding my previous note, your original request is implementable with minimal effort using C++2011 features (delegating constructors).

#4 Updated by Christopher Green about 6 years ago

  • Tracker changed from Feature to Bug

#5 Updated by Christopher Green about 6 years ago

  • Due date deleted (09/30/2013)
  • Status changed from Accepted to Feedback
  • Assignee set to Christopher Green
  • Start date changed from 03/06/2012 to 10/03/2013
  • % Done changed from 0 to 100
  • Experiment - added
  • Experiment deleted (Mu2e)
  • SSI Package art added
  • SSI Package deleted ()

This has been not quite implemented with fbdae00. Instead of specifying an unadorned Ptr in the constructor of a FindXXXX, one may use a brace-enclosed initializer list, vis:

FindOne<X, D> fo({pA, pB, pC}, e, iTag)
Is this sufficient?

#6 Updated by Christopher Green about 6 years ago

  • Tracker changed from Bug to Feature
  • Target version changed from 1.09.00 to 401

#7 Updated by Christopher Green about 6 years ago

  • Status changed from Feedback to Resolved

#8 Updated by Christopher Green about 6 years ago

  • Target version changed from 401 to 1.08.09

#9 Updated by Lynn Garren over 5 years ago

  • Status changed from Resolved to Closed

#10 Updated by Christopher Green almost 4 years ago

  • Has duplicate Feature #11495: FindMany/One interface that works with art::Ptr added


Also available in: Atom PDF