LArSoft  v06_68_00
Liquid Argon Software toolkit - http://larsoft.org/
geo::Geometry Class Reference

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

#include "Geometry.h"

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

Public Types

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

Public Member Functions

 Geometry (fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
 
void preBeginRun (art::Run const &run)
 Updates the geometry if needed at the beginning of each new run. More...
 
provider_type const * provider () const
 Returns a pointer to the geometry service provider. More...
 
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 , typename ContextID >
GeoID GetBeginID (ContextID const &id) const
 Returns the ID of the first subelement of the specified element. More...
 
void GetBeginID (geo::CryostatID &id) const
 Initializes the specified ID with the ID of the first cryostat. More...
 
void GetBeginID (geo::TPCID &id) const
 Initializes the specified ID with the ID of the first TPC. More...
 
void GetBeginID (geo::PlaneID &id) const
 Initializes the specified ID with the ID of the first plane. More...
 
void GetBeginID (geo::WireID &id) const
 Initializes the specified ID with the ID of the first wire. More...
 
void GetBeginID (readout::TPCsetID &id) const
 Initializes the specified ID with the ID of the first TPC set. More...
 
void GetBeginID (readout::ROPID &id) const
 Initializes the specified ID with the ID of the first readout plane. 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 GetEndID (ContextID const &id) const
 Returns the (possibly invalid) ID after the last subelement of the specified element. More...
 
void GetEndID (geo::CryostatID &id) const
 Initializes the specified ID with the invalid ID after the last cryostat. More...
 
void GetEndID (geo::TPCID &id) const
 Initializes the specified ID with the invalid ID after the last TPC. More...
 
void GetEndID (geo::PlaneID &id) const
 Initializes the specified ID with the invalid ID after the last plane. More...
 
void GetEndID (geo::WireID &id) const
 Initializes the specified ID with the invalid ID after the last wire. More...
 
void GetEndID (readout::TPCsetID &id) const
 Initializes the specified ID with the invalid ID after the last TPC set. More...
 
void GetEndID (readout::ROPID &id) const
 Initializes the specified ID with the invalid ID after the last ROP. More...
 
bool HasElement (geo::TPCID const &tpcid) const
 Returns whether we have the specified TPC. More...
 
bool HasElement (readout::TPCsetID const &tpcsetid) const
 Returns whether we have the specified TPC set. More...
 
bool HasElement (readout::ROPID const &ropid) const
 
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...
 
bool IncrementID (geo::CryostatID &id) const
 
bool IncrementID (geo::TPCID &id) const
 
bool IncrementID (geo::PlaneID &id) const
 
bool IncrementID (geo::WireID &id) const
 
bool IncrementID (readout::TPCsetID &id) const
 
bool IncrementID (readout::ROPID &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...
 
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...
 
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 begin_TPC_id (geo::CryostatID const &cid) const
 
TPC_id_iterator end_TPC_id () const
 Returns an iterator pointing after the last TPC ID in the detector. More...
 
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 begin_TPC (geo::CryostatID const &cid) 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 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...
 
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...
 
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...
 
geo::PlaneID GetBeginPlaneID (geo::CryostatID const &id) const
 Returns the ID of the first plane of the specified cryostat. More...
 
geo::PlaneID GetBeginPlaneID (geo::TPCID const &id) const
 Returns the ID of the first plane of the specified TPC. More...
 
geo::PlaneID GetEndPlaneID (geo::CryostatID const &id) const
 
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 begin_plane_id (geo::CryostatID const &ID) const
 
plane_id_iterator begin_plane_id (geo::TPCID const &ID) const
 
plane_id_iterator end_plane_id () const
 Returns an iterator pointing after the last plane ID in the detector. More...
 
plane_id_iterator end_plane_id (geo::CryostatID 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 begin_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 () const
 Returns an iterator pointing after the last plane in the detector. More...
 
plane_iterator end_plane (geo::CryostatID const &ID) const
 
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...
 
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...
 
View_t View (geo::PlaneID const &pid) const
 Returns the view (wire orientation) on the channels of specified TPC plane. More...
 
View_t View (raw::ChannelID_t const channel) const
 Returns the view (wire orientation) on the specified TPC channel. More...
 
geo::View_t View (readout::ROPID const &ropid) const
 Returns the view of the channels in the specified readout plane. More...
 
SigType_t SignalType (geo::PlaneID const &pid) const
 Returns the type of signal on the channels of specified TPC plane. More...
 
SigType_t SignalType (raw::ChannelID_t const channel) const
 Returns the type of signal on the specified TPC channel. More...
 
geo::SigType_t SignalType (readout::ROPID const &ropid) const
 Returns the type of signal of channels in specified readout plane. More...
 
geo::WireID GetBeginWireID (geo::CryostatID const &id) const
 Returns the ID of the first wire in the specified cryostat. More...
 
geo::WireID GetBeginWireID (geo::TPCID const &id) const
 Returns the ID of the first wire of the specified TPC. More...
 
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::CryostatID const &id) const
 
geo::WireID GetEndWireID (geo::TPCID const &id) const
 
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 begin_wire_id (geo::CryostatID const &id) const
 Returns an iterator pointing to the first wire ID in specified cryostat. More...
 
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 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 () const
 Returns an iterator pointing after the last wire ID in the detector. More...
 
wire_id_iterator end_wire_id (geo::CryostatID const &id) const
 
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 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 begin_wire (geo::CryostatID const &id) const
 Returns an iterator pointing to the first 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 begin_wire (geo::PlaneID const &id) const
 Returns an iterator pointing to the first wire in specified plane. More...
 
wire_iterator end_wire () const
 Returns an iterator pointing after the last wire in the detector. More...
 
wire_iterator end_wire (geo::CryostatID const &id) const
 Returns an iterator pointing after the last wire in specified cryostat. More...
 
wire_iterator end_wire (geo::TPCID const &id) const
 Returns an iterator pointing after the last wire in specified TPC. 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...
 
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...
 
geo::Length_t WirePitch (geo::View_t view) const
 Returns the distance between two wires in the specified view. More...
 
template<typename Point >
geo::GeometryCore::Segment< Point > WireEndPoints (geo::WireID const &wireid) const
 
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...
 
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
 
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...
 
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 begin_TPCset_id (geo::CryostatID const &cid) const
 
TPCset_id_iterator end_TPCset_id () const
 Returns an iterator pointing after the last TPC set ID in the detector. More...
 
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
 
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...
 
readout::ROPID GetBeginROPID (geo::CryostatID const &id) const
 Returns the ID of the first readout plane of the specified cryostat. More...
 
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 (geo::CryostatID const &id) const
 
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 begin_ROP_id (geo::CryostatID const &ID) const
 
ROP_id_iterator begin_ROP_id (readout::TPCsetID const &ID) const
 
ROP_id_iterator end_ROP_id () const
 Returns an iterator pointing after the last ROP ID in the detector. More...
 
ROP_id_iterator end_ROP_id (geo::CryostatID 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...
 
bool ValueInRange (double value, double min, double max) const
 Returns whether a value is within the specified range. More...
 
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...
 
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...
 
TPC access and information
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...
 
unsigned int NTPC (unsigned int cstat=0) const
 Returns the total number of TPCs in the specified cryostat. More...
 
unsigned int NTPC (geo::CryostatID const &cryoid) 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...
 
Plane access and information
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...
 
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 Nplanes (geo::TPCID const &tpcid) const
 Returns the total number of 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...
 
Wire access and information
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 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 MaxWires () const
 Returns the largest number of wires among all planes in this detector. More...
 
TPC set information
unsigned int NSiblingElements (readout::TPCsetID const &tpcsetid) const
 Returns the total number of TPC sets in the specified cryostat. More...
 
unsigned int NTPCsets (readout::CryostatID const &cryoid) const
 Returns the total number of TPC sets in the specified cryostat. More...
 
Readout plane information
unsigned int NSiblingElements (readout::ROPID const &ropid) const
 Returns the total number of ROP in the specified TPC set. More...
 
unsigned int NROPs (readout::TPCsetID const &tpcsetid) const
 Returns the total number of ROP in the specified TPC set. 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...
 
bool HasElement (geo::PlaneID const &planeid) const
 Returns whether we have the specified plane. More...
 
bool HasPlane (geo::PlaneID const &planeid) const
 Returns whether we have the specified plane. More...
 
bool HasElement (geo::WireID const &wireid) const
 Returns whether we have the specified wire. More...
 
bool HasWire (geo::WireID const &wireid) const
 Returns whether we have the specified wire. 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...
 
TPCGeo const & GetElement (geo::TPCID const &tpcid) const
 Returns the specified TPC. 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...
 
PlaneGeo const & GetElement (geo::PlaneID const &planeid) const
 Returns the specified wire. 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...
 
WireGeo const & GetElement (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...
 
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...
 
TPCGeo const * GetElementPtr (geo::TPCID const &tpcid) const
 Returns the specified TPC. More...
 
TPCGeo const * TPCPtr (geo::TPCID const &tpcid) const
 Returns the specified TPC. More...
 
PlaneGeo const * GetElementPtr (geo::PlaneID const &planeid) const
 Returns the specified plane. More...
 
PlaneGeo const * PlanePtr (geo::PlaneID const &planeid) const
 Returns the specified plane. More...
 
WireGeo const * GetElementPtr (geo::WireID const &wireid) const
 Returns the specified wire. More...
 
WireGeo const * WirePtr (geo::WireID const &wireid) const
 Returns the specified wire. 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...
 
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...
 
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...
 
geo::Length_t WirePitch (geo::PlaneID const &planeid, unsigned int w1=0, unsigned int w2=1) const
 Returns the distance between two consecutive wires. More...
 
geo::Length_t WirePitch (unsigned int w1=0, unsigned int w2=1, 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 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...
 
Optical readout channels
Todo:
add explanation of the different IDs
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 Member Functions

void LoadNewGeometry (std::string gdmlfile, std::string rootfile, bool bForceReload=false)
 Expands the provided paths and loads the geometry description(s) More...
 
void InitializeChannelMap ()
 

Private Attributes

std::string fRelPath
 
bool fDisableWiresInG4
 
bool fForceUseFCLOnly
 
fhicl::ParameterSet fSortingParameters
 Parameter set to define the channel map sorting. More...
 

Detailed Description

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

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

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

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

Configuration

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

  • RelativePath (string, default: no path): this path is prepended to the geometry file names before searching from them; the path string does not affect the file name
  • GDML (string, mandatory): path of the GDML file to be served to Geant4 for detector simulation. The full file is composed out of the optional relative path specified by RelativePath path and the base name specified in GDML parameter; this path is searched for in the directories configured in the FW_SEARCH_PATH environment variable;
  • ROOT (string, mandatory): currently overridden by GDML parameter, whose value is used instead; this path is assembled in the same way as the one for GDML parameter, except that no alternative (wireless) geometry is used even if DisableWiresInG4 is specified (see below); this file is used to load the geometry used in the internal simulation and reconstruction, basically everywhere except for the Geant4 simulation
  • DisableWiresInG4 (boolean, default: false): if true, Geant4 is loaded with an alternative geometry from a file with the standard name as configured with the /GDML/ parameter, but with an additional "_nowires" appended before the ".gdml" suffix
  • ForceUseFCLOnly (boolean, default: false): information on the current geometry is stored in each run by the event generator producers; if this information does not describe the current geometry, a new geometry is loaded according to the information in the run. If ForceUseFCLOnly is set to true, this mechanism is disabled and the geometry is just loaded at the beginning of the job from the information in the job configuration, once and for all.
  • SortingParameters (a parameter set; default: empty): this configuration is directly passed to the channel mapping algorithm (see geo::ChannelMapAlg); its content is dependent on the chosen implementation of ChannelMapAlg
Note
Currently, the file defined by GDML parameter is also served to ROOT for the internal geometry representation.

Definition at line 110 of file Geometry.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.

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.

type of service provider

Definition at line 114 of file Geometry.h.

Definition at line 1474 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::Geometry::Geometry ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry reg 
)

Definition at line 31 of file Geometry_service.cc.

References fRelPath, fhicl::ParameterSet::get(), LoadNewGeometry(), preBeginRun(), and art::ActivityRegistry::sPreBeginRun.

32  : GeometryCore(pset)
33  , fRelPath (pset.get< std::string >("RelativePath", "" ))
34  , fDisableWiresInG4 (pset.get< bool >("DisableWiresInG4", false))
35  , fForceUseFCLOnly (pset.get< bool >("ForceUseFCLOnly" , false))
36  , fSortingParameters(pset.get<fhicl::ParameterSet>("SortingParameters", fhicl::ParameterSet() ))
37  {
38  // add a final directory separator ("/") to fRelPath if not already there
39  if (!fRelPath.empty() && (fRelPath.back() != '/')) fRelPath += '/';
40 
41  // register a callback to be executed when a new run starts
42  reg.sPreBeginRun.watch(this, &Geometry::preBeginRun);
43 
44  //......................................................................
45  // 5.15.12 BJR: use the gdml file for both the fGDMLFile and fROOTFile
46  // variables as ROOT v5.30.06 is once again able to read in gdml files
47  // during batch operation, in this case think of fROOTFile meaning the
48  // file used to make the ROOT TGeoManager. I don't want to remove
49  // the separate variables in case ROOT breaks again
50  std::string GDMLFileName = pset.get<std::string>("GDML");
51  std::string ROOTFileName = pset.get<std::string>("GDML");
52 
53  // load the geometry
54  LoadNewGeometry(GDMLFileName, ROOTFileName);
55 
56  } // Geometry::Geometry()
fhicl::ParameterSet fSortingParameters
Parameter set to define the channel map sorting.
Definition: Geometry.h:141
bool fDisableWiresInG4
Definition: Geometry.h:137
void preBeginRun(art::Run const &run)
Updates the geometry if needed at the beginning of each new run.
bool fForceUseFCLOnly
Definition: Geometry.h:139
GeometryCore(fhicl::ParameterSet const &pset)
Initialize geometry from a given configuration.
std::string fRelPath
Definition: Geometry.h:135
void LoadNewGeometry(std::string gdmlfile, std::string rootfile, bool bForceReload=false)
Expands the provided paths and loads the geometry description(s)
GlobalSignal< detail::SignalResponseType::FIFO, void(Run const &)> sPreBeginRun

Member Function Documentation

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

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 geo::GeometryCore::fChannelMapAlg, geo::GeometryCore::fGeoData, geo::GeometryCore::SortGeometry(), and geo::GeometryCore::UpdateAfterSorting().

Referenced by geo::StandardGeometryHelper::doConfigureChannelMapAlg(), and geo::GeometryCore::~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
inherited

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 geo::GeometryCore::AuxDets(), and geo::GeometryCore::NAuxDets().

Referenced by geo::GeometryCore::ChannelToAuxDet(), geo::GeometryCore::ChannelToAuxDetSensitive(), geo::GeometryCore::PositionToAuxDet(), geo::GeometryCore::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 ( )
inlineprotectedinherited
AuxDetList_t const& geo::GeometryCore::AuxDets ( ) const
inlineprotectedinherited

Return the interfal auxiliary detectors list.

Definition at line 5268 of file GeometryCore.h.

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

Returns an iterator pointing to the first cryostat.

Definition at line 2117 of file GeometryCore.h.

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

Referenced by evd_tool::ICARUSDrawer::DetOutline3D(), and geo::GeometryCore::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
inlineinherited

Returns an iterator pointing to the first cryostat ID.

Definition at line 2109 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::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
inlineinherited

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

Definition at line 2998 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::IteratePlaneIDs(), and geo::GeometryCore::IteratePlanes().

2999  { 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
inlineinherited

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

Definition at line 3007 of file GeometryCore.h.

3008  { 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
inlineinherited

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

Definition at line 3016 of file GeometryCore.h.

3017  { 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
inlineinherited

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

Definition at line 2970 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::end_plane(), and geo::GeometryCore::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
inlineinherited

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

Definition at line 2979 of file GeometryCore.h.

2980  { 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
inlineinherited

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

Definition at line 2989 of file GeometryCore.h.

2990  { 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
inlineinherited

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

Definition at line 5011 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::end_ROP_id(), and geo::GeometryCore::IterateROPIDs().

5012  { 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
inlineinherited

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

Definition at line 5020 of file GeometryCore.h.

5021  { 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
inlineinherited

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

Definition at line 5030 of file GeometryCore.h.

5031  { 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
inlineinherited

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

Definition at line 2527 of file GeometryCore.h.

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

Referenced by lar::example::SpacePointIsolationAlg::fillAlgConfigFromGeometry(), geo::GeometryCore::IterateTPCIDs(), and geo::GeometryCore::IterateTPCs().

2528  { 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
inlineinherited

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

Definition at line 2535 of file GeometryCore.h.

2536  { 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
inlineinherited

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

Definition at line 2509 of file GeometryCore.h.

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

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

2510  { 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
inlineinherited

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

Definition at line 2518 of file GeometryCore.h.

2519  { 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
inlineinherited

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

Definition at line 4774 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::end_TPCset_id(), and geo::GeometryCore::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
inlineinherited

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

Definition at line 4783 of file GeometryCore.h.

4784  { 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
inlineinherited

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

Definition at line 3392 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::IterateWireIDs(), and geo::GeometryCore::IterateWires().

3393  { 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
inlineinherited

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

Definition at line 3400 of file GeometryCore.h.

3401  { 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
inlineinherited

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

Definition at line 3408 of file GeometryCore.h.

3409  { 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
inlineinherited

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

Definition at line 3416 of file GeometryCore.h.

3417  { 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
inlineinherited

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

Definition at line 3359 of file GeometryCore.h.

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

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

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
inlineinherited

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

Definition at line 3367 of file GeometryCore.h.

3368  { 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
inlineinherited

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

Definition at line 3376 of file GeometryCore.h.

3377  { 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
inlineinherited

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

Definition at line 3384 of file GeometryCore.h.

3385  { 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
inlineprotectedinherited

Returns the object handling the channel map.

Definition at line 5256 of file GeometryCore.h.

Referenced by InitializeChannelMap().

5257  { 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
inherited

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 1213 of file GeometryCore.cxx.

References geo::GeometryCore::ChannelToWire(), geo::GeometryCore::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().

1217  {
1218 
1219  // [GP] these errors should be exceptions, and this function is deprecated
1220  // because it violates interoperability
1221  std::vector<geo::WireID> chan1wires = ChannelToWire(c1);
1222  if (chan1wires.empty()) {
1223  mf::LogError("ChannelsIntersect")
1224  << "1st channel " << c1 << " maps to no wire (is it a real one?)";
1225  return false;
1226  }
1227  std::vector<geo::WireID> chan2wires = ChannelToWire(c2);
1228  if (chan2wires.empty()) {
1229  mf::LogError("ChannelsIntersect")
1230  << "2nd channel " << c2 << " maps to no wire (is it a real one?)";
1231  return false;
1232  }
1233 
1234  if (chan1wires.size() > 1) {
1235  mf::LogWarning("ChannelsIntersect")
1236  << "1st channel " << c1 << " maps to " << chan2wires.size()
1237  << " wires; using the first!";
1238  return false;
1239  }
1240  if (chan2wires.size() > 1) {
1241  mf::LogError("ChannelsIntersect")
1242  << "2nd channel " << c2 << " maps to " << chan2wires.size()
1243  << " wires; using the first!";
1244  return false;
1245  }
1246 
1247  geo::WireIDIntersection widIntersect;
1248  if (this->WireIDsIntersect(chan1wires[0],chan2wires[0],widIntersect)){
1249  y = widIntersect.y;
1250  z = widIntersect.z;
1251  return true;
1252  }
1253  else{
1254  y = widIntersect.y;
1255  z = widIntersect.z;
1256  return false;
1257  }
1258  }
MaybeLogger_< ELseverityLevel::ELsev_warning, false, true, detail::ConditionalLogger > LogWarning
Definition: MessageLogger.h:58
double z
z position of intersection
Definition: geo_types.h:497
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.
TCanvas * c1
Definition: plotHisto.C:7
TCanvas * c2
Definition: plot_hist.C:75
MaybeLogger_< ELseverityLevel::ELsev_error, false, true, detail::AlwaysLogger > LogError
Definition: MessageLogger.h:66
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:496
const AuxDetGeo & geo::GeometryCore::ChannelToAuxDet ( std::string const &  auxDetName,
uint32_t const &  channel 
) const
inherited

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 510 of file GeometryCore.cxx.

References geo::GeometryCore::AuxDet(), geo::GeometryCore::AuxDets(), and geo::GeometryCore::fChannelMapAlg.

512  {
513  size_t adIdx = fChannelMapAlg->ChannelToAuxDet(AuxDets(), auxDetName, channel);
514  return this->AuxDet(adIdx);
515  }
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
inherited

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 518 of file GeometryCore.cxx.

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

520  {
521  auto idx = fChannelMapAlg->ChannelToSensitiveAuxDet(AuxDets(), auxDetName, channel);
522  return this->AuxDet(idx.first).SensitiveVolume(idx.second);
523  }
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
inherited

Returns the ID of the ROP the channel belongs to

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

Definition at line 1052 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg, and geo::GeometryCore::WireCoordinate().

Referenced by geo::GeometryCore::View().

1053  {
1054  return fChannelMapAlg->ChannelToROP(channel);
1055  } // 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
inherited

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 1046 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

Referenced by hit::MCHitAnaExample::analyze(), MCBTDemo::analyze(), detsim::WienerFilterAna::analyze(), apa::APAGeometryAlg::APAChannelsIntersect(), lar_cluster3d::Hit3DBuilderAlg::BuildChannelStatusVec(), geo::GeometryCore::ChannelsIntersect(), apa::APAGeometryAlg::ChanSegsPerSide(), apa::DisambigAlg::CompareViews(), lar_cluster3d::MinSpanTreeAlg::configure(), evd::RawDataDrawer::FillQHisto(), evd::RecoBaseDrawer::FillQHisto(), lar_pandora::PFParticleHitDumper::FillRecoWires(), evd::RecoBaseDrawer::FillTQHisto(), evd::RecoBaseDrawer::FillTQHistoDP(), hit::HitCheater::FindHitsOnChannel(), cluster::SmallClusterFinderAlg::GetPlaneAndTPC(), corner::CornerFinderAlg::GrabWires(), apa::APAGeometryAlg::Init(), hit::DisambigCheater::InitHitToWids(), 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::DPRawHitFinder::produce(), hit::GausHitFinder::produce(), hit::RFFHitFinderAlg::Run(), hit::CCHitFinderAlg::RunCCHitFinder(), evd::RawDataDrawer::RunOperation(), img::DataProviderAlg::setWireDriftData(), apa::APAGeometryAlg::ThreeChanPos(), apa::DisambigAlg::TrivialDisambig(), and evd::RecoBaseDrawer::Wire2D().

1047  {
1048  return fChannelMapAlg->ChannelToWire(channel);
1049  }
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
double geo::GeometryCore::ComputeThirdPlane_dTdW ( double  angle1,
double  pitch1,
double  dTdW1,
double  angle2,
double  pitch2,
double  dTdW2,
double  angle_target,
double  pitch_target 
)
staticinherited

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 1602 of file GeometryCore.cxx.

References geo::GeometryCore::ComputeThirdPlaneSlope().

Referenced by geo::GeometryCore::ThirdPlane_dTdW().

1607  {
1608  // we need to convert dt/dw into homogeneous coordinates, and then back;
1609  // slope = [dT * (TDCperiod / driftVelocity)] / [dW * wirePitch]
1610  // The coefficient of dT is assumed to be the same for all the planes,
1611  // and it finally cancels out. Pitches cancel out only if they are all
1612  // the same.
1613  return pitch_target * ComputeThirdPlaneSlope
1614  (angle1, dTdW1 / pitch1, angle2, dTdW2 / pitch2, angle_target);
1615  } // 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 
)
staticinherited

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 1577 of file GeometryCore.cxx.

Referenced by geo::GeometryCore::ComputeThirdPlane_dTdW(), geo::GeometryCore::ThirdPlane_dTdW(), and geo::GeometryCore::ThirdPlaneSlope().

1578  {
1579  // note that, if needed, the trigonometric functions can be pre-calculated.
1580 
1581  // Can't resolve very small slopes
1582  if ((std::abs(slope1) < 0.001) && (std::abs(slope2)) < 0.001) return 0.001;
1583 
1584  // We need the "wire coordinate direction" for each plane.
1585  // This is perpendicular to the wire orientation.
1586  double slope3 = 0.001;
1587  if (std::abs(slope1) > 0.001 && std::abs(slope2) > 0.001) {
1588  slope3
1589  = (
1590  + (1./slope1)*std::sin(angle3-angle2)
1591  - (1./slope2)*std::sin(angle3-angle1)
1592  ) / std::sin(angle1-angle2)
1593  ;
1594  }
1595  if (slope3 != 0.) slope3 = 1./slope3;
1596  else slope3 = 999.;
1597 
1598  return slope3;
1599  } // GeometryCore::ComputeThirdPlaneSlope()
CryostatGeo const & geo::GeometryCore::Cryostat ( geo::CryostatID const &  cryoid) const
inherited

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 geo::GeometryCore::CryostatPtr().

Referenced by 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(), geo::GeometryCore::CryostatBoundaries(), geo::GeometryCore::CryostatHalfHeight(), geo::GeometryCore::CryostatHalfWidth(), geo::GeometryCore::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(), geo::GeometryCore::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(), geo::GeometryCore::NOpDets(), geo::GeometryCore::OpDetFromCryo(), geo::GeometryCore::OpDetGeoFromOpDet(), geo::GeometryCore::OpDetGeoName(), geo::GeometryCore::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
inlineinherited

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 1994 of file GeometryCore.h.

1995  { 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:119
void geo::GeometryCore::CryostatBoundaries ( double *  boundaries,
geo::CryostatID const &  cid 
) const
inherited

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 714 of file GeometryCore.cxx.

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

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

715  {
716  geo::CryostatGeo const& cryo = Cryostat(cid);
717  cryo.Boundaries(boundaries);
718  } // 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
inlineinherited

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 2223 of file GeometryCore.h.

2224  { 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:119
geo::Length_t geo::GeometryCore::CryostatHalfHeight ( geo::CryostatID const &  cid) const
inherited

Returns the height of the cryostat (y direction)

Definition at line 701 of file GeometryCore.cxx.

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

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

702  {
703  return Cryostat(cid).HalfHeight();
704  }
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
inlineinherited

Returns the height of the cryostat (y direction)

Definition at line 2177 of file GeometryCore.h.

2178  { 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:119
geo::Length_t geo::GeometryCore::CryostatHalfWidth ( geo::CryostatID const &  cid) const
inherited

Returns the half width of the cryostat (x direction)

Definition at line 694 of file GeometryCore.cxx.

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

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

695  {
696  return Cryostat(cid).HalfWidth();
697  }
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
inlineinherited

Returns the half width of the cryostat (x direction)

Definition at line 2170 of file GeometryCore.h.

2171  { 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:119
geo::Length_t geo::GeometryCore::CryostatLength ( geo::CryostatID const &  cid) const
inherited

Returns the length of the cryostat (z direction)

Definition at line 707 of file GeometryCore.cxx.

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

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

708  {
709  return Cryostat(cid).Length();
710  }
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
inlineinherited

Returns the length of the cryostat (z direction)

Definition at line 2184 of file GeometryCore.h.

2185  { 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:119
CryostatGeo const* geo::GeometryCore::CryostatPtr ( geo::CryostatID const &  cryoid) const
inlineinherited

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 2009 of file GeometryCore.h.

References geo::CryostatID::Cryostat.

Referenced by geo::GeometryCore::Cryostat().

2010  { 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 ( )
inlineprotectedinherited
CryostatList_t const& geo::GeometryCore::Cryostats ( ) const
inlineprotectedinherited

Return the internal cryostat list.

Definition at line 5262 of file GeometryCore.h.

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

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::Length_t geo::GeometryCore::DetHalfHeight ( geo::TPCID const &  tpcid) const
inherited

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 681 of file GeometryCore.cxx.

References geo::TPCGeo::ActiveHalfHeight(), and geo::GeometryCore::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_tool::StandardDrawer::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(), sim::MCRecoPart::MCRecoPart(), 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().

682  {
683  return TPC(tpcid).ActiveHalfHeight();
684  }
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
inlineinherited

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 2671 of file GeometryCore.h.

2672  { 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:194
geo::Length_t geo::GeometryCore::DetHalfWidth ( geo::TPCID const &  tpcid) const
inherited

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 675 of file GeometryCore.cxx.

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

Referenced by lar::example::AnalysisExample::analyze(), evgen::NUANCEGen::beginJob(), evgen::NDKGen::beginJob(), evgen::GENIEGen::beginJob(), trkf::SpacePointAna::bookHistograms(), LArStackingAction::ClassifyNewTrack(), evd_tool::StandardDrawer::DetOutline3D(), 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(), sim::MCRecoPart::MCRecoPart(), 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(), and evd::TWQProjectionView::SetSeeds().

676  {
677  return TPC(tpcid).ActiveHalfWidth();
678  }
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
inlineinherited

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 2649 of file GeometryCore.h.

2650  { 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:194
geo::Length_t geo::GeometryCore::DetLength ( geo::TPCID const &  tpcid) const
inherited

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 687 of file GeometryCore.cxx.

References geo::TPCGeo::ActiveLength(), geo::GeometryCore::CryostatHalfWidth(), and geo::GeometryCore::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_tool::StandardDrawer::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(), sim::MCRecoPart::MCRecoPart(), lar_cluster3d::Hit3DBuilderAlg::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(), and evd::TWQProjectionView::SetSeeds().

688  {
689  return TPC(tpcid).ActiveLength();
690  }
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
inlineinherited

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 2692 of file GeometryCore.h.

2693  { 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:194
cryostat_iterator geo::GeometryCore::end_cryostat ( ) const
inlineinherited

Returns an iterator pointing after the last cryostat.

Definition at line 2121 of file GeometryCore.h.

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

Referenced by evd_tool::ICARUSDrawer::DetOutline3D(), and geo::GeometryCore::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
inlineinherited

Returns an iterator pointing after the last cryostat ID.

Definition at line 2113 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::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
inlineinherited

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

Definition at line 3002 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::IteratePlaneIDs(), and geo::GeometryCore::IteratePlanes().

3003  { 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
inlineinherited

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

Definition at line 3012 of file GeometryCore.h.

3013  { 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
inlineinherited

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

Definition at line 3020 of file GeometryCore.h.

References geo::GeometryCore::begin_plane_id(), and geo::GeometryCore::end_plane_id().

3021  { 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
inlineinherited

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

Definition at line 2974 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::end_plane(), and geo::GeometryCore::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
inlineinherited

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

Definition at line 2984 of file GeometryCore.h.

2985  { 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
inlineinherited

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

Definition at line 2994 of file GeometryCore.h.

2995  { 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
inlineinherited

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

Definition at line 5015 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::end_ROP_id(), and geo::GeometryCore::IterateROPIDs().

5016  { 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
inlineinherited

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

Definition at line 5025 of file GeometryCore.h.

5026  { 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
inlineinherited

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

Definition at line 5035 of file GeometryCore.h.

References geo::GeometryCore::begin_ROP_id(), and geo::GeometryCore::end_ROP_id().

5036  { 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
inlineinherited

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

Definition at line 2531 of file GeometryCore.h.

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

Referenced by lar::example::SpacePointIsolationAlg::fillAlgConfigFromGeometry(), geo::GeometryCore::IterateTPCIDs(), and geo::GeometryCore::IterateTPCs().

2532  { 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
inlineinherited

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

Definition at line 2539 of file GeometryCore.h.

References geo::GeometryCore::begin_TPC_id(), and geo::GeometryCore::end_TPC_id().

2540  { 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
inlineinherited

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

Definition at line 2513 of file GeometryCore.h.

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

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

2514  { 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
inlineinherited

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

Definition at line 2523 of file GeometryCore.h.

2524  { 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
inlineinherited

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

Definition at line 4778 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::end_TPCset_id(), and geo::GeometryCore::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
inlineinherited

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

Definition at line 4788 of file GeometryCore.h.

References geo::GeometryCore::begin_TPCset_id(), and geo::GeometryCore::end_TPCset_id().

4789  { 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
inlineinherited

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

Definition at line 3396 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::IterateWireIDs(), and geo::GeometryCore::IterateWires().

3397  { 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
inlineinherited

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

Definition at line 3404 of file GeometryCore.h.

3405  { 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
inlineinherited

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

Definition at line 3412 of file GeometryCore.h.

3413  { 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
inlineinherited

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

Definition at line 3420 of file GeometryCore.h.

References geo::GeometryCore::begin_wire_id(), and geo::GeometryCore::end_wire_id().

3421  { 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
inlineinherited

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

Definition at line 3363 of file GeometryCore.h.

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

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

3364  { 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
inlineinherited

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

Definition at line 3372 of file GeometryCore.h.

3373  { 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
inlineinherited

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

Definition at line 3380 of file GeometryCore.h.

3381  { 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
inlineinherited

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

Definition at line 3388 of file GeometryCore.h.

3389  { 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
inherited

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 646 of file GeometryCore.cxx.

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

Referenced by geo::GeometryCore::FindAllVolumes().

647  {
648  CollectPathsByName path_collector(vol_names);
649 
650  ROOTGeoNodeForwardIterator iNode(ROOTGeoManager()->GetTopNode());
651 
652  while (*iNode) {
653  path_collector(iNode);
654  ++iNode;
655  } // while
656 
657  return path_collector.paths;
658  } // 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
inherited

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 629 of file GeometryCore.cxx.

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

630  {
631  CollectNodesByName node_collector(vol_names);
632 
633  ROOTGeoNodeForwardIterator iNode(ROOTGeoManager()->GetTopNode());
634  TGeoNode const* pCurrentNode;
635 
636  while ((pCurrentNode = *iNode)) {
637  node_collector(*pCurrentNode);
638  ++iNode;
639  } // while
640 
641  return node_collector.nodes;
642  } // GeometryCore::FindAllVolumes()
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
unsigned int geo::GeometryCore::FindAuxDetAtPosition ( double const  worldLoc[3]) const
inherited

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 462 of file GeometryCore.cxx.

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

Referenced by geo::GeometryCore::FindAuxDetSensitiveAtPosition(), and geo::GeometryCore::PositionToAuxDet().

unsigned int FindAuxDetAtPosition(double const worldLoc[3]) const
Returns the index of the auxiliary detector at specified location.
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
inherited

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 geo::GeometryCore::AuxDets(), and geo::GeometryCore::fChannelMapAlg.

456  {
457  std::array<double, 3U> worldPos = { point.X(), point.Y(), point.Z() };
458  return fChannelMapAlg->NearestAuxDet(worldPos.data(), AuxDets());
459  } // 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
inherited

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 482 of file GeometryCore.cxx.

References geo::GeometryCore::AuxDets(), geo::GeometryCore::fChannelMapAlg, and geo::GeometryCore::FindAuxDetAtPosition().

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

483  {
484  adg = FindAuxDetAtPosition(point);
485  std::array<double, 3U> const worldPos = { point.X(), point.Y(), point.Z() };
486  sv = fChannelMapAlg->NearestSensitiveAuxDet(worldPos.data(), AuxDets());
487  } // 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
inherited

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 491 of file GeometryCore.cxx.

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

492  { 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.
constexpr::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
geo::CryostatID::CryostatID_t geo::GeometryCore::FindCryostatAtPosition ( geo::Point_t const &  worldLoc) const
inherited

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 geo::GeometryCore::PositionToCryostatPtr().

Referenced by pma::ProjectionMatchingAlg::buildShowerSeg(), ems::MultiEMShowers::convCluster(), geo::GeometryCore::FindCryostatAtPosition(), evd::SimulationDrawer::MCTruthOrtho(), geo::GeometryCore::PositionToCryostat(), and geo::GeometryCore::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:129
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:125
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
inherited

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 geo::GeometryCore::FindCryostatAtPosition(), geo::vect::makePointFromCoords(), and geo::GeometryCore::PositionToTPCptr().

362  {
364  } // GeometryCore::FindCryostatAtPosition(double[])
geo::CryostatID::CryostatID_t FindCryostatAtPosition(geo::Point_t const &worldLoc) const
Returns the index of the cryostat at specified location.
constexpr::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
geo::TPCID geo::GeometryCore::FindTPCAtPosition ( double const  worldLoc[3]) const
inlineinherited

Returns the ID of the TPC at specified location.

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

Definition at line 2417 of file GeometryCore.h.

References geo::vect::makePointFromCoords().

Referenced by pma::ProjectionMatchingAlg::buildShowerSeg(), ems::MultiEMShowers::convCluster(), hit::HitCheater::FindHitsOnChannel(), shower::EMShowerAlg::FindInitialTrackHits(), geo::GeometryCore::FindTPCsetAtPosition(), opdet::GetHitGeometryInfo(), nnet::TrainingDataAlg::getProjection(), lar_pandora::LArPandoraInput::GetTrueStartAndEndPoints(), hit::DisambigCheater::InitHitToWids(), evd::SimulationDrawer::MCTruthOrtho(), shower::EMShowerAlg::OrderShowerHits(), calo::Calorimetry::produce(), shower::EMShowerAlg::Project3DPointOntoPlane(), DUNE::NeutrinoTrackingEff::truthLength(), and DUNE::MuonTrackingEff::truthLength().

2418  { return FindTPCAtPosition(geo::vect::makePointFromCoords(worldLoc)); }
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
constexpr::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
geo::TPCID geo::GeometryCore::FindTPCAtPosition ( geo::Point_t const &  point) const
inherited

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, geo::GeometryCore::fPositionWiggle, geo::CryostatGeo::ID(), geo::CryostatID::markInvalid(), geo::GeometryCore::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:129
Geometry information for a single cryostat.
Definition: CryostatGeo.h:36
The data type to uniquely identify a TPC.
Definition: geo_types.h:194
void markInvalid()
Sets the ID as invalid.
Definition: geo_types.h:156
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
inlineinherited

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 2427 of file GeometryCore.h.

References geo::vect::toPoint().

2428  { 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
inherited

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 1661 of file GeometryCore.cxx.

References geo::GeometryCore::FindTPCAtPosition(), and geo::GeometryCore::TPCtoTPCset().

Referenced by geo::GeometryCore::HasTPCset().

1662  {
1663  return TPCtoTPCset(FindTPCAtPosition(worldLoc));
1664  } // 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
inherited

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 1728 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

Referenced by geo::GeometryCore::ROPtoTPCs().

1729  {
1730  return fChannelMapAlg->FirstChannelInROP(ropid);
1731  } // GeometryCore::FirstChannelInROP()
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
std::string geo::GeometryCore::GDMLFile ( ) const
inlineinherited

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
inlineinherited

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 1896 of file GeometryCore.h.

References geo::GeometryCore::GetBeginID().

Referenced by geo::GeometryCore::GetBeginID().

1896 { 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
inherited

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
inlineinherited

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

Definition at line 2097 of file GeometryCore.h.

2098  { id = geo::CryostatID(0, HasCryostat(geo::CryostatID(0))); }
geo::CryostatID CryostatID
Definition: readout_types.h:26
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:119
void geo::GeometryCore::GetBeginID ( geo::TPCID id) const
inlineinherited

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

iterators

Definition at line 2487 of file GeometryCore.h.

2488  { 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
inlineinherited

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

Definition at line 2940 of file GeometryCore.h.

2941  { 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
inlineinherited

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

Definition at line 3320 of file GeometryCore.h.

3321  { 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
inlineinherited

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

iterators

Definition at line 4752 of file GeometryCore.h.

4753  { 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
inlineinherited

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

iterators

Definition at line 4981 of file GeometryCore.h.

4982  { 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
inlineinherited

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

Definition at line 2952 of file GeometryCore.h.

2953  { 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
inlineinherited

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

Definition at line 2961 of file GeometryCore.h.

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

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

Definition at line 4993 of file GeometryCore.h.

4994  { 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
inlineinherited

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

Definition at line 5002 of file GeometryCore.h.

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

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

Definition at line 2499 of file GeometryCore.h.

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

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

Definition at line 4764 of file GeometryCore.h.

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

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

Definition at line 3332 of file GeometryCore.h.

3333  { 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
inlineinherited

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

Definition at line 3341 of file GeometryCore.h.

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

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

Definition at line 3350 of file GeometryCore.h.

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

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 1837 of file GeometryCore.cxx.

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

Referenced by geo::GeometryCore::GetClosestOpDet().

1838  {
1839  geo::CryostatGeo const* cryo = PositionToCryostatPtr(point);
1840  if (!cryo) return std::numeric_limits<unsigned int>::max();
1841  int o = cryo->GetClosestOpDet(point);
1842  return OpDetFromCryo(o, cryo->ID().Cryostat);
1843  }
unsigned int GetClosestOpDet(geo::Point_t const &point) const
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:129
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
inherited

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 1848 of file GeometryCore.cxx.

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

unsigned int GetClosestOpDet(geo::Point_t const &point) const
Find the nearest OpChannel to some point.
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
inherited

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 669 of file GeometryCore.cxx.

References geo::GeometryCore::Cryostat().

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

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 2243 of file GeometryCore.h.

2244  { 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:119
CryostatGeo const& geo::GeometryCore::GetElement ( geo::CryostatID const &  cryoid) const
inlineinherited

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 1996 of file GeometryCore.h.

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

1997  { 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
inlineinherited

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 2390 of file GeometryCore.h.

2391  { 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
inlineinherited

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 2913 of file GeometryCore.h.

2914  { 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
inlineinherited

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 3311 of file GeometryCore.h.

3312  { 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
inlineinherited

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 2011 of file GeometryCore.h.

2012  { 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
inlineinherited

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 2408 of file GeometryCore.h.

2409  { 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
inlineinherited

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 2931 of file GeometryCore.h.

2932  { 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
inlineinherited

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 3293 of file GeometryCore.h.

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

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 1915 of file GeometryCore.h.

References geo::GeometryCore::GetEndID().

Referenced by geo::GeometryCore::GetEndID().

1915 { 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
inherited

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
inlineinherited

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

Definition at line 2101 of file GeometryCore.h.

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

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

Definition at line 2491 of file GeometryCore.h.

2492  { 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
inlineinherited

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

Definition at line 2944 of file GeometryCore.h.

2945  { 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
inlineinherited

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

Definition at line 3324 of file GeometryCore.h.

3325  { 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
inlineinherited

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

Definition at line 4756 of file GeometryCore.h.

4757  { 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
inlineinherited

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

Definition at line 4985 of file GeometryCore.h.

4986  { 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
inlineinherited

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

Definition at line 2957 of file GeometryCore.h.

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

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

Definition at line 2966 of file GeometryCore.h.

2967  { 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
inlineinherited

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

Definition at line 4998 of file GeometryCore.h.

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

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

Definition at line 5007 of file GeometryCore.h.

5008  { 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
inlineinherited

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

Definition at line 2504 of file GeometryCore.h.

References geo::CryostatID::Cryostat.

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

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

Definition at line 4769 of file GeometryCore.h.

References geo::CryostatID::Cryostat.

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

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

Definition at line 3337 of file GeometryCore.h.

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

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

Definition at line 3346 of file GeometryCore.h.

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

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

Definition at line 3355 of file GeometryCore.h.

3356  { 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
inherited

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 663 of file GeometryCore.cxx.

References geo::GeometryCore::TPC().

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

664  {
665  return std::string(TPC(tpcid).ActiveVolume()->GetName());
666  }
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
inlineinherited

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 2738 of file GeometryCore.h.

2739  { return GetLArTPCVolumeName(geo::TPCID(cstat, tpc)); }
The data type to uniquely identify a TPC.
Definition: geo_types.h:194
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
inlineinherited

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 1905 of file GeometryCore.h.

1906  { 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
inlineinherited

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 2710 of file GeometryCore.h.

2711  { return TPC(tpcid).GetFrontFaceCenter<Point>(); }
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
inlineinherited

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 2714 of file GeometryCore.h.

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

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

Definition at line 574 of file GeometryCore.cxx.

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

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

Convert unique channel to hardware channel.

Definition at line 242 of file GeometryCore.cxx.

References geo::GeometryCore::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
inherited

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 562 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

562  {
563  return fChannelMapAlg->HasChannel(channel);
564  } // 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
inlineinherited

Returns whether we have the specified cryostat.

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

Definition at line 1974 of file GeometryCore.h.

References geo::CryostatID::Cryostat.

1975  { 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
inlineinherited

Returns whether we have the specified cryostat.

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

Definition at line 1976 of file GeometryCore.h.

1977  { 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
inlineinherited

Returns whether we have the specified TPC.

Definition at line 2367 of file GeometryCore.h.

2367 { 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
inlineinherited

Returns whether we have the specified plane.

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

Definition at line 2886 of file GeometryCore.h.

2887  { 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
inlineinherited

Returns whether we have the specified wire.

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

Definition at line 3276 of file GeometryCore.h.

3276 { 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
inlineinherited

Returns whether we have the specified TPC set.

Definition at line 4716 of file GeometryCore.h.

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

Returns whether we have the specified readout plane

Returns
whether the readout plane is valid and exists

Definition at line 4920 of file GeometryCore.h.

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

Returns whether we have the specified plane.

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

Definition at line 2881 of file GeometryCore.h.

References geo::TPCGeo::HasPlane().

2882  {
2883  geo::TPCGeo const* pTPC = TPCPtr(planeid);
2884  return pTPC? pTPC->HasPlane(planeid): false;
2885  }
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
inherited

Returns whether we have the specified readout plane

Returns
whether the readout plane is valid and exists

Definition at line 1698 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

1698  {
1699  return fChannelMapAlg->HasROP(ropid);
1700  } // 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
inlineinherited

Returns whether we have the specified TPC.

Definition at line 2360 of file GeometryCore.h.

References geo::CryostatGeo::HasTPC().

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

2361  {
2362  CryostatGeo const* pCryo = CryostatPtr(tpcid);
2363  return pCryo? pCryo->HasTPC(tpcid): false;
2364  }
CryostatGeo const * CryostatPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
bool geo::GeometryCore::HasTPCset ( readout::TPCsetID const &  tpcsetid) const
inherited

Returns whether we have the specified TPC set

Returns
whether the TPC set is valid and exists

Definition at line 1654 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg, and geo::GeometryCore::FindTPCsetAtPosition().

1654  {
1655  return fChannelMapAlg->HasTPCset(tpcsetid);
1656  } // 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
inlineinherited

Returns whether we have the specified wire.

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

Definition at line 3271 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 geo::GeometryCore::WireIDIntersectionCheck().

3272  {
3273  geo::PlaneGeo const* pPlane = PlanePtr(wireid);
3274  return pPlane? pPlane->HasWire(wireid): false;
3275  }
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
inlineinherited

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 5390 of file GeometryCore.h.

5390  {
5391  ++id.Cryostat;
5392  if (id) id.isValid = HasCryostat(id); // if invalid already, it stays so
5393  return bool(id);
5394 } // 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
inlineinherited

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 5396 of file GeometryCore.h.

5396  {
5397  unsigned int const nTPCsInCryo = NTPC(id);
5398  if (++id.TPC < nTPCsInCryo) return bool(id); // if was invalid, it stays so
5399  // no more TPCs in this cryostat
5400  id.TPC = 0;
5401  return IncrementID(id.asCryostatID()); // also sets validity
5402 } // 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
inlineinherited

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 5404 of file GeometryCore.h.

5404  {
5405  // this implementation is non-optimal, in that the cryostat lookup is
5406  // performed both here and, potentially, in IncrementID(TPCID)
5407  unsigned int const nPlanesInTPC = Nplanes(id);
5408  if (++id.Plane < nPlanesInTPC) return bool(id); // if was invalid, stays so
5409  // no more planes in this TPCs
5410  id.Plane = 0;
5411  return IncrementID(id.asTPCID()); // also sets validity
5412 } // 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
inlineinherited

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 5414 of file GeometryCore.h.

5414  {
5415  // this implementation is non-optimal, in that the TPC lookup is
5416  // performed both here and, potentially, in IncrementID(PlaneID)
5417  unsigned int const nWiresInPlane = Nwires(id);
5418  if (++id.Wire < nWiresInPlane) return bool(id); // if was invalid, stays so
5419  // no more wires in this plane
5420  id.Wire = 0;
5421  return IncrementID(id.asPlaneID()); // also sets validity
5422 } // 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
inlineinherited

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 5424 of file GeometryCore.h.

5424  {
5425  unsigned int const nTPCsetsInCryo = NTPCsets(id);
5426  if (++id.TPCset < nTPCsetsInCryo)
5427  return bool(id); // if was invalid, it stays so
5428  // no more TPC sets in this cryostat
5429  id.TPCset = 0;
5430  return IncrementID(id.asCryostatID()); // also sets validity
5431 } // 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
inlineinherited

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 5433 of file GeometryCore.h.

References geo::GeometryCore::WireEndPoints().

5433  {
5434  // this implementation is non-optimal, in that the cryostat lookup is
5435  // performed both here and, potentially, in IncrementID(TPCsetID)
5436  unsigned int const nROPinTPC = NROPs(id);
5437  if (++id.ROP < nROPinTPC) return bool(id); // if was invalid, stays so
5438  // no more readout planes in this TPC set
5439  id.ROP = 0;
5440  return IncrementID(id.asTPCsetID()); // also sets validity
5441 } // 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.
void geo::Geometry::InitializeChannelMap ( )
private

Definition at line 98 of file Geometry_service.cc.

References geo::GeometryCore::ChannelMap(), and fSortingParameters.

Referenced by LoadNewGeometry(), and provider().

99  {
100  // the channel map is responsible of calling the channel map configuration
101  // of the geometry
103  ->ConfigureChannelMapAlg(fSortingParameters, this);
104 
105  if ( ! ChannelMap() ) {
106  throw cet::exception("ChannelMapLoadFail")
107  << " failed to load new channel map";
108  }
109 
110  } // Geometry::InitializeChannelMap()
fhicl::ParameterSet fSortingParameters
Parameter set to define the channel map sorting.
Definition: Geometry.h:141
geo::ChannelMapAlg const * ChannelMap() const
Returns the object handling the channel map.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool geo::GeometryCore::IntersectionPoint ( geo::WireID const &  wid1,
geo::WireID const &  wid2,
double &  y,
double &  z 
) const
inherited

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 1627 of file GeometryCore.cxx.

References geo::GeometryCore::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().

1630  {
1631  geo::WireIDIntersection widIntersect;
1632  bool const found = WireIDsIntersect(wid1, wid2, widIntersect);
1633  y = widIntersect.y;
1634  z = widIntersect.z;
1635  return found;
1636  }
double z
z position of intersection
Definition: geo_types.h:497
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:496
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
inlineinherited

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 4117 of file GeometryCore.h.

4125  {
4126  return IntersectionPoint(
4127  geo::WireID(cstat, tpc, plane1, wire1),
4128  geo::WireID(cstat, tpc, plane2, wire2),
4129  y, z
4130  );
4131  }
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
inherited

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 1262 of file GeometryCore.cxx.

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

Referenced by geo::GeometryCore::IntersectSegments().

1266  {
1267 
1268  // Equation from http://en.wikipedia.org/wiki/Line%E2%80%93line_intersection
1269  // T.Yang Nov, 2014
1270  // Notation: x => coordinate orthogonal to the drift direction and to the beam direction
1271  // y => direction orthogonal to the previous and to beam direction
1272 
1273  double const denom = (A_start_x - A_end_x)*(B_start_y - B_end_y)
1274  - (A_start_y - A_end_y)*(B_start_x - B_end_x);
1275 
1276  if (coordIs.zero(denom)) return false;
1277 
1278  double const A = (A_start_x * A_end_y - A_start_y * A_end_x) / denom;
1279  double const B = (B_start_x * B_end_y - B_start_y * B_end_x) / denom;
1280 
1281  x = (B_start_x - B_end_x) * A - (A_start_x - A_end_x) * B;
1282  y = (B_start_y - B_end_y) * A - (A_start_y - A_end_y) * B;
1283 
1284  return true;
1285 
1286  } // 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
inherited

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 1289 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(), geo::GeometryCore::IntersectLines(), geo::TPCID::InvalidID, geo::GeometryCore::PointWithinSegments(), geo::sqr(), geo::GeometryCore::Segment< Point >::start(), geo::GeometryCore::ThirdPlane(), geo::vect::toTVector3(), geo::TPCID::TPC, geo::WireIDIntersection::TPC, geo::GeometryCore::Wire(), geo::GeometryCore::WireEndPoints(), geo::GeometryCore::WireIDIntersectionCheck(), geo::GeometryCore::WireIDsIntersect(), geo::WireIDIntersection::y, and geo::WireIDIntersection::z.

1293  {
1294 
1295  bool bCross = IntersectLines(
1296  A_start_x, A_start_y, A_end_x, A_end_y,
1297  B_start_x, B_start_y, B_end_x, B_end_y,
1298  x, y
1299  );
1300 
1301  if (bCross) {
1302  mf::LogWarning("IntersectSegments") << "The segments are parallel!";
1303  return false;
1304  }
1305 
1306  return PointWithinSegments(
1307  A_start_x, A_start_y, A_end_x, A_end_y,
1308  B_start_x, B_start_y, B_end_x, B_end_y,
1309  x, y
1310  );
1311 
1312  } // GeometryCore::IntersectSegments()
Float_t x
Definition: compare.C:6
MaybeLogger_< ELseverityLevel::ELsev_warning, false, true, detail::ConditionalLogger > LogWarning
Definition: MessageLogger.h:58
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.
bool geo::GeometryCore::IsValidOpChannel ( int  opChannel) const
inherited

Is this a valid OpChannel number?

Definition at line 249 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg, and geo::GeometryCore::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
inlineinherited

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 2142 of file GeometryCore.h.

References geo::GeometryCore::begin_cryostat(), and geo::GeometryCore::end_cryostat().

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

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 2161 of file GeometryCore.h.

Referenced by geo::GeometryCore::PositionToCryostatPtr().

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

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 3041 of file GeometryCore.h.

References geo::GeometryCore::begin_plane_id(), and geo::GeometryCore::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(), vertex::VertexMatch::produce(), and vertex::HarrisVertexFinder::produce().

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

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 3066 of file GeometryCore.h.

References geo::GeometryCore::begin_plane_id(), and geo::GeometryCore::end_plane_id().

3066 { 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
inlineinherited

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 3090 of file GeometryCore.h.

References geo::GeometryCore::begin_plane(), and geo::GeometryCore::end_plane().

3090 { return { this, tid }; }
IteratorBox< plane_iterator, &GeometryCore::begin_plane, &GeometryCore::end_plane > geo::GeometryCore::IteratePlanes ( ) const
inlineinherited

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 3109 of file GeometryCore.h.

References geo::GeometryCore::begin_plane(), and geo::GeometryCore::end_plane().

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

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

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 3132 of file GeometryCore.h.

References geo::GeometryCore::begin_plane(), and geo::GeometryCore::end_plane().

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

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 3155 of file GeometryCore.h.

3155 { return { this, tid }; }
IteratorBox< ROP_id_iterator, &GeometryCore::begin_ROP_id, &GeometryCore::end_ROP_id > geo::GeometryCore::IterateROPIDs ( ) const
inlineinherited

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 5056 of file GeometryCore.h.

References geo::GeometryCore::begin_ROP_id(), and geo::GeometryCore::end_ROP_id().

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

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 5080 of file GeometryCore.h.

References geo::GeometryCore::begin_ROP_id(), and geo::GeometryCore::end_ROP_id().

5080 { 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
inlineinherited

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 5104 of file GeometryCore.h.

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

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

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 2560 of file GeometryCore.h.

References geo::GeometryCore::begin_TPC_id(), and geo::GeometryCore::end_TPC_id().

Referenced by tca::InsideTPC(), tca::TruthMatcher::MatchTruth(), and tca::TrajClusterAlg::RunTrajClusterAlg().

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

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 2584 of file GeometryCore.h.

References geo::GeometryCore::begin_TPC(), and geo::GeometryCore::end_TPC().

2584 { return { this, cid }; }
IteratorBox<TPC_iterator, &GeometryCore::begin_TPC, &GeometryCore::end_TPC> geo::GeometryCore::IterateTPCs ( ) const
inlineinherited

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 2603 of file GeometryCore.h.

References geo::GeometryCore::begin_TPC(), and geo::GeometryCore::end_TPC().

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

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

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 2626 of file GeometryCore.h.

2626 { return { this, cid }; }
IteratorBox< TPCset_id_iterator, &GeometryCore::begin_TPCset_id, &GeometryCore::end_TPCset_id > geo::GeometryCore::IterateTPCsetIDs ( ) const
inlineinherited

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 4809 of file GeometryCore.h.

References geo::GeometryCore::begin_TPCset_id(), and geo::GeometryCore::end_TPCset_id().

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

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 4833 of file GeometryCore.h.

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

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 3442 of file GeometryCore.h.

References geo::GeometryCore::begin_wire_id(), and geo::GeometryCore::end_wire_id().

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

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 3467 of file GeometryCore.h.

References geo::GeometryCore::begin_wire_id(), and geo::GeometryCore::end_wire_id().

3467 { 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
inlineinherited

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 3492 of file GeometryCore.h.

References geo::GeometryCore::begin_wire_id(), and geo::GeometryCore::end_wire_id().

3492 { 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
inlineinherited

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 3517 of file GeometryCore.h.

References geo::GeometryCore::begin_wire(), and geo::GeometryCore::end_wire().

3517 { return { this, pid }; }
IteratorBox< wire_iterator, &GeometryCore::begin_wire, &GeometryCore::end_wire > geo::GeometryCore::IterateWires ( ) const
inlineinherited

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 3536 of file GeometryCore.h.

References geo::GeometryCore::begin_wire(), and geo::GeometryCore::end_wire().

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

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 3560 of file GeometryCore.h.

References geo::GeometryCore::begin_wire(), and geo::GeometryCore::end_wire().

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

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 3584 of file GeometryCore.h.

References geo::GeometryCore::begin_wire(), and geo::GeometryCore::end_wire().

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

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 3608 of file GeometryCore.h.

3608 { return { this, tid }; }
void geo::GeometryCore::LoadGeometryFile ( std::string  gdmlfile,
std::string  rootfile,
bool  bForceReload = false 
)
inherited

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 geo::GeometryCore::ClearGeometry(), geo::GeometryCore::fGDMLfile, geo::GeometryCore::FindAuxDet(), geo::GeometryCore::FindCryostat(), geo::GeometryCore::fROOTfile, and geo::GeometryCore::MaxWireDepthInGDML.

Referenced by 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)
static constexpr std::size_t MaxWireDepthInGDML
void FindAuxDet(std::vector< const TGeoNode * > &path, unsigned int depth)
void ClearGeometry()
Deletes the detector geometry structures.
MaybeLogger_< ELseverityLevel::ELsev_info, false, true, detail::ConditionalLogger > LogInfo
Definition: MessageLogger.h:50
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::Geometry::LoadNewGeometry ( std::string  gdmlfile,
std::string  rootfile,
bool  bForceReload = false 
)
private

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

Definition at line 113 of file Geometry_service.cc.

References DEFINE_ART_SERVICE, fDisableWiresInG4, fRelPath, InitializeChannelMap(), and geo::GeometryCore::LoadGeometryFile().

Referenced by Geometry(), preBeginRun(), and provider().

116  {
117  // start with the relative path
118  std::string GDMLFileName(fRelPath), ROOTFileName(fRelPath);
119 
120  // add the base file names
121  ROOTFileName.append(gdmlfile); // not rootfile (why?)
122  GDMLFileName.append(gdmlfile);
123 
124  // special for GDML if geometry with no wires is used for Geant4 simulation
126  GDMLFileName.insert(GDMLFileName.find(".gdml"), "_nowires");
127 
128  // Search all reasonable locations for the GDML file that contains
129  // the detector geometry.
130  // cet::search_path constructor decides if initialized value is a path
131  // or an environment variable
132  cet::search_path sp("FW_SEARCH_PATH");
133 
134  std::string GDMLfile;
135  if( !sp.find_file(GDMLFileName, GDMLfile) ) {
136  throw cet::exception("Geometry")
137  << "cannot find the gdml geometry file:"
138  << "\n" << GDMLFileName
139  << "\nbail ungracefully.\n";
140  }
141 
142  std::string ROOTfile;
143  if( !sp.find_file(ROOTFileName, ROOTfile) ) {
144  throw cet::exception("Geometry")
145  << "cannot find the root geometry file:\n"
146  << "\n" << ROOTFileName
147  << "\nbail ungracefully.\n";
148  }
149 
150  // initialize the geometry with the files we have found
151  LoadGeometryFile(GDMLfile, ROOTfile, bForceReload);
152 
153  // now update the channel map
155 
156  } // Geometry::LoadNewGeometry()
void LoadGeometryFile(std::string gdmlfile, std::string rootfile, bool bForceReload=false)
Loads the geometry information from the specified files.
bool fDisableWiresInG4
Definition: Geometry.h:137
std::string fRelPath
Definition: Geometry.h:135
void InitializeChannelMap()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<typename T >
geo::PlaneDataContainer<T> geo::GeometryCore::makePlaneData ( ) const
inlineinherited

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 2796 of file GeometryCore.h.

2797  { 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
inlineinherited

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 2818 of file GeometryCore.h.

2819  { 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
inlineinherited

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 2305 of file GeometryCore.h.

2306  { 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
inlineinherited

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 2328 of file GeometryCore.h.

2329  { 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
inherited

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 1004 of file GeometryCore.cxx.

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

Referenced by geo::GeometryCore::TotalMass().

1005  {
1006 
1007  //The purpose of this method is to determine the column density
1008  //between the two points given. Do that by starting at p1 and
1009  //stepping until you get to the node of p2. calculate the distance
1010  //between the point just inside that node and p2 to get the last
1011  //bit of column density
1012  double columnD = 0.;
1013 
1014  //first initialize a track - get the direction cosines
1015  geo::Vector_t const dir = (p2 - p1).Unit();
1016 
1017  double const dxyz[3] = { dir.X(), dir.Y(), dir.Z() };
1018  double const cp1[3] = { p1.X(), p1.Y(), p1.Z() };
1019  gGeoManager->InitTrack(cp1, dxyz);
1020 
1021  //might be helpful to have a point to a TGeoNode
1022  TGeoNode *node = gGeoManager->GetCurrentNode();
1023 
1024  //check that the points are not in the same volume already.
1025  //if they are in different volumes, keep stepping until you
1026  //are in the same volume as the second point
1027  while(!gGeoManager->IsSameLocation(p2.X(), p2.Y(), p2.Z())){
1028  gGeoManager->FindNextBoundary();
1029  columnD += gGeoManager->GetStep()*node->GetMedium()->GetMaterial()->GetDensity();
1030 
1031  //the act of stepping puts you in the next node and returns that node
1032  node = gGeoManager->Step();
1033  }//end loop to get to volume of second point
1034 
1035  //now you are in the same volume as the last point, but not at that point.
1036  //get the distance between the current point and the last one
1037  geo::Point_t const last
1038  = geo::vect::makePointFromCoords(gGeoManager->GetCurrentPoint());
1039  double const lastStep = (p2 - last).R();
1040  columnD += lastStep*node->GetMedium()->GetMaterial()->GetDensity();
1041 
1042  return columnD;
1043  }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:137
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:157
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
inherited

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
inherited

Returns the material at the specified position.

Definition at line 894 of file GeometryCore.cxx.

Referenced by geo::GeometryCore::MaterialName().

894  {
895  auto const pNode = gGeoManager->FindNode(point.X(), point.Y(), point.Z());
896  if (!pNode) return nullptr;
897  auto const pMedium = pNode->GetMedium();
898  return pMedium? pMedium->GetMaterial(): nullptr;
899  }
std::string geo::GeometryCore::MaterialName ( TVector3 const &  point) const
inlineinherited

Name of the deepest material containing the point xyz.

Returns
material of the origin by default

Definition at line 1850 of file GeometryCore.h.

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

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

1851  { 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
inherited

Name of the deepest material containing the point xyz.

Returns
material of the origin by default

Definition at line 902 of file GeometryCore.cxx.

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

903  {
904  // check that the given point is in the World volume at least
905  geo::BoxBoundedGeo worldBox = WorldBox();
906  if (!worldBox.ContainsPosition(point)) {
907  mf::LogWarning("GeometryCoreBadInputPoint")
908  << "point " << point << " is not inside the world volume "
909  << worldBox.Min() << " -- " << worldBox.Max()
910  << "; returning unknown material name";
911  return { "unknownMaterial" };
912  }
913  auto const pMaterial = Material(point);
914  if (!pMaterial) {
915  mf::LogWarning("GeometryCoreBadInputPoint")
916  << "material for point " << point
917  << " not found! returning unknown material name";
918  return { "unknownMaterial" };
919  }
920  return pMaterial->GetName();
921  }
MaybeLogger_< ELseverityLevel::ELsev_warning, false, true, detail::ConditionalLogger > LogWarning
Definition: MessageLogger.h:58
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
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
inherited

Largest optical channel number.

Definition at line 218 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg, and geo::GeometryCore::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
inherited

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

Definition at line 806 of file GeometryCore.cxx.

References geo::GeometryCore::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(), geo::GeometryCore::Nviews(), shower::EMShowerAlg::OrderShowerHits(), pma::PMAlgTracker::PMAlgTracker(), trkf::PMAlgTrackMaker::PMAlgTrackMaker(), nnet::PointIdTrainingData::PointIdTrainingData(), lar_pandora::LArPandoraTrackCreation::produce(), shower::EMShowerAlg::RelativeWireWidth(), trkf::TrackKalmanFitter::sortOutput(), and shower::EMShowerAlg::WorstPlane().

806  {
807  unsigned int maxPlanes = 0;
808  for (geo::CryostatGeo const& cryo: Cryostats()) {
809  unsigned int maxPlanesInCryo = cryo.MaxPlanes();
810  if (maxPlanesInCryo > maxPlanes) maxPlanes = maxPlanesInCryo;
811  } // for
812  return maxPlanes;
813  } // 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
inherited

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

Definition at line 1692 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

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

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

Definition at line 786 of file GeometryCore.cxx.

References geo::GeometryCore::Cryostats().

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

786  {
787  unsigned int maxTPCs = 0;
788  for (geo::CryostatGeo const& cryo: Cryostats()) {
789  unsigned int maxTPCsInCryo = cryo.NTPC();
790  if (maxTPCsInCryo > maxTPCs) maxTPCs = maxTPCsInCryo;
791  } // for
792  return maxTPCs;
793  } // 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
inherited

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

Definition at line 1648 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

1648  {
1649  return fChannelMapAlg