LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
StandaloneGeometrySetup.h
Go to the documentation of this file.
1 
12 #ifndef LARCOREALG_GEOMETRY_STANDALONEGEOMETRYSETUP_H
13 #define LARCOREALG_GEOMETRY_STANDALONEGEOMETRYSETUP_H
14 
15 // LArSoft libraries
18 
19 // art-provided libraries
20 #include "fhiclcpp/ParameterSet.h"
21 
22 // C/C++ standard libraries
23 #include <memory> // std::make_unique()
24 #include <set>
25 #include <string>
26 
27 namespace lar::standalone {
28 
29  // --- BEGIN Geometry group ------------------------------------------------
32 
33  //--------------------------------------------------------------------------
89  std::unique_ptr<geo::GeometryCore> SetupGeometryWithChannelMapping(
90  fhicl::ParameterSet const& pset,
91  std::unique_ptr<geo::ChannelMapAlg> channelMap);
92 
93  //--------------------------------------------------------------------------
127  template <typename ChannelMapClass, typename... Args>
128  std::unique_ptr<geo::GeometryCore> SetupGeometry(fhicl::ParameterSet const& pset, Args&&... args);
129 
130  //--------------------------------------------------------------------------
131 
132  // --- END Geometry group --------------------------------------------------
134 
135 } // namespace lar::standalone
136 
137 //------------------------------------------------------------------------------
138 //--- template implementation
139 //---
140 template <typename ChannelMapClass, typename... Args>
141 std::unique_ptr<geo::GeometryCore> lar::standalone::SetupGeometry(fhicl::ParameterSet const& pset,
142  Args&&... args)
143 {
144  auto const SortingParameters = pset.get<fhicl::ParameterSet>("SortingParameters", {});
145  auto channelMap =
146  std::make_unique<ChannelMapClass>(SortingParameters, std::forward<Args>(args)...);
147  return SetupGeometryWithChannelMapping(pset, move(channelMap));
148 } // lar::standalone::SetupGeometry()
149 
150 //------------------------------------------------------------------------------
151 
152 #endif // LARCOREALG_GEOMETRY_STANDALONEGEOMETRYSETUP_H
Access the description of detector geometry.
T get(std::string const &key) const
Definition: ParameterSet.h:314
Utilities for use in an environment without art.
std::unique_ptr< geo::GeometryCore > SetupGeometryWithChannelMapping(fhicl::ParameterSet const &pset, std::unique_ptr< geo::ChannelMapAlg > channelMap)
Initializes a LArSoft geometry object.
std::unique_ptr< geo::GeometryCore > SetupGeometry(fhicl::ParameterSet const &pset, Args &&...args)
Initializes a LArSoft geometry object.
Interface to algorithm class for a specific detector channel mapping.