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_idIterateCryostatIDs () 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_idIterateTPCIDs (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_TPCIterateTPCs (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_idIteratePlaneIDs (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_idIteratePlaneIDs (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_planeIteratePlanes (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_planeIteratePlanes (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_idIterateWireIDs (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_idIterateWireIDs (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_idIterateWireIDs (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_wireIterateWires (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_wireIterateWires (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_wireIterateWires (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_idIterateTPCsetIDs () 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_idIterateTPCsetIDs (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_idIterateROPIDs (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_idIterateROPIDs (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...
 
template<typename Point >
geo::GeometryCore::Segment< PointWireEndPoints (geo::WireID const &wireid) const
 
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< PointWireEndPoints (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_tcoordIs { 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 196 of file Geometry.h.

Member Typedef Documentation

type of service provider

Definition at line 200 of file Geometry.h.

Constructor & Destructor Documentation

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

Definition at line 38 of file Geometry_service.cc.

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

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 190 of file Geometry_service.cc.

191  {
192 
193  MF_LOG_DEBUG("Geometry") << "New geometry information:\n" << other;
194 
196 
197  } // Geometry::CheckConfigurationInfo()
static bool CompareConfigurationInfo(sumdata::GeometryConfigurationInfo const &A, sumdata::GeometryConfigurationInfo const &B)
Returns if A and B are compatible geometry service configurations.
sumdata::GeometryConfigurationInfo fConfInfo
Summary of service configuration.
Definition: Geometry.h:258
#define MF_LOG_DEBUG(id)
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 221 of file Geometry_service.cc.

225  {
226  /*
227  * Implemented criteria:
228  *
229  * * both informations must be valid
230  * * the detector names must exactly match
231  *
232  */
233 
234  if (!A.isDataValid()) {
235  mf::LogWarning("Geometry") << "Geometry::CompareConfigurationInfo(): "
236  "invalid version for configuration A:\n" << A;
237  return false;
238  }
239  if (!B.isDataValid()) {
240  mf::LogWarning("Geometry") << "Geometry::CompareConfigurationInfo(): "
241  "invalid version for configuration B:\n" << B;
242  return false;
243  }
244 
245  // currently used only in debug mode (assert())
246  [[maybe_unused]] auto const commonVersion = std::min(A.dataVersion, B.dataVersion);
247 
248  assert(commonVersion >= 1);
249 
250  if (A.detectorName != B.detectorName) { // case sensitive so far
251  mf::LogWarning("Geometry") << "Geometry::CompareConfigurationInfo(): "
252  "detector name mismatch: '" << A.detectorName << "' vs. '"
253  << B.detectorName << "'";
254  return false;
255  }
256 
257  return true;
258  } // CompareConfigurationInfo()
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
#define A
Definition: memgrp.cpp:38
sumdata::GeometryConfigurationInfo const& geo::Geometry::configurationInfo ( ) const
inline

Returns the current geometry configuration information.

Definition at line 209 of file Geometry.h.

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

Fills the service configuration information into fConfInfo.

Definition at line 170 of file Geometry_service.cc.

171  {
172 
175 
176  // version 1+:
177  confInfo.detectorName = DetectorName();
178 
179  // version 2+:
180  confInfo.geometryServiceConfiguration = config.to_indented_string();
181  fConfInfo = std::move(confInfo);
182 
183  MF_LOG_TRACE("Geometry")
184  << "Geometry configuration information:\n" << fConfInfo;
185 
186  } // 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.
static Config * config
Definition: config.cpp:1054
def move(depos, offset)
Definition: depos.py:107
#define MF_LOG_TRACE(id)
sumdata::GeometryConfigurationInfo fConfInfo
Summary of service configuration.
Definition: Geometry.h:258
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 103 of file Geometry_service.cc.

104  {
105  // the channel map is responsible of calling the channel map configuration
106  // of the geometry
108  auto channelMapAlg = helper->ConfigureChannelMapAlg(fSortingParameters,
109  DetectorName());
110  if (!channelMapAlg) {
111  throw cet::exception("ChannelMapLoadFail")
112  << " failed to load new channel map";
113  }
114  ApplyChannelMap(move(channelMapAlg));
115  } // Geometry::InitializeChannelMap()
fhicl::ParameterSet fSortingParameters
Parameter set to define the channel map sorting.
Definition: Geometry.h:255
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
def move(depos, offset)
Definition: depos.py:107
void ApplyChannelMap(std::unique_ptr< geo::ChannelMapAlg > pChannelMap)
Initializes the geometry to work with this channel map.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
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 118 of file Geometry_service.cc.

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

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

Definition at line 75 of file Geometry_service.cc.

76  {
77 
78  sumdata::GeometryConfigurationInfo const inputGeomInfo
80  if (!CheckConfigurationInfo(inputGeomInfo)) {
81  if (fNonFatalConfCheck) {
82  // disable the non-fatal option if you need the details
83  mf::LogWarning("Geometry") << "Geometry used for " << run.id()
84  << " is incompatible with the one configured in the job.";
85  }
86  else {
87  throw cet::exception("Geometry")
88  << "Geometry used for run " << run.id()
89  << " is incompatible with the one configured in the job!"
90  << "\n=== job configuration " << std::string(50, '=')
91  << "\n" << fConfInfo
92  << "\n=== run configuration " << std::string(50, '=')
93  << "\n" << inputGeomInfo
94  << "\n======================" << std::string(50, '=')
95  << "\n";
96  }
97  }
98 
99  } // Geometry::preBeginRun()
std::string string
Definition: nybbler.cc:12
bool fNonFatalConfCheck
Definition: Geometry.h:253
bool CheckConfigurationInfo(sumdata::GeometryConfigurationInfo const &other) const
Returns if the other configuration is compatible with our current.
static sumdata::GeometryConfigurationInfo const & ReadConfigurationInfo(art::Run const &run)
Reads and returns the geometry configuration information from the run.
sumdata::GeometryConfigurationInfo fConfInfo
Summary of service configuration.
Definition: Geometry.h:258
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
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 205 of file Geometry.h.

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

Reads and returns the geometry configuration information from the run.

Definition at line 201 of file Geometry_service.cc.

202  {
203 
204  try {
205  return run.getProduct<sumdata::GeometryConfigurationInfo>
206  (art::InputTag{"GeometryConfigurationWriter"});
207  }
208  catch (art::Exception const& e) {
209  throw art::Exception{
210  e.categoryCode(),
211  "Can't read geometry configuration information.\n"
212  "Is `GeometryConfigurationWriter` service configured?\n",
213  e
214  };
215  }
216 
217  } // Geometry::ReadConfigurationInfo()
const double e
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
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 256 of file Geometry.h.

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

Summary of service configuration.

Definition at line 258 of file Geometry.h.

bool geo::Geometry::fDisableWiresInG4
private

If set true, supply G4 with GDMLfileNoWires rather than GDMLfile

Definition at line 251 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 253 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 249 of file Geometry.h.

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

Parameter set to define the channel map sorting.

Definition at line 255 of file Geometry.h.


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