LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
StandaloneBasicSetup.h
Go to the documentation of this file.
1 
28 #ifndef LARCOREALG_GEOMETRY_STANDALONEBASICSETUP_H
29 #define LARCOREALG_GEOMETRY_STANDALONEBASICSETUP_H
30 
31 // utility libraries
32 #include "cetlib/filepath_maker.h" // cet::filepath_lookup_after1
33 #include "fhiclcpp/ParameterSet.h"
35 
36 // C/C++ standard libraries
37 #include <string>
38 
39 namespace lar {
40 
42  namespace standalone {
43 
44  //--------------------------------------------------------------------------
54  fhicl::ParameterSet ParseConfiguration(std::string configPath,
55  cet::filepath_maker& lookupPolicy);
56 
57  //--------------------------------------------------------------------------
70  fhicl::ParameterSet ParseConfiguration(std::string configPath);
71 
72  //--------------------------------------------------------------------------
86  void SetupMessageFacility(fhicl::ParameterSet const& pset, std::string applName = "standalone");
87 
88  //--------------------------------------------------------------------------
89 
90  } // namespace standalone
91 } // namespace lar
92 
93 //------------------------------------------------------------------------------
94 //--- inline implementation
95 //---
96 //------------------------------------------------------------------------------
98  cet::filepath_maker& lookupPolicy)
99 {
100  fhicl::ParameterSet pset;
101  pset = fhicl::ParameterSet::make(configPath, lookupPolicy);
102  return pset;
103 } // ParseConfiguration(string, filepath_maker)
104 
105 //------------------------------------------------------------------------------
107 {
108  cet::filepath_lookup_after1 policy("FHICL_FILE_PATH");
109  return ParseConfiguration(configPath, policy);
110 } // ParseConfiguration(string)
111 
112 //------------------------------------------------------------------------------
114  std::string applName /* = "standalone" */)
115 {
116  mf::StartMessageFacility(pset.get<fhicl::ParameterSet>("services.message"));
117  mf::SetApplicationName(applName);
118  mf::SetContextSinglet("main");
120 } // lar::standalone::SetupMessageFacility()
121 
122 //------------------------------------------------------------------------------
123 
124 #endif // LARCOREALG_GEOMETRY_STANDALONEBASICSETUP_H
static ParameterSet make(intermediate_table const &tbl)
Definition: ParameterSet.cc:68
void SetContextIteration(string const &val)
void SetupMessageFacility(fhicl::ParameterSet const &pset, std::string applName="standalone")
Sets up the message facility service.
void StartMessageFacility(fhicl::ParameterSet const &pset, string const &applicationName)
T get(std::string const &key) const
Definition: ParameterSet.h:314
LArSoft-specific namespace.
void SetContextSinglet(string const &val)
fhicl::ParameterSet ParseConfiguration(std::string configPath, cet::filepath_maker &lookupPolicy)
Parses a FHiCL configuration file.
void SetApplicationName(string const &applicationName)