LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
StandaloneGeometrySetup.h
Go to the documentation of this file.
1 
13 #ifndef STATICGEOMETRYLOADER_H
14 #define STATICGEOMETRYLOADER_H
15 
16 // LArSoft libraries
19 
20 // CET libraries
21 #include "fhiclcpp/ParameterSet.h"
22 #include "fhiclcpp/types/Name.h"
23 #include "fhiclcpp/types/Comment.h"
24 #include "fhiclcpp/types/Atom.h"
27 #include "fhiclcpp/types/Table.h"
28 
29 
30 // C/C++ standard libraries
31 #include <string>
32 #include <set>
33 #include <memory> // std::make_unique(), std::make_shared()
34 
35 namespace lar {
36 
37  namespace standalone {
38 
39  // --- BEGIN Geometry group ------------------------------------------------
42 
43  //--------------------------------------------------------------------------
99  std::unique_ptr<geo::GeometryCore> SetupGeometryWithChannelMapping(
100  fhicl::ParameterSet const& pset,
101  std::shared_ptr<geo::ChannelMapAlg> channelMap
102  );
103 
104 
105  //--------------------------------------------------------------------------
139  template <typename ChannelMapClass, typename... Args>
140  std::unique_ptr<geo::GeometryCore> SetupGeometry
141  (fhicl::ParameterSet const& pset, Args&&... args);
142 
143  //--------------------------------------------------------------------------
144 
145  // --- END Geometry group --------------------------------------------------
147 
148  } // namespace standalone
149 } // namespace lar
150 
151 
152 //------------------------------------------------------------------------------
153 //--- template implementation
154 //---
155 template <typename ChannelMapClass, typename... Args>
156 std::unique_ptr<geo::GeometryCore> lar::standalone::SetupGeometry
157  (fhicl::ParameterSet const& pset, Args&&... args)
158 {
159  auto SortingParameters
160  = pset.get<fhicl::ParameterSet>("SortingParameters", fhicl::ParameterSet());
161 
162  auto channelMap = std::make_shared<ChannelMapClass>
163  (SortingParameters, std::forward<Args>(args)...);
164 
165  return SetupGeometryWithChannelMapping(pset, channelMap);
166 
167 } // lar::standalone::SetupGeometry()
168 
169 //------------------------------------------------------------------------------
170 
171 #endif // STATICGEOMETRYLOADER_H
std::unique_ptr< geo::GeometryCore > SetupGeometryWithChannelMapping(fhicl::ParameterSet const &pset, std::shared_ptr< geo::ChannelMapAlg > channelMap)
Initializes a LArSoft geometry object.
Access the description of detector geometry.
T get(std::string const &key) const
Definition: ParameterSet.h:231
LArSoft-specific namespace.
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.