Support #23469

Specializations for fhicl::get_if_present seem to have stopped working

Added by Rob Kutschke about 1 year ago. Updated about 1 year ago.

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


Estimated time:
SSI Package:


A long time ago Mu2e wrote template specializations for fhicl::get_if_present . Among other things they allowed us to do the following:

In the fhicl:

offset : [ 1., 2., 3. ]

and in the code:

 CLHEP::Hep3Vector offset =  pset.get<CLHEP::Hep3Vector>("offset");

where pset is a fhicl parameter set. This seems to have stopped working. The error is:

%MSG-s ArtException:  HelloWorld:hello@Construction 24-Oct-2019 10:40:03 CDT  ModuleConstruction
cet::exception caught in art
---- Type mismatch BEGIN

  Unsuccessful attempt to convert FHiCL parameter 'v' to type 'CLHEP::Hep3Vector'.

  [Specific error:]
  bad any_cast

---- Type mismatch END
Art has completed and will exit with status 65.

An example the reproduces the problem is on the Mu2e interactive machines in


The source for the template specializations is found in mu2e Offline in:


We using art v3_03_01


#1 Updated by Rob Kutschke about 1 year ago

Oooops .. seems to have stopped working!

#2 Updated by Lynn Garren about 1 year ago

  • Status changed from New to Feedback

Kyle is planning to be back Nov. 4 and is the best person to look at this issue. Let us know if you need someone to look at this sooner.

#3 Updated by Rob Kutschke about 1 year ago

  • Description updated (diff)

#4 Updated by Rob Kutschke about 1 year ago

FYI: At Chris' request, I ran my test against a handful of different version of Mu2e Offline going to back to Offline v6_3_2, which uses art v2_07_03. All failed with the same error message. All of our earlier builds on cvmfs require a SLF6 test machine which we no longer have. If someone can point me to an SLF6 machine that mounts the /cvmfs/ I can go farther back.

#5 Updated by Christopher Green about 1 year ago

  • Assignee set to Christopher Green
  • Status changed from Feedback to Assigned
  • Category set to Infrastructure

I am investigating this issue.

#6 Updated by Christopher Green about 1 year ago

  • Status changed from Assigned to Feedback
  • Tracker changed from Bug to Support

Rob, the to which you refer here does not include GeneralUtilities/inc/ParameterSetHelpers.hh, and it is not pulled in indirectly. It is important that the compiler sees the template definition first, followed by the declaration of any specializations, before any code which would trigger the instantiation of the template for the specified type. Otherwise, the default template instantiation will be triggered, which in this case would give exactly the error you see.

Please try again with the appropriate include inserted, and let me know if the problem is resolved for you.

#7 Updated by Rob Kutschke about 1 year ago

  • Experiment Mu2e added
  • Experiment deleted (-)

Thanks Chris. I have confirmed in my test that this fixes the problem. Please close the ticket.

#8 Updated by Kyle Knoepfel about 1 year ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF