10 #ifndef ICARUSCODE_UTILITIES_READARTCONFIGURATION_H
11 #define ICARUSCODE_UTILITIES_READARTCONFIGURATION_H
15 #include "canvas/Persistency/Provenance/ProcessConfiguration.h"
16 #include "canvas/Persistency/Provenance/ProcessHistory.h"
17 #include "fhiclcpp/ParameterSet.h"
18 #include "fhiclcpp/ParameterSetID.h"
19 #include "fhiclcpp/ParameterSetRegistry.h"
20 #include "cetlib_except/exception.h"
46 std::map<fhicl::ParameterSetID, fhicl::ParameterSet>
81 template <
typename Principal>
82 std::map<std::string, fhicl::ParameterSet>
95 template <
typename Principal>
96 std::map<std::string, fhicl::ParameterSet>
99 std::map<std::string, fhicl::ParameterSet> configMap;
101 for (art::ProcessConfiguration
const& procConfig: principal.processHistory())
104 fhicl::ParameterSet config;
108 throw cet::exception(
"readConfigurationFromArtPrincipal")
109 <<
"Configuration of process '" << procConfig.processName()
110 <<
"' can't be found!\n";
113 configMap[procConfig.processName()] = std::move(config);
124 #endif // ICARUSCODE_UTILITIES_READARTCONFIGURATION_H
std::map< fhicl::ParameterSetID, fhicl::ParameterSet > readConfigurationFromArtFile(TFile &file)
Reads and returns the art configuration stored in sourceDir.
std::map< std::string, fhicl::ParameterSet > readConfigurationFromArtPrincipal(Principal const &principal)
Reads and returns the complete art configuration in the principal.