LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Extracts of LArSoft geometry information from ROOT. More...
#include "GeometryBuilderStandard.h"
Classes | |
struct | Config |
Configuration parameters. More... | |
Public Types | |
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... | |
Public Member Functions | |
GeometryBuilderStandard (Config const &config) | |
template<typename ObjGeo > | |
geo::GeometryBuilder::GeoColl_t< ObjGeo > | doExtractGeometryObjects (Path_t &path, std::function< bool(TGeoNode const &)> const IsObj, ObjGeo(GeometryBuilderStandard::*MakeObj)(Path_t &)) |
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... | |
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 > | |
GeoColl_t< ObjGeo > | doExtractGeometryObjects (Path_t &path, std::function< bool(TGeoNode const &)> IsObj, ObjGeo(geo::GeometryBuilderStandard::*MakeObj)(Path_t &)) |
Boilerplate implementation of doExtractXxxx() methods. More... | |
Cryostat information | |
Cryostats_t | extractCryostats (Path_t const &path) |
Looks for all cryostats under the specified path. More... | |
using | Cryostats_t = GeoColl_t< geo::CryostatGeo > |
Collection of cryostat information objects. More... | |
Auxiliary detector information | |
AuxDets_t | extractAuxiliaryDetectors (Path_t const &path) |
Looks for all auxiliary detectors under the specified path. More... | |
using | AuxDets_t = GeoColl_t< geo::AuxDetGeo > |
Collection of auxiliary detector information objects. More... | |
Auxiliary detector sensitive volume information | |
using | AuxDetSensitive_t = GeoColl_t< geo::AuxDetSensitiveGeo > |
Looks for all auxiliary detectors under the specified path. More... | |
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 > |
Looks for all optical detectors under the specified path. More... | |
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 > |
Looks for all TPCs under the specified path. More... | |
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 > |
Looks for all wire planes under the specified path. More... | |
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 > |
Looks for all wires under the specified path. More... | |
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... | |
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.
|
inherited |
Collection of auxiliary detector information objects.
Definition at line 101 of file GeometryBuilder.h.
|
protected |
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 166 of file GeometryBuilderStandard.h.
|
inherited |
Collection of cryostat information objects.
Definition at line 76 of file GeometryBuilder.h.
|
inherited |
Type of direct collection of geometry objects.
Definition at line 61 of file GeometryBuilder.h.
|
protected |
Looks for all optical detectors under the specified path.
path | path pointing to the starting node |
Definition at line 227 of file GeometryBuilderStandard.h.
|
inherited |
Identification of a single node in ROOT geometry.
Definition at line 57 of file GeometryBuilder.h.
|
protected |
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 291 of file GeometryBuilderStandard.h.
|
protected |
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 258 of file GeometryBuilderStandard.h.
|
protected |
Looks for all wires under the specified path.
path | path pointing to the starting node |
Definition at line 324 of file GeometryBuilderStandard.h.
geo::GeometryBuilderStandard::GeometryBuilderStandard | ( | Config const & | config | ) |
Definition at line 69 of file GeometryBuilderStandard.cxx.
|
protectedvirtual |
Core implementation of extractAuxDetSensitive()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Definition at line 92 of file GeometryBuilderStandard.cxx.
References doExtractGeometryObjects(), and makeAuxDetSensitive().
Referenced by extractAuxDetSensitive(), and makeAuxDetSensitive().
|
overrideprotectedvirtual |
Core implementation of extractCryostats()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Implements geo::GeometryBuilder.
Definition at line 74 of file GeometryBuilderStandard.cxx.
References doExtractGeometryObjects(), and doMakeAuxDet().
Referenced by makeAuxDet().
|
overrideprotectedvirtual |
Core implementation of extractCryostats()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Implements geo::GeometryBuilder.
Definition at line 105 of file GeometryBuilderStandard.cxx.
References doExtractGeometryObjects(), and makeCryostat().
Referenced by makeCryostat().
geo::GeometryBuilder::GeoColl_t<ObjGeo> geo::GeometryBuilderStandard::doExtractGeometryObjects | ( | Path_t & | path, |
std::function< bool(TGeoNode const &)> const | IsObj, | ||
ObjGeo(GeometryBuilderStandard::*)(Path_t &) | MakeObj | ||
) |
Definition at line 175 of file GeometryBuilderStandard.cxx.
References geo::GeoNodePath::append(), geo::GeoNodePath::current(), geo::GeoNodePath::depth(), doExtractGeometryObjects(), fMaxDepth, n, and geo::GeoNodePath::pop().
|
private |
Boilerplate implementation of doExtractXxxx()
methods.
ObjGeo | the geometry object being extracted (e.g. geo::WireGeo ) |
path | the path to the node describing the object |
IsObj | function to identify if a node is of the right type |
MakeObj | class method creating the target object from a path |
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. Referenced by doExtractAuxDetSensitive(), doExtractAuxiliaryDetectors(), doExtractCryostats(), doExtractGeometryObjects(), doExtractOpDets(), doExtractPlanes(), doExtractTPCs(), doExtractWires(), and makeWire().
|
protectedvirtual |
Core implementation of extractOpDets()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Definition at line 121 of file GeometryBuilderStandard.cxx.
References doExtractGeometryObjects(), fOpDetGeoName, and makeOpDet().
Referenced by extractOpDets(), and makeOpDet().
|
protectedvirtual |
Core implementation of extractPlanes()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Definition at line 149 of file GeometryBuilderStandard.cxx.
References doExtractGeometryObjects(), and makePlane().
Referenced by extractPlanes(), and makePlane().
|
protectedvirtual |
Core implementation of extractTPCs()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Definition at line 136 of file GeometryBuilderStandard.cxx.
References doExtractGeometryObjects(), and makeTPC().
Referenced by extractTPCs(), and makeTPC().
|
protectedvirtual |
Core implementation of extractWires()
.
The actual algorithm is specialization of doExtractGeometryObjects()
.
Reimplemented in geo::GeometryBuilderWireless.
Definition at line 162 of file GeometryBuilderStandard.cxx.
References doExtractGeometryObjects(), and makeWire().
Referenced by extractWires(), and makeWire().
|
protectedvirtual |
Core implementation of extractAuxiliaryDetectors()
.
Definition at line 82 of file GeometryBuilderStandard.cxx.
References geo::GeoNodePath::current(), geo::GeoNodePath::currentTransformation(), and extractAuxDetSensitive().
Referenced by doExtractAuxiliaryDetectors(), and makeAuxDet().
|
protectedvirtual |
Core implementation of makeAuxDetSensitive()
.
Definition at line 99 of file GeometryBuilderStandard.cxx.
References geo::GeoNodePath::current(), and geo::GeoNodePath::currentTransformation().
Referenced by makeAuxDetSensitive().
|
protectedvirtual |
Core implementation of extractAuxDetSensitive()
.
Definition at line 112 of file GeometryBuilderStandard.cxx.
References geo::GeoNodePath::current(), geo::GeoNodePath::currentTransformation(), extractOpDets(), and extractTPCs().
Referenced by makeCryostat().
|
protectedvirtual |
Core implementation of makeOpDet()
.
Definition at line 130 of file GeometryBuilderStandard.cxx.
References geo::GeoNodePath::current(), and geo::GeoNodePath::currentTransformation().
Referenced by makeOpDet().
|
protectedvirtual |
Core implementation of makePlanes()
.
Definition at line 155 of file GeometryBuilderStandard.cxx.
References geo::GeoNodePath::current(), geo::GeoNodePath::currentTransformation(), and extractWires().
Referenced by makePlane().
|
protectedvirtual |
Core implementation of makeTPC()
.
Definition at line 142 of file GeometryBuilderStandard.cxx.
References geo::GeoNodePath::current(), geo::GeoNodePath::currentTransformation(), and extractPlanes().
Referenced by makeTPC().
|
protectedvirtual |
Core implementation of makeWire()
.
Definition at line 168 of file GeometryBuilderStandard.cxx.
References geo::GeoNodePath::current(), and geo::GeoNodePath::currentTransformation().
Referenced by makeWire().
|
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 179 of file GeometryBuilderStandard.h.
References doExtractAuxDetSensitive().
Referenced by doMakeAuxDet().
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.
Definition at line 112 of file GeometryBuilder.h.
References geo::GeometryBuilder::doExtractAuxiliaryDetectors(), and geo::GeometryBuilder::doExtractCryostats().
Referenced by geo::GeometryCore::BuildGeometry(), and geo::AuxDetGeometryCore::LoadGeometryFile().
|
inlineinherited |
Looks for all cryostats under the specified path.
path | path pointing to the starting node |
The cryostats contain all their inner elements. The current node itself of the path is also considered as cryostat candidate, then it is descended into.
Definition at line 87 of file GeometryBuilder.h.
References geo::GeometryBuilder::doExtractCryostats().
Referenced by geo::GeometryCore::BuildGeometry().
Looks for all optical detectors under the specified path.
path | path pointing to the starting node |
Definition at line 234 of file GeometryBuilderStandard.h.
References doExtractOpDets().
Referenced by doMakeCryostat().
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 300 of file GeometryBuilderStandard.h.
References doExtractPlanes().
Referenced by doMakeTPC().
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 267 of file GeometryBuilderStandard.h.
References doExtractTPCs().
Referenced by doMakeCryostat().
Looks for all wires under the specified path.
path | path pointing to the starting node |
Definition at line 332 of file GeometryBuilderStandard.h.
References doExtractWires().
Referenced by doMakePlane().
|
inlineprotected |
Constructs a geo::AuxDetGeo
from the current node of the path
.
Definition at line 149 of file GeometryBuilderStandard.h.
References doExtractAuxiliaryDetectors(), and doMakeAuxDet().
|
inlineprotected |
Constructs a geo::AuxDetSensitiveGeo
from the current node of the path
.
Definition at line 187 of file GeometryBuilderStandard.h.
References doExtractAuxDetSensitive(), and doMakeAuxDetSensitive().
Referenced by doExtractAuxDetSensitive().
|
inlineprotected |
Constructs a geo::CryostatGeo
from the current node of the path
.
Definition at line 210 of file GeometryBuilderStandard.h.
References doExtractCryostats(), and doMakeCryostat().
Referenced by doExtractCryostats().
|
inlineprotected |
Constructs a geo::OpDetGeo
from the current node of the path
.
Definition at line 241 of file GeometryBuilderStandard.h.
References doExtractOpDets(), and doMakeOpDet().
Referenced by doExtractOpDets().
|
inlineprotected |
Constructs a geo::PlaneGeo
from the current node of the path
.
Definition at line 307 of file GeometryBuilderStandard.h.
References doExtractPlanes(), and doMakePlane().
Referenced by doExtractPlanes().
|
inlineprotected |
Constructs a geo::TPCGeo
from the current node of the path
.
Definition at line 274 of file GeometryBuilderStandard.h.
References doExtractTPCs(), and doMakeTPC().
Referenced by doExtractTPCs().
|
inlineprotected |
Constructs a geo::WireGeo
from the current node of the path
.
Definition at line 339 of file GeometryBuilderStandard.h.
References doExtractGeometryObjects(), doExtractWires(), and doMakeWire().
Referenced by doExtractWires().
|
protected |
Maximum level to descend into in the path.
Definition at line 137 of file GeometryBuilderStandard.h.
Referenced by doExtractGeometryObjects().
|
protected |
Name of the optical detector nodes.
Definition at line 140 of file GeometryBuilderStandard.h.
Referenced by doExtractOpDets().