19 #include <string_view> 24 template <
typename Dest,
typename Src>
25 void extendCollection(Dest& dest, Src&& src)
27 std::move(src.begin(), src.end(), std::back_inserter(dest));
32 bool starts_with(std::string_view
const s, std::string_view
const key)
34 return s.compare(0, key.size(), key) == 0;
37 bool isAuxDetNode(TGeoNode
const& node)
39 return starts_with(node.GetName(),
"volAuxDet"sv);
41 bool isAuxDetSensitiveNode(TGeoNode
const& node)
43 return std::string_view(node.GetName()).find(
"Sensitive") != std::string_view::npos;
45 bool isCryostatNode(TGeoNode
const& node)
47 return starts_with(node.GetName(),
"volCryostat"sv);
50 bool isOpDetNode(TGeoNode
const& node, std::string_view
const opDetGeoName)
52 return starts_with(node.GetName(), opDetGeoName);
54 bool isTPCNode(TGeoNode
const& node)
56 return starts_with(node.GetName(),
"volTPC"sv);
58 bool isPlaneNode(TGeoNode
const& node)
60 return starts_with(node.GetName(),
"volTPCPlane"sv);
62 bool isWireNode(TGeoNode
const& node)
64 return starts_with(node.GetName(),
"volTPCWire"sv);
70 : fMaxDepth(config.maxDepth()), fOpDetGeoName(config.opDetGeoName())
125 [
this](
auto const& node) {
return isOpDetNode(node,
fOpDetGeoName); },
174 template <
typename ObjGeo>
177 std::function<
bool(TGeoNode
const&)>
const IsObj,
186 objs.push_back((this->*MakeObj)(path));
195 TGeoVolume
const* volume = path.
current().GetVolume();
196 int const n = volume->GetNdaughters();
197 for (
int i = 0; i <
n; ++i) {
198 path.
append(*volume->GetNode(i));
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
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.
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.
GeoColl_t< ObjGeo > doExtractGeometryObjects(Path_t &path, std::function< bool(TGeoNode const &)> IsObj, ObjGeo(geo::GeometryBuilderStandard::*MakeObj)(Path_t &))
Boilerplate implementation of doExtractXxxx() methods.
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().
virtual AuxDetSensitive_t doExtractAuxDetSensitive(Path_t &path)
Geometry information for a single cryostat.
void append(Node_t const &node)
Adds a node to the current path.
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.
void pop()
Removes the current node from the path, moving the current one up.
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...
virtual TPCs_t doExtractTPCs(Path_t &path)
Configuration parameters.
GeoColl_t< geo::CryostatGeo > Cryostats_t
Collection of cryostat information objects.
Path_t::Depth_t fMaxDepth
Maximum level to descend into in the path.
Matrix currentTransformation() const
Returns the total transformation to the current node, as a Matrix.
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.
GeoColl_t< geo::OpDetGeo > OpDets_t
Looks for all optical detectors under the specified path.
Standard implementation of geometry extractor.
Wires_t extractWires(Path_t &path)
Looks for all wires under the specified path.
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.
Representation of a node and its ancestry.
Node_t const & current() const
Returns the current node. Undefined if the path is empty.
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.
Depth_t depth() const
Returns the depth of the path (elements including up to the current).
ROOT::Math::Transform3D TransformationMatrix
Type of transformation matrix used in geometry.
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)