LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
geo::WireReadoutGeomBuilderStandard Class Reference

Extracts of LArSoft geometry information from ROOT. More...

#include "WireReadoutGeomBuilderStandard.h"

Inheritance diagram for geo::WireReadoutGeomBuilderStandard:
geo::WireReadoutGeometryBuilder

Classes

struct  Config
 

Public Types

using Path_t = GeoNodePath
 Identification of a single node in ROOT geometry. More...
 

Public Member Functions

 WireReadoutGeomBuilderStandard (fhicl::Table< Config > const &config)
 
 WireReadoutGeomBuilderStandard (fhicl::ParameterSet const &pset)
 

Private Member Functions

Planes_t doExtractPlanes (Path_t &path) const override
 
PlaneGeo makePlane (Path_t &path) const
 
std::vector< WireGeoextractWires (Path_t &path) const
 
WireGeo makeWire (Path_t const &path) const
 

Private Attributes

GeometryExtractor fExtractObjects
 

Cryostat information

Planes_t extractPlanes (Path_t path) const
 Looks for all cryostats under the specified path. More...
 
using Planes_t = std::map< std::size_t, std::vector< PlaneGeo >>
 Collection of wire-plane information objects. More...
 

Detailed Description

Extracts of LArSoft geometry information from ROOT.

The builder manages several components, each devoted to the extraction of a specific type of geometry object (e.g. cryostat, or wire plane within a TPC).

Further customization notes

This builder does not extend the interface of geo::GeometryBuilder, but it defines a protected interface that other builder classes could override to customize single elements of the build. As long as the interface is complied to, the different components are interchangeable.

If instead a different interface is needed for one component, the parent component needs to be customised too. For example, if the signature of doExtractPlanes() is changed, also doMakePlane() needs to be customized to correctly call the previous. In that case, take care of deleting the inherited interface to avoid confusion and errors.

Technical notes on customization

The internal structure of the builder follows the pattern already employed in the base class. The base class defines both the public interface and the implementation, but it separates the two leaving the former as non-virtual functions, and the latter as virtual functions accessible only by derived classes.

The geo::GeometryBuilderStandard class replicates this pattern in a more hidden level. The general flow of the algorithm is a top-down crawl of the geometry tree structure, where the top objects (cryostats and auxiliary detectors) are discovered and built, and each of these objects takes care of discovering its own relevant components. Therefore e.g. the cryostat algorithm will, once found a candidate cryostat, descend into it to discover TPCs and optical detectors. This nested discovery is delegated to other algorithms, and e.g. the TPC algorithm will take care of creating a TPC and populating it with wire planes whose discovery is again delegated to another algorithm.

The interface of these algorithms is fixed and is part of the protected class interface, in a way mirroring geo::GeometryBuilder in that it does not rely on virtuality, but entirely protected. The implementation is also in the protected space.

Each component type has five elements:

  • a type describing a collection of the object of this component; this is integral part of the protected interface
  • an interface to create an object for a single component, called makeXxx(), expected to rely on its implementation method doMakeXxx()
  • an interface to discover all the components of this type, and creating them; it is called extractXxx() and it logically relies on makeXxx(), expected to rely on its implementation method doExtractXxx()
  • a virtual implementation method of the component creation routine, called doMakeXxx() and expected to invoke the extractYyy() interface of all the subcomponents nested inside it
  • a virtual implementation method of the component discovery routine, called doExtractXxx() and expected to invoke the makeYyy() interface of all the subcomponents nested inside it

The discovery interface and the collection type of two of these components are directly part of the public interface inherited from geo::GeometryBuilder.

Definition at line 90 of file WireReadoutGeomBuilderStandard.h.

Member Typedef Documentation

Identification of a single node in ROOT geometry.

Definition at line 41 of file WireReadoutGeometryBuilder.h.

using geo::WireReadoutGeometryBuilder::Planes_t = std::map<std::size_t, std::vector<PlaneGeo>>
inherited

Collection of wire-plane information objects.

Definition at line 56 of file WireReadoutGeometryBuilder.h.

Constructor & Destructor Documentation

geo::WireReadoutGeomBuilderStandard::WireReadoutGeomBuilderStandard ( fhicl::Table< Config > const &  config)
explicit

Definition at line 37 of file WireReadoutGeomBuilderStandard.cxx.

39  : fExtractObjects(config().extractor())
40 {}
geo::WireReadoutGeomBuilderStandard::WireReadoutGeomBuilderStandard ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 42 of file WireReadoutGeomBuilderStandard.cxx.

Member Function Documentation

auto geo::WireReadoutGeomBuilderStandard::doExtractPlanes ( Path_t path) const
overrideprivatevirtual

Implements geo::WireReadoutGeometryBuilder.

Definition at line 46 of file WireReadoutGeomBuilderStandard.cxx.

References fExtractObjects, makePlane(), and geo::GeoNodePath::parent_entry().

47 {
48  Planes_t result;
49  fExtractObjects(path, isPlaneNode, [&result, this](Path_t& path) {
50  auto const [tpc, tpc_hash] = path.parent_entry();
51  assert(tpc);
52  result[tpc_hash].push_back(makePlane(path));
53  });
54  return result;
55 }
GeoNodePath Path_t
Identification of a single node in ROOT geometry.
std::map< std::size_t, std::vector< PlaneGeo >> Planes_t
Collection of wire-plane information objects.
Planes_t geo::WireReadoutGeometryBuilder::extractPlanes ( Path_t  path) const
inlineinherited

Looks for all cryostats under the specified path.

Parameters
pathpath pointing to the starting node
Returns
a list of fully constructed planes, keyed by TPC TGeoVolume pointer

The planes contain all their inner elements. The current node itself of the path is also considered as plane candidate, then it is descended into.

Definition at line 66 of file WireReadoutGeometryBuilder.h.

References geo::WireReadoutGeometryBuilder::doExtractPlanes().

66 { return doExtractPlanes(path); }
virtual Planes_t doExtractPlanes(Path_t &path) const =0
std::vector< geo::WireGeo > geo::WireReadoutGeomBuilderStandard::extractWires ( Path_t path) const
private

Definition at line 64 of file WireReadoutGeomBuilderStandard.cxx.

References fExtractObjects, and makeWire().

Referenced by makePlane().

65 {
66  std::vector<WireGeo> result;
68  path, isWireNode, [&result, this](Path_t const& path) { result.push_back(makeWire(path)); });
69  return result;
70 }
WireGeo makeWire(Path_t const &path) const
GeoNodePath Path_t
Identification of a single node in ROOT geometry.
geo::PlaneGeo geo::WireReadoutGeomBuilderStandard::makePlane ( Path_t path) const
private

Definition at line 58 of file WireReadoutGeomBuilderStandard.cxx.

References geo::GeoNodePath::current(), geo::GeoNodePath::currentTransformation(), and extractWires().

Referenced by doExtractPlanes().

59 {
60  return {path.current(), path.currentTransformation<TransformationMatrix>(), extractWires(path)};
61 }
std::vector< WireGeo > extractWires(Path_t &path) const
ROOT::Math::Transform3D TransformationMatrix
Type of transformation matrix used in geometry.
geo::WireGeo geo::WireReadoutGeomBuilderStandard::makeWire ( Path_t const &  path) const
private

Definition at line 73 of file WireReadoutGeomBuilderStandard.cxx.

References geo::GeoNodePath::current(), and geo::GeoNodePath::currentTransformation().

Referenced by extractWires().

74 {
75  return {path.current(), path.currentTransformation<TransformationMatrix>()};
76 }
ROOT::Math::Transform3D TransformationMatrix
Type of transformation matrix used in geometry.

Member Data Documentation

GeometryExtractor geo::WireReadoutGeomBuilderStandard::fExtractObjects
private

Definition at line 99 of file WireReadoutGeomBuilderStandard.h.

Referenced by doExtractPlanes(), and extractWires().


The documentation for this class was generated from the following files: