LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
GeometryBuilderStandard.h
Go to the documentation of this file.
1 
10 #ifndef LARCOREALG_GEOMETRY_GEOMETRYBUILDERSTANDARD_H
11 #define LARCOREALG_GEOMETRY_GEOMETRYBUILDERSTANDARD_H
12 
13 // LArSoft libraries
22 
23 // support libraries
24 #include "fhiclcpp/types/Atom.h"
25 
26 // ROOT libraries
27 #include "TGeoNode.h"
28 
29 // C++ standard library
30 #include <functional>
31 #include <limits> // std::numeric_limits<>
32 #include <string_view>
33 
34 namespace geo {
35 
107 
108  public:
110  struct Config {
111 
112  using Name = fhicl::Name;
114 
116  Name("maxDepth"),
117  Comment("maximum number of level of the geometry structure to descend"),
118  std::numeric_limits<Path_t::Depth_t>::max() // default
119  };
120 
122  Name("opDetGeoName"),
123  Comment("the start of the name of optical detector GDML nodes"),
124  "volOpDetSensitive" // default
125  };
126 
127  }; // struct Config
128 
129  GeometryBuilderStandard(Config const& config);
130 
131  //
132  // we don't expand the public interface here
133  //
134 
135  protected:
137  Path_t::Depth_t fMaxDepth = std::numeric_limits<Path_t::Depth_t>::max();
138 
140  std::string fOpDetGeoName = "volOpDetSensitive";
141 
142  // --- BEGIN Auxiliary detector information --------------------------------
145 
146  // extractAuxiliaryDetectors() and AuxDets_t are inherited public interface
147 
149  geo::AuxDetGeo makeAuxDet(Path_t& path) { return doMakeAuxDet(path); }
150 
154  virtual AuxDets_t doExtractAuxiliaryDetectors(Path_t& path) override;
155 
157  virtual geo::AuxDetGeo doMakeAuxDet(Path_t& path);
158 
160  // --- END Auxiliary detector information ----------------------------------
161 
162  // --- BEGIN Auxiliary detector sensitive volume information ---------------
165 
167 
180  {
181  auto localPath = path;
182  return doExtractAuxDetSensitive(localPath);
183  }
184 
188  {
189  return doMakeAuxDetSensitive(path);
190  }
191 
196 
199 
201  // --- END Auxiliary detector sensitive volume information -----------------
202 
203  // --- BEGIN Cryostat information ------------------------------------------
206 
207  // extractCryostats() and Cryostats_t are inherited public interface
208 
211 
215  virtual Cryostats_t doExtractCryostats(Path_t& path) override;
216 
218  virtual geo::CryostatGeo doMakeCryostat(Path_t& path);
219 
221  // --- END Cryostat information --------------------------------------------
222 
223  // --- BEGIN Optical detector information ----------------------------------
226 
228 
235  {
236  auto localPath = path;
237  return doExtractOpDets(localPath);
238  }
239 
241  geo::OpDetGeo makeOpDet(Path_t& path) { return doMakeOpDet(path); }
242 
246  virtual OpDets_t doExtractOpDets(Path_t& path);
247 
249  virtual geo::OpDetGeo doMakeOpDet(Path_t& path);
250 
252  // --- END Optical detector information ------------------------------------
253 
254  // --- BEGIN TPC information -----------------------------------------------
257 
259 
268  {
269  auto localPath = path;
270  return doExtractTPCs(localPath);
271  }
272 
274  geo::TPCGeo makeTPC(Path_t& path) { return doMakeTPC(path); }
275 
279  virtual TPCs_t doExtractTPCs(Path_t& path);
280 
282  virtual geo::TPCGeo doMakeTPC(Path_t& path);
283 
285  // --- END TPC information -------------------------------------------------
286 
287  // --- BEGIN Plane information ---------------------------------------------
290 
292 
301  {
302  auto localPath = path;
303  return doExtractPlanes(localPath);
304  }
305 
307  geo::PlaneGeo makePlane(Path_t& path) { return doMakePlane(path); }
308 
312  virtual Planes_t doExtractPlanes(Path_t& path);
313 
315  virtual geo::PlaneGeo doMakePlane(Path_t& path);
316 
318  // --- END Plane information -----------------------------------------------
319 
320  // --- BEGIN Wire information ----------------------------------------------
323 
325 
333  {
334  auto localPath = path;
335  return doExtractWires(localPath);
336  }
337 
339  geo::WireGeo makeWire(Path_t& path) { return doMakeWire(path); }
340 
344  virtual Wires_t doExtractWires(Path_t& path);
345 
347  virtual geo::WireGeo doMakeWire(Path_t& path);
348 
350  // --- END Wire information ------------------------------------------------
351 
352  private:
369  template <typename ObjGeo>
371  Path_t& path,
372  std::function<bool(TGeoNode const&)> IsObj,
373  ObjGeo (geo::GeometryBuilderStandard::*MakeObj)(Path_t&));
374 
375  }; // class GeometryBuilderStandard
376 
377 } // namespace geo
378 
379 #endif // LARCOREALG_GEOMETRY_GEOMETRYBUILDERSTANDARD_H
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:114
virtual OpDets_t doExtractOpDets(Path_t &path)
TPCs_t extractTPCs(Path_t &path)
Looks for all TPCs under the specified path.
Planes_t extractPlanes(Path_t &path)
Looks for all wire planes under the specified path.
virtual geo::PlaneGeo doMakePlane(Path_t &path)
Core implementation of makePlanes().
virtual geo::AuxDetSensitiveGeo doMakeAuxDetSensitive(Path_t &path)
Core implementation of makeAuxDetSensitive().
virtual geo::TPCGeo doMakeTPC(Path_t &path)
Core implementation of makeTPC().
geo::TPCGeo makeTPC(Path_t &path)
Constructs a geo::TPCGeo from the current node of the path.
fhicl::Atom< Path_t::Depth_t > maxDepth
Encapsulate the construction of a single cyostat.
Encapsulate the geometry of the sensitive portion of an auxiliary detector.
GeometryBuilderStandard(Config const &config)
GeoColl_t< geo::AuxDetSensitiveGeo > AuxDetSensitive_t
Looks for all auxiliary detectors under the specified path.
Geometry information for a single TPC.
Definition: TPCGeo.h:36
GeoColl_t< ObjGeo > doExtractGeometryObjects(Path_t &path, std::function< bool(TGeoNode const &)> IsObj, ObjGeo(geo::GeometryBuilderStandard::*MakeObj)(Path_t &))
Boilerplate implementation of doExtractXxxx() methods.
Interface for geometry extractor classes.
GeoColl_t< geo::TPCGeo > TPCs_t
Looks for all TPCs under the specified path.
virtual geo::CryostatGeo doMakeCryostat(Path_t &path)
Core implementation of extractAuxDetSensitive().
geo::AuxDetGeo makeAuxDet(Path_t &path)
Constructs a geo::AuxDetGeo from the current node of the path.
virtual AuxDetSensitive_t doExtractAuxDetSensitive(Path_t &path)
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
virtual geo::AuxDetGeo doMakeAuxDet(Path_t &path)
Core implementation of extractAuxiliaryDetectors().
GeoColl_t< geo::AuxDetGeo > AuxDets_t
Collection of auxiliary detector information objects.
OpDets_t extractOpDets(Path_t &path)
Looks for all optical detectors under the specified path.
virtual Cryostats_t doExtractCryostats(Path_t &path) override
virtual AuxDets_t doExtractAuxiliaryDetectors(Path_t &path) override
GeoColl_t< geo::WireGeo > Wires_t
Looks for all wires under the specified path.
std::string fOpDetGeoName
Name of the optical detector nodes.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
virtual TPCs_t doExtractTPCs(Path_t &path)
GeoColl_t< geo::CryostatGeo > Cryostats_t
Collection of cryostat information objects.
Path_t::Depth_t fMaxDepth
Maximum level to descend into in the path.
virtual geo::OpDetGeo doMakeOpDet(Path_t &path)
Core implementation of makeOpDet().
GeoColl_t< geo::PlaneGeo > Planes_t
Looks for all wire planes under the specified path.
Encapsulate the geometry of an auxiliary detector.
Encapsulate the geometry of a wire.
GeoColl_t< geo::OpDetGeo > OpDets_t
Looks for all optical detectors under the specified path.
Encapsulate the geometry of an optical detector.
Wires_t extractWires(Path_t &path)
Looks for all wires under the specified path.
std::size_t Depth_t
Type used to represent the depth of the path.
Definition: GeoNodePath.h:48
Encapsulate the construction of a single detector plane.
AuxDetSensitive_t extractAuxDetSensitive(Path_t &path)
Looks for all auxiliary detectors under the specified path.
virtual Wires_t doExtractWires(Path_t &path)
geo::OpDetGeo makeOpDet(Path_t &path)
Constructs a geo::OpDetGeo from the current node of the path.
Manages the extraction of LArSoft geometry information from ROOT.
Representation of a node and its ancestry.
Definition: GeoNodePath.h:37
Namespace collecting geometry-related classes utilities.
geo::PlaneGeo makePlane(Path_t &path)
Constructs a geo::PlaneGeo from the current node of the path.
virtual Planes_t doExtractPlanes(Path_t &path)
Extracts of LArSoft geometry information from ROOT.
Encapsulate the construction of a single detector plane.
std::vector< GeoObj > GeoColl_t
Type of direct collection of geometry objects.
geo::CryostatGeo makeCryostat(Path_t &path)
Constructs a geo::CryostatGeo from the current node of the path.
virtual geo::WireGeo doMakeWire(Path_t &path)
Core implementation of makeWire().
geo::WireGeo makeWire(Path_t &path)
Constructs a geo::WireGeo from the current node of the path.
geo::AuxDetSensitiveGeo makeAuxDetSensitive(Path_t &path)