LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
geo::GeometryCore Class Reference

Description of geometry of one entire detector. More...

#include "GeometryCore.h"

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

Classes

struct  Segment
 Simple class with two points (a pair with aliases). More...
 

Public Types

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

 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...
 
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::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 WireIDsIntersect (WireID const &wid1, WireID const &wid2, WireIDIntersection &widIntersect) const
 Computes the intersection between two wires. 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...
 
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...
 
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< Point > WireEndPoints (geo::WireID const &wireid) const
 
Detector information
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
 Returns a string with the name of the detector, as configured. More...
 
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
 Name of the deepest material containing the point xyz. More...
 
double TotalMass () const
 Returns the total mass [kg] of the specified volume (default: world). More...
 
double TotalMass (std::string vol) const
 Returns the total mass [kg] of the specified volume (default: world). More...
 
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
 Returns the column density between two points. More...
 
Cryostat access and information
unsigned int Ncryostats () const
 Returns the number of cryostats in the detector. More...
 
unsigned int NElements () const
 Returns the number of cryostats in the detector. More...
 
unsigned int NSiblingElements (geo::CryostatID const &) const
 Returns the number of cryostats in the detector. More...
 
bool HasCryostat (geo::CryostatID const &cryoid) const
 Returns whether we have the specified cryostat. More...
 
bool HasElement (geo::CryostatID const &cryoid) const
 Returns whether we have the specified cryostat. More...
 
CryostatGeo const & Cryostat (geo::CryostatID const &cryoid) const
 Returns the specified cryostat. More...
 
CryostatGeo const & Cryostat (unsigned int const cstat=0) const
 Returns the specified cryostat. More...
 
CryostatGeo const & GetElement (geo::CryostatID const &cryoid) const
 Returns the specified cryostat. More...
 
CryostatGeo const * CryostatPtr (geo::CryostatID const &cryoid) const
 Returns the specified cryostat. More...
 
CryostatGeo const * GetElementPtr (geo::CryostatID const &cryoid) const
 Returns the specified cryostat. More...
 
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
 Returns the index of the cryostat at specified location. More...
 
CryostatGeo const & PositionToCryostat (geo::Point_t const &point) const
 Returns the cryostat at specified location. More...
 
CryostatGeo const & PositionToCryostat (double const point[3]) const
 Returns the cryostat at specified location. More...
 
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
 Returns the half width of the cryostat (x direction) More...
 
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
 Returns the height of the cryostat (y direction) More...
 
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
 Returns the length of the cryostat (z direction) More...
 
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
 Return the name of LAr TPC volume. More...
 
TPC access and information
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
 Returns the total number of TPCs in the specified cryostat. More...
 
unsigned int NSiblingElements (geo::TPCID const &tpcid) const
 Returns the total number of TPCs in the specified cryostat. More...
 
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
 Returns the specified TPC. More...
 
TPCGeo const & GetElement (geo::TPCID const &tpcid) const
 Returns the specified TPC. More...
 
TPCGeo const * TPCPtr (geo::TPCID const &tpcid) const
 Returns the specified TPC. More...
 
TPCGeo const * GetElementPtr (geo::TPCID const &tpcid) const
 Returns the specified TPC. More...
 
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
 Returns the ID of the TPC at specified location. More...
 
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
 Returns the TPC at specified location. More...
 
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
 Returns the half width of the active volume of the specified TPC. More...
 
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
 Returns the half height of the active volume of the specified TPC. More...
 
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
 Returns the length of the active volume of the specified TPC. More...
 
template<typename Point = DefaultPoint_t>
Point GetTPCFrontFaceCenter (geo::TPCID const &tpcid) const
 Returns the center of side of the detector facing the beam. More...
 
template<typename Point = DefaultPoint_t>
Point GetTPCFrontFaceCenter (unsigned int tpc=0, unsigned int cstat=0) const
 Returns the center of side of the detector facing the beam. More...
 
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
 Return the name of specified LAr TPC volume. More...
 
Plane access and information
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
 Returns the total number of wire planes in the specified TPC. More...
 
unsigned int NSiblingElements (geo::PlaneID const &planeid) const
 Returns the total number of wire planes in the specified TPC. More...
 
bool HasPlane (geo::PlaneID const &planeid) const
 Returns whether we have the specified plane. More...
 
bool HasElement (geo::PlaneID const &planeid) const
 Returns whether we have the specified plane. More...
 
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
 Returns the specified wire. More...
 
PlaneGeo const & GetElement (geo::PlaneID const &planeid) const
 Returns the specified wire. More...
 
PlaneGeo const * PlanePtr (geo::PlaneID const &planeid) const
 Returns the specified plane. More...
 
PlaneGeo const * GetElementPtr (geo::PlaneID const &planeid) const
 Returns the specified plane. More...
 
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
 Returns the distance between two planes. More...
 
geo::Length_t PlanePitch (unsigned int p1=0, unsigned int p2=1, unsigned int tpc=0, unsigned int cstat=0) const
 Returns the distance between two planes. More...
 
Wire access and information
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
 Returns the total number of wires in the specified plane. More...
 
unsigned int NSiblingElements (geo::WireID const &wireid) const
 Returns the total number of wires in the specified plane. More...
 
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
 Returns whether we have the specified wire. More...
 
WireGeo const * WirePtr (geo::WireID const &wireid) const
 Returns the specified wire. More...
 
WireGeo const * GetElementPtr (geo::WireID const &wireid) const
 Returns the specified wire. More...
 
WireGeo const & Wire (geo::WireID const &wireid) const
 Returns the specified wire. More...
 
WireGeo const & WireIDToWireGeo (geo::WireID const &wireid) const
 Returns the specified wire. More...
 
WireGeo const & GetElement (geo::WireID const &wireid) const
 Returns the specified wire. More...
 
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
 Returns the distance between two consecutive wires. More...
 
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
 Returns the angle of the wires in the specified view from vertical. More...
 
Wire geometry queries

Please note the differences between functions: ChannelsIntersect(), WireIDsIntersect() and IntersectionPoint() all calculate wires intersection using the same equation. ChannelsIntersect() and WireIdsIntersect() will return true if the two wires cross, return false if they don't. IntersectionPoint() does not check if the two wires cross.

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 = DefaultPoint_t>
Segment< Point > WireEndPoints (geo::WireID const &wireID) const
 Returns a segment whose ends are the wire end points. 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 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
 Fills two arrays with the coordinates of the wire end points. More...
 
geo::WireID NearestWireID (const TVector3 &point, geo::PlaneID const &planeid) const
 Fills two arrays with the coordinates of the wire end points. More...
 
geo::WireID NearestWireID (const double point[3], unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 Fills two arrays with the coordinates of the wire end points. More...
 
geo::WireID NearestWireID (std::vector< double > const &point, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 Fills two arrays with the coordinates of the wire end points. More...
 
geo::WireID NearestWireID (const TVector3 &point, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 Fills two arrays with the coordinates of the wire end points. More...
 
geo::WireID NearestWireID (geo::Point_t const &point, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 Fills two arrays with the coordinates of the wire end points. More...
 
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
 Returns the index of wire closest to position in the specified TPC. More...
 
unsigned int NearestWire (const TVector3 &worldLoc, geo::PlaneID const &planeid) const
 Returns the index of wire closest to position in the specified TPC. More...
 
unsigned int NearestWire (const double worldLoc[3], unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 Returns the index of wire closest to position in the specified TPC. More...
 
unsigned int NearestWire (std::vector< double > const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 Returns the index of wire closest to position in the specified TPC. More...
 
unsigned int NearestWire (const TVector3 &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 Returns the index of wire closest to position in the specified TPC. More...
 
unsigned int NearestWire (geo::Point_t const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 Returns the index of wire closest to position in the specified TPC. More...
 
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
 Returns the index of the nearest wire to the specified position. More...
 
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
 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
 Returns the slope on the third plane, given it in the other two. More...
 
Optical detector geometry access and information
unsigned int NOpDets () const
 Number of OpDets in the whole detector. More...
 
OpDetGeo const & OpDetGeoFromOpChannel (unsigned int OpChannel) const
 Access the OpDetGeo object by OpDet or Channel Number. More...
 
OpDetGeo const & OpDetGeoFromOpDet (unsigned int OpDet) const
 Number of OpDets in the whole detector. 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
 Find the nearest OpChannel to some point. More...
 
Auxiliary detectors access and information
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]) const
 Returns the index of the auxiliary detector at specified location. More...
 
unsigned int FindAuxDetAtPosition (geo::Point_t const &point) 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) const
 Fills the indices of the sensitive auxiliary detector at location. More...
 
void FindAuxDetSensitiveAtPosition (double const worldLoc[3], size_t &adg, size_t &sv) const
 Fills the indices of the sensitive auxiliary detector at location. More...
 
AuxDetGeo const & PositionToAuxDet (geo::Point_t const &point, unsigned int &ad) const
 Returns the auxiliary detector at specified location. More...
 
AuxDetGeo const & PositionToAuxDet (double const worldLoc[3], unsigned int &ad) const
 Returns the auxiliary detector at specified location. More...
 
const AuxDetSensitiveGeoPositionToAuxDetSensitive (geo::Point_t const &point, size_t &ad, size_t &sv) const
 Returns the auxiliary detector at specified location. More...
 
const AuxDetSensitiveGeoPositionToAuxDetSensitive (double const worldLoc[3], size_t &ad, size_t &sv) const
 Returns the auxiliary detector at specified location. More...
 
const AuxDetGeoChannelToAuxDet (std::string const &auxDetName, uint32_t const &channel) const
 Returns the number of auxiliary detectors. More...
 
const AuxDetSensitiveGeoChannelToAuxDetSensitive (std::string const &auxDetName, uint32_t const &channel) const
 Returns the number of auxiliary detectors. More...
 
TPC readout channels and views
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::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
 Returns the number of TPC readout channels in the detector. More...
 
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
 Returns the ID of the channel nearest to the specified position. More...
 
raw::ChannelID_t NearestChannel (const TVector3 &worldLoc, geo::PlaneID const &planeid) const
 Returns the ID of the channel nearest to the specified position. More...
 
raw::ChannelID_t NearestChannel (const double worldLoc[3], unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 Returns the ID of the channel nearest to the specified position. More...
 
raw::ChannelID_t NearestChannel (std::vector< double > const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 Returns the ID of the channel nearest to the specified position. More...
 
raw::ChannelID_t NearestChannel (const TVector3 &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 Returns the ID of the channel nearest to the specified position. More...
 
raw::ChannelID_t NearestChannel (geo::Point_t const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 Returns the ID of the channel nearest to the specified position. More...
 
TPC set information
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
 Returns the total number of TPC sets in the specified cryostat. More...
 
Readout plane information
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
 Returns the total number of ROP in the specified TPC set. More...
 
Optical readout channels
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
 Number of electronics channels for all the optical detectors. More...
 
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...
 
Geometry initialization
void LoadGeometryFile (std::string gdmlfile, std::string rootfile, bool bForceReload=false)
 Loads the geometry information from the specified files. More...
 
void ApplyChannelMap (std::shared_ptr< geo::ChannelMapAlg > pChannelMap)
 Initializes the geometry to work with this channel map. More...
 

Static Public Member Functions

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

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

void SetDetectorName (std::string 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
 Return the internal cryostat list. More...
 
AuxDetList_tAuxDets ()
 Return the interfal auxiliary detectors list. More...
 
AuxDetList_t const & AuxDets () const
 Return the interfal auxiliary detectors list. More...
 

Private Types

using DefaultVector_t = TVector3
 Default template argument. More...
 
using DefaultPoint_t = TVector3
 Default template argument. More...
 

Private Member Functions

std::vector< TGeoNode const * > FindDetectorEnclosure (std::string const &name="volDetEnclosure") const
 
bool FindFirstVolume (std::string const &name, std::vector< const TGeoNode * > &path) const
 
void FindCryostat (std::vector< const TGeoNode * > &path, unsigned int depth)
 
void MakeCryostat (std::vector< const TGeoNode * > &path, int depth)
 
void FindAuxDet (std::vector< const TGeoNode * > &path, unsigned int depth)
 
void MakeAuxDet (std::vector< const TGeoNode * > &path, int depth)
 
bool WireIDIntersectionCheck (const geo::WireID &wid1, const geo::WireID &wid2) const
 Wire ID check for WireIDsIntersect methods. More...
 
void SortGeometry (geo::GeoObjectSorter const &sorter)
 Runs the sorting of geometry with the sorter provided by channel mapping. More...
 
void UpdateAfterSorting ()
 Performs all the updates needed after sorting. More...
 
void ClearGeometry ()
 Deletes the detector geometry structures. More...
 

Static Private Member Functions

static bool PointWithinSegments (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)
 Returns whether x and y are within both specified ranges (A and B). More...
 
static void CheckIndependentPlanesOnSameTPC (geo::PlaneID const &pid1, geo::PlaneID const &pid2, const char *caller)
 

Private Attributes

GeometryData_t fGeoData
 The detector description data. More...
 
double fSurfaceY
 The point where air meets earth for this detector. More...
 
std::string fDetectorName
 Name of the detector. More...
 
std::string fGDMLfile
 path to geometry file used for Geant4 simulation More...
 
std::string fROOTfile
 path to geometry file for geometry in GeometryCore More...
 
double fMinWireZDist
 
double fPositionWiggle
 accounting for rounding errors when testing positions More...
 
std::shared_ptr< const geo::ChannelMapAlgfChannelMapAlg
 Object containing the channel to wire mapping. More...
 
std::set< geo::View_tallViews
 All views in the detector. More...
 

Detailed Description

Description of geometry of one entire detector.


Note
All lengths are specified in centimetres

How to correctly instantiate a GeometryCore object

Instantiation is a multi-step procedure:

  1. construct a GeometryCore object (the "service provider"), with the full configuration; at this step, configuration is just stored
  2. load a geometry with GeometryCore::LoadGeometryFile(); this loads the detector geometry information
  3. prepare a channel map algorithm object (might use for example GeometryCore::DetectorName() or the detector geometry from the newly created object, but any use of channel mapping related functions is forbidden and it would yield undefined behaviour (expected to be catastrophic)
  4. acquire the channel mapping algorithm with GeometryCore::ApplyChannelMap(); at this point, the ChannelMapAlg object is asked to initialize itself and to perform whatever modifications to the geometry provider is needed.

Step 3 (creation of the channel mapping algorithm object) can be performed at any time before step 4, provided that no GeometryCore instance is needed for it.

Configuration parameters

  • Name (string; mandatory): string identifying the detector; it can be different from the base name of the file used to initialize the geometry; standard names are recommended by each experiment. This name can be used, for example, to select which channel mapping algorithm to use.
  • SurfaceY (real; mandatory): depth of the detector, in centimetrs; see SurfaceY() for details
  • MinWireZDist (real; default: 3)
  • PositionEpsilon (real; default: 0.01%) set the default tolerance (see DefaultWiggle())

Definition at line 1442 of file GeometryCore.h.

Member Typedef Documentation

Type of list of auxiliary detectors.

Definition at line 1479 of file GeometryCore.h.

Forward-iterator browsing all cryostat IDs in the detector.

Usage example with a while loop:

iCryostat = geom->begin_cryostat_id(), cend = geom->end_cryostat_id();
while (iCryostat != cend) {
std::cout << "Cryo: " << iCryostat->Cryostat << std::endl;
const geo::CryostatGeo* pCryo = iCryostat.get();
++iCryostat;
// ...
} // while

The recommended way to iterate is actually to use GeometryCore::IterateCryostatIDs() in a range-for loop. It is recommended to save the end iterator rather than calling GeometryCore::end_cryostat_id() on every check.

Definition at line 1510 of file GeometryCore.h.

Forward-iterator browsing all cryostats in the detector.

Usage example with a while loop:

iCryostat = geom->begin_cryostat(), cend = geom->end_cryostat();
while (iCryostat != cend) {
std::cout << "Cryo: " << iCryostat.ID() << std::endl;
geo::CryostatGeo const& Cryo = *iCryostat;
++iCryostat;
// ...
} // while

The recommended way to iterate is actually to use GeometryCore::IterateCryostats() in a range-for loop. It is recommended to save the end iterator rather than calling GeometryCore::end_cryostat() on every check.

Definition at line 1531 of file GeometryCore.h.

Type of list of cryostats.

Definition at line 1477 of file GeometryCore.h.

using geo::GeometryCore::DefaultPoint_t = TVector3
private

Default template argument.

Definition at line 1445 of file GeometryCore.h.

using geo::GeometryCore::DefaultVector_t = TVector3
private

Default template argument.

Definition at line 1444 of file GeometryCore.h.

Definition at line 1451 of file GeometryCore.h.

Forward-iterator browsing all plane IDs in the detector.

Usage example with a while loop:

geo::GeometryCore::plane_id_iterator iPlane = geom->begin_plane_id(),
pend = geom->end_plane_id();
while (iPlane != pend) {
std::cout << "Plane: " << *iPlane << std::endl;
// the plane descriptor object
const geo::PlaneGeo* pPlane = iPlane.get();
// the TPC the plane is in
geo::TPCGeo const& TPC = geom->TPC(*iPlane);
++iPlane;
// ...
} // while

The recommended way to iterate is actually to use GeometryCore::IteratePlaneIDs() in a range-for loop. It is recommended to save the end iterator rather than calling GeometryCore::end_plane_id() on every check.

Definition at line 1601 of file GeometryCore.h.

Forward-iterator browsing all planes in the detector.

Usage example with a while loop:

geo::GeometryCore::plane_iterator iPlane = geom->begin_plane(),
pend = geom->end_plane();
while (iPlane != pend) {
std::cout << "Plane: " << iPlane.ID() << std::endl;
// the plane descriptor object
geo::PlaneGeo const& Plane = *iPlane;
++iPlane;
// ...
} // while

The recommended way to iterate is actually to use GeometryCore::IteratePlanes() in a range-for loop. It is recommended to save the end iterator rather than calling GeometryCore::end_plane() on every check.

Definition at line 1623 of file GeometryCore.h.

Forward-iterator browsing all TPC IDs in the detector.

Usage example with a while loop:

geo::GeometryCore::TPC_id_iterator iTPC = geom->begin_TPC_id(),
tend = geom->end_TPC_id();
while (iTPC != tend) {
std::cout << "TPC: " << *iTPC << std::endl;
// the TPC descriptor object
const geo::TPCGeo* pTPC = iTPC.get();
// the cryostat the TPC is in
geo::CryostatGeo const& Cryo = geom->Cryostat(*iTPC);
++iTPC;
// ...
} // while

The recommended way to iterate is actually to use GeometryCore::IterateTPCIDs() in a range-for loop. It is recommended to save the end iterator rather than calling GeometryCore::end_TPC_id() on every check.

Definition at line 1555 of file GeometryCore.h.

Forward-iterator browsing all TPCs in the detector.

Usage example with a while loop:

geo::GeometryCore::TPC_iterator iTPC = geom->begin_TPC(),
tend = geom->end_TPC();
while (iTPC != tend) {
std::cout << "TPC: " << iTPC.ID() << std::endl;
// the TPC descriptor object
geo::TPCGeo const& TPC = *iTPC;
++iTPC;
// ...
} // while

The recommended way to iterate is actually to use GeometryCore::IterateTPCs() in a range-for loop. It is recommended to save the end iterator rather than calling GeometryCore::end_TPC() on every check.

Definition at line 1577 of file GeometryCore.h.

Forward-iterator browsing all wire IDs in the detector.

Usage example with a while loop:

geo::GeometryCore::wire_id_iterator iWire = geom->begin_wire_id(),
wend = geom->end_wire_id();
while (iWire != wend) {
std::cout << "Wire: " << *iWire << std::endl;
// the wire descriptor object
const geo::WireGeo* pWire = iWire.get();
// the TPC the wire is in
geo::TPCGeo const& TPC = geom->TPC(*iWire);
++iWire;
// ...
} // while

The recommended way to iterate is actually to use GeometryCore::IterateWireIDs() in a range-for loop. It is recommended to save the end iterator rather than calling GeometryCore::end_wire_id() on every check.

Definition at line 1647 of file GeometryCore.h.

Forward-iterator browsing all wires in the detector.

Usage example with a while loop:

geo::GeometryCore::wire_iterator iWire = geom->begin_wire(),
wend = geom->end_wire();
while (iWire != wend) {
std::cout << "Wire: " << iWire.ID() << std::endl;
// the wire descriptor object
geo::WireGeo const& Wire = *iWire;
++iWire;
// ...
} // while

The recommended way to iterate is actually to use GeometryCore::IterateWires() in a range-for loop. It is recommended to save the end iterator rather than calling GeometryCore::end_wire() on every check.

Definition at line 1669 of file GeometryCore.h.

Constructor & Destructor Documentation

geo::GeometryCore::GeometryCore ( fhicl::ParameterSet const &  pset)

Initialize geometry from a given configuration.

Parameters
psetconfiguration parameters

This constructor does not load any geometry description. The next step is to do exactly that, by GeometryCore::LoadGeometryFile().

Definition at line 61 of file GeometryCore.cxx.

References fDetectorName.

64  : fSurfaceY (pset.get< double >("SurfaceY" ))
65  , fDetectorName (pset.get< std::string >("Name" ))
66  , fMinWireZDist (pset.get< double >("MinWireZDist", 3.0 ))
67  , fPositionWiggle (pset.get< double >("PositionEpsilon", 1.e-4))
68  {
69  std::transform(fDetectorName.begin(), fDetectorName.end(),
70  fDetectorName.begin(), ::tolower);
71  } // GeometryCore::GeometryCore()
double fSurfaceY
The point where air meets earth for this detector.
double fPositionWiggle
accounting for rounding errors when testing positions
std::string fDetectorName
Name of the detector.
geo::GeometryCore::~GeometryCore ( )

Destructor.

Definition at line 75 of file GeometryCore.cxx.

References ApplyChannelMap(), and ClearGeometry().

75  {
76  ClearGeometry();
77  } // GeometryCore::~GeometryCore()
void ClearGeometry()
Deletes the detector geometry structures.
geo::GeometryCore::GeometryCore ( GeometryCore const &  )
delete
geo::GeometryCore::GeometryCore ( GeometryCore &&  )
delete

Member Function Documentation

void geo::GeometryCore::ApplyChannelMap ( std::shared_ptr< geo::ChannelMapAlg pChannelMap)

Initializes the geometry to work with this channel map.

Parameters
pChannelMapa pointer to the channel mapping algorithm to be used
See also
LoadGeometryFile()

The specified channel mapping is used with this geometry. The algorithm object is asked and allowed to make the necessary modifications to the geometry description. These modifications typically involve some resorting of the objects.

The ownership of the algorithm object is shared, usually with a calling framework: we maintain it alive as long as we need it (and no other code can delete it), and we delete it only if no other code is sharing the ownership.

This method needs to be called after LoadGeometryFile() to complete the geometry initialization.

Definition at line 82 of file GeometryCore.cxx.

References fChannelMapAlg, fGeoData, SortGeometry(), and UpdateAfterSorting().

Referenced by geo::StandardGeometryHelper::doConfigureChannelMapAlg(), and ~GeometryCore().

83  {
84  SortGeometry(pChannelMap->Sorter());
85  UpdateAfterSorting(); // after channel mapping has sorted objects, set their IDs
86  pChannelMap->Initialize(fGeoData);
87  fChannelMapAlg = pChannelMap;
88 
89  } // GeometryCore::ApplyChannelMap()
GeometryData_t fGeoData
The detector description data.
void SortGeometry(geo::GeoObjectSorter const &sorter)
Runs the sorting of geometry with the sorter provided by channel mapping.
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
void UpdateAfterSorting()
Performs all the updates needed after sorting.
const AuxDetGeo & geo::GeometryCore::AuxDet ( unsigned int const  ad = 0) const

Returns the specified auxiliary detector.

Parameters
adthe auxiliary detector index
Returns
a constant reference to the specified auxiliary detector
Todo:

what happens if it does not exist?

remove the default parameter?

Definition at line 299 of file GeometryCore.cxx.

References AuxDets(), and NAuxDets().

Referenced by ChannelToAuxDet(), ChannelToAuxDetSensitive(), PositionToAuxDet(), PositionToAuxDetSensitive(), and larg4::LArG4::produce().

300  {
301  if(ad >= NAuxDets())
302  throw cet::exception("GeometryCore") << "AuxDet "
303  << ad
304  << " does not exist\n";
305 
306  return *(AuxDets()[ad]);
307  }
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
AuxDetList_t& geo::GeometryCore::AuxDets ( )
inlineprotected

Return the interfal auxiliary detectors list.

Definition at line 5346 of file GeometryCore.h.

Referenced by AuxDet(), ChannelToAuxDet(), ChannelToAuxDetSensitive(), ClearGeometry(), FindAuxDetAtPosition(), FindAuxDetSensitiveAtPosition(), MakeAuxDet(), NAuxDetSensitive(), and SortGeometry().

5346 { return fGeoData.auxDets; }
GeometryData_t fGeoData
The detector description data.
AuxDetList_t auxDets
The auxiliary detectors.
AuxDetList_t const& geo::GeometryCore::AuxDets ( ) const
inlineprotected

Return the interfal auxiliary detectors list.

Definition at line 5347 of file GeometryCore.h.

5347 { return fGeoData.auxDets; }
GeometryData_t fGeoData
The detector description data.
AuxDetList_t auxDets
The auxiliary detectors.
cryostat_iterator geo::GeometryCore::begin_cryostat ( ) const
inline

Returns an iterator pointing to the first cryostat.

Definition at line 2124 of file GeometryCore.h.

References geo::details::geometry_iterator_types::begin_pos.

Referenced by evd_tool::ICARUSDrawer::DetOutline3D(), and IterateCryostatIDs().

geo::cryostat_iterator cryostat_iterator
Forward-iterator browsing all cryostats in the detector.
static constexpr BeginPos_t begin_pos
Definition: GeometryCore.h:119
cryostat_id_iterator geo::GeometryCore::begin_cryostat_id ( ) const
inline

Returns an iterator pointing to the first cryostat ID.

Definition at line 2116 of file GeometryCore.h.

References geo::details::geometry_iterator_types::begin_pos.

Referenced by end_cryostat().

static constexpr BeginPos_t begin_pos
Definition: GeometryCore.h:119
geo::cryostat_id_iterator cryostat_id_iterator
Forward-iterator browsing all cryostat IDs in the detector.
plane_iterator geo::GeometryCore::begin_plane ( ) const
inline

Returns an iterator pointing to the first plane in the detector.

Definition at line 3035 of file GeometryCore.h.

References geo::details::geometry_iterator_types::begin_pos.

Referenced by IteratePlaneIDs(), and IteratePlanes().

3036  { return plane_iterator(this, plane_iterator::begin_pos); }
static constexpr BeginPos_t begin_pos
Definition: GeometryCore.h:119
geo::plane_iterator plane_iterator
Forward-iterator browsing all planes in the detector.
plane_iterator geo::GeometryCore::begin_plane ( geo::CryostatID const &  ID) const
inline

Returns an iterator pointing to the first plane in the specified cryostat.

Definition at line 3044 of file GeometryCore.h.

3045  { return plane_iterator(this, GetBeginPlaneID(ID)); }
geo::PlaneID GetBeginPlaneID(geo::CryostatID const &id) const
Returns the ID of the first plane of the specified cryostat.
geo::plane_iterator plane_iterator
Forward-iterator browsing all planes in the detector.
plane_iterator geo::GeometryCore::begin_plane ( geo::TPCID const &  ID) const
inline

Returns an iterator pointing to the first plane in the specified TPC.

Definition at line 3053 of file GeometryCore.h.

3054  { return plane_iterator(this, GetBeginPlaneID(ID)); }
geo::PlaneID GetBeginPlaneID(geo::CryostatID const &id) const
Returns the ID of the first plane of the specified cryostat.
geo::plane_iterator plane_iterator
Forward-iterator browsing all planes in the detector.
plane_id_iterator geo::GeometryCore::begin_plane_id ( ) const
inline

Returns an iterator pointing to the first plane ID in the detector.

Definition at line 3007 of file GeometryCore.h.

References geo::details::geometry_iterator_types::begin_pos.

Referenced by end_plane(), and IteratePlaneIDs().

static constexpr BeginPos_t begin_pos
Definition: GeometryCore.h:119
geo::plane_id_iterator plane_id_iterator
Forward-iterator browsing all plane IDs in the detector.
plane_id_iterator geo::GeometryCore::begin_plane_id ( geo::CryostatID const &  ID) const
inline

Returns an iterator pointing to the first plane ID in the specified cryostat.

Definition at line 3016 of file GeometryCore.h.

3017  { return plane_id_iterator(this, GetBeginPlaneID(ID)); }
geo::PlaneID GetBeginPlaneID(geo::CryostatID const &id) const
Returns the ID of the first plane of the specified cryostat.
geo::plane_id_iterator plane_id_iterator
Forward-iterator browsing all plane IDs in the detector.
plane_id_iterator geo::GeometryCore::begin_plane_id ( geo::TPCID const &  ID) const
inline

Returns an iterator pointing to the first plane ID in the specified TPC.

Definition at line 3026 of file GeometryCore.h.

3027  { return plane_id_iterator(this, GetBeginPlaneID(ID)); }
geo::PlaneID GetBeginPlaneID(geo::CryostatID const &id) const
Returns the ID of the first plane of the specified cryostat.
geo::plane_id_iterator plane_id_iterator
Forward-iterator browsing all plane IDs in the detector.
ROP_id_iterator geo::GeometryCore::begin_ROP_id ( ) const
inline

Returns an iterator pointing to the first ROP ID in the detector.

Definition at line 5086 of file GeometryCore.h.

References geo::details::geometry_iterator_types::begin_pos.

Referenced by end_ROP_id(), and IterateROPIDs().

5087  { return ROP_id_iterator(this, ROP_id_iterator::begin_pos); }
static constexpr BeginPos_t begin_pos
Definition: GeometryCore.h:119
details::ROP_id_iterator_base< readout::ROPID > ROP_id_iterator
Forward iterator browsing all readout planes in the detector.
ROP_id_iterator geo::GeometryCore::begin_ROP_id ( geo::CryostatID const &  ID) const
inline

Returns an iterator pointing to the first readout plane ID in the specified cryostat.

Definition at line 5095 of file GeometryCore.h.

5096  { return ROP_id_iterator(this, GetBeginROPID(ID)); }
details::ROP_id_iterator_base< readout::ROPID > ROP_id_iterator
Forward iterator browsing all readout planes in the detector.
readout::ROPID GetBeginROPID(geo::CryostatID const &id) const
Returns the ID of the first readout plane of the specified cryostat.
ROP_id_iterator geo::GeometryCore::begin_ROP_id ( readout::TPCsetID const &  ID) const
inline

Returns an iterator pointing to the first readout plane ID in the specified TPC set.

Definition at line 5105 of file GeometryCore.h.

5106  { return ROP_id_iterator(this, GetBeginROPID(ID)); }
details::ROP_id_iterator_base< readout::ROPID > ROP_id_iterator
Forward iterator browsing all readout planes in the detector.
readout::ROPID GetBeginROPID(geo::CryostatID const &id) const
Returns the ID of the first readout plane of the specified cryostat.
TPC_iterator geo::GeometryCore::begin_TPC ( ) const
inline

Returns an iterator pointing to the first TPC in the detector.

Definition at line 2534 of file GeometryCore.h.

References geo::details::geometry_iterator_types::begin_pos.

Referenced by lar::example::SpacePointIsolationAlg::fillAlgConfigFromGeometry(), IterateTPCIDs(), IterateTPCs(), and sim::MCRecoPart::MCRecoPart().

2535  { return TPC_iterator(this, TPC_iterator::begin_pos); }
geo::TPC_iterator TPC_iterator
Forward-iterator browsing all TPCs in the detector.
static constexpr BeginPos_t begin_pos
Definition: GeometryCore.h:119
TPC_iterator geo::GeometryCore::begin_TPC ( geo::CryostatID const &  cid) const
inline

Returns an iterator pointing to the first TPC in the detector.

Definition at line 2542 of file GeometryCore.h.

2543  { return TPC_iterator(this, GetBeginTPCID(cid)); }
geo::TPC_iterator TPC_iterator
Forward-iterator browsing all TPCs in the detector.
geo::TPCID GetBeginTPCID(geo::CryostatID const &id) const
Returns the ID of the first TPC in the specified cryostat.
TPC_id_iterator geo::GeometryCore::begin_TPC_id ( ) const
inline

Returns an iterator pointing to the first TPC ID in the detector.

Definition at line 2516 of file GeometryCore.h.

References geo::details::geometry_iterator_types::begin_pos.

Referenced by pma::PMAlgTracker::build(), end_TPC(), IterateTPCIDs(), and tss::TrackShowerHits::produce().

2517  { return TPC_id_iterator(this, TPC_id_iterator::begin_pos); }
static constexpr BeginPos_t begin_pos
Definition: GeometryCore.h:119
geo::TPC_id_iterator TPC_id_iterator
Forward-iterator browsing all TPC IDs in the detector.
TPC_id_iterator geo::GeometryCore::begin_TPC_id ( geo::CryostatID const &  cid) const
inline

Returns an iterator pointing to the first TPC ID in the specified cryostat.

Definition at line 2525 of file GeometryCore.h.

2526  { return TPC_id_iterator(this, GetBeginTPCID(cid)); }
geo::TPC_id_iterator TPC_id_iterator
Forward-iterator browsing all TPC IDs in the detector.
geo::TPCID GetBeginTPCID(geo::CryostatID const &id) const
Returns the ID of the first TPC in the specified cryostat.
TPCset_id_iterator geo::GeometryCore::begin_TPCset_id ( ) const
inline

Returns an iterator pointing to the first TPC set ID in the detector.

Definition at line 4849 of file GeometryCore.h.

References geo::details::geometry_iterator_types::begin_pos.

Referenced by end_TPCset_id(), and IterateTPCsetIDs().

static constexpr BeginPos_t begin_pos
Definition: GeometryCore.h:119
details::TPCset_id_iterator_base< readout::TPCsetID > TPCset_id_iterator
Forward iterator browsing all TPC sets in the detector.
TPCset_id_iterator geo::GeometryCore::begin_TPCset_id ( geo::CryostatID const &  cid) const
inline

Returns an iterator pointing to the first TPC set ID in the specified cryostat.

Definition at line 4858 of file GeometryCore.h.

4859  { return TPCset_id_iterator(this, GetBeginTPCsetID(cid)); }
readout::TPCsetID GetBeginTPCsetID(geo::CryostatID const &id) const
Returns the ID of the first TPC set in the specified cryostat.
details::TPCset_id_iterator_base< readout::TPCsetID > TPCset_id_iterator
Forward iterator browsing all TPC sets in the detector.
wire_iterator geo::GeometryCore::begin_wire ( ) const
inline

Returns an iterator pointing to the first wire in the detector.

Definition at line 3455 of file GeometryCore.h.

References geo::details::geometry_iterator_types::begin_pos.

Referenced by IterateWireIDs(), and IterateWires().

3456  { return wire_iterator(this, wire_iterator::begin_pos); }
static constexpr BeginPos_t begin_pos
Definition: GeometryCore.h:119
geo::wire_iterator wire_iterator
Forward-iterator browsing all wires in the detector.
wire_iterator geo::GeometryCore::begin_wire ( geo::CryostatID const &  id) const
inline

Returns an iterator pointing to the first wire in specified cryostat.

Definition at line 3463 of file GeometryCore.h.

3464  { return wire_iterator(begin_wire_id(id)); }
wire_id_iterator begin_wire_id() const
Returns an iterator pointing to the first wire ID in the detector.
geo::wire_iterator wire_iterator
Forward-iterator browsing all wires in the detector.
wire_iterator geo::GeometryCore::begin_wire ( geo::TPCID const &  id) const
inline

Returns an iterator pointing to the first wire in specified TPC.

Definition at line 3471 of file GeometryCore.h.

3472  { return wire_iterator(begin_wire_id(id)); }
wire_id_iterator begin_wire_id() const
Returns an iterator pointing to the first wire ID in the detector.
geo::wire_iterator wire_iterator
Forward-iterator browsing all wires in the detector.
wire_iterator geo::GeometryCore::begin_wire ( geo::PlaneID const &  id) const
inline

Returns an iterator pointing to the first wire in specified plane.

Definition at line 3479 of file GeometryCore.h.

3480  { return wire_iterator(begin_wire_id(id)); }
wire_id_iterator begin_wire_id() const
Returns an iterator pointing to the first wire ID in the detector.
geo::wire_iterator wire_iterator
Forward-iterator browsing all wires in the detector.
wire_id_iterator geo::GeometryCore::begin_wire_id ( ) const
inline

Returns an iterator pointing to the first wire ID in the detector.

Definition at line 3422 of file GeometryCore.h.

References geo::details::geometry_iterator_types::begin_pos.

Referenced by end_wire(), IterateWireIDs(), lariov::SIOVElectronicsCalibProvider::Reconfigure(), and lariov::DetPedestalRetrievalAlg::Reconfigure().

static constexpr BeginPos_t begin_pos
Definition: GeometryCore.h:119
geo::wire_id_iterator wire_id_iterator
Forward-iterator browsing all wire IDs in the detector.
wire_id_iterator geo::GeometryCore::begin_wire_id ( geo::CryostatID const &  id) const
inline

Returns an iterator pointing to the first wire ID in specified cryostat.

Definition at line 3430 of file GeometryCore.h.

3431  { return wire_id_iterator(this, GetBeginWireID(id)); }
geo::WireID GetBeginWireID(geo::CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
geo::wire_id_iterator wire_id_iterator
Forward-iterator browsing all wire IDs in the detector.
wire_id_iterator geo::GeometryCore::begin_wire_id ( geo::TPCID const &  id) const
inline

Returns an iterator pointing to the first wire ID in specified TPC.

Definition at line 3439 of file GeometryCore.h.

3440  { return wire_id_iterator(this, GetBeginWireID(id)); }
geo::WireID GetBeginWireID(geo::CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
geo::wire_id_iterator wire_id_iterator
Forward-iterator browsing all wire IDs in the detector.
wire_id_iterator geo::GeometryCore::begin_wire_id ( geo::PlaneID const &  id) const
inline

Returns an iterator pointing to the first wire ID in specified plane.

Definition at line 3447 of file GeometryCore.h.

3448  { return wire_id_iterator(this, GetBeginWireID(id)); }
geo::WireID GetBeginWireID(geo::CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
geo::wire_id_iterator wire_id_iterator
Forward-iterator browsing all wire IDs in the detector.
geo::ChannelMapAlg const* geo::GeometryCore::ChannelMap ( ) const
inlineprotected

Returns the object handling the channel map.

Definition at line 5335 of file GeometryCore.h.

Referenced by geo::Geometry::InitializeChannelMap().

5336  { return fChannelMapAlg.get(); }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
bool geo::GeometryCore::ChannelsIntersect ( raw::ChannelID_t  c1,
raw::ChannelID_t  c2,
double &  y,
double &  z 
) const

Returns an intersection point of two channels.

Parameters
c1one channel ID
c2the other channel ID
y(output) y coordinate of the intersection
z(output) z coordinate of the intersection
Returns
whether a intersection point was found
Todo:

what happens for channels from different TPCs?

what happens for channels with multiple intersection points?

Deprecated:
This is clearly not APA-aware

Definition at line 1335 of file GeometryCore.cxx.

References ChannelToWire(), WireIDsIntersect(), geo::WireIDIntersection::y, and geo::WireIDIntersection::z.

Referenced by vertex::FeatureVertexFinder::Find3dVtxFrom2dClusterVtxCand(), evd::TWQMultiTPCProjectionView::FindEndPoint(), evd::TWQMultiTPCProjectionView::FindLineLength(), cmtool::CFAlgoStartTimeCompat::Float(), vertex::FeatureVertexFinder::Get3dVertexCandidates(), util::GeometryUtilities::GetProjectedPoint(), util::GeometryUtilities::GetYZ(), vertex::VertexFinder2D::produce(), and shwf::ShowerReco::produce().

1339  {
1340 
1341  // [GP] these errors should be exceptions, and this function is deprecated
1342  // because it violates interoperability
1343  std::vector<geo::WireID> chan1wires = ChannelToWire(c1);
1344  if (chan1wires.empty()) {
1345  mf::LogError("ChannelsIntersect")
1346  << "1st channel " << c1 << " maps to no wire (is it a real one?)";
1347  return false;
1348  }
1349  std::vector<geo::WireID> chan2wires = ChannelToWire(c2);
1350  if (chan2wires.empty()) {
1351  mf::LogError("ChannelsIntersect")
1352  << "2nd channel " << c2 << " maps to no wire (is it a real one?)";
1353  return false;
1354  }
1355 
1356  if (chan1wires.size() > 1) {
1357  mf::LogWarning("ChannelsIntersect")
1358  << "1st channel " << c1 << " maps to " << chan2wires.size()
1359  << " wires; using the first!";
1360  return false;
1361  }
1362  if (chan2wires.size() > 1) {
1363  mf::LogError("ChannelsIntersect")
1364  << "2nd channel " << c2 << " maps to " << chan2wires.size()
1365  << " wires; using the first!";
1366  return false;
1367  }
1368 
1369  geo::WireIDIntersection widIntersect;
1370  if (this->WireIDsIntersect(chan1wires[0],chan2wires[0],widIntersect)){
1371  y = widIntersect.y;
1372  z = widIntersect.z;
1373  return true;
1374  }
1375  else{
1376  y = widIntersect.y;
1377  z = widIntersect.z;
1378  return false;
1379  }
1380  }
double z
z position of intersection
Definition: geo_types.h:494
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
TCanvas * c1
Definition: plotHisto.C:7
TCanvas * c2
Definition: plot_hist.C:75
bool WireIDsIntersect(WireID const &wid1, WireID const &wid2, geo::Point_t &intersection) const
Computes the intersection between two wires.
double y
y position of intersection
Definition: geo_types.h:493
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
const AuxDetGeo & geo::GeometryCore::ChannelToAuxDet ( std::string const &  auxDetName,
uint32_t const &  channel 
) const

Returns the number of auxiliary detectors.

Todo:
use a AutDetID_t instead of unsigned int?

This method returns the total number of scintillator paddles (Auxiliary Detectors aka AuxDet) outside of the cryostat

Todo:
Change return type to size_t

Definition at line 514 of file GeometryCore.cxx.

References AuxDet(), AuxDets(), and fChannelMapAlg.

516  {
517  size_t adIdx = fChannelMapAlg->ChannelToAuxDet(AuxDets(), auxDetName, channel);
518  return this->AuxDet(adIdx);
519  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
const AuxDetSensitiveGeo & geo::GeometryCore::ChannelToAuxDetSensitive ( std::string const &  auxDetName,
uint32_t const &  channel 
) const

Returns the number of auxiliary detectors.

Todo:
use a AutDetID_t instead of unsigned int?

This method returns the total number of scintillator paddles (Auxiliary Detectors aka AuxDet) outside of the cryostat

Todo:
Change return type to size_t

Definition at line 522 of file GeometryCore.cxx.

References AuxDet(), AuxDets(), fChannelMapAlg, and geo::AuxDetGeo::SensitiveVolume().

524  {
525  auto idx = fChannelMapAlg->ChannelToSensitiveAuxDet(AuxDets(), auxDetName, channel);
526  return this->AuxDet(idx.first).SensitiveVolume(idx.second);
527  }
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
Definition: AuxDetGeo.h:159
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
readout::ROPID geo::GeometryCore::ChannelToROP ( raw::ChannelID_t  channel) const

Returns the ID of the ROP the channel belongs to

Exceptions
cet::exception(category: "Geometry") if non-existent channel

Definition at line 1174 of file GeometryCore.cxx.

References fChannelMapAlg, and WireCoordinate().

Referenced by reco3d::TripletFinder::FillBadMap(), reco3d::TripletFinder::FillHitMap(), and View().

1175  {
1176  return fChannelMapAlg->ChannelToROP(channel);
1177  } // GeometryCore::ChannelToROP()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
std::vector< geo::WireID > geo::GeometryCore::ChannelToWire ( raw::ChannelID_t const  channel) const

Returns a list of wires connected to the specified TPC channel.

Parameters
channelTPC channel ID
Returns
vector containing the ID of all the connected wires
Exceptions
cet::exception(category: "Geometry") if non-existent channel

Definition at line 1168 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by hit::MCHitAnaExample::analyze(), MCBTDemo::analyze(), detsim::WienerFilterAna::analyze(), apa::APAGeometryAlg::APAChannelsIntersect(), lar_cluster3d::StandardHit3DBuilder::BuildChannelStatusVec(), ChannelsIntersect(), apa::APAGeometryAlg::ChanSegsPerSide(), apa::DisambigAlg::CompareViews(), lar_cluster3d::MinSpanTreeAlg::configure(), reco3d::TripletFinder::FillHitMap(), evd::RawDataDrawer::FillQHisto(), evd::RecoBaseDrawer::FillQHisto(), lar_pandora::PFParticleHitDumper::FillRecoWires(), evd::RecoBaseDrawer::FillTQHisto(), evd::RecoBaseDrawer::FillTQHistoDP(), reco_tool::CandHitStandard::findHitCandidates(), reco_tool::CandHitDerivative::findHitCandidates(), reco_tool::CandHitMorphological::findHitCandidates(), hit::HitCheater::FindHitsOnChannel(), cluster::SmallClusterFinderAlg::GetPlaneAndTPC(), corner::CornerFinderAlg::GrabWires(), apa::APAGeometryAlg::Init(), hit::DisambigCheater::InitHitToWids(), reco3d::IntersectionCache::ISect(), apa::APAGeometryAlg::LineSegChanIntersect(), apa::DisambigAlg::MakeCloseHits(), sim::MCRecoEdep::MakeMCEdep(), apa::APAGeometryAlg::NearestWireIDOnChan(), btutil::MCBTAlg::ProcessSimChannel(), hit::TTHitFinder::produce(), hit::FFTHitFinder::produce(), hit::RawHitFinder::produce(), hit::GausHitFinder::produce(), hit::DPRawHitFinder::produce(), hit::RFFHitFinderAlg::Run(), hit::CCHitFinderAlg::RunCCHitFinder(), evd::RawDataDrawer::RunOperation(), img::DataProviderAlg::setWireDriftData(), apa::APAGeometryAlg::ThreeChanPos(), apa::DisambigAlg::TrivialDisambig(), and evd::RecoBaseDrawer::Wire2D().

1169  {
1170  return fChannelMapAlg->ChannelToWire(channel);
1171  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
void geo::GeometryCore::CheckIndependentPlanesOnSameTPC ( geo::PlaneID const &  pid1,
geo::PlaneID const &  pid2,
const char *  caller 
)
staticprivate

Throws an exception ("GeometryCore" category) unless pid1 and pid2 are on different planes of the same TPC (ID validity is not checked)

Definition at line 1606 of file GeometryCore.cxx.

References geo::TPCID::asTPCID().

Referenced by ThirdPlane(), ThirdPlane_dTdW(), and ThirdPlaneSlope().

1607  {
1608  if(pid1.asTPCID() != pid2.asTPCID()) {
1609  throw cet::exception("GeometryCore")
1610  << caller << " needs two planes on the same TPC (got "
1611  << std::string(pid1) << " and " << std::string(pid2) << ")\n";
1612  }
1613  if(pid1 == pid2) { // was: return 999;
1614  throw cet::exception("GeometryCore")
1615  << caller << " needs two different planes, got "
1616  << std::string(pid1) << " twice\n";
1617  }
1618  } // GeometryCore::CheckIndependentPlanesOnSameTPC()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void geo::GeometryCore::ClearGeometry ( )
private

Deletes the detector geometry structures.

Definition at line 133 of file GeometryCore.cxx.

References AuxDets(), evd::details::begin(), Cryostats(), and evd::details::end().

Referenced by LoadGeometryFile(), and ~GeometryCore().

133  {
134 
135  Cryostats().clear();
136 
137  // auxiliary detectors
138  std::for_each(AuxDets().begin(), AuxDets().end(),
139  std::default_delete<AuxDetGeo>());
140  AuxDets().clear();
141 
142  } // GeometryCore::ClearGeometry()
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
CryostatList_t & Cryostats()
Return the internal cryostat list.
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
double geo::GeometryCore::ComputeThirdPlane_dTdW ( double  angle1,
double  pitch1,
double  dTdW1,
double  angle2,
double  pitch2,
double  dTdW2,
double  angle_target,
double  pitch_target 
)
static

Returns the slope on the third plane, given it in the other two.

Parameters
angle1angle or the wires on the first plane
pitch1wire pitch on the first plane
dTdW1slope in dt/dw units as observed on the first plane
angle2angle or the wires on the second plane
pitch2wire pitch on the second plane
dTdW2slope in dt/dw units as observed on the second plane
angle_targetangle or the wires on the target plane
pitch_targetwire pitch on the target plane
Returns
dt/dw slope as measured on the third plane, or 999 if infinity

The input slope must be specified in dt/dw non-homogeneous coordinates.

This function will return a small slope if both input slopes are small.

Definition at line 1724 of file GeometryCore.cxx.

References ComputeThirdPlaneSlope().

Referenced by ThirdPlane_dTdW().

1729  {
1730  // we need to convert dt/dw into homogeneous coordinates, and then back;
1731  // slope = [dT * (TDCperiod / driftVelocity)] / [dW * wirePitch]
1732  // The coefficient of dT is assumed to be the same for all the planes,
1733  // and it finally cancels out. Pitches cancel out only if they are all
1734  // the same.
1735  return pitch_target * ComputeThirdPlaneSlope
1736  (angle1, dTdW1 / pitch1, angle2, dTdW2 / pitch2, angle_target);
1737  } // GeometryCore::ComputeThirdPlane_dTdW()
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.
double geo::GeometryCore::ComputeThirdPlaneSlope ( double  angle1,
double  slope1,
double  angle2,
double  slope2,
double  angle_target 
)
static

Returns the slope on the third plane, given it in the other two.

Parameters
angle1angle or the wires on the first plane
slope1slope as observed on the first plane
angle2angle or the wires on the second plane
slope2slope as observed on the second plane
angle_targetangle or the wires on the target plane
Returns
the slope as measure on the third plane, or 999 if infinity

This function will return a small slope if both input slopes are small.

Definition at line 1699 of file GeometryCore.cxx.

Referenced by ComputeThirdPlane_dTdW(), ThirdPlane_dTdW(), and ThirdPlaneSlope().

1700  {
1701  // note that, if needed, the trigonometric functions can be pre-calculated.
1702 
1703  // Can't resolve very small slopes
1704  if ((std::abs(slope1) < 0.001) && (std::abs(slope2)) < 0.001) return 0.001;
1705 
1706  // We need the "wire coordinate direction" for each plane.
1707  // This is perpendicular to the wire orientation.
1708  double slope3 = 0.001;
1709  if (std::abs(slope1) > 0.001 && std::abs(slope2) > 0.001) {
1710  slope3
1711  = (
1712  + (1./slope1)*std::sin(angle3-angle2)
1713  - (1./slope2)*std::sin(angle3-angle1)
1714  ) / std::sin(angle1-angle2)
1715  ;
1716  }
1717  if (slope3 != 0.) slope3 = 1./slope3;
1718  else slope3 = 999.;
1719 
1720  return slope3;
1721  } // GeometryCore::ComputeThirdPlaneSlope()
CryostatGeo const & geo::GeometryCore::Cryostat ( geo::CryostatID const &  cryoid) const

Returns the specified cryostat.

Parameters
cstatnumber of cryostat
cryoidcryostat ID
Returns
a constant reference to the specified cryostat
Exceptions
cet::exception(GeometryCore category) if cryostat not present

The GetElement() method is overloaded and its return depends on the type of ID.

Todo:
Make the cryostat number mandatory (as CryostatID)

Definition at line 280 of file GeometryCore.cxx.

References geo::CryostatID::Cryostat, and CryostatPtr().

Referenced by trkf::SpacePointAna::bookHistograms(), pma::ProjectionMatchingAlg::buildShowerSeg(), lar_pandora::LArPandoraOutput::CalculateT0(), util::DetectorPropertiesServiceArgoNeuT::CalculateXTicksParams(), detinfo::DetectorPropertiesStandard::CalculateXTicksParams(), larg4::LArVoxelReadoutGeometry::Construct(), ems::MultiEMShowers::convCluster(), lar_pandora::LArPandoraInput::CreatePandoraHits2D(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), CryostatBoundaries(), CryostatHalfHeight(), CryostatHalfWidth(), CryostatLength(), hit::DisambigCheater::DisambigCheater(), evd::RecoBaseDrawer::DrawTrack2D(), cluster::EndPointAlg::EndPoint(), cluster::HoughBaseAlg::FastTransform(), trkf::SpacePointAlg::fillComplexSpacePoint(), cosmic::BeamFlashTrackMatchTaggerAlg::FillFlashProperties(), opdet::FlashHypothesisAnaAlg::FillOpDetPositions(), vertex::FeatureVertexFinder::Find2dClusterVertexCandidates(), vertex::FeatureVertexFinder::Find3dVtxFrom2dClusterVtxCand(), vertex::FeatureVertexFinder::Get3dVertexCandidates(), corner::CornerFinderAlg::get_feature_points_fast(), GetCryostatVolumeName(), trkf::BezierTrack::GetProjectedPointUVWT(), trkf::BezierTrack::GetProjectedPointUVWX(), trkf::BezierTrack::GetTrackPitch(), lar_pandora::LArPandoraInput::GetTrueX0(), lar_pandora::PFParticleHitDumper::GetUVW(), cluster::fuzzyClusterAlg::InitFuzzy(), ems::EMShower3D::LinkCandidates(), trkf::SpacePointAlg::makeSpacePoints(), NOpDets(), OpDetFromCryo(), OpDetGeoFromOpDet(), OpDetGeoName(), PositionToCryostat(), cluster::ClusterCheater::produce(), vertex::HarrisVertexFinder::produce(), vertex::FeatureVertexFinder::produce(), larg4::LArG4::produce(), evd::SimulationDrawer::SimulationDrawer(), apa::APAGeometryAlg::ThreeChanPos(), cluster::HoughBaseAlg::Transform(), apa::DisambigAlg::TrivialDisambig(), DUNE::NeutrinoTrackingEff::truthLength(), trkf::SpacePointAlg::update(), apa::DisambigAlg::UseEndPts(), and trkf::VertexFitAlg::VertexFit().

280  {
281  CryostatGeo const* pCryo = CryostatPtr(cryoid);
282  if(!pCryo) {
283  throw cet::exception("GeometryCore") << "Cryostat #"
284  << cryoid.Cryostat
285  << " does not exist\n";
286  }
287  return *pCryo;
288  } // GeometryCore::Cryostat(CryostatID)
CryostatGeo const * CryostatPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
CryostatGeo const& geo::GeometryCore::Cryostat ( unsigned int const  cstat = 0) const
inline

Returns the specified cryostat.

Parameters
cstatnumber of cryostat
cryoidcryostat ID
Returns
a constant reference to the specified cryostat
Exceptions
cet::exception(GeometryCore category) if cryostat not present

The GetElement() method is overloaded and its return depends on the type of ID.

Todo:
Make the cryostat number mandatory (as CryostatID)

Definition at line 2001 of file GeometryCore.h.

2002  { return Cryostat(geo::CryostatID(cstat)); }
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:120
void geo::GeometryCore::CryostatBoundaries ( double *  boundaries,
geo::CryostatID const &  cid 
) const

Returns the boundaries of the specified cryostat.

Parameters
boundaries(output) pointer to an area of 6 doubles for boundaries
cidcryostat ID
Exceptions
cet::exception("GeometryCore" category) if cryostat not present
See also
CryostatGeo::Boundaries()

The boundaries array is filled with: [0] lower x coordinate [1] upper x coordinate [2] lower y coordinate [3] upper y coordinate [4] lower z coordinate [5] upper z coordinate

Deprecated:
Use CryostatGeo::Boundaries() (from Cryostat(cid)).
Todo:
What happen on invalid cryostat?

Definition at line 750 of file GeometryCore.cxx.

References geo::CryostatGeo::Boundaries(), and Cryostat().

Referenced by evgen::GaisserParam::beginJob(), ems::MergeEMShower3D::collectshowers(), CryostatLength(), evgen::CORSIKAGen::populateNShowers(), evgen::CosmicsGen::produce(), evgen::CORSIKAGen::produce(), and phot::PhotonVisibilityService::reconfigure().

751  {
752  geo::CryostatGeo const& cryo = Cryostat(cid);
753  cryo.Boundaries(boundaries);
754  } // GeometryCore::CryostatBoundaries()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
geo::BoxBoundedGeo const & Boundaries() const
Returns boundaries of the cryostat (in centimetres).
Definition: CryostatGeo.h:99
void geo::GeometryCore::CryostatBoundaries ( double *  boundaries,
unsigned int  cstat = 0 
) const
inline

Returns the boundaries of the specified cryostat.

Parameters
boundaries(output) pointer to an area of 6 doubles for boundaries
cstatnumber of cryostat
Exceptions
cet::exception("GeometryCore" category) if cryostat not present
See also
CryostatGeo::Boundaries()

The boundaries array is filled with: [0] lower x coordinate [1] upper x coordinate [2] lower y coordinate [3] upper y coordinate [4] lower z coordinate [5] upper z coordinate

Deprecated:
Use CryostatBoundaries(double*, geo::CryostatID const&) or (recommended) CryostatGeo::Boundaries() from Cryostat(cid) instead

Definition at line 2230 of file GeometryCore.h.

2231  { CryostatBoundaries(boundaries, geo::CryostatID(cstat)); }
void CryostatBoundaries(double *boundaries, geo::CryostatID const &cid) const
Returns the boundaries of the specified cryostat.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:120
geo::Length_t geo::GeometryCore::CryostatHalfHeight ( geo::CryostatID const &  cid) const

Returns the height of the cryostat (y direction)

Definition at line 737 of file GeometryCore.cxx.

References Cryostat(), and geo::CryostatGeo::HalfHeight().

Referenced by CryostatHalfWidth(), simfilter::FilterNoDirtNeutrinos::filter(), and evgen::FileMuons::ReadEvents().

738  {
739  return Cryostat(cid).HalfHeight();
740  }
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
double HalfHeight() const
Half height of the cryostat [cm].
geo::Length_t geo::GeometryCore::CryostatHalfHeight ( unsigned int  cstat = 0) const
inline

Returns the height of the cryostat (y direction)

Definition at line 2184 of file GeometryCore.h.

2185  { return CryostatHalfHeight(geo::CryostatID(cstat)); }
geo::Length_t CryostatHalfHeight(geo::CryostatID const &cid) const
Returns the height of the cryostat (y direction)
The data type to uniquely identify a cryostat.
Definition: geo_types.h:120
geo::Length_t geo::GeometryCore::CryostatHalfWidth ( geo::CryostatID const &  cid) const

Returns the half width of the cryostat (x direction)

Definition at line 730 of file GeometryCore.cxx.

References Cryostat(), CryostatHalfHeight(), and geo::CryostatGeo::HalfWidth().

Referenced by DetLength(), simfilter::FilterNoDirtNeutrinos::filter(), and evgen::FileMuons::ReadEvents().

731  {
732  return Cryostat(cid).HalfWidth();
733  }
double HalfWidth() const
Half width of the cryostat [cm].
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
geo::Length_t geo::GeometryCore::CryostatHalfWidth ( unsigned int  cstat = 0) const
inline

Returns the half width of the cryostat (x direction)

Definition at line 2177 of file GeometryCore.h.

2178  { return CryostatHalfWidth(geo::CryostatID(cstat)); }
geo::Length_t CryostatHalfWidth(geo::CryostatID const &cid) const
Returns the half width of the cryostat (x direction)
The data type to uniquely identify a cryostat.
Definition: geo_types.h:120
geo::Length_t geo::GeometryCore::CryostatLength ( geo::CryostatID const &  cid) const

Returns the length of the cryostat (z direction)

Definition at line 743 of file GeometryCore.cxx.

References Cryostat(), CryostatBoundaries(), and geo::CryostatGeo::Length().

Referenced by evgen::FileMuons::ReadEvents().

744  {
745  return Cryostat(cid).Length();
746  }
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
double Length() const
Length of the cryostat [cm].
Definition: CryostatGeo.h:91
geo::Length_t geo::GeometryCore::CryostatLength ( unsigned int  cstat = 0) const
inline

Returns the length of the cryostat (z direction)

Definition at line 2191 of file GeometryCore.h.

2192  { return CryostatLength(geo::CryostatID(cstat)); }
geo::Length_t CryostatLength(geo::CryostatID const &cid) const
Returns the length of the cryostat (z direction)
The data type to uniquely identify a cryostat.
Definition: geo_types.h:120
CryostatGeo const* geo::GeometryCore::CryostatPtr ( geo::CryostatID const &  cryoid) const
inline

Returns the specified cryostat.

Parameters
cryoidcryostat ID
Returns
a constant pointer to the specified cryostat, or nullptr if none

The GetElementPtr() method is overloaded and its return depends on the type of ID.

Definition at line 2016 of file GeometryCore.h.

References geo::CryostatID::Cryostat.

Referenced by Cryostat().

2017  { return HasCryostat(cryoid)? &(Cryostats()[cryoid.Cryostat]): nullptr; }
CryostatList_t & Cryostats()
Return the internal cryostat list.
bool HasCryostat(geo::CryostatID const &cryoid) const
Returns whether we have the specified cryostat.
CryostatList_t& geo::GeometryCore::Cryostats ( )
inlineprotected

Return the internal cryostat list.

Definition at line 5340 of file GeometryCore.h.

Referenced by ClearGeometry(), MakeCryostat(), MaxPlanes(), MaxTPCs(), MaxWires(), SortGeometry(), TotalNTPC(), and UpdateAfterSorting().

5340 { return fGeoData.cryostats; }
GeometryData_t fGeoData
The detector description data.
CryostatList_t cryostats
The detector cryostats.
CryostatList_t const& geo::GeometryCore::Cryostats ( ) const
inlineprotected

Return the internal cryostat list.

Definition at line 5341 of file GeometryCore.h.

5341 { return fGeoData.cryostats; }
GeometryData_t fGeoData
The detector description data.
CryostatList_t cryostats
The detector cryostats.
double geo::GeometryCore::DefaultWiggle ( ) const
inline

Returns the tolerance used in looking for positions.

Returns
the tolerance value

This parameter is used as tolerance ("wiggle") for methods that require it (e.g. geo::CryostatGeo::FindTPCAtPosition()). Typically, it's a additional fraction of tolerance: 0 means no tolerance, 0.1 means 10% tolerance.

Todo:
Confirm the definition of wiggle: this one is taken from other doc

Definition at line 1705 of file GeometryCore.h.

1705 { return fPositionWiggle; }
double fPositionWiggle
accounting for rounding errors when testing positions
geo::BoxBoundedGeo geo::GeometryCore::DetectorEnclosureBox ( std::string const &  name = "volDetEnclosure") const

Returns the absolute coordinates of the detector enclosure volume [cm].

Parameters
namename of the volume to be sought (default: volDetEnclosure)
Exceptions
cet::exceptionif the specified volume is not found

Definition at line 588 of file GeometryCore.cxx.

References FindDetectorEnclosure(), and geo::LocalTransformation< StoredMatrix >::LocalToWorld().

Referenced by GetWorldVolumeName().

589  {
590  auto const& path = FindDetectorEnclosure(name);
591  if (path.empty()) {
592  throw cet::exception("GeometryCore")
593  << "DetectorEnclosureBox(): can't find enclosure volume '" << name << "'\n";
594  }
595 
596  TGeoVolume const* pEncl = path.back()->GetVolume();
597  auto const* pBox = dynamic_cast<TGeoBBox const*>(pEncl->GetShape());
598 
599  // check that this is indeed a box
600  if (!pBox) {
601  // at initialisation time we don't know yet our real ID
602  throw cet::exception("GeometryCore") << "Detector enclosure '"
603  << name << "' is not a box! (it is a " << pEncl->GetShape()->IsA()->GetName()
604  << ")\n";
605  }
606 
607  geo::LocalTransformation<TGeoHMatrix> trans(path, path.size() - 1);
608  // get the half width, height, etc of the cryostat
609  const double halfwidth = pBox->GetDX();
610  const double halfheight = pBox->GetDY();
611  const double halflength = pBox->GetDZ();
612 
613  return {
614  trans.LocalToWorld(geo::Point_t{ -halfwidth, -halfheight, -halflength }),
615  trans.LocalToWorld(geo::Point_t{ +halfwidth, +halfheight, +halflength })
616  };
617  } // geo::GeometryCore::DetectorEnclosureBox()
std::vector< TGeoNode const * > FindDetectorEnclosure(std::string const &name="volDetEnclosure") const
void LocalToWorld(double const *local, double *world) const
Transforms a point from local frame to world frame.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:187
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::Length_t geo::GeometryCore::DetHalfHeight ( geo::TPCID const &  tpcid) const

Returns the half height of the active volume of the specified TPC.

Parameters
tpcidID of the TPC
tpcTPC number within the cryostat
cstatnumber of cryostat
Returns
the value of the half height of the specified TPC
Exceptions
cet::exception(GeometryCore category) if cryostat not present
cet::exception(TPCOutOfRange category) if no such TPC
See also
geo::TPCGeo::ActiveHalfHeight()

See geo::TPCGeo::ActiveHalfHeight() for more details.

Todo:

deprecate this function

rename the function

Definition at line 717 of file GeometryCore.cxx.

References geo::TPCGeo::ActiveHalfHeight(), and TPC().

Referenced by lar::example::AnalysisExample::analyze(), evgen::NUANCEGen::beginJob(), evgen::NDKGen::beginJob(), evgen::GENIEGen::beginJob(), trkf::SpacePointAna::bookHistograms(), LArStackingAction::ClassifyNewTrack(), evd_tool::MicroBooNEDrawer::DetOutline3D(), evd::Display3DPad::Draw(), lar_pandora::PFParticleCosmicAna::FillRecoTree(), tca::FillWireHitRange(), simfilter::FilterStoppingMuon::filter(), simfilter::FilterNoDirtNeutrinos::filter(), cmtool::CFAlgoVolumeOverlap::Float(), cmtool::CFAlgoWireOverlap::Float(), util::GeometryUtilities::Get2DangleFrom3D(), trk::TrackContainmentAlg::GetCosmicTagID(), ToyOneShowerGen::GetXYZPosition(), cosmic::BeamFlashTrackMatchTaggerAlg::InDetector(), tca::InsideTPC(), trk::TrackContainmentAlg::IsContained(), trkf::SeedAna::MCHists::MCHists(), trkf::TrackAna::MCHists::MCHists(), evd::Ortho3DPad::Ortho3DPad(), trk::TrackContainmentAlg::ProcessTracks(), trkf::SpacePts::produce(), trkf::Track3Dreco::produce(), evgen::NDKGen::produce(), vertex::VertexFinder2D::produce(), trkf::Track3DKalmanSPS::produce(), trkf::SeedAna::RecoHists::RecoHists(), trkf::TrackAna::RecoHists::RecoHists(), and evd::TWQProjectionView::SetSeeds().

718  {
719  return TPC(tpcid).ActiveHalfHeight();
720  }
double ActiveHalfHeight() const
Half height (associated with y coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:91
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
geo::Length_t geo::GeometryCore::DetHalfHeight ( unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const
inline

Returns the half height of the active volume of the specified TPC.

Parameters
tpcidID of the TPC
tpcTPC number within the cryostat
cstatnumber of cryostat
Returns
the value of the half height of the specified TPC
Exceptions
cet::exception(GeometryCore category) if cryostat not present
cet::exception(TPCOutOfRange category) if no such TPC
See also
geo::TPCGeo::ActiveHalfHeight()

See geo::TPCGeo::ActiveHalfHeight() for more details.

Todo:

deprecate this function

rename the function

Definition at line 2708 of file GeometryCore.h.

2709  { return DetHalfHeight(geo::TPCID(cstat, tpc)); }
geo::Length_t DetHalfHeight(geo::TPCID const &tpcid) const
Returns the half height of the active volume of the specified TPC.
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
geo::Length_t geo::GeometryCore::DetHalfWidth ( geo::TPCID const &  tpcid) const

Returns the half width of the active volume of the specified TPC.

Parameters
tpcidID of the TPC
tpcTPC number within the cryostat
cstatnumber of cryostat
Returns
the value of the half width of the specified TPC
Exceptions
cet::exception(GeometryCore category) if cryostat not present
cet::exception(TPCOutOfRange category) if no such TPC
See also
geo::TPCGeo::ActiveHalfWidth()
Todo:

deprecate this function

rename the function

Definition at line 711 of file GeometryCore.cxx.

References geo::TPCGeo::ActiveHalfWidth(), and TPC().

Referenced by lar::example::AnalysisExample::analyze(), evgen::NUANCEGen::beginJob(), evgen::NDKGen::beginJob(), evgen::GENIEGen::beginJob(), trkf::SpacePointAna::bookHistograms(), LArStackingAction::ClassifyNewTrack(), evd_tool::MicroBooNEDrawer::DetOutline3D(), evd::Display3DPad::Draw(), lar_pandora::PFParticleCosmicAna::FillRecoTree(), tca::FillWireHitRange(), simfilter::FilterStoppingMuon::filter(), simfilter::FilterNoDirtNeutrinos::filter(), util::GeometryUtilities::Get2DangleFrom3D(), trk::TrackContainmentAlg::GetCosmicTagID(), ToyOneShowerGen::GetXYZPosition(), cosmic::BeamFlashTrackMatchTaggerAlg::InDetector(), cosmic::BeamFlashTrackMatchTaggerAlg::InDriftWindow(), tca::InsideTPC(), trk::TrackContainmentAlg::IsContained(), trkf::SeedAna::MCHists::MCHists(), trkf::TrackAna::MCHists::MCHists(), evd::RecoBaseDrawer::OpFlashOrtho(), evd::Ortho3DPad::Ortho3DPad(), trk::TrackContainmentAlg::ProcessTracks(), evgen::NUANCEGen::produce(), evgen::NDKGen::produce(), trkf::Track3DKalmanSPS::produce(), trkf::SeedAna::RecoHists::RecoHists(), trkf::TrackAna::RecoHists::RecoHists(), evd::TWQProjectionView::SetSeeds(), and evd::RecoBaseDrawer::Vertex2D().

712  {
713  return TPC(tpcid).ActiveHalfWidth();
714  }
double ActiveHalfWidth() const
Half width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:87
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
geo::Length_t geo::GeometryCore::DetHalfWidth ( unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const
inline

Returns the half width of the active volume of the specified TPC.

Parameters
tpcidID of the TPC
tpcTPC number within the cryostat
cstatnumber of cryostat
Returns
the value of the half width of the specified TPC
Exceptions
cet::exception(GeometryCore category) if cryostat not present
cet::exception(TPCOutOfRange category) if no such TPC
See also
geo::TPCGeo::ActiveHalfWidth()
Todo:

deprecate this function

rename the function

Definition at line 2686 of file GeometryCore.h.

2687  { return DetHalfWidth(geo::TPCID(cstat, tpc)); }
geo::Length_t DetHalfWidth(geo::TPCID const &tpcid) const
Returns the half width of the active volume of the specified TPC.
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
geo::Length_t geo::GeometryCore::DetLength ( geo::TPCID const &  tpcid) const

Returns the length of the active volume of the specified TPC.

Parameters
tpcidID of the TPC
tpcTPC number within the cryostat
cstatnumber of cryostat
Returns
the value of the length of the specified TPC
Exceptions
cet::exception(GeometryCore category) if cryostat not present
cet::exception(TPCOutOfRange category) if no such TPC
See also
geo::TPCGeo::ActiveLength()

See geo::TPCGeo::ActiveLength() for more details.

Todo:

deprecate this function

rename the function

Definition at line 723 of file GeometryCore.cxx.

References geo::TPCGeo::ActiveLength(), CryostatHalfWidth(), and TPC().

Referenced by lar::example::AnalysisExample::analyze(), evgen::NUANCEGen::beginJob(), evgen::NDKGen::beginJob(), evgen::GENIEGen::beginJob(), trkf::SpacePointAna::bookHistograms(), LArStackingAction::ClassifyNewTrack(), evd_tool::MicroBooNEDrawer::DetOutline3D(), evd::Display3DPad::Draw(), lar_pandora::PFParticleCosmicAna::FillRecoTree(), tca::FillWireHitRange(), simfilter::FilterNoDirtNeutrinos::filter(), simfilter::FilterStoppingMuon::filter(), cmtool::CFAlgoVolumeOverlap::Float(), cmtool::CFAlgoWireOverlap::Float(), util::GeometryUtilities::Get2DangleFrom3D(), trk::TrackContainmentAlg::GetCosmicTagID(), ToyOneShowerGen::GetXYZPosition(), cosmic::BeamFlashTrackMatchTaggerAlg::InDetector(), tca::InsideTPC(), trk::TrackContainmentAlg::IsContained(), trkf::SeedAna::MCHists::MCHists(), trkf::TrackAna::MCHists::MCHists(), lar_cluster3d::StandardHit3DBuilder::NearestWireID(), evd::Ortho3DPad::Ortho3DPad(), trk::TrackContainmentAlg::ProcessTracks(), evgen::CosmicsGen::produce(), evgen::NUANCEGen::produce(), evgen::NDKGen::produce(), trkf::Track3DKalmanSPS::produce(), trkf::SeedAna::RecoHists::RecoHists(), trkf::TrackAna::RecoHists::RecoHists(), evd::TWQProjectionView::SetSeeds(), and evd::RecoBaseDrawer::Vertex2D().

724  {
725  return TPC(tpcid).ActiveLength();
726  }
double ActiveLength() const
Length (associated with z coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:95
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
geo::Length_t geo::GeometryCore::DetLength ( unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const
inline

Returns the length of the active volume of the specified TPC.

Parameters
tpcidID of the TPC
tpcTPC number within the cryostat
cstatnumber of cryostat
Returns
the value of the length of the specified TPC
Exceptions
cet::exception(GeometryCore category) if cryostat not present
cet::exception(TPCOutOfRange category) if no such TPC
See also
geo::TPCGeo::ActiveLength()

See geo::TPCGeo::ActiveLength() for more details.

Todo:

deprecate this function

rename the function

Definition at line 2729 of file GeometryCore.h.

2730  { return DetLength(geo::TPCID(cstat, tpc)); }
geo::Length_t DetLength(geo::TPCID const &tpcid) const
Returns the length of the active volume of the specified TPC.
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
cryostat_iterator geo::GeometryCore::end_cryostat ( ) const
inline

Returns an iterator pointing after the last cryostat.

Definition at line 2128 of file GeometryCore.h.

References begin_cryostat_id(), end_cryostat_id(), and geo::details::geometry_iterator_types::end_pos.

Referenced by evd_tool::ICARUSDrawer::DetOutline3D(), and IterateCryostatIDs().

geo::cryostat_iterator cryostat_iterator
Forward-iterator browsing all cryostats in the detector.
static constexpr EndPos_t end_pos
Definition: GeometryCore.h:120
cryostat_id_iterator geo::GeometryCore::end_cryostat_id ( ) const
inline

Returns an iterator pointing after the last cryostat ID.

Definition at line 2120 of file GeometryCore.h.

References geo::details::geometry_iterator_types::end_pos.

Referenced by end_cryostat().

static constexpr EndPos_t end_pos
Definition: GeometryCore.h:120
geo::cryostat_id_iterator cryostat_id_iterator
Forward-iterator browsing all cryostat IDs in the detector.
plane_iterator geo::GeometryCore::end_plane ( ) const
inline

Returns an iterator pointing after the last plane in the detector.

Definition at line 3039 of file GeometryCore.h.

References geo::details::geometry_iterator_types::end_pos.

Referenced by IteratePlaneIDs(), and IteratePlanes().

3040  { return plane_iterator(this, plane_iterator::end_pos); }
static constexpr EndPos_t end_pos
Definition: GeometryCore.h:120
geo::plane_iterator plane_iterator
Forward-iterator browsing all planes in the detector.
plane_iterator geo::GeometryCore::end_plane ( geo::CryostatID const &  ID) const
inline

Returns an iterator pointing after the last plane in the specified cryostat.

Definition at line 3049 of file GeometryCore.h.

3050  { return plane_iterator(this, GetEndPlaneID(ID)); }
geo::plane_iterator plane_iterator
Forward-iterator browsing all planes in the detector.
geo::PlaneID GetEndPlaneID(geo::CryostatID const &id) const
plane_iterator geo::GeometryCore::end_plane ( geo::TPCID const &  ID) const
inline

Returns an iterator pointing after the last plane in the specified TPC.

Definition at line 3057 of file GeometryCore.h.

References begin_plane_id(), and end_plane_id().

3058  { return plane_iterator(this, GetEndPlaneID(ID)); }
geo::plane_iterator plane_iterator
Forward-iterator browsing all planes in the detector.
geo::PlaneID GetEndPlaneID(geo::CryostatID const &id) const
plane_id_iterator geo::GeometryCore::end_plane_id ( ) const
inline

Returns an iterator pointing after the last plane ID in the detector.

Definition at line 3011 of file GeometryCore.h.

References geo::details::geometry_iterator_types::end_pos.

Referenced by end_plane(), and IteratePlaneIDs().

static constexpr EndPos_t end_pos
Definition: GeometryCore.h:120
geo::plane_id_iterator plane_id_iterator
Forward-iterator browsing all plane IDs in the detector.
plane_id_iterator geo::GeometryCore::end_plane_id ( geo::CryostatID const &  ID) const
inline

Returns an iterator pointing after the last plane ID in the specified cryostat.

Definition at line 3021 of file GeometryCore.h.

3022  { return plane_id_iterator(this, GetEndPlaneID(ID)); }
geo::plane_id_iterator plane_id_iterator
Forward-iterator browsing all plane IDs in the detector.
geo::PlaneID GetEndPlaneID(geo::CryostatID const &id) const
plane_id_iterator geo::GeometryCore::end_plane_id ( geo::TPCID const &  ID) const
inline

Returns an iterator pointing after the last plane ID in the specified TPC.

Definition at line 3031 of file GeometryCore.h.

3032  { return plane_id_iterator(this, GetEndPlaneID(ID)); }
geo::plane_id_iterator plane_id_iterator
Forward-iterator browsing all plane IDs in the detector.
geo::PlaneID GetEndPlaneID(geo::CryostatID const &id) const
ROP_id_iterator geo::GeometryCore::end_ROP_id ( ) const
inline

Returns an iterator pointing after the last ROP ID in the detector.

Definition at line 5090 of file GeometryCore.h.

References geo::details::geometry_iterator_types::end_pos.

Referenced by end_ROP_id(), and IterateROPIDs().

5091  { return ROP_id_iterator(this, ROP_id_iterator::end_pos); }
details::ROP_id_iterator_base< readout::ROPID > ROP_id_iterator
Forward iterator browsing all readout planes in the detector.
static constexpr EndPos_t end_pos
Definition: GeometryCore.h:120
ROP_id_iterator geo::GeometryCore::end_ROP_id ( geo::CryostatID const &  ID) const
inline

Returns an iterator pointing after the last readout plane ID in the specified cryostat.

Definition at line 5100 of file GeometryCore.h.

5101  { return ROP_id_iterator(this, GetEndROPID(ID)); }
readout::ROPID GetEndROPID(geo::CryostatID const &id) const
details::ROP_id_iterator_base< readout::ROPID > ROP_id_iterator
Forward iterator browsing all readout planes in the detector.
ROP_id_iterator geo::GeometryCore::end_ROP_id ( readout::TPCsetID const &  ID) const
inline

Returns an iterator pointing after the last readout plane ID in the specified TPC set.

Definition at line 5110 of file GeometryCore.h.

References begin_ROP_id(), and end_ROP_id().

5111  { return ROP_id_iterator(this, GetEndROPID(ID)); }
readout::ROPID GetEndROPID(geo::CryostatID const &id) const
details::ROP_id_iterator_base< readout::ROPID > ROP_id_iterator
Forward iterator browsing all readout planes in the detector.
TPC_iterator geo::GeometryCore::end_TPC ( ) const
inline

Returns an iterator pointing after the last TPC in the detector.

Definition at line 2538 of file GeometryCore.h.

References geo::details::geometry_iterator_types::end_pos.

Referenced by lar::example::SpacePointIsolationAlg::fillAlgConfigFromGeometry(), IterateTPCIDs(), IterateTPCs(), and sim::MCRecoPart::MCRecoPart().

2539  { return TPC_iterator(this, TPC_iterator::end_pos); }
geo::TPC_iterator TPC_iterator
Forward-iterator browsing all TPCs in the detector.
static constexpr EndPos_t end_pos
Definition: GeometryCore.h:120
TPC_iterator geo::GeometryCore::end_TPC ( geo::CryostatID const &  cid) const
inline

Returns an iterator pointing after the last TPC in the detector.

Definition at line 2546 of file GeometryCore.h.

References begin_TPC_id(), and end_TPC_id().

2547  { return TPC_iterator(this, GetEndTPCID(cid)); }
geo::TPCID GetEndTPCID(geo::CryostatID const &id) const
geo::TPC_iterator TPC_iterator
Forward-iterator browsing all TPCs in the detector.
TPC_id_iterator geo::GeometryCore::end_TPC_id ( ) const
inline

Returns an iterator pointing after the last TPC ID in the detector.

Definition at line 2520 of file GeometryCore.h.

References geo::details::geometry_iterator_types::end_pos.

Referenced by pma::PMAlgTracker::build(), end_TPC(), IterateTPCIDs(), and tss::TrackShowerHits::produce().

2521  { return TPC_id_iterator(this, TPC_id_iterator::end_pos); }
static constexpr EndPos_t end_pos
Definition: GeometryCore.h:120
geo::TPC_id_iterator TPC_id_iterator
Forward-iterator browsing all TPC IDs in the detector.
TPC_id_iterator geo::GeometryCore::end_TPC_id ( geo::CryostatID const &  cid) const
inline

Returns an iterator pointing after the last TPC ID in the specified cryostat.

Definition at line 2530 of file GeometryCore.h.

2531  { return TPC_id_iterator(this, GetEndTPCID(cid)); }
geo::TPCID GetEndTPCID(geo::CryostatID const &id) const
geo::TPC_id_iterator TPC_id_iterator
Forward-iterator browsing all TPC IDs in the detector.
TPCset_id_iterator geo::GeometryCore::end_TPCset_id ( ) const
inline

Returns an iterator pointing after the last TPC set ID in the detector.

Definition at line 4853 of file GeometryCore.h.

References geo::details::geometry_iterator_types::end_pos.

Referenced by end_TPCset_id(), and IterateTPCsetIDs().

static constexpr EndPos_t end_pos
Definition: GeometryCore.h:120
details::TPCset_id_iterator_base< readout::TPCsetID > TPCset_id_iterator
Forward iterator browsing all TPC sets in the detector.
TPCset_id_iterator geo::GeometryCore::end_TPCset_id ( geo::CryostatID const &  cid) const
inline

Returns an iterator pointing after the last TPC set ID in the specified cryostat.

Definition at line 4863 of file GeometryCore.h.

References begin_TPCset_id(), and end_TPCset_id().

4864  { return TPCset_id_iterator(this, GetEndTPCsetID(cid)); }
readout::TPCsetID GetEndTPCsetID(geo::CryostatID const &id) const
details::TPCset_id_iterator_base< readout::TPCsetID > TPCset_id_iterator
Forward iterator browsing all TPC sets in the detector.
wire_iterator geo::GeometryCore::end_wire ( ) const
inline

Returns an iterator pointing after the last wire in the detector.

Definition at line 3459 of file GeometryCore.h.

References geo::details::geometry_iterator_types::end_pos.

Referenced by IterateWireIDs(), and IterateWires().

3460  { return wire_iterator(this, wire_iterator::end_pos); }
static constexpr EndPos_t end_pos
Definition: GeometryCore.h:120
geo::wire_iterator wire_iterator
Forward-iterator browsing all wires in the detector.
wire_iterator geo::GeometryCore::end_wire ( geo::CryostatID const &  id) const
inline

Returns an iterator pointing after the last wire in specified cryostat.

Definition at line 3467 of file GeometryCore.h.

3468  { return wire_iterator(end_wire_id(id)); }
wire_id_iterator end_wire_id() const
Returns an iterator pointing after the last wire ID in the detector.
geo::wire_iterator wire_iterator
Forward-iterator browsing all wires in the detector.
wire_iterator geo::GeometryCore::end_wire ( geo::TPCID const &  id) const
inline

Returns an iterator pointing after the last wire in specified TPC.

Definition at line 3475 of file GeometryCore.h.

3476  { return wire_iterator(end_wire_id(id)); }
wire_id_iterator end_wire_id() const
Returns an iterator pointing after the last wire ID in the detector.
geo::wire_iterator wire_iterator
Forward-iterator browsing all wires in the detector.
wire_iterator geo::GeometryCore::end_wire ( geo::PlaneID const &  id) const
inline

Returns an iterator pointing after the last wire in specified plane.

Definition at line 3483 of file GeometryCore.h.

References begin_wire_id(), and end_wire_id().

3484  { return wire_iterator(end_wire_id(id)); }
wire_id_iterator end_wire_id() const
Returns an iterator pointing after the last wire ID in the detector.
geo::wire_iterator wire_iterator
Forward-iterator browsing all wires in the detector.
wire_id_iterator geo::GeometryCore::end_wire_id ( ) const
inline

Returns an iterator pointing after the last wire ID in the detector.

Definition at line 3426 of file GeometryCore.h.

References geo::details::geometry_iterator_types::end_pos.

Referenced by end_wire(), IterateWireIDs(), lariov::SIOVElectronicsCalibProvider::Reconfigure(), and lariov::DetPedestalRetrievalAlg::Reconfigure().

3427  { return wire_id_iterator(this, wire_id_iterator::end_pos); }
static constexpr EndPos_t end_pos
Definition: GeometryCore.h:120
geo::wire_id_iterator wire_id_iterator
Forward-iterator browsing all wire IDs in the detector.
wire_id_iterator geo::GeometryCore::end_wire_id ( geo::CryostatID const &  id) const
inline

Returns an iterator pointing after the last wire ID in specified cryostat.

Definition at line 3435 of file GeometryCore.h.

3436  { return wire_id_iterator(this, GetEndWireID(id)); }
geo::WireID GetEndWireID(geo::CryostatID const &id) const
geo::wire_id_iterator wire_id_iterator
Forward-iterator browsing all wire IDs in the detector.
wire_id_iterator geo::GeometryCore::end_wire_id ( geo::TPCID const &  id) const
inline

Returns an iterator pointing after the last wire ID in specified TPC.

Definition at line 3443 of file GeometryCore.h.

3444  { return wire_id_iterator(this, GetEndWireID(id)); }
geo::WireID GetEndWireID(geo::CryostatID const &id) const
geo::wire_id_iterator wire_id_iterator
Forward-iterator browsing all wire IDs in the detector.
wire_id_iterator geo::GeometryCore::end_wire_id ( geo::PlaneID const &  id) const
inline

Returns an iterator pointing after the last wire ID in specified plane.

Definition at line 3451 of file GeometryCore.h.

3452  { return wire_id_iterator(this, GetEndWireID(id)); }
geo::WireID GetEndWireID(geo::CryostatID const &id) const
geo::wire_id_iterator wire_id_iterator
Forward-iterator browsing all wire IDs in the detector.
std::vector< std::vector< TGeoNode const * > > geo::GeometryCore::FindAllVolumePaths ( std::set< std::string > const &  vol_names) const

Returns paths of all nodes with volumes with the specified names.

Parameters
vol_nameslist of names of volumes
Returns
list paths of the found nodes

All the nodes in the geometry are checked, and the path of all the ones that contain a volume with a name among the ones specified in vol_names is saved in the collection and returned. A node path is a ordered list of all nodes leading to the final one, starting from thetop level (root) down. The node at the back() of the path is the one with name in vol_names. No empty paths are returned.

Definition at line 682 of file GeometryCore.cxx.

References geo::CollectPathsByName::paths, and ROOTGeoManager().

Referenced by FindAllVolumes().

683  {
684  CollectPathsByName path_collector(vol_names);
685 
686  ROOTGeoNodeForwardIterator iNode(ROOTGeoManager()->GetTopNode());
687 
688  while (*iNode) {
689  path_collector(iNode);
690  ++iNode;
691  } // while
692 
693  return path_collector.paths;
694  } // GeometryCore::FindAllVolumePaths()
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
std::vector< TGeoNode const * > geo::GeometryCore::FindAllVolumes ( std::set< std::string > const &  vol_names) const

Returns all the nodes with volumes with any of the specified names.

Parameters
vol_nameslist of names of volumes
Returns
list of nodes found

All the nodes in the geometry are checked, and all the ones that contain a volume with a name among the ones specified in vol_names are saved in the collection and returned.

Definition at line 665 of file GeometryCore.cxx.

References FindAllVolumePaths(), geo::CollectNodesByName::nodes, and ROOTGeoManager().

666  {
667  CollectNodesByName node_collector(vol_names);
668 
669  ROOTGeoNodeForwardIterator iNode(ROOTGeoManager()->GetTopNode());
670  TGeoNode const* pCurrentNode;
671 
672  while ((pCurrentNode = *iNode)) {
673  node_collector(*pCurrentNode);
674  ++iNode;
675  } // while
676 
677  return node_collector.nodes;
678  } // GeometryCore::FindAllVolumes()
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
void geo::GeometryCore::FindAuxDet ( std::vector< const TGeoNode * > &  path,
unsigned int  depth 
)
private

Definition at line 1077 of file GeometryCore.cxx.

References MakeAuxDet().

Referenced by LoadGeometryFile().

1079  {
1080  const char* nm = path[depth]->GetName();
1081  if( (strncmp(nm, "volAuxDet", 9) == 0) ){
1082  this->MakeAuxDet(path, depth);
1083  return;
1084  }
1085 
1086  //explore the next layer down
1087  unsigned int deeper = depth+1;
1088  if(deeper >= path.size()){
1089  throw cet::exception("GeometryCore") << "exceeded maximum TGeoNode depth\n";
1090  }
1091 
1092  const TGeoVolume *v = path[depth]->GetVolume();
1093  int nd = v->GetNdaughters();
1094  for(int i = 0; i < nd; ++i){
1095  path[deeper] = v->GetNode(i);
1096  this->FindAuxDet(path, deeper);
1097  }
1098 
1099  }
void FindAuxDet(std::vector< const TGeoNode * > &path, unsigned int depth)
void MakeAuxDet(std::vector< const TGeoNode * > &path, int depth)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int geo::GeometryCore::FindAuxDetAtPosition ( double const  worldLoc[3]) const

Returns the index of the auxiliary detector at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
Returns
the index of the detector, or std::numeric_limits<unsigned int>max() if no detector is there
Bug:
Actually, an exception is thrown.
Deprecated:
Use the version with geo::Point_t.

Definition at line 464 of file GeometryCore.cxx.

References geo::vect::makePointFromCoords(), and PositionToAuxDet().

Referenced by FindAuxDetSensitiveAtPosition(), and PositionToAuxDet().

unsigned int FindAuxDetAtPosition(double const worldLoc[3]) const
Returns the index of the auxiliary detector at specified location.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
unsigned int geo::GeometryCore::FindAuxDetAtPosition ( geo::Point_t const &  point) const

Returns the index of the auxiliary detector at specified location.

Parameters
pointlocation to be tested
Returns
the index of the detector, or std::numeric_limits<unsigned int>max() if no detector is there
Bug:
Actually, an exception is thrown.

Definition at line 455 of file GeometryCore.cxx.

References AuxDets(), and fChannelMapAlg.

456  {
457  // BUG the double brace syntax is required to work around clang bug 21629
458  // (https://bugs.llvm.org/show_bug.cgi?id=21629)
459  std::array<double, 3U> worldPos = {{ point.X(), point.Y(), point.Z() }};
460  return fChannelMapAlg->NearestAuxDet(worldPos.data(), AuxDets());
461  } // GeometryCore::FindAuxDetAtPosition()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
void geo::GeometryCore::FindAuxDetSensitiveAtPosition ( geo::Point_t const &  point,
std::size_t &  adg,
std::size_t &  sv 
) const

Fills the indices of the sensitive auxiliary detector at location.

Parameters
pointlocation to be tested
adg_(output)_ auxiliary detector index
sv_(output)_ sensitive volume index

Definition at line 484 of file GeometryCore.cxx.

References AuxDets(), fChannelMapAlg, and FindAuxDetAtPosition().

Referenced by larg4::AuxDetReadoutGeometry::FindAndMakeAuxDetSensitive(), FindAuxDetSensitiveAtPosition(), PositionToAuxDet(), and PositionToAuxDetSensitive().

485  {
486  adg = FindAuxDetAtPosition(point);
487  // BUG the double brace syntax is required to work around clang bug 21629
488  // (https://bugs.llvm.org/show_bug.cgi?id=21629)
489  std::array<double, 3U> const worldPos = {{ point.X(), point.Y(), point.Z() }};
490  sv = fChannelMapAlg->NearestSensitiveAuxDet(worldPos.data(), AuxDets());
491  } // GeometryCore::FindAuxDetAtPosition()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
unsigned int FindAuxDetAtPosition(double const worldLoc[3]) const
Returns the index of the auxiliary detector at specified location.
void geo::GeometryCore::FindAuxDetSensitiveAtPosition ( double const  worldLoc[3],
size_t &  adg,
size_t &  sv 
) const

Fills the indices of the sensitive auxiliary detector at location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
adg(output) auxiliary detector index
sv(output) sensitive volume index
Deprecated:
Use the version with geo::Point_t.

Definition at line 495 of file GeometryCore.cxx.

References FindAuxDetSensitiveAtPosition(), geo::vect::makePointFromCoords(), and PositionToAuxDetSensitive().

496  { return FindAuxDetSensitiveAtPosition(geo::vect::makePointFromCoords(worldPos), adg, sv); }
void FindAuxDetSensitiveAtPosition(geo::Point_t const &point, std::size_t &adg, std::size_t &sv) const
Fills the indices of the sensitive auxiliary detector at location.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
void geo::GeometryCore::FindCryostat ( std::vector< const TGeoNode * > &  path,
unsigned int  depth 
)
private

Definition at line 1046 of file GeometryCore.cxx.

References MakeCryostat().

Referenced by LoadGeometryFile().

1048  {
1049  const char* nm = path[depth]->GetName();
1050  if( (strncmp(nm, "volCryostat", 11) == 0) ){
1051  this->MakeCryostat(path, depth);
1052  return;
1053  }
1054 
1055  //explore the next layer down
1056  unsigned int deeper = depth+1;
1057  if(deeper >= path.size()){
1058  throw cet::exception("GeometryCore") << "exceeded maximum TGeoNode depth\n";
1059  }
1060 
1061  const TGeoVolume *v = path[depth]->GetVolume();
1062  int nd = v->GetNdaughters();
1063  for(int i = 0; i < nd; ++i){
1064  path[deeper] = v->GetNode(i);
1065  this->FindCryostat(path, deeper);
1066  }
1067 
1068  }
void FindCryostat(std::vector< const TGeoNode * > &path, unsigned int depth)
void MakeCryostat(std::vector< const TGeoNode * > &path, int depth)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::CryostatID::CryostatID_t geo::GeometryCore::FindCryostatAtPosition ( geo::Point_t const &  worldLoc) const

Returns the index of the cryostat at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
Returns
the index of the cryostat, or UINT_MAX if no cryostat is there
Deprecated:
Use PositionToCryostatID() instead

Definition at line 352 of file GeometryCore.cxx.

References geo::CryostatID::Cryostat, geo::CryostatGeo::ID(), geo::CryostatID::InvalidID, and PositionToCryostatPtr().

Referenced by pma::ProjectionMatchingAlg::buildShowerSeg(), ems::MultiEMShowers::convCluster(), FindCryostatAtPosition(), evd::SimulationDrawer::MCTruthOrtho(), PositionToCryostat(), and PositionToCryostatID().

353  {
354  geo::CryostatGeo const* cryo = PositionToCryostatPtr(worldLoc);
355  return cryo? cryo->ID().Cryostat: geo::CryostatID::InvalidID;
356  } // GeometryCore::FindCryostatAtPosition(Point)
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:130
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
geo::CryostatGeo const * PositionToCryostatPtr(geo::Point_t const &point) const
Returns the cryostat at specified location.
static const CryostatID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:126
geo::CryostatID const & ID() const
Returns the identifier of this cryostat.
Definition: CryostatGeo.h:116
geo::CryostatID::CryostatID_t geo::GeometryCore::FindCryostatAtPosition ( double const  worldLoc[3]) const

Returns the index of the cryostat at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
Returns
the index of the cryostat, or UINT_MAX if no cryostat is there
Deprecated:
Use PositionToCryostatID() instead

Definition at line 361 of file GeometryCore.cxx.

References FindCryostatAtPosition(), geo::vect::makePointFromCoords(), and PositionToTPCptr().

362  {
364  } // GeometryCore::FindCryostatAtPosition(double[])
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
geo::CryostatID::CryostatID_t FindCryostatAtPosition(geo::Point_t const &worldLoc) const
Returns the index of the cryostat at specified location.
std::vector< TGeoNode const * > geo::GeometryCore::FindDetectorEnclosure ( std::string const &  name = "volDetEnclosure") const
private

Definition at line 957 of file GeometryCore.cxx.

References FindFirstVolume(), and ROOTGeoManager().

Referenced by DetectorEnclosureBox(), and MaterialName().

958  {
959  std::vector<TGeoNode const*> path { ROOTGeoManager()->GetTopNode() };
960  if (!FindFirstVolume(name, path)) path.clear();
961  return path;
962  } // FindDetectorEnclosure()
bool FindFirstVolume(std::string const &name, std::vector< const TGeoNode * > &path) const
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
bool geo::GeometryCore::FindFirstVolume ( std::string const &  name,
std::vector< const TGeoNode * > &  path 
) const
private

Definition at line 966 of file GeometryCore.cxx.

Referenced by FindDetectorEnclosure().

967  {
968  assert(!path.empty());
969 
970  auto const* pCurrent = path.back();
971 
972  // first check the current layer
973  if (strncmp(name.c_str(), pCurrent->GetName(), name.length()) == 0)
974  return true;
975 
976  //explore the next layer down
977  auto const* pCurrentVolume = pCurrent->GetVolume();
978  unsigned int nd = pCurrentVolume->GetNdaughters();
979  for(unsigned int i = 0; i < nd; ++i) {
980  path.push_back(pCurrentVolume->GetNode(i));
981  if (FindFirstVolume(name, path)) return true;
982  path.pop_back();
983  } // for
984  return false;
985  } // FindFirstVolume()
bool FindFirstVolume(std::string const &name, std::vector< const TGeoNode * > &path) const
geo::TPCID geo::GeometryCore::FindTPCAtPosition ( double const  worldLoc[3]) const
inline
geo::TPCID geo::GeometryCore::FindTPCAtPosition ( geo::Point_t const &  point) const

Returns the ID of the TPC at specified location.

Parameters
worldLoc3D point (world reference frame, centimeters)
Returns
the TPC ID, or an invalid one if no TPC is there

Definition at line 311 of file GeometryCore.cxx.

References geo::CryostatID::Cryostat, fPositionWiggle, geo::CryostatGeo::ID(), geo::CryostatID::markInvalid(), PositionToCryostatPtr(), and geo::CryostatGeo::PositionToTPCID().

311  {
312 
313  // first find the cryostat
314  geo::CryostatGeo const* cryo = PositionToCryostatPtr(point);
315  if (!cryo) return {};
316 
317  // then ask it about the TPC
318  geo::TPCID tpcid = cryo->PositionToTPCID(point, 1. + fPositionWiggle);
319  if (tpcid) return tpcid;
320 
321  // return an invalid TPC ID with cryostat information set:
322  tpcid.Cryostat = cryo->ID().Cryostat;
323  tpcid.markInvalid();
324  return tpcid;
325 
326  } // GeometryCore::FindTPCAtPosition()
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:130
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
void markInvalid()
Sets the ID as invalid.
Definition: geo_types.h:157
double fPositionWiggle
accounting for rounding errors when testing positions
geo::CryostatGeo const * PositionToCryostatPtr(geo::Point_t const &point) const
Returns the cryostat at specified location.
geo::TPCID PositionToTPCID(geo::Point_t const &point, double wiggle) const
Returns the ID of the TPC at specified location.
geo::CryostatID const & ID() const
Returns the identifier of this cryostat.
Definition: CryostatGeo.h:116
geo::TPCID geo::GeometryCore::FindTPCAtPosition ( TVector3 const &  point) const
inline

Returns the ID of the TPC at specified location.

Parameters
worldLoc3D point (world reference frame, centimeters)
Returns
the TPC ID, or an invalid one if no TPC is there

Definition at line 2434 of file GeometryCore.h.

References geo::vect::toPoint().

2435  { return FindTPCAtPosition(geo::vect::toPoint(point)); }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
readout::TPCsetID geo::GeometryCore::FindTPCsetAtPosition ( double const  worldLoc[3]) const

Returns the ID of the TPC set at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
Returns
the TPC set ID, or an invalid one if no TPC set is there

Definition at line 1783 of file GeometryCore.cxx.

References FindTPCAtPosition(), and TPCtoTPCset().

Referenced by HasTPCset().

1784  {
1785  return TPCtoTPCset(FindTPCAtPosition(worldLoc));
1786  } // GeometryCore::FindTPCsetAtPosition()
readout::TPCsetID TPCtoTPCset(geo::TPCID const &tpcid) const
Returns the ID of the TPC set tpcid belongs to.
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
raw::ChannelID_t geo::GeometryCore::FirstChannelInROP ( readout::ROPID const &  ropid) const

Returns the ID of the first channel in the specified readout plane.

Parameters
ropidID of the readout plane
Returns
ID of first channel, or raw::InvalidChannelID if ID is invalid

Note that this check is performed on the validity of the readout plane ID, that does not necessarily imply that the readout plane specified by the ID actually exists. Check if the ROP exists with HasROP(). The behaviour for non-existing readout planes is undefined.

Definition at line 1850 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by ROPtoTPCs().

1851  {
1852  return fChannelMapAlg->FirstChannelInROP(ropid);
1853  } // GeometryCore::FirstChannelInROP()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
std::string geo::GeometryCore::GDMLFile ( ) const
inline

Returns the full directory path to the GDML file source.

Returns
the full directory path to the GDML file source

This is the full path of the source of the detector geometry handed to the detector simulation (GEANT).

Definition at line 1723 of file GeometryCore.h.

Referenced by larg4::LArG4::beginJob(), and evd::Landed::Landed().

1723 { return fGDMLfile; }
std::string fGDMLfile
path to geometry file used for Geant4 simulation
template<typename GeoID >
GeoID geo::GeometryCore::GetBeginID ( ) const
inline

Returns the ID of the first element of the detector.

Template Parameters
GeoIDtype of the ID to be returned
Returns
ID of the first subelement in the detector

Definition at line 1903 of file GeometryCore.h.

References GetBeginID().

Referenced by GetBeginID().

1903 { GeoID id; GetBeginID(id); return id; }
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
template<typename GeoID , typename ContextID >
GeoID geo::GeometryCore::GetBeginID ( ContextID const &  id) const

Returns the ID of the first subelement of the specified element.

Template Parameters
GeoIDtype of the ID to be returned
ContextIDtype of the ID of the containing element
Parameters
idID of the containing element
Returns
ID of the first subelement in the specified geometry element
void geo::GeometryCore::GetBeginID ( geo::CryostatID id) const
inline

Initializes the specified ID with the ID of the first cryostat.

Definition at line 2104 of file GeometryCore.h.

2105  { id = geo::CryostatID(0, HasCryostat(geo::CryostatID(0))); }
geo::CryostatID CryostatID
Definition: readout_types.h:30
bool HasCryostat(geo::CryostatID const &cryoid) const
Returns whether we have the specified cryostat.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:120
void geo::GeometryCore::GetBeginID ( geo::TPCID id) const
inline

Initializes the specified ID with the ID of the first TPC.

iterators

Definition at line 2494 of file GeometryCore.h.

2495  { GetBeginID(id.asCryostatID()); id.TPC = 0; }
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
void geo::GeometryCore::GetBeginID ( geo::PlaneID id) const
inline

Initializes the specified ID with the ID of the first plane.

Definition at line 2977 of file GeometryCore.h.

2978  { GetBeginID(id.asTPCID()); id.Plane = 0; }
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
void geo::GeometryCore::GetBeginID ( geo::WireID id) const
inline

Initializes the specified ID with the ID of the first wire.

Definition at line 3383 of file GeometryCore.h.

3384  { GetBeginID(id.asPlaneID()); id.Wire = 0; }
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
void geo::GeometryCore::GetBeginID ( readout::TPCsetID id) const
inline

Initializes the specified ID with the ID of the first TPC set.

iterators

Definition at line 4827 of file GeometryCore.h.

4828  { GetBeginID(id.asCryostatID()); id.TPCset = 0; }
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
void geo::GeometryCore::GetBeginID ( readout::ROPID id) const
inline

Initializes the specified ID with the ID of the first readout plane.

iterators

Definition at line 5056 of file GeometryCore.h.

5057  { GetBeginID(id.asTPCsetID()); id.ROP = 0; }
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
geo::PlaneID geo::GeometryCore::GetBeginPlaneID ( geo::CryostatID const &  id) const
inline

Returns the ID of the first plane of the specified cryostat.

Definition at line 2989 of file GeometryCore.h.

2990  { return { GetBeginTPCID(id), 0 }; }
geo::TPCID GetBeginTPCID(geo::CryostatID const &id) const
Returns the ID of the first TPC in the specified cryostat.
geo::PlaneID geo::GeometryCore::GetBeginPlaneID ( geo::TPCID const &  id) const
inline

Returns the ID of the first plane of the specified TPC.

Definition at line 2998 of file GeometryCore.h.

2999  { return { id, 0 }; }
readout::ROPID geo::GeometryCore::GetBeginROPID ( geo::CryostatID const &  id) const
inline

Returns the ID of the first readout plane of the specified cryostat.

Definition at line 5068 of file GeometryCore.h.

5069  { return { GetBeginTPCsetID(id), 0 }; }
readout::TPCsetID GetBeginTPCsetID(geo::CryostatID const &id) const
Returns the ID of the first TPC set in the specified cryostat.
readout::ROPID geo::GeometryCore::GetBeginROPID ( readout::TPCsetID const &  id) const
inline

Returns the ID of the first readout plane of the specified TPC set.

Definition at line 5077 of file GeometryCore.h.

5078  { return { id, 0 }; }
geo::TPCID geo::GeometryCore::GetBeginTPCID ( geo::CryostatID const &  id) const
inline

Returns the ID of the first TPC in the specified cryostat.

Definition at line 2506 of file GeometryCore.h.

2507  { return { id, 0 }; }
readout::TPCsetID geo::GeometryCore::GetBeginTPCsetID ( geo::CryostatID const &  id) const
inline

Returns the ID of the first TPC set in the specified cryostat.

Definition at line 4839 of file GeometryCore.h.

4840  { return { id, 0 }; }
geo::WireID geo::GeometryCore::GetBeginWireID ( geo::CryostatID const &  id) const
inline

Returns the ID of the first wire in the specified cryostat.

Definition at line 3395 of file GeometryCore.h.

3396  { return { GetBeginPlaneID(id), 0 }; }
geo::PlaneID GetBeginPlaneID(geo::CryostatID const &id) const
Returns the ID of the first plane of the specified cryostat.
geo::WireID geo::GeometryCore::GetBeginWireID ( geo::TPCID const &  id) const
inline

Returns the ID of the first wire of the specified TPC.

Definition at line 3404 of file GeometryCore.h.

3405  { return { geo::PlaneID(id, 0), 0 }; }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
geo::WireID geo::GeometryCore::GetBeginWireID ( geo::PlaneID const &  id) const
inline

Returns the ID of the first wire of the specified wire plane.

Definition at line 3413 of file GeometryCore.h.

3414  { return { id, 0 }; }
unsigned int geo::GeometryCore::GetClosestOpDet ( geo::Point_t const &  point) const

Find the nearest OpChannel to some point.

Parameters
xyzpoint to be queried, in world coordinates
Returns
the nearest OpChannel to the point, or std::numeric_limits<unsigned int>max() if invalid point
Deprecated:
This method does not tell in which cryostat the detector is; use geo::CryostatGeo::GetClosestOpDet() instead (find the cryostat with PositionToCryostatPtr()).

Definition at line 1959 of file GeometryCore.cxx.

References geo::CryostatID::Cryostat, geo::CryostatGeo::GetClosestOpDet(), geo::CryostatGeo::ID(), max, OpDetFromCryo(), and PositionToCryostatPtr().

Referenced by GetClosestOpDet().

1960  {
1961  geo::CryostatGeo const* cryo = PositionToCryostatPtr(point);
1962  if (!cryo) return std::numeric_limits<unsigned int>::max();
1963  int o = cryo->GetClosestOpDet(point);
1964  return OpDetFromCryo(o, cryo->ID().Cryostat);
1965  }
unsigned int GetClosestOpDet(geo::Point_t const &point) const
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:130
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
unsigned int OpDetFromCryo(unsigned int o, unsigned int c) const
Get unique opdet number from cryo and internal count.
Int_t max
Definition: plot.C:27
geo::CryostatGeo const * PositionToCryostatPtr(geo::Point_t const &point) const
Returns the cryostat at specified location.
geo::CryostatID const & ID() const
Returns the identifier of this cryostat.
Definition: CryostatGeo.h:116
unsigned int geo::GeometryCore::GetClosestOpDet ( double const *  point) const

Find the nearest OpChannel to some point.

Parameters
xyzpoint to be queried, in world coordinates
Returns
the nearest OpChannel to the point, or std::numeric_limits<unsigned int>max() if invalid point
Deprecated:
This method does not tell in which cryostat the detector is; use geo::CryostatGeo::GetClosestOpDet() instead (find the cryostat with PositionToCryostatPtr()).

Definition at line 1970 of file GeometryCore.cxx.

References GetClosestOpDet(), geo::vect::makePointFromCoords(), and WireIDIntersectionCheck().

unsigned int GetClosestOpDet(geo::Point_t const &point) const
Find the nearest OpChannel to some point.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
std::string geo::GeometryCore::GetCryostatVolumeName ( geo::CryostatID const &  cid) const

Return the name of LAr TPC volume.

Parameters
cstatindex of the cryostat
Returns
the name of the specified TPC

This information is used in the event display.

Todo:

Use a cryostat ID instead

What if it does not exist?

Definition at line 705 of file GeometryCore.cxx.

References Cryostat().

706  {
707  return std::string(Cryostat(cid).Volume()->GetName());
708  }
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
std::string geo::GeometryCore::GetCryostatVolumeName ( unsigned int const  cstat = 0) const
inline

Return the name of LAr TPC volume.

Parameters
cstatindex of the cryostat
Returns
the name of the specified TPC

This information is used in the event display.

Todo:

Use a cryostat ID instead

What if it does not exist?

Definition at line 2250 of file GeometryCore.h.

2251  { return GetCryostatVolumeName(geo::CryostatID(cstat)); }
std::string GetCryostatVolumeName(geo::CryostatID const &cid) const
Return the name of LAr TPC volume.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:120
CryostatGeo const& geo::GeometryCore::GetElement ( geo::CryostatID const &  cryoid) const
inline

Returns the specified cryostat.

Parameters
cstatnumber of cryostat
cryoidcryostat ID
Returns
a constant reference to the specified cryostat
Exceptions
cet::exception(GeometryCore category) if cryostat not present

The GetElement() method is overloaded and its return depends on the type of ID.

Todo:
Make the cryostat number mandatory (as CryostatID)

Definition at line 2003 of file GeometryCore.h.

Referenced by evd::SimulationDrawer::MCTruthOrtho().

2004  { return Cryostat(cryoid); }
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
TPCGeo const& geo::GeometryCore::GetElement ( geo::TPCID const &  tpcid) const
inline

Returns the specified TPC.

Parameters
tpcidID of the tpc
tpctpc number within the cryostat
cstatnumber of cryostat
Returns
a constant reference to the specified TPC
Exceptions
cet::exception(GeometryCore category) if cryostat not present
cet::exception(TPCOutOfRange category) if no such TPC

The GetElement() method is overloaded and its return depends on the type of ID.

Todo:
remove the version with integers

Definition at line 2397 of file GeometryCore.h.

2398  { return TPC(tpcid); }
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
PlaneGeo const& geo::GeometryCore::GetElement ( geo::PlaneID const &  planeid) const
inline

Returns the specified wire.

Parameters
planeidID of the plane
pplane number within the TPC
tpcTPC number within the cryostat
cstatnumber of cryostat
Returns
a constant reference to the specified plane
Exceptions
cet::exception(GeometryCore category) if cryostat not present
cet::exception(TPCOutOfRange category) if no such TPC
cet::exception(PlaneOutOfRange category) if no such plane

The GetElement() method is overloaded and its return depends on the type of ID.

Todo:
remove the version with integers

Definition at line 2950 of file GeometryCore.h.

2951  { return Plane(planeid); }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
WireGeo const& geo::GeometryCore::GetElement ( geo::WireID const &  wireid) const
inline

Returns the specified wire.

Parameters
wireidID of the wire
Returns
a constant reference to the specified wire
Exceptions
cet::exceptionif not found

The GetElement() method is overloaded and its return depends on the type of ID.

Definition at line 3374 of file GeometryCore.h.

3375  { return Wire(wireid); }
WireGeo const & Wire(geo::WireID const &wireid) const
Returns the specified wire.
CryostatGeo const* geo::GeometryCore::GetElementPtr ( geo::CryostatID const &  cryoid) const
inline

Returns the specified cryostat.

Parameters
cryoidcryostat ID
Returns
a constant pointer to the specified cryostat, or nullptr if none

The GetElementPtr() method is overloaded and its return depends on the type of ID.

Definition at line 2018 of file GeometryCore.h.

2019  { return CryostatPtr(cryoid); }
CryostatGeo const * CryostatPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
TPCGeo const* geo::GeometryCore::GetElementPtr ( geo::TPCID const &  tpcid) const
inline

Returns the specified TPC.

Parameters
tpcidTPC ID
Returns
a constant pointer to the specified TPC, or nullptr if none

The GetElementPtr() method is overloaded and its return depends on the type of ID.

Definition at line 2415 of file GeometryCore.h.

2416  { return TPCPtr(tpcid); }
TPCGeo const * TPCPtr(geo::TPCID const &tpcid) const
Returns the specified TPC.
PlaneGeo const* geo::GeometryCore::GetElementPtr ( geo::PlaneID const &  planeid) const
inline

Returns the specified plane.

Parameters
planeidplane ID
Returns
a constant pointer to the specified plane, or nullptr if none

The GetElementPtr() method is overloaded and its return depends on the type of ID.

Definition at line 2968 of file GeometryCore.h.

2969  { return PlanePtr(planeid); }
PlaneGeo const * PlanePtr(geo::PlaneID const &planeid) const
Returns the specified plane.
WireGeo const* geo::GeometryCore::GetElementPtr ( geo::WireID const &  wireid) const
inline

Returns the specified wire.

Parameters
wireidwire ID
Returns
a constant pointer to the specified wire, or nullptr if none

The GetElementPtr() method is overloaded and its return depends on the type of ID.

Definition at line 3356 of file GeometryCore.h.

3357  { return WirePtr(wireid); }
WireGeo const * WirePtr(geo::WireID const &wireid) const
Returns the specified wire.
template<typename GeoID >
GeoID geo::GeometryCore::GetEndID ( ) const
inline

Returns the (possibly invalid) ID after the last subelement of the detector.

Template Parameters
GeoIDtype of the ID to be returned
Returns
ID after the last subelement in the specified geometry element

Definition at line 1922 of file GeometryCore.h.

References GetEndID().

Referenced by GetEndID().

1922 { GeoID id; GetEndID(id); return id; }
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
template<typename GeoID , typename ContextID >
GeoID geo::GeometryCore::GetEndID ( ContextID const &  id) const

Returns the (possibly invalid) ID after the last subelement of the specified element.

Template Parameters
GeoIDtype of the ID to be returned
ContextIDtype of the ID of the containing element
Parameters
idID of the containing element
Returns
ID (possibly invalid) after the last subelement in the specified geometry element
void geo::GeometryCore::GetEndID ( geo::CryostatID id) const
inline

Initializes the specified ID with the invalid ID after the last cryostat.

Definition at line 2108 of file GeometryCore.h.

2109  { id = geo::CryostatID(Ncryostats(), false); }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
geo::CryostatID CryostatID
Definition: readout_types.h:30
void geo::GeometryCore::GetEndID ( geo::TPCID id) const
inline

Initializes the specified ID with the invalid ID after the last TPC.

Definition at line 2498 of file GeometryCore.h.

2499  { GetEndID(id.asCryostatID()); id.TPC = 0; }
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
void geo::GeometryCore::GetEndID ( geo::PlaneID id) const
inline

Initializes the specified ID with the invalid ID after the last plane.

Definition at line 2981 of file GeometryCore.h.

2982  { GetEndID(id.asTPCID()); id.Plane = 0; }
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
void geo::GeometryCore::GetEndID ( geo::WireID id) const
inline

Initializes the specified ID with the invalid ID after the last wire.

Definition at line 3387 of file GeometryCore.h.

3388  { GetEndID(id.asPlaneID()); id.Wire = 0; }
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
void geo::GeometryCore::GetEndID ( readout::TPCsetID id) const
inline

Initializes the specified ID with the invalid ID after the last TPC set.

Definition at line 4831 of file GeometryCore.h.

4832  { GetEndID(id.asCryostatID()); id.TPCset = 0; }
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
void geo::GeometryCore::GetEndID ( readout::ROPID id) const
inline

Initializes the specified ID with the invalid ID after the last ROP.

Definition at line 5060 of file GeometryCore.h.

5061  { GetEndID(id.asTPCsetID()); id.ROP = 0; }
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
geo::PlaneID geo::GeometryCore::GetEndPlaneID ( geo::CryostatID const &  id) const
inline

Returns the (possibly invalid) ID after the last plane of the specified cryostat.

Definition at line 2994 of file GeometryCore.h.

2995  { return { GetEndTPCID(id), 0 }; }
geo::TPCID GetEndTPCID(geo::CryostatID const &id) const
geo::PlaneID geo::GeometryCore::GetEndPlaneID ( geo::TPCID const &  id) const
inline

Returns the (possibly invalid) ID after the last plane of the specified TPC.

Definition at line 3003 of file GeometryCore.h.

3004  { return { GetNextID(id), 0 }; }
GeoID GetNextID(GeoID const &id) const
Returns the ID next to the specified one.
readout::ROPID geo::GeometryCore::GetEndROPID ( geo::CryostatID const &  id) const
inline

Returns the (possibly invalid) ID after the last readout plane of the specified cryostat.

Definition at line 5073 of file GeometryCore.h.

5074  { return { GetEndTPCsetID(id), 0 }; }
readout::TPCsetID GetEndTPCsetID(geo::CryostatID const &id) const
readout::ROPID geo::GeometryCore::GetEndROPID ( readout::TPCsetID const &  id) const
inline

Returns the (possibly invalid) ID after the last readout plane of the specified TPC set.

Definition at line 5082 of file GeometryCore.h.

5083  { return { GetNextID(id), 0 }; }
GeoID GetNextID(GeoID const &id) const
Returns the ID next to the specified one.
geo::TPCID geo::GeometryCore::GetEndTPCID ( geo::CryostatID const &  id) const
inline

Returns the (possibly invalid) ID after the last TPC of the specified cryostat.

Definition at line 2511 of file GeometryCore.h.

References geo::CryostatID::Cryostat.

2512  { return { id.Cryostat + 1, 0 }; }
readout::TPCsetID geo::GeometryCore::GetEndTPCsetID ( geo::CryostatID const &  id) const
inline

Returns the (possibly invalid) ID after the last TPC set of the specified cryostat.

Definition at line 4844 of file GeometryCore.h.

References geo::CryostatID::Cryostat.

4845  { return { id.Cryostat + 1, 0 }; }
geo::WireID geo::GeometryCore::GetEndWireID ( geo::CryostatID const &  id) const
inline

Returns the (possibly invalid) ID after the last wire in the specified cryostat.

Definition at line 3400 of file GeometryCore.h.

3401  { return { GetEndPlaneID(id), 0 }; }
geo::PlaneID GetEndPlaneID(geo::CryostatID const &id) const
geo::WireID geo::GeometryCore::GetEndWireID ( geo::TPCID const &  id) const
inline

Returns the (possibly invalid) ID after the last wire of the specified TPC.

Definition at line 3409 of file GeometryCore.h.

3410  { return { geo::PlaneID(GetNextID(id), 0), 0 }; }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
GeoID GetNextID(GeoID const &id) const
Returns the ID next to the specified one.
geo::WireID geo::GeometryCore::GetEndWireID ( geo::PlaneID const &  id) const
inline

Returns the (possibly invalid) ID after the last wire of the specified wire plane.

Definition at line 3418 of file GeometryCore.h.

3419  { return { GetNextID(id), 0 }; }
GeoID GetNextID(GeoID const &id) const
Returns the ID next to the specified one.
std::string geo::GeometryCore::GetLArTPCVolumeName ( geo::TPCID const &  tpcid) const

Return the name of specified LAr TPC volume.

Parameters
tpcidID of the TPC
tpcindex of TPC in the cryostat
cstatindex of the cryostat
Returns
the name of the specified TPC

This information is used by Geant4 simulation

Todo:

Use a TPCID instead

What if it does not exist?

Definition at line 699 of file GeometryCore.cxx.

References TPC().

Referenced by LArStackingAction::ClassifyNewTrack(), trkf::SpacePts::produce(), trkf::Track3Dreco::produce(), vertex::VertexFinder2D::produce(), trkf::Track3DKalman::produce(), and trkf::Track3DKalmanSPS::produce().

700  {
701  return std::string(TPC(tpcid).ActiveVolume()->GetName());
702  }
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
std::string geo::GeometryCore::GetLArTPCVolumeName ( unsigned int const  tpc = 0,
unsigned int const  cstat = 0 
) const
inline

Return the name of specified LAr TPC volume.

Parameters
tpcidID of the TPC
tpcindex of TPC in the cryostat
cstatindex of the cryostat
Returns
the name of the specified TPC

This information is used by Geant4 simulation

Todo:

Use a TPCID instead

What if it does not exist?

Definition at line 2775 of file GeometryCore.h.

2776  { return GetLArTPCVolumeName(geo::TPCID(cstat, tpc)); }
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
std::string GetLArTPCVolumeName(geo::TPCID const &tpcid) const
Return the name of specified LAr TPC volume.
template<typename GeoID >
GeoID geo::GeometryCore::GetNextID ( GeoID const &  id) const
inline

Returns the ID next to the specified one.

Template Parameters
GeoIDtype of the ID to be returned
Parameters
idthe element ID to be incremented
Returns
ID of the next subelement after id

Definition at line 1912 of file GeometryCore.h.

1913  { auto nextID(id); IncrementID(nextID); return nextID; }
bool IncrementID(geo::CryostatID &id) const
template<typename Point = DefaultPoint_t>
Point geo::GeometryCore::GetTPCFrontFaceCenter ( geo::TPCID const &  tpcid) const
inline

Returns the center of side of the detector facing the beam.

Parameters
tpcidID of the TPC
tpctpc number within the cryostat
cstatnumber of cryostat
Returns
the position of center of TPC face toward the beam

Effectively, this is the center of the side of TPC active volume which faces the negative z direction, the first that a beam following

Definition at line 2747 of file GeometryCore.h.

2748  { return TPC(tpcid).GetFrontFaceCenter<Point>(); }
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:34
Point GetFrontFaceCenter() const
Returns the center of the active TPC volume side facing negative z.
Definition: TPCGeo.h:258
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
template<typename Point = DefaultPoint_t>
Point geo::GeometryCore::GetTPCFrontFaceCenter ( unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const
inline

Returns the center of side of the detector facing the beam.

Parameters
tpcidID of the TPC
tpctpc number within the cryostat
cstatnumber of cryostat
Returns
the position of center of TPC face toward the beam

Effectively, this is the center of the side of TPC active volume which faces the negative z direction, the first that a beam following

Definition at line 2751 of file GeometryCore.h.

2752  { return GetTPCFrontFaceCenter<Point>(geo::TPCID(cstat, tpc)); }
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
const std::string geo::GeometryCore::GetWorldVolumeName ( ) const

Return the name of the world volume (needed by Geant4 simulation)

Definition at line 578 of file GeometryCore.cxx.

References DetectorEnclosureBox().

Referenced by evgen::CosmicsGen::reconfigure(), WorldBox(), and WorldVolume().

579  {
580  // For now, and possibly forever, this is a constant (given the
581  // definition of "nodeNames" above).
582  return std::string("volWorld");
583  }
unsigned int geo::GeometryCore::HardwareChannelFromOpChannel ( int  opChannel) const

Convert unique channel to hardware channel.

Definition at line 242 of file GeometryCore.cxx.

References fChannelMapAlg.

243  {
244  return fChannelMapAlg->HardwareChannelFromOpChannel(opChannel);
245  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
bool geo::GeometryCore::HasChannel ( raw::ChannelID_t  channel) const

Returns whether the specified channel exists and is valid.

Parameters
channelthe ID of the channel
Returns
whether the specified channel exists

A channel is defined as existing and valid if its ID is not invalid and if the channel is physical.

Definition at line 566 of file GeometryCore.cxx.

References fChannelMapAlg.

566  {
567  return fChannelMapAlg->HasChannel(channel);
568  } // GeometryCore::HasChannel()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
bool geo::GeometryCore::HasCryostat ( geo::CryostatID const &  cryoid) const
inline

Returns whether we have the specified cryostat.

The HasElement() method is overloaded and its meaning depends on the type of ID.

Definition at line 1981 of file GeometryCore.h.

References geo::CryostatID::Cryostat.

1982  { return cryoid.Cryostat < Ncryostats(); }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
bool geo::GeometryCore::HasElement ( geo::CryostatID const &  cryoid) const
inline

Returns whether we have the specified cryostat.

The HasElement() method is overloaded and its meaning depends on the type of ID.

Definition at line 1983 of file GeometryCore.h.

1984  { return HasCryostat(cryoid); }
bool HasCryostat(geo::CryostatID const &cryoid) const
Returns whether we have the specified cryostat.
bool geo::GeometryCore::HasElement ( geo::TPCID const &  tpcid) const
inline

Returns whether we have the specified TPC.

Definition at line 2374 of file GeometryCore.h.

2374 { return HasTPC(tpcid); }
bool HasTPC(geo::TPCID const &tpcid) const
Returns whether we have the specified TPC.
bool geo::GeometryCore::HasElement ( geo::PlaneID const &  planeid) const
inline

Returns whether we have the specified plane.

The HasElement() method is overloaded and its meaning depends on the type of ID.

Definition at line 2923 of file GeometryCore.h.

2924  { return HasPlane(planeid); }
bool HasPlane(geo::PlaneID const &planeid) const
Returns whether we have the specified plane.
bool geo::GeometryCore::HasElement ( geo::WireID const &  wireid) const
inline

Returns whether we have the specified wire.

The HasElement() method is overloaded and its meaning depends on the type of ID.

Definition at line 3339 of file GeometryCore.h.

3339 { return HasWire(wireid); }
bool HasWire(geo::WireID const &wireid) const
Returns whether we have the specified wire.
bool geo::GeometryCore::HasElement ( readout::TPCsetID const &  tpcsetid) const
inline

Returns whether we have the specified TPC set.

Definition at line 4791 of file GeometryCore.h.

4792  { return HasTPCset(tpcsetid); }
bool HasTPCset(readout::TPCsetID const &tpcsetid) const
bool geo::GeometryCore::HasElement ( readout::ROPID const &  ropid) const
inline

Returns whether we have the specified readout plane

Returns
whether the readout plane is valid and exists

Definition at line 4995 of file GeometryCore.h.

4995 { return HasROP(ropid); }
bool HasROP(readout::ROPID const &ropid) const
bool geo::GeometryCore::HasPlane ( geo::PlaneID const &  planeid) const
inline

Returns whether we have the specified plane.

The HasElement() method is overloaded and its meaning depends on the type of ID.

Definition at line 2918 of file GeometryCore.h.

References geo::TPCGeo::HasPlane().

2919  {
2920  geo::TPCGeo const* pTPC = TPCPtr(planeid);
2921  return pTPC? pTPC->HasPlane(planeid): false;
2922  }
bool HasPlane(unsigned int iplane) const
Returns whether a plane with index iplane is present in this TPC.
Definition: TPCGeo.h:155
Geometry information for a single TPC.
Definition: TPCGeo.h:37
TPCGeo const * TPCPtr(geo::TPCID const &tpcid) const
Returns the specified TPC.
bool geo::GeometryCore::HasROP ( readout::ROPID const &  ropid) const

Returns whether we have the specified readout plane

Returns
whether the readout plane is valid and exists

Definition at line 1820 of file GeometryCore.cxx.

References fChannelMapAlg.

1820  {
1821  return fChannelMapAlg->HasROP(ropid);
1822  } // GeometryCore::HasROP()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
bool geo::GeometryCore::HasTPC ( geo::TPCID const &  tpcid) const
inline

Returns whether we have the specified TPC.

Definition at line 2367 of file GeometryCore.h.

References geo::CryostatGeo::HasTPC().

Referenced by pma::ProjectionMatchingAlg::buildShowerSeg(), ems::MultiEMShowers::convCluster(), and evd::TWQProjectionView::SelectTPC().

2368  {
2369  CryostatGeo const* pCryo = CryostatPtr(tpcid);
2370  return pCryo? pCryo->HasTPC(tpcid): false;
2371  }
CryostatGeo const * CryostatPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
bool geo::GeometryCore::HasTPCset ( readout::TPCsetID const &  tpcsetid) const

Returns whether we have the specified TPC set

Returns
whether the TPC set is valid and exists

Definition at line 1776 of file GeometryCore.cxx.

References fChannelMapAlg, and FindTPCsetAtPosition().

1776  {
1777  return fChannelMapAlg->HasTPCset(tpcsetid);
1778  } // GeometryCore::HasTPCset()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
bool geo::GeometryCore::HasWire ( geo::WireID const &  wireid) const
inline

Returns whether we have the specified wire.

The HasElement() method is overloaded and its meaning depends on the type of ID.

Definition at line 3334 of file GeometryCore.h.

References geo::PlaneGeo::HasWire().

Referenced by tca::FillmAllTraj(), tca::Find3DVertices(), pma::ProjectionMatchingAlg::validate(), pma::ProjectionMatchingAlg::validate_on_adc(), pma::ProjectionMatchingAlg::validate_on_adc_test(), and WireIDIntersectionCheck().

3335  {
3336  geo::PlaneGeo const* pPlane = PlanePtr(wireid);
3337  return pPlane? pPlane->HasWire(wireid): false;
3338  }
PlaneGeo const * PlanePtr(geo::PlaneID const &planeid) const
Returns the specified plane.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
bool HasWire(unsigned int iwire) const
Returns whether a wire with index iwire is present in this plane.
Definition: PlaneGeo.h:260
bool geo::GeometryCore::IncrementID ( geo::CryostatID id) const
inline

Sets the ID to the ID after the specified one.

Returns
whether the ID is actually valid (validity flag is also set)

Definition at line 5475 of file GeometryCore.h.

5475  {
5476  ++id.Cryostat;
5477  if (id) id.isValid = HasCryostat(id); // if invalid already, it stays so
5478  return bool(id);
5479 } // geo::GeometryCore::IncrementID(geo::CryostatID)
bool HasCryostat(geo::CryostatID const &cryoid) const
Returns whether we have the specified cryostat.
bool geo::GeometryCore::IncrementID ( geo::TPCID id) const
inline

Sets the ID to the ID after the specified one.

Returns
whether the ID is actually valid (validity flag is also set)

Definition at line 5481 of file GeometryCore.h.

5481  {
5482  unsigned int const nTPCsInCryo = NTPC(id);
5483  if (++id.TPC < nTPCsInCryo) return bool(id); // if was invalid, it stays so
5484  // no more TPCs in this cryostat
5485  id.TPC = 0;
5486  return IncrementID(id.asCryostatID()); // also sets validity
5487 } // geo::GeometryCore::IncrementID(geo::TPCID)
bool IncrementID(geo::CryostatID &id) const
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
bool geo::GeometryCore::IncrementID ( geo::PlaneID id) const
inline

Sets the ID to the ID after the specified one.

Returns
whether the ID is actually valid (validity flag is also set)

Definition at line 5489 of file GeometryCore.h.

5489  {
5490  // this implementation is non-optimal, in that the cryostat lookup is
5491  // performed both here and, potentially, in IncrementID(TPCID)
5492  unsigned int const nPlanesInTPC = Nplanes(id);
5493  if (++id.Plane < nPlanesInTPC) return bool(id); // if was invalid, stays so
5494  // no more planes in this TPCs
5495  id.Plane = 0;
5496  return IncrementID(id.asTPCID()); // also sets validity
5497 } // geo::GeometryCore::IncrementID(geo::PlaneID)
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
bool IncrementID(geo::CryostatID &id) const
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
bool geo::GeometryCore::IncrementID ( geo::WireID id) const
inline

Sets the ID to the ID after the specified one.

Returns
whether the ID is actually valid (validity flag is also set)

Definition at line 5499 of file GeometryCore.h.

5499  {
5500  // this implementation is non-optimal, in that the TPC lookup is
5501  // performed both here and, potentially, in IncrementID(PlaneID)
5502  unsigned int const nWiresInPlane = Nwires(id);
5503  if (++id.Wire < nWiresInPlane) return bool(id); // if was invalid, stays so
5504  // no more wires in this plane
5505  id.Wire = 0;
5506  return IncrementID(id.asPlaneID()); // also sets validity
5507 } // geo::GeometryCore::IncrementID(geo::WireID)
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.
bool IncrementID(geo::CryostatID &id) const
WireGeo const & Wire(geo::WireID const &wireid) const
Returns the specified wire.
bool geo::GeometryCore::IncrementID ( readout::TPCsetID id) const
inline

Sets the ID to the ID after the specified one.

Returns
whether the ID is actually valid (validity flag is also set)

Definition at line 5509 of file GeometryCore.h.

5509  {
5510  unsigned int const nTPCsetsInCryo = NTPCsets(id);
5511  if (++id.TPCset < nTPCsetsInCryo)
5512  return bool(id); // if was invalid, it stays so
5513  // no more TPC sets in this cryostat
5514  id.TPCset = 0;
5515  return IncrementID(id.asCryostatID()); // also sets validity
5516 } // geo::GeometryCore::IncrementID(readout::TPCsetID)
unsigned int NTPCsets(readout::CryostatID const &cryoid) const
Returns the total number of TPC sets in the specified cryostat.
bool IncrementID(geo::CryostatID &id) const
bool geo::GeometryCore::IncrementID ( readout::ROPID id) const
inline

Sets the ID to the ID after the specified one.

Returns
whether the ID is actually valid (validity flag is also set)

Definition at line 5518 of file GeometryCore.h.

References WireEndPoints().

5518  {
5519  // this implementation is non-optimal, in that the cryostat lookup is
5520  // performed both here and, potentially, in IncrementID(TPCsetID)
5521  unsigned int const nROPinTPC = NROPs(id);
5522  if (++id.ROP < nROPinTPC) return bool(id); // if was invalid, stays so
5523  // no more readout planes in this TPC set
5524  id.ROP = 0;
5525  return IncrementID(id.asTPCsetID()); // also sets validity
5526 } // geo::GeometryCore::IncrementID(readout::ROPID)
bool IncrementID(geo::CryostatID &id) const
unsigned int NROPs(readout::TPCsetID const &tpcsetid) const
Returns the total number of ROP in the specified TPC set.
bool geo::GeometryCore::IntersectionPoint ( geo::WireID const &  wid1,
geo::WireID const &  wid2,
double &  y,
double &  z 
) const

Returns the intersection point of two wires.

Parameters
wid1ID of the first wire
wid2ID of the other wire
y(output) y coordinate of the intersection point
z(output) z coordinate of the intersection point
Returns
whether an intersection was found within the TPC
See also
WireIDsIntersect()

The behaviour of this method reflects the one of WireIDsIntersect(), which supersedes this one.

To test if the result is infinity, use e.g. std::isfinite(y).

Deprecated:
This method uses arbitrary assumptions and should not be used. Use WireIDsIntersect() returning a vector, instead.

Definition at line 1749 of file GeometryCore.cxx.

References WireIDsIntersect(), geo::WireIDIntersection::y, and geo::WireIDIntersection::z.

Referenced by pma::ProjectionMatchingAlg::addEndpointRef(), sppt::SpacePointAlg_TimeSort::fillCoordinatesArrays(), filter::MuonFilter::filter(), tca::Find3DVertices(), cmtool::CFAlgoStartPointCompat::Float(), cmtool::CFAlgoStartPointMatch::Float(), vertex::FeatureVertexFinder::Get3dVertexCandidates(), trkf::BezierTrackerAlgorithm::MakeTracks(), cluster::ClusterMatchAlg::Match_RoughZ(), and trkf::TrackTrajectoryAlg::ShortTrackTrajectory().

1752  {
1753  geo::WireIDIntersection widIntersect;
1754  bool const found = WireIDsIntersect(wid1, wid2, widIntersect);
1755  y = widIntersect.y;
1756  z = widIntersect.z;
1757  return found;
1758  }
double z
z position of intersection
Definition: geo_types.h:494
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
bool WireIDsIntersect(WireID const &wid1, WireID const &wid2, geo::Point_t &intersection) const
Computes the intersection between two wires.
double y
y position of intersection
Definition: geo_types.h:493
bool geo::GeometryCore::IntersectionPoint ( unsigned int  wire1,
unsigned int  wire2,
unsigned int  plane1,
unsigned int  plane2,
unsigned int  cstat,
unsigned int  tpc,
double &  y,
double &  z 
) const
inline

Returns the intersection point of two wires.

Parameters
wire1wire index of the first wire
wire2wire index of the other wire
plane1plane index of the first wire
plane2plane index of the other wire
cstatcryostat number
tpctpc number within the cryostat where the planes belong
y(output) y coordinate of the intersection point
z(output) z coordinate of the intersection point
Returns
whether an intersection was found

No check is performed, not any information provided, about the validity of the result.

Deprecated:
This method uses arbitrary assumptions and should not be used. Use WireIDsIntersect() returning a vector, instead.

Definition at line 4188 of file GeometryCore.h.

4196  {
4197  return IntersectionPoint(
4198  geo::WireID(cstat, tpc, plane1, wire1),
4199  geo::WireID(cstat, tpc, plane2, wire2),
4200  y, z
4201  );
4202  }
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
bool IntersectionPoint(geo::WireID const &wid1, geo::WireID const &wid2, double &y, double &z) const
Returns the intersection point of two wires.
bool geo::GeometryCore::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.

Parameters
A_start_xx coordinate of one point of the first segment
A_start_yy coordinate of one point of the first segment
A_end_xx coordinate of another point of the first segment
A_end_yy coordinate of another point of the first segment
B_start_xx coordinate of one point of the second segment
B_start_yy coordinate of one point of the second segment
B_end_xx coordinate of another point of the second segment
B_end_yy coordinate of another point of the second segment
x_(output)_ variable to store the x coordinate of intersection
y_(output)_ variable to store the y coordinate of intersection
Returns
whether intersection exists

The order of the ends is not relevant. The return value is false if the two segments are parallel. In that case, x and y variables are not changed. Otherwise, they hold the intersection coordinate, even if the intersection point is beyond one or both the segments.

Definition at line 1384 of file GeometryCore.cxx.

References B, coordIs, and lar::util::RealComparisons< RealType >::zero().

Referenced by IntersectSegments().

1388  {
1389 
1390  // Equation from http://en.wikipedia.org/wiki/Line%E2%80%93line_intersection
1391  // T.Yang Nov, 2014
1392  // Notation: x => coordinate orthogonal to the drift direction and to the beam direction
1393  // y => direction orthogonal to the previous and to beam direction
1394 
1395  double const denom = (A_start_x - A_end_x)*(B_start_y - B_end_y)
1396  - (A_start_y - A_end_y)*(B_start_x - B_end_x);
1397 
1398  if (coordIs.zero(denom)) return false;
1399 
1400  double const A = (A_start_x * A_end_y - A_start_y * A_end_x) / denom;
1401  double const B = (B_start_x * B_end_y - B_start_y * B_end_x) / denom;
1402 
1403  x = (B_start_x - B_end_x) * A - (A_start_x - A_end_x) * B;
1404  y = (B_start_y - B_end_y) * A - (A_start_y - A_end_y) * B;
1405 
1406  return true;
1407 
1408  } // GeometryCore::IntersectLines()
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Int_t B
Definition: plot.C:25
constexpr bool zero(Value_t value) const
Returns whether the value is no farther from 0 than the threshold.
static lar::util::RealComparisons< geo::Length_t > coordIs
Value of tolerance for equality comparisons.
bool geo::GeometryCore::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.

Parameters
A_start_xx coordinate of the start of the first segment
A_start_yy coordinate of the start of the first segment
A_end_xx coordinate of the end of the first segment
A_end_yy coordinate of the end of the first segment
B_start_xx coordinate of the start of the second segment
B_start_yy coordinate of the start of the second segment
B_end_xx coordinate of the end of the second segment
B_end_yy coordinate of the end of the second segment
x_(output)_ variable to store the x coordinate of intersection
y_(output)_ variable to store the y coordinate of intersection
Returns
whether intersection exists and is on both segments

The order of the ends is not relevant. The return value is false if the two segments are parallel, or if their intersection point is not on both the segments. If the segments are parallel, x and y variables are not changed. Otherwise, they hold the intersection coordinate, even if the intersection point is beyond one or both the segments.

Definition at line 1411 of file GeometryCore.cxx.

References c1, c2, geo::vect::cross(), geo::WireGeo::Direction(), geo::vect::dot(), geo::GeometryCore::Segment< Point >::end(), geo::WireGeo::GetCenter(), geo::WireGeo::HalfL(), IntersectLines(), geo::TPCID::InvalidID, PointWithinSegments(), geo::sqr(), geo::GeometryCore::Segment< Point >::start(), ThirdPlane(), geo::vect::toTVector3(), geo::TPCID::TPC, geo::WireIDIntersection::TPC, Wire(), WireEndPoints(), WireIDIntersectionCheck(), WireIDsIntersect(), geo::WireIDIntersection::y, and geo::WireIDIntersection::z.

1415  {
1416 
1417  bool bCross = IntersectLines(
1418  A_start_x, A_start_y, A_end_x, A_end_y,
1419  B_start_x, B_start_y, B_end_x, B_end_y,
1420  x, y
1421  );
1422 
1423  if (bCross) {
1424  mf::LogWarning("IntersectSegments") << "The segments are parallel!";
1425  return false;
1426  }
1427 
1428  return PointWithinSegments(
1429  A_start_x, A_start_y, A_end_x, A_end_y,
1430  B_start_x, B_start_y, B_end_x, B_end_y,
1431  x, y
1432  );
1433 
1434  } // GeometryCore::IntersectSegments()
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
static bool PointWithinSegments(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)
Returns whether x and y are within both specified ranges (A and B).
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.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
bool geo::GeometryCore::IsValidOpChannel ( int  opChannel) const

Is this a valid OpChannel number?

Definition at line 249 of file GeometryCore.cxx.

References fChannelMapAlg, and NOpDets().

Referenced by cosmic::BeamFlashTrackMatchTaggerAlg::CheckCompatibility(), cosmic::BeamFlashTrackMatchTaggerAlg::PrintHypothesisFlashComparison(), lariov::SIOVPmtGainProvider::Reconfigure(), and opdet::RunHitFinder().

250  {
251  return fChannelMapAlg->IsValidOpChannel(opChannel, this->NOpDets());
252  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int NOpDets() const
Number of OpDets in the whole detector.
IteratorBox< cryostat_id_iterator, &GeometryCore::begin_cryostat_id, &GeometryCore::end_cryostat_id > geo::GeometryCore::IterateCryostatIDs ( ) const
inline

Enables ranged-for loops on all cryostat IDs of the detector.

Returns
an object suitable for ranged-for loops on all cryostat IDs

Example of usage:

for (geo::CryostatID const& cID: geom->IterateCryostatIDs()) {
  geo::CryostatGeo const& Cryo = geom->Cryostat(cID);

  // useful code here

} // for all cryostats

Definition at line 2149 of file GeometryCore.h.

References begin_cryostat(), and end_cryostat().

2149 { return { this }; }
IteratorBox< cryostat_iterator, &GeometryCore::begin_cryostat, &GeometryCore::end_cryostat > geo::GeometryCore::IterateCryostats ( ) const
inline

Enables ranged-for loops on all cryostats of the detector.

Returns
an object suitable for ranged-for loops on all cryostats

Example of usage:

for (geo::CryostatGeo const& Cryo: geom->IterateCryostats()) {

  // useful code here

} // for all cryostats

Definition at line 2168 of file GeometryCore.h.

Referenced by PositionToCryostatPtr().

2168 { return { this }; }
IteratorBox< plane_id_iterator, &GeometryCore::begin_plane_id, &GeometryCore::end_plane_id > geo::GeometryCore::IteratePlaneIDs ( ) const
inline

Enables ranged-for loops on all plane IDs of the detector.

Returns
an object suitable for ranged-for loops on all plane IDs

Example of usage:

for (geo::PlaneID const& pID: geom->IteratePlaneIDs()) {
geo::PlaneGeo const& Plane = geom->Plane(pID);
// useful code here
} // for all plane IDs

Definition at line 3078 of file GeometryCore.h.

References begin_plane_id(), and end_plane_id().

Referenced by vertex::FeatureVertexFinderAna::analyze(), corner::CornerFinderAlg::create_smaller_histos(), sim::details::createPlaneIndexMap(), corner::CornerFinderAlg::get_feature_points(), corner::CornerFinderAlg::get_feature_points_LineIntegralScore(), cluster::DBScan3DAlg::init(), vertex::VertexMatch::produce(), and vertex::HarrisVertexFinder::produce().

3078 { return { this }; }
LocalIteratorBox< plane_id_iterator, geo::CryostatID, &GeometryCore::begin_plane_id, &GeometryCore::end_plane_id > geo::GeometryCore::IteratePlaneIDs ( geo::CryostatID const &  cid) const
inline

Enables ranged-for loops on all plane IDs of the specified cryostat.

Parameters
cidthe ID of the cryostat to loop the plane IDs of
Returns
an object suitable for ranged-for loops on plane IDs

If the cryostat ID is invalid, the effect is undefined.

Example of usage:

geo::CryostatID cid{1}; // cryostat #1 (hope it exists!)
for (geo::PlaneID const& pID: geom->IteratePlaneIDs(cid)) {
geo::PlaneGeo const& plane = geom->Plane(pID);
// useful code here
} // for all planes in cryostat #1

Definition at line 3103 of file GeometryCore.h.

References begin_plane_id(), and end_plane_id().

3103 { return { this, cid }; }
LocalIteratorBox< plane_id_iterator, geo::TPCID, &GeometryCore::begin_plane_id, &GeometryCore::end_plane_id > geo::GeometryCore::IteratePlaneIDs ( geo::TPCID const &  tid) const
inline

Enables ranged-for loops on all plane IDs of the specified TPC.

Parameters
tidthe ID of the TPC to loop the plane IDs of
Returns
an object suitable for ranged-for loops on plane IDs

If the TPC ID is invalid, the effect is undefined.

Example of usage:

geo::TPCID tid{ 0, 1 }; // C:0 T:1 (hope it exists!)
for (geo::PlaneID const& pID: geom->IteratePlaneIDs(tid)) {
geo::PlaneGeo const& plane = geom->Plane(pID);
// useful code here
} // for all planes in C:0 T:1

Definition at line 3127 of file GeometryCore.h.

References begin_plane(), and end_plane().

3127 { return { this, tid }; }
void geo::GeometryCore::IteratePlaneIDs ( geo::PlaneID const &  pid) const
delete

IteratePlaneIDs() is not supported on plane IDs.

void geo::GeometryCore::IteratePlaneIDs ( geo::WireID const &  pid) const
delete

IteratePlaneIDs() is not supported on wire IDs.

void geo::GeometryCore::IteratePlaneIDs ( readout::TPCsetID const &  ) const
delete

IteratePlaneIDs() is not supported on readout IDs.

void geo::GeometryCore::IteratePlaneIDs ( readout::ROPID const &  ) const
delete

IteratePlaneIDs() is not supported on readout IDs.

IteratorBox< plane_iterator, &GeometryCore::begin_plane, &GeometryCore::end_plane > geo::GeometryCore::IteratePlanes ( ) const
inline

Enables ranged-for loops on all planes of the detector.

Returns
an object suitable for ranged-for loops on all planes

Example of usage:

for (geo::PlaneGeo const& Plane: geom->IteratePlanes()) {
// useful code here
} // for all planes

Definition at line 3160 of file GeometryCore.h.

References begin_plane(), and end_plane().

Referenced by mvapid::MVAAlg::GetWireNormals().

3160 { return { this }; }
LocalIteratorBox< plane_iterator, geo::CryostatID, &GeometryCore::begin_plane, &GeometryCore::end_plane > geo::GeometryCore::IteratePlanes ( geo::CryostatID const &  cid) const
inline

Enables ranged-for loops on all planes of the specified cryostat.

Parameters
cidthe ID of the cryostat to loop the planes of
Returns
an object suitable for ranged-for loops on planes

If the cryostat ID is invalid, the effect is undefined.

Example of usage:

geo::CryostatID cid{1}; // cryostat #1 (hope it exists!)
for (geo::PlaneGeo const& plane: geom->IteratePlanes(cid)) {
// useful code here
} // for planes in cryostat 1

Definition at line 3183 of file GeometryCore.h.

References begin_plane(), and end_plane().

3183 { return { this, cid }; }
LocalIteratorBox< plane_iterator, geo::TPCID, &GeometryCore::begin_plane, &GeometryCore::end_plane > geo::GeometryCore::IteratePlanes ( geo::TPCID const &  tid) const
inline

Enables ranged-for loops on all planes of the specified TPC.

Parameters
tidthe ID of the TPC to loop the planes of
Returns
an object suitable for ranged-for loops on planes

If the TPC ID is invalid, the effect is undefined.

Example of usage:

geo::TPCID tid{ 0, 1 }; // C:0 T:1 (hope it exists!)
for (geo::PlaneGeo const& plane: geom->IteratePlanes(tid)) {
// useful code here
} // for planes in C:0 T:1

Definition at line 3206 of file GeometryCore.h.

3206 { return { this, tid }; }
void geo::GeometryCore::IteratePlanes ( geo::PlaneID const &  pid) const
delete

IteratePlanes() is not supported on plane IDs.

void geo::GeometryCore::IteratePlanes ( geo::WireID const &  pid) const
delete

IteratePlanes() is not supported on wire IDs.

void geo::GeometryCore::IteratePlanes ( readout::TPCsetID const &  ) const
delete

IteratePlanes() is not supported on readout IDs.

void geo::GeometryCore::IteratePlanes ( readout::ROPID const &  ) const
delete

IteratePlanes() is not supported on readout IDs.

IteratorBox< ROP_id_iterator, &GeometryCore::begin_ROP_id, &GeometryCore::end_ROP_id > geo::GeometryCore::IterateROPIDs ( ) const
inline

Enables ranged-for loops on all readout plane IDs of the detector.

Returns
an object suitable for ranged-for loops on all ROP IDs

Example of usage:

for (readout::ROPID const& rID: geom->IterateROPIDs()) {
// useful code here
} // for all ROPs

Definition at line 5131 of file GeometryCore.h.

References begin_ROP_id(), and end_ROP_id().

5131 { return { this }; }
LocalIteratorBox< ROP_id_iterator, geo::CryostatID, &GeometryCore::begin_ROP_id, &GeometryCore::end_ROP_id > geo::GeometryCore::IterateROPIDs ( geo::CryostatID const &  cid) const
inline

Enables ranged-for loops on all readout plane IDs of the specified cryostat.

Parameters
cidthe ID of the cryostat to loop the readout plane IDs of
Returns
an object suitable for ranged-for loops on readout plane IDs

If the cryostat ID is invalid, the effect is undefined.

Example of usage:

geo::CryostatID cid{1}; // cryostat #1 (hope it exists!)
for (readout::ROPID const& rID: geom->IterateROPIDs(cid)) {
// useful code here
} // for all readout planes in cryostat #1

Definition at line 5155 of file GeometryCore.h.

References begin_ROP_id(), and end_ROP_id().

5155 { return { this, cid }; }
LocalIteratorBox< ROP_id_iterator, readout::TPCsetID, &GeometryCore::begin_ROP_id, &GeometryCore::end_ROP_id > geo::GeometryCore::IterateROPIDs ( readout::TPCsetID const &  sid) const
inline

Enables ranged-for loops on all readout plane IDs of the specified TPC set.

Parameters
sidthe ID of the TPC set to loop the readout plane IDs of
Returns
an object suitable for ranged-for loops on readout plane IDs

If the TPC set ID is invalid, the effect is undefined.

Example of usage:

readout::TPCsetID sid{ 0, 1 }; // C:0 S:1 (hope it exists!)
for (readout::ROPID const& rID: geom->IterateROPIDs(sid)) {
// useful code here
} // for all readout planes in C:0 S:1

Definition at line 5179 of file GeometryCore.h.

References max, min, and fhicl::detail::atom::value().

5179 { return { this, sid }; }
IteratorBox< TPC_id_iterator, &GeometryCore::begin_TPC_id, &GeometryCore::end_TPC_id > geo::GeometryCore::IterateTPCIDs ( ) const
inline

Enables ranged-for loops on all TPC IDs of the detector.

Returns
an object suitable for ranged-for loops on all TPC IDs

Example of usage:

for (geo::TPCID const& tID: geom->IterateTPCIDs()) {
geo::TPCGeo const& TPC = geom->TPC(tID);
// useful code here
} // for all TPC

Definition at line 2567 of file GeometryCore.h.

References begin_TPC_id(), and end_TPC_id().

Referenced by tca::InsideTPC(), and tca::TruthMatcher::MatchAndSum().

2567 { return { this }; }
LocalIteratorBox< TPC_id_iterator, geo::CryostatID, &GeometryCore::begin_TPC_id, &GeometryCore::end_TPC_id > geo::GeometryCore::IterateTPCIDs ( geo::CryostatID const &  cid) const
inline

Enables ranged-for loops on all TPC IDs of the specified cryostat.

Parameters
cidthe ID of the cryostat to loop the TPC IDs of
Returns
an object suitable for ranged-for loops on TPC IDs

If the cryostat ID is invalid, the effect is undefined.

Example of usage:

geo::CryostatID cid{1}; // cryostat #1 (hope it exists!)
for (geo::TPCID const& tID: geom->IterateTPCIDs(cid)) {
geo::TPCGeo const& TPC = geom->TPC(tID);
// useful code here
} // for all TPC in cryostat #1

Definition at line 2591 of file GeometryCore.h.

References begin_TPC(), and end_TPC().

2591 { return { this, cid }; }
void geo::GeometryCore::IterateTPCIDs ( geo::TPCID const &  pid) const
delete

IterateTPCIDs() is not supported on TPC IDs.

void geo::GeometryCore::IterateTPCIDs ( geo::PlaneID const &  pid) const
delete

IterateTPCIDs() is not supported on plane IDs.

void geo::GeometryCore::IterateTPCIDs ( geo::WireID const &  pid) const
delete

IterateTPCIDs() is not supported on wire IDs.

void geo::GeometryCore::IterateTPCIDs ( readout::TPCsetID const &  ) const
delete

IterateTPCIDs() is not supported on readout IDs.

void geo::GeometryCore::IterateTPCIDs ( readout::ROPID const &  ) const
delete

IterateTPCIDs() is not supported on readout IDs.

IteratorBox<TPC_iterator, &GeometryCore::begin_TPC, &GeometryCore::end_TPC> geo::GeometryCore::IterateTPCs ( ) const
inline

Enables ranged-for loops on all TPCs of the detector.

Returns
an object suitable for ranged-for loops on all TPCs

If the cryostat ID is invalid, the effect is undefined.

Example of usage:

for (geo::TPCGeo const& TPC: geom->IterateTPCs()) {
// useful code here
} // for TPCs

Definition at line 2625 of file GeometryCore.h.

References begin_TPC(), and end_TPC().

Referenced by ems::MCinfo::Findtpcborders(), and UpdateAfterSorting().

2625 { return { this }; }
LocalIteratorBox< TPC_iterator, geo::CryostatID, &GeometryCore::begin_TPC, &GeometryCore::end_TPC > geo::GeometryCore::IterateTPCs ( geo::CryostatID const &  cid) const
inline

Enables ranged-for loops on all TPCs of the specified cryostat.

Parameters
cidthe ID of the cryostat to loop the TPCs of
Returns
an object suitable for ranged-for loops on TPCs

If the cryostat ID is invalid, the effect is undefined.

Example of usage:

geo::CryostatID cid{1}; // cryostat #1 (hope it exists!)
for (geo::TPCGeo const& TPC: geom->IterateTPCs(cid)) {
// useful code here
} // for TPCs in cryostat 1

Definition at line 2648 of file GeometryCore.h.

2648 { return { this, cid }; }
void geo::GeometryCore::IterateTPCs ( geo::TPCID const &  pid) const
delete

IterateTPCs() is not supported on TPC IDs.

void geo::GeometryCore::IterateTPCs ( geo::PlaneID const &  pid) const
delete

IterateTPCs() is not supported on plane IDs.

void geo::GeometryCore::IterateTPCs ( geo::WireID const &  pid) const
delete

IterateTPCs() is not supported on wire IDs.

void geo::GeometryCore::IterateTPCs ( readout::TPCsetID const &  ) const
delete

IterateTPCs() is not supported on readout IDs.

void geo::GeometryCore::IterateTPCs ( readout::ROPID const &  ) const
delete

IterateTPCs() is not supported on readout IDs.

IteratorBox< TPCset_id_iterator, &GeometryCore::begin_TPCset_id, &GeometryCore::end_TPCset_id > geo::GeometryCore::IterateTPCsetIDs ( ) const
inline

Enables ranged-for loops on all TPC set IDs of the detector.

Returns
an object suitable for ranged-for loops on all TPC set IDs

Example of usage:

for (readout::TPCsetID const& sID: geom->IterateTPCsetIDs()) {
// useful code here
} // for all TPC sets

Definition at line 4884 of file GeometryCore.h.

References begin_TPCset_id(), and end_TPCset_id().

4884 { return { this }; }
LocalIteratorBox< TPCset_id_iterator, geo::CryostatID, &GeometryCore::begin_TPCset_id, &GeometryCore::end_TPCset_id > geo::GeometryCore::IterateTPCsetIDs ( geo::CryostatID const &  cid) const
inline

Enables ranged-for loops on all TPC set IDs of the specified cryostat.

Parameters
cidthe ID of the cryostat to loop the TPC set IDs of
Returns
an object suitable for ranged-for loops on TPC set IDs

If the cryostat ID is invalid, the effect is undefined.

Example of usage:

geo::CryostatID cid{1}; // cryostat #1 (hope it exists!)
for (readout::TPCsetID const& tID: geom->IterateTPCsetIDs(cid)) {
// useful code here
} // for all TPC sets in cryostat #1

Definition at line 4908 of file GeometryCore.h.

4908 { return { this, cid }; }
IteratorBox< wire_id_iterator, &GeometryCore::begin_wire_id, &GeometryCore::end_wire_id > geo::GeometryCore::IterateWireIDs ( ) const
inline

Enables ranged-for loops on all wire IDs of the detector.

Returns
an object suitable for ranged-for loops on all wire IDs

Example of usage:

for (geo::WireID const& wID: geom->IterateWireIDs()) {
geo::WireGeo const& Wire = geom->Wire(wID);
// useful code here
} // for all wires

Definition at line 3505 of file GeometryCore.h.

References begin_wire_id(), and end_wire_id().

Referenced by cluster::DBScan3DAlg::init().

3505 { return { this }; }
LocalIteratorBox< wire_id_iterator, geo::CryostatID, &GeometryCore::begin_wire_id, &GeometryCore::end_wire_id > geo::GeometryCore::IterateWireIDs ( geo::CryostatID const &  cid) const
inline

Enables ranged-for loops on all wire IDs of specified cryostat.

Parameters
cidthe ID of the cryostat to loop the wires of
Returns
an object suitable for ranged-for loops on cryostat wire IDs

If the cryostat ID is invalid, the effect is undefined.

Example of usage:

geo::CryostatID cid{1}; // cryostat #1 (hope it exists!)
for (geo::WireID const& wID: geom->IterateWireIDs(cid)) {
geo::WireGeo const& Wire = geom->Wire(wID);
// useful code here
} // for all wires

Definition at line 3530 of file GeometryCore.h.

References begin_wire_id(), and end_wire_id().

3530 { return { this, cid }; }
LocalIteratorBox< wire_id_iterator, geo::TPCID, &GeometryCore::begin_wire_id, &GeometryCore::end_wire_id > geo::GeometryCore::IterateWireIDs ( geo::TPCID const &  tid) const
inline

Enables ranged-for loops on all wire IDs of specified TPC.

Parameters
tidthe ID of the TPC to loop the wires of
Returns
an object suitable for ranged-for loops on TPC wire IDs

If the TPC ID is invalid, the effect is undefined.

Example of usage:

geo::TPCID tid{0, 1}; // C:0 T:1 (hope it exists!)
for (geo::WireID const& wID: geom->IterateWireIDs(tid)) {
geo::WireGeo const& Wire = geom->Wire(wID);
// useful code here
} // for all wires in C:0 T:1

Definition at line 3555 of file GeometryCore.h.

References begin_wire_id(), and end_wire_id().

3555 { return { this, tid }; }
LocalIteratorBox< wire_id_iterator, geo::PlaneID, &GeometryCore::begin_wire_id, &GeometryCore::end_wire_id > geo::GeometryCore::IterateWireIDs ( geo::PlaneID const &  pid) const
inline

Enables ranged-for loops on all wire IDs of specified wire plane.

Parameters
pidthe ID of the wire plane to loop the wires of
Returns
an object suitable for ranged-for loops on plane wire IDs

If the wire plane ID is invalid, the effect is undefined.

Example of usage:

geo::PlaneID pid{0, 0, 1}; // C:0 T:0 P:1
for (geo::WireID const& wID: geom->IterateWireIDs(pid)) {
geo::WireGeo const& Wire = geom->Wire(wID);
// useful code here
} // for all wires in C:0 T:0 P:1

Definition at line 3580 of file GeometryCore.h.

References begin_wire(), and end_wire().

3580 { return { this, pid }; }
void geo::GeometryCore::IterateWireIDs ( geo::WireID const &  pid) const
delete

IterateWireIDs() is not supported on wire IDs.

void geo::GeometryCore::IterateWireIDs ( readout::TPCsetID const &  ) const
delete

IterateWireIDs() is not supported on readout IDs.

void geo::GeometryCore::IterateWireIDs ( readout::ROPID const &  ) const
delete

IterateWireIDs() is not supported on readout IDs.

IteratorBox< wire_iterator, &GeometryCore::begin_wire, &GeometryCore::end_wire > geo::GeometryCore::IterateWires ( ) const
inline

Enables ranged-for loops on all wires of the detector.

Returns
an object suitable for ranged-for loops on all wires

Example of usage:

for (geo::WireGeo const& Wire: geom->IterateWires()) {
// useful code here
} // for all wires

Definition at line 3609 of file GeometryCore.h.

References begin_wire(), and end_wire().

3609 { return { this }; }
LocalIteratorBox< wire_iterator, geo::CryostatID, &GeometryCore::begin_wire, &GeometryCore::end_wire > geo::GeometryCore::IterateWires ( geo::CryostatID const &  cid) const
inline

Enables ranged-for loops on all wires of specified cryostat.

Parameters
cidthe ID of the cryostat to loop the wires of
Returns
an object suitable for ranged-for loops on cryostat wires

If the cryostat ID is invalid, the effect is undefined.

Example of usage:

geo::CryostatID cid{1}; // cryostat #1 (hope it exists!)
for (geo::WireID const& Wire: geom->IterateWires(cid)) {
// useful code here
} // for all wires

Definition at line 3633 of file GeometryCore.h.

References begin_wire(), and end_wire().

3633 { return { this, cid }; }
LocalIteratorBox< wire_iterator, geo::TPCID, &GeometryCore::begin_wire, &GeometryCore::end_wire > geo::GeometryCore::IterateWires ( geo::TPCID const &  tid) const
inline

Enables ranged-for loops on all wires of specified TPC.

Parameters
tidthe ID of the TPC to loop the wires of
Returns
an object suitable for ranged-for loops on TPC wires

If the TPC ID is invalid, the effect is undefined.

Example of usage:

geo::TPCID tid{0, 1}; // C:0 T:1 (hope it exists!)
for (geo::WireID const& Wire: geom->IterateWires(tid)) {
// useful code here
} // for all wires in C:0 T:1

Definition at line 3657 of file GeometryCore.h.

References begin_wire(), and end_wire().

3657 { return { this, tid }; }
LocalIteratorBox< wire_iterator, geo::PlaneID, &GeometryCore::begin_wire, &GeometryCore::end_wire > geo::GeometryCore::IterateWires ( geo::PlaneID const &  tid) const
inline

Enables ranged-for loops on all wires of specified wire plane.

Parameters
pidthe ID of the wire plane to loop the wires of
Returns
an object suitable for ranged-for loops on plane wires

If the wire plane ID is invalid, the effect is undefined.

Example of usage:

geo::PlaneID pid{0, 1}; // C:0 T:0 P:1
for (geo::WireID const& Wire: geom->IterateWires(pid)) {
// useful code here
} // for all wires in C:0 T:0 T:1

Definition at line 3681 of file GeometryCore.h.

3681 { return { this, tid }; }
void geo::GeometryCore::IterateWires ( geo::WireID const &  pid) const
delete

IterateWires() is not supported on wire IDs.

void geo::GeometryCore::IterateWires ( readout::TPCsetID const &  ) const
delete

IterateWires() is not supported on readout IDs.

void geo::GeometryCore::IterateWires ( readout::ROPID const &  ) const
delete

IterateWires() is not supported on readout IDs.

void geo::GeometryCore::LoadGeometryFile ( std::string  gdmlfile,
std::string  rootfile,
bool  bForceReload = false 
)

Loads the geometry information from the specified files.

Parameters
gdmlfilepath to file to be used for Geant4 simulation
rootfilepath to file for internal geometry representation
bForceReloadreload even if there is already a valid geometry
See also
ApplyChannelMap()

Both paths must directly resolve to an available file, as no search is performed for them.

The gdmlfile parameter does not have to necessarily be in GDML format, as long as it's something supported by Geant4. This file is not used by the geometry, but its path is provided on request by the simulation modules (see LArSoft LArG4 module). The rootfile also does not need to be a ROOT file, but just anything that TGeoManager::Import() supports. This file is parsed immediately and the internal geometry representation is built out of it.

Note
After calling this method, the detector geometry information can be considered complete, but the geometry service provider is not fully initialized yet, since it's still necessary to provide or update the channel mapping.

Definition at line 92 of file GeometryCore.cxx.

References ClearGeometry(), fGDMLfile, FindAuxDet(), FindCryostat(), fROOTfile, and MaxWireDepthInGDML.

Referenced by geo::Geometry::LoadNewGeometry().

95  {
96 
97  if (gdmlfile.empty()) {
98  throw cet::exception("GeometryCore")
99  << "No GDML Geometry file specified!\n";
100  }
101 
102  if (rootfile.empty()) {
103  throw cet::exception("GeometryCore")
104  << "No ROOT Geometry file specified!\n";
105  }
106 
107  ClearGeometry();
108 
109  // Open the GDML file, and convert it into ROOT TGeoManager format.
110  // Then lock the gGeoManager to prevent future imports, for example
111  // in AuxDetGeometry
112  if( !gGeoManager || bForceReload ){
113  if (gGeoManager) TGeoManager::UnlockGeometry();
114  TGeoManager::Import(rootfile.c_str());
115  gGeoManager->LockGeometry();
116  }
117 
118  std::vector<const TGeoNode*> path(MaxWireDepthInGDML);
119  path[0] = gGeoManager->GetTopNode();
120  FindCryostat(path, 0);
121  FindAuxDet(path, 0);
122 
123  fGDMLfile = gdmlfile;
124  fROOTfile = rootfile;
125 
126  mf::LogInfo("GeometryCore") << "New detector geometry loaded from "
127  << "\n\t" << fROOTfile
128  << "\n\t" << fGDMLfile << "\n";
129 
130  } // GeometryCore::LoadGeometryFile()
void FindCryostat(std::vector< const TGeoNode * > &path, unsigned int depth)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
static constexpr std::size_t MaxWireDepthInGDML
void FindAuxDet(std::vector< const TGeoNode * > &path, unsigned int depth)
void ClearGeometry()
Deletes the detector geometry structures.
std::string fGDMLfile
path to geometry file used for Geant4 simulation
std::string fROOTfile
path to geometry file for geometry in GeometryCore
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void geo::GeometryCore::MakeAuxDet ( std::vector< const TGeoNode * > &  path,
int  depth 
)
private

Definition at line 1102 of file GeometryCore.cxx.

References AuxDets().

Referenced by FindAuxDet().

1103  {
1104  AuxDets().push_back(new AuxDetGeo(path, depth));
1105  }
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
void geo::GeometryCore::MakeCryostat ( std::vector< const TGeoNode * > &  path,
int  depth 
)
private

Definition at line 1071 of file GeometryCore.cxx.

References Cryostats().

Referenced by FindCryostat().

1072  {
1073  Cryostats().emplace_back(path, depth);
1074  }
CryostatList_t & Cryostats()
Return the internal cryostat list.
template<typename T >
geo::PlaneDataContainer<T> geo::GeometryCore::makePlaneData ( ) const
inline

Returns a container with one entry per wire plane.

Template Parameters
Ttype of data in the container
Returns
a container with one default-constructed T per plane
See also
geo::PlaneDataContainer

The working assumption is that all cryostats have the same number of TPCs, and all TPCs have the same number of planes. It is always guaranteed that all existing planes have an entry in the container, although if the previous working assumption is not satisfied there will be entries in the containers which are not associated to a valid plane.

The interface of the container is detailed in the documentation of the container itself, geo::PlaneDataContainer. Example of usage:

auto const* geom = lar::providerFrom<geo::GeometryCore>();
auto hitsPerPlane
= geom->makePlaneData<std::vector<recob::Hit const*>>();
for (recob::Hit const& hit: hits) {
if (hit.WireID()) hitsPerPlane[hit.WireID()].push_back(&hit);
} // for

where the container will be filled with pointers to all hits on the given wire plane (wire IDs are implicitly converted into plane IDs in the index operator[] call).

Definition at line 2833 of file GeometryCore.h.

2834  { return { Ncryostats(), MaxTPCs(), MaxPlanes() }; }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
unsigned int MaxTPCs() const
Returns the largest number of TPCs a cryostat in the detector has.
template<typename T >
geo::PlaneDataContainer<T> geo::GeometryCore::makePlaneData ( T const &  defValue) const
inline

Returns a container with one entry per wire plane.

Template Parameters
Ttype of data in the container
Parameters
defValuethe initial value of all elements in the container
Returns
a container with one default-constructed T per plane
See also
geo::PlaneDataContainer

This function operates as makePlaneData() const, except that copies the specified value into all the entries of the container. Example:

auto const* geom = lar::providerFrom<geo::GeometryCore>();
auto nHitsPerPlane = geom->makePlaneData(0U);
for (recob::Hit const& hit: hits) {
if (hit.WireID()) ++(hitsPerPlane[hit.WireID()]);
} // for

Definition at line 2855 of file GeometryCore.h.

2856  { return { Ncryostats(), MaxTPCs(), MaxPlanes(), defValue }; }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
unsigned int MaxTPCs() const
Returns the largest number of TPCs a cryostat in the detector has.
template<typename T >
geo::TPCDataContainer<T> geo::GeometryCore::makeTPCData ( ) const
inline

Returns a container with one entry per TPC.

Template Parameters
Ttype of data in the container
Returns
a container with one default-constructed T per TPC
See also
geo::TPCDataContainer

The working assumption is that all cryostats have the same number of TPCs. It is always guaranteed that all existing TPCs have an entry in the container, although if the previous working assumption is not satisfied there will be entries in the containers which are not associated to a valid TPC.

The interface of the container is detailed in the documentation of the container itself, geo::TPCDataContainer. Example of usage:

auto const* geom = lar::providerFrom<geo::GeometryCore>();
auto tracksPerTPC
= geom->makeTPCData<std::vector<recob::Track const*>>();
for (recob::Track const& track: tracks) {
geo::TPCGeo const* tpc = geom->PositionToTPCptr(track.Start());
if (tpc) tracksPerTPC[tpc->ID()].push_back(&track);
} // for

where the container will be filled with pointers to all tracks starting from a given TPC (tracks reconstructed as starting outside the TPCs will be not saved in the container).

Definition at line 2312 of file GeometryCore.h.

2313  { return { Ncryostats(), MaxTPCs() }; }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
unsigned int MaxTPCs() const
Returns the largest number of TPCs a cryostat in the detector has.
template<typename T >
geo::TPCDataContainer<T> geo::GeometryCore::makeTPCData ( T const &  defValue) const
inline

Returns a container with one entry per TPC.

Template Parameters
Ttype of data in the container
Parameters
defValuethe initial value of all elements in the container
Returns
a container with a value defValue per each TPC
See also
geo::TPCDataContainer

This function operates as makeTPCData() const, except that copies the specified value into all the entries of the container. Example:

auto const* geom = lar::providerFrom<geo::GeometryCore>();
auto nTracksPerTPC = geom->makeTPCData(0U);
for (recob::Track const& track: tracks) {
geo::TPCGeo const* tpc = geom->PositionToTPCptr(track.Start());
if (tpc) ++(tracksPerTPC[tpc->ID()]);
} // for

Definition at line 2335 of file GeometryCore.h.

2336  { return { Ncryostats(), MaxTPCs(), defValue }; }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
unsigned int MaxTPCs() const
Returns the largest number of TPCs a cryostat in the detector has.
double geo::GeometryCore::MassBetweenPoints ( geo::Point_t const &  p1,
geo::Point_t const &  p2 
) const

Returns the column density between two points.

Parameters
p1the first point
p2the second point
Returns
the column density [kg / cm²]

The column density is defined as $ \int_{\vec{p}_{1}}^{\vec{p}_{2}} \rho(\vec{p}) d\vec{p} $ where $ \rho(\vec{p}) $ is the density at point $ \vec{p} $, which the integral leads from p1 to p2 in a straight line.

Both points are specified in world coordinates.

Definition at line 1126 of file GeometryCore.cxx.

References dir, geo::vect::makePointFromCoords(), and R.

Referenced by TotalMass().

1127  {
1128 
1129  //The purpose of this method is to determine the column density
1130  //between the two points given. Do that by starting at p1 and
1131  //stepping until you get to the node of p2. calculate the distance
1132  //between the point just inside that node and p2 to get the last
1133  //bit of column density
1134  double columnD = 0.;
1135 
1136  //first initialize a track - get the direction cosines
1137  geo::Vector_t const dir = (p2 - p1).Unit();
1138 
1139  double const dxyz[3] = { dir.X(), dir.Y(), dir.Z() };
1140  double const cp1[3] = { p1.X(), p1.Y(), p1.Z() };
1141  gGeoManager->InitTrack(cp1, dxyz);
1142 
1143  //might be helpful to have a point to a TGeoNode
1144  TGeoNode *node = gGeoManager->GetCurrentNode();
1145 
1146  //check that the points are not in the same volume already.
1147  //if they are in different volumes, keep stepping until you
1148  //are in the same volume as the second point
1149  while(!gGeoManager->IsSameLocation(p2.X(), p2.Y(), p2.Z())){
1150  gGeoManager->FindNextBoundary();
1151  columnD += gGeoManager->GetStep()*node->GetMedium()->GetMaterial()->GetDensity();
1152 
1153  //the act of stepping puts you in the next node and returns that node
1154  node = gGeoManager->Step();
1155  }//end loop to get to volume of second point
1156 
1157  //now you are in the same volume as the last point, but not at that point.
1158  //get the distance between the current point and the last one
1159  geo::Point_t const last
1160  = geo::vect::makePointFromCoords(gGeoManager->GetCurrentPoint());
1161  double const lastStep = (p2 - last).R();
1162  columnD += lastStep*node->GetMedium()->GetMaterial()->GetDensity();
1163 
1164  return columnD;
1165  }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:167
Double_t R
TDirectory * dir
Definition: macro.C:5
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:187
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
double geo::GeometryCore::MassBetweenPoints ( double *  p1,
double *  p2 
) const

Returns the column density between two points.

Parameters
p1the first point
p2the second point
Returns
the column density [kg / cm²]

The column density is defined as $ \int_{\vec{p}_{1}}^{\vec{p}_{2}} \rho(\vec{p}) d\vec{p} $ where $ \rho(\vec{p}) $ is the density at point $ \vec{p} $, which the integral leads from p1 to p2 in a straight line.

Both points are specified in world coordinates.

TGeoMaterial const * geo::GeometryCore::Material ( geo::Point_t const &  point) const

Returns the material at the specified position.

Definition at line 925 of file GeometryCore.cxx.

Referenced by MaterialName().

925  {
926  auto const pNode = gGeoManager->FindNode(point.X(), point.Y(), point.Z());
927  if (!pNode) return nullptr;
928  auto const pMedium = pNode->GetMedium();
929  return pMedium? pMedium->GetMaterial(): nullptr;
930  }
std::string geo::GeometryCore::MaterialName ( TVector3 const &  point) const
inline

Name of the deepest material containing the point xyz.

Returns
material of the origin by default

Definition at line 1857 of file GeometryCore.h.

References art::detail::indent(), pyG4Element::Print(), and geo::vect::toPoint().

Referenced by larg4::LArG4Ana::analyze().

1858  { return MaterialName(geo::vect::toPoint(point)); }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
std::string MaterialName(TVector3 const &point) const
Name of the deepest material containing the point xyz.
std::string geo::GeometryCore::MaterialName ( geo::Point_t const &  point) const

Name of the deepest material containing the point xyz.

Returns
material of the origin by default

Definition at line 933 of file GeometryCore.cxx.

References geo::BoxBoundedGeo::ContainsPosition(), FindDetectorEnclosure(), Material(), geo::BoxBoundedGeo::Max(), geo::BoxBoundedGeo::Min(), and WorldBox().

934  {
935  // check that the given point is in the World volume at least
936  geo::BoxBoundedGeo worldBox = WorldBox();
937  if (!worldBox.ContainsPosition(point)) {
938  mf::LogWarning("GeometryCoreBadInputPoint")
939  << "point " << point << " is not inside the world volume "
940  << worldBox.Min() << " -- " << worldBox.Max()
941  << "; returning unknown material name";
942  return { "unknownMaterial" };
943  }
944  auto const pMaterial = Material(point);
945  if (!pMaterial) {
946  mf::LogWarning("GeometryCoreBadInputPoint")
947  << "material for point " << point
948  << " not found! returning unknown material name";
949  return { "unknownMaterial" };
950  }
951  return pMaterial->GetName();
952  }
geo::Point_t Min() const
Returns the corner point with the smallest coordinates.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:35
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
TGeoMaterial const * Material(geo::Point_t const &point) const
Returns the material at the specified position.
geo::Point_t Max() const
Returns the corner point with the largest coordinates.
bool ContainsPosition(geo::Point_t const &point, double wiggle=1.0) const
Returns whether this volume contains the specified point.
geo::BoxBoundedGeo WorldBox() const
unsigned int geo::GeometryCore::MaxOpChannel ( ) const

Largest optical channel number.

Definition at line 218 of file GeometryCore.cxx.

References fChannelMapAlg, and NOpDets().

Referenced by cosmic::BeamFlashTrackMatchTaggerAlg::CheckCompatibility(), opdet::ConstructFlash(), and cosmic::BeamFlashTrackMatchTaggerAlg::PrintHypothesisFlashComparison().

219  {
220  return fChannelMapAlg->MaxOpChannel(this->NOpDets());
221  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int NOpDets() const
Number of OpDets in the whole detector.
unsigned int geo::GeometryCore::MaxPlanes ( ) const

Returns the largest number of planes among all TPCs in this detector.

Definition at line 837 of file GeometryCore.cxx.

References Cryostats().

Referenced by pma::PMAlgTracker::build(), shower::EMShowerAlg::CheckIsolatedHits(), img::DataProviderAlg::DataProviderAlg(), trkf::TrackKalmanFitter::doFitWork(), lar_pandora::LArPandoraGeometry::LoadGeometry(), shower::EMShowerAlg::MakeShower(), shower::EMShowerAlg::MakeSpacePoints(), Nviews(), shower::EMShowerAlg::OrderShowerHits(), pma::PMAlgTracker::PMAlgTracker(), trkf::PMAlgTrackMaker::PMAlgTrackMaker(), lar_pandora::LArPandoraTrackCreation::produce(), shower::EMShowerAlg::RelativeWireWidth(), trkf::TrackKalmanFitter::sortOutput(), and shower::EMShowerAlg::WorstPlane().

837  {
838  unsigned int maxPlanes = 0;
839  for (geo::CryostatGeo const& cryo: Cryostats()) {
840  unsigned int maxPlanesInCryo = cryo.MaxPlanes();
841  if (maxPlanesInCryo > maxPlanes) maxPlanes = maxPlanesInCryo;
842  } // for
843  return maxPlanes;
844  } // GeometryCore::MaxPlanes()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
CryostatList_t & Cryostats()
Return the internal cryostat list.
unsigned int geo::GeometryCore::MaxROPs ( ) const

Returns the largest number of ROPs a TPC set in the detector has.

Definition at line 1814 of file GeometryCore.cxx.

References fChannelMapAlg.

1814  {
1815  return fChannelMapAlg->MaxROPs();
1816  } // GeometryCore::MaxROPs()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::MaxTPCs ( ) const

Returns the largest number of TPCs a cryostat in the detector has.

Definition at line 817 of file GeometryCore.cxx.

References Cryostats().

Referenced by evd::TWQProjectionView::SetUpTPCselection().

817  {
818  unsigned int maxTPCs = 0;
819  for (geo::CryostatGeo const& cryo: Cryostats()) {
820  unsigned int maxTPCsInCryo = cryo.NTPC();
821  if (maxTPCsInCryo > maxTPCs) maxTPCs = maxTPCsInCryo;
822  } // for
823  return maxTPCs;
824  } // GeometryCore::MaxTPCs()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
CryostatList_t & Cryostats()
Return the internal cryostat list.
unsigned int geo::GeometryCore::MaxTPCsets ( ) const

Returns the largest number of TPC sets any cryostat in the detector has.

Definition at line 1770 of file GeometryCore.cxx.

References fChannelMapAlg.

1770  {
1771  return fChannelMapAlg->MaxTPCsets();
1772  } // GeometryCore::MaxTPCsets()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::MaxWires ( ) const

Returns the largest number of wires among all planes in this detector.

Definition at line 847 of file GeometryCore.cxx.

References Cryostats().

Referenced by cluster::BlurredClusteringAlg::ConvertRecobHitsToVector().

847  {
848  unsigned int maxWires = 0;
849  for (geo::CryostatGeo const& cryo: Cryostats()) {
850  unsigned int maxWiresInCryo = cryo.MaxWires();
851  if (maxWiresInCryo > maxWires) maxWires = maxWiresInCryo;
852  } // for
853  return maxWires;
854  } // GeometryCore::MaxWires()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
CryostatList_t & Cryostats()
Return the internal cryostat list.
unsigned int geo::GeometryCore::NAuxDets ( ) const
inline

Returns the number of auxiliary detectors.

Todo:
use a AutDetID_t instead of unsigned int?

This method returns the total number of scintillator paddles (Auxiliary Detectors aka AuxDet) outside of the cryostat

Todo:
Change return type to size_t

Definition at line 4458 of file GeometryCore.h.

Referenced by AuxDet(), NAuxDetSensitive(), and larg4::LArG4::produce().

4458 { return AuxDets().size(); }
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
unsigned int geo::GeometryCore::NAuxDetSensitive ( size_t const &  aid) const

Returns the number of sensitive components of auxiliary detector.

Parameters
aidID of the auxiliary detector
Returns
number of sensitive components in the auxiliary detector aid cet::exception (category "Geometry") if aid does not exist

Definition at line 255 of file GeometryCore.cxx.

References AuxDets(), and NAuxDets().

256  {
257  if( aid > NAuxDets() - 1)
258  throw cet::exception("Geometry") << "Requested AuxDet index " << aid
259  << " is out of range: " << NAuxDets();
260 
261  return AuxDets()[aid]->NSensitiveVolume();
262  }
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
unsigned int geo::GeometryCore::Nchannels ( ) const

Returns the number of TPC readout channels in the detector.

Definition at line 191 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by larg4::LArG4Ana::beginJob(), lar_cluster3d::StandardHit3DBuilder::BuildChannelStatusVec(), trkf::SeedFinderAlgorithm::CalculateGeometricalElements(), trkf::BezierTrackerAlgorithm::MakeTracks(), hit::MCHitFinder::produce(), and detsim::SimWire::produce().

192  {
193  return fChannelMapAlg->Nchannels();
194  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::Nchannels ( readout::ROPID const &  ropid) const

Returns the number of channels in the specified ROP.

Returns
number of channels in the specified ROP, 0 if non-existent

Definition at line 197 of file GeometryCore.cxx.

References fChannelMapAlg.

198  {
199  return fChannelMapAlg->Nchannels(ropid);
200  } // GeometryCore::Nchannels(ROPID)
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::Ncryostats ( ) const
inline

Returns the number of cryostats in the detector.

The NElements() and NSiblingElements() methods are overloaded and their return depends on the type of ID.

Todo:
Change return type to size_t

Definition at line 1964 of file GeometryCore.h.

Referenced by detsim::WienerFilterAna::beginJob(), evgen::GaisserParam::beginJob(), detsim::SimDriftElectrons::beginJob(), trkf::SpacePointAna::bookHistograms(), lar_cluster3d::StandardHit3DBuilder::BuildHitPairMap(), util::DetectorPropertiesServiceArgoNeuT::CalculateXTicksParams(), detinfo::DetectorPropertiesStandard::CalculateXTicksParams(), larg4::LArVoxelReadout::ClearSimChannels(), lar_cluster3d::StandardHit3DBuilder::CollectArtHits(), larg4::LArVoxelReadoutGeometry::Construct(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), hit::DisambigCheater::DisambigCheater(), detsim::WienerFilterAna::endJob(), vertex::FeatureVertexFinder::Find2dClusterVertexCandidates(), vertex::FeatureVertexFinder::Find3dVtxFrom2dClusterVtxCand(), vertex::FeatureVertexFinder::Get3dVertexCandidates(), corner::CornerFinderAlg::get_feature_points_fast(), lar_pandora::LArPandoraInput::GetTrueStartAndEndPoints(), lar_cluster3d::SpacePointHit3DBuilder::Hit3DBuilder(), lar_pandora::LArPandoraGeometry::LoadGeometry(), trkf::SpacePointAlg::makeSpacePoints(), NOpDets(), OpDetFromCryo(), OpDetGeoFromOpDet(), evgen::CORSIKAGen::populateNShowers(), lar_pandora::LArPandoraTrackCreation::produce(), evgen::CosmicsGen::produce(), evgen::CORSIKAGen::produce(), vertex::FeatureVertexFinder::produce(), larg4::LArG4::produce(), evd::TWQProjectionView::SelectTPC(), evd::TWQProjectionView::SetUpTPCselection(), evd::SimulationDrawer::SimulationDrawer(), cheat::BackTracker::SpacePointHitsToWeightedXYZ(), trkf::SpacePointAlg::update(), and UpdateAfterSorting().

1964 { return Cryostats().size(); }
CryostatList_t & Cryostats()
Return the internal cryostat list.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( geo::Point_t const &  worldLoc,
geo::PlaneID const &  planeid 
) const

Returns the ID of the channel nearest to the specified position.

Parameters
worldLoc3D coordinates of the point (world reference frame)
planeidID of the wire plane the channel must belong to
Returns
the ID of the channel, or raw::InvalidChannelID if invalid wire
Bug:
on invalid wire, a geo::InvalidWireError exception is thrown

Definition at line 1271 of file GeometryCore.cxx.

References raw::InvalidChannelID, NearestWireID(), and PlaneWireToChannel().

Referenced by larg4::LArVoxelReadout::DriftIonizationElectrons(), NearestChannel(), NearestWireID(), detsim::SimDriftElectrons::produce(), vertex::FeatureVertexFinder::produce(), and apa::DisambigAlg::TrivialDisambig().

1272  {
1273 
1274  // This method is supposed to return a channel number rather than
1275  // a wire number. Perform the conversion here (although, maybe
1276  // faster if we deal in wire numbers rather than channel numbers?)
1277 
1278  // NOTE on failure both NearestChannel() and upstream:
1279  // * according to documentation, should return invalid channel
1280  // * in the actual code throw an exception because of a BUG
1281  //
1282  // The following implementation automatically becomes in fact compliant to
1283  // the documentation if upstreams becomes compliant to.
1284  // When that happens, just delete this comment.
1285  geo::WireID const wireID = NearestWireID(worldPos, planeid);
1286  return wireID? PlaneWireToChannel(wireID): raw::InvalidChannelID;
1287  } // GeometryCore::NearestChannel()
Raw data description.
Definition: RawTypes.h:6
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
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.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( const double  worldLoc[3],
geo::PlaneID const &  planeid 
) const

Returns the ID of the channel nearest to the specified position.

Parameters
worldLoc3D coordinates of the point (world reference frame)
PlaneNothe number of plane
TPCNothe number of TPC
cstatthe number of cryostat
Returns
the ID of the channel, or raw::InvalidChannelID if invalid wire
Bug:
on invalid wire, a geo::InvalidWireError exception is thrown

The different versions allow different way to provide the position.

Todo:
remove the integers version

Definition at line 1253 of file GeometryCore.cxx.

References NearestChannel().

1254  {
1255  return NearestChannel(TVector3(worldPos), planeid);
1256  }
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.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( std::vector< double > const &  worldLoc,
geo::PlaneID const &  planeid 
) const

Returns the ID of the channel nearest to the specified position.

Parameters
worldLoc3D coordinates of the point (world reference frame)
PlaneNothe number of plane
TPCNothe number of TPC
cstatthe number of cryostat
Returns
the ID of the channel, or raw::InvalidChannelID if invalid wire
Bug:
on invalid wire, a geo::InvalidWireError exception is thrown

The different versions allow different way to provide the position.

Todo:
remove the integers version

Definition at line 1260 of file GeometryCore.cxx.

References NearestChannel().

1261  {
1262  if(worldPos.size() > 3) throw cet::exception("GeometryCore") << "bad size vector for "
1263  << "worldPos: "
1264  << worldPos.size() << "\n";
1265  TVector3 wp(&(worldPos[0]));
1266  return NearestChannel(wp, planeid);
1267  }
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.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
raw::ChannelID_t geo::GeometryCore::NearestChannel ( const TVector3 &  worldLoc,
geo::PlaneID const &  planeid 
) const
inline

Returns the ID of the channel nearest to the specified position.

Parameters
worldLoc3D coordinates of the point (world reference frame)
PlaneNothe number of plane
TPCNothe number of TPC
cstatthe number of cryostat
Returns
the ID of the channel, or raw::InvalidChannelID if invalid wire
Bug:
on invalid wire, a geo::InvalidWireError exception is thrown

The different versions allow different way to provide the position.

Todo:
remove the integers version

Definition at line 4714 of file GeometryCore.h.

References geo::vect::toPoint().

4715  { return NearestChannel(geo::vect::toPoint(worldLoc), planeid); }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
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.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( const double  worldLoc[3],
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Returns the ID of the channel nearest to the specified position.

Parameters
worldLoc3D coordinates of the point (world reference frame)
PlaneNothe number of plane
TPCNothe number of TPC
cstatthe number of cryostat
Returns
the ID of the channel, or raw::InvalidChannelID if invalid wire
Bug:
on invalid wire, a geo::InvalidWireError exception is thrown

The different versions allow different way to provide the position.

Todo:
remove the integers version

Definition at line 4716 of file GeometryCore.h.

4720  { return NearestChannel(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( std::vector< double > const &  worldLoc,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Returns the ID of the channel nearest to the specified position.

Parameters
worldLoc3D coordinates of the point (world reference frame)
PlaneNothe number of plane
TPCNothe number of TPC
cstatthe number of cryostat
Returns
the ID of the channel, or raw::InvalidChannelID if invalid wire
Bug:
on invalid wire, a geo::InvalidWireError exception is thrown

The different versions allow different way to provide the position.

Todo:
remove the integers version

Definition at line 4721 of file GeometryCore.h.

4725  { return NearestChannel(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( const TVector3 &  worldLoc,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Returns the ID of the channel nearest to the specified position.

Parameters
worldLoc3D coordinates of the point (world reference frame)
PlaneNothe number of plane
TPCNothe number of TPC
cstatthe number of cryostat
Returns
the ID of the channel, or raw::InvalidChannelID if invalid wire
Bug:
on invalid wire, a geo::InvalidWireError exception is thrown

The different versions allow different way to provide the position.

Todo:
remove the integers version

Definition at line 4726 of file GeometryCore.h.

4730  { return NearestChannel(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( geo::Point_t const &  worldLoc,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Returns the ID of the channel nearest to the specified position.

Parameters
worldLoc3D coordinates of the point (world reference frame)
PlaneNothe number of plane
TPCNothe number of TPC
cstatthe number of cryostat
Returns
the ID of the channel, or raw::InvalidChannelID if invalid wire
Bug:
on invalid wire, a geo::InvalidWireError exception is thrown

The different versions allow different way to provide the position.

Todo:
remove the integers version

Definition at line 4731 of file GeometryCore.h.

References c1, and c2.

4735  { return NearestChannel(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
unsigned int geo::GeometryCore::NearestWire ( geo::Point_t const &  point,
geo::PlaneID const &  planeid 
) const

Returns the index of wire closest to position in the specified TPC.

Parameters
pointthe point to be tested [cm]
planeidID of the plane
Returns
the index of the wire, or geo::WireID::InvalidID on failure
Bug:
Actually, on failure an exception geo::InvalidWireError is thrown
Deprecated:
Use NearestWireID() instead.

Definition at line 1202 of file GeometryCore.cxx.

References NearestWireID(), and geo::WireID::Wire.

Referenced by vertex::FeatureVertexFinderAna::analyze(), trkf::TrackAna::analyze(), evd::RecoBaseDrawer::DrawTrack2D(), evd::TWQMultiTPCProjectionView::FindEndPoint(), evd::TWQProjectionView::FindEndPoint(), hit::HitCheater::FindHitsOnChannel(), cmtool::CFAlgoStartPointCompat::Float(), cmtool::CFAlgoStartTimeCompat::Float(), util::GeometryUtilities::Get2DPointProjection(), util::GeometryUtilities::Get2DPointProjectionCM(), trkf::FeatureTracker::GetConnectionMap(), opdet::GetHitGeometryInfo(), trkf::BezierTrack::GetProjectedPointUVWT(), trkf::BezierTrack::GetProjectedPointUVWX(), nnet::TrainingDataAlg::getProjection(), apa::APAGeometryAlg::LineSegChanIntersect(), NearestWire(), cluster::ClusterCheater::produce(), shwf::ShowerReco::produce(), vertex::FeatureVertexFinder::produce(), evd::RecoBaseDrawer::Seed2D(), and WireCoordinate().

1203  {
1204  return NearestWireID(point, planeid).Wire;
1205  // return fChannelMapAlg->NearestWire(worldPos, planeid);
1206  }
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:313
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.
unsigned int geo::GeometryCore::NearestWire ( const double  worldLoc[3],
geo::PlaneID const &  planeid 
) const

Returns the index of wire closest to position in the specified TPC.

Parameters
worldLoc3D coordinates of the point (world reference frame)
planeidID of the plane
PlaneNoplane number within the TPC
TPCNotpc number within the cryostat
cstatcryostat number
Returns
the index of the wire

The different versions allow different way to provide the position.

Deprecated:
Use NearestWireID() instead.
Todo:

remove the integers version

what happens when no wire is found?

Definition at line 1210 of file GeometryCore.cxx.

References NearestWire().

1211  {
1212  return NearestWire(TVector3(worldPos), planeid);
1213  }
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.
unsigned int geo::GeometryCore::NearestWire ( std::vector< double > const &  worldLoc,
geo::PlaneID const &  planeid 
) const

Returns the index of wire closest to position in the specified TPC.

Parameters
worldLoc3D coordinates of the point (world reference frame)
planeidID of the plane
PlaneNoplane number within the TPC
TPCNotpc number within the cryostat
cstatcryostat number
Returns
the index of the wire

The different versions allow different way to provide the position.

Deprecated:
Use NearestWireID() instead.
Todo:

remove the integers version

what happens when no wire is found?

Definition at line 1217 of file GeometryCore.cxx.

References NearestWire(), and NearestWireID().

1218  {
1219  if(worldPos.size() > 3) throw cet::exception("GeometryCore") << "bad size vector for "
1220  << "worldPos: "
1221  << worldPos.size() << "\n";
1222  TVector3 wp(&(worldPos[0]));
1223  return NearestWire(wp, planeid);
1224  }
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.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int geo::GeometryCore::NearestWire ( const TVector3 &  worldLoc,
geo::PlaneID const &  planeid 
) const
inline

Returns the index of wire closest to position in the specified TPC.

Parameters
worldLoc3D coordinates of the point (world reference frame)
planeidID of the plane
PlaneNoplane number within the TPC
TPCNotpc number within the cryostat
cstatcryostat number
Returns
the index of the wire

The different versions allow different way to provide the position.

Deprecated:
Use NearestWireID() instead.
Todo:

remove the integers version

what happens when no wire is found?

Definition at line 3951 of file GeometryCore.h.

References geo::vect::toPoint().

3952  { return NearestWire(geo::vect::toPoint(worldLoc), planeid); }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
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.
unsigned int geo::GeometryCore::NearestWire ( const double  worldLoc[3],
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Returns the index of wire closest to position in the specified TPC.

Parameters
worldLoc3D coordinates of the point (world reference frame)
planeidID of the plane
PlaneNoplane number within the TPC
TPCNotpc number within the cryostat
cstatcryostat number
Returns
the index of the wire

The different versions allow different way to provide the position.

Deprecated:
Use NearestWireID() instead.
Todo:

remove the integers version

what happens when no wire is found?

Definition at line 3953 of file GeometryCore.h.

3957  { return NearestWire(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
unsigned int geo::GeometryCore::NearestWire ( std::vector< double > const &  worldLoc,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Returns the index of wire closest to position in the specified TPC.

Parameters
worldLoc3D coordinates of the point (world reference frame)
planeidID of the plane
PlaneNoplane number within the TPC
TPCNotpc number within the cryostat
cstatcryostat number
Returns
the index of the wire

The different versions allow different way to provide the position.

Deprecated:
Use NearestWireID() instead.
Todo:

remove the integers version

what happens when no wire is found?

Definition at line 3958 of file GeometryCore.h.

3962  { return NearestWire(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
unsigned int geo::GeometryCore::NearestWire ( const TVector3 &  worldLoc,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Returns the index of wire closest to position in the specified TPC.

Parameters
worldLoc3D coordinates of the point (world reference frame)
planeidID of the plane
PlaneNoplane number within the TPC
TPCNotpc number within the cryostat
cstatcryostat number
Returns
the index of the wire

The different versions allow different way to provide the position.

Deprecated:
Use NearestWireID() instead.
Todo:

remove the integers version

what happens when no wire is found?

Definition at line 3963 of file GeometryCore.h.

3967  { return NearestWire(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
unsigned int geo::GeometryCore::NearestWire ( geo::Point_t const &  worldLoc,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Returns the index of wire closest to position in the specified TPC.

Parameters
worldLoc3D coordinates of the point (world reference frame)
planeidID of the plane
PlaneNoplane number within the TPC
TPCNotpc number within the cryostat
cstatcryostat number
Returns
the index of the wire

The different versions allow different way to provide the position.

Deprecated:
Use NearestWireID() instead.
Todo:

remove the integers version

what happens when no wire is found?

Definition at line 3968 of file GeometryCore.h.

3972  { return NearestWire(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
geo::WireID geo::GeometryCore::NearestWireID ( geo::Point_t const &  point,
geo::PlaneID const &  planeid 
) const

Returns the ID of wire closest to position in the specified TPC.

Parameters
pointthe point to be tested [cm]
planeidID of the plane
Returns
the ID of the wire, or an invalid wire ID
See also
geo::PlaneGeo::ClosestWireID()
Bug:
Instead of returning an invalid wire ID, an exception is thrown!

If the nearest wire is not closer than half a wire pitch, the result is marked invalid. The returned (invalid) ID will contain the non-existing wire that would be the nearest, if it existed.

If the wire ID is invalid and the existing closest wire is desired, a possible solution is (when the BUG will be solved):

geo::WireID wireID = geom->NearestWireID(point, planeID);
if (!wireID) wireID = geom->Plane(planeID).ClosestWireID(wireID);

Note however that this will execute plane lookup twice, and a more efficient approach would be to ask the plane everything directly:

geo::PlaneGeo const& plane = geom->Plane(planeID);
geo::WireID wireID = plane.NearestWireID(point);
if (!wireID) wireID = plane.ClosestWireID(wireID);

Until the BUG is fixed, the actual working code is:

geo::PlaneGeo const& plane = geom->Plane(planeID);
geo::WireID wireID;
try {
wireID = plane.NearestWireID(point);
}
catch (geo::InvalidWireError const& e) {
if (!e.hasSuggestedWire()) throw;
wireID = plane.ClosestWireID(e.suggestedWireID());
}

Definition at line 1228 of file GeometryCore.cxx.

References geo::PlaneGeo::NearestWireID(), and Plane().

Referenced by hit::DisambigCheater::InitHitToWids(), NearestChannel(), NearestWire(), NearestWireID(), apa::APAGeometryAlg::NearestWireIDOnChan(), evd::RecoBaseDrawer::OpFlash2D(), trk::TrackContainmentAlg::ProcessTracks(), and shower::EMShowerAlg::Project3DPointOntoPlane().

1229  {
1230  return Plane(planeid).NearestWireID(worldPos);
1231  }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
geo::WireID NearestWireID(geo::Point_t const &pos) const
Returns the ID of wire closest to the specified position.
Definition: PlaneGeo.cxx:673
geo::WireID geo::GeometryCore::NearestWireID ( const double  point[3],
geo::PlaneID const &  planeid 
) const

Returns the ID of wire closest to position in the specified TPC.

Parameters
pointthe point to be tested [cm]
planeidID of the plane
PlaneNoplane number within the TPC
TPCNotpc number within the cryostat
cstatcryostat number
Returns
the ID of the wire, or an invalid wire ID
Bug:
Instead of returning an invalid wire ID, an exception is thrown!

The different versions allow different way to provide the position.

Deprecated:
Use the version with a geo::Point_t and PlaneID arguments
Todo:
remove the integers version

Definition at line 1246 of file GeometryCore.cxx.

References NearestChannel(), and NearestWireID().

1247  {
1248  return NearestWireID(TVector3(worldPos), planeid);
1249  }
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.
geo::WireID geo::GeometryCore::NearestWireID ( std::vector< double > const &  point,
geo::PlaneID const &  planeid 
) const

Fills two arrays with the coordinates of the wire end points.

Parameters
wireidID of the wire
xyzStart(output) an array with the start coordinate
xyzEnd(output) an array with the end coordinate
Exceptions
cet::exceptionwire not present

The starting point is the wire end with lower z coordinate.

Deprecated:
use the wire ID interface instead (but note that it does not sort the ends)

Definition at line 1235 of file GeometryCore.cxx.

References NearestWireID().

1236  {
1237  if(worldPos.size() > 3) throw cet::exception("GeometryCore") << "bad size vector for "
1238  << "worldPos: "
1239  << worldPos.size() << "\n";
1240  TVector3 wp(&(worldPos[0]));
1241  return NearestWireID(wp, planeid);
1242  }
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.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::WireID geo::GeometryCore::NearestWireID ( const TVector3 &  point,
geo::PlaneID const &  planeid 
) const
inline

Fills two arrays with the coordinates of the wire end points.

Parameters
wireidID of the wire
xyzStart(output) an array with the start coordinate
xyzEnd(output) an array with the end coordinate
Exceptions
cet::exceptionwire not present

The starting point is the wire end with lower z coordinate.

Deprecated:
use the wire ID interface instead (but note that it does not sort the ends)

Definition at line 3894 of file GeometryCore.h.

References geo::vect::toPoint().

3895  { return NearestWireID(geo::vect::toPoint(point), planeid); }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
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.
geo::WireID geo::GeometryCore::NearestWireID ( const double  point[3],
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Fills two arrays with the coordinates of the wire end points.

Parameters
wireidID of the wire
xyzStart(output) an array with the start coordinate
xyzEnd(output) an array with the end coordinate
Exceptions
cet::exceptionwire not present

The starting point is the wire end with lower z coordinate.

Deprecated:
use the wire ID interface instead (but note that it does not sort the ends)

Definition at line 3896 of file GeometryCore.h.

3900  { return NearestWireID(point, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
geo::WireID geo::GeometryCore::NearestWireID ( std::vector< double > const &  point,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Fills two arrays with the coordinates of the wire end points.

Parameters
wireidID of the wire
xyzStart(output) an array with the start coordinate
xyzEnd(output) an array with the end coordinate
Exceptions
cet::exceptionwire not present

The starting point is the wire end with lower z coordinate.

Deprecated:
use the wire ID interface instead (but note that it does not sort the ends)

Definition at line 3901 of file GeometryCore.h.

3905  { return NearestWireID(point, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
geo::WireID geo::GeometryCore::NearestWireID ( const TVector3 &  point,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Fills two arrays with the coordinates of the wire end points.

Parameters
wireidID of the wire
xyzStart(output) an array with the start coordinate
xyzEnd(output) an array with the end coordinate
Exceptions
cet::exceptionwire not present

The starting point is the wire end with lower z coordinate.

Deprecated:
use the wire ID interface instead (but note that it does not sort the ends)

Definition at line 3906 of file GeometryCore.h.

3910  { return NearestWireID(point, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
geo::WireID geo::GeometryCore::NearestWireID ( geo::Point_t const &  point,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Fills two arrays with the coordinates of the wire end points.

Parameters
wireidID of the wire
xyzStart(output) an array with the start coordinate
xyzEnd(output) an array with the end coordinate
Exceptions
cet::exceptionwire not present

The starting point is the wire end with lower z coordinate.

Deprecated:
use the wire ID interface instead (but note that it does not sort the ends)

Definition at line 3911 of file GeometryCore.h.

3915  { return NearestWireID(point, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
unsigned int geo::GeometryCore::NElements ( ) const
inline

Returns the number of cryostats in the detector.

The NElements() and NSiblingElements() methods are overloaded and their return depends on the type of ID.

Todo:
Change return type to size_t

Definition at line 1965 of file GeometryCore.h.

1965 { return Ncryostats(); }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
unsigned int geo::GeometryCore::NElements ( geo::CryostatID const &  cryoid) const
inline

Returns the total number of TPCs in the specified cryostat.

Parameters
cstatcryostat number
Todo:

Make the cryostat number mandatory (as CryostatID)

Change return type to size_t

what happens if it does not exist?

Definition at line 2356 of file GeometryCore.h.

2357  { return NTPC(cryoid); }
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
unsigned int geo::GeometryCore::NElements ( geo::TPCID const &  tpcid) const
inline

Returns the total number of wire planes in the specified TPC.

Parameters
tpctpc number within the cryostat
cstatcryostat number
Todo:

Make all the arguments mandatory (as TPCID)

Change return type to size_t

what happens if TPC does not exist?

Definition at line 2875 of file GeometryCore.h.

2876  { return Nplanes(tpcid); }
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
unsigned int geo::GeometryCore::NElements ( geo::PlaneID const &  planeid) const
inline

Returns the total number of wires in the specified plane.

Parameters
pplane number within the TPC
tpctpc number within the cryostat
cstatcryostat number
Todo:

Make all the arguments mandatory (as PlaneID)

Change return type to size_t

what happens if it does not exist?

Definition at line 3312 of file GeometryCore.h.

3313  { return Nwires(planeid); }
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.
unsigned int geo::GeometryCore::NOpChannels ( ) const

Number of electronics channels for all the optical detectors.

Todo:
add explanation of the different IDs

Definition at line 212 of file GeometryCore.cxx.

References fChannelMapAlg, and NOpDets().

Referenced by opdet::OpHitAna::analyze(), opdet::OpFlashAna::analyze(), opdet::SimPhotonCounter::analyze(), opdet::SimPhotonCounter::beginJob(), opdet::OpDetResponseInterface::doNOpChannels(), opdet::OpDigiProperties::FillGainArray(), opdet::OpDigiProperties::FillPedMeanArray(), opdet::FlashClusterMatch::produce(), opdet::TrackTimeAssoc::produce(), opdet::BeamFlashCompatabilityCheck::produce(), opdet::OptDetDigitizer::produce(), and opdet::OpDigiProperties::reconfigure().

213  {
214  return fChannelMapAlg->NOpChannels(this->NOpDets());
215  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int NOpDets() const
Number of OpDets in the whole detector.
unsigned int geo::GeometryCore::NOpDets ( ) const

Number of OpDets in the whole detector.

Definition at line 203 of file GeometryCore.cxx.

References Cryostat(), Ncryostats(), and geo::CryostatGeo::NOpDet().

Referenced by cosmic::BeamFlashTrackMatchTaggerAlg::CheckCompatibility(), phot::CreateHybridLibrary::CreateHybridLibrary(), opdet::FlashHypothesisAnaAlg::FillOpDetPositions(), larg4::OpDetLookup::FindClosestOpDet(), opdet::FlashClusterMatch::GetLightHypothesis(), opdet::TrackTimeAssoc::GetMIPHypotheses(), opdet::BeamFlashCompatabilityCheck::GetMIPHypotheses(), IsValidOpChannel(), phot::PhotonVisibilityService::LoadLibrary(), MaxOpChannel(), NOpChannels(), cosmic::BeamFlashTrackMatchTaggerAlg::NormalizeLightHypothesis(), phot::PhotonLibraryHybrid::PhotonLibraryHybrid(), cosmic::BeamFlashTrackMatchTaggerAlg::PrintHypothesisFlashComparison(), wc::CellTree::processOpFlash(), opdet::FlashClusterMatch::produce(), opdet::TrackTimeAssoc::produce(), opdet::BeamFlashCompatabilityCheck::produce(), larg4::LArG4::produce(), lariov::SIOVPmtGainProvider::Reconfigure(), opdet::TrackTimeAssoc::ScanMIPHypotheses(), and opdet::FlashHypothesisAnaAlg::SetOutputObjects().

204  {
205  int N=0;
206  for(size_t cstat=0; cstat!=Ncryostats(); cstat++)
207  N += this->Cryostat(cstat).NOpDet();
208  return N;
209  }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:295
unsigned int geo::GeometryCore::NOpHardwareChannels ( int  opDet) const

Number of electronics channels for all the optical detectors.

Todo:
add explanation of the different IDs

Definition at line 224 of file GeometryCore.cxx.

References fChannelMapAlg.

225  {
226  return fChannelMapAlg->NOpHardwareChannels(opDet);
227  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::Nplanes ( unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const
inline

Returns the total number of wire planes in the specified TPC.

Parameters
tpctpc number within the cryostat
cstatcryostat number
Todo:

Make all the arguments mandatory (as TPCID)

Change return type to size_t

what happens if TPC does not exist?

Definition at line 2799 of file GeometryCore.h.

Referenced by hit::MCHitAnaExample::analyze(), cluster::ClusterAna::analyze(), pfpf::PFPAna::analyze(), hit::MagDriftAna::analyze(), cluster::DBclusterAna::analyze(), trkf::TrackAna::analyze(), tca::AnalyzeHits(), cluster::SmallClusterFilter::beginJob(), cluster::SmallClusterFinder::beginJob(), detsim::WienerFilterAna::beginJob(), shwf::ShowerReco::beginJob(), lar_cluster3d::StandardHit3DBuilder::BuildChannelStatusVec(), btutil::MCMatchAlg::BuildMap(), mvapid::MVAAlg::CalcSegmentdEdxDist(), util::GeometryUtilities::CalculatePitch(), util::GeometryUtilities::CalculatePitchPolar(), tca::TruthMatcher::CanReconstruct(), cluster::ClusterMatchTQ::ClusterMatch(), opdet::ConstructFlash(), evd::AnalysisBaseDrawer::DrawDeDx(), evd::AnalysisBaseDrawer::DrawKineticEnergy(), detsim::WienerFilterAna::endJob(), cluster::HoughBaseAlg::FastTransform(), hit::GausHitFinder::FillOutHitParameterVector(), hit::DPRawHitFinder::FillOutHitParameterVector(), trkf::BezierTrack::FillTrajectoryVectors(), tca::FillWireHitRange(), filter::MuonFilter::filter(), calo::GeneralCalorimetry::GeneralCalorimetry(), opdet::GetHitGeometryInfo(), mvapid::MVAAlg::GetWireNormals(), corner::CornerFinderAlg::GrabWires(), evd::GraphCluster::GraphCluster(), evd::GraphClusterAlg::GraphClusterAlg(), evd::InfoTransfer::InfoTransfer(), corner::CornerFinderAlg::InitializeGeometry(), tca::TruthMatcher::MatchAndSum(), hit::MCHitAnaExample::MCHitAnaExample(), cluster::ClusterMatchAlg::PrepareDetParams(), btutil::MCBTAlg::ProcessSimChannel(), trk::TrackContainmentAlg::ProcessTracks(), calo::Calorimetry::produce(), shwf::ShowerReco::produce(), evd::RawDataDrawer::RawDataDrawer(), evd::InfoTransfer::Rebuild(), evd::RecoBaseDrawer::RecoBaseDrawer(), evd::InfoTransfer::reconfigure(), util::GeometryUtilities::Reconfigure(), hit::RFFHitFinderAlg::SetFitterParamsVectors(), showerreco::ShowerRecoManager::ShowerRecoManager(), cheat::BackTracker::SpacePointHitsToWeightedXYZ(), ThirdPlane(), evd::TQPad::TQPad(), cluster::HoughBaseAlg::Transform(), evd::TWireProjPad::TWireProjPad(), evd::TWQMultiTPCProjectionView::TWQMultiTPCProjectionView(), and evd::TWQProjectionView::TWQProjectionView().

2800  { return Nplanes(geo::TPCID(cstat, tpc)); }
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
unsigned int geo::GeometryCore::Nplanes ( geo::TPCID const &  tpcid) const
inline

Returns the total number of planes in the specified TPC.

Parameters
tpcidTPC ID
Returns
number of planes in specified TPC, or 0 if no TPC found

The NElements() and NSiblingElements() methods are overloaded and their return depends on the type of ID.

Todo:
Change return type to size_t

Definition at line 2870 of file GeometryCore.h.

References geo::TPCGeo::NElements().

2871  {
2872  TPCGeo const* pTPC = GetElementPtr(tpcid);
2873  return pTPC? pTPC->NElements(): 0;
2874  }
CryostatGeo const * GetElementPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
unsigned int geo::GeometryCore::NROPs ( readout::TPCsetID const &  tpcsetid) const

Returns the total number of ROP in the specified TPC set.

Parameters
tpcsetidTPC set ID
Returns
number of readout planes in the TPC set, or 0 if no TPC set found

Note that this methods explicitly check the existence of the TPC set.

The NSiblingElements() method is overloaded and its return depends on the type of ID.

Definition at line 1808 of file GeometryCore.cxx.

References fChannelMapAlg.

1808  {
1809  return fChannelMapAlg->NROPs(tpcsetid);
1810  } // GeometryCore::NROPs()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::NSiblingElements ( geo::CryostatID const &  ) const
inline

Returns the number of cryostats in the detector.

The NElements() and NSiblingElements() methods are overloaded and their return depends on the type of ID.

Todo:
Change return type to size_t

Definition at line 1966 of file GeometryCore.h.

1967  { return Ncryostats(); }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
unsigned int geo::GeometryCore::NSiblingElements ( geo::TPCID const &  tpcid) const
inline

Returns the total number of TPCs in the specified cryostat.

Parameters
cstatcryostat number
Todo:

Make the cryostat number mandatory (as CryostatID)

Change return type to size_t

what happens if it does not exist?

Definition at line 2358 of file GeometryCore.h.

2359  { return NTPC(tpcid); }
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
unsigned int geo::GeometryCore::NSiblingElements ( geo::PlaneID const &  planeid) const
inline

Returns the total number of wire planes in the specified TPC.

Parameters
tpctpc number within the cryostat
cstatcryostat number
Todo:

Make all the arguments mandatory (as TPCID)

Change return type to size_t

what happens if TPC does not exist?

Definition at line 2877 of file GeometryCore.h.

2878  { return Nplanes(planeid); }
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
unsigned int geo::GeometryCore::NSiblingElements ( geo::WireID const &  wireid) const
inline

Returns the total number of wires in the specified plane.

Parameters
pplane number within the TPC
tpctpc number within the cryostat
cstatcryostat number
Todo:

Make all the arguments mandatory (as PlaneID)

Change return type to size_t

what happens if it does not exist?

Definition at line 3314 of file GeometryCore.h.

3315  { return Nwires(wireid); }
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.
unsigned int geo::GeometryCore::NSiblingElements ( readout::TPCsetID const &  tpcsetid) const
inline

Returns the total number of TPC sets in the specified cryostat.

Parameters
cryoidcryostat ID
Returns
number of TPC sets in the cryostat, or 0 if no cryostat found

The NSiblingElements() method is overloaded and its return depends on the type of ID.

Definition at line 4775 of file GeometryCore.h.

4776  { return NTPCsets(tpcsetid); }
unsigned int NTPCsets(readout::CryostatID const &cryoid) const
Returns the total number of TPC sets in the specified cryostat.
unsigned int geo::GeometryCore::NSiblingElements ( readout::ROPID const &  ropid) const
inline

Returns the total number of ROP in the specified TPC set.

Parameters
tpcsetidTPC set ID
Returns
number of readout planes in the TPC set, or 0 if no TPC set found

Note that this methods explicitly check the existence of the TPC set.

The NSiblingElements() method is overloaded and its return depends on the type of ID.

Definition at line 4978 of file GeometryCore.h.

4979  { return NROPs(ropid); }
unsigned int NROPs(readout::TPCsetID const &tpcsetid) const
Returns the total number of ROP in the specified TPC set.
unsigned int geo::GeometryCore::NTPC ( unsigned int  cstat = 0) const
inline

Returns the total number of TPCs in the specified cryostat.

Parameters
cstatcryostat number
Todo:

Make the cryostat number mandatory (as CryostatID)

Change return type to size_t

what happens if it does not exist?

Definition at line 2273 of file GeometryCore.h.

Referenced by detsim::WienerFilterAna::beginJob(), detsim::SimDriftElectrons::beginJob(), lar_cluster3d::StandardHit3DBuilder::BuildHitPairMap(), mvapid::MVAAlg::CalcSegmentdEdxDist(), larg4::LArVoxelReadout::ClearSimChannels(), lar_cluster3d::StandardHit3DBuilder::CollectArtHits(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), hit::DisambigCheater::DisambigCheater(), detsim::WienerFilterAna::endJob(), lar_pandora::LArPandoraInput::GetTrueStartAndEndPoints(), mvapid::MVAAlg::GetWireNormals(), lar_cluster3d::SpacePointHit3DBuilder::Hit3DBuilder(), apa::APAGeometryAlg::Init(), lar_pandora::LArPandoraGeometry::LoadGeometry(), evd::RecoBaseDrawer::OpFlashOrtho(), evd::Ortho3DPad::Ortho3DPad(), lar_pandora::LArPandoraTrackCreation::produce(), cluster::TrajCluster::produce(), evgen::NucleonDecay::produce(), evgen::NDKGen::produce(), evgen::NeutronOsc::produce(), evd::RecoBaseDrawer::RecoBaseDrawer(), evgen::ActiveVolumeVertexSampler::reconfigure(), evd::TWQProjectionView::SelectTPC(), evd::TWQProjectionView::SetUpTPCselection(), cheat::BackTracker::SpacePointHitsToWeightedXYZ(), tca::StitchPFPs(), apa::DisambigAlg::TrivialDisambig(), and evd::TWQMultiTPCProjectionView::TWQMultiTPCProjectionView().

2274  { return NTPC(geo::CryostatID(cstat)); }
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:120
unsigned int geo::GeometryCore::NTPC ( geo::CryostatID const &  cryoid) const
inline

Returns the total number of TPCs in the specified cryostat.

Parameters
cryoidcryostat number
Returns
number of TPCs in specified cryostat, or 0 if no cryostat found

The NElements() and NSiblingElements() methods are overloaded and their return depends on the type of ID.

Todo:
Change return type to size_t

Definition at line 2351 of file GeometryCore.h.

References geo::CryostatGeo::NElements().

2352  {
2353  CryostatGeo const* pCryo = GetElementPtr(cryoid);
2354  return pCryo? pCryo->NElements(): 0;
2355  }
CryostatGeo const * GetElementPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
unsigned int geo::GeometryCore::NTPCsets ( readout::CryostatID const &  cryoid) const

Returns the total number of TPC sets in the specified cryostat.

Parameters
cryoidcryostat ID
Returns
number of TPC sets in the cryostat, or 0 if no cryostat found

The NSiblingElements() method is overloaded and its return depends on the type of ID.

Definition at line 1764 of file GeometryCore.cxx.

References fChannelMapAlg.

1764  {
1765  return fChannelMapAlg->NTPCsets(cryoid);
1766  } // GeometryCore::NTPCsets()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::Nviews ( ) const

Returns the number of views (different wire orientations)

Returns the number of different views, or wire orientations, in the detector.

The function assumes that all TPCs in all cryostats of a detector have the same number of planes, which should be a safe assumption.

Todo:
Change return type to size_t

Definition at line 266 of file GeometryCore.cxx.

References MaxPlanes().

Referenced by evd_tool::ICARUSDrawer::DrawBadChannels(), and evd_tool::MicroBooNEDrawer::DrawBadChannels().

267  {
268  return MaxPlanes();
269  }
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
unsigned int geo::GeometryCore::Nwires ( unsigned int  p,
unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const
inline

Returns the total number of wires in the specified plane.

Parameters
pplane number within the TPC
tpctpc number within the cryostat
cstatcryostat number
Todo:

Make all the arguments mandatory (as PlaneID)

Change return type to size_t

what happens if it does not exist?

Definition at line 3293 of file GeometryCore.h.

Referenced by lar_cluster3d::StandardHit3DBuilder::BuildChannelStatusVec(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), noisefilteralg::WireCellNoiseFilter::DoNoiseFilter(), evd_tool::ICARUSDrawer::DrawBadChannels(), evd_tool::MicroBooNEDrawer::DrawBadChannels(), sppt::SpacePointAlg_TimeSort::fillCoordinatesArrays(), tca::FillWireHitRange(), vertex::FeatureVertexFinder::Find2dClusterVertexCandidates(), evd::RawDataDrawer::RoIextractorClass::Finish(), cmtool::CFAlgoVolumeOverlap::Float(), cmtool::CFAlgoWireOverlap::Float(), evd::RawDataDrawer::GetRegionOfInterest(), evd::RecoBaseDrawer::GetRegionOfInterest(), util::GeometryUtilities::GetYZ(), cluster::MergeClusterAlg::GlobalWire(), cluster::BlurredClusteringAlg::GlobalWire(), shower::EMShowerAlg::GlobalWire(), corner::CornerFinderAlg::GrabWires(), corner::CornerFinderAlg::InitializeGeometry(), lar_cluster3d::StandardHit3DBuilder::NearestWireID(), cluster::fuzzyClusterAlg::run_fuzzy_cluster(), util::GeometryUtilities::SelectPolygonHitList(), evd::TWQProjectionView::SetWire(), img::DataProviderAlg::setWireDriftData(), cluster::HoughBaseAlg::Transform(), evd::TWireProjPad::TWireProjPad(), evd::TWQMultiTPCProjectionView::TWQMultiTPCProjectionView(), evd::TWQProjectionView::TWQProjectionView(), evd::RecoBaseDrawer::Wire2D(), WireIDIntersectionCheck(), evd::TWQMultiTPCProjectionView::ZoomInterest(), and evd::TWQProjectionView::ZoomInterest().

3294  { return Nwires(geo::PlaneID(cstat, tpc, p)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
unsigned int geo::GeometryCore::Nwires ( geo::PlaneID const &  planeid) const
inline

Returns the total number of wires in the specified plane.

Parameters
planeidplane ID
Returns
number of wires in specified plane, or 0 if no plane found

The NElements() and NSiblingElements() methods are overloaded and their return depends on the type of ID.

Todo:
Change return type to size_t

Definition at line 3307 of file GeometryCore.h.

References geo::PlaneGeo::NElements().

3308  {
3309  PlaneGeo const* pPlane = GetElementPtr(planeid);
3310  return pPlane? pPlane->NElements(): 0;
3311  }
CryostatGeo const * GetElementPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
unsigned int geo::GeometryCore::OpChannel ( int  detNum,
int  hardwareChannel 
) const

Convert detector number and hardware channel to unique channel.

Definition at line 230 of file GeometryCore.cxx.

References fChannelMapAlg.

231  {
232  return fChannelMapAlg->OpChannel(detNum, hardwareChannel);
233  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::OpDetFromCryo ( unsigned int  o,
unsigned int  c 
) const

Get unique opdet number from cryo and internal count.

Definition at line 1880 of file GeometryCore.cxx.

References Cryostat(), Ncryostats(), and geo::CryostatGeo::NOpDet().

Referenced by GetClosestOpDet().

1881  {
1882  static bool Loaded=false;
1883  static std::vector<unsigned int> LowestID;
1884  static unsigned int NCryo;
1885  // If not yet loaded static parameters, do it
1886  if(Loaded == false){
1887 
1888  Loaded = true;
1889 
1890  // Store the lowest ID for each cryostat
1891  NCryo=Ncryostats();
1892  LowestID.resize(NCryo + 1);
1893  LowestID.at(0)=0;
1894  for(size_t cryo=0; cryo!=NCryo; ++cryo){
1895  LowestID.at(cryo+1)=LowestID.at(cryo)+Cryostat(c).NOpDet();
1896  }
1897 
1898  }
1899 
1900  if( (c < NCryo) && (o < Cryostat(c).NOpDet())){
1901  return LowestID.at(c)+o;
1902  }
1903  else{
1904  throw cet::exception("OpDetCryoToOpID Error") << "Coordinates c=" << c
1905  << ", o=" << o
1906  << " out of range. Abort\n";
1907  }
1908 
1909  // if all is well, we never get to this point in the method
1910  // but still a good idea to be sure to always return something.
1911 
1912  return INT_MAX;
1913  }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:295
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const OpDetGeo & geo::GeometryCore::OpDetGeoFromOpChannel ( unsigned int  OpChannel) const

Access the OpDetGeo object by OpDet or Channel Number.

Definition at line 1916 of file GeometryCore.cxx.

References OpDetFromOpChannel(), and OpDetGeoFromOpDet().

Referenced by opdet::GetHitGeometryInfo().

1917  {
1918  return this->OpDetGeoFromOpDet(this->OpDetFromOpChannel(OpChannel));
1919  }
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Number of OpDets in the whole detector.
unsigned int OpDetFromOpChannel(int opChannel) const
Convert unique channel to detector number.
unsigned int OpChannel(int detNum, int hardwareChannel) const
Convert detector number and hardware channel to unique channel.
const OpDetGeo & geo::GeometryCore::OpDetGeoFromOpDet ( unsigned int  OpDet) const

Number of OpDets in the whole detector.

Definition at line 1922 of file GeometryCore.cxx.

References Cryostat(), Ncryostats(), geo::CryostatGeo::NOpDet(), and geo::CryostatGeo::OpDet().

Referenced by phot::CreateHybridLibrary::CreateHybridLibrary(), phot::PhotonVisibilityService::DistanceToOpDet(), larg4::OpDetLookup::FindClosestOpDet(), phot::PhotonLibraryHybrid::GetCount(), OpDetGeoFromOpChannel(), larg4::OpFastScintillation::propagation_time(), and phot::PhotonVisibilityService::SolidAngleFactor().

1923  {
1924  static bool Loaded=false;
1925  static std::vector<unsigned int> LowestID;
1926  static size_t NCryo;
1927  // If not yet loaded static parameters, do it
1928  if(Loaded == false){
1929 
1930  Loaded = true;
1931 
1932  // Store the lowest ID for each cryostat
1933  NCryo=Ncryostats();
1934  LowestID.resize(NCryo + 1);
1935  LowestID[0] = 0;
1936  for(size_t cryo = 0; cryo != NCryo; ++cryo){
1937  LowestID[cryo+1] = LowestID[cryo] + Cryostat(cryo).NOpDet();
1938  }
1939 
1940  }
1941 
1942  for(size_t i=0; i!=NCryo; ++i){
1943  if( (OpDet >= LowestID[i]) && (OpDet < LowestID[i+1]) ){
1944  int c = i;
1945  int o = OpDet-LowestID[i];
1946  return this->Cryostat(c).OpDet(o);
1947  }
1948  }
1949  // If we made it here, we didn't find the right combination. abort
1950  throw cet::exception("OpID To OpDetCryo error")<<"OpID out of range, "<< OpDet << "\n";
1951 
1952  // Will not reach due to exception
1953  return this->Cryostat(0).OpDet(0);
1954  }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
const OpDetGeo & OpDet(unsigned int iopdet) const
Return the iopdet&#39;th optical detector in the cryostat.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:295
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::string geo::GeometryCore::OpDetGeoName ( unsigned int  c = 0) const

Returns gdml string which gives sensitive opdet name.

Parameters
cID of the cryostat the detector is in

This name is defined in the geometry (GDML) description.

Todo:
Change to use CryostatID

Definition at line 1873 of file GeometryCore.cxx.

References Cryostat(), and geo::CryostatGeo::OpDetGeoName().

Referenced by larg4::LArG4::beginJob().

1874  {
1875  return Cryostat(c).OpDetGeoName();
1876  }
std::string OpDetGeoName() const
Get name of opdet geometry element.
Definition: CryostatGeo.h:311
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
GeometryCore& geo::GeometryCore::operator= ( GeometryCore const &  )
delete
GeometryCore& geo::GeometryCore::operator= ( GeometryCore &&  )
delete
PlaneGeo const& geo::GeometryCore::Plane ( unsigned int const  p,
unsigned int const  tpc = 0,
unsigned int const  cstat = 0 
) const
inline

Returns the specified wire.

Parameters
planeidID of the plane
pplane number within the TPC
tpcTPC number within the cryostat
cstatnumber of cryostat
Returns
a constant reference to the specified plane
Exceptions
cet::exception(GeometryCore category) if cryostat not present
cet::exception(TPCOutOfRange category) if no such TPC
cet::exception(PlaneOutOfRange category) if no such plane

The GetElement() method is overloaded and its return depends on the type of ID.

Todo:
remove the version with integers

Definition at line 2945 of file GeometryCore.h.

Referenced by cluster::ClusterAna::analyze(), pfpf::PFPAna::analyze(), cluster::DBclusterAna::analyze(), hit::GausHitFinderAna::analyze(), cluster::ClusterMergeHelper::AppendResult(), util::GeometryUtilities::CalculatePitch(), util::GeometryUtilities::CalculatePitchPolar(), trkf::Track3DKalmanSPS::dQdxCalc(), tca::FilldEdx(), filter::MuonFilter::filter(), evd::TWQMultiTPCProjectionView::FindEndPoint(), evd::TWQProjectionView::FindEndPoint(), evd::TWQMultiTPCProjectionView::FindLineLength(), evd::TWQProjectionView::FindLineLength(), util::GeometryUtilities::Get2DangleFrom3D(), util::GeometryUtilities::Get2DPointProjection(), calo::Calorimetry::GetPitch(), util::GeometryUtilities::GetProjectedPoint(), util::GeometryUtilities::GetTimeTicks(), util::GeometryUtilities::GetXYZ(), shower::EMShowerAlg::MakeShower(), lar_cluster3d::StandardHit3DBuilder::NearestWireID(), NearestWireID(), util::GeometryUtilities::PitchInView(), cluster::SimpleClusterMerger::produce(), cluster::FuzzyClusterMerger::produce(), trkf::SpacePts::produce(), trkf::Track3Dreco::produce(), cluster::SmallClusterFinder::produce(), calo::Calorimetry::produce(), vertex::VertexFinder2D::produce(), shwf::ShowerReco::produce(), evd::GraphCluster::produce(), util::GeometryUtilities::Reconfigure(), detsim::SimWire::SetFieldResponse(), View(), WireCoordinate(), and WirePitch().

2947  { return Plane(geo::PlaneID(cstat, tpc, p)); }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
PlaneGeo const& geo::GeometryCore::Plane ( geo::PlaneID const &  planeid) const
inline

Returns the specified wire.

Parameters
planeidID of the plane
pplane number within the TPC
tpcTPC number within the cryostat
cstatnumber of cryostat
Returns
a constant reference to the specified plane
Exceptions
cet::exception(GeometryCore category) if cryostat not present
cet::exception(TPCOutOfRange category) if no such TPC
cet::exception(PlaneOutOfRange category) if no such plane

The GetElement() method is overloaded and its return depends on the type of ID.

Todo:
remove the version with integers

Definition at line 2948 of file GeometryCore.h.

2949  { return TPC(planeid).Plane(planeid); }
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:299
std::set< PlaneID > const & geo::GeometryCore::PlaneIDs ( ) const

Returns a list of possible PlaneIDs in the detector.

Returns
a constant reference to the set of plane IDs
Deprecated:
use IteratePlaneIDs() instead plane IDs of DUNE FD? probably better to use iterators instead

Definition at line 572 of file GeometryCore.cxx.

References fChannelMapAlg.

573  {
574  return fChannelMapAlg->PlaneIDs();
575  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
double geo::GeometryCore::PlanePitch ( geo::TPCID const &  tpcid,
geo::PlaneID::PlaneID_t  p1 = 0,
geo::PlaneID::PlaneID_t  p2 = 1 
) const

Returns the distance between two planes.

Parameters
p1index of the first plane
p2index of the second plane
tpctpc number within the cryostat
cstatcryostat number
Returns
distance between the planes
Todo:

add a version with plane IDs

deprecate this function

add a default version for a given TPCID

add a version with two plane indices for a given TPCID

return the absolute value of the distance (makes the order unimportant)

document what will happen (in the future methods) with planes on different TPCs

Definition at line 759 of file GeometryCore.cxx.

References geo::TPCGeo::PlanePitch(), and TPC().

Referenced by PlanePitch(), trkf::SpacePts::produce(), and trkf::Track3Dreco::produce().

763  {
764  return TPC(tpcid).PlanePitch(p1, p2);
765  }
double PlanePitch(unsigned int p1=0, unsigned int p2=1) const
Returns the center of the TPC volume in world coordinates [cm].
Definition: TPCGeo.cxx:419
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
double geo::GeometryCore::PlanePitch ( geo::PlaneID const &  pid1,
geo::PlaneID const &  pid2 
) const

Returns the distance between two planes.

Parameters
p1index of the first plane
p2index of the second plane
tpctpc number within the cryostat
cstatcryostat number
Returns
distance between the planes
Todo:

add a version with plane IDs

deprecate this function

add a default version for a given TPCID

add a version with two plane indices for a given TPCID

return the absolute value of the distance (makes the order unimportant)

document what will happen (in the future methods) with planes on different TPCs

Definition at line 768 of file GeometryCore.cxx.

References geo::TPCID::asTPCID(), geo::PlaneID::Plane, and PlanePitch().

769  {
770  return PlanePitch(pid1.asTPCID(), pid1.Plane, pid2.Plane);
771  }
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.
double geo::GeometryCore::PlanePitch ( unsigned int  p1 = 0,
unsigned int  p2 = 1,
unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const

Returns the distance between two planes.

Parameters
p1index of the first plane
p2index of the second plane
tpctpc number within the cryostat
cstatcryostat number
Returns
distance between the planes
Todo:

add a version with plane IDs

deprecate this function

add a default version for a given TPCID

add a version with two plane indices for a given TPCID

return the absolute value of the distance (makes the order unimportant)

document what will happen (in the future methods) with planes on different TPCs

Definition at line 773 of file GeometryCore.cxx.

References PlanePitch().

777  {
778  return PlanePitch(geo::TPCID(cstat, tpc), p1, p2);
779  }
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.
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
PlaneGeo const* geo::GeometryCore::PlanePtr ( geo::PlaneID const &  planeid) const
inline

Returns the specified plane.

Parameters
planeidplane ID
Returns
a constant pointer to the specified plane, or nullptr if none

The GetElementPtr() method is overloaded and its return depends on the type of ID.

Definition at line 2963 of file GeometryCore.h.

References geo::TPCGeo::PlanePtr().

2964  {
2965  geo::TPCGeo const* pTPC = TPCPtr(planeid);
2966  return pTPC? pTPC->PlanePtr(planeid): nullptr;
2967  } // PlanePtr()
Geometry information for a single TPC.
Definition: TPCGeo.h:37
TPCGeo const * TPCPtr(geo::TPCID const &tpcid) const
Returns the specified TPC.
PlaneGeo const * PlanePtr(unsigned int iplane) const
Returns the plane number iplane from this TPC.
Definition: TPCGeo.h:203
raw::ChannelID_t geo::GeometryCore::PlaneWireToChannel ( WireID const &  wireid) const

Returns the ID of the TPC channel connected to the specified wire.

Parameters
planethe number of plane
wirethe number of wire
tpcthe number of TPC
cryostatthe number of cryostat
wireidthe ID of the wire
Returns
the ID of the channel, or raw::InvalidChannelID if invalid wire
Todo:

Verify the raw::InvalidChannelID part

remove the integers version

Definition at line 1290 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by hit::MCHitAnaExample::analyze(), cluster::BlurredClusteringAlg::ConvertRecobHitsToVector(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), evd_tool::MicroBooNEDrawer::DrawBadChannels(), evd_tool::ICARUSDrawer::DrawBadChannels(), evd::RawDataDrawer::FillTQHisto(), tca::FillWireHitRange(), vertex::FeatureVertexFinder::Find3dVtxFrom2dClusterVtxCand(), evd::TWQMultiTPCProjectionView::FindEndPoint(), evd::TWQMultiTPCProjectionView::FindLineLength(), cmtool::CFAlgoStartTimeCompat::Float(), vertex::FeatureVertexFinder::Get3dVertexCandidates(), tca::GetOrigin(), util::GeometryUtilities::GetProjectedPoint(), util::GeometryUtilities::GetYZ(), cluster::DBScan3DAlg::init(), apa::DisambigAlg::MakeCloseHits(), NearestChannel(), wc::MergeWireCell::produce(), calo::Calorimetry::produce(), vertex::VertexFinder2D::produce(), shwf::ShowerReco::produce(), lariov::SIOVElectronicsCalibProvider::Reconfigure(), lariov::DetPedestalRetrievalAlg::Reconfigure(), pma::ProjectionMatchingAlg::validate(), pma::ProjectionMatchingAlg::validate_on_adc(), pma::ProjectionMatchingAlg::validate_on_adc_test(), and evd::RecoBaseDrawer::Wire2D().

1291  {
1292  return fChannelMapAlg->PlaneWireToChannel(wireid);
1293  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
raw::ChannelID_t geo::GeometryCore::PlaneWireToChannel ( unsigned int const  plane,
unsigned int const  wire,
unsigned int const  tpc = 0,
unsigned int const  cstat = 0 
) const
inline

Returns the number of TPC readout channels in the detector.

Definition at line 4633 of file GeometryCore.h.

4637  { return PlaneWireToChannel(geo::WireID(cstat, tpc, plane, wire)); }
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
bool geo::GeometryCore::PointWithinSegments ( 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 
)
staticprivate

Returns whether x and y are within both specified ranges (A and B).

Definition at line 2005 of file GeometryCore.cxx.

References geo::details::geometry_iterator_types::begin_pos, coordIs, geo::details::geometry_iterator_types::end_pos, geo::details::geometry_iterator_types::undefined_pos, and lar::util::RealComparisons< RealType >::withinSorted().

Referenced by IntersectSegments().

2009  {
2010  return coordIs.withinSorted(x, A_start_x, A_end_x)
2011  && coordIs.withinSorted(y, A_start_y, A_end_y)
2012  && coordIs.withinSorted(x, B_start_x, B_end_x)
2013  && coordIs.withinSorted(y, B_start_y, B_end_y)
2014  ;
2015 
2016  } // GeometryCore::PointWithinSegments()
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
constexpr bool withinSorted(Value_t value, Value_t lower, Value_t upper) const
Returns whether value is between bounds (included); bounds are sorted.
static lar::util::RealComparisons< geo::Length_t > coordIs
Value of tolerance for equality comparisons.
const AuxDetGeo & geo::GeometryCore::PositionToAuxDet ( geo::Point_t const &  point,
unsigned int &  ad 
) const

Returns the auxiliary detector at specified location.

Parameters
pointlocation to be tested
ad_(output)_ the auxiliary detector index
Returns
constant reference to AuxDetGeo object of the auxiliary detector
Todo:
what happens if it does not exist?

Definition at line 470 of file GeometryCore.cxx.

References AuxDet(), and FindAuxDetAtPosition().

Referenced by larg4::AuxDetReadoutGeometry::FindAndMakeAuxDet(), FindAuxDetAtPosition(), and PositionToAuxDet().

471  {
472  // locate the desired Auxiliary Detector
473  ad = FindAuxDetAtPosition(point);
474  return AuxDet(ad);
475  }
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
unsigned int FindAuxDetAtPosition(double const worldLoc[3]) const
Returns the index of the auxiliary detector at specified location.
const AuxDetGeo & geo::GeometryCore::PositionToAuxDet ( double const  worldLoc[3],
unsigned int &  ad 
) const

Returns the auxiliary detector at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
ad(output) the auxiliary detector index
Returns
constant reference to AuxDetGeo object of the auxiliary detector
Deprecated:
Use the version with geo::Point_t.
Todo:
what happens if it does not exist?

Definition at line 479 of file GeometryCore.cxx.

References FindAuxDetSensitiveAtPosition(), geo::vect::makePointFromCoords(), and PositionToAuxDet().

480  { return PositionToAuxDet(geo::vect::makePointFromCoords(worldLoc), ad); }
AuxDetGeo const & PositionToAuxDet(geo::Point_t const &point, unsigned int &ad) const
Returns the auxiliary detector at specified location.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
const AuxDetSensitiveGeo & geo::GeometryCore::PositionToAuxDetSensitive ( geo::Point_t const &  point,
size_t &  ad,
size_t &  sv 
) const

Returns the auxiliary detector at specified location.

Parameters
pointlocation to be tested
ad_(output)_ the auxiliary detector index
sv_(output)_ the auxiliary detector sensitive volume index
Returns
reference to AuxDetSensitiveGeo object of the auxiliary detector
Todo:
what happens if it does not exist?

Definition at line 501 of file GeometryCore.cxx.

References AuxDet(), FindAuxDetSensitiveAtPosition(), and geo::AuxDetGeo::SensitiveVolume().

Referenced by FindAuxDetSensitiveAtPosition(), and PositionToAuxDetSensitive().

502  {
503  // locate the desired Auxiliary Detector
504  FindAuxDetSensitiveAtPosition(point, ad, sv);
505  return AuxDet(ad).SensitiveVolume(sv);
506  }
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
Definition: AuxDetGeo.h:159
void FindAuxDetSensitiveAtPosition(geo::Point_t const &point, std::size_t &adg, std::size_t &sv) const
Fills the indices of the sensitive auxiliary detector at location.
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
const AuxDetSensitiveGeo & geo::GeometryCore::PositionToAuxDetSensitive ( double const  worldLoc[3],
size_t &  ad,
size_t &  sv 
) const

Returns the auxiliary detector at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
ad(output) the auxiliary detector index
sv(output) the auxiliary detector sensitive volume index
Returns
reference to AuxDetSensitiveGeo object of the auxiliary detector
Todo:
what happens if it does not exist?
Deprecated:
Use the version with geo::Point_t.

Definition at line 510 of file GeometryCore.cxx.

References geo::vect::makePointFromCoords(), and PositionToAuxDetSensitive().

511  { return PositionToAuxDetSensitive(geo::vect::makePointFromCoords(worldLoc), ad, sv); }
const AuxDetSensitiveGeo & PositionToAuxDetSensitive(geo::Point_t const &point, size_t &ad, size_t &sv) const
Returns the auxiliary detector at specified location.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
geo::CryostatGeo const & geo::GeometryCore::PositionToCryostat ( geo::Point_t const &  point) const

Returns the cryostat at specified location.

Parameters
pointthe location [cm]
Returns
a constant reference to the geo::CryostatGeo containing point
Exceptions
cet::exception("Geometry" category) if no cryostat matches

The tolerance used here is the one returned by DefaultWiggle().

Definition at line 419 of file GeometryCore.cxx.

References PositionToCryostatPtr().

Referenced by larg4::LArVoxelReadoutGeometry::FindNestedVolume(), PositionToCryostat(), PositionToTPCID(), and detsim::SimDriftElectrons::produce().

420  {
421  geo::CryostatGeo const* cstat = PositionToCryostatPtr(point);
422  if (!cstat) {
423  throw cet::exception("GeometryCore")
424  << "Can't find any cryostat at position " << point << "\n";
425  }
426  return *cstat;
427  } // GeometryCore::PositionToCryostat()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
geo::CryostatGeo const * PositionToCryostatPtr(geo::Point_t const &point) const
Returns the cryostat at specified location.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
CryostatGeo const& geo::GeometryCore::PositionToCryostat ( double const  point[3]) const
inline

Returns the cryostat at specified location.

Parameters
pointthe location [cm]
Returns
a constant reference to the geo::CryostatGeo containing point
Exceptions
cet::exception("Geometry" category) if no cryostat matches

The tolerance used here is the one returned by DefaultWiggle().

Definition at line 2067 of file GeometryCore.h.

References geo::vect::makePointFromCoords().

CryostatGeo const & PositionToCryostat(geo::Point_t const &point) const
Returns the cryostat at specified location.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
const CryostatGeo & geo::GeometryCore::PositionToCryostat ( double const  worldLoc[3],
geo::CryostatID cid 
) const

Returns the cryostat at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
cid(output) cryostat ID
Returns
a constant reference to the CryostatGeo object of the cryostat
Exceptions
cet::exception("Geometry" category) if no cryostat matches

The tolerance used here is the one returned by DefaultWiggle().

Deprecated:
Use PositionToCryostat(geo::Point_t const&) instead.

Definition at line 432 of file GeometryCore.cxx.

References Cryostat(), FindCryostatAtPosition(), geo::CryostatID::InvalidID, and PositionToCryostat().

433  {
435 
436  if(cstat == geo::CryostatID::InvalidID)
437  throw cet::exception("GeometryCore") << "Can't find Cryostat for position ("
438  << worldLoc[0] << ","
439  << worldLoc[1] << ","
440  << worldLoc[2] << ")\n";
441  cid = geo::CryostatID(cstat);
442  return Cryostat(cid);
443  } // GeometryCore::PositionToCryostat(double[3], CryostatID)
unsigned int CryostatID_t
Type for the ID number.
Definition: geo_types.h:121
geo::CryostatID CryostatID
Definition: readout_types.h:30
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
static const CryostatID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:126
geo::CryostatID::CryostatID_t FindCryostatAtPosition(geo::Point_t const &worldLoc) const
Returns the index of the cryostat at specified location.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const CryostatGeo & geo::GeometryCore::PositionToCryostat ( double const  worldLoc[3],
unsigned int &  cstat 
) const

Returns the cryostat at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
cstat(output) number of cryostat
Returns
a constant reference to the CryostatGeo object of the cryostat
Exceptions
cet::exception("Geometry" category) if no cryostat matches

The tolerance used here is the one returned by DefaultWiggle().

Deprecated:
Use PositionToCryostat(geo::Point_t const&) instead.

Definition at line 446 of file GeometryCore.cxx.

References geo::CryostatID::Cryostat, and PositionToCryostat().

447  {
448  geo::CryostatID cid;
449  geo::CryostatGeo const& cryo = PositionToCryostat(worldLoc, cid);
450  cstat = cid.Cryostat;
451  return cryo;
452  } // GeometryCore::PositionToCryostat(double[3], unsigned int)
CryostatGeo const & PositionToCryostat(geo::Point_t const &point) const
Returns the cryostat at specified location.
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:130
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
The data type to uniquely identify a cryostat.
Definition: geo_types.h:120
geo::CryostatID geo::GeometryCore::PositionToCryostatID ( geo::Point_t const &  point) const

Returns the ID of the cryostat at specified location.

Parameters
pointthe location [cm]
Returns
ID of the cryostat including point (invalid if none)

The tolerance used here is the one returned by DefaultWiggle().

Definition at line 343 of file GeometryCore.cxx.

References FindCryostatAtPosition(), geo::CryostatGeo::ID(), and PositionToCryostatPtr().

Referenced by PositionToCryostatPtr().

344  {
345  geo::CryostatGeo const* cryo = PositionToCryostatPtr(point);
346  return cryo? cryo->ID(): geo::CryostatID{};
347  } // GeometryCore::PositionToCryostatID()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
geo::CryostatGeo const * PositionToCryostatPtr(geo::Point_t const &point) const
Returns the cryostat at specified location.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:120
geo::CryostatID const & ID() const
Returns the identifier of this cryostat.
Definition: CryostatGeo.h:116
geo::CryostatGeo const * geo::GeometryCore::PositionToCryostatPtr ( geo::Point_t const &  point) const

Returns the cryostat at specified location.

Parameters
pointthe location [cm]
Returns
pointer to the geo::CryostatGeo including point, or nullptr

The tolerance used here is the one returned by DefaultWiggle().

Definition at line 331 of file GeometryCore.cxx.

References fPositionWiggle, IterateCryostats(), and PositionToCryostatID().

Referenced by FindCryostatAtPosition(), FindTPCAtPosition(), GetClosestOpDet(), PositionToCryostat(), PositionToCryostatID(), and PositionToTPCptr().

332  {
333  for (geo::CryostatGeo const& cryostat: IterateCryostats()) {
334  if (cryostat.ContainsPosition(point, 1.0 + fPositionWiggle))
335  return &cryostat;
336  }
337  return nullptr;
338  } // GeometryCore::PositionToCryostatPtr()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
double fPositionWiggle
accounting for rounding errors when testing positions
IteratorBox< cryostat_iterator,&GeometryCore::begin_cryostat,&GeometryCore::end_cryostat > IterateCryostats() const
Enables ranged-for loops on all cryostats of the detector.
geo::TPCGeo const & geo::GeometryCore::PositionToTPC ( geo::Point_t const &  point) const

Returns the TPC at specified location.

Parameters
pointthe location [cm]
Returns
a constant reference to the geo::TPCGeo including point
Exceptions
cet::exception("Geometry" category) if no TPC matches

Definition at line 378 of file GeometryCore.cxx.

References PositionToTPCptr().

Referenced by larg4::LArVoxelReadoutGeometry::FindNestedVolume(), lar_pandora::PFParticleMonitoring::GetStartAndEndPoints(), lar_pandora::LArPandoraInput::GetTrueX0(), apa::APAGeometryAlg::LineSegChanIntersect(), PositionToTPC(), PositionToTPCptr(), detsim::SimDriftElectrons::produce(), cheat::BackTracker::SpacePointHitsToWeightedXYZ(), and opreco::OpticalRecoAna::update_MC_particle_time().

379  {
380  geo::TPCGeo const* tpc = PositionToTPCptr(point);
381  if (!tpc) {
382  throw cet::exception("GeometryCore")
383  << "Can't find any TPC at position " << point << "\n";
384  }
385  return *tpc;
386  } // GeometryCore::PositionToTPC()
Geometry information for a single TPC.
Definition: TPCGeo.h:37
geo::TPCGeo const * PositionToTPCptr(geo::Point_t const &point) const
Returns the TPC at specified location.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
TPCGeo const& geo::GeometryCore::PositionToTPC ( double const  point[3]) const
inline

Returns the TPC at specified location.

Parameters
pointthe location [cm]
Returns
a constant reference to the geo::TPCGeo including point
Exceptions
cet::exception("Geometry" category) if no TPC matches

Definition at line 2454 of file GeometryCore.h.

References geo::vect::makePointFromCoords().

2455  { return PositionToTPC(geo::vect::makePointFromCoords(point)); }
geo::TPCGeo const & PositionToTPC(geo::Point_t const &point) const
Returns the TPC at specified location.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
TPCGeo const & geo::GeometryCore::PositionToTPC ( double const  worldLoc[3],
unsigned int &  tpc,
unsigned int &  cstat 
) const

Returns the TPC at specified location.

Parameters
pointthe location [cm]
tpc_(output)_ where to store the number of TPC
cstat_(output)_ where to store the number of cryostat
Returns
a constant reference to the geo::TPCGeo including point
Exceptions
cet::exception("Geometry" category) if no TPC matches
Deprecated:
Use PositionToTPCID() or PositionToTPC().ID()

Definition at line 401 of file GeometryCore.cxx.

References geo::CryostatID::Cryostat, geo::TPCGeo::ID(), PositionToTPC(), geo::TPCID::TPC, and TPC().

402  {
403  geo::TPCGeo const& TPC = PositionToTPC(worldLoc);
404  cstat = TPC.ID().Cryostat;
405  tpc = TPC.ID().TPC;
406  return TPC;
407  } // GeometryCore::PositionToTPC(double*, TPCID&)
geo::TPCID const & ID() const
Returns the identifier of this TPC.
Definition: TPCGeo.h:278
Geometry information for a single TPC.
Definition: TPCGeo.h:37
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:130
geo::TPCGeo const & PositionToTPC(geo::Point_t const &point) const
Returns the TPC at specified location.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:203
TPCGeo const & geo::GeometryCore::PositionToTPC ( double const  worldLoc[3],
TPCID tpcid 
) const

Returns the TPC at specified location.

Parameters
pointthe location [cm]
tpcid_(output)_ where to store the TPC ID
Returns
a constant reference to the geo::TPCGeo including point
Exceptions
cet::exception("Geometry" category) if no TPC matches
Deprecated:
Use PositionToTPCID() or PositionToTPC().ID()

Definition at line 391 of file GeometryCore.cxx.

References geo::TPCGeo::ID(), PositionToTPC(), and TPC().

392  {
393  geo::TPCGeo const& TPC = PositionToTPC(worldLoc);
394  tpcid = TPC.ID();
395  return TPC;
396  } // GeometryCore::PositionToTPC(double*, TPCID&)
geo::TPCID const & ID() const
Returns the identifier of this TPC.
Definition: TPCGeo.h:278
Geometry information for a single TPC.
Definition: TPCGeo.h:37
geo::TPCGeo const & PositionToTPC(geo::Point_t const &point) const
Returns the TPC at specified location.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
geo::TPCID geo::GeometryCore::PositionToTPCID ( geo::Point_t const &  point) const

Returns the ID of the TPC at specified location.

Parameters
pointthe location [cm]
Returns
ID of the TPC at specified location, invalid if none
See also
PositionToTPC()

Definition at line 411 of file GeometryCore.cxx.

References geo::TPCGeo::ID(), PositionToCryostat(), and PositionToTPCptr().

411  {
412  geo::TPCGeo const* tpc = PositionToTPCptr(point);
413  return tpc? tpc->ID(): geo::TPCID{};
414  } // GeometryCore::PositionToTPCID()
geo::TPCID const & ID() const
Returns the identifier of this TPC.
Definition: TPCGeo.h:278
Geometry information for a single TPC.
Definition: TPCGeo.h:37
geo::TPCGeo const * PositionToTPCptr(geo::Point_t const &point) const
Returns the TPC at specified location.
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
geo::TPCGeo const * geo::GeometryCore::PositionToTPCptr ( geo::Point_t const &  point) const

Returns the TPC at specified location.

Parameters
pointthe location [cm]
Returns
the geo::TPCGeo including point, or nullptr if none

Definition at line 369 of file GeometryCore.cxx.

References fPositionWiggle, PositionToCryostatPtr(), PositionToTPC(), and geo::CryostatGeo::PositionToTPCptr().

Referenced by FindCryostatAtPosition(), PositionToTPC(), and PositionToTPCID().

370  {
371  geo::CryostatGeo const* cryo = PositionToCryostatPtr(point);
372  return cryo? cryo->PositionToTPCptr(point, 1. + fPositionWiggle): nullptr;
373  } // GeometryCore::PositionToTPCptr()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
geo::TPCGeo const * PositionToTPCptr(geo::Point_t const &point, double wiggle) const
Returns a pointer to the TPC at specified location.
double fPositionWiggle
accounting for rounding errors when testing positions
geo::CryostatGeo const * PositionToCryostatPtr(geo::Point_t const &point) const
Returns the cryostat at specified location.
template<typename Stream >
void geo::GeometryCore::Print ( Stream &&  out,
std::string  indent = "  " 
) const

Prints geometry information with maximum verbosity.

Definition at line 5546 of file GeometryCore.h.

References geo::PlaneGeo::ID(), art::detail::indent(), geo::AuxDetSensitiveGeo::MaxVerbosity, geo::OpDetGeo::MaxVerbosity, geo::AuxDetGeo::MaxVerbosity, geo::WireGeo::MaxVerbosity, geo::TPCGeo::MaxVerbosity, geo::PlaneGeo::MaxVerbosity, geo::TPCGeo::Nplanes(), geo::AuxDetGeo::NSensitiveVolume(), geo::PlaneGeo::Nwires(), geo::TPCGeo::Plane(), geo::AuxDetSensitiveGeo::PrintAuxDetInfo(), geo::AuxDetGeo::PrintAuxDetInfo(), geo::OpDetGeo::PrintOpDetInfo(), geo::PlaneGeo::PrintPlaneInfo(), geo::TPCGeo::PrintTPCInfo(), geo::WireGeo::PrintWireInfo(), geo::AuxDetGeo::SensitiveVolume(), w, and geo::PlaneGeo::Wire().

Referenced by geo::DumpGeometry::dumpGeometryCore(), and WireEndPoints().

5547 {
5548 
5549  out << "Detector " << DetectorName() << " has "
5550  << Ncryostats() << " cryostats and "
5551  << NAuxDets() << " auxiliary detectors:";
5552 
5553  auto const& detEnclosureBox = DetectorEnclosureBox();
5554  out << "\n" << indent << "Detector enclosure: "
5555  << detEnclosureBox.Min() << " -- " << detEnclosureBox.Max()
5556  << " cm => ( " << detEnclosureBox.SizeX() << " x "
5557  << detEnclosureBox.SizeY() << " x "
5558  << detEnclosureBox.SizeZ() << " ) cm^3"
5559  ;
5560 
5561  for (geo::CryostatGeo const& cryostat: IterateCryostats()) {
5562  out << "\n" << indent;
5563  cryostat.PrintCryostatInfo
5564  (std::forward<Stream>(out), indent + " ", cryostat.MaxVerbosity);
5565 
5566  const unsigned int nTPCs = cryostat.NTPC();
5567  for(unsigned int t = 0; t < nTPCs; ++t) {
5568  const geo::TPCGeo& tpc = cryostat.TPC(t);
5569 
5570  out << "\n" << indent << " ";
5571  tpc.PrintTPCInfo
5572  (std::forward<Stream>(out), indent + " ", tpc.MaxVerbosity);
5573 
5574  const unsigned int nPlanes = tpc.Nplanes();
5575  for(unsigned int p = 0; p < nPlanes; ++p) {
5576  const geo::PlaneGeo& plane = tpc.Plane(p);
5577  const unsigned int nWires = plane.Nwires();
5578 
5579  out << "\n" << indent << " ";
5580  plane.PrintPlaneInfo
5581  (std::forward<Stream>(out), indent + " ", plane.MaxVerbosity);
5582 
5583  for(unsigned int w = 0; w < nWires; ++w) {
5584  const geo::WireGeo& wire = plane.Wire(w);
5585  geo::WireID wireID(plane.ID(), w);
5586 
5587  // the wire should be aligned on z axis, half on each side of 0,
5588  // in its local frame
5589  out << "\n" << indent << " " << wireID << " ";
5590  wire.PrintWireInfo
5591  (std::forward<Stream>(out), indent + " ", wire.MaxVerbosity);
5592  } // for wire
5593  } // for plane
5594  } // for TPC
5595 
5596  unsigned int nOpDets = cryostat.NOpDet();
5597  for (unsigned int iOpDet = 0; iOpDet < nOpDets; ++iOpDet) {
5598  geo::OpDetGeo const& opDet = cryostat.OpDet(iOpDet);
5599  out << "\n" << indent << " [OpDet #" << iOpDet << "] ";
5600  opDet.PrintOpDetInfo
5601  (std::forward<Stream>(out), indent + " ", opDet.MaxVerbosity);
5602  } // for
5603  } // for cryostat
5604 
5605  unsigned int const nAuxDets = NAuxDets();
5606  for (unsigned int iDet = 0; iDet < nAuxDets; ++iDet) {
5607  geo::AuxDetGeo const& auxDet = AuxDet(iDet);
5608 
5609  out << "\n" << indent << "[#" << iDet << "] ";
5610  auxDet.PrintAuxDetInfo
5611  (std::forward<Stream>(out), indent + " ", auxDet.MaxVerbosity);
5612 
5613  unsigned int const nSensitive = auxDet.NSensitiveVolume();
5614  switch (nSensitive) {
5615  case 0: break;
5616  case 1: {
5617  geo::AuxDetSensitiveGeo const& auxDetS = auxDet.SensitiveVolume(0U);
5618  out << "\n" << indent << " ";
5619  auxDetS.PrintAuxDetInfo
5620  (std::forward<Stream>(out), indent + " ", auxDetS.MaxVerbosity);
5621  break;
5622  }
5623  default:
5624  for (unsigned int iSens = 0; iSens < nSensitive; ++iSens) {
5625  out << "\n" << indent << "[#" << iSens << "] ";
5626  geo::AuxDetSensitiveGeo const& auxDetS
5627  = auxDet.SensitiveVolume(iSens);
5628  auxDetS.PrintAuxDetInfo
5629  (std::forward<Stream>(out), indent + " ", auxDetS.MaxVerbosity);
5630  } // for
5631  break;
5632  } // if sensitive detectors
5633 
5634  } // for auxiliary detector
5635 
5636  out << '\n';
5637 
5638 } // geo::GeometryCore::Print()
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:61
void PrintWireInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this wire.
Definition: WireGeo.h:386
void PrintTPCInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this TPC.
Definition: TPCGeo.h:703
WireGeo const & Wire(unsigned int iwire) const
Definition: PlaneGeo.cxx:506
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
Definition: AuxDetGeo.h:159
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:145
Geometry information for a single TPC.
Definition: TPCGeo.h:37
geo::BoxBoundedGeo DetectorEnclosureBox(std::string const &name="volDetEnclosure") const
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
std::string indent(std::size_t const i)
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
void PrintOpDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=0) const
Prints information about this optical detector.
Definition: OpDetGeo.h:199
size_t NSensitiveVolume() const
Definition: AuxDetGeo.h:160
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
void PrintAuxDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=0) const
Prints information about this auxiliary sensitive detector.
IteratorBox< cryostat_iterator,&GeometryCore::begin_cryostat,&GeometryCore::end_cryostat > IterateCryostats() const
Enables ranged-for loops on all cryostats of the detector.
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintAuxDetInfo().
void PrintPlaneInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this plane.
Definition: PlaneGeo.h:1324
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintOpDetInfo().
Definition: OpDetGeo.h:172
geo::PlaneID const & ID() const
Returns the identifier of this plane.
Definition: PlaneGeo.h:190
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintAuxDetInfo().
Definition: AuxDetGeo.h:193
unsigned int Nwires() const
Number of wires in this plane.
Definition: PlaneGeo.h:250
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintWireInfo().
Definition: WireGeo.h:251
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:299
static constexpr unsigned int MaxVerbosity
Maximum value for print verbosity.
Definition: PlaneGeo.h:645
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintTPCInfo().
Definition: TPCGeo.h:595
Float_t w
Definition: plot.C:23
void PrintAuxDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this auxiliary detector.
Definition: AuxDetGeo.h:225
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
std::string geo::GeometryCore::ROOTFile ( ) const
inline

Returns the full directory path to the geometry file source.

Returns
the full directory path to the geometry file source

This is the full path of the source of the detector geometry GeometryCore relies on.

Definition at line 1714 of file GeometryCore.h.

Referenced by geo::DumpGeometry::dumpGeometryCore(), and evgen::GENIEGen::GENIEGen().

1714 { return fROOTfile; }
std::string fROOTfile
path to geometry file for geometry in GeometryCore
TGeoManager * geo::GeometryCore::ROOTGeoManager ( ) const

Access to the ROOT geometry description manager.

Definition at line 185 of file GeometryCore.cxx.

Referenced by FindAllVolumePaths(), FindAllVolumes(), FindDetectorEnclosure(), evgen::GENIEGen::GENIEGen(), and evgen::RadioGen::SampleOne().

186  {
187  return gGeoManager;
188  }
std::vector< geo::TPCID > geo::GeometryCore::ROPtoTPCs ( readout::ROPID const &  ropid) const

Returns a list of ID of TPCs the specified ROP spans.

Parameters
ropidID of the readout plane
Returns
the list of TPC IDs, empty if readout plane ID is invalid

Note that this check is performed on the validity of the readout plane ID, that does not necessarily imply that the readout plane specified by the ID actually exists. Check if the ROP exists with HasROP(). The behaviour on non-existing readout planes is undefined.

Definition at line 1842 of file GeometryCore.cxx.

References fChannelMapAlg, and FirstChannelInROP().

Referenced by reco3d::TripletFinder::FillBadMap(), reco3d::TripletFinder::FillHitMap(), and ROPtoWirePlanes().

1843  {
1844  return fChannelMapAlg->ROPtoTPCs(ropid);
1845  } // GeometryCore::ROPtoTPCs()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
std::vector< geo::PlaneID > geo::GeometryCore::ROPtoWirePlanes ( readout::ROPID const &  ropid) const

Returns a list of ID of planes belonging to the specified ROP.

Parameters
ropidID of the readout plane
Returns
list of ID of wire planes belonging to the specified ROP

If ropid is an invalid ID, an empty list is returned. If ropid is a valid ID (i.e. an ID whose isValid flag is set) that points to a non-existent readout plane, the result is undefined. Use HasROP() to check if the readout plane actually exists.

Definition at line 1834 of file GeometryCore.cxx.

References fChannelMapAlg, and ROPtoTPCs().

Referenced by WirePlaneToROP().

1835  {
1836  return fChannelMapAlg->ROPtoWirePlanes(ropid);
1837  } // GeometryCore::ROPtoWirePlanes()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
void geo::GeometryCore::SetDetectorName ( std::string  new_name)
inlineprotected

Sets the detector name.

Definition at line 5332 of file GeometryCore.h.

Referenced by geo::Geometry::preBeginRun().

5332 { fDetectorName = new_name; }
std::string fDetectorName
Name of the detector.
SigType_t geo::GeometryCore::SignalType ( geo::PlaneID const &  pid) const

Returns the type of signal on the channels of specified TPC plane.

Parameters
planeTPC plane ID
Returns
the type of signal on the specified plane, or geo::kMysteryType

Assumes that all the channels on the plane have the same signal type.

Todo:
verify that kMysteryType is returned on invalid plane

Definition at line 537 of file GeometryCore.cxx.

References WirePlaneToROP().

Referenced by caldata::CalWireAna::analyze(), evd::Landed::analyze(), lar::example::AnalysisExample::analyze(), cluster::HoughBaseAlg::FastTransform(), reco3d::TripletFinder::FillHitMap(), hit::HitCheater::FindHitsOnChannel(), calo::GeneralCalorimetry::GeneralCalorimetry(), cluster::MergeClusterAlg::GlobalWire(), cluster::BlurredClusteringAlg::GlobalWire(), shower::EMShowerAlg::GlobalWire(), shwf::ShowerReco::LongTransEnergy(), trkf::SpacePointAlg::makeSpacePoints(), evd::TWQMultiTPCProjectionView::PrintCharge(), evd::TWQProjectionView::PrintCharge(), hit::TTHitFinder::produce(), hit::FFTHitFinder::produce(), wc::MergeWireCell::produce(), caldata::CalWire::produce(), cluster::DBcluster::produce(), cluster::fuzzyCluster::produce(), trkf::SpacePts::produce(), hit::RawHitFinder::produce(), reco3d::SpacePointSolver::produce(), detsim::SimWire::produce(), evd::RawDataDrawer::QueueDrawingBoxes(), lariov::DetPedestalRetrievalAlg::Reconfigure(), hit::RFFHitFinderAlg::Run(), cluster::fuzzyClusterAlg::run_fuzzy_cluster(), cluster::HoughBaseAlg::Transform(), evd::TWireProjPad::TWireProjPad(), trkf::SpacePointAlg::update(), and evd::RecoBaseDrawer::Wire2D().

538  {
539  // map wire plane -> readout plane -> first channel,
540  // then use SignalType(channel)
541 
542  auto const ropid = WirePlaneToROP(pid);
543  if (!ropid.isValid) {
544  throw cet::exception("GeometryCore")
545  << "SignalType(): Mapping of wire plane " << std::string(pid)
546  << " to readout plane failed!\n";
547  }
548  return SignalType(ropid);
549 
550  } // GeometryCore::SignalType(PlaneID)
readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const
Returns the ID of the ROP planeid belongs to.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
SigType_t geo::GeometryCore::SignalType ( raw::ChannelID_t const  channel) const

Returns the type of signal on the specified TPC channel.

Parameters
channelTPC channel ID
Returns
the type of signal on the specified channel, or geo::kMysteryType
Todo:
verify that kMysteryType is returned on invalid channel

Definition at line 531 of file GeometryCore.cxx.

References fChannelMapAlg.

532  {
533  return fChannelMapAlg->SignalTypeForChannel(channel);
534  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
geo::SigType_t geo::GeometryCore::SignalType ( readout::ROPID const &  ropid) const

Returns the type of signal of channels in specified readout plane.

Parameters
ropidreadout plane ID
Returns
the type of signal on the specified ROP

Assumes that all the channels on the readout plane have the same signal type. If ropid is an invalid ID, geo::kMysteryType is returned. If ropid is a valid ID (i.e. an ID whose isValid flag is set) that points to a non-existent readout plane, the result is undefined. Use HasROP() to check if the readout plane actually exists.

Definition at line 1863 of file GeometryCore.cxx.

References fChannelMapAlg.

1863  {
1864  return fChannelMapAlg->SignalTypeForROPID(ropid);
1865  } // GeometryCore::SignalType(ROPID)
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
void geo::GeometryCore::SortGeometry ( geo::GeoObjectSorter const &  sorter)
private

Runs the sorting of geometry with the sorter provided by channel mapping.

Definition at line 146 of file GeometryCore.cxx.

References AuxDets(), Cryostats(), geo::GeoObjectSorter::SortAuxDets(), util::SortByPointers(), and geo::GeoObjectSorter::SortCryostats().

Referenced by ApplyChannelMap().

146  {
147 
148  mf::LogInfo("GeometryCore") << "Sorting volumes...";
149 
150  sorter.SortAuxDets(AuxDets());
151 
152  //
153  // cryostats
154  //
156  [&sorter](auto& coll){ sorter.SortCryostats(coll); });
157 
159  for (geo::CryostatGeo& cryo: Cryostats())
160  {
161  cryo.SortSubVolumes(sorter);
162  cryo.UpdateAfterSorting(geo::CryostatID(c));
163  ++c;
164  } // for
165 
166  } // GeometryCore::SortGeometry()
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
unsigned int CryostatID_t
Type for the ID number.
Definition: geo_types.h:121
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
void SortByPointers(Coll &coll, Sorter sorter)
Applies sorting indirectly, minimizing data copy.
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
CryostatList_t & Cryostats()
Return the internal cryostat list.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:120
geo::Length_t geo::GeometryCore::SurfaceY ( ) const
inline

The position of the detector respect to earth surface.

Returns
typical y position at surface in units of cm

This is the depth (y) of the surface (where earth meets air) for this detector site. The number is expressed in world coordinates and in centimetres, and it represents the y coordinate of earth surface. A negative value means that the origin of coordinates, typically matching the detector centre, is above surface.

Todo:
check that this is actually how it is used

Definition at line 1786 of file GeometryCore.h.

Referenced by evgen::CosmicsGen::produce().

1786 { return fSurfaceY; }
double fSurfaceY
The point where air meets earth for this detector.
geo::PlaneID geo::GeometryCore::ThirdPlane ( geo::PlaneID const &  pid1,
geo::PlaneID const &  pid2 
) const

Returns the plane that is not in the specified arguments.

Parameters
pid1a plane
pid2another plane
Returns
the ID to the third plane
Exceptions
cet::exception(category: "GeometryCore") if other than 3 planes
cet::exception(category: "GeometryCore") if pid1 and pid2 match

This function requires a geometry with exactly three planes. If the two input planes are not on the same TPC, the result is undefined.

Definition at line 1574 of file GeometryCore.cxx.

References CheckIndependentPlanesOnSameTPC(), Nplanes(), and geo::PlaneID::Plane.

Referenced by IntersectSegments(), ThirdPlane_dTdW(), and ThirdPlaneSlope().

1575  {
1576  // how many planes in the TPC pid1 belongs to:
1577  const unsigned int nPlanes = Nplanes(pid1);
1578  if(nPlanes != 3) {
1579  throw cet::exception("GeometryCore")
1580  << "ThirdPlane() supports only TPCs with 3 planes, and I see "
1581  << nPlanes << " instead\n";
1582  }
1583 
1584  geo::PlaneID::PlaneID_t target_plane = nPlanes;
1585  for (geo::PlaneID::PlaneID_t iPlane = 0; iPlane < nPlanes; ++iPlane){
1586  if ((iPlane == pid1.Plane) || (iPlane == pid2.Plane)) continue;
1587  if (target_plane != nPlanes) {
1588  throw cet::exception("GeometryCore")
1589  << "ThirdPlane() found too many planes that are not "
1590  << std::string(pid1) << " nor " << std::string(pid2)
1591  << "! (first " << target_plane << ", then " << iPlane << ")\n";
1592  } // if we had a target already
1593  target_plane = iPlane;
1594  } // for
1595  if (target_plane == nPlanes) {
1596  throw cet::exception("GeometryCore")
1597  << "ThirdPlane() can't find a plane that is not " << std::string(pid1)
1598  << " nor " << std::string(pid2) << "!\n";
1599  }
1600 
1601  return geo::PlaneID(pid1, target_plane);
1602  } // GeometryCore::ThirdPlane()
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:251
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
double geo::GeometryCore::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.

Parameters
pid1ID of the plane of the first dT/dW
dTdW1dT/dW as seen on the first plane
pid2ID of the plane of the second dT/dW
dTdW2dT/dW as seen on the second plane
output_planeID of the plane on which to calculate the slope
Returns
dT/dW on the third plane, or -999. if dT/dW would be infinity
Exceptions
cet::exception(category: "GeometryCore") if different TPC
cet::exception(category: "GeometryCore") if same plane
cet::exception(category: "GeometryCore") if other than 3 planes

Given a dT/dW as projected in two planes, returns the dT/dW as projected in the third plane. The dT/dW are defined in time ticks/wide number units.

Definition at line 1651 of file GeometryCore.cxx.

References CheckIndependentPlanesOnSameTPC(), ComputeThirdPlane_dTdW(), geo::PlaneGeo::PhiZ(), geo::TPCGeo::Plane(), TPC(), and geo::PlaneGeo::WirePitch().

Referenced by ThirdPlane_dTdW().

1655  {
1656 
1657  CheckIndependentPlanesOnSameTPC(pid1, pid2, "ThirdPlane_dTdW()");
1658 
1659  geo::TPCGeo const& TPC = this->TPC(pid1);
1660 
1661  double angle[3], pitch[3];
1662  geo::PlaneGeo const* const planes[3]
1663  = { &TPC.Plane(pid1), &TPC.Plane(pid2), &TPC.Plane(output_plane) };
1664 
1665  // We need wire pitch and "wire coordinate direction" for each plane.
1666  // The latter is perpendicular to the wire orientation.
1667  // PlaneGeo::PhiZ() defines the right orientation too.
1668  for (size_t i = 0; i < 3; ++i) {
1669  angle[i] = planes[i]->PhiZ();
1670  pitch[i] = planes[i]->WirePitch();
1671  } // for
1672 
1673  return ComputeThirdPlane_dTdW(
1674  angle[0], pitch[0], slope1,
1675  angle[1], pitch[1], slope2,
1676  angle[2], pitch[2]
1677  );
1678 
1679  } // GeometryCore::ThirdPlane_dTdW()
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.
Geometry information for a single TPC.
Definition: TPCGeo.h:37
double PhiZ() const
Angle from positive z axis of the wire coordinate axis, in radians.
Definition: PlaneGeo.h:180
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
static void CheckIndependentPlanesOnSameTPC(geo::PlaneID const &pid1, geo::PlaneID const &pid2, const char *caller)
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:299
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Definition: PlaneGeo.h:367
double geo::GeometryCore::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.

Parameters
pid1ID of the plane of the first dT/dW
dTdW1dT/dW as seen on the first plane
pid2ID of the plane of the second dT/dW
dTdW2dT/dW as seen on the second plane
Returns
dT/dW on the third plane, or -999. if dT/dW would be infinity
Exceptions
cet::exception(category: "GeometryCore") if different TPC
cet::exception(category: "GeometryCore") if same plane
cet::exception(category: "GeometryCore") if other than 3 planes

Given a dT/dW as projected in two planes, returns the dT/dW as projected in the third plane. This function is a shortcut assuming exactly three wire planes in the TPC, in which case the output plane is chosen as the one that is neither of the input planes.

Definition at line 1682 of file GeometryCore.cxx.

References ComputeThirdPlaneSlope(), ThirdPlane(), and ThirdPlane_dTdW().

1685  {
1686  geo::PlaneID target_plane = ThirdPlane(pid1, pid2);
1687  return ThirdPlane_dTdW(pid1, slope1, pid2, slope2, target_plane);
1688  } // ThirdPlane_dTdW()
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
geo::PlaneID ThirdPlane(geo::PlaneID const &pid1, geo::PlaneID const &pid2) const
Returns the plane that is not in the specified arguments.
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.
double geo::GeometryCore::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.

Parameters
pid1ID of the plane of the first slope
slope1slope as seen on the first plane
pid2ID of the plane of the second slope
slope2slope as seen on the second plane
output_planeID of the plane on which to calculate the slope
Returns
the slope on the third plane, or -999. if slope would be infinity
Exceptions
cet::exception(category: "GeometryCore") if different TPC
cet::exception(category: "GeometryCore") if input planes match

Given a slope as projected in two planes, returns the slope as projected in the specified output plane. The slopes are defined in uniform units; they should be computed as distance ratios (or tangent of a geometrical angle; the formula is still valid using dt/dw directly in case of equal wire pitch in all planes and uniform drift velocity.

Definition at line 1621 of file GeometryCore.cxx.

References CheckIndependentPlanesOnSameTPC(), ComputeThirdPlaneSlope(), geo::PlaneGeo::PhiZ(), geo::TPCGeo::Plane(), and TPC().

Referenced by ThirdPlaneSlope().

1625  {
1626 
1627  CheckIndependentPlanesOnSameTPC(pid1, pid2, "ThirdPlaneSlope()");
1628 
1629  geo::TPCGeo const& TPC = this->TPC(pid1);
1630 
1631  // We need the "wire coordinate direction" for each plane.
1632  // This is perpendicular to the wire orientation.
1633  // PlaneGeo::PhiZ() defines the right orientation too.
1634  return ComputeThirdPlaneSlope(
1635  TPC.Plane(pid1).PhiZ(), slope1,
1636  TPC.Plane(pid2).PhiZ(), slope2,
1637  TPC.Plane(output_plane).PhiZ()
1638  );
1639  } // ThirdPlaneSlope()
Geometry information for a single TPC.
Definition: TPCGeo.h:37
double PhiZ() const
Angle from positive z axis of the wire coordinate axis, in radians.
Definition: PlaneGeo.h:180
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.
static void CheckIndependentPlanesOnSameTPC(geo::PlaneID const &pid1, geo::PlaneID const &pid2, const char *caller)
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:299
double geo::GeometryCore::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.

Parameters
pid1ID of the plane of the first slope
slope1slope as seen on the first plane
pid2ID of the plane of the second slope
slope2slope as seen on the second plane
Returns
the slope on the third plane, or -999. if slope would be infinity
Exceptions
cet::exception(category: "GeometryCore") if different TPC
cet::exception(category: "GeometryCore") if same plane
cet::exception(category: "GeometryCore") if other than 3 planes

Given a slope as projected in two planes, returns the slope as projected in the third plane. This function is a shortcut assuming exactly three wire planes in the TPC, in which case the output plane is chosen as the one that is neither of the input planes.

Definition at line 1642 of file GeometryCore.cxx.

References ThirdPlane(), and ThirdPlaneSlope().

1645  {
1646  geo::PlaneID target_plane = ThirdPlane(pid1, pid2);
1647  return ThirdPlaneSlope(pid1, slope1, pid2, slope2, target_plane);
1648  } // ThirdPlaneSlope()
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
geo::PlaneID ThirdPlane(geo::PlaneID const &pid1, geo::PlaneID const &pid2) const
Returns the plane that is not in the specified arguments.
double geo::GeometryCore::ThirdPlaneSlope ( geo::PlaneID::PlaneID_t  plane1,
double  slope1,
geo::PlaneID::PlaneID_t  plane2,
double  slope2,
geo::TPCID const &  tpcid 
) const
inline

Returns the slope on the third plane, given it in the other two.

Parameters
plane1index of the plane of the first slope
slope1slope as seen on the first plane
plane2index of the plane of the second slope
slope2slope as seen on the second plane
tpcidTPC where the two planes belong
Returns
the slope on the third plane, or -999. if slope would be infinity
Exceptions
cet::exception(category: "GeometryCore") if different TPC
cet::exception(category: "GeometryCore") if same plane
cet::exception(category: "GeometryCore") if other than 3 planes

Given a slope as projected in two planes, returns the slope as projected in the third plane.

Definition at line 4278 of file GeometryCore.h.

4281  {
4282  return ThirdPlaneSlope(
4283  geo::PlaneID(tpcid, plane1), slope1,
4284  geo::PlaneID(tpcid, plane2), slope2
4285  );
4286  }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
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.
double geo::GeometryCore::ThirdPlaneSlope ( unsigned int  plane1,
double  slope1,
unsigned int  plane2,
double  slope2,
unsigned int  tpc,
unsigned int  cstat 
) const
inline

Returns the slope on the third plane, given it in the other two.

Parameters
plane1index of the plane of the first slope
slope1slope as seen on the first plane
plane2index of the plane of the second slope
slope2slope as seen on the second plane
tpcidTPC where the two planes belong
Returns
the slope on the third plane, or -999. if slope would be infinity
Exceptions
cet::exception(category: "GeometryCore") if different TPC
cet::exception(category: "GeometryCore") if same plane
cet::exception(category: "GeometryCore") if other than 3 planes

Given a slope as projected in two planes, returns the slope as projected in the third plane.

Definition at line 4287 of file GeometryCore.h.

4290  {
4291  return ThirdPlaneSlope
4292  (plane1, slope1, plane2, slope2, geo::TPCID(cstat, tpc));
4293  }
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.
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
double geo::GeometryCore::TotalMass ( ) const
inline

Returns the total mass [kg] of the specified volume (default: world).

Definition at line 1865 of file GeometryCore.h.

Referenced by evgen::GENIEGen::GENIEGen().

1865 { return TotalMass(GetWorldVolumeName()); }
const std::string GetWorldVolumeName() const
Return the name of the world volume (needed by Geant4 simulation)
double TotalMass() const
Returns the total mass [kg] of the specified volume (default: world).
double geo::GeometryCore::TotalMass ( std::string  vol) const

Returns the total mass [kg] of the specified volume (default: world).

Definition at line 1112 of file GeometryCore.cxx.

References MassBetweenPoints().

1113  {
1114  //the TGeoNode::GetVolume() returns the TGeoVolume of the detector outline
1115  //and ROOT calculates the mass in kg for you
1116  TGeoVolume *gvol = gGeoManager->FindVolumeFast(vol.c_str());
1117  if(gvol) return gvol->Weight();
1118 
1119  throw cet::exception("GeometryCore") << "could not find specified volume '"
1120  << vol
1121  << " 'to determine total mass\n";
1122  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int geo::GeometryCore::TotalNTPC ( ) const

Returns the total number of TPCs in the detector.

Definition at line 827 of file GeometryCore.cxx.

References evd::details::begin(), Cryostats(), evd::details::end(), and geo::CryostatGeo::NTPC().

Referenced by mvapid::MVAAlg::GetDetectorEdges().

827  {
828  // it looks like C++11 lambdas have made STL algorithms easier to use,
829  // but only so much:
830  return std::accumulate(Cryostats().begin(), Cryostats().end(), 0U,
831  [](unsigned int sum, geo::CryostatGeo const& cryo)
832  { return sum + cryo.NTPC(); }
833  );
834  } // GeometryCore::TotalNTPC()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:155
CryostatList_t & Cryostats()
Return the internal cryostat list.
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
TPCGeo const& geo::GeometryCore::TPC ( unsigned int const  tpc = 0,
unsigned int const  cstat = 0 
) const
inline

Returns the specified TPC.

Parameters
tpcidID of the tpc
tpctpc number within the cryostat
cstatnumber of cryostat
Returns
a constant reference to the specified TPC
Exceptions
cet::exception(GeometryCore category) if cryostat not present
cet::exception(TPCOutOfRange category) if no such TPC

The GetElement() method is overloaded and its return depends on the type of ID.

Todo:
remove the version with integers

Definition at line 2393 of file GeometryCore.h.

Referenced by hit::MagDriftAna::analyze(), calo::LinearEnergyAlg::CalculateEnergy(), evd::RecoBaseDrawer::Cluster2D(), pma::CmToWireDrift(), pma::VtxCandidate::ComputeMse2D(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), DetHalfHeight(), DetHalfWidth(), DetLength(), evd::RecoBaseDrawer::DrawTrack2D(), evd::RecoBaseDrawer::DrawTrackVertexAssns2D(), larg4::LArVoxelReadout::DriftIonizationElectrons(), evd::RecoBaseDrawer::EndPoint2D(), larg::LArSimChannelAna::ensureHists(), hit::MagDriftAna::ensureHists(), evd::RecoBaseDrawer::Event2D(), tca::FillWireHitRange(), tca::FindShowers3D(), pma::ProjectionMatchingAlg::GetCloseHits(), mvapid::MVAAlg::GetDetectorEdges(), GetLArTPCVolumeName(), nnet::TrainingDataAlg::getProjection(), pma::GetProjectionToPlane(), pma::ProjectionMatchingAlg::guideEndpoints(), pma::Track3D::InitFromMiddle(), tca::InsideTPC(), lar_pandora::LArPandoraGeometry::LoadGeometry(), pma::PMAlgTracker::matchCluster(), tca::MergePFPTjs(), evd::RecoBaseDrawer::OpFlashOrtho(), evd::Ortho3DPad::Ortho3DPad(), PlanePitch(), PositionToTPC(), lar_pandora::LArPandoraTrackCreation::produce(), evgen::NucleonDecay::produce(), evgen::NDKGen::produce(), evgen::NeutronOsc::produce(), trkf::PMAlgTrajFitter::produce(), detsim::SimDriftElectrons::produce(), trkf::PMAlgTrackMaker::produce(), evd::RecoBaseDrawer::Prong2D(), evd::RecoBaseDrawer::RecoBaseDrawer(), evgen::ActiveVolumeVertexSampler::reconfigure(), evgen::ActiveVolumeVertexSampler::sample_vertex_pos(), tca::SaveCRInfo(), lar_pandora::LArPandoraGeometry::ShouldSwitchUV(), ThirdPlane_dTdW(), ThirdPlaneSlope(), pma::ProjectionMatchingAlg::validate(), pma::ProjectionMatchingAlg::validate_on_adc_test(), evd::RecoBaseDrawer::Vertex2D(), WireAngleToVertical(), pma::WireDriftToCm(), and WirePitch().

2394  { return TPC(geo::TPCID(cstat, tpc)); }
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
TPCGeo const& geo::GeometryCore::TPC ( geo::TPCID const &  tpcid) const
inline

Returns the specified TPC.

Parameters
tpcidID of the tpc
tpctpc number within the cryostat
cstatnumber of cryostat
Returns
a constant reference to the specified TPC
Exceptions
cet::exception(GeometryCore category) if cryostat not present
cet::exception(TPCOutOfRange category) if no such TPC

The GetElement() method is overloaded and its return depends on the type of ID.

Todo:
remove the version with integers

Definition at line 2395 of file GeometryCore.h.

References geo::CryostatGeo::TPC().

2396  { return Cryostat(tpcid).TPC(tpcid); }
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
TPCGeo const* geo::GeometryCore::TPCPtr ( geo::TPCID const &  tpcid) const
inline

Returns the specified TPC.

Parameters
tpcidTPC ID
Returns
a constant pointer to the specified TPC, or nullptr if none

The GetElementPtr() method is overloaded and its return depends on the type of ID.

Definition at line 2410 of file GeometryCore.h.

References geo::CryostatGeo::TPCPtr().

2411  {
2412  CryostatGeo const* pCryo = CryostatPtr(tpcid);
2413  return pCryo? pCryo->TPCPtr(tpcid): nullptr;
2414  } // TPCPtr()
CryostatGeo const * CryostatPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
std::vector< geo::TPCID > geo::GeometryCore::TPCsetToTPCs ( readout::TPCsetID const &  tpcsetid) const

Returns a list of ID of TPCs belonging to the specified TPC set.

Parameters
tpcsetidID of the TPC set to convert into TPC IDs
Returns
the list of TPCs, empty if TPC set is invalid

Note that the check is performed on the validity of the TPC set ID, that does not necessarily imply that the TPC set specified by the ID actually exists. Check the existence of the TPC set first (HasTPCset()). Behaviour on valid, non-existent TPC set IDs is undefined.

Definition at line 1798 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by TPCtoTPCset().

1799  {
1800  return fChannelMapAlg->TPCsetToTPCs(tpcsetid);
1801  } // GeometryCore::TPCsetToTPCs()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
readout::TPCsetID geo::GeometryCore::TPCtoTPCset ( geo::TPCID const &  tpcid) const

Returns the ID of the TPC set tpcid belongs to.

Definition at line 1790 of file GeometryCore.cxx.

References fChannelMapAlg, and TPCsetToTPCs().

Referenced by FindTPCsetAtPosition().

1791  {
1792  return fChannelMapAlg->TPCtoTPCset(tpcid);
1793  } // GeometryCore::TPCtoTPCset()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
void geo::GeometryCore::UpdateAfterSorting ( )
private

Performs all the updates needed after sorting.

Definition at line 170 of file GeometryCore.cxx.

References allViews, Cryostats(), IterateTPCs(), and Ncryostats().

Referenced by ApplyChannelMap().

170  {
171 
172  for (size_t c = 0; c < Ncryostats(); ++c)
173  Cryostats()[c].UpdateAfterSorting(geo::CryostatID(c));
174 
175  allViews.clear();
176  for (geo::TPCGeo const& tpc: IterateTPCs()) {
177  auto const& TPCviews = tpc.Views();
178  allViews.insert(TPCviews.cbegin(), TPCviews.cend());
179  }
180 
181  } // GeometryCore::UpdateAfterSorting()
Geometry information for a single TPC.
Definition: TPCGeo.h:37
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
std::set< geo::View_t > allViews
All views in the detector.
IteratorBox< TPC_iterator,&GeometryCore::begin_TPC,&GeometryCore::end_TPC > IterateTPCs() const
Enables ranged-for loops on all TPCs of the detector.
CryostatList_t & Cryostats()
Return the internal cryostat list.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:120
bool geo::GeometryCore::ValueInRange ( double  value,
double  min,
double  max 
) const

Returns whether a value is within the specified range.

Parameters
valuethe value to be tested
minthe lower boundary
maxthe upper boundary
Returns
whether the value is within range

If min is larger than max, they are swapped. A tolerance of 10^-6 (absolute) is used.

Todo:

Use wiggle instead of 10^-6

resort source code for a bit of speed up

Definition at line 1298 of file GeometryCore.cxx.

References e, max, and WireEndPoints().

Referenced by apa::APAGeometryAlg::LineSegChanIntersect().

1299  {
1300  if(min>max) std::swap(min,max);//protect against funny business due to wire angles
1301  if (std::abs(value-min)<1e-6||std::abs(value-max)<1e-6) return true;
1302  return (value>=min) && (value<=max);
1303  }
Int_t max
Definition: plot.C:27
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
std::string value(boost::any const &)
Int_t min
Definition: plot.C:26
Float_t e
Definition: plot.C:34
View_t geo::GeometryCore::View ( geo::PlaneID const &  pid) const

Returns the view (wire orientation) on the channels of specified TPC plane.

Parameters
planeTPC plane ID
Returns
the type of signal on the specified plane, or geo::kUnknown

Definition at line 560 of file GeometryCore.cxx.

References geo::kUnknown, Plane(), and geo::PlaneGeo::View().

Referenced by calo::TrackCalorimetryAlg::AnalyzeHit(), apa::APAGeometryAlg::APAChannelsIntersect(), apa::APAGeometryAlg::APAView(), tca::FillWireHitRange(), hit::HitCheater::FindHitsOnChannel(), apa::APAGeometryAlg::FirstChannelInView(), calo::GeneralCalorimetry::GeneralCalorimetry(), corner::CornerFinderAlg::get_feature_points(), corner::CornerFinderAlg::get_feature_points_LineIntegralScore(), apa::APAGeometryAlg::Init(), apa::DisambigAlg::MakeCloseHits(), apa::APAGeometryAlg::NearestWireIDOnChan(), wc::MergeWireCell::produce(), cluster::TrajCluster::produce(), vertex::VertexMatch::produce(), reco3d::SpacePointSolver::produce(), vertex::HarrisVertexFinder::produce(), vertex::FeatureVertexFinder::produce(), shower::TCShowerTemplateMaker::showerProfileTrue(), cheat::BackTracker::TrackIdToSimIDEs_Ps(), and View().

561  {
562  return pid? Plane(pid).View(): geo::kUnknown;
563  }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
Unknown view.
Definition: geo_types.h:83
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:171
View_t geo::GeometryCore::View ( raw::ChannelID_t const  channel) const

Returns the view (wire orientation) on the specified TPC channel.

Parameters
channelTPC channel ID
Returns
the type of signal on the specified channel, or geo::kUnknown

The view of the readout plane channel belongs to is returned, as in View(readout::ROPID const&) const.

Definition at line 554 of file GeometryCore.cxx.

References ChannelToROP(), raw::InvalidChannelID, geo::kUnknown, and View().

554  {
555  return (channel == raw::InvalidChannelID)
556  ? geo::kUnknown: View(ChannelToROP(channel));
557  } // GeometryCore::View()
Unknown view.
Definition: geo_types.h:83
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
readout::ROPID ChannelToROP(raw::ChannelID_t channel) const
geo::View_t geo::GeometryCore::View ( readout::ROPID const &  ropid) const

Returns the view of the channels in the specified readout plane.

Parameters
ropidreadout plane ID
Returns
the type of signal on the specified ROP

Returns the view (wire orientation) on the channels of specified readout plane. If ropid is an invalid ID, geo::kUnknown is returned. If ropid is a valid ID (i.e. an ID whose isValid flag is set) that points to a non-existent readout plane, the result is undefined. Use HasROP() to check if the readout plane actually exists.

Definition at line 1857 of file GeometryCore.cxx.

References fChannelMapAlg, and View().

1857  {
1858  return View(fChannelMapAlg->FirstWirePlaneInROP(ropid));
1859  } // GeometryCore::View()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
std::set<geo::View_t> const& geo::GeometryCore::Views ( ) const
inline
std::string geo::GeometryCore::VolumeName ( geo::Point_t const &  point) const

Returns the name of the deepest volume containing specified point.

Parameters
pointthe location to query, in world coordinates
Returns
name of the volume containing the point
Todo:

what happens if none?

Unify the coordinates type

Definition at line 899 of file GeometryCore.cxx.

References art::productstatus::unknown(), and WorldVolume().

Referenced by larg4::LArG4Ana::analyze(), and LArStackingAction::InsideTPC().

900  {
901  // check that the given point is in the World volume at least
902  TGeoVolume const*volWorld = WorldVolume();
903  double halflength = ((TGeoBBox*)volWorld->GetShape())->GetDZ();
904  double halfheight = ((TGeoBBox*)volWorld->GetShape())->GetDY();
905  double halfwidth = ((TGeoBBox*)volWorld->GetShape())->GetDX();
906  if(std::abs(point.x()) > halfwidth ||
907  std::abs(point.y()) > halfheight ||
908  std::abs(point.z()) > halflength
909  ){
910  mf::LogWarning("GeometryCoreBadInputPoint") << "point (" << point.x() << ","
911  << point.y() << "," << point.z() << ") "
912  << "is not inside the world volume "
913  << " half width = " << halfwidth
914  << " half height = " << halfheight
915  << " half length = " << halflength
916  << " returning unknown volume name";
917  const std::string unknown("unknownVolume");
918  return unknown;
919  }
920 
921  return gGeoManager->FindNode(point.X(), point.Y(), point.Z())->GetName();
922  }
TGeoVolume const * WorldVolume() const
Returns a pointer to the world volume.
ProductStatus unknown()
Definition: ProductStatus.h:31
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::string geo::GeometryCore::VolumeName ( TVector3 const &  point) const
inline

Returns a string with the name of the detector, as configured.

Definition at line 1816 of file GeometryCore.h.

References geo::vect::toPoint().

1817  { return VolumeName(geo::vect::toPoint(point)); }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
std::string VolumeName(geo::Point_t const &point) const
Returns the name of the deepest volume containing specified point.
WireGeo const& geo::GeometryCore::Wire ( geo::WireID const &  wireid) const
inline

Returns the specified wire.

Parameters
wireidID of the wire
Returns
a constant reference to the specified wire
Exceptions
cet::exceptionif not found

The GetElement() method is overloaded and its return depends on the type of ID.

Definition at line 3370 of file GeometryCore.h.

Referenced by IntersectSegments(), and trkf::Track3DKalmanHitAlg::makeSeed().

3371  { return Plane(wireid).Wire(wireid); }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
WireGeo const & Wire(unsigned int iwire) const
Definition: PlaneGeo.cxx:506
double geo::GeometryCore::WireAngleToVertical ( geo::View_t  view,
geo::TPCID const &  tpcid 
) const

Returns the angle of the wires in the specified view from vertical.

Parameters
viewthe view
TPCthe index of the TPC in the specified cryostat
Cryothe cryostat
tpcidID of the TPC
Returns
the angle [radians]
Exceptions
cet::exception("GeometryCore" category) if no such view

The angle is defined as in WireGeo::ThetaZ().

This method assumes all wires in the view have the same angle (it queries for the first).

Deprecated:
This does not feel APA-ready

Definition at line 802 of file GeometryCore.cxx.

References geo::TPCGeo::Nplanes(), geo::TPCGeo::Plane(), geo::PlaneGeo::ThetaZ(), TPC(), geo::PlaneGeo::View(), and geo::PlaneGeo::ViewName().

Referenced by util::GeometryUtilities::CalculatePitch(), util::GeometryUtilities::CalculatePitchPolar(), util::GeometryUtilities::Get2DangleFrom3D(), lar_pandora::LArPandoraGeometry::LoadGeometry(), shower::EMShowerAlg::MakeShower(), util::GeometryUtilities::PitchInView(), calo::Calorimetry::produce(), WirePitch(), lar_pandora::PFParticleHitDumper::YZtoU(), and lar_pandora::PFParticleHitDumper::YZtoV().

803  {
804  // loop over the planes in cryostat 0, tpc 0 to find the plane with the
805  // specified view
806  geo::TPCGeo const& TPC = this->TPC(tpcid);
807  for (unsigned int p = 0; p < TPC.Nplanes(); ++p) {
808  geo::PlaneGeo const& plane = TPC.Plane(p);
809  if (plane.View() == view) return plane.ThetaZ();
810  } // for
811  throw cet::exception("GeometryCore") << "WireAngleToVertical(): no view \""
812  << geo::PlaneGeo::ViewName(view) << "\" (#" << ((int) view)
813  << ") in " << std::string(tpcid);
814  } // GeometryCore::WireAngleToVertical()
static std::string ViewName(geo::View_t view)
Returns the name of the specified view.
Definition: PlaneGeo.cxx:765
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:145
Geometry information for a single TPC.
Definition: TPCGeo.h:37
double ThetaZ() const
Angle of the wires from positive z axis; .
Definition: PlaneGeo.cxx:728
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:171
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:299
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
double geo::GeometryCore::WireAngleToVertical ( geo::View_t  view,
int  TPC = 0,
int  Cryo = 0 
) const
inline

Returns the angle of the wires in the specified view from vertical.

Parameters
viewthe view
TPCthe index of the TPC in the specified cryostat
Cryothe cryostat
tpcidID of the TPC
Returns
the angle [radians]
Exceptions
cet::exception("GeometryCore" category) if no such view

The angle is defined as in WireGeo::ThetaZ().

This method assumes all wires in the view have the same angle (it queries for the first).

Deprecated:
This does not feel APA-ready

Definition at line 3753 of file GeometryCore.h.

3754  { return WireAngleToVertical(view, geo::TPCID(Cryo, TPC)); }
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
double WireAngleToVertical(geo::View_t view, geo::TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
geo::Length_t geo::GeometryCore::WireCoordinate ( double  YPos,
double  ZPos,
geo::PlaneID const &  planeid 
) const

Returns the index of the nearest wire to the specified position.

Parameters
YPosy coordinate on the wire plane
ZPosz coordinate on the wire plane
planeidID of the plane
Returns
an index interpolation between the two nearest wires
Deprecated:
Use WireCoordinate(geo::Point_t const&, geo::PlaneID const&) instead

Respect to NearestWireID(), this method returns a real number, representing a continuous coordinate in the wire axis, with the round values corresponding to the actual wires.

Todo:
Unify (y, z) coordinate

Definition at line 1189 of file GeometryCore.cxx.

References fChannelMapAlg, and NearestWire().

Referenced by ChannelToROP(), tca::ChgFracBetween(), tca::ChgFracNearEnd(), evd::RecoBaseDrawer::DrawProng2D(), evd::RecoBaseDrawer::DrawTrackVertexAssns2D(), tca::Find3DVertices(), tca::FindCompleteness(), tca::FindXMatches(), tca::FitTp3(), tca::FitTp3s(), tca::FollowTp3s(), cluster::MergeClusterAlg::GlobalWire(), cluster::BlurredClusteringAlg::GlobalWire(), shower::EMShowerAlg::GlobalWire(), ems::Hit2D::Hit2D(), lar_cluster3d::PCASeedFinderAlg::LineFit2DHits(), lar_cluster3d::HoughSeedFinderAlg::LineFit2DHits(), tca::MakeBareTP(), tca::MakeTp3(), shower::EMShowerAlg::OrderShowerHits(), tca::PosInPlane(), evd::RecoBaseDrawer::Prong2D(), evd::RecoBaseDrawer::Slice2D(), trkf::TrackLineFitAlg::TrkLineFit(), pma::ProjectionMatchingAlg::validate(), pma::ProjectionMatchingAlg::validate_on_adc(), pma::ProjectionMatchingAlg::validate_on_adc_test(), evd::RecoBaseDrawer::Vertex2D(), trkf::VertexFitAlg::VertexFit(), and WireCoordinate().

1190  {
1191  return fChannelMapAlg->WireCoordinate(YPos, ZPos, planeid);
1192  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
geo::Length_t geo::GeometryCore::WireCoordinate ( double  YPos,
double  ZPos,
unsigned int  PlaneNo,
unsigned int  TPCNo,
unsigned int  cstat 
) const
inline

Returns the index of the nearest wire to the specified position.

Parameters
YPosy coordinate on the wire plane
ZPosz coordinate on the wire plane
PlaneNonumber of plane
TPCNonumber of TPC
cstatnumber of cryostat
Returns
an index interpolation between the two nearest wires
See also
ChannelMapAlg::WireCoordinate()
Deprecated:
Use the version with plane ID instead

Definition at line 4007 of file GeometryCore.h.

4011  { return WireCoordinate(YPos, ZPos, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
geo::Length_t WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
geo::Length_t geo::GeometryCore::WireCoordinate ( geo::Point_t const &  pos,
geo::PlaneID const &  planeid 
) const

Returns the index of the nearest wire to the specified position.

Parameters
posworld coordinates of the position (it will be projected)
planeidID of the plane
Returns
an index interpolation between the two nearest wires
See also
ChannelMapAlg::WireCoordinate()

Respect to NearestWireID(), this method returns a real number, representing a continuous coordinate in the wire axis, with the round values corresponding to the actual wires.

Definition at line 1182 of file GeometryCore.cxx.

References Plane(), geo::PlaneGeo::WireCoordinate(), and WireCoordinate().

1183  {
1184  return Plane(planeid).WireCoordinate(pos);
1185  }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
double WireCoordinate(Point const &point) const
Returns the coordinate of the point on the plane, in wire units.
Definition: PlaneGeo.h:725
geo::Length_t geo::GeometryCore::WireCoordinate ( TVector3 const &  pos,
geo::PlaneID const &  planeid 
) const
inline

Returns the index of the nearest wire to the specified position.

Parameters
posworld coordinates of the position (it will be projected)
planeidID of the plane
Returns
an index interpolation between the two nearest wires
See also
ChannelMapAlg::WireCoordinate()

Respect to NearestWireID(), this method returns a real number, representing a continuous coordinate in the wire axis, with the round values corresponding to the actual wires.

Definition at line 4028 of file GeometryCore.h.

References geo::vect::toPoint(), x, y, and z.

4029  { return WireCoordinate(geo::vect::toPoint(pos), planeid); }
geo::Length_t WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
void geo::GeometryCore::WireEndPoints ( geo::WireID const &  wireid,
double *  xyzStart,
double *  xyzEnd 
) const

Fills two arrays with the coordinates of the wire end points.

Parameters
wireidID of the wire
xyzStart(output) an array with the start coordinate
xyzEnd(output) an array with the end coordinate
Exceptions
cet::exceptionwire not present

The starting point is the wire end with lower z coordinate.

Deprecated:
use the wire ID interface instead (but note that it does not sort the ends)

Definition at line 1307 of file GeometryCore.cxx.

References geo::GeometryCore::Segment< Point >::end(), and geo::GeometryCore::Segment< Point >::start().

Referenced by trkf::BezierTrackerAlgorithm::CalculateGeometricalElements(), trkf::SeedFinderAlgorithm::CalculateGeometricalElements(), cmtool::CFAlgoWireOverlap::Float(), cmtool::CFAlgoVolumeOverlap::Float(), trkf::BezierTrack::GetClosestApproach(), trkf::BezierTrack::GetClosestApproaches(), trkf::SeedFinderAlgorithm::GetHitDistAndProj(), trkf::BezierTrack::GetTrackPitch(), IncrementID(), IntersectSegments(), apa::DisambigAlg::TrivialDisambig(), and ValueInRange().

1308  {
1309  Segment_t result = WireEndPoints(wireid);
1310 
1311  xyzStart[0] = result.start().X();
1312  xyzStart[1] = result.start().Y();
1313  xyzStart[2] = result.start().Z();
1314  xyzEnd[0] = result.end().X();
1315  xyzEnd[1] = result.end().Y();
1316  xyzEnd[2] = result.end().Z();
1317 
1318  if(xyzEnd[2]<xyzStart[2]){
1319  //ensure that "End" has higher z-value than "Start"
1320  std::swap(xyzStart[0],xyzEnd[0]);
1321  std::swap(xyzStart[1],xyzEnd[1]);
1322  std::swap(xyzStart[2],xyzEnd[2]);
1323  }
1324  if(xyzEnd[1]<xyzStart[1] && std::abs(xyzEnd[2]-xyzStart[2])<0.01){
1325  // if wire is vertical ensure that "End" has higher y-value than "Start"
1326  std::swap(xyzStart[0],xyzEnd[0]);
1327  std::swap(xyzStart[1],xyzEnd[1]);
1328  std::swap(xyzStart[2],xyzEnd[2]);
1329  }
1330 
1331  } // GeometryCore::WireEndPoints(WireID, 2x double*)
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
Segment< DefaultPoint_t > Segment_t
void WireEndPoints(geo::WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
void geo::GeometryCore::WireEndPoints ( unsigned int  cstat,
unsigned int  tpc,
unsigned int  plane,
unsigned int  wire,
double *  xyzStart,
double *  xyzEnd 
) const
inline

Fills two arrays with the coordinates of the wire end points.

Parameters
cstatcryostat number
tpctpc number within the cryostat
planeplane number within the TPC
wirewire number within the plane
xyzStart(output) an array with the start coordinate
xyzEnd(output) an array with the end coordinate
Exceptions
cet::exceptionwire not present

The starting point is the wire end with lower z coordinate.

Deprecated:
use the wire ID interface instead (but note that it does not sort the ends)

Definition at line 3807 of file GeometryCore.h.

3811  { WireEndPoints(geo::WireID(cstat, tpc, plane, wire), xyzStart, xyzEnd); }
void WireEndPoints(geo::WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
template<typename Point = DefaultPoint_t>
Segment<Point> geo::GeometryCore::WireEndPoints ( geo::WireID const &  wireID) const

Returns a segment whose ends are the wire end points.

Parameters
wireidID of the wire
Returns
a segment whose ends are the wire end points
Exceptions
cet::exceptionwire not present

The start and end are assigned as returned from the geo::WireGeo object. The rules for this assignment are documented in that class.

Deprecated:
use the wire ID interface instead (but note that it does not sort the ends)
template<typename Point >
geo::GeometryCore::Segment<Point> geo::GeometryCore::WireEndPoints ( geo::WireID const &  wireid) const

Definition at line 5536 of file GeometryCore.h.

References geo::WireGeo::GetEnd(), geo::WireGeo::GetStart(), and Print().

5537 {
5538  geo::WireGeo const& wire = Wire(wireid);
5539  return { wire.GetStart<Point>(), wire.GetEnd<Point>() };
5540 } // geo::GeometryCore::WireEndPoints(WireID)
void GetStart(double *xyz) const
Definition: WireGeo.h:129
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:61
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:34
WireGeo const & Wire(geo::WireID const &wireid) const
Returns the specified wire.
void GetEnd(double *xyz) const
Definition: WireGeo.h:133
bool geo::GeometryCore::WireIDIntersectionCheck ( const geo::WireID wid1,
const geo::WireID wid2 
) const
private

Wire ID check for WireIDsIntersect methods.

Definition at line 1976 of file GeometryCore.cxx.

References geo::TPCID::asTPCID(), HasWire(), Nwires(), geo::PlaneID::Plane, and geo::WireID::planeID().

Referenced by GetClosestOpDet(), and IntersectSegments().

1977  {
1978  if (wid1.asTPCID() != wid2) {
1979  mf::LogError("WireIDIntersectionCheck")
1980  << "Comparing two wires on different TPCs: return failure.";
1981  return false;
1982  }
1983  if (wid1.Plane == wid2.Plane) {
1984  mf::LogError("WireIDIntersectionCheck")
1985  << "Comparing two wires in the same plane: return failure";
1986  return false;
1987  }
1988  if (!HasWire(wid1)) {
1989  mf::LogError("WireIDIntersectionCheck")
1990  << "1st wire " << wid1 << " does not exist (max wire number: "
1991  << Nwires(wid1.planeID()) << ")";
1992  return false;
1993  }
1994  if (!HasWire(wid2)) {
1995  mf::LogError("WireIDIntersectionCheck")
1996  << "2nd wire " << wid2 << " does not exist (max wire number: "
1997  << Nwires(wid2.planeID()) << ")";
1998  return false;
1999  }
2000  return true;
2001  } // GeometryCore::WireIDIntersectionCheck()
PlaneID const & planeID() const
Definition: geo_types.h:355
TPCID const & asTPCID() const
Conversion to TPCID (for convenience of notation).
Definition: geo_types.h:227
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
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.
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:258
bool HasWire(geo::WireID const &wireid) const
Returns whether we have the specified wire.
bool geo::GeometryCore::WireIDsIntersect ( WireID const &  wid1,
WireID const &  wid2,
geo::Point_t intersection 
) const

Computes the intersection between two wires.

Parameters
wid1ID of the first wire
wid2ID of the other wire
intersection(output) the intersection point (global coordinates)
Returns
whether an intersection was found inside the TPC the wires belong

The "intersection" refers to the projection of the wires into the same wire plane. The coordinate along the drift direction is arbitrarily set to the one of the first wire. Wires are assumed to have at most one intersection. If wires are parallel, intersection will have all components set to infinity (std::numeric_limits<>::infinity()) and false is returned. If the intersection is outside the TPC, false is also returned, but the intersection point will contain that intersection.

To test that the result is not infinity (nor NaN), use geo::vect::isfinite(intersection) etc.

Referenced by apa::APAGeometryAlg::APAChannelsIntersect(), ChannelsIntersect(), apa::DisambigAlg::CompareViews(), shower::EMShowerAlg::Construct3DPoint(), evd::TWQProjectionView::FindEndPoint(), evd::TWQProjectionView::FindLineLength(), IntersectionPoint(), IntersectSegments(), reco3d::IntersectionCache::ISect(), lar_cluster3d::StandardHit3DBuilder::makeDeadChannelPair(), lar_cluster3d::StandardHit3DBuilder::makeHitPair(), and apa::APAGeometryAlg::ThreeChanPos().

bool geo::GeometryCore::WireIDsIntersect ( WireID const &  wid1,
WireID const &  wid2,
TVector3 &  intersection 
) const

Computes the intersection between two wires.

Parameters
wid1ID of the first wire
wid2ID of the other wire
intersection(output) the intersection point (global coordinates)
Returns
whether an intersection was found inside the TPC the wires belong

The "intersection" refers to the projection of the wires into the same wire plane. The coordinate along the drift direction is arbitrarily set to the one of the first wire. Wires are assumed to have at most one intersection. If wires are parallel, intersection will have all components set to infinity (std::numeric_limits<>::infinity()) and false is returned. If the intersection is outside the TPC, false is also returned, but the intersection point will contain that intersection.

To test that the result is not infinity (nor NaN), use geo::vect::isfinite(intersection) etc.

bool geo::GeometryCore::WireIDsIntersect ( WireID const &  wid1,
WireID const &  wid2,
WireIDIntersection widIntersect 
) const

Computes the intersection between two wires.

Parameters
wid1ID of the first wire
wid2ID of the other wire
widIntersect(output) the coordinate of the intersection point
Returns
whether an intersection was found within the TPC

The "intersection" refers to the projection of the wires into the same $ x = 0 $ plane. Wires are assumed to have at most one intersection. If wires are parallel, widIntersect will have the two components set to infinity (std::numeric_limits<>::infinity()) and the TPC number set to invalid (geo::TPCID::InvalidID). Also, false is returned. If the intersection is outside the TPC, false is also returned, but the widIntersect will contain the coordinates of that intersection. The TPC number is still set to invalid, although the intersection might belong to a valid TPC somewhere else.

Deprecated:
This method uses arbitrary assumptions and should not be used. Use the interface returning a full vector instead.
WireGeo const& geo::GeometryCore::WireIDToWireGeo ( geo::WireID const &  wireid) const
inline
geo::Length_t geo::GeometryCore::WirePitch ( geo::PlaneID const &  planeid) const

Returns the distance between two consecutive wires.

Parameters
pplane number within the TPC
tpctpc number within the cryostat
cstatcryostat number
Returns
the distance between the two wires
Note
The current geometry assumptions imply that wire pitch is constant between all wires on the same wire plane. This is an assumption non-trivial to remove.
Todo:

add a version with wire IDs

deprecate this function

document what will happen (in the future methods) with wires on different planes

Definition at line 783 of file GeometryCore.cxx.

References Plane(), and geo::PlaneGeo::WirePitch().

Referenced by vertex::FeatureVertexFinderAna::analyze(), shwf::ShowerReco::beginJob(), shwf::ShowerReco::beginRun(), mvapid::MVAAlg::CalcSegmentdEdxDist(), trkf::BezierTrackerAlgorithm::CalculateGeometricalElements(), trkf::SeedFinderAlgorithm::CalculateGeometricalElements(), util::GeometryUtilities::CalculatePitch(), util::GeometryUtilities::CalculatePitchPolar(), evd::RecoBaseDrawer::Cluster2D(), cluster::ClusterMatchTQ::ClusterMatch(), lar_cluster3d::StandardHit3DBuilder::configure(), shower::HitPosition::ConvertWireTickToCm(), lar_pandora::LArPandoraInput::CreatePandoraHits2D(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), trkf::Track3DKalmanSPS::dQdxCalc(), evd::RecoBaseDrawer::DrawTrack2D(), cluster::EndPointAlg::EndPoint(), cluster::HoughBaseAlg::FastTransform(), trkf::SpacePointAlg::fillComplexSpacePoint(), tca::FilldEdx(), trkf::SpacePointAlg::fillSpacePoint(), tca::FillWireHitRange(), apa::DisambigAlg::FindChanTimeEndPts(), lar_cluster3d::HoughSeedFinderAlg::findHoughClusters(), trkf::BezierTrack::GetCalorimetryObject(), lar_pandora::LArPandoraInput::GetMips(), calo::Calorimetry::GetPitch(), trkf::BezierTrack::GetTrackPitch(), shower::TCShowerAlg::goodHit(), evd::RecoBaseDrawer::Hit2D(), shower::EMShowerAlg::HitPosition(), apa::APAGeometryAlg::Init(), lar_cluster3d::PCASeedFinderAlg::LineFit2DHits(), lar_cluster3d::HoughSeedFinderAlg::LineFit2DHits(), lar_pandora::LArPandoraGeometry::LoadGeometry(), shower::EMShowerAlg::MakeShower(), trkf::SpacePointAlg::makeSpacePoints(), util::GeometryUtilities::PitchInView(), lar_pandora::LArPandoraTrackCreation::produce(), cluster::DBCluster3D::produce(), trkf::SpacePts::produce(), trkf::Track3Dreco::produce(), calo::Calorimetry::produce(), vertex::VertexFinder2D::produce(), util::GeometryUtilities::Reconfigure(), trkf::KHitWireLine::subpredict(), trkf::KHitWireX::subpredict(), cluster::HoughBaseAlg::Transform(), trkf::TrackLineFitAlg::TrkLineFit(), evd::details::ADCCorrectorClass::update(), and trkf::VertexFitAlg::VertexFit().

784  {
785  return Plane(planeid).WirePitch();
786  }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Definition: PlaneGeo.h:367
geo::Length_t geo::GeometryCore::WirePitch ( unsigned int  plane = 0,
unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const
inline

Returns the distance between two consecutive wires.

Parameters
pplane number within the TPC
tpctpc number within the cryostat
cstatcryostat number
Returns
the distance between the two wires
Note
The current geometry assumptions imply that wire pitch is constant between all wires on the same wire plane. This is an assumption non-trivial to remove.
Todo:

add a version with wire IDs

deprecate this function

document what will happen (in the future methods) with wires on different planes

Definition at line 3714 of file GeometryCore.h.

3717  { return WirePitch(geo::PlaneID(cstat, tpc, plane)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
geo::Length_t geo::GeometryCore::WirePitch ( geo::View_t  view) const

Returns the distance between two wires in the specified view.

Parameters
w1index of the first wire
w2index of the second wire
pplane number within the TPC
tpctpc number within the cryostat
cstatcryostat number
Returns
the distance between the two wires

This method assumes that all the wires on all the planes on the specified view of all TPCs have the same pitch.

Definition at line 791 of file GeometryCore.cxx.

References Plane(), TPC(), WireAngleToVertical(), and geo::PlaneGeo::WirePitch().

792  {
793  // look in cryostat 0, tpc 0 to find the plane with the
794  // specified view
795  return TPC({ 0, 0 }).Plane(view).WirePitch();
796  }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Definition: PlaneGeo.h:367
readout::ROPID geo::GeometryCore::WirePlaneToROP ( geo::PlaneID const &  planeid) const

Returns the ID of the ROP planeid belongs to.

Parameters
planeidID of the wire plane
Returns
the ID of the ROP planeid belongs to

If planeid is an invalid ID, an invalid ROP ID is returned. If planeid is a valid ID (i.e. an ID whose isValid flag is set) that points to a non-existent wire plane, the result is undefined. Use HasPlaneID() to check if the wire plane actually exists.

Definition at line 1826 of file GeometryCore.cxx.

References fChannelMapAlg, and ROPtoWirePlanes().

Referenced by SignalType().

1827  {
1828  return fChannelMapAlg->WirePlaneToROP(planeid);
1829  } // GeometryCore::WirePlaneToROP()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
WireGeo const* geo::GeometryCore::WirePtr ( geo::WireID const &  wireid) const
inline

Returns the specified wire.

Parameters
wireidwire ID
Returns
a constant pointer to the specified wire, or nullptr if none

The GetElementPtr() method is overloaded and its return depends on the type of ID.

Definition at line 3351 of file GeometryCore.h.

References geo::PlaneGeo::WirePtr().

Referenced by lar_cluster3d::MinSpanTreeAlg::configure(), evd_tool::MicroBooNEDrawer::DrawBadChannels(), and evd_tool::ICARUSDrawer::DrawBadChannels().

3352  {
3353  geo::PlaneGeo const* pPlane = PlanePtr(wireid);
3354  return pPlane? pPlane->WirePtr(wireid): nullptr;
3355  } // WirePtr()
PlaneGeo const * PlanePtr(geo::PlaneID const &planeid) const
Returns the specified plane.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
WireGeo const * WirePtr(unsigned int iwire) const
Returns the wire number iwire from this plane.
Definition: PlaneGeo.h:305
void geo::GeometryCore::WorldBox ( double *  xlo,
double *  xhi,
double *  ylo,
double *  yhi,
double *  zlo,
double *  zhi 
) const

Fills the arguments with the boundaries of the world.

Parameters
xlo(output) pointer to the lower x coordinate
xlo(output) pointer to the upper x coordinate
ylo(output) pointer to the lower y coordinate
ylo(output) pointer to the upper y coordinate
zlo(output) pointer to the lower z coordinate
zlo(output) pointer to the upper z coordinate
Exceptions
cet::exception("GeometryCore" category) if no world found
See also
GetWorldVolumeName()

This method fills the boundaries of the world volume (GetWorldVolumeName()).

If a pointer is null, its coordinate is skipped.

Deprecated:
Use the version without arguments instead.

Definition at line 885 of file GeometryCore.cxx.

References geo::BoxBoundedGeo::MaxX(), geo::BoxBoundedGeo::MaxY(), geo::BoxBoundedGeo::MaxZ(), geo::BoxBoundedGeo::MinX(), geo::BoxBoundedGeo::MinY(), geo::BoxBoundedGeo::MinZ(), and WorldBox().

Referenced by evd_tool::ICARUSDrawer::DetOutline3D(), and evgen::CORSIKAGen::GetSample().

888  {
889  geo::BoxBoundedGeo const box = WorldBox();
890  if (xlo) *xlo = box.MinX();
891  if (ylo) *ylo = box.MinY();
892  if (zlo) *zlo = box.MinZ();
893  if (xhi) *xhi = box.MaxX();
894  if (yhi) *yhi = box.MaxY();
895  if (zhi) *zhi = box.MaxZ();
896  }
double MinX() const
Returns the world x coordinate of the start of the box.
Definition: BoxBoundedGeo.h:90
double MaxX() const
Returns the world x coordinate of the end of the box.
Definition: BoxBoundedGeo.h:93
double MinZ() const
Returns the world z coordinate of the start of the box.
double MaxY() const
Returns the world y coordinate of the end of the box.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:35
double MaxZ() const
Returns the world z coordinate of the end of the box.
double MinY() const
Returns the world y coordinate of the start of the box.
geo::BoxBoundedGeo WorldBox() const
geo::BoxBoundedGeo geo::GeometryCore::WorldBox ( ) const

Returns a box with the extremes of the world volume (from shape axes).

See also
GetWorldVolumeName()

Definition at line 862 of file GeometryCore.cxx.

References GetWorldVolumeName(), s, WorldVolume(), x1, x2, y1, and y2.

Referenced by MaterialName(), and WorldBox().

862  {
863 
864  TGeoVolume const* world = WorldVolume();
865  if(!world) {
866  throw cet::exception("GeometryCore")
867  << "no world volume '" << GetWorldVolumeName() << "'\n";
868  }
869  TGeoShape const* s = world->GetShape();
870  if(!s) {
871  throw cet::exception("GeometryCore")
872  << "world volume '" << GetWorldVolumeName() << "' is shapeless!!!\n";
873  }
874 
875  double x1, x2, y1, y2, z1, z2;
876  s->GetAxisRange(1, x1, x2);
877  s->GetAxisRange(2, y1, y2);
878  s->GetAxisRange(3, z1, z2);
879 
880  // geo::BoxBoundedGeo constructor will sort the coordinates as needed
881  return geo::BoxBoundedGeo{ x1, x2, y1, y2, z1, z2 };
882  } // GeometryCore::WorldBox()
Float_t s
Definition: plot.C:23
Float_t y1[n_points_granero]
Definition: compare.C:5
Float_t x1[n_points_granero]
Definition: compare.C:5
const std::string GetWorldVolumeName() const
Return the name of the world volume (needed by Geant4 simulation)
TGeoVolume const * WorldVolume() const
Returns a pointer to the world volume.
Float_t y2[n_points_geant4]
Definition: compare.C:26
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:35
Float_t x2[n_points_geant4]
Definition: compare.C:26
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
TGeoVolume const * geo::GeometryCore::WorldVolume ( ) const

Returns a pointer to the world volume.

Definition at line 857 of file GeometryCore.cxx.

References GetWorldVolumeName().

Referenced by VolumeName(), and WorldBox().

857  {
858  return gGeoManager->FindVolumeFast(GetWorldVolumeName().c_str());
859  }
const std::string GetWorldVolumeName() const
Return the name of the world volume (needed by Geant4 simulation)

Member Data Documentation

std::set<geo::View_t> geo::GeometryCore::allViews
private

All views in the detector.

Definition at line 5404 of file GeometryCore.h.

Referenced by UpdateAfterSorting().

lar::util::RealComparisons< geo::Length_t > geo::GeometryCore::coordIs { 1e-8 }
static

Value of tolerance for equality comparisons.

Definition at line 1487 of file GeometryCore.h.

Referenced by IntersectLines(), PointWithinSegments(), and geo::sqr().

std::string geo::GeometryCore::fDetectorName
private

Name of the detector.

Definition at line 5394 of file GeometryCore.h.

Referenced by GeometryCore().

std::string geo::GeometryCore::fGDMLfile
private

path to geometry file used for Geant4 simulation

Definition at line 5395 of file GeometryCore.h.

Referenced by LoadGeometryFile().

GeometryData_t geo::GeometryCore::fGeoData
private

The detector description data.

Definition at line 5391 of file GeometryCore.h.

Referenced by ApplyChannelMap().

double geo::GeometryCore::fMinWireZDist
private

Minimum distance in Z from a point in which to look for the closest wire

Definition at line 5397 of file GeometryCore.h.

double geo::GeometryCore::fPositionWiggle
private

accounting for rounding errors when testing positions

Definition at line 5399 of file GeometryCore.h.

Referenced by FindTPCAtPosition(), PositionToCryostatPtr(), and PositionToTPCptr().

std::string geo::GeometryCore::fROOTfile
private

path to geometry file for geometry in GeometryCore

Definition at line 5396 of file GeometryCore.h.

Referenced by LoadGeometryFile().

double geo::GeometryCore::fSurfaceY
private

The point where air meets earth for this detector.

Definition at line 5393 of file GeometryCore.h.

constexpr std::size_t geo::GeometryCore::MaxWireDepthInGDML = 20U
static

Wires must be found in GDML description within this number of nested volumes.

Definition at line 1484 of file GeometryCore.h.

Referenced by LoadGeometryFile().


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