All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
lar::standalone Namespace Reference

Utilities for use in an environment without art. More...

Functions

template<>
std::unique_ptr
< geo::GeometryCore
SetupGeometry< icarus::ICARUSChannelMapAlg > (fhicl::ParameterSet const &pset)
 
fhicl::ParameterSet ParseConfiguration (std::string configPath, cet::filepath_maker &lookupPolicy)
 Parses a FHiCL configuration file. More...
 
fhicl::ParameterSet ParseConfiguration (std::string configPath)
 Parses a FHiCL configuration file. More...
 
void SetupMessageFacility (fhicl::ParameterSet const &pset, std::string applName="standalone")
 Sets up the message facility service. More...
 
std::unique_ptr
< geo::GeometryCore
SetupGeometryWithChannelMapping (fhicl::ParameterSet const &pset, std::unique_ptr< geo::ChannelMapAlg > channelMap)
 Initializes a LArSoft geometry object. More...
 
template<typename ChannelMapClass , typename... Args>
std::unique_ptr
< geo::GeometryCore
SetupGeometry (fhicl::ParameterSet const &pset, Args &&...args)
 Initializes a LArSoft geometry object. More...
 

Detailed Description

Utilities for use in an environment without art.

Function Documentation

fhicl::ParameterSet lar::standalone::ParseConfiguration ( std::string  configPath,
cet::filepath_maker &  lookupPolicy 
)
inline

Parses a FHiCL configuration file.

Parameters
configPaththe path to the configuration file to be parsed
lookupPolicyclass performing the proper lookup for FHiCL files
Returns
a parameter set containing the whole configuration from the file

Some lookup policies are provided in cetlib (see cetlib/filepath_maker.h file).

Definition at line 106 of file StandaloneBasicSetup.h.

107 {
108  fhicl::ParameterSet pset;
109  pset = fhicl::ParameterSet::make(configPath, lookupPolicy);
110  return pset;
111 } // ParseConfiguration(string, filepath_maker)
fhicl::ParameterSet lar::standalone::ParseConfiguration ( std::string  configPath)
inline

Parses a FHiCL configuration file.

Parameters
configPaththe path to the configuration file to be parsed
Returns
a parameter set containing the whole configuration from the file

The lookup policy for finding the FHiCL files is such that:

  • configPath must be readily available: no special lookup is performed
  • FHiCL files included (directly or indirectly) by configPath are searched for in the path list specified in the environment variable FHICL_FILE_PATH

Definition at line 116 of file StandaloneBasicSetup.h.

117 {
118  cet::filepath_lookup_after1 policy("FHICL_FILE_PATH");
119  return ParseConfiguration(configPath, policy);
120 } // ParseConfiguration(string)
fhicl::ParameterSet ParseConfiguration(std::string configPath, cet::filepath_maker &lookupPolicy)
Parses a FHiCL configuration file.
template<>
std::unique_ptr<geo::GeometryCore> lar::standalone::SetupGeometry< icarus::ICARUSChannelMapAlg > ( fhicl::ParameterSet const &  pset)
inline

Specialization of lar::standalone::SetupGeometry() for ICARUS channel mapping icarus::ICARUSChannelMapAlg.

Definition at line 120 of file ICARUSstandaloneGeometrySetup.h.

121  { return icarus::geo::SetupICARUSGeometry<icarus::ICARUSChannelMapAlg>(pset); }
void lar::standalone::SetupMessageFacility ( fhicl::ParameterSet const &  pset,
std::string  applName = "standalone" 
)
inline

Sets up the message facility service.

Parameters
psetglobal configuration parameter set
applName(default: "standalone") name of running the application

The configuration is read from the path services.message (as for the standard art behaviour). Any configuration working in art is expected to work here as well.

Technical details:

  • "context singlet" is set to main (mf::SetContextSinglet())
  • "context iteration" is set to empty (mf::SetContextIteration())

Definition at line 125 of file StandaloneBasicSetup.h.

126 {
127  mf::StartMessageFacility(pset.get<fhicl::ParameterSet>("services.message"));
128  mf::SetApplicationName(applName);
129  mf::SetContextSinglet("main");
130  mf::SetContextIteration("");
131 } // lar::standalone::SetupMessageFacility()