Extracts of LArSoft geometry information from ROOT. More...
#include <GeometryBuilderStandard.h>
Classes | |
struct | Config |
Configuration parameters. More... | |
Public Member Functions | |
GeometryBuilderStandard (Config const &config) | |
template<typename ObjGeo , bool(geo::GeometryBuilderStandard::*)(TGeoNode const &) const IsObj, ObjGeo(geo::GeometryBuilderStandard::*)(geo::GeometryBuilder::Path_t &) MakeObj> | |
geo::GeometryBuilder::GeoColl_t< ObjGeo > | doExtractGeometryObjects (Path_t &path) |
Public Member Functions inherited from geo::GeometryBuilder | |
virtual | ~GeometryBuilder ()=default |
Virtual destructor. More... | |
Cryostats_t | extractCryostats (Path_t const &path) |
Looks for all cryostats under the specified path. More... | |
AuxDets_t | extractAuxiliaryDetectors (Path_t const &path) |
Looks for all auxiliary detectors under the specified path. More... | |
Protected Member Functions | |
Auxiliary detector information | |
geo::AuxDetGeo | makeAuxDet (Path_t &path) |
Constructs a geo::AuxDetGeo from the current node of the path . More... | |
virtual AuxDets_t | doExtractAuxiliaryDetectors (Path_t &path) override |
virtual geo::AuxDetGeo | doMakeAuxDet (Path_t &path) |
Core implementation of extractAuxiliaryDetectors() . More... | |
Cryostat information | |
geo::CryostatGeo | makeCryostat (Path_t &path) |
Constructs a geo::CryostatGeo from the current node of the path . More... | |
virtual Cryostats_t | doExtractCryostats (Path_t &path) override |
virtual geo::CryostatGeo | doMakeCryostat (Path_t &path) |
Core implementation of extractAuxDetSensitive() . More... | |
Node type identification | |
These are implementation details of | |
bool | isAuxDetNode (TGeoNode const &node) const |
bool | isAuxDetSensitiveNode (TGeoNode const &node) const |
bool | isCryostatNode (TGeoNode const &node) const |
Returns whether the specified node is recognised as a cryostat. More... | |
bool | isOpDetNode (TGeoNode const &node) const |
Returns whether the specified node is recognised as a optical detector. More... | |
bool | isTPCNode (TGeoNode const &node) const |
Returns whether the specified node is recognised as a TPC. More... | |
bool | isPlaneNode (TGeoNode const &node) const |
Returns whether the specified node is recognised as a wire plane. More... | |
bool | isWireNode (TGeoNode const &node) const |
Returns whether the specified node is recognised as a wire. More... | |
Static Protected Member Functions | |
static bool | starts_with (std::string_view const &s, std::string_view const &key) |
Protected Attributes | |
Path_t::Depth_t | fMaxDepth = std::numeric_limits<Path_t::Depth_t>::max() |
Maximum level to descend into in the path. More... | |
std::string | fOpDetGeoName = "volOpDetSensitive" |
Name of the optical detector nodes. More... | |
Private Member Functions | |
template<typename ObjGeo , bool(geo::GeometryBuilderStandard::*)(TGeoNode const &) const IsObj, ObjGeo(geo::GeometryBuilderStandard::*)(Path_t &) MakeObj> | |
GeoColl_t< ObjGeo > | doExtractGeometryObjects (Path_t &path) |
Boilerplate implementation of doExtractXxxx() methods. More... | |
Auxiliary detector sensitive volume information | |
using | AuxDetSensitive_t = GeoColl_t< geo::AuxDetSensitiveGeo > |
AuxDetSensitive_t | extractAuxDetSensitive (Path_t &path) |
Looks for all auxiliary detectors under the specified path. More... | |
geo::AuxDetSensitiveGeo | makeAuxDetSensitive (Path_t &path) |
virtual AuxDetSensitive_t | doExtractAuxDetSensitive (Path_t &path) |
virtual geo::AuxDetSensitiveGeo | doMakeAuxDetSensitive (Path_t &path) |
Core implementation of makeAuxDetSensitive() . More... | |
Optical detector information | |
using | OpDets_t = GeoColl_t< geo::OpDetGeo > |
OpDets_t | extractOpDets (Path_t &path) |
Looks for all optical detectors under the specified path. More... | |
geo::OpDetGeo | makeOpDet (Path_t &path) |
Constructs a geo::OpDetGeo from the current node of the path . More... | |
virtual OpDets_t | doExtractOpDets (Path_t &path) |
virtual geo::OpDetGeo | doMakeOpDet (Path_t &path) |
Core implementation of makeOpDet() . More... | |
TPC information | |
using | TPCs_t = GeoColl_t< geo::TPCGeo > |
TPCs_t | extractTPCs (Path_t &path) |
Looks for all TPCs under the specified path. More... | |
geo::TPCGeo | makeTPC (Path_t &path) |
Constructs a geo::TPCGeo from the current node of the path . More... | |
virtual TPCs_t | doExtractTPCs (Path_t &path) |
virtual geo::TPCGeo | doMakeTPC (Path_t &path) |
Core implementation of makeTPC() . More... | |
Wire plane information | |
using | Planes_t = GeoColl_t< geo::PlaneGeo > |
Planes_t | extractPlanes (Path_t &path) |
Looks for all wire planes under the specified path. More... | |
geo::PlaneGeo | makePlane (Path_t &path) |
Constructs a geo::PlaneGeo from the current node of the path . More... | |
virtual Planes_t | doExtractPlanes (Path_t &path) |
virtual geo::PlaneGeo | doMakePlane (Path_t &path) |
Core implementation of makePlanes() . More... | |
Wire information | |
using | Wires_t = GeoColl_t< geo::WireGeo > |
Wires_t | extractWires (Path_t &path) |
Looks for all wires under the specified path. More... | |
geo::WireGeo | makeWire (Path_t &path) |
Constructs a geo::WireGeo from the current node of the path . More... | |
virtual Wires_t | doExtractWires (Path_t &path) |
virtual geo::WireGeo | doMakeWire (Path_t &path) |
Core implementation of makeWire() . More... | |
Additional Inherited Members | |
Public Types inherited from geo::GeometryBuilder | |
using | Path_t = geo::GeoNodePath |
Identification of a single node in ROOT geometry. More... | |
template<typename GeoObj > | |
using | GeoColl_t = std::vector< GeoObj > |
Type of direct collection of geometry objects. More... | |
using | Cryostats_t = GeoColl_t< geo::CryostatGeo > |
Collection of cryostat information objects. More... | |
using | AuxDets_t = GeoColl_t< geo::AuxDetGeo > |
Collection of auxiliary detector information objects. More... | |
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).
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.
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:
makeXxx()
, expected to rely on its implementation method doMakeXxx()
extractXxx()
and it logically relies on makeXxx()
, expected to rely on its implementation method doExtractXxx()
doMakeXxx()
and expected to invoke the extractYyy()
interface of all the subcomponents nested inside itdoExtractXxx()
and expected to invoke the makeYyy()
interface of all the subcomponents nested inside itThe 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 106 of file GeometryBuilderStandard.h.
|
protected |
Definition at line 172 of file GeometryBuilderStandard.h.
|
protected |
Definition at line 233 of file GeometryBuilderStandard.h.
|
protected |
Definition at line 297 of file GeometryBuilderStandard.h.
|
protected |
Definition at line 264 of file GeometryBuilderStandard.h.
|
protected |
Definition at line 330 of file GeometryBuilderStandard.h.
geo::GeometryBuilderStandard::GeometryBuilderStandard | ( | Config const & | config | ) |
Definition at line 39 of file GeometryBuilderStandard.cxx.
|
protectedvirtual |
Core implementation of extractAuxDetSensitive()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Definition at line 72 of file GeometryBuilderStandard.cxx.
|
overrideprotectedvirtual |
Core implementation of extractCryostats()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Implements geo::GeometryBuilder.
Definition at line 47 of file GeometryBuilderStandard.cxx.
|
overrideprotectedvirtual |
Core implementation of extractCryostats()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Implements geo::GeometryBuilder.
Definition at line 93 of file GeometryBuilderStandard.cxx.
geo::GeometryBuilder::GeoColl_t<ObjGeo> geo::GeometryBuilderStandard::doExtractGeometryObjects | ( | Path_t & | path | ) |
Definition at line 263 of file GeometryBuilderStandard.cxx.
|
private |
Boilerplate implementation of doExtractXxxx()
methods.
ObjGeo | the geometry object being extracted (e.g. geo::WireGeo ) |
IsObj | function to identify if a node is of the right type |
MakeObj | class method creating the target object from a path |
path | the path to the node describing the object |
ObjGeo
This implementation first evaluates if the current node in the specified path is suitable to create a ObjGeo
; if not, then it descends into the node daughters and recursively to their descendents. For each candidate node, a ObjGeo
is created. All descendents of the candidates are ignored.
path
is allowed to change during processing.
|
protectedvirtual |
Core implementation of extractOpDets()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Definition at line 119 of file GeometryBuilderStandard.cxx.
|
protectedvirtual |
Core implementation of extractPlanes()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Definition at line 161 of file GeometryBuilderStandard.cxx.
|
protectedvirtual |
Core implementation of extractTPCs()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Definition at line 138 of file GeometryBuilderStandard.cxx.
|
protectedvirtual |
Core implementation of extractWires()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Reimplemented in geo::GeometryBuilderWireless.
Definition at line 184 of file GeometryBuilderStandard.cxx.
|
protectedvirtual |
Core implementation of extractAuxiliaryDetectors()
.
Definition at line 60 of file GeometryBuilderStandard.cxx.
|
protectedvirtual |
Core implementation of makeAuxDetSensitive()
.
Definition at line 84 of file GeometryBuilderStandard.cxx.
|
protectedvirtual |
Core implementation of extractAuxDetSensitive()
.
Definition at line 106 of file GeometryBuilderStandard.cxx.
|
protectedvirtual |
Core implementation of makeOpDet()
.
Definition at line 130 of file GeometryBuilderStandard.cxx.
|
protectedvirtual |
Core implementation of makePlanes()
.
Definition at line 174 of file GeometryBuilderStandard.cxx.
|
protectedvirtual |
Core implementation of makeTPC()
.
Definition at line 151 of file GeometryBuilderStandard.cxx.
|
protectedvirtual |
Core implementation of makeWire()
.
Definition at line 197 of file GeometryBuilderStandard.cxx.
|
inlineprotected |
Looks for all auxiliary detectors under the specified path.
path | path pointing to the starting node |
The auxiliary detectors contain all their inner elements. The current node itself of the path is also considered as auxiliary detector candidate, then it is descended into.
path
is allowed to change during processing. Definition at line 185 of file GeometryBuilderStandard.h.
Looks for all optical detectors under the specified path.
path | path pointing to the starting node |
Definition at line 240 of file GeometryBuilderStandard.h.
Looks for all wire planes under the specified path.
path | path pointing to the starting node |
Each plane has its own wires already in.
Definition at line 306 of file GeometryBuilderStandard.h.
Looks for all TPCs under the specified path.
path | path pointing to the starting node |
Each TPC has its own wire planes already in.
Definition at line 273 of file GeometryBuilderStandard.h.
Looks for all wires under the specified path.
path | path pointing to the starting node |
Definition at line 338 of file GeometryBuilderStandard.h.
|
protected |
Returns whether the specified node is recognised as auxiliary detector.
Definition at line 206 of file GeometryBuilderStandard.cxx.
|
protected |
Returns whether the specified node is recognised as sensitive volume of auxiliary detector.
Definition at line 214 of file GeometryBuilderStandard.cxx.
|
protected |
Returns whether the specified node is recognised as a cryostat.
Definition at line 222 of file GeometryBuilderStandard.cxx.
|
protected |
Returns whether the specified node is recognised as a optical detector.
Definition at line 229 of file GeometryBuilderStandard.cxx.
|
protected |
Returns whether the specified node is recognised as a wire plane.
Definition at line 243 of file GeometryBuilderStandard.cxx.
|
protected |
Returns whether the specified node is recognised as a TPC.
Definition at line 236 of file GeometryBuilderStandard.cxx.
|
protected |
Returns whether the specified node is recognised as a wire.
Definition at line 250 of file GeometryBuilderStandard.cxx.
|
inlineprotected |
Constructs a geo::AuxDetGeo
from the current node of the path
.
Definition at line 152 of file GeometryBuilderStandard.h.
|
inlineprotected |
Constructs a geo::AuxDetSensitiveGeo
from the current node of the path
.
Definition at line 190 of file GeometryBuilderStandard.h.
|
inlineprotected |
Constructs a geo::CryostatGeo
from the current node of the path
.
Definition at line 213 of file GeometryBuilderStandard.h.
|
inlineprotected |
Constructs a geo::OpDetGeo
from the current node of the path
.
Definition at line 244 of file GeometryBuilderStandard.h.
|
inlineprotected |
Constructs a geo::PlaneGeo
from the current node of the path
.
Definition at line 310 of file GeometryBuilderStandard.h.
|
inlineprotected |
Constructs a geo::TPCGeo
from the current node of the path
.
Definition at line 277 of file GeometryBuilderStandard.h.
|
inlineprotected |
Constructs a geo::WireGeo
from the current node of the path
.
Definition at line 342 of file GeometryBuilderStandard.h.
|
inlinestaticprotected |
Returns whether the start of s
matches the full key
.
s.starts_with(key)
). Definition at line 396 of file GeometryBuilderStandard.h.
|
protected |
Maximum level to descend into in the path.
Definition at line 139 of file GeometryBuilderStandard.h.
|
protected |
Name of the optical detector nodes.
Definition at line 142 of file GeometryBuilderStandard.h.