All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
geo::Geometry Class Reference

The geometry of one entire detector, as served by art. More...

#include <Geometry.h>

Inheritance diagram for geo::Geometry:
geo::GeometryCore

Public Types

using provider_type = GeometryCore
 type of service provider More...
 
- Public Types inherited from geo::GeometryCore
using instead = geo::Length_t
 
using Segment_t = Segment< DefaultPoint_t >
 
using CryostatList_t = GeometryData_t::CryostatList_t
 Type of list of cryostats. More...
 
using AuxDetList_t = GeometryData_t::AuxDetList_t
 Type of list of auxiliary detectors. More...
 
using cryostat_id_iterator = geo::cryostat_id_iterator
 Forward-iterator browsing all cryostat IDs in the detector. More...
 
using cryostat_iterator = geo::cryostat_iterator
 Forward-iterator browsing all cryostats in the detector. More...
 
using TPC_id_iterator = geo::TPC_id_iterator
 Forward-iterator browsing all TPC IDs in the detector. More...
 
using TPC_iterator = geo::TPC_iterator
 Forward-iterator browsing all TPCs in the detector. More...
 
using plane_id_iterator = geo::plane_id_iterator
 Forward-iterator browsing all plane IDs in the detector. More...
 
using plane_iterator = geo::plane_iterator
 Forward-iterator browsing all planes in the detector. More...
 
using wire_id_iterator = geo::wire_id_iterator
 Forward-iterator browsing all wire IDs in the detector. More...
 
using wire_iterator = geo::wire_iterator
 Forward-iterator browsing all wires in the detector. More...
 

