8 #ifndef LARCOREALG_GEOMETRY_GEOMETRYCORE_H 9 #define LARCOREALG_GEOMETRY_GEOMETRYCORE_H 104 std::unique_ptr<GeometryBuilder> builder,
105 std::unique_ptr<GeoObjectSorter> sorter);
167 void WorldBox(
double* xlo,
double* xhi,
double* ylo,
double* yhi,
double* zlo,
double* zhi)
224 std::vector<TGeoNode const*>
FindAllVolumes(std::set<std::string>
const& vol_names)
const;
240 std::set<std::string>
const& vol_names)
const;
277 template <
typename Stream>
278 void Print(Stream&& out, std::string
indent =
" ")
const;
282 std::string
Info(std::string
indent =
" ")
const;
432 return pCryo ? pCryo->
HasTPC(tpcid) :
false;
466 return pCryo ? pCryo->
TPCPtr(tpcid) :
nullptr;
591 unsigned int OpDetFromCryo(
unsigned int o,
unsigned int c)
const;
617 std::string
const& name =
"volDetEnclosure")
const;
619 bool FindFirstVolume(std::string
const& name, std::vector<GeoNodePathEntry>& path)
const;
632 template <
typename Stream>
640 << indent <<
"Detector enclosure: " << detEnclosureBox.Min() <<
" -- " 641 << detEnclosureBox.Max() <<
" cm => ( " << detEnclosureBox.SizeX() <<
" x " 642 << detEnclosureBox.SizeY() <<
" x " << detEnclosureBox.SizeZ() <<
" ) cm^3";
644 for (
auto const& cryostat : Iterate<CryostatGeo>()) {
646 cryostat.PrintCryostatInfo(std::forward<Stream>(out), indent +
" ", cryostat.MaxVerbosity);
648 unsigned const int nTPCs = cryostat.NTPC();
649 for (
unsigned int t = 0; t < nTPCs; ++t) {
650 TPCGeo const& tpc = cryostat.TPC(t);
652 out <<
"\n" << indent <<
" ";
656 unsigned int nOpDets = cryostat.NOpDet();
657 for (
unsigned int iOpDet = 0; iOpDet < nOpDets; ++iOpDet) {
658 OpDetGeo const& opDet = cryostat.OpDet(iOpDet);
659 out <<
"\n" << indent <<
" [OpDet #" << iOpDet <<
"] ";
668 #endif // LARCOREALG_GEOMETRY_GEOMETRYCORE_H
CryostatGeo const * PositionToCryostatPtr(Point_t const &point) const
Returns the cryostat at specified location.
std::string const & GetWorldVolumeName() const
Return the name of the world volume (needed by Geant4 simulation)
void PrintTPCInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this TPC.
unsigned int TotalNTPC() const
Returns the total number of TPCs in the detector.
Encapsulate the construction of a single cyostat .
double Length_t
Type used for coordinates and distances. They are measured in centimeters.
Encapsulate the geometry of the sensitive portion of an auxiliary detector .
std::vector< GeoNodePathEntry > FindDetectorEnclosure(std::string const &name="volDetEnclosure") const
void Print(Stream &&out, std::string indent=" ") const
Prints geometry information with maximum verbosity.
unsigned int NTPC(CryostatID const &cryoid=details::cryostat_zero) const
Returns the total number of TPCs in the specified cryostat.
CryostatList_t fCryostats
unsigned int GetClosestOpDet(Point_t const &point) const
Find the nearest OpChannel to some point.
CryostatGeo const * GetElementPtr(CryostatID const &cryoid) const
Returns the specified cryostat.
Geometry information for a single TPC.
BoxBoundedGeo DetectorEnclosureBox(std::string const &name="volDetEnclosure") const
double fSurfaceY
The point where air meets earth for this detector.
TGeoVolume const * WorldVolume() const
Returns a pointer to the world volume.
Interface for geometry extractor classes.
CryostatID_t Cryostat
Index of cryostat.
TGeoMaterial const * Material(Point_t const &point) const
Returns the material at the specified position.
Geometry information for a single cryostat.
CryostatGeo const & GetElement(CryostatID const &cryoid) const
Returns the specified cryostat.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
CryostatGeo const & PositionToCryostat(Point_t const &point) const
Returns the cryostat at specified location.
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
Length_t SurfaceY() const
The position of the detector respect to earth surface.
std::string OpDetGeoName(CryostatID const &cid=details::cryostat_zero) const
Returns gdml string which gives sensitive opdet name.
unsigned int OpDetFromCryo(unsigned int o, unsigned int c) const
Get unique opdet number from cryo and internal count.
unsigned int NElements() const
Returns the number of cryostats in the detector.
TPCGeo const & GetElement(TPCID const &tpcid) const
Returns the specified TPC.
std::vector< CryostatGeo > CryostatList_t
unsigned int NSiblingElements(TPCID const &tpcid) const
Returns the largest number of TPCs a cryostat in the detector has.
double TotalMass() const
Returns the total mass [kg] of the specified volume (default: world).
CryostatList_t const & Cryostats() const noexcept
Interface to algorithm class for sorting geo::AuxDet objects .
bool HasElement(CryostatID const &cryoid) const
Returns whether we have the specified cryostat.
std::string VolumeName(Point_t const &point) const
Returns the name of the deepest volume containing specified point.
TPCID FindTPCAtPosition(Point_t const &point) const
Returns the ID of the TPC at specified location.
iterator_type< T > begin() const
TPCGeo const * GetElementPtr(TPCID const &tpcid) const
Returns the specified TPC.
constexpr CryostatID cryostat_zero
Definitions of geometry vector data types.
TPCGeo const & PositionToTPC(Point_t const &point) const
Returns the TPC at specified location.
CryostatGeo const * CryostatPtr(CryostatID const &cryoid) const
Returns the specified cryostat.
std::string MaterialName(Point_t const &point) const
Name of the deepest material containing the point xyz.
std::string indent(std::size_t const i)
unsigned int NElements() const
Alias for NTPC().
void PrintOpDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=0) const
Prints information about this optical detector.
Utilities to extend the interface of geometry vectors.This library provides facilities that can be us...
TPCGeo const * TPCPtr(unsigned int itpc) const
Returns the TPC number itpc from this cryostat.
unsigned int NSiblingElements(CryostatID const &) const
Returns the number of cryostats in the detector.
std::unique_ptr< GeoObjectSorter > fSorter
bool HasCryostat(CryostatID const &cryoid) const
Returns whether we have the specified cryostat.
std::string Info(std::string indent=" ") const
Returns a string with complete geometry information.
bool FindFirstVolume(std::string const &name, std::vector< GeoNodePathEntry > &path) const
GeometryCore(fhicl::ParameterSet const &pset, std::unique_ptr< GeometryBuilder > builder, std::unique_ptr< GeoObjectSorter > sorter)
Initialize geometry from a given configuration.
The data type to uniquely identify a TPC.
Description of the physical geometry of one entire detector.
Definition of data types for geometry description.
double DefaultWiggle() const
Returns the tolerance used in looking for positions.
CryostatGeo const & Cryostat(CryostatID const &cryoid=details::cryostat_zero) const
Returns the specified cryostat.
unsigned int NOpDets() const
Number of OpDets in the whole detector.
Provides a base class aware of world box coordinates.
id_sentinel_for< T > end() const
double fPositionWiggle
accounting for rounding errors when testing positions
Encapsulate the geometry of an auxiliary detector.
std::vector< TGeoNode const * > FindAllVolumes(std::set< std::string > const &vol_names) const
Returns all the nodes with volumes with any of the specified names.
GeometryCore & operator=(GeometryCore const &)=delete
Encapsulate the geometry of an optical detector.
std::string fGDMLfile
path to geometry file used for Geant4 simulation
BoxBoundedGeo WorldBox() const
CryostatID PositionToCryostatID(Point_t const &point) const
Returns the ID of the cryostat at specified location.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
double MassBetweenPoints(Point_t const &p1, Point_t const &p2) const
Returns the column density between two points.
TPCGeo const & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
void BuildGeometry()
Parses ROOT geometry nodes and builds LArSoft geometry representation.
TPCGeo const * TPCPtr(TPCID const &tpcid) const
Returns the specified TPC.
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintOpDetInfo().
bool HasElement(TPCID const &tpcid) const
Returns whether we have the specified TPC.
range_type< T > Iterate() const
std::unique_ptr< GeometryBuilder > fBuilder
std::string const & GDMLFile() const
Returns the full directory path to the GDML file source.
std::string fDetectorName
Name of the detector.
std::vector< std::vector< TGeoNode const * > > FindAllVolumePaths(std::set< std::string > const &vol_names) const
Returns paths of all nodes with volumes with the specified names.
bool HasTPC(unsigned int itpc) const
Returns whether a TPC with index itpc is present in this cryostat.
std::string const & DetectorName() const
Returns a string with the name of the detector, as configured.
unsigned int NElements(CryostatID const &cryoid) const
Returns the largest number of TPCs a cryostat in the detector has.
TPCGeo const & TPC(TPCID const &tpcid=details::tpc_zero) const
Returns the specified TPC.
TPCGeo const * PositionToTPCptr(Point_t const &point) const
Returns the TPC at specified location.
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintTPCInfo().
unsigned int MaxTPCs() const
Returns the largest number of TPCs a cryostat in the detector has.
TPCID PositionToTPCID(Point_t const &point) const
Returns the ID of the TPC at specified location.
bool HasTPC(TPCID const &tpcid) const
Returns whether we have the specified TPC.
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Returns the geo::OpDetGeo object for the given detector number.
Encapsulate the construction of a single detector plane .
The data type to uniquely identify a cryostat.