File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,4 @@ art_make_library( LIBRARY_NAME caf_RecoUtils
1111 larsim::MCCheater_BackTrackerService_service
1212 larsim::MCCheater_ParticleInventoryService_service
1313 larcorealg::Geometry
14- sbnanaobj::StandardRecord
15- sbnanaobj::StandardRecordFlat
1614 )
Original file line number Diff line number Diff line change @@ -71,12 +71,18 @@ namespace hit {
7171 std::vector<double > FillOutHitParameterVector (const std::vector<double >& input);
7272
7373 template <class T >
74- inline std::vector<T> getValueOrListOf (fhicl::ParameterSet const & pset, std::string const & key) {
74+ std::vector<T> getValueOrListOf (fhicl::ParameterSet const & pset, std::string const & key) const {
7575
7676 auto const & wireReadoutGeom = art::ServiceHandle<geo::WireReadout const >()->Get ();
7777 const unsigned int N_PLANES = wireReadoutGeom.Nplanes ();
7878
7979 if (pset.is_key_to_sequence (key))
80+ auto vec = pset.get <std::vector<T>>(key);
81+ if (vec.size () != N_PLANES) {
82+ throw cet::exception (" Configuration" )
83+ << " Parameter '" << key << " ' has size " << vec.size ()
84+ << " but expected " << N_PLANES << " (number of planes)" ;
85+ }
8086 return pset.get <std::vector<T>>(key);
8187 else
8288 return std::vector<T>(N_PLANES, pset.get <T>(key));
You can’t perform that action at this time.
0 commit comments