Feature #6097

Propose that art take over this helper function

Added by Rob Kutschke over 6 years ago. Updated almost 6 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
2.00 h
Spent time:
SSI Package:


This is closely related to issue 3202

We propose that the following code be supported by the art team - I am not sure of the appropriate place for it.

Mu2e has written a specialization of the template

T fhicl::ParameterSet::get<std::vector<T>>( std::string const & key ) const;

for T of std::vector<art::InputTag>.

This permits you to write:

auto tags = pset.get<std::vector<art::inputTag>>("myInputTags");

The source code is at:

We chose not to provide the corresponding specialization for a single art::InputTag because we feel that the following is simple enough:

art::InputTag tag = pset.get<string>("myInputTag");

My personal recommendation is to remove the specialization that accepts a default value as the second argument. I know that this breaks the code symmetry but I want all inputTags to be exposed in fcl files. Mu2e has both specializations because we currently have code that depends on the specialization that has a default.

Related issues

Related to cet-is - Feature #3202: Parameter set helper methodsClosed09/30/2013

Associated revisions

Revision 28b8af5f (diff)
Added by Kyle Knoepfel almost 6 years ago

Implement issue #6097


#1 Updated by Christopher Green over 6 years ago

  • Category set to Infrastructure
  • Status changed from New to Accepted
  • Target version set to 1.09.03
  • Estimated time set to 2.00 h
  • SSI Package art added
  • SSI Package deleted ()

We believe this can be shoehorned into the upcoming 1.09.03 without being the critical path for that release.

#2 Updated by Christopher Green over 6 years ago

  • Target version changed from 1.09.03 to 1.13.00

#3 Updated by Christopher Green almost 6 years ago

  • Status changed from Accepted to Assigned
  • Assignee set to Marc Paterno

#4 Updated by Kyle Knoepfel almost 6 years ago

#5 Updated by Marc Paterno almost 6 years ago

  • Assignee changed from Marc Paterno to Kyle Knoepfel

#6 Updated by Kyle Knoepfel almost 6 years ago

  • Status changed from Assigned to Resolved
  • Start date changed from 05/01/2014 to 02/05/2015

Implementing this feature involved overloading the fhicl::detail::decode function to allow for conversions from std::string to art::InputTag. By overloading this one function, the following conversions are now allowed:

pset.get<            art::InputTag >(...)

pset.get_if_present<            art::InputTag >(...)

The functions that allow for default values are still supported with the art::InputTag and std::vector<art::InputTag> template arguments, in accord with other currently supported template arguments. Whether or not a default value is provided is a policy decision that is left to the individual experiments.

Implemented with 28b8af5fe34905065b275c93928043dc7f32d9be.

#7 Updated by Kyle Knoepfel almost 6 years ago

  • % Done changed from 0 to 100

#8 Updated by Christopher Green almost 6 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF