LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
StandaloneBasicSetup.h
Go to the documentation of this file.
1 
30 #ifndef STANDALONEBASICSETUP_H
31 #define STANDALONEBASICSETUP_H
32 
33 // utility libraries
35 #include "fhiclcpp/ParameterSet.h"
37 #include "cetlib/filepath_maker.h" // cet::filepath_lookup_after1
38 
39 // C/C++ standard libraries
40 #include <string>
41 
42 
43 namespace lar {
44 
46  namespace standalone {
47 
48  //--------------------------------------------------------------------------
59  (std::string configPath, cet::filepath_maker& lookupPolicy);
60 
61 
62  //--------------------------------------------------------------------------
75  fhicl::ParameterSet ParseConfiguration(std::string configPath);
76 
77 
78  //--------------------------------------------------------------------------
93  (fhicl::ParameterSet const& pset, std::string applName = "standalone");
94 
95 
96  //--------------------------------------------------------------------------
97 
98  } // namespace standalone
99 } // namespace lar
100 
101 
102 //------------------------------------------------------------------------------
103 //--- inline implementation
104 //---
105 //------------------------------------------------------------------------------
107  (std::string configPath, cet::filepath_maker& lookupPolicy)
108 {
109  fhicl::ParameterSet pset;
110  fhicl::make_ParameterSet(configPath, lookupPolicy, pset);
111  return pset;
112 } // ParseConfiguration(string, filepath_maker)
113 
114 
115 //------------------------------------------------------------------------------
117  (std::string configPath)
118 {
119  cet::filepath_lookup_after1 policy("FHICL_FILE_PATH");
120  return ParseConfiguration(configPath, policy);
121 } // ParseConfiguration(string)
122 
123 
124 //------------------------------------------------------------------------------
126  (fhicl::ParameterSet const& pset, std::string applName /* = "standalone" */)
127 {
128  mf::StartMessageFacility(pset.get<fhicl::ParameterSet>("services.message"));
129  mf::SetApplicationName(applName);
130  mf::SetContextSinglet("main");
132 } // lar::standalone::SetupMessageFacility()
133 
134 
135 //------------------------------------------------------------------------------
136 
137 #endif // STANDALONEBASICSETUP_H
void make_ParameterSet(intermediate_table const &tbl, ParameterSet &ps)
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:231
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)