Public Member Functions

 Geometry (fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
 
provider_type const * provider () const
 Returns a pointer to the geometry service provider. More...
 
sumdata::GeometryConfigurationInfo
const & 
configurationInfo () const
 Returns the current geometry configuration information. More...
 
- Public Member Functions inherited from geo::GeometryCore
 GeometryCore (fhicl::ParameterSet const &pset)
 Initialize geometry from a given configuration. More...
 
 ~GeometryCore ()
 Destructor. More...
 
 GeometryCore (GeometryCore const &)=delete
 
 GeometryCore (GeometryCore &&)=delete
 
GeometryCoreoperator= (GeometryCore const &)=delete
 
GeometryCoreoperator= (GeometryCore &&)=delete
 
double DefaultWiggle () const
 Returns the tolerance used in looking for positions. More...
 
std::string ROOTFile () const
 Returns the full directory path to the geometry file source. More...
 
std::string GDMLFile () const
 Returns the full directory path to the GDML file source. More...
 
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. More...
 
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. More...
 
TGeoMaterial const * Material (geo::Point_t const &point) const
 Returns the material at the specified position. More...
 
template<typename Stream >
void Print (Stream &&out, std::string indent=" ") const
 Prints geometry information with maximum verbosity. More...
 
std::string Info (std::string indent=" ") const
 Returns a string with complete geometry information. More...
 
template<typename GeoID >
GeoID GetBeginID () const
 Returns the ID of the first element of the detector. More...
 
template<typename GeoID >
GeoID GetNextID (GeoID const &id) const
 Returns the ID next to the specified one. More...
 
template<typename GeoID >
GeoID GetEndID () const
 Returns the (possibly invalid) ID after the last subelement of the detector. More...
 
template<typename GeoID , typename ContextID >
GeoID GetBeginID (ContextID const &id) const
 Returns the ID of the first subelement of the specified element. More...
 
template<typename GeoID , typename ContextID >
GeoID GetEndID (ContextID const &id) const
 Returns the (possibly invalid) ID after the last subelement of the specified element. More...
 
geo::CryostatGeo const * PositionToCryostatPtr (geo::Point_t const &point) const
 Returns the cryostat at specified location. More...
 
geo::CryostatID PositionToCryostatID (geo::Point_t const &point) const
 Returns the ID of the cryostat at specified location. More...
 
CryostatGeo const & PositionToCryostat (double const worldLoc[3], geo::CryostatID &cid) const
 Returns the cryostat at specified location. More...
 
CryostatGeo const & PositionToCryostat (double const worldLoc[3], unsigned int &cstat) const
 Returns the cryostat at specified location. More...
 
void GetBeginID (geo::CryostatID &id) const
 Initializes the specified ID with the ID of the first cryostat. More...
 
void GetEndID (geo::CryostatID &id) const
 Initializes the specified ID with the invalid ID after the last cryostat. More...
 
bool IncrementID (geo::CryostatID &id) const
 
cryostat_id_iterator begin_cryostat_id () const
 Returns an iterator pointing to the first cryostat ID. More...
 
cryostat_id_iterator end_cryostat_id () const
 Returns an iterator pointing after the last cryostat ID. More...
 
cryostat_iterator begin_cryostat () const
 Returns an iterator pointing to the first cryostat. More...
 
cryostat_iterator end_cryostat () const
 Returns an iterator pointing after the last cryostat. More...
 
IteratorBox
< cryostat_id_iterator,&GeometryCore::begin_cryostat_id,&GeometryCore::end_cryostat_id
IterateCryostatIDs () const
 Enables ranged-for loops on all cryostat IDs of the detector. More...
 
IteratorBox< cryostat_iterator,&GeometryCore::begin_cryostat,&GeometryCore::end_cryostatIterateCryostats () const
 Enables ranged-for loops on all cryostats of the detector. More...
 
void CryostatBoundaries (double *boundaries, geo::CryostatID const &cid) const
 Returns the boundaries of the specified cryostat. More...
 
void CryostatBoundaries (double *boundaries, unsigned int cstat=0) const
 Returns the boundaries of the specified cryostat. More...
 
bool HasTPC (geo::TPCID const &tpcid) const
 Returns whether we have the specified TPC. More...
 
bool HasElement (geo::TPCID const &tpcid) const
 Returns whether we have the specified TPC. More...
 
geo::TPCID FindTPCAtPosition (double const worldLoc[3]) const
 Returns the ID of the TPC at specified location. More...
 
geo::TPCGeo const * PositionToTPCptr (geo::Point_t const &point) const
 Returns the TPC at specified location. More...
 
TPCGeo const & PositionToTPC (double const worldLoc[3], unsigned int &tpc, unsigned int &cstat) const
 Returns the TPC at specified location. More...
 
TPCGeo const & PositionToTPC (double const worldLoc[3], TPCID &tpcid) const
 Returns the TPC at specified location. More...
 
geo::TPCID PositionToTPCID (geo::Point_t const &point) const
 Returns the ID of the TPC at specified location. More...
 
void GetBeginID (geo::TPCID &id) const
 Initializes the specified ID with the ID of the first TPC. More...
 
void GetEndID (geo::TPCID &id) const
 Initializes the specified ID with the invalid ID after the last TPC. More...
 
bool IncrementID (geo::TPCID &id) const
 
geo::TPCID GetBeginTPCID (geo::CryostatID const &id) const
 Returns the ID of the first TPC in the specified cryostat. More...
 
geo::TPCID GetEndTPCID (geo::CryostatID const &id) const
 
TPC_id_iterator begin_TPC_id () const
 Returns an iterator pointing to the first TPC ID in the detector. More...
 
TPC_id_iterator end_TPC_id () const
 Returns an iterator pointing after the last TPC ID in the detector. More...
 
TPC_id_iterator begin_TPC_id (geo::CryostatID const &cid) const
 
TPC_id_iterator end_TPC_id (geo::CryostatID const &cid) const
 
TPC_iterator begin_TPC () const
 Returns an iterator pointing to the first TPC in the detector. More...
 
TPC_iterator end_TPC () const
 Returns an iterator pointing after the last TPC in the detector. More...
 
TPC_iterator begin_TPC (geo::CryostatID const &cid) const
 Returns an iterator pointing to the first TPC in the detector. More...
 
TPC_iterator end_TPC (geo::CryostatID const &cid) const
 Returns an iterator pointing after the last TPC in the detector. More...
 
IteratorBox< TPC_id_iterator,&GeometryCore::begin_TPC_id,&GeometryCore::end_TPC_idIterateTPCIDs () const
 Enables ranged-for loops on all TPC IDs of the detector. More...
 
LocalIteratorBox
< TPC_id_iterator,
geo::CryostatID,&GeometryCore::begin_TPC_id,&GeometryCore::end_TPC_id
IterateTPCIDs (geo::CryostatID const &cid) const
 Enables ranged-for loops on all TPC IDs of the specified cryostat. More...
 
void IterateTPCIDs (geo::TPCID const &pid) const =delete
 IterateTPCIDs() is not supported on TPC IDs. More...
 
void IterateTPCIDs (geo::PlaneID const &pid) const =delete
 IterateTPCIDs() is not supported on plane IDs. More...
 
void IterateTPCIDs (geo::WireID const &pid) const =delete
 IterateTPCIDs() is not supported on wire IDs. More...
 
void IterateTPCIDs (readout::TPCsetID const &) const =delete
 IterateTPCIDs() is not supported on readout IDs. More...
 
void IterateTPCIDs (readout::ROPID const &) const =delete
 IterateTPCIDs() is not supported on readout IDs. More...
 
IteratorBox< TPC_iterator,&GeometryCore::begin_TPC,&GeometryCore::end_TPCIterateTPCs () const
 Enables ranged-for loops on all TPCs of the detector. More...
 
LocalIteratorBox< TPC_iterator,
geo::CryostatID,&GeometryCore::begin_TPC,&GeometryCore::end_TPC
IterateTPCs (geo::CryostatID const &cid) const
 Enables ranged-for loops on all TPCs of the specified cryostat. More...
 
void IterateTPCs (geo::TPCID const &pid) const =delete
 IterateTPCs() is not supported on TPC IDs. More...
 
void IterateTPCs (geo::PlaneID const &pid) const =delete
 IterateTPCs() is not supported on plane IDs. More...
 
void IterateTPCs (geo::WireID const &pid) const =delete
 IterateTPCs() is not supported on wire IDs. More...
 
void IterateTPCs (readout::TPCsetID const &) const =delete
 IterateTPCs() is not supported on readout IDs. More...
 
void IterateTPCs (readout::ROPID const &) const =delete
 IterateTPCs() is not supported on readout IDs. More...
 
unsigned int Nviews () const
 Returns the number of views (different wire orientations) More...
 
std::set< PlaneID > const & PlaneIDs () const
 Returns a list of possible PlaneIDs in the detector. More...
 
void GetBeginID (geo::PlaneID &id) const
 Initializes the specified ID with the ID of the first plane. More...
 
void GetEndID (geo::PlaneID &id) const
 Initializes the specified ID with the invalid ID after the last plane. More...
 
bool IncrementID (geo::PlaneID &id) const
 
geo::PlaneID GetBeginPlaneID (geo::CryostatID const &id) const
 Returns the ID of the first plane of the specified cryostat. More...
 
geo::PlaneID GetEndPlaneID (geo::CryostatID const &id) const
 
geo::PlaneID GetBeginPlaneID (geo::TPCID const &id) const
 Returns the ID of the first plane of the specified TPC. More...
 
geo::PlaneID GetEndPlaneID (geo::TPCID const &id) const
 
plane_id_iterator begin_plane_id () const
 Returns an iterator pointing to the first plane ID in the detector. More...
 
plane_id_iterator end_plane_id () const
 Returns an iterator pointing after the last plane ID in the detector. More...
 
plane_id_iterator begin_plane_id (geo::CryostatID const &ID) const
 
plane_id_iterator end_plane_id (geo::CryostatID const &ID) const
 
plane_id_iterator begin_plane_id (geo::TPCID const &ID) const
 
plane_id_iterator end_plane_id (geo::TPCID const &ID) const
 
plane_iterator begin_plane () const
 Returns an iterator pointing to the first plane in the detector. More...
 
plane_iterator end_plane () const
 Returns an iterator pointing after the last plane in the detector. More...
 
plane_iterator begin_plane (geo::CryostatID const &ID) const
 
plane_iterator end_plane (geo::CryostatID const &ID) const
 
plane_iterator begin_plane (geo::TPCID const &ID) const
 Returns an iterator pointing to the first plane in the specified TPC. More...
 
plane_iterator end_plane (geo::TPCID const &ID) const
 Returns an iterator pointing after the last plane in the specified TPC. More...
 
IteratorBox< plane_id_iterator,&GeometryCore::begin_plane_id,&GeometryCore::end_plane_idIteratePlaneIDs () const
 Enables ranged-for loops on all plane IDs of the detector. More...
 
LocalIteratorBox
< plane_id_iterator,
geo::CryostatID,&GeometryCore::begin_plane_id,&GeometryCore::end_plane_id
IteratePlaneIDs (geo::CryostatID const &cid) const
 Enables ranged-for loops on all plane IDs of the specified cryostat. More...
 
LocalIteratorBox
< plane_id_iterator,
geo::TPCID,&GeometryCore::begin_plane_id,&GeometryCore::end_plane_id
IteratePlaneIDs (geo::TPCID const &tid) const
 Enables ranged-for loops on all plane IDs of the specified TPC. More...
 
void IteratePlaneIDs (geo::PlaneID const &pid) const =delete
 IteratePlaneIDs() is not supported on plane IDs. More...
 
void IteratePlaneIDs (geo::WireID const &pid) const =delete
 IteratePlaneIDs() is not supported on wire IDs. More...
 
void IteratePlaneIDs (readout::TPCsetID const &) const =delete
 IteratePlaneIDs() is not supported on readout IDs. More...
 
void IteratePlaneIDs (readout::ROPID const &) const =delete
 IteratePlaneIDs() is not supported on readout IDs. More...
 
IteratorBox< plane_iterator,&GeometryCore::begin_plane,&GeometryCore::end_planeIteratePlanes () const
 Enables ranged-for loops on all planes of the detector. More...
 
LocalIteratorBox
< plane_iterator,
geo::CryostatID,&GeometryCore::begin_plane,&GeometryCore::end_plane
IteratePlanes (geo::CryostatID const &cid) const
 Enables ranged-for loops on all planes of the specified cryostat. More...
 
LocalIteratorBox
< plane_iterator, geo::TPCID,&GeometryCore::begin_plane,&GeometryCore::end_plane
IteratePlanes (geo::TPCID const &tid) const
 Enables ranged-for loops on all planes of the specified TPC. More...
 
void IteratePlanes (geo::PlaneID const &pid) const =delete
 IteratePlanes() is not supported on plane IDs. More...
 
void IteratePlanes (geo::WireID const &pid) const =delete
 IteratePlanes() is not supported on wire IDs. More...
 
void IteratePlanes (readout::TPCsetID const &) const =delete
 IteratePlanes() is not supported on readout IDs. More...
 
void IteratePlanes (readout::ROPID const &) const =delete
 IteratePlanes() is not supported on readout IDs. More...
 
View_t View (geo::PlaneID const &pid) const
 Returns the view (wire orientation) on the channels of specified TPC plane. More...
 
SigType_t SignalType (geo::PlaneID const &pid) const
 Returns the type of signal on the channels of specified TPC plane. More...
 
void GetBeginID (geo::WireID &id) const
 Initializes the specified ID with the ID of the first wire. More...
 
void GetEndID (geo::WireID &id) const
 Initializes the specified ID with the invalid ID after the last wire. More...
 
bool IncrementID (geo::WireID &id) const
 
geo::WireID GetBeginWireID (geo::CryostatID const &id) const
 Returns the ID of the first wire in the specified cryostat. More...
 
geo::WireID GetEndWireID (geo::CryostatID const &id) const
 
geo::WireID GetBeginWireID (geo::TPCID const &id) const
 Returns the ID of the first wire of the specified TPC. More...
 
geo::WireID GetEndWireID (geo::TPCID const &id) const
 
geo::WireID GetBeginWireID (geo::PlaneID const &id) const
 Returns the ID of the first wire of the specified wire plane. More...
 
geo::WireID GetEndWireID (geo::PlaneID const &id) const
 
wire_id_iterator begin_wire_id () const
 Returns an iterator pointing to the first wire ID in the detector. More...
 
wire_id_iterator end_wire_id () const
 Returns an iterator pointing after the last wire ID in the detector. More...
 
wire_id_iterator begin_wire_id (geo::CryostatID const &id) const
 Returns an iterator pointing to the first wire ID in specified cryostat. More...
 
wire_id_iterator end_wire_id (geo::CryostatID const &id) const
 
wire_id_iterator begin_wire_id (geo::TPCID const &id) const
 Returns an iterator pointing to the first wire ID in specified TPC. More...
 
wire_id_iterator end_wire_id (geo::TPCID const &id) const
 Returns an iterator pointing after the last wire ID in specified TPC. More...
 
wire_id_iterator begin_wire_id (geo::PlaneID const &id) const
 Returns an iterator pointing to the first wire ID in specified plane. More...
 
wire_id_iterator end_wire_id (geo::PlaneID const &id) const
 Returns an iterator pointing after the last wire ID in specified plane. More...
 
wire_iterator begin_wire () const
 Returns an iterator pointing to the first wire in the detector. More...
 
wire_iterator end_wire () const
 Returns an iterator pointing after the last wire in the detector. More...
 
wire_iterator begin_wire (geo::CryostatID const &id) const
 Returns an iterator pointing to the first wire in specified cryostat. More...
 
wire_iterator end_wire (geo::CryostatID const &id) const
 Returns an iterator pointing after the last wire in specified cryostat. More...
 
wire_iterator begin_wire (geo::TPCID const &id) const
 Returns an iterator pointing to the first wire in specified TPC. More...
 
wire_iterator end_wire (geo::TPCID const &id) const
 Returns an iterator pointing after the last wire in specified TPC. More...
 
wire_iterator begin_wire (geo::PlaneID const &id) const
 Returns an iterator pointing to the first wire in specified plane. More...
 
wire_iterator end_wire (geo::PlaneID const &id) const
 Returns an iterator pointing after the last wire in specified plane. More...
 
IteratorBox< wire_id_iterator,&GeometryCore::begin_wire_id,&GeometryCore::end_wire_idIterateWireIDs () const
 Enables ranged-for loops on all wire IDs of the detector. More...
 
LocalIteratorBox
< wire_id_iterator,
geo::CryostatID,&GeometryCore::begin_wire_id,&GeometryCore::end_wire_id
IterateWireIDs (geo::CryostatID const &cid) const
 Enables ranged-for loops on all wire IDs of specified cryostat. More...
 
LocalIteratorBox
< wire_id_iterator, geo::TPCID,&GeometryCore::begin_wire_id,&GeometryCore::end_wire_id
IterateWireIDs (geo::TPCID const &tid) const
 Enables ranged-for loops on all wire IDs of specified TPC. More...
 
LocalIteratorBox
< wire_id_iterator,
geo::PlaneID,&GeometryCore::begin_wire_id,&GeometryCore::end_wire_id
IterateWireIDs (geo::PlaneID const &pid) const
 Enables ranged-for loops on all wire IDs of specified wire plane. More...
 
void IterateWireIDs (geo::WireID const &pid) const =delete
 IterateWireIDs() is not supported on wire IDs. More...
 
void IterateWireIDs (readout::TPCsetID const &) const =delete
 IterateWireIDs() is not supported on readout IDs. More...
 
void IterateWireIDs (readout::ROPID const &) const =delete
 IterateWireIDs() is not supported on readout IDs. More...
 
IteratorBox< wire_iterator,&GeometryCore::begin_wire,&GeometryCore::end_wireIterateWires () const
 Enables ranged-for loops on all wires of the detector. More...
 
LocalIteratorBox
< wire_iterator,
geo::CryostatID,&GeometryCore::begin_wire,&GeometryCore::end_wire
IterateWires (geo::CryostatID const &cid) const
 Enables ranged-for loops on all wires of specified cryostat. More...
 
LocalIteratorBox
< wire_iterator, geo::TPCID,&GeometryCore::begin_wire,&GeometryCore::end_wire
IterateWires (geo::TPCID const &tid) const
 Enables ranged-for loops on all wires of specified TPC. More...
 
LocalIteratorBox
< wire_iterator, geo::PlaneID,&GeometryCore::begin_wire,&GeometryCore::end_wire
IterateWires (geo::PlaneID const &tid) const
 Enables ranged-for loops on all wires of specified wire plane. More...
 
void IterateWires (geo::WireID const &pid) const =delete
 IterateWires() is not supported on wire IDs. More...
 
void IterateWires (readout::TPCsetID const &) const =delete
 IterateWires() is not supported on readout IDs. More...
 
void IterateWires (readout::ROPID const &) const =delete
 IterateWires() is not supported on readout IDs. More...
 
geo::Length_t WirePitch (geo::View_t view) const
 Returns the distance between two wires in the specified view. More...
 
geo::WireID NearestWireID (geo::Point_t const &point, geo::PlaneID const &planeid) const
 Returns the ID of wire closest to position in the specified TPC. More...
 
geo::WireID::WireID_t NearestWire (geo::Point_t const &point, geo::PlaneID const &planeid) const
 Returns the index of wire closest to position in the specified TPC. More...
 
geo::Length_t WireCoordinate (double YPos, double ZPos, geo::PlaneID const &planeid) const
 Returns the index of the nearest wire to the specified position. More...
 
geo::Length_t WireCoordinate (double YPos, double ZPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const
 Returns the index of the nearest wire to the specified position. More...
 
bool IntersectLines (double A_start_x, double A_start_y, double A_end_x, double A_end_y, double B_start_x, double B_start_y, double B_end_x, double B_end_y, double &x, double &y) const
 Computes the intersection between two lines on a plane. More...
 
bool IntersectSegments (double A_start_x, double A_start_y, double A_end_x, double A_end_y, double B_start_x, double B_start_y, double B_end_x, double B_end_y, double &x, double &y) const
 Computes the intersection between two segments on a plane. More...
 
bool IntersectionPoint (geo::WireID const &wid1, geo::WireID const &wid2, double &y, double &z) const
 Returns the intersection point of two wires. More...
 
bool IntersectionPoint (unsigned int wire1, unsigned int wire2, unsigned int plane1, unsigned int plane2, unsigned int cstat, unsigned int tpc, double &y, double &z) const
 Returns the intersection point of two wires. More...
 
geo::PlaneID ThirdPlane (geo::PlaneID const &pid1, geo::PlaneID const &pid2) const
 Returns the plane that is not in the specified arguments. More...
 
double ThirdPlaneSlope (geo::PlaneID const &pid1, double slope1, geo::PlaneID const &pid2, double slope2, geo::PlaneID const &output_plane) const
 Returns the slope on the third plane, given it in the other two. More...
 
double ThirdPlaneSlope (geo::PlaneID const &pid1, double slope1, geo::PlaneID const &pid2, double slope2) const
 Returns the slope on the third plane, given it in the other two. More...
 
double ThirdPlane_dTdW (geo::PlaneID const &pid1, double slope1, geo::PlaneID const &pid2, double slope2, geo::PlaneID const &output_plane) const
 Returns dT/dW on the third plane, given it in the other two. More...
 
double ThirdPlane_dTdW (geo::PlaneID const &pid1, double slope1, geo::PlaneID const &pid2, double slope2) const
 Returns dT/dW on the third plane, given it in the other two. More...
 
std::string OpDetGeoName (unsigned int c=0) const
 Returns gdml string which gives sensitive opdet name. More...
 
SigType_t SignalType (raw::ChannelID_t const channel) const
 Returns the type of signal on the specified TPC channel. More...
 
View_t View (raw::ChannelID_t const channel) const
 Returns the view (wire orientation) on the specified TPC channel. More...
 
std::vector< geo::WireIDChannelToWire (raw::ChannelID_t const channel) const
 Returns a list of wires connected to the specified TPC channel. More...
 
readout::ROPID ChannelToROP (raw::ChannelID_t channel) const
 
raw::ChannelID_t NearestChannel (geo::Point_t const &worldLoc, geo::PlaneID const &planeid) const
 Returns the ID of the channel nearest to the specified position. More...
 
bool ChannelsIntersect (raw::ChannelID_t c1, raw::ChannelID_t c2, double &y, double &z) const
 Returns an intersection point of two channels. More...
 
unsigned int MaxTPCsets () const
 Returns the largest number of TPC sets any cryostat in the detector has. More...
 
template<typename T >
readout::TPCsetDataContainer< T > makeTPCsetData () const
 Returns a container with one entry per TPC set. More...
 
template<typename T >
readout::TPCsetDataContainer< T > makeTPCsetData (T const &defValue) const
 Returns a container with one entry per TPC set. More...
 
bool HasTPCset (readout::TPCsetID const &tpcsetid) const
 
bool HasElement (readout::TPCsetID const &tpcsetid) const
 Returns whether we have the specified TPC set. More...
 
readout::TPCsetID FindTPCsetAtPosition (double const worldLoc[3]) const
 Returns the ID of the TPC set at specified location. More...
 
readout::TPCsetID TPCtoTPCset (geo::TPCID const &tpcid) const
 Returns the ID of the TPC set tpcid belongs to. More...
 
std::vector< geo::TPCIDTPCsetToTPCs (readout::TPCsetID const &tpcsetid) const
 Returns a list of ID of TPCs belonging to the specified TPC set. More...
 
void GetBeginID (readout::TPCsetID &id) const
 Initializes the specified ID with the ID of the first TPC set. More...
 
void GetEndID (readout::TPCsetID &id) const
 Initializes the specified ID with the invalid ID after the last TPC set. More...
 
bool IncrementID (readout::TPCsetID &id) const
 
readout::TPCsetID GetBeginTPCsetID (geo::CryostatID const &id) const
 Returns the ID of the first TPC set in the specified cryostat. More...
 
readout::TPCsetID GetEndTPCsetID (geo::CryostatID const &id) const
 
TPCset_id_iterator begin_TPCset_id () const
 Returns an iterator pointing to the first TPC set ID in the detector. More...
 
TPCset_id_iterator end_TPCset_id () const
 Returns an iterator pointing after the last TPC set ID in the detector. More...
 
TPCset_id_iterator begin_TPCset_id (geo::CryostatID const &cid) const
 
TPCset_id_iterator end_TPCset_id (geo::CryostatID const &cid) const
 
IteratorBox
< TPCset_id_iterator,&GeometryCore::begin_TPCset_id,&GeometryCore::end_TPCset_id
IterateTPCsetIDs () const
 Enables ranged-for loops on all TPC set IDs of the detector. More...
 
LocalIteratorBox
< TPCset_id_iterator,
geo::CryostatID,&GeometryCore::begin_TPCset_id,&GeometryCore::end_TPCset_id
IterateTPCsetIDs (geo::CryostatID const &cid) const
 Enables ranged-for loops on all TPC set IDs of the specified cryostat. More...
 
unsigned int MaxROPs () const
 Returns the largest number of ROPs a TPC set in the detector has. More...
 
template<typename T >
readout::ROPDataContainer< T > makeROPdata () const
 Returns a container with one entry per readout plane. More...
 
template<typename T >
readout::ROPDataContainer< T > makeROPdata (T const &defValue) const
 Returns a container with one entry per readout plane. More...
 
bool HasROP (readout::ROPID const &ropid) const
 
bool HasElement (readout::ROPID const &ropid) const
 
readout::ROPID WirePlaneToROP (geo::PlaneID const &planeid) const
 Returns the ID of the ROP planeid belongs to. More...
 
std::vector< geo::PlaneIDROPtoWirePlanes (readout::ROPID const &ropid) const
 Returns a list of ID of planes belonging to the specified ROP. More...
 
std::vector< geo::TPCIDROPtoTPCs (readout::ROPID const &ropid) const
 Returns a list of ID of TPCs the specified ROP spans. More...
 
raw::ChannelID_t FirstChannelInROP (readout::ROPID const &ropid) const
 Returns the ID of the first channel in the specified readout plane. More...
 
void GetBeginID (readout::ROPID &id) const
 Initializes the specified ID with the ID of the first readout plane. More...
 
void GetEndID (readout::ROPID &id) const
 Initializes the specified ID with the invalid ID after the last ROP. More...
 
bool IncrementID (readout::ROPID &id) const
 
readout::ROPID GetBeginROPID (geo::CryostatID const &id) const
 Returns the ID of the first readout plane of the specified cryostat. More...
 
readout::ROPID GetEndROPID (geo::CryostatID const &id) const
 
readout::ROPID GetBeginROPID (readout::TPCsetID const &id) const
 Returns the ID of the first readout plane of the specified TPC set. More...
 
readout::ROPID GetEndROPID (readout::TPCsetID const &id) const
 
ROP_id_iterator begin_ROP_id () const
 Returns an iterator pointing to the first ROP ID in the detector. More...
 
ROP_id_iterator end_ROP_id () const
 Returns an iterator pointing after the last ROP ID in the detector. More...
 
ROP_id_iterator begin_ROP_id (geo::CryostatID const &ID) const
 
ROP_id_iterator end_ROP_id (geo::CryostatID const &ID) const
 
ROP_id_iterator begin_ROP_id (readout::TPCsetID const &ID) const
 
ROP_id_iterator end_ROP_id (readout::TPCsetID const &ID) const
 
IteratorBox< ROP_id_iterator,&GeometryCore::begin_ROP_id,&GeometryCore::end_ROP_idIterateROPIDs () const
 Enables ranged-for loops on all readout plane IDs of the detector. More...
 
LocalIteratorBox
< ROP_id_iterator,
geo::CryostatID,&GeometryCore::begin_ROP_id,&GeometryCore::end_ROP_id
IterateROPIDs (geo::CryostatID const &cid) const
 Enables ranged-for loops on all readout plane IDs of the specified cryostat. More...
 
LocalIteratorBox
< ROP_id_iterator,
readout::TPCsetID,&GeometryCore::begin_ROP_id,&GeometryCore::end_ROP_id
IterateROPIDs (readout::TPCsetID const &sid) const
 Enables ranged-for loops on all readout plane IDs of the specified TPC set. More...
 
geo::View_t View (readout::ROPID const &ropid) const
 Returns the view of the channels in the specified readout plane. More...
 
geo::SigType_t SignalType (readout::ROPID const &ropid) const
 Returns the type of signal of channels in specified readout plane. More...
 
bool ValueInRange (double value, double min, double max) const
 Returns whether a value is within the specified range. More...
 
std::string DetectorName () const
 Returns a string with the name of the detector, as configured. More...
 
TGeoVolume const * WorldVolume () const
 Returns a pointer to the world volume. More...
 
void WorldBox (double *xlo, double *xhi, double *ylo, double *yhi, double *zlo, double *zhi) const
 Fills the arguments with the boundaries of the world. More...
 
geo::BoxBoundedGeo WorldBox () const
 
geo::Length_t SurfaceY () const
 The position of the detector respect to earth surface. More...
 
TGeoManager * ROOTGeoManager () const
 Access to the ROOT geometry description manager. More...
 
const std::string GetWorldVolumeName () const
 Return the name of the world volume (needed by Geant4 simulation) More...
 
geo::BoxBoundedGeo DetectorEnclosureBox (std::string const &name="volDetEnclosure") const
 
std::string VolumeName (geo::Point_t const &point) const
 Returns the name of the deepest volume containing specified point. More...
 
std::string VolumeName (TVector3 const &point) const
 
std::string MaterialName (TVector3 const &point) const
 Name of the deepest material containing the point xyz. More...
 
std::string MaterialName (geo::Point_t const &point) const
 
double TotalMass () const
 Returns the total mass [kg] of the specified volume (default: world). More...
 
double TotalMass (std::string vol) const
 
double MassBetweenPoints (geo::Point_t const &p1, geo::Point_t const &p2) const
 Returns the column density between two points. More...
 
double MassBetweenPoints (double *p1, double *p2) const
 
unsigned int Ncryostats () const
 Returns the number of cryostats in the detector. More...
 
unsigned int NElements () const
 
unsigned int NSiblingElements (geo::CryostatID const &) const
 
bool HasCryostat (geo::CryostatID const &cryoid) const
 Returns whether we have the specified cryostat. More...
 
bool HasElement (geo::CryostatID const &cryoid) const
 
CryostatGeo const & Cryostat (geo::CryostatID const &cryoid) const
 Returns the specified cryostat. More...
 
CryostatGeo const & Cryostat (unsigned int const cstat=0) const
 
CryostatGeo const & GetElement (geo::CryostatID const &cryoid) const
 
CryostatGeo const * CryostatPtr (geo::CryostatID const &cryoid) const
 Returns the specified cryostat. More...
 
CryostatGeo const * GetElementPtr (geo::CryostatID const &cryoid) const
 
geo::CryostatID::CryostatID_t FindCryostatAtPosition (geo::Point_t const &worldLoc) const
 Returns the index of the cryostat at specified location. More...
 
geo::CryostatID::CryostatID_t FindCryostatAtPosition (double const worldLoc[3]) const
 
CryostatGeo const & PositionToCryostat (geo::Point_t const &point) const
 Returns the cryostat at specified location. More...
 
CryostatGeo const & PositionToCryostat (double const point[3]) const
 
geo::Length_t CryostatHalfWidth (geo::CryostatID const &cid) const
 Returns the half width of the cryostat (x direction) More...
 
geo::Length_t CryostatHalfWidth (unsigned int cstat=0) const
 
geo::Length_t CryostatHalfHeight (geo::CryostatID const &cid) const
 Returns the height of the cryostat (y direction) More...
 
geo::Length_t CryostatHalfHeight (unsigned int cstat=0) const
 
geo::Length_t CryostatLength (geo::CryostatID const &cid) const
 Returns the length of the cryostat (z direction) More...
 
geo::Length_t CryostatLength (unsigned int cstat=0) const
 
std::string GetCryostatVolumeName (geo::CryostatID const &cid) const
 Return the name of LAr TPC volume. More...
 
std::string GetCryostatVolumeName (unsigned int const cstat=0) const
 
unsigned int NTPC (unsigned int cstat=0) const
 Returns the total number of TPCs in the specified cryostat. More...
 
unsigned int MaxTPCs () const
 Returns the largest number of TPCs a cryostat in the detector has. More...
 
unsigned int TotalNTPC () const
 Returns the total number of TPCs in the detector. More...
 
template<typename T >
geo::TPCDataContainer< T > makeTPCData () const
 Returns a container with one entry per TPC. More...
 
template<typename T >
geo::TPCDataContainer< T > makeTPCData (T const &defValue) const
 Returns a container with one entry per TPC. More...
 
unsigned int NTPC (geo::CryostatID const &cryoid) const
 Returns the total number of TPCs in the specified cryostat. More...
 
unsigned int NElements (geo::CryostatID const &cryoid) const
 
unsigned int NSiblingElements (geo::TPCID const &tpcid) const
 
TPCGeo const & TPC (unsigned int const tpc=0, unsigned int const cstat=0) const
 Returns the specified TPC. More...
 
TPCGeo const & TPC (geo::TPCID const &tpcid) const
 
TPCGeo const & GetElement (geo::TPCID const &tpcid) const
 
TPCGeo const * TPCPtr (geo::TPCID const &tpcid) const
 Returns the specified TPC. More...
 
TPCGeo const * GetElementPtr (geo::TPCID const &tpcid) const
 
geo::TPCID FindTPCAtPosition (geo::Point_t const &point) const
 Returns the ID of the TPC at specified location. More...
 
geo::TPCID FindTPCAtPosition (TVector3 const &point) const
 
geo::TPCGeo const & PositionToTPC (geo::Point_t const &point) const
 Returns the TPC at specified location. More...
 
TPCGeo const & PositionToTPC (double const point[3]) const
 
geo::Length_t DetHalfWidth (geo::TPCID const &tpcid) const
 Returns the half width of the active volume of the specified TPC. More...
 
geo::Length_t DetHalfWidth (unsigned int tpc=0, unsigned int cstat=0) const
 
geo::Length_t DetHalfHeight (geo::TPCID const &tpcid) const
 Returns the half height of the active volume of the specified TPC. More...
 
geo::Length_t DetHalfHeight (unsigned int tpc=0, unsigned int cstat=0) const
 
geo::Length_t DetLength (geo::TPCID const &tpcid) const
 Returns the length of the active volume of the specified TPC. More...
 
geo::Length_t DetLength (unsigned int tpc=0, unsigned int cstat=0) const
 
template<typename Point >
Point GetTPCFrontFaceCenter (geo::TPCID const &tpcid) const
 Returns the center of side of the detector facing the beam. More...
 
DefaultPoint_t GetTPCFrontFaceCenter (geo::TPCID const &tpcid) const
 
template<typename Point >
Point GetTPCFrontFaceCenter (unsigned int tpc=0, unsigned int cstat=0) const
 Returns the center of side of the detector facing the beam. More...
 
DefaultPoint_t GetTPCFrontFaceCenter (unsigned int tpc=0, unsigned int cstat=0) const
 
std::string GetLArTPCVolumeName (geo::TPCID const &tpcid) const
 Return the name of specified LAr TPC volume. More...
 
std::string GetLArTPCVolumeName (unsigned int const tpc=0, unsigned int const cstat=0) const
 
unsigned int Nplanes (unsigned int tpc=0, unsigned int cstat=0) const
 Returns the total number of wire planes in the specified TPC. More...
 
unsigned int MaxPlanes () const
 Returns the largest number of planes among all TPCs in this detector. More...
 
template<typename T >
geo::PlaneDataContainer< T > makePlaneData () const
 Returns a container with one entry per wire plane. More...
 
template<typename T >
geo::PlaneDataContainer< T > makePlaneData (T const &defValue) const
 Returns a container with one entry per wire plane. More...
 
unsigned int Nplanes (geo::TPCID const &tpcid) const
 Returns the total number of planes in the specified TPC. More...
 
unsigned int NElements (geo::TPCID const &tpcid) const
 
unsigned int NSiblingElements (geo::PlaneID const &planeid) const
 
bool HasPlane (geo::PlaneID const &planeid) const
 Returns whether we have the specified plane. More...
 
bool HasElement (geo::PlaneID const &planeid) const
 
PlaneGeo const & Plane (unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
 Returns the specified wire. More...
 
PlaneGeo const & Plane (geo::PlaneID const &planeid) const
 
PlaneGeo const & GetElement (geo::PlaneID const &planeid) const
 
PlaneGeo const * PlanePtr (geo::PlaneID const &planeid) const
 Returns the specified plane. More...
 
PlaneGeo const * GetElementPtr (geo::PlaneID const &planeid) const
 
geo::Length_t PlanePitch (geo::TPCID const &tpcid, geo::PlaneID::PlaneID_t p1=0, geo::PlaneID::PlaneID_t p2=1) const
 Returns the distance between two planes. More...
 
geo::Length_t PlanePitch (geo::PlaneID const &pid1, geo::PlaneID const &pid2) const
 
geo::Length_t PlanePitch (unsigned int p1=0, unsigned int p2=1, unsigned int tpc=0, unsigned int cstat=0) const
 
unsigned int Nwires (unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
 Returns the total number of wires in the specified plane. More...
 
unsigned int Nwires (geo::PlaneID const &planeid) const
 Returns the total number of wires in the specified plane. More...
 
unsigned int NElements (geo::PlaneID const &planeid) const
 
unsigned int NSiblingElements (geo::WireID const &wireid) const
 
unsigned int MaxWires () const
 Returns the largest number of wires among all planes in this detector. More...
 
bool HasWire (geo::WireID const &wireid) const
 Returns whether we have the specified wire. More...
 
bool HasElement (geo::WireID const &wireid) const
 
WireGeo const * WirePtr (geo::WireID const &wireid) const
 Returns the specified wire. More...
 
WireGeo const * GetElementPtr (geo::WireID const &wireid) const
 
WireGeo const & Wire (geo::WireID const &wireid) const
 Returns the specified wire. More...
 
WireGeo const & WireIDToWireGeo (geo::WireID const &wireid) const
 
WireGeo const & GetElement (geo::WireID const &wireid) const
 
geo::Length_t WirePitch (geo::PlaneID const &planeid) const
 Returns the distance between two consecutive wires. More...
 
geo::Length_t WirePitch (unsigned int plane=0, unsigned int tpc=0, unsigned int cstat=0) const
 
double WireAngleToVertical (geo::View_t view, geo::TPCID const &tpcid) const
 Returns the angle of the wires in the specified view from vertical. More...
 
double WireAngleToVertical (geo::View_t view, int TPC=0, int Cryo=0) const
 
void WireEndPoints (geo::WireID const &wireid, double *xyzStart, double *xyzEnd) const
 Fills two arrays with the coordinates of the wire end points. More...
 
void WireEndPoints (unsigned int cstat, unsigned int tpc, unsigned int plane, unsigned int wire, double *xyzStart, double *xyzEnd) const
 Fills two arrays with the coordinates of the wire end points. More...
 
template<typename Point >
Segment< Point > WireEndPoints (geo::WireID const &wireID) const
 Returns a segment whose ends are the wire end points. More...
 
Segment< DefaultPoint_tWireEndPoints (geo::WireID const &wireID) const
 
geo::WireID NearestWireID (const double point[3], geo::PlaneID const &planeid) const
 Returns the ID of wire closest to position in the specified TPC. More...
 
geo::WireID NearestWireID (std::vector< double > const &point, geo::PlaneID const &planeid) const
 
geo::WireID NearestWireID (const TVector3 &point, geo::PlaneID const &planeid) const
 
geo::WireID NearestWireID (const double point[3], unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
geo::WireID NearestWireID (std::vector< double > const &point, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
geo::WireID NearestWireID (const TVector3 &point, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
geo::WireID NearestWireID (geo::Point_t const &point, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
unsigned int NearestWire (const double worldLoc[3], geo::PlaneID const &planeid) const
 Returns the index of wire closest to position in the specified TPC. More...
 
unsigned int NearestWire (std::vector< double > const &worldLoc, geo::PlaneID const &planeid) const
 
unsigned int NearestWire (const TVector3 &worldLoc, geo::PlaneID const &planeid) const
 
unsigned int NearestWire (const double worldLoc[3], unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
unsigned int NearestWire (std::vector< double > const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
unsigned int NearestWire (const TVector3 &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
unsigned int NearestWire (geo::Point_t const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
geo::Length_t WireCoordinate (geo::Point_t const &pos, geo::PlaneID const &planeid) const
 Returns the index of the nearest wire to the specified position. More...
 
geo::Length_t WireCoordinate (TVector3 const &pos, geo::PlaneID const &planeid) const
 
bool WireIDsIntersect (WireID const &wid1, WireID const &wid2, geo::Point_t &intersection) const
 Computes the intersection between two wires. More...
 
bool WireIDsIntersect (WireID const &wid1, WireID const &wid2, TVector3 &intersection) const
 
bool WireIDsIntersect (WireID const &wid1, WireID const &wid2, WireIDIntersection &widIntersect) const
 Computes the intersection between two wires. More...
 
double ThirdPlaneSlope (geo::PlaneID::PlaneID_t plane1, double slope1, geo::PlaneID::PlaneID_t plane2, double slope2, geo::TPCID const &tpcid) const
 Returns the slope on the third plane, given it in the other two. More...
 
double ThirdPlaneSlope (unsigned int plane1, double slope1, unsigned int plane2, double slope2, unsigned int tpc, unsigned int cstat) const
 
unsigned int NOpDets () const
 Number of OpDets in the whole detector. More...
 
OpDetGeo const & OpDetGeoFromOpChannel (unsigned int OpChannel) const
 Returns the geo::OpDetGeo object for the given channel number. More...
 
OpDetGeo const & OpDetGeoFromOpDet (unsigned int OpDet) const
 Returns the geo::OpDetGeo object for the given detector number. More...
 
unsigned int GetClosestOpDet (geo::Point_t const &point) const
 Find the nearest OpChannel to some point. More...
 
unsigned int GetClosestOpDet (double const *point) const
 
unsigned int NAuxDets () const
 Returns the number of auxiliary detectors. More...
 
unsigned int NAuxDetSensitive (size_t const &aid) const
 Returns the number of sensitive components of auxiliary detector. More...
 
AuxDetGeo const & AuxDet (unsigned int const ad=0) const
 Returns the specified auxiliary detector. More...
 
unsigned int FindAuxDetAtPosition (double const worldLoc[3], double tolerance=0) const
 Returns the index of the auxiliary detector at specified location. More...
 
unsigned int FindAuxDetAtPosition (geo::Point_t const &point, double tolerance=0) const
 Returns the index of the auxiliary detector at specified location. More...
 
void FindAuxDetSensitiveAtPosition (geo::Point_t const &point, std::size_t &adg, std::size_t &sv, double tolerance=0) const
 Fills the indices of the sensitive auxiliary detector at location. More...
 
void FindAuxDetSensitiveAtPosition (double const worldLoc[3], size_t &adg, size_t &sv, double tolerance=0) const
 Fills the indices of the sensitive auxiliary detector at location. More...
 
AuxDetGeo const & PositionToAuxDet (geo::Point_t const &point, unsigned int &ad, double tolerance=0) const
 Returns the auxiliary detector at specified location. More...
 
AuxDetGeo const & PositionToAuxDet (double const worldLoc[3], unsigned int &ad, double tolerance=0) const
 Returns the auxiliary detector at specified location. More...
 
const AuxDetSensitiveGeoPositionToAuxDetSensitive (geo::Point_t const &point, size_t &ad, size_t &sv, double tolerance=0) const
 Returns the auxiliary detector at specified location. More...
 
const AuxDetSensitiveGeoPositionToAuxDetSensitive (double const worldLoc[3], size_t &ad, size_t &sv, double tolerance=0) const
 Returns the auxiliary detector at specified location. More...
 
const AuxDetGeoChannelToAuxDet (std::string const &auxDetName, uint32_t const &channel) const
 
const AuxDetSensitiveGeoChannelToAuxDetSensitive (std::string const &auxDetName, uint32_t const &channel) const
 
unsigned int Nchannels () const
 Returns the number of TPC readout channels in the detector. More...
 
unsigned int Nchannels (readout::ROPID const &ropid) const
 Returns the number of channels in the specified ROP. More...
 
std::vector< raw::ChannelID_tChannelsInTPCs () const
 Returns an std::vector<ChannelID_t> in all TPCs in a TPCSet. More...
 
std::set< geo::View_t > const & Views () const
 Returns a list of possible views in the detector. More...
 
bool HasChannel (raw::ChannelID_t channel) const
 Returns whether the specified channel exists and is valid. More...
 
raw::ChannelID_t PlaneWireToChannel (WireID const &wireid) const
 Returns the ID of the TPC channel connected to the specified wire. More...
 
raw::ChannelID_t PlaneWireToChannel (unsigned int const plane, unsigned int const wire, unsigned int const tpc=0, unsigned int const cstat=0) const
 
raw::ChannelID_t NearestChannel (const double worldLoc[3], geo::PlaneID const &planeid) const
 Returns the ID of the channel nearest to the specified position. More...
 
raw::ChannelID_t NearestChannel (std::vector< double > const &worldLoc, geo::PlaneID const &planeid) const
 
raw::ChannelID_t NearestChannel (const TVector3 &worldLoc, geo::PlaneID const &planeid) const
 
raw::ChannelID_t NearestChannel (const double worldLoc[3], unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
raw::ChannelID_t NearestChannel (std::vector< double > const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
raw::ChannelID_t NearestChannel (const TVector3 &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
raw::ChannelID_t NearestChannel (geo::Point_t const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
unsigned int NTPCsets (readout::CryostatID const &cryoid) const
 Returns the total number of TPC sets in the specified cryostat. More...
 
unsigned int NSiblingElements (readout::TPCsetID const &tpcsetid) const
 
unsigned int NROPs (readout::TPCsetID const &tpcsetid) const
 Returns the total number of ROP in the specified TPC set. More...
 
unsigned int NSiblingElements (readout::ROPID const &ropid) const
 
unsigned int NOpChannels () const
 Number of electronics channels for all the optical detectors. More...
 
unsigned int MaxOpChannel () const
 Largest optical channel number. More...
 
unsigned int NOpHardwareChannels (int opDet) const
 
bool IsValidOpChannel (int opChannel) const
 Is this a valid OpChannel number? More...
 
unsigned int OpChannel (int detNum, int hardwareChannel) const
 Convert detector number and hardware channel to unique channel. More...
 
unsigned int OpDetFromOpChannel (int opChannel) const
 Convert unique channel to detector number. More...
 
unsigned int HardwareChannelFromOpChannel (int opChannel) const
 Convert unique channel to hardware channel. More...
 
unsigned int OpDetFromCryo (unsigned int o, unsigned int c) const
 Get unique opdet number from cryo and internal count. More...
 
void LoadGeometryFile (std::string gdmlfile, std::string rootfile, geo::GeometryBuilder &builder, bool bForceReload=false)
 Loads the geometry information from the specified files. More...
 
void LoadGeometryFile (std::string gdmlfile, std::string rootfile, bool bForceReload=false)
 Loads the geometry information from the specified files. More...
 
void ApplyChannelMap (std::unique_ptr< geo::ChannelMapAlg > pChannelMap)
 Initializes the geometry to work with this channel map. More...
 

Private Member Functions

void preBeginRun (art::Run const &run)
 Updates the geometry if needed at the beginning of each new run. More...
 
void LoadNewGeometry (std::string gdmlfile, std::string rootfile, bool bForceReload=false)
 Expands the provided paths and loads the geometry description(s) More...
 
void InitializeChannelMap ()
 

Private Attributes

std::string fRelPath
 
bool fDisableWiresInG4
 
bool fNonFatalConfCheck
 
fhicl::ParameterSet fSortingParameters
 Parameter set to define the channel map sorting. More...
 
fhicl::ParameterSet fBuilderParameters
 Parameter set for geometry builder. More...
 
sumdata::GeometryConfigurationInfo fConfInfo
 Summary of service configuration. More...
 

Configuration information checks

void FillGeometryConfigurationInfo (fhicl::ParameterSet const &config)
 Fills the service configuration information into fConfInfo. More...
 
bool CheckConfigurationInfo (sumdata::GeometryConfigurationInfo const &other) const
 Returns if the other configuration is compatible with our current. More...
 
static
sumdata::GeometryConfigurationInfo
const & 
ReadConfigurationInfo (art::Run const &run)
 Reads and returns the geometry configuration information from the run. More...
 
static bool CompareConfigurationInfo (sumdata::GeometryConfigurationInfo const &A, sumdata::GeometryConfigurationInfo const &B)
 Returns if A and B are compatible geometry service configurations. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from geo::GeometryCore
static double ComputeThirdPlaneSlope (double angle1, double slope1, double angle2, double slope2, double angle_target)
 Returns the slope on the third plane, given it in the other two. More...
 
static double ComputeThirdPlane_dTdW (double angle1, double pitch1, double dTdW1, double angle2, double pitch2, double dTdW2, double angle_target, double pitch_target)
 Returns the slope on the third plane, given it in the other two. More...
 
- Static Public Attributes inherited from geo::GeometryCore
static constexpr std::size_t MaxWireDepthInGDML = 20U
 
static
lar::util::RealComparisons
< geo::Length_t
coordIs { 1e-8 }
 Value of tolerance for equality comparisons. More...
 
- Protected Member Functions inherited from geo::GeometryCore
void SetDetectorName (std::string const &new_name)
 Sets the detector name. More...
 
geo::ChannelMapAlg const * ChannelMap () const
 Returns the object handling the channel map. More...
 
CryostatList_tCryostats ()
 Return the internal cryostat list. More...
 
CryostatList_t const & Cryostats () const
 
AuxDetList_tAuxDets ()
 Return the interfal auxiliary detectors list. More...
 
AuxDetList_t const & AuxDets () const
 

Detailed Description

The geometry of one entire detector, as served by art.

This class extends the interface of the geometry service provider, GeometryCore, to the one of an art service. It handles the correct initialization of the provider using information

It relies on geo::ExptGeoHelperInterface service to obtain the channel mapping algorithm proper for the selected geometry.

The geometry initialization happens immediately on construction. Optionally, the geometry is automatically reinitialized on each run based on the information contained in the art::Run object.

Configuration

In addition to the parameters documented in geo::GeometryCore, the following parameters are supported:

Note
Currently, the file defined by GDML parameter is also served to ROOT for the internal geometry representation.

Configuration consistency check

The Geometry service checks that the input files were processed with a configuration of Geometry service compatible with the current one.

Two checks may be performed: the standard check, and a legacy check.

Consistency check

The Geometry service checks at the beginning of each run that the current configuration is compatible with the geometry configuration declared in the input file. The Geometry service requires that an additional service, GeometryConfigurationWriter, is run: this service is charged with writing the configuration information into the output files, for the checks in the future job.

The compatibility check is currently very silly, but it can improved in future versions. This check is the same as the legacy check, that verifies that the configured detector name (geo::GeometryCore::DetectorName()) has not changed.

To allow this check to operate correctly, the only requirement is that the service GeometryConfigurationWriter be included in the job:

services.GeometryConfigurationWriter: {}

This must happen on the first job in the processing chain that configures Geometry service. It is irrelevant, but not harmful, in the jobs that follow.

Design details

This section describes the full design of the check from a technical point of view. Users do not need to understand the mechanisms of this check in order to configure their jobs to successfully pass it.

The check happens based on the data contained in the sumdata::GeometryConfigurationInfo data product. Starting from after the construction is complete, geo::Geometry is able to provide at any time an instance of sumdata::GeometryConfigurationInfo describing the geometry configuration for this job, whether the geometry is already configured or not.

The Geometry service loads the geometry at the beginning of the job. At the start of each run from the input file, the Geometry service reads a configuration information sumdata::GeometryConfigurationInfo from the art::Run record and verifies that it is compatible with the current configuration. It is a fatal error for this information not to be available in art::Run, and it is a fatal check failure if the available information is not compatible with the current configuration.

The sumdata::GeometryConfigurationInfo information is put into art::Run record by the geo::GeometryConfigurationWriter producing service. This service verifies whether there is already such information in the run. If no information is available yet in art::Run, the service obtains the current configuration information from the Geometry service, and then puts it into the art::Run record. The art framework guarantees that this happens before the Geometry service itself is notified by art of the start of the new run. If some geo::GeometryConfigurationWriter information is already in the run record, geo::GeometryConfigurationWriter replicates it again. As legacy check, if there is no information in the sumdata::GeometryConfigurationInfo form but there is a sumdata::RunData data product, the latter is used as a base for the check.

Design notes:

Definition at line 181 of file Geometry.h.

Member Typedef Documentation

type of service provider

Definition at line 185 of file Geometry.h.

Constructor & Destructor Documentation

geo::Geometry::Geometry ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry &  reg 
)

Definition at line 42 of file Geometry.cc.

43  : GeometryCore(pset)
44  , fRelPath (pset.get< std::string >("RelativePath", "" ))
45  , fDisableWiresInG4 (pset.get< bool >("DisableWiresInG4", false))
46  , fNonFatalConfCheck(pset.get< bool >("SkipConfigurationCheck", false))
47  , fSortingParameters(pset.get<fhicl::ParameterSet>("SortingParameters", fhicl::ParameterSet() ))
48  , fBuilderParameters(pset.get<fhicl::ParameterSet>("Builder", fhicl::ParameterSet() ))
49  {
50 
51  if (pset.has_key("ForceUseFCLOnly")) {
52  throw art::Exception(art::errors::Configuration)
53  << "Geometry service does not support `ForceUseFCLOnly` configuration parameter any more.\n";
54  }
55 
56  // add a final directory separator ("/") to fRelPath if not already there
57  if (!fRelPath.empty() && (fRelPath.back() != '/')) fRelPath += '/';
58 
59  // register a callback to be executed when a new run starts
60  reg.sPreBeginRun.watch(this, &Geometry::preBeginRun);
61 
62  //......................................................................
63  // 5.15.12 BJR: use the gdml file for both the fGDMLFile and fROOTFile
64  // variables as ROOT v5.30.06 is once again able to read in gdml files
65  // during batch operation, in this case think of fROOTFile meaning the
66  // file used to make the ROOT TGeoManager. I don't want to remove
67  // the separate variables in case ROOT breaks again
68  std::string GDMLFileName = pset.get<std::string>("GDML");
69  std::string ROOTFileName = pset.get<std::string>("GDML");
70 
71  // load the geometry
72  LoadNewGeometry(GDMLFileName, ROOTFileName);
73 
75 
76  } // Geometry::Geometry()
fhicl::ParameterSet fSortingParameters
Parameter set to define the channel map sorting.
Definition: Geometry.h:240
void FillGeometryConfigurationInfo(fhicl::ParameterSet const &config)
Fills the service configuration information into fConfInfo.
Definition: Geometry.cc:174
bool fNonFatalConfCheck
Definition: Geometry.h:238
bool fDisableWiresInG4
Definition: Geometry.h:236
std::string ROOTFileName
void preBeginRun(art::Run const &run)
Updates the geometry if needed at the beginning of each new run.
Definition: Geometry.cc:79
fhicl::ParameterSet fBuilderParameters
Parameter set for geometry builder.
Definition: Geometry.h:241
GeometryCore(fhicl::ParameterSet const &pset)
Initialize geometry from a given configuration.
std::string fRelPath
Definition: Geometry.h:234
void LoadNewGeometry(std::string gdmlfile, std::string rootfile, bool bForceReload=false)
Expands the provided paths and loads the geometry description(s)
Definition: Geometry.cc:122
std::string GDMLFileName

Member Function Documentation

bool geo::Geometry::CheckConfigurationInfo ( sumdata::GeometryConfigurationInfo const &  other) const
private

Returns if the other configuration is compatible with our current.

Definition at line 194 of file Geometry.cc.

195  {
196 
197  MF_LOG_DEBUG("Geometry") << "New geometry information:\n" << other;
198 
199  return CompareConfigurationInfo(fConfInfo, other);
200 
201  } // Geometry::CheckConfigurationInfo()
static bool CompareConfigurationInfo(sumdata::GeometryConfigurationInfo const &A, sumdata::GeometryConfigurationInfo const &B)
Returns if A and B are compatible geometry service configurations.
Definition: Geometry.cc:225
sumdata::GeometryConfigurationInfo fConfInfo
Summary of service configuration.
Definition: Geometry.h:243
bool geo::Geometry::CompareConfigurationInfo ( sumdata::GeometryConfigurationInfo const &  A,
sumdata::GeometryConfigurationInfo const &  B 
)
staticprivate

Returns if A and B are compatible geometry service configurations.

Definition at line 225 of file Geometry.cc.

229  {
230  /*
231  * Implemented criteria:
232  *
233  * * both informations must be valid
234  * * the detector names must exactly match
235  *
236  */
237 
238  if (!A.isDataValid()) {
239  mf::LogWarning("Geometry") << "Geometry::CompareConfigurationInfo(): "
240  "invalid version for configuration A:\n" << A;
241  return false;
242  }
243  if (!B.isDataValid()) {
244  mf::LogWarning("Geometry") << "Geometry::CompareConfigurationInfo(): "
245  "invalid version for configuration B:\n" << B;
246  return false;
247  }
248 
249  // currently used only in debug mode (assert())
250  [[maybe_unused]] auto const commonVersion = std::min(A.dataVersion, B.dataVersion);
251 
252  assert(commonVersion >= 1);
253 
254  if (A.detectorName != B.detectorName) { // case sensitive so far
255  mf::LogWarning("Geometry") << "Geometry::CompareConfigurationInfo(): "
256  "detector name mismatch: '" << A.detectorName << "' vs. '"
257  << B.detectorName << "'";
258  return false;
259  }
260 
261  return true;
262  } // CompareConfigurationInfo()
float A
Definition: dedx.py:137
sumdata::GeometryConfigurationInfo const& geo::Geometry::configurationInfo ( ) const
inline

Returns the current geometry configuration information.

Definition at line 194 of file Geometry.h.

195  { return fConfInfo; }
sumdata::GeometryConfigurationInfo fConfInfo
Summary of service configuration.
Definition: Geometry.h:243
void geo::Geometry::FillGeometryConfigurationInfo ( fhicl::ParameterSet const &  config)
private

Fills the service configuration information into fConfInfo.

Definition at line 174 of file Geometry.cc.

175  {
176 
179 
180  // version 1+:
181  confInfo.detectorName = DetectorName();
182 
183  // version 2+:
184  confInfo.geometryServiceConfiguration = config.to_indented_string();
185  fConfInfo = std::move(confInfo);
186 
187  MF_LOG_TRACE("Geometry")
188  << "Geometry configuration information:\n" << fConfInfo;
189 
190  } // Geometry::FillGeometryConfigurationInfo()
DataVersion_t dataVersion
Version of the data in this object (0 is invalid version).
std::string geometryServiceConfiguration
geo::Geometry service configuration, as FHiCL table.
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
sumdata::GeometryConfigurationInfo fConfInfo
Summary of service configuration.
Definition: Geometry.h:243
unsigned int DataVersion_t
Type used for the version of data.
Description of the current configuration of detector geometry.
void geo::Geometry::InitializeChannelMap ( )
private

Definition at line 107 of file Geometry.cc.

108  {
109  // the channel map is responsible of calling the channel map configuration
110  // of the geometry
111  art::ServiceHandle<geo::ExptGeoHelperInterface const> helper{};
112  auto channelMapAlg = helper->ConfigureChannelMapAlg(fSortingParameters,
113  DetectorName());
114  if (!channelMapAlg) {
115  throw cet::exception("ChannelMapLoadFail")
116  << " failed to load new channel map";
117  }
118  ApplyChannelMap(move(channelMapAlg));
119  } // Geometry::InitializeChannelMap()
fhicl::ParameterSet fSortingParameters
Parameter set to define the channel map sorting.
Definition: Geometry.h:240
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
void ApplyChannelMap(std::unique_ptr< geo::ChannelMapAlg > pChannelMap)
Initializes the geometry to work with this channel map.
void geo::Geometry::LoadNewGeometry ( std::string  gdmlfile,
std::string  rootfile,
bool  bForceReload = false 
)
private

Expands the provided paths and loads the geometry description(s)

Definition at line 122 of file Geometry.cc.

125  {
126  // start with the relative path
128 
129  // add the base file names
130  ROOTFileName.append(gdmlfile); // not rootfile (why?)
131  GDMLFileName.append(gdmlfile);
132 
133  // special for GDML if geometry with no wires is used for Geant4 simulation
135  GDMLFileName.insert(GDMLFileName.find(".gdml"), "_nowires");
136 
137  // Search all reasonable locations for the GDML file that contains
138  // the detector geometry.
139  // cet::search_path constructor decides if initialized value is a path
140  // or an environment variable
141  cet::search_path const sp{"FW_SEARCH_PATH"};
142 
143  std::string GDMLfile;
144  if( !sp.find_file(GDMLFileName, GDMLfile) ) {
145  throw cet::exception("Geometry")
146  << "cannot find the gdml geometry file:"
147  << "\n" << GDMLFileName
148  << "\nbail ungracefully.\n";
149  }
150 
151  std::string ROOTfile;
152  if( !sp.find_file(ROOTFileName, ROOTfile) ) {
153  throw cet::exception("Geometry")
154  << "cannot find the root geometry file:\n"
155  << "\n" << ROOTFileName
156  << "\nbail ungracefully.\n";
157  }
158 
159  {
160  fhicl::Table<geo::GeometryBuilderStandard::Config> const config{fBuilderParameters, {"tool_type"}};
161  geo::GeometryBuilderStandard builder{config()};
162 
163  // initialize the geometry with the files we have found
164  LoadGeometryFile(GDMLfile, ROOTfile, builder, bForceReload);
165  }
166 
167  // now update the channel map
169 
170  } // Geometry::LoadNewGeometry()
bool fDisableWiresInG4
Definition: Geometry.h:236
std::string ROOTFileName
fhicl::ParameterSet fBuilderParameters
Parameter set for geometry builder.
Definition: Geometry.h:241
std::string fRelPath
Definition: Geometry.h:234
void LoadGeometryFile(std::string gdmlfile, std::string rootfile, geo::GeometryBuilder &builder, bool bForceReload=false)
Loads the geometry information from the specified files.
std::string GDMLFileName
Extracts of LArSoft geometry information from ROOT.
void InitializeChannelMap()
Definition: Geometry.cc:107
void geo::Geometry::preBeginRun ( art::Run const &  run)
private

Updates the geometry if needed at the beginning of each new run.

Definition at line 79 of file Geometry.cc.

80  {
81 
82  sumdata::GeometryConfigurationInfo const inputGeomInfo
83  = ReadConfigurationInfo(run);
84  if (!CheckConfigurationInfo(inputGeomInfo)) {
85  if (fNonFatalConfCheck) {
86  // disable the non-fatal option if you need the details
87  mf::LogWarning("Geometry") << "Geometry used for " << run.id()
88  << " is incompatible with the one configured in the job.";
89  }
90  else {
91  throw cet::exception("Geometry")
92  << "Geometry used for run " << run.id()
93  << " is incompatible with the one configured in the job!"
94  << "\n=== job configuration " << std::string(50, '=')
95  << "\n" << fConfInfo
96  << "\n=== run configuration " << std::string(50, '=')
97  << "\n" << inputGeomInfo
98  << "\n======================" << std::string(50, '=')
99  << "\n";
100  }
101  }
102 
103  } // Geometry::preBeginRun()
bool fNonFatalConfCheck
Definition: Geometry.h:238
bool CheckConfigurationInfo(sumdata::GeometryConfigurationInfo const &other) const
Returns if the other configuration is compatible with our current.
Definition: Geometry.cc:194
static sumdata::GeometryConfigurationInfo const & ReadConfigurationInfo(art::Run const &run)
Reads and returns the geometry configuration information from the run.
Definition: Geometry.cc:205
sumdata::GeometryConfigurationInfo fConfInfo
Summary of service configuration.
Definition: Geometry.h:243
Description of the current configuration of detector geometry.
provider_type const* geo::Geometry::provider ( ) const
inline

Returns a pointer to the geometry service provider.

Definition at line 190 of file Geometry.h.

191  { return static_cast<provider_type const*>(this); }
GeometryCore provider_type
type of service provider
Definition: Geometry.h:185
sumdata::GeometryConfigurationInfo const & geo::Geometry::ReadConfigurationInfo ( art::Run const &  run)
staticprivate

Reads and returns the geometry configuration information from the run.

Definition at line 205 of file Geometry.cc.

206  {
207 
208  try {
209  return run.getProduct<sumdata::GeometryConfigurationInfo>
210  (art::InputTag{"GeometryConfigurationWriter"});
211  }
212  catch (art::Exception const& e) {
213  throw art::Exception{
214  e.categoryCode(),
215  "Can't read geometry configuration information.\n"
216  "Is `GeometryConfigurationWriter` service configured?\n",
217  e
218  };
219  }
220 
221  } // Geometry::ReadConfigurationInfo()
do i e
Description of the current configuration of detector geometry.

Member Data Documentation

fhicl::ParameterSet geo::Geometry::fBuilderParameters
private

Parameter set for geometry builder.

Definition at line 241 of file Geometry.h.

sumdata::GeometryConfigurationInfo geo::Geometry::fConfInfo
private

Summary of service configuration.

Definition at line 243 of file Geometry.h.

bool geo::Geometry::fDisableWiresInG4
private

If set true, supply G4 with GDMLfileNoWires rather than GDMLfile

Definition at line 236 of file Geometry.h.

bool geo::Geometry::fNonFatalConfCheck
private

Don't stop if configuration check fails. files specified in the fcl file

Definition at line 238 of file Geometry.h.

std::string geo::Geometry::fRelPath
private

Relative path added to FW_SEARCH_PATH to search for geometry file

Definition at line 234 of file Geometry.h.

fhicl::ParameterSet geo::Geometry::fSortingParameters
private

Parameter set to define the channel map sorting.

Definition at line 240 of file Geometry.h.


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