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

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

#include <GeometryCore.h>

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

Classes

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

Public Types

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

Public Member Functions

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

See Also
optical detector channel information

There are a number of ways to identify an optical detector or channel:

  • geometric:
    • cryostat (e.g. geo::CryostatID) and relative optical detector number within it
    • unique optical detector number
  • readout:
    • optical detector channel
    • "hardware" channel

And they all should be better documented!

unsigned int NOpDets () const
 Number of OpDets in the whole detector. More...
 
OpDetGeo const & OpDetGeoFromOpChannel (unsigned int OpChannel) const
 Returns the geo::OpDetGeo object for the given channel number. More...
 
OpDetGeo const & OpDetGeoFromOpDet (unsigned int OpDet) const
 Returns the geo::OpDetGeo object for the given detector number. More...
 
unsigned int GetClosestOpDet (geo::Point_t const &point) const
 Find the nearest OpChannel to some point. More...
 
unsigned int GetClosestOpDet (double const *point) const
 
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], double tolerance=0) const
 Returns the index of the auxiliary detector at specified location. More...
 
unsigned int FindAuxDetAtPosition (geo::Point_t const &point, double tolerance=0) const
 Returns the index of the auxiliary detector at specified location. More...
 
void FindAuxDetSensitiveAtPosition (geo::Point_t const &point, std::size_t &adg, std::size_t &sv, double tolerance=0) const
 Fills the indices of the sensitive auxiliary detector at location. More...
 
void FindAuxDetSensitiveAtPosition (double const worldLoc[3], size_t &adg, size_t &sv, double tolerance=0) const
 Fills the indices of the sensitive auxiliary detector at location. More...
 
AuxDetGeo const & PositionToAuxDet (geo::Point_t const &point, unsigned int &ad, double tolerance=0) const
 Returns the auxiliary detector at specified location. More...
 
AuxDetGeo const & PositionToAuxDet (double const worldLoc[3], unsigned int &ad, double tolerance=0) const
 Returns the auxiliary detector at specified location. More...
 
const AuxDetSensitiveGeoPositionToAuxDetSensitive (geo::Point_t const &point, size_t &ad, size_t &sv, double tolerance=0) const
 Returns the auxiliary detector at specified location. More...
 
const AuxDetSensitiveGeoPositionToAuxDetSensitive (double const worldLoc[3], size_t &ad, size_t &sv, double tolerance=0) const
 Returns the auxiliary detector at specified location. More...
 
const AuxDetGeoChannelToAuxDet (std::string const &auxDetName, uint32_t const &channel) const
 
const AuxDetSensitiveGeoChannelToAuxDetSensitive (std::string const &auxDetName, uint32_t const &channel) const
 
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::vector< raw::ChannelID_tChannelsInTPCs () const
 Returns an std::vector<ChannelID_t> in all TPCs in a TPCSet. More...
 
std::set< geo::View_t > const & Views () const
 Returns a list of possible views in the detector. More...
 
bool HasChannel (raw::ChannelID_t channel) const
 Returns whether the specified channel exists and is valid. More...
 
raw::ChannelID_t PlaneWireToChannel (WireID const &wireid) const
 Returns the ID of the TPC channel connected to the specified wire. More...
 
raw::ChannelID_t PlaneWireToChannel (unsigned int const plane, unsigned int const wire, unsigned int const tpc=0, unsigned int const cstat=0) const
 
raw::ChannelID_t NearestChannel (const double worldLoc[3], geo::PlaneID const &planeid) const
 Returns the ID of the channel nearest to the specified position. More...
 
raw::ChannelID_t NearestChannel (std::vector< double > const &worldLoc, geo::PlaneID const &planeid) const
 
raw::ChannelID_t NearestChannel (const TVector3 &worldLoc, geo::PlaneID const &planeid) const
 
raw::ChannelID_t NearestChannel (const double worldLoc[3], unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
raw::ChannelID_t NearestChannel (std::vector< double > const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
raw::ChannelID_t NearestChannel (const TVector3 &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
raw::ChannelID_t NearestChannel (geo::Point_t const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
 
TPC set information
unsigned int NTPCsets (readout::CryostatID const &cryoid) const
 Returns the total number of TPC sets in the specified cryostat. More...
 
unsigned int NSiblingElements (readout::TPCsetID const &tpcsetid) const
 
Readout plane information
unsigned int NROPs (readout::TPCsetID const &tpcsetid) const
 Returns the total number of ROP in the specified TPC set. More...
 
unsigned int NSiblingElements (readout::ROPID const &ropid) const
 
Optical readout channels
unsigned int NOpChannels () const
 Number of electronics channels for all the optical detectors. More...
 
unsigned int MaxOpChannel () const
 Largest optical channel number. More...
 
unsigned int NOpHardwareChannels (int opDet) const
 
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, geo::GeometryBuilder &builder, bool bForceReload=false)
 Loads the geometry information from the specified files. More...
 
void LoadGeometryFile (std::string gdmlfile, std::string rootfile, bool bForceReload=false)
 Loads the geometry information from the specified files. More...
 
void ApplyChannelMap (std::unique_ptr< geo::ChannelMapAlg > pChannelMap)
 Initializes the geometry to work with this channel map. More...
 

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_t
coordIs { 1e-8 }
 Value of tolerance for equality comparisons. More...
 

Protected Member Functions

void SetDetectorName (std::string const &new_name)
 Sets the detector name. More...
 
geo::ChannelMapAlg const * ChannelMap () const
 Returns the object handling the channel map. More...
 
CryostatList_tCryostats ()
 Return the internal cryostat list. More...
 
CryostatList_t const & Cryostats () const
 
AuxDetList_tAuxDets ()
 Return the interfal auxiliary detectors list. More...
 
AuxDetList_t const & AuxDets () const
 

Private Types

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

Private Member Functions

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

Static Private Member Functions

static bool PointWithinSegments (double A_start_x, double A_start_y, double A_end_x, double A_end_y, double B_start_x, double B_start_y, double B_end_x, double B_end_y, double x, double y)
 Returns whether x and y are within both specified ranges (A and B). More...
 
static void CheckIndependentPlanesOnSameTPC (geo::PlaneID const &pid1, geo::PlaneID const &pid2, const char *caller)
 

Private Attributes

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

Detailed Description

Description of geometry of one entire detector.


Note
All lengths are specified in centimetres

How to correctly instantiate a GeometryCore object

Instantiation is a multi-step procedure:

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

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

Configuration parameters

Definition at line 1476 of file GeometryCore.h.

Member Typedef Documentation

Type of list of auxiliary detectors.

Definition at line 1513 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 1544 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 1565 of file GeometryCore.h.

Type of list of cryostats.

Definition at line 1511 of file GeometryCore.h.

using geo::GeometryCore::DefaultPoint_t = TVector3
private

Default template argument.

Definition at line 1479 of file GeometryCore.h.

using geo::GeometryCore::DefaultVector_t = TVector3
private

Default template argument.

Definition at line 1478 of file GeometryCore.h.

Definition at line 1485 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 1635 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 1657 of file GeometryCore.h.

Definition at line 1508 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 1589 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 1611 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 1681 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 1703 of file GeometryCore.h.

Constructor & Destructor Documentation

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

Initialize geometry from a given configuration.

Parameters
psetconfiguration parameters

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

Definition at line 59 of file GeometryCore.cxx.

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

Destructor.

Definition at line 75 of file GeometryCore.cxx.

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

Member Function Documentation

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

Initializes the geometry to work with this channel map.

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

The specified channel mapping is used with this geometry. These modifications typically involve some resorting of the objects.

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

Definition at line 82 of file GeometryCore.cxx.

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

Returns the specified auxiliary detector.

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

what happens if it does not exist?

remove the default parameter?

Definition at line 340 of file GeometryCore.cxx.

341  {
342  if(ad >= NAuxDets())
343  throw cet::exception("GeometryCore") << "AuxDet "
344  << ad
345  << " does not exist\n";
346 
347  return AuxDets()[ad];
348  }
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
AuxDetList_t& geo::GeometryCore::AuxDets ( )
inlineprotected

Return the interfal auxiliary detectors list.

Definition at line 5502 of file GeometryCore.h.

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

Definition at line 5503 of file GeometryCore.h.

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

Returns an iterator pointing to the first cryostat.

Definition at line 2162 of file GeometryCore.h.

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

Returns an iterator pointing to the first cryostat ID.

Definition at line 2154 of file GeometryCore.h.

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

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

Definition at line 3087 of file GeometryCore.h.

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

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

Definition at line 3096 of file GeometryCore.h.

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

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

Definition at line 3105 of file GeometryCore.h.

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

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

Definition at line 3059 of file GeometryCore.h.

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

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

Definition at line 3068 of file GeometryCore.h.

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

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

Definition at line 3078 of file GeometryCore.h.

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

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

Definition at line 5231 of file GeometryCore.h.

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

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

Definition at line 5240 of file GeometryCore.h.

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

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

Definition at line 5250 of file GeometryCore.h.

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

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

Definition at line 2570 of file GeometryCore.h.

2571  { 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:107
TPC_iterator geo::GeometryCore::begin_TPC ( geo::CryostatID const &  cid) const
inline

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

Definition at line 2578 of file GeometryCore.h.

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

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

Definition at line 2552 of file GeometryCore.h.

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

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

Definition at line 2561 of file GeometryCore.h.

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

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

Definition at line 4996 of file GeometryCore.h.

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

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

Definition at line 5005 of file GeometryCore.h.

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

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

Definition at line 3503 of file GeometryCore.h.

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

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

Definition at line 3511 of file GeometryCore.h.

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

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

Definition at line 3519 of file GeometryCore.h.

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

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

Definition at line 3527 of file GeometryCore.h.

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

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

Definition at line 3470 of file GeometryCore.h.

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

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

Definition at line 3478 of file GeometryCore.h.

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

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

Definition at line 3487 of file GeometryCore.h.

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

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

Definition at line 3495 of file GeometryCore.h.

3496  { 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.
void geo::GeometryCore::BuildGeometry ( geo::GeometryBuilder builder)
private

Parses ROOT geometry nodes and builds LArSoft geometry representation.

Parameters
builderthe algorithm to be used

Definition at line 1119 of file GeometryCore.cxx.

1120  {
1121  geo::GeoNodePath path{ gGeoManager->GetTopNode() };
1122  Cryostats() = builder.extractCryostats(path);
1123  AuxDets() = builder.extractAuxiliaryDetectors(path);
1124  }
Cryostats_t extractCryostats(Path_t const &path)
Looks for all cryostats under the specified path.
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics path
AuxDets_t extractAuxiliaryDetectors(Path_t const &path)
Looks for all auxiliary detectors under the specified path.
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
CryostatList_t & Cryostats()
Return the internal cryostat list.
Representation of a node and its ancestry.
Definition: GeoNodePath.h:38
geo::ChannelMapAlg const* geo::GeometryCore::ChannelMap ( ) const
inlineprotected

Returns the object handling the channel map.

Definition at line 5491 of file GeometryCore.h.

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

Returns an intersection point of two channels.

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

what happens for channels from different TPCs?

what happens for channels with multiple intersection points?

Deprecated:
This is clearly not APA-aware

Definition at line 1360 of file GeometryCore.cxx.

1364  {
1365 
1366  // [GP] these errors should be exceptions, and this function is deprecated
1367  // because it violates interoperability
1368  std::vector<geo::WireID> chan1wires = ChannelToWire(c1);
1369  if (chan1wires.empty()) {
1370  mf::LogError("ChannelsIntersect")
1371  << "1st channel " << c1 << " maps to no wire (is it a real one?)";
1372  return false;
1373  }
1374  std::vector<geo::WireID> chan2wires = ChannelToWire(c2);
1375  if (chan2wires.empty()) {
1376  mf::LogError("ChannelsIntersect")
1377  << "2nd channel " << c2 << " maps to no wire (is it a real one?)";
1378  return false;
1379  }
1380 
1381  if (chan1wires.size() > 1) {
1382  mf::LogWarning("ChannelsIntersect")
1383  << "1st channel " << c1 << " maps to " << chan2wires.size()
1384  << " wires; using the first!";
1385  return false;
1386  }
1387  if (chan2wires.size() > 1) {
1388  mf::LogError("ChannelsIntersect")
1389  << "2nd channel " << c2 << " maps to " << chan2wires.size()
1390  << " wires; using the first!";
1391  return false;
1392  }
1393 
1394  geo::WireIDIntersection widIntersect;
1395  if (this->WireIDsIntersect(chan1wires[0],chan2wires[0],widIntersect)){
1396  y = widIntersect.y;
1397  z = widIntersect.z;
1398  return true;
1399  }
1400  else{
1401  y = widIntersect.y;
1402  z = widIntersect.z;
1403  return false;
1404  }
1405  }
process_name opflash particleana ie ie ie z
double z
z position of intersection
Definition: geo_types.h:805
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
process_name opflash particleana ie ie y
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:804
std::vector< raw::ChannelID_t > geo::GeometryCore::ChannelsInTPCs ( ) const

Returns an std::vector<ChannelID_t> in all TPCs in a TPCSet.

Definition at line 221 of file GeometryCore.cxx.

222  {
223  std::vector<raw::ChannelID_t> channels;
224  channels.reserve(fChannelMapAlg->Nchannels());
225 
226  for (const readout::TPCsetID & ts: IterateTPCsetIDs())
227  {
228  for (auto const t: fChannelMapAlg->TPCsetToTPCs(ts))
229  {
230  for (auto const & wire: IterateWireIDs(t))
231  {
232  channels.push_back(fChannelMapAlg->PlaneWireToChannel(wire));
233  }
234  }
235  }
236  std::sort(channels.begin(), channels.end());
237  auto last = std::unique(channels.begin(), channels.end());
238  channels.erase(last, channels.end());
239  return channels;
240  }
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
Class identifying a set of TPC sharing readout channels.
Definition: readout_types.h:70
IteratorBox< wire_id_iterator,&GeometryCore::begin_wire_id,&GeometryCore::end_wire_id > IterateWireIDs() const
Enables ranged-for loops on all wire IDs of the detector.
IteratorBox< TPCset_id_iterator,&GeometryCore::begin_TPCset_id,&GeometryCore::end_TPCset_id > IterateTPCsetIDs() const
Enables ranged-for loops on all TPC set IDs of the detector.
const AuxDetGeo & geo::GeometryCore::ChannelToAuxDet ( std::string const &  auxDetName,
uint32_t const &  channel 
) const

Definition at line 576 of file GeometryCore.cxx.

578  {
579  size_t adIdx = fChannelMapAlg->ChannelToAuxDet(AuxDets(), auxDetName, channel);
580  return this->AuxDet(adIdx);
581  }
std::unique_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

Definition at line 584 of file GeometryCore.cxx.

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

Returns the ID of the ROP the channel belongs to

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

Definition at line 1202 of file GeometryCore.cxx.

1203  {
1204  return fChannelMapAlg->ChannelToROP(channel);
1205  } // GeometryCore::ChannelToROP()
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
std::vector< geo::WireID > geo::GeometryCore::ChannelToWire ( raw::ChannelID_t const  channel) const

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

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

Definition at line 1196 of file GeometryCore.cxx.

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

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

Definition at line 1603 of file GeometryCore.cxx.

1604  {
1605  if(pid1.asTPCID() != pid2.asTPCID()) {
1606  throw cet::exception("GeometryCore")
1607  << caller << " needs two planes on the same TPC (got "
1608  << std::string(pid1) << " and " << std::string(pid2) << ")\n";
1609  }
1610  if(pid1 == pid2) { // was: return 999;
1611  throw cet::exception("GeometryCore")
1612  << caller << " needs two different planes, got "
1613  << std::string(pid1) << " twice\n";
1614  }
1615  } // GeometryCore::CheckIndependentPlanesOnSameTPC()
void geo::GeometryCore::ClearGeometry ( )
private

Deletes the detector geometry structures.

Definition at line 160 of file GeometryCore.cxx.

161  {
162  Cryostats().clear();
163  AuxDets().clear();
164  }
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
CryostatList_t & Cryostats()
Return the internal cryostat list.
double geo::GeometryCore::ComputeThirdPlane_dTdW ( double  angle1,
double  pitch1,
double  dTdW1,
double  angle2,
double  pitch2,
double  dTdW2,
double  angle_target,
double  pitch_target 
)
static

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

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

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

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

Definition at line 1721 of file GeometryCore.cxx.

1726  {
1727  // we need to convert dt/dw into homogeneous coordinates, and then back;
1728  // slope = [dT * (TDCperiod / driftVelocity)] / [dW * wirePitch]
1729  // The coefficient of dT is assumed to be the same for all the planes,
1730  // and it finally cancels out. Pitches cancel out only if they are all
1731  // the same.
1732  return pitch_target * ComputeThirdPlaneSlope
1733  (angle1, dTdW1 / pitch1, angle2, dTdW2 / pitch2, angle_target);
1734  } // GeometryCore::ComputeThirdPlane_dTdW()
static double ComputeThirdPlaneSlope(double angle1, double slope1, double angle2, double slope2, double angle_target)
Returns the slope on the third plane, given it in the other two.
double geo::GeometryCore::ComputeThirdPlaneSlope ( double  angle1,
double  slope1,
double  angle2,
double  slope2,
double  angle_target 
)
static

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

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

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

Definition at line 1696 of file GeometryCore.cxx.

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

Returns the specified cryostat.

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

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

Todo:
Make the cryostat number mandatory (as CryostatID)

Definition at line 321 of file GeometryCore.cxx.

321  {
322  CryostatGeo const* pCryo = CryostatPtr(cryoid);
323  if(!pCryo) {
324  throw cet::exception("GeometryCore") << "Cryostat #"
325  << cryoid.Cryostat
326  << " does not exist\n";
327  }
328  return *pCryo;
329  } // GeometryCore::Cryostat(CryostatID)
CryostatGeo const * CryostatPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
CryostatGeo const& geo::GeometryCore::Cryostat ( unsigned int const  cstat = 0) const
inline

Definition at line 2039 of file GeometryCore.h.

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

Returns the boundaries of the specified cryostat.

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

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

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

Definition at line 812 of file GeometryCore.cxx.

813  {
814  geo::CryostatGeo const& cryo = Cryostat(cid);
815  cryo.Boundaries(boundaries);
816  } // GeometryCore::CryostatBoundaries()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
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:115
void geo::GeometryCore::CryostatBoundaries ( double *  boundaries,
unsigned int  cstat = 0 
) const
inline

Returns the boundaries of the specified cryostat.

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

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

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

Definition at line 2268 of file GeometryCore.h.

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

Returns the height of the cryostat (y direction)

Definition at line 799 of file GeometryCore.cxx.

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

Definition at line 2222 of file GeometryCore.h.

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

Returns the half width of the cryostat (x direction)

Definition at line 792 of file GeometryCore.cxx.

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

Definition at line 2215 of file GeometryCore.h.

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

Returns the length of the cryostat (z direction)

Definition at line 805 of file GeometryCore.cxx.

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

Definition at line 2229 of file GeometryCore.h.

2230  { 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:190
CryostatGeo const* geo::GeometryCore::CryostatPtr ( geo::CryostatID const &  cryoid) const
inline

Returns the specified cryostat.

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

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

Definition at line 2054 of file GeometryCore.h.

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

Return the internal cryostat list.

Definition at line 5496 of file GeometryCore.h.

5496 { return fGeoData.cryostats; }
GeometryData_t fGeoData
The detector description data.
CryostatList_t cryostats
The detector cryostats.
Definition: GeometryData.h:38
CryostatList_t const& geo::GeometryCore::Cryostats ( ) const
inlineprotected

Definition at line 5497 of file GeometryCore.h.

5497 { return fGeoData.cryostats; }
GeometryData_t fGeoData
The detector description data.
CryostatList_t cryostats
The detector cryostats.
Definition: GeometryData.h:38
double geo::GeometryCore::DefaultWiggle ( ) const
inline

Returns the tolerance used in looking for positions.

Returns
the tolerance value

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

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

Definition at line 1739 of file GeometryCore.h.

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

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

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

Definition at line 650 of file GeometryCore.cxx.

651  {
652  auto const& path = FindDetectorEnclosure(name);
653  if (path.empty()) {
654  throw cet::exception("GeometryCore")
655  << "DetectorEnclosureBox(): can't find enclosure volume '" << name << "'\n";
656  }
657 
658  TGeoVolume const* pEncl = path.back()->GetVolume();
659  auto const* pBox = dynamic_cast<TGeoBBox const*>(pEncl->GetShape());
660 
661  // check that this is indeed a box
662  if (!pBox) {
663  // at initialisation time we don't know yet our real ID
664  throw cet::exception("GeometryCore") << "Detector enclosure '"
665  << name << "' is not a box! (it is a " << pEncl->GetShape()->IsA()->GetName()
666  << ")\n";
667  }
668 
670  // get the half width, height, etc of the cryostat
671  const double halfwidth = pBox->GetDX();
672  const double halfheight = pBox->GetDY();
673  const double halflength = pBox->GetDZ();
674 
675  return {
676  trans.LocalToWorld(geo::Point_t{ -halfwidth, -halfheight, -halflength }),
677  trans.LocalToWorld(geo::Point_t{ +halfwidth, +halfheight, +halflength })
678  };
679  } // geo::GeometryCore::DetectorEnclosureBox()
std::vector< TGeoNode const * > FindDetectorEnclosure(std::string const &name="volDetEnclosure") const
void LocalToWorld(double const *local, double *world) const
Transforms a point from local frame to world frame.
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics path
Class to transform between world and local coordinates.
then echo fcl name
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:184
std::string geo::GeometryCore::DetectorName ( ) const
inline

Returns a string with the name of the detector, as configured.

Definition at line 1769 of file GeometryCore.h.

1769 { return fDetectorName; }
std::string fDetectorName
Name of the detector.
geo::Length_t geo::GeometryCore::DetHalfHeight ( geo::TPCID const &  tpcid) const

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

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

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

Todo:

deprecate this function

rename the function

Definition at line 779 of file GeometryCore.cxx.

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

Definition at line 2744 of file GeometryCore.h.

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

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

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

deprecate this function

rename the function

Definition at line 773 of file GeometryCore.cxx.

774  {
775  return TPC(tpcid).ActiveHalfWidth();
776  }
double ActiveHalfWidth() const
Half width (associated with x 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::DetHalfWidth ( unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const
inline

Definition at line 2722 of file GeometryCore.h.

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

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

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

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

Todo:

deprecate this function

rename the function

Definition at line 785 of file GeometryCore.cxx.

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

Definition at line 2765 of file GeometryCore.h.

2766  { 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:386
cryostat_iterator geo::GeometryCore::end_cryostat ( ) const
inline

Returns an iterator pointing after the last cryostat.

Definition at line 2166 of file GeometryCore.h.

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

Returns an iterator pointing after the last cryostat ID.

Definition at line 2158 of file GeometryCore.h.

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

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

Definition at line 3091 of file GeometryCore.h.

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

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

Definition at line 3101 of file GeometryCore.h.

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

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

Definition at line 3109 of file GeometryCore.h.

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

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

Definition at line 3063 of file GeometryCore.h.

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

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

Definition at line 3073 of file GeometryCore.h.

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

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

Definition at line 3083 of file GeometryCore.h.

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

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

Definition at line 5235 of file GeometryCore.h.

5236  { 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:108
ROP_id_iterator geo::GeometryCore::end_ROP_id ( geo::CryostatID const &  ID) const
inline

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

Definition at line 5245 of file GeometryCore.h.

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

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

Definition at line 5255 of file GeometryCore.h.

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

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

Definition at line 2574 of file GeometryCore.h.

2575  { 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:108
TPC_iterator geo::GeometryCore::end_TPC ( geo::CryostatID const &  cid) const
inline

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

Definition at line 2582 of file GeometryCore.h.

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

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

Definition at line 2556 of file GeometryCore.h.

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

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

Definition at line 2566 of file GeometryCore.h.

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

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

Definition at line 5000 of file GeometryCore.h.

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

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

Definition at line 5010 of file GeometryCore.h.

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

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

Definition at line 3507 of file GeometryCore.h.

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

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

Definition at line 3515 of file GeometryCore.h.

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

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

Definition at line 3523 of file GeometryCore.h.

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

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

Definition at line 3531 of file GeometryCore.h.

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

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

Definition at line 3474 of file GeometryCore.h.

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

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

Definition at line 3483 of file GeometryCore.h.

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

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

Definition at line 3491 of file GeometryCore.h.

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

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

Definition at line 3499 of file GeometryCore.h.

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

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

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

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

Definition at line 744 of file GeometryCore.cxx.

745  {
746  CollectPathsByName path_collector(vol_names);
747 
748  ROOTGeoNodeForwardIterator iNode(ROOTGeoManager()->GetTopNode());
749 
750  while (*iNode) {
751  path_collector(iNode);
752  ++iNode;
753  } // while
754 
755  return path_collector.paths;
756  } // GeometryCore::FindAllVolumePaths()
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
std::vector< TGeoNode const * > geo::GeometryCore::FindAllVolumes ( std::set< std::string > const &  vol_names) const

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

Parameters
vol_nameslist of names of volumes
Returns
list of nodes found

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

Definition at line 727 of file GeometryCore.cxx.

728  {
729  CollectNodesByName node_collector(vol_names);
730 
731  ROOTGeoNodeForwardIterator iNode(ROOTGeoManager()->GetTopNode());
732  TGeoNode const* pCurrentNode;
733 
734  while ((pCurrentNode = *iNode)) {
735  node_collector(*pCurrentNode);
736  ++iNode;
737  } // while
738 
739  return node_collector.nodes;
740  } // GeometryCore::FindAllVolumes()
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
unsigned int geo::GeometryCore::FindAuxDetAtPosition ( double const  worldLoc[3],
double  tolerance = 0 
) const

Returns the index of the auxiliary detector at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
tolerancetolerance (cm) for matches. Default 0
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 526 of file GeometryCore.cxx.

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

Returns the index of the auxiliary detector at specified location.

Parameters
pointlocation to be tested
tolerancetolerance (cm) for matches. Default 0
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 517 of file GeometryCore.cxx.

518  {
519  // BUG the double brace syntax is required to work around clang bug 21629
520  // (https://bugs.llvm.org/show_bug.cgi?id=21629)
521  std::array<double, 3U> worldPos = {{ point.X(), point.Y(), point.Z() }};
522  return fChannelMapAlg->NearestAuxDet(worldPos.data(), AuxDets(), tolerance);
523  } // GeometryCore::FindAuxDetAtPosition()
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
auto const tolerance
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,
double  tolerance = 0 
) const

Fills the indices of the sensitive auxiliary detector at location.

Parameters
pointlocation to be tested
adg_(output)_ auxiliary detector index
sv_(output)_ sensitive volume index
tolerancetolerance (cm) for matches. Default 0.

Definition at line 546 of file GeometryCore.cxx.

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

Fills the indices of the sensitive auxiliary detector at location.

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

Definition at line 557 of file GeometryCore.cxx.

void FindAuxDetSensitiveAtPosition(geo::Point_t const &point, std::size_t &adg, std::size_t &sv, double tolerance=0) const
Fills the indices of the sensitive auxiliary detector at location.
auto const tolerance
GENVECTOR_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

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

394  {
395  geo::CryostatGeo const* cryo = PositionToCryostatPtr(worldLoc);
396  return cryo? cryo->ID().Cryostat: geo::CryostatID::InvalidID;
397  } // GeometryCore::FindCryostatAtPosition(Point)
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
geo::CryostatGeo const * PositionToCryostatPtr(geo::Point_t const &point) const
Returns the cryostat at specified location.
static constexpr CryostatID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:208
geo::CryostatID const & ID() const
Returns the identifier of this cryostat.
Definition: CryostatGeo.h:132
geo::CryostatID::CryostatID_t geo::GeometryCore::FindCryostatAtPosition ( double const  worldLoc[3]) const

Definition at line 402 of file GeometryCore.cxx.

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

Definition at line 1087 of file GeometryCore.cxx.

1088  {
1089  std::vector<TGeoNode const*> path { ROOTGeoManager()->GetTopNode() };
1090  if (!FindFirstVolume(name, path)) path.clear();
1091  return path;
1092  } // FindDetectorEnclosure()
bool FindFirstVolume(std::string const &name, std::vector< const TGeoNode * > &path) const
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics path
then echo fcl name
bool geo::GeometryCore::FindFirstVolume ( std::string const &  name,
std::vector< const TGeoNode * > &  path 
) const
private

Definition at line 1096 of file GeometryCore.cxx.

1097  {
1098  assert(!path.empty());
1099 
1100  auto const* pCurrent = path.back();
1101 
1102  // first check the current layer
1103  if (strncmp(name.c_str(), pCurrent->GetName(), name.length()) == 0)
1104  return true;
1105 
1106  //explore the next layer down
1107  auto const* pCurrentVolume = pCurrent->GetVolume();
1108  unsigned int nd = pCurrentVolume->GetNdaughters();
1109  for(unsigned int i = 0; i < nd; ++i) {
1110  path.push_back(pCurrentVolume->GetNode(i));
1111  if (FindFirstVolume(name, path)) return true;
1112  path.pop_back();
1113  } // for
1114  return false;
1115  } // FindFirstVolume()
bool FindFirstVolume(std::string const &name, std::vector< const TGeoNode * > &path) const
then echo fcl name
geo::TPCID geo::GeometryCore::FindTPCAtPosition ( double const  worldLoc[3]) const
inline

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

2463  { return FindTPCAtPosition(geo::vect::makePointFromCoords(worldLoc)); }
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
GENVECTOR_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

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

352  {
353 
354  // first find the cryostat
355  geo::CryostatGeo const* cryo = PositionToCryostatPtr(point);
356  if (!cryo) return {};
357 
358  // then ask it about the TPC
359  geo::TPCID tpcid = cryo->PositionToTPCID(point, 1. + fPositionWiggle);
360  if (tpcid) return tpcid;
361 
362  // return an invalid TPC ID with cryostat information set:
363  tpcid.Cryostat = cryo->ID().Cryostat;
364  tpcid.markInvalid();
365  return tpcid;
366 
367  } // GeometryCore::FindTPCAtPosition()
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
void markInvalid()
Sets the ID as invalid.
Definition: geo_types.h:240
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:132
geo::TPCID geo::GeometryCore::FindTPCAtPosition ( TVector3 const &  point) const
inline

Definition at line 2472 of file GeometryCore.h.

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

Returns the ID of the TPC set at specified location.

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

Definition at line 1780 of file GeometryCore.cxx.

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

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

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

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

Definition at line 1847 of file GeometryCore.cxx.

1848  {
1849  return fChannelMapAlg->FirstChannelInROP(ropid);
1850  } // GeometryCore::FirstChannelInROP()
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
std::string geo::GeometryCore::GDMLFile ( ) const
inline

Returns the full directory path to the GDML file source.

Returns
the full directory path to the GDML file source

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

Definition at line 1757 of file GeometryCore.h.

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

Returns the ID of the first element of the detector.

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

Definition at line 1941 of file GeometryCore.h.

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

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

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

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

Definition at line 2142 of file GeometryCore.h.

2143  { id = geo::CryostatID(0, HasCryostat(geo::CryostatID(0))); }
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
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:190
void geo::GeometryCore::GetBeginID ( geo::TPCID id) const
inline

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

iterators

Definition at line 2532 of file GeometryCore.h.

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

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

Definition at line 3032 of file GeometryCore.h.

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

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

Definition at line 3435 of file GeometryCore.h.

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

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

iterators

Definition at line 4974 of file GeometryCore.h.

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

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

iterators

Definition at line 5201 of file GeometryCore.h.

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

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

Definition at line 3043 of file GeometryCore.h.

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

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

Definition at line 3051 of file GeometryCore.h.

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

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

Definition at line 5213 of file GeometryCore.h.

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

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

Definition at line 5222 of file GeometryCore.h.

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

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

Definition at line 2543 of file GeometryCore.h.

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

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

Definition at line 4986 of file GeometryCore.h.

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

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

Definition at line 3446 of file GeometryCore.h.

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

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

Definition at line 3454 of file GeometryCore.h.

3455  { return { geo::PlaneID(id, 0), 0 }; }
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
geo::WireID geo::GeometryCore::GetBeginWireID ( geo::PlaneID const &  id) const
inline

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

Definition at line 3462 of file GeometryCore.h.

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

Find the nearest OpChannel to some point.

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

Definition at line 1956 of file GeometryCore.cxx.

1957  {
1958  geo::CryostatGeo const* cryo = PositionToCryostatPtr(point);
1959  if (!cryo) return std::numeric_limits<unsigned int>::max();
1960  int o = cryo->GetClosestOpDet(point);
1961  return OpDetFromCryo(o, cryo->ID().Cryostat);
1962  }
unsigned int GetClosestOpDet(geo::Point_t const &point) const
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
unsigned int OpDetFromCryo(unsigned int o, unsigned int c) const
Get unique opdet number from cryo and internal count.
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:132
unsigned int geo::GeometryCore::GetClosestOpDet ( double const *  point) const

Definition at line 1967 of file GeometryCore.cxx.

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

Return the name of LAr TPC volume.

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

This information is used in the event display.

Todo:

Use a cryostat ID instead

What if it does not exist?

Definition at line 767 of file GeometryCore.cxx.

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

Definition at line 2288 of file GeometryCore.h.

2289  { 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:190
CryostatGeo const& geo::GeometryCore::GetElement ( geo::CryostatID const &  cryoid) const
inline

Definition at line 2041 of file GeometryCore.h.

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

Definition at line 2435 of file GeometryCore.h.

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

Definition at line 3005 of file GeometryCore.h.

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

Definition at line 3426 of file GeometryCore.h.

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

Definition at line 2056 of file GeometryCore.h.

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

Definition at line 2453 of file GeometryCore.h.

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

Definition at line 3023 of file GeometryCore.h.

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

Definition at line 3408 of file GeometryCore.h.

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

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

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

Definition at line 1960 of file GeometryCore.h.

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

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

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

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

Definition at line 2146 of file GeometryCore.h.

2147  { id = geo::CryostatID(Ncryostats(), false); }
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
void geo::GeometryCore::GetEndID ( geo::TPCID id) const

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

Definition at line 459 of file GeometryCore.cxx.

459  {
460  if (MaxTPCs() == 0) {
461  GetBeginID(id);
462  id.markInvalid();
463  }
464  else {
465  GetEndID(id.asCryostatID());
466  id.TPC = 0;
467  }
468  } // GeometryCore::GetEndID(geo::TPCID)
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
unsigned int MaxTPCs() const
Returns the largest number of TPCs a cryostat in the detector has.
void geo::GeometryCore::GetEndID ( geo::PlaneID id) const

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

Definition at line 819 of file GeometryCore.cxx.

819  {
820  if (MaxPlanes() == 0) {
821  GetBeginID(id);
822  id.markInvalid();
823  }
824  else {
825  GetEndID(id.asTPCID());
826  id.Plane = 0;
827  }
828  } // GeometryCore::GetEndID(PlaneID)
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
void geo::GeometryCore::GetEndID ( geo::WireID id) const

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

Definition at line 947 of file GeometryCore.cxx.

947  {
948  if (MaxWires() == 0) {
949  GetBeginID(id);
950  id.markInvalid();
951  }
952  else {
953  GetEndID(id.asPlaneID());
954  id.Wire = 0;
955  }
956  } // GeometryCore::GetEndID(WireID)
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
unsigned int MaxWires() const
Returns the largest number of wires among all planes in this detector.
void geo::GeometryCore::GetEndID ( readout::TPCsetID id) const
inline

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

Definition at line 4978 of file GeometryCore.h.

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

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

Definition at line 5205 of file GeometryCore.h.

5206  { 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

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

Definition at line 831 of file GeometryCore.cxx.

831  {
832  geo::CryostatGeo const* cryo = CryostatPtr(id);
833  return (cryo && cryo->MaxPlanes() > 0)
834  ? geo::PlaneID{ GetEndTPCID(id), 0 }: GetBeginPlaneID(id);
835  } // GeometryCore::GetEndPlaneID(CryostatID)
geo::TPCID GetEndTPCID(geo::CryostatID const &id) const
unsigned int MaxPlanes() const
Returns the largest number of planes among the TPCs in this cryostat.
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
geo::PlaneID GetBeginPlaneID(geo::CryostatID const &id) const
Returns the ID of the first plane of the specified cryostat.
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
CryostatGeo const * CryostatPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
geo::PlaneID geo::GeometryCore::GetEndPlaneID ( geo::TPCID const &  id) const

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

Definition at line 838 of file GeometryCore.cxx.

838  {
839  if (geo::TPCGeo const* TPC = TPCPtr(id); TPC && TPC->Nplanes() > 0)
840  return { GetNextID(id), 0 };
841  geo::PlaneID pid = GetBeginPlaneID(id);
842  pid.markInvalid();
843  return pid;
844  } // GeometryCore::GetEndPlaneID(TPCID)
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
Geometry information for a single TPC.
Definition: TPCGeo.h:38
geo::PlaneID GetBeginPlaneID(geo::CryostatID const &id) const
Returns the ID of the first plane of the specified cryostat.
TPCGeo const * TPCPtr(geo::TPCID const &tpcid) const
Returns the specified TPC.
void markInvalid()
Sets the ID as invalid.
Definition: geo_types.h:240
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
GeoID GetNextID(GeoID const &id) const
Returns the ID next to the specified one.
readout::ROPID geo::GeometryCore::GetEndROPID ( geo::CryostatID const &  id) const
inline

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

Definition at line 5218 of file GeometryCore.h.

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

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

Definition at line 5227 of file GeometryCore.h.

5228  { 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

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

Definition at line 471 of file GeometryCore.cxx.

471  {
472  if (geo::CryostatGeo const* cryo = CryostatPtr(id); cryo && cryo->NTPC() > 0)
473  return { id.Cryostat + 1, 0 };
474  geo::TPCID tpcid = GetBeginTPCID(id);
475  tpcid.markInvalid();
476  return tpcid;
477  } // GeometryCore::GetEndTPCID()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:181
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
void markInvalid()
Sets the ID as invalid.
Definition: geo_types.h:240
geo::TPCID GetBeginTPCID(geo::CryostatID const &id) const
Returns the ID of the first TPC in the specified cryostat.
CryostatGeo const * CryostatPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
readout::TPCsetID geo::GeometryCore::GetEndTPCsetID ( geo::CryostatID const &  id) const
inline

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

Definition at line 4991 of file GeometryCore.h.

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

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

Definition at line 959 of file GeometryCore.cxx.

959  {
960  geo::CryostatGeo const* cryo = CryostatPtr(id);
961  if (cryo && cryo->MaxWires() > 0) return { GetEndPlaneID(id), 0 };
962  geo::WireID wid = GetBeginWireID(id);
963  wid.markInvalid();
964  return wid;
965  } // GeometryCore::GetEndWireID(CryostatID)
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
void markInvalid()
Sets the ID as invalid.
Definition: geo_types.h:240
unsigned int MaxWires() const
Returns the largest number of wires among the TPCs in this cryostat.
geo::WireID GetBeginWireID(geo::CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
CryostatGeo const * CryostatPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
geo::PlaneID GetEndPlaneID(geo::CryostatID const &id) const
geo::WireID geo::GeometryCore::GetEndWireID ( geo::TPCID const &  id) const

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

Definition at line 968 of file GeometryCore.cxx.

968  {
969  geo::TPCGeo const* TPC = TPCPtr(id);
970  if (TPC && TPC->MaxWires() > 0) return { GetEndPlaneID(id), 0 };
971  geo::WireID wid = GetBeginWireID(id);
972  wid.markInvalid();
973  return wid;
974  } // GeometryCore::GetEndWireID(TPCID)
Geometry information for a single TPC.
Definition: TPCGeo.h:38
TPCGeo const * TPCPtr(geo::TPCID const &tpcid) const
Returns the specified TPC.
void markInvalid()
Sets the ID as invalid.
Definition: geo_types.h:240
unsigned int MaxWires() const
Returns the largest number of wires among the planes in this TPC.
Definition: TPCGeo.cxx:297
geo::WireID GetBeginWireID(geo::CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
geo::PlaneID GetEndPlaneID(geo::CryostatID const &id) const
geo::WireID geo::GeometryCore::GetEndWireID ( geo::PlaneID const &  id) const

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

Definition at line 977 of file GeometryCore.cxx.

977  {
978 
979  if (geo::PlaneGeo const* plane = PlanePtr(id); plane && plane->Nwires() > 0)
980  return { GetNextID(id), 0 };
981  geo::WireID wid = GetBeginWireID(id);
982  wid.markInvalid();
983  return wid;
984  } // GeometryCore::GetEndWireID(PlaneID)
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:82
void markInvalid()
Sets the ID as invalid.
Definition: geo_types.h:240
geo::WireID GetBeginWireID(geo::CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
unsigned int Nwires() const
Number of wires in this plane.
Definition: PlaneGeo.h:269
GeoID GetNextID(GeoID const &id) const
Returns the ID next to the specified one.
std::string geo::GeometryCore::GetLArTPCVolumeName ( geo::TPCID const &  tpcid) const

Return the name of specified LAr TPC volume.

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

This information is used by Geant4 simulation

Todo:

Use a TPCID instead

What if it does not exist?

Definition at line 761 of file GeometryCore.cxx.

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

Definition at line 2830 of file GeometryCore.h.

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

Returns the ID next to the specified one.

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

Definition at line 1950 of file GeometryCore.h.

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

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

Template Parameters
Point_(default: DefaultPoint_t)_ return this point type
Parameters
tpcidID of the TPC
Returns
position of center of TPC face toward the beam, in world coordinates [cm]

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

Definition at line 2783 of file GeometryCore.h.

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

Definition at line 2785 of file GeometryCore.h.

2786  { return GetTPCFrontFaceCenter<DefaultPoint_t>(tpcid); }
template<typename Point >
Point geo::GeometryCore::GetTPCFrontFaceCenter ( unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const
inline

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

Template Parameters
Point_(default: DefaultPoint_t)_ return this point type
Parameters
tpc_(default: 0)_ TPC number within the cryostat cstat
cstat_(default: 0)_ number of cryostat
Returns
position of center of TPC face toward the beam, in world coordinates [cm]
See Also
GetTPCFrontFaceCenter(geo::TPCID const&)
Note
Please use GetTPCFrontFaceCenter(geo::TPCID const&) instead.

Definition at line 2803 of file GeometryCore.h.

2804  { return GetTPCFrontFaceCenter<Point>(geo::TPCID(cstat, tpc)); }
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
DefaultPoint_t geo::GeometryCore::GetTPCFrontFaceCenter ( unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const
inline

Definition at line 2806 of file GeometryCore.h.

2807  { return GetTPCFrontFaceCenter<DefaultPoint_t>(tpc, cstat); }
const std::string geo::GeometryCore::GetWorldVolumeName ( ) const

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

Definition at line 640 of file GeometryCore.cxx.

641  {
642  // For now, and possibly forever, this is a constant (given the
643  // definition of "nodeNames" above).
644  return std::string("volWorld");
645  }
unsigned int geo::GeometryCore::HardwareChannelFromOpChannel ( int  opChannel) const

Convert unique channel to hardware channel.

Definition at line 283 of file GeometryCore.cxx.

284  {
285  return fChannelMapAlg->HardwareChannelFromOpChannel(opChannel);
286  }
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
bool geo::GeometryCore::HasChannel ( raw::ChannelID_t  channel) const

Returns whether the specified channel exists and is valid.

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

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

Definition at line 628 of file GeometryCore.cxx.

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

Returns whether we have the specified cryostat.

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

Definition at line 2019 of file GeometryCore.h.

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

Definition at line 2021 of file GeometryCore.h.

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

Returns whether we have the specified TPC.

Definition at line 2412 of file GeometryCore.h.

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

Definition at line 2978 of file GeometryCore.h.

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

Definition at line 3391 of file GeometryCore.h.

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

Returns whether we have the specified TPC set.

Definition at line 4938 of file GeometryCore.h.

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

Returns whether we have the specified readout plane

Returns
whether the readout plane is valid and exists

Definition at line 5140 of file GeometryCore.h.

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

Returns whether we have the specified plane.

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

Definition at line 2973 of file GeometryCore.h.

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

Returns whether we have the specified readout plane

Returns
whether the readout plane is valid and exists

Definition at line 1817 of file GeometryCore.cxx.

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

Returns whether we have the specified TPC.

Definition at line 2405 of file GeometryCore.h.

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

Returns whether we have the specified TPC set

Returns
whether the TPC set is valid and exists

Definition at line 1773 of file GeometryCore.cxx.

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

Returns whether we have the specified wire.

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

Definition at line 3386 of file GeometryCore.h.

3387  {
3388  geo::PlaneGeo const* pPlane = PlanePtr(wireid);
3389  return pPlane? pPlane->HasWire(wireid): false;
3390  }
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:82
bool HasWire(unsigned int iwire) const
Returns whether a wire with index iwire is present in this plane.
Definition: PlaneGeo.h:279
bool geo::GeometryCore::IncrementID ( geo::CryostatID id) const
inline

Sets the ID to the ID after the specified one.

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

Definition at line 5632 of file GeometryCore.h.

5632  {
5633  ++id.Cryostat;
5634  if (id) id.isValid = HasCryostat(id); // if invalid already, it stays so
5635  return bool(id);
5636 } // geo::GeometryCore::IncrementID(geo::CryostatID)
static constexpr bool
bool HasCryostat(geo::CryostatID const &cryoid) const
Returns whether we have the specified cryostat.
bool geo::GeometryCore::IncrementID ( geo::TPCID id) const
inline

Sets the ID to the ID after the specified one.

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

Definition at line 5638 of file GeometryCore.h.

5638  {
5639  unsigned int const nTPCsInCryo = NTPC(id);
5640  if (++id.TPC < nTPCsInCryo) return bool(id); // if was invalid, it stays so
5641  // no more TPCs in this cryostat
5642  id.TPC = 0;
5643  return IncrementID(id.asCryostatID()); // also sets validity
5644 } // geo::GeometryCore::IncrementID(geo::TPCID)
static constexpr bool
bool IncrementID(geo::CryostatID &id) const
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
bool geo::GeometryCore::IncrementID ( geo::PlaneID id) const
inline

Sets the ID to the ID after the specified one.

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

Definition at line 5646 of file GeometryCore.h.

5646  {
5647  // this implementation is non-optimal, in that the cryostat lookup is
5648  // performed both here and, potentially, in IncrementID(TPCID)
5649  unsigned int const nPlanesInTPC = Nplanes(id);
5650  if (++id.Plane < nPlanesInTPC) return bool(id); // if was invalid, stays so
5651  // no more planes in this TPCs
5652  id.Plane = 0;
5653  return IncrementID(id.asTPCID()); // also sets validity
5654 } // 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.
static constexpr bool
bool IncrementID(geo::CryostatID &id) const
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
bool geo::GeometryCore::IncrementID ( geo::WireID id) const
inline

Sets the ID to the ID after the specified one.

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

Definition at line 5656 of file GeometryCore.h.

5656  {
5657  // this implementation is non-optimal, in that the TPC lookup is
5658  // performed both here and, potentially, in IncrementID(PlaneID)
5659  unsigned int const nWiresInPlane = Nwires(id);
5660  if (++id.Wire < nWiresInPlane) return bool(id); // if was invalid, stays so
5661  // no more wires in this plane
5662  id.Wire = 0;
5663  return IncrementID(id.asPlaneID()); // also sets validity
5664 } // geo::GeometryCore::IncrementID(geo::WireID)
static constexpr bool
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
bool IncrementID(geo::CryostatID &id) const
WireGeo const & Wire(geo::WireID const &wireid) const
Returns the specified wire.
bool geo::GeometryCore::IncrementID ( readout::TPCsetID id) const
inline

Sets the ID to the ID after the specified one.

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

Definition at line 5666 of file GeometryCore.h.

5666  {
5667  unsigned int const nTPCsetsInCryo = NTPCsets(id);
5668  if (++id.TPCset < nTPCsetsInCryo)
5669  return bool(id); // if was invalid, it stays so
5670  // no more TPC sets in this cryostat
5671  id.TPCset = 0;
5672  return IncrementID(id.asCryostatID()); // also sets validity
5673 } // geo::GeometryCore::IncrementID(readout::TPCsetID)
unsigned int NTPCsets(readout::CryostatID const &cryoid) const
Returns the total number of TPC sets in the specified cryostat.
static constexpr bool
bool IncrementID(geo::CryostatID &id) const
bool geo::GeometryCore::IncrementID ( readout::ROPID id) const
inline

Sets the ID to the ID after the specified one.

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

Definition at line 5675 of file GeometryCore.h.

5675  {
5676  // this implementation is non-optimal, in that the cryostat lookup is
5677  // performed both here and, potentially, in IncrementID(TPCsetID)
5678  unsigned int const nROPinTPC = NROPs(id);
5679  if (++id.ROP < nROPinTPC) return bool(id); // if was invalid, stays so
5680  // no more readout planes in this TPC set
5681  id.ROP = 0;
5682  return IncrementID(id.asTPCsetID()); // also sets validity
5683 } // geo::GeometryCore::IncrementID(readout::ROPID)
static constexpr bool
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.
std::string geo::GeometryCore::Info ( std::string  indent = "  ") const

Returns a string with complete geometry information.

See Also
Print()

Definition at line 1187 of file GeometryCore.cxx.

1187  {
1188  std::ostringstream sstr;
1189  Print(sstr, indent);
1190  return sstr.str();
1191  } // GeometryCore::Info()
void Print(Stream &&out, std::string indent=" ") const
Prints geometry information with maximum verbosity.
bool geo::GeometryCore::IntersectionPoint ( geo::WireID const &  wid1,
geo::WireID const &  wid2,
double &  y,
double &  z 
) const

Returns the intersection point of two wires.

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

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

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

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

Definition at line 1746 of file GeometryCore.cxx.

1749  {
1750  geo::WireIDIntersection widIntersect;
1751  bool const found = WireIDsIntersect(wid1, wid2, widIntersect);
1752  y = widIntersect.y;
1753  z = widIntersect.z;
1754  return found;
1755  }
process_name opflash particleana ie ie ie z
double z
z position of intersection
Definition: geo_types.h:805
process_name opflash particleana ie ie y
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:804
bool geo::GeometryCore::IntersectionPoint ( unsigned int  wire1,
unsigned int  wire2,
unsigned int  plane1,
unsigned int  plane2,
unsigned int  cstat,
unsigned int  tpc,
double &  y,
double &  z 
) const
inline

Returns the intersection point of two wires.

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

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

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

Definition at line 4258 of file GeometryCore.h.

4266  {
4267  return IntersectionPoint(
4268  geo::WireID(cstat, tpc, plane1, wire1),
4269  geo::WireID(cstat, tpc, plane2, wire2),
4270  y, z
4271  );
4272  }
process_name opflash particleana ie ie ie z
process_name opflash particleana ie ie y
bool IntersectionPoint(geo::WireID const &wid1, geo::WireID const &wid2, double &y, double &z) const
Returns the intersection point of two wires.
bool geo::GeometryCore::IntersectLines ( double  A_start_x,
double  A_start_y,
double  A_end_x,
double  A_end_y,
double  B_start_x,
double  B_start_y,
double  B_end_x,
double  B_end_y,
double &  x,
double &  y 
) const

Computes the intersection between two lines on a plane.

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

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

Definition at line 1409 of file GeometryCore.cxx.

1413  {
1414 
1415  // Equation from http://en.wikipedia.org/wiki/Line%E2%80%93line_intersection
1416  // T.Yang Nov, 2014
1417  // Notation: x => coordinate orthogonal to the drift direction and to the beam direction
1418  // y => direction orthogonal to the previous and to beam direction
1419 
1420  double const denom = (A_start_x - A_end_x)*(B_start_y - B_end_y)
1421  - (A_start_y - A_end_y)*(B_start_x - B_end_x);
1422 
1423  if (coordIs.zero(denom)) return false;
1424 
1425  double const A = (A_start_x * A_end_y - A_start_y * A_end_x) / denom;
1426  double const B = (B_start_x * B_end_y - B_start_y * B_end_x) / denom;
1427 
1428  x = (B_start_x - B_end_x) * A - (A_start_x - A_end_x) * B;
1429  y = (B_start_y - B_end_y) * A - (A_start_y - A_end_y) * B;
1430 
1431  return true;
1432 
1433  } // GeometryCore::IntersectLines()
process_name opflash particleana ie x
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.
process_name opflash particleana ie ie y
float A
Definition: dedx.py:137
bool geo::GeometryCore::IntersectSegments ( double  A_start_x,
double  A_start_y,
double  A_end_x,
double  A_end_y,
double  B_start_x,
double  B_start_y,
double  B_end_x,
double  B_end_y,
double &  x,
double &  y 
) const

Computes the intersection between two segments on a plane.

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

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

Definition at line 1436 of file GeometryCore.cxx.

1440  {
1441 
1442  bool bCross = IntersectLines(
1443  A_start_x, A_start_y, A_end_x, A_end_y,
1444  B_start_x, B_start_y, B_end_x, B_end_y,
1445  x, y
1446  );
1447 
1448  if (bCross) {
1449  mf::LogWarning("IntersectSegments") << "The segments are parallel!";
1450  return false;
1451  }
1452 
1453  return PointWithinSegments(
1454  A_start_x, A_start_y, A_end_x, A_end_y,
1455  B_start_x, B_start_y, B_end_x, B_end_y,
1456  x, y
1457  );
1458 
1459  } // GeometryCore::IntersectSegments()
process_name opflash particleana ie x
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).
process_name opflash particleana ie ie y
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

Is this a valid OpChannel number?

Definition at line 290 of file GeometryCore.cxx.

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

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

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

Example of usage:

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

  // useful code here

} // for all cryostats

Definition at line 2187 of file GeometryCore.h.

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

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

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

Example of usage:

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

  // useful code here

} // for all cryostats

Definition at line 2206 of file GeometryCore.h.

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

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

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

Example of usage:

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

Definition at line 3130 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 3155 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 3179 of file GeometryCore.h.

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

IteratePlaneIDs() is not supported on plane IDs.

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

IteratePlaneIDs() is not supported on wire IDs.

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

IteratePlaneIDs() is not supported on readout IDs.

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

IteratePlaneIDs() is not supported on readout IDs.

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

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

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

Example of usage:

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

Definition at line 3212 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 3235 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 3258 of file GeometryCore.h.

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

IteratePlanes() is not supported on plane IDs.

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

IteratePlanes() is not supported on wire IDs.

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

IteratePlanes() is not supported on readout IDs.

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

IteratePlanes() is not supported on readout IDs.

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

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

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

Example of usage:

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

Definition at line 5276 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 5300 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 5324 of file GeometryCore.h.

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

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

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

Example of usage:

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

Definition at line 2603 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 2627 of file GeometryCore.h.

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

IterateTPCIDs() is not supported on TPC IDs.

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

IterateTPCIDs() is not supported on plane IDs.

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

IterateTPCIDs() is not supported on wire IDs.

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

IterateTPCIDs() is not supported on readout IDs.

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

IterateTPCIDs() is not supported on readout IDs.

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

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

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

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

Example of usage:

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

Definition at line 2661 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 2684 of file GeometryCore.h.

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

IterateTPCs() is not supported on TPC IDs.

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

IterateTPCs() is not supported on plane IDs.

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

IterateTPCs() is not supported on wire IDs.

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

IterateTPCs() is not supported on readout IDs.

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

IterateTPCs() is not supported on readout IDs.

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

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

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

Example of usage:

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

Definition at line 5031 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 5055 of file GeometryCore.h.

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

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

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

Example of usage:

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

Definition at line 3553 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 3578 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 3603 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 3628 of file GeometryCore.h.

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

IterateWireIDs() is not supported on wire IDs.

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

IterateWireIDs() is not supported on readout IDs.

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

IterateWireIDs() is not supported on readout IDs.

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

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

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

Example of usage:

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

Definition at line 3657 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 3681 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 3705 of file GeometryCore.h.

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

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

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

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

Example of usage:

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

Definition at line 3729 of file GeometryCore.h.

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

IterateWires() is not supported on wire IDs.

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

IterateWires() is not supported on readout IDs.

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

IterateWires() is not supported on readout IDs.

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

Loads the geometry information from the specified files.

Parameters
gdmlfilepath to file to be used for Geant4 simulation
rootfilepath to file for internal geometry representation
builderalgorithm to be used for the interpretation of geometry
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 91 of file GeometryCore.cxx.

95  {
96 
97 
98  if (gdmlfile.empty()) {
99  throw cet::exception("GeometryCore")
100  << "No GDML Geometry file specified!\n";
101  }
102 
103  if (rootfile.empty()) {
104  throw cet::exception("GeometryCore")
105  << "No ROOT Geometry file specified!\n";
106  }
107 
108  ClearGeometry();
109 
110  // Open the GDML file, and convert it into ROOT TGeoManager format.
111  // Then lock the gGeoManager to prevent future imports, for example
112  // in AuxDetGeometry
113  if( !gGeoManager || bForceReload ){
114  if (gGeoManager) TGeoManager::UnlockGeometry();
115  else { // very first time (or so it should)
116  // [20210630, petrillo@slac.stanford.edu]
117  // ROOT 6.22.08 allows us to choose the representation of lengths
118  // in the geometry objects parsed from GDML.
119  // In LArSoft we want them to be centimeters (ROOT standard).
120  // This was tracked as Redmine issue #25990, and I leave this mark
121  // because I feel that we'll be back to it not too far in the future.
122  // Despite the documentation (ROOT 6.22/08),
123  // it seems the units are locked from the beginning,
124  // so we unlock without prejudice.
125  TGeoManager::LockDefaultUnits(false);
126  TGeoManager::SetDefaultUnits(TGeoManager::kRootUnits);
127  TGeoManager::LockDefaultUnits(true);
128  }
129  TGeoManager::Import(rootfile.c_str());
130  gGeoManager->LockGeometry();
131  }
132 
133  BuildGeometry(builder);
134 
135  fGDMLfile = gdmlfile;
136  fROOTfile = rootfile;
137 
138  mf::LogInfo("GeometryCore") << "New detector geometry loaded from "
139  << "\n\t" << fROOTfile
140  << "\n\t" << fGDMLfile << "\n";
141 
142  } // GeometryCore::LoadGeometryFile()
void ClearGeometry()
Deletes the detector geometry structures.
void BuildGeometry(geo::GeometryBuilder &builder)
std::string fGDMLfile
path to geometry file used for Geant4 simulation
std::string fROOTfile
path to geometry file for geometry in GeometryCore
void geo::GeometryCore::LoadGeometryFile ( std::string  gdmlfile,
std::string  rootfile,
bool  bForceReload = false 
)

Loads the geometry information from the specified files.

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

This legacy version of LoadGeometryFile() uses a standard geo::GeometryBuilder implementation. Do not rely on it if you can avoid it.

Definition at line 146 of file GeometryCore.cxx.

149  {
150  fhicl::Table<geo::GeometryBuilderStandard::Config> const builderConfig
151  (fBuilderParameters, { "tool_type" });
152 
153  // this is a wink to the understanding that we might be using a art-based
154  // service provider configuration sprinkled with tools.
155  geo::GeometryBuilderStandard builder{builderConfig()};
156  LoadGeometryFile(gdmlfile, rootfile, builder, bForceReload);
157  } // GeometryCore::LoadGeometryFile()
void LoadGeometryFile(std::string gdmlfile, std::string rootfile, geo::GeometryBuilder &builder, bool bForceReload=false)
Loads the geometry information from the specified files.
fhicl::ParameterSet fBuilderParameters
Extracts of LArSoft geometry information from ROOT.
template<typename T >
geo::PlaneDataContainer<T> geo::GeometryCore::makePlaneData ( ) const
inline

Returns a container with one entry per wire plane.

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

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

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

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

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

Definition at line 2888 of file GeometryCore.h.

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

Returns a container with one entry per wire plane.

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

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

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

Definition at line 2910 of file GeometryCore.h.

2911  { 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 >
readout::ROPDataContainer<T> geo::GeometryCore::makeROPdata ( ) const
inline

Returns a container with one entry per readout plane.

Template Parameters
Ttype of data in the container
Returns
a container with one default-constructed T per readout plane
See Also
readout::ROPDataContainer

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

The interface of the container is detailed in the documentation of the container itself, readout::ROPDataContainer. Example of usage:

auto const* geom = lar::providerFrom<geo::GeometryCore>();
auto hitsPerROP
= geom->makeROPdata<std::vector<recob::Hit const*>>();

Definition at line 5109 of file GeometryCore.h.

5110  { return { Ncryostats(), MaxTPCsets(), MaxROPs() }; }
unsigned int MaxROPs() const
Returns the largest number of ROPs a TPC set in the detector has.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
unsigned int MaxTPCsets() const
Returns the largest number of TPC sets any cryostat in the detector has.
template<typename T >
readout::ROPDataContainer<T> geo::GeometryCore::makeROPdata ( T const &  defValue) const
inline

Returns a container with one entry per readout 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 readout plane
See Also
readout::ROPDataContainer

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

auto const* geom = lar::providerFrom<geo::GeometryCore>();
auto nHitsPerROP = geom->makeROPdata(0U);

Definition at line 5127 of file GeometryCore.h.

5128  { return { Ncryostats(), MaxTPCsets(), MaxROPs(), defValue }; }
unsigned int MaxROPs() const
Returns the largest number of ROPs a TPC set in the detector has.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
unsigned int MaxTPCsets() const
Returns the largest number of TPC sets any cryostat in the detector has.
template<typename T >
geo::TPCDataContainer<T> geo::GeometryCore::makeTPCData ( ) const
inline

Returns a container with one entry per TPC.

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

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

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

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

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

Definition at line 2350 of file GeometryCore.h.

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

Returns a container with one entry per TPC.

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

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

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

Definition at line 2373 of file GeometryCore.h.

2374  { 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.
template<typename T >
readout::TPCsetDataContainer<T> geo::GeometryCore::makeTPCsetData ( ) const
inline

Returns a container with one entry per TPC set.

Template Parameters
Ttype of data in the container
Returns
a container with one default-constructed T per TPC set
See Also
readout::TPCsetDataContainer

The working assumption is that all cryostats have the same number of TPC sets. It is always guaranteed that all existing TPC sets 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 set.

The interface of the container is detailed in the documentation of the container itself, readout::TPCsetDataContainer. Example of usage:

auto const* geom = lar::providerFrom<geo::GeometryCore>();
auto tracksPerTPCset
= geom->makeTPCsetData<std::vector<recob::Track const*>>();

Definition at line 4908 of file GeometryCore.h.

4909  { return { Ncryostats(), MaxTPCsets() }; }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
unsigned int MaxTPCsets() const
Returns the largest number of TPC sets any cryostat in the detector has.
template<typename T >
readout::TPCsetDataContainer<T> geo::GeometryCore::makeTPCsetData ( T const &  defValue) const
inline

Returns a container with one entry per TPC set.

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 set
See Also
readout::TPCsetDataContainer

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

auto const* geom = lar::providerFrom<geo::GeometryCore>();
auto nTracksPerTPCset = geom->makeTPCsetData(0U);

Definition at line 4926 of file GeometryCore.h.

4927  { return { Ncryostats(), MaxTPCsets(), defValue }; }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
unsigned int MaxTPCsets() const
Returns the largest number of TPC sets any cryostat in the detector has.
double geo::GeometryCore::MassBetweenPoints ( geo::Point_t const &  p1,
geo::Point_t const &  p2 
) const

Returns the column density between two points.

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

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

Both points are specified in world coordinates.

Definition at line 1145 of file GeometryCore.cxx.

1146  {
1147 
1148  //The purpose of this method is to determine the column density
1149  //between the two points given. Do that by starting at p1 and
1150  //stepping until you get to the node of p2. calculate the distance
1151  //between the point just inside that node and p2 to get the last
1152  //bit of column density
1153  double columnD = 0.;
1154 
1155  //first initialize a track - get the direction cosines
1156  geo::Vector_t const dir = (p2 - p1).Unit();
1157 
1158  double const dxyz[3] = { dir.X(), dir.Y(), dir.Z() };
1159  double const cp1[3] = { p1.X(), p1.Y(), p1.Z() };
1160  gGeoManager->InitTrack(cp1, dxyz);
1161 
1162  //might be helpful to have a point to a TGeoNode
1163  TGeoNode *node = gGeoManager->GetCurrentNode();
1164 
1165  //check that the points are not in the same volume already.
1166  //if they are in different volumes, keep stepping until you
1167  //are in the same volume as the second point
1168  while(!gGeoManager->IsSameLocation(p2.X(), p2.Y(), p2.Z())){
1169  gGeoManager->FindNextBoundary();
1170  columnD += gGeoManager->GetStep()*node->GetMedium()->GetMaterial()->GetDensity();
1171 
1172  //the act of stepping puts you in the next node and returns that node
1173  node = gGeoManager->Step();
1174  }//end loop to get to volume of second point
1175 
1176  //now you are in the same volume as the last point, but not at that point.
1177  //get the distance between the current point and the last one
1178  geo::Point_t const last
1179  = geo::vect::makePointFromCoords(gGeoManager->GetCurrentPoint());
1180  double const lastStep = (p2 - last).R();
1181  columnD += lastStep*node->GetMedium()->GetMaterial()->GetDensity();
1182 
1183  return columnD;
1184  }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
tuple dir
Definition: dropbox.py:28
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:184
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
physics associatedGroupsWithLeft p1
double geo::GeometryCore::MassBetweenPoints ( double *  p1,
double *  p2 
) const
TGeoMaterial const * geo::GeometryCore::Material ( geo::Point_t const &  point) const

Returns the material at the specified position.

Definition at line 1055 of file GeometryCore.cxx.

1055  {
1056  auto const pNode = gGeoManager->FindNode(point.X(), point.Y(), point.Z());
1057  if (!pNode) return nullptr;
1058  auto const pMedium = pNode->GetMedium();
1059  return pMedium? pMedium->GetMaterial(): nullptr;
1060  }
std::string geo::GeometryCore::MaterialName ( TVector3 const &  point) const
inline

Name of the deepest material containing the point xyz.

Returns
material of the origin by default

Definition at line 1891 of file GeometryCore.h.

1892  { 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

Definition at line 1063 of file GeometryCore.cxx.

1064  {
1065  // check that the given point is in the World volume at least
1066  geo::BoxBoundedGeo worldBox = WorldBox();
1067  if (!worldBox.ContainsPosition(point)) {
1068  mf::LogWarning("GeometryCoreBadInputPoint")
1069  << "point " << point << " is not inside the world volume "
1070  << worldBox.Min() << " -- " << worldBox.Max()
1071  << "; returning unknown material name";
1072  return { "unknownMaterial" };
1073  }
1074  auto const pMaterial = Material(point);
1075  if (!pMaterial) {
1076  mf::LogWarning("GeometryCoreBadInputPoint")
1077  << "material for point " << point
1078  << " not found! returning unknown material name";
1079  return { "unknownMaterial" };
1080  }
1081  return pMaterial->GetName();
1082  }
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:33
TGeoMaterial const * Material(geo::Point_t const &point) const
Returns the material at the specified position.
geo::Point_t Max() const
Returns the corner point with the largest coordinates.
bool ContainsPosition(geo::Point_t const &point, double wiggle=1.0) const
Returns whether this volume contains the specified point.
geo::BoxBoundedGeo WorldBox() const
unsigned int geo::GeometryCore::MaxOpChannel ( ) const

Largest optical channel number.

Definition at line 259 of file GeometryCore.cxx.

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

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

Definition at line 927 of file GeometryCore.cxx.

927  {
928  unsigned int maxPlanes = 0;
929  for (geo::CryostatGeo const& cryo: Cryostats()) {
930  unsigned int maxPlanesInCryo = cryo.MaxPlanes();
931  if (maxPlanesInCryo > maxPlanes) maxPlanes = maxPlanesInCryo;
932  } // for
933  return maxPlanes;
934  } // GeometryCore::MaxPlanes()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
CryostatList_t & Cryostats()
Return the internal cryostat list.
unsigned int geo::GeometryCore::MaxROPs ( ) const

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

Definition at line 1811 of file GeometryCore.cxx.

1811  {
1812  return fChannelMapAlg->MaxROPs();
1813  } // GeometryCore::MaxROPs()
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::MaxTPCs ( ) const

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

Definition at line 907 of file GeometryCore.cxx.

907  {
908  unsigned int maxTPCs = 0;
909  for (geo::CryostatGeo const& cryo: Cryostats()) {
910  unsigned int maxTPCsInCryo = cryo.NTPC();
911  if (maxTPCsInCryo > maxTPCs) maxTPCs = maxTPCsInCryo;
912  } // for
913  return maxTPCs;
914  } // GeometryCore::MaxTPCs()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
CryostatList_t & Cryostats()
Return the internal cryostat list.
unsigned int geo::GeometryCore::MaxTPCsets ( ) const

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

Definition at line 1767 of file GeometryCore.cxx.

1767  {
1768  return fChannelMapAlg->MaxTPCsets();
1769  } // GeometryCore::MaxTPCsets()
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::MaxWires ( ) const

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

Definition at line 937 of file GeometryCore.cxx.

937  {
938  unsigned int maxWires = 0;
939  for (geo::CryostatGeo const& cryo: Cryostats()) {
940  unsigned int maxWiresInCryo = cryo.MaxWires();
941  if (maxWiresInCryo > maxWires) maxWires = maxWiresInCryo;
942  } // for
943  return maxWires;
944  } // GeometryCore::MaxWires()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
CryostatList_t & Cryostats()
Return the internal cryostat list.
unsigned int geo::GeometryCore::NAuxDets ( ) const
inline

Returns the number of auxiliary detectors.

Todo:
use a AutDetID_t instead of unsigned int?

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

Todo:
Change return type to size_t

Definition at line 4548 of file GeometryCore.h.

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

Returns the number of sensitive components of auxiliary detector.

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

Definition at line 296 of file GeometryCore.cxx.

297  {
298  if( aid > NAuxDets() - 1)
299  throw cet::exception("Geometry") << "Requested AuxDet index " << aid
300  << " is out of range: " << NAuxDets();
301 
302  return AuxDets()[aid].NSensitiveVolume();
303  }
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
unsigned int geo::GeometryCore::Nchannels ( ) const

Returns the number of TPC readout channels in the detector.

Definition at line 208 of file GeometryCore.cxx.

209  {
210  return fChannelMapAlg->Nchannels();
211  }
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::Nchannels ( readout::ROPID const &  ropid) const

Returns the number of channels in the specified ROP.

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

Definition at line 214 of file GeometryCore.cxx.

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

Returns the number of cryostats in the detector.

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

Todo:
Change return type to size_t

Definition at line 2002 of file GeometryCore.h.

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

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

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

Definition at line 1296 of file GeometryCore.cxx.

1297  {
1298 
1299  // This method is supposed to return a channel number rather than
1300  // a wire number. Perform the conversion here (although, maybe
1301  // faster if we deal in wire numbers rather than channel numbers?)
1302 
1303  // NOTE on failure both NearestChannel() and upstream:
1304  // * according to documentation, should return invalid channel
1305  // * in the actual code throw an exception because of a BUG
1306  //
1307  // The following implementation automatically becomes in fact compliant to
1308  // the documentation if upstreams becomes compliant to.
1309  // When that happens, just delete this comment.
1310  geo::WireID const wireID = NearestWireID(worldPos, planeid);
1311  return wireID? PlaneWireToChannel(wireID): raw::InvalidChannelID;
1312  } // GeometryCore::NearestChannel()
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:32
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
geo::WireID NearestWireID(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( const double  worldLoc[3],
geo::PlaneID const &  planeid 
) const

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

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

The different versions allow different way to provide the position.

Todo:
remove the integers version

Definition at line 1279 of file GeometryCore.cxx.

1280  {
1281  return NearestChannel(geo::vect::makePointFromCoords(worldPos), planeid);
1282  }
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.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
raw::ChannelID_t geo::GeometryCore::NearestChannel ( std::vector< double > const &  worldLoc,
geo::PlaneID const &  planeid 
) const

Definition at line 1286 of file GeometryCore.cxx.

1287  {
1288  if(worldPos.size() > 3) throw cet::exception("GeometryCore") << "bad size vector for "
1289  << "worldPos: "
1290  << worldPos.size() << "\n";
1291  return NearestChannel(worldPos.data(), planeid);
1292  }
raw::ChannelID_t NearestChannel(geo::Point_t const &worldLoc, geo::PlaneID const &planeid) const
Returns the ID of the channel nearest to the specified position.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( const TVector3 &  worldLoc,
geo::PlaneID const &  planeid 
) const
inline

Definition at line 4818 of file GeometryCore.h.

4819  { return NearestChannel(geo::vect::toPoint(worldLoc), planeid); }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
raw::ChannelID_t NearestChannel(geo::Point_t const &worldLoc, geo::PlaneID const &planeid) const
Returns the ID of the channel nearest to the specified position.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( const double  worldLoc[3],
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Definition at line 4820 of file GeometryCore.h.

4824  { return NearestChannel(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
raw::ChannelID_t NearestChannel(geo::Point_t const &worldLoc, geo::PlaneID const &planeid) const
Returns the ID of the channel nearest to the specified position.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( std::vector< double > const &  worldLoc,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Definition at line 4825 of file GeometryCore.h.

4829  { return NearestChannel(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
raw::ChannelID_t NearestChannel(geo::Point_t const &worldLoc, geo::PlaneID const &planeid) const
Returns the ID of the channel nearest to the specified position.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( const TVector3 &  worldLoc,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Definition at line 4830 of file GeometryCore.h.

4834  { return NearestChannel(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
raw::ChannelID_t NearestChannel(geo::Point_t const &worldLoc, geo::PlaneID const &planeid) const
Returns the ID of the channel nearest to the specified position.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( geo::Point_t const &  worldLoc,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Definition at line 4835 of file GeometryCore.h.

4839  { return NearestChannel(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
raw::ChannelID_t NearestChannel(geo::Point_t const &worldLoc, geo::PlaneID const &planeid) const
Returns the ID of the channel nearest to the specified position.
unsigned int geo::GeometryCore::NearestWire ( geo::Point_t const &  point,
geo::PlaneID const &  planeid 
) const

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

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

Definition at line 1230 of file GeometryCore.cxx.

1231  {
1232  return NearestWireID(point, planeid).Wire;
1233  // return fChannelMapAlg->NearestWire(worldPos, planeid);
1234  }
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:580
geo::WireID NearestWireID(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
unsigned int geo::GeometryCore::NearestWire ( const double  worldLoc[3],
geo::PlaneID const &  planeid 
) const

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

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

The different versions allow different way to provide the position.

Deprecated:
Use NearestWireID() instead.
Todo:

remove the integers version

what happens when no wire is found?

Definition at line 1238 of file GeometryCore.cxx.

1239  {
1240  return NearestWire(geo::vect::makePointFromCoords(worldPos), planeid);
1241  }
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.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
unsigned int geo::GeometryCore::NearestWire ( std::vector< double > const &  worldLoc,
geo::PlaneID const &  planeid 
) const

Definition at line 1245 of file GeometryCore.cxx.

1246  {
1247  if(worldPos.size() > 3) throw cet::exception("GeometryCore") << "bad size vector for "
1248  << "worldPos: "
1249  << worldPos.size() << "\n";
1250  return NearestWire(worldPos.data(), planeid);
1251  }
geo::WireID::WireID_t NearestWire(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the index of wire closest to position in the specified TPC.
unsigned int geo::GeometryCore::NearestWire ( const TVector3 &  worldLoc,
geo::PlaneID const &  planeid 
) const
inline

Definition at line 4004 of file GeometryCore.h.

4005  { return NearestWire(geo::vect::toPoint(worldLoc), planeid); }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
geo::WireID::WireID_t NearestWire(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the index of wire closest to position in the specified TPC.
unsigned int geo::GeometryCore::NearestWire ( const double  worldLoc[3],
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Definition at line 4006 of file GeometryCore.h.

4010  { return NearestWire(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
geo::WireID::WireID_t NearestWire(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the index of wire closest to position in the specified TPC.
unsigned int geo::GeometryCore::NearestWire ( std::vector< double > const &  worldLoc,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Definition at line 4011 of file GeometryCore.h.

4015  { return NearestWire(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
geo::WireID::WireID_t NearestWire(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the index of wire closest to position in the specified TPC.
unsigned int geo::GeometryCore::NearestWire ( const TVector3 &  worldLoc,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Definition at line 4016 of file GeometryCore.h.

4020  { return NearestWire(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
geo::WireID::WireID_t NearestWire(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the index of wire closest to position in the specified TPC.
unsigned int geo::GeometryCore::NearestWire ( geo::Point_t const &  worldLoc,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Definition at line 4021 of file GeometryCore.h.

4025  { return NearestWire(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
geo::WireID::WireID_t NearestWire(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the index of wire closest to position in the specified TPC.
geo::WireID geo::GeometryCore::NearestWireID ( geo::Point_t const &  point,
geo::PlaneID const &  planeid 
) const

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

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

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

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

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

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

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

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

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

Definition at line 1255 of file GeometryCore.cxx.

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

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

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

The different versions allow different way to provide the position.

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

Definition at line 1272 of file GeometryCore.cxx.

1273  {
1274  return NearestWireID(geo::vect::makePointFromCoords(worldPos), planeid);
1275  }
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.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
geo::WireID geo::GeometryCore::NearestWireID ( std::vector< double > const &  point,
geo::PlaneID const &  planeid 
) const

Definition at line 1262 of file GeometryCore.cxx.

1263  {
1264  if(worldPos.size() > 3) throw cet::exception("GeometryCore") << "bad size vector for "
1265  << "worldPos: "
1266  << worldPos.size() << "\n";
1267  return NearestWireID(worldPos.data(), planeid);
1268  }
geo::WireID NearestWireID(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
geo::WireID geo::GeometryCore::NearestWireID ( const TVector3 &  point,
geo::PlaneID const &  planeid 
) const
inline

Definition at line 3947 of file GeometryCore.h.

3948  { return NearestWireID(geo::vect::toPoint(point), planeid); }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
geo::WireID NearestWireID(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
geo::WireID geo::GeometryCore::NearestWireID ( const double  point[3],
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Definition at line 3949 of file GeometryCore.h.

3953  { return NearestWireID(point, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
geo::WireID NearestWireID(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
geo::WireID geo::GeometryCore::NearestWireID ( std::vector< double > const &  point,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Definition at line 3954 of file GeometryCore.h.

3958  { return NearestWireID(point, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
geo::WireID NearestWireID(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
geo::WireID geo::GeometryCore::NearestWireID ( const TVector3 &  point,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Definition at line 3959 of file GeometryCore.h.

3963  { return NearestWireID(point, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
geo::WireID NearestWireID(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
geo::WireID geo::GeometryCore::NearestWireID ( geo::Point_t const &  point,
unsigned int const  PlaneNo,
unsigned int const  TPCNo = 0,
unsigned int const  cstat = 0 
) const
inline

Definition at line 3964 of file GeometryCore.h.

3968  { return NearestWireID(point, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
geo::WireID NearestWireID(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
unsigned int geo::GeometryCore::NElements ( ) const
inline

Definition at line 2003 of file GeometryCore.h.

2003 { return Ncryostats(); }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
unsigned int geo::GeometryCore::NElements ( geo::CryostatID const &  cryoid) const
inline

Definition at line 2394 of file GeometryCore.h.

2395  { return NTPC(cryoid); }
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
unsigned int geo::GeometryCore::NElements ( geo::TPCID const &  tpcid) const
inline

Definition at line 2930 of file GeometryCore.h.

2931  { return Nplanes(tpcid); }
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
unsigned int geo::GeometryCore::NElements ( geo::PlaneID const &  planeid) const
inline

Definition at line 3364 of file GeometryCore.h.

3365  { return Nwires(planeid); }
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
unsigned int geo::GeometryCore::NOpChannels ( ) const

Number of electronics channels for all the optical detectors.

Todo:
add explanation of the different IDs

Definition at line 253 of file GeometryCore.cxx.

254  {
255  return fChannelMapAlg->NOpChannels(this->NOpDets());
256  }
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int NOpDets() const
Number of OpDets in the whole detector.
unsigned int geo::GeometryCore::NOpDets ( ) const

Number of OpDets in the whole detector.

Definition at line 244 of file GeometryCore.cxx.

245  {
246  int N=0;
247  for(size_t cstat=0; cstat!=Ncryostats(); cstat++)
248  N += this->Cryostat(cstat).NOpDet();
249  return N;
250  }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:361
process_name largeant stream1 can override from command line with o or output physics producers generator N
unsigned int geo::GeometryCore::NOpHardwareChannels ( int  opDet) const

Definition at line 265 of file GeometryCore.cxx.

266  {
267  return fChannelMapAlg->NOpHardwareChannels(opDet);
268  }
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::Nplanes ( unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const
inline

Returns the total number of wire planes in the specified TPC.

Parameters
tpctpc number within the cryostat
cstatcryostat number
Todo:

Make all the arguments mandatory (as TPCID)

Change return type to size_t

what happens if TPC does not exist?

Definition at line 2854 of file GeometryCore.h.

2855  { return Nplanes(geo::TPCID(cstat, tpc)); }
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
unsigned int geo::GeometryCore::Nplanes ( geo::TPCID const &  tpcid) const
inline

Returns the total number of planes in the specified TPC.

Parameters
tpcidTPC ID
Returns
number of planes in specified TPC, or 0 if no TPC found

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

Todo:
Change return type to size_t

Definition at line 2925 of file GeometryCore.h.

2926  {
2927  TPCGeo const* pTPC = GetElementPtr(tpcid);
2928  return pTPC? pTPC->NElements(): 0;
2929  }
CryostatGeo const * GetElementPtr(geo::CryostatID const &cryoid) const
unsigned int geo::GeometryCore::NROPs ( readout::TPCsetID const &  tpcsetid) const

Returns the total number of ROP in the specified TPC set.

Parameters
tpcsetidTPC set ID
Returns
number of readout planes in the TPC set, or 0 if no TPC set found

Note that this methods explicitly check the existence of the TPC set.

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

Definition at line 1805 of file GeometryCore.cxx.

1805  {
1806  return fChannelMapAlg->NROPs(tpcsetid);
1807  } // GeometryCore::NROPs()
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::NSiblingElements ( geo::CryostatID const &  ) const
inline

Definition at line 2004 of file GeometryCore.h.

2005  { return Ncryostats(); }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
unsigned int geo::GeometryCore::NSiblingElements ( geo::TPCID const &  tpcid) const
inline

Definition at line 2396 of file GeometryCore.h.

2397  { return NTPC(tpcid); }
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
unsigned int geo::GeometryCore::NSiblingElements ( geo::PlaneID const &  planeid) const
inline

Definition at line 2932 of file GeometryCore.h.

2933  { return Nplanes(planeid); }
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
unsigned int geo::GeometryCore::NSiblingElements ( geo::WireID const &  wireid) const
inline

Definition at line 3366 of file GeometryCore.h.

3367  { return Nwires(wireid); }
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
unsigned int geo::GeometryCore::NSiblingElements ( readout::TPCsetID const &  tpcsetid) const
inline

Definition at line 4879 of file GeometryCore.h.

4880  { return NTPCsets(tpcsetid); }
unsigned int NTPCsets(readout::CryostatID const &cryoid) const
Returns the total number of TPC sets in the specified cryostat.
unsigned int geo::GeometryCore::NSiblingElements ( readout::ROPID const &  ropid) const
inline

Definition at line 5079 of file GeometryCore.h.

5080  { return NROPs(ropid); }
unsigned int NROPs(readout::TPCsetID const &tpcsetid) const
Returns the total number of ROP in the specified TPC set.
unsigned int geo::GeometryCore::NTPC ( unsigned int  cstat = 0) const
inline

Returns the total number of TPCs in the specified cryostat.

Parameters
cstatcryostat number
Todo:

Make the cryostat number mandatory (as CryostatID)

Change return type to size_t

what happens if it does not exist?

Definition at line 2311 of file GeometryCore.h.

2312  { return NTPC(geo::CryostatID(cstat)); }
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:190
unsigned int geo::GeometryCore::NTPC ( geo::CryostatID const &  cryoid) const
inline

Returns the total number of TPCs in the specified cryostat.

Parameters
cryoidcryostat number
Returns
number of TPCs in specified cryostat, or 0 if no cryostat found

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

Todo:
Change return type to size_t

Definition at line 2389 of file GeometryCore.h.

2390  {
2391  CryostatGeo const* pCryo = GetElementPtr(cryoid);
2392  return pCryo? pCryo->NElements(): 0;
2393  }
CryostatGeo const * GetElementPtr(geo::CryostatID const &cryoid) const
unsigned int geo::GeometryCore::NTPCsets ( readout::CryostatID const &  cryoid) const

Returns the total number of TPC sets in the specified cryostat.

Parameters
cryoidcryostat ID
Returns
number of TPC sets in the cryostat, or 0 if no cryostat found

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

Definition at line 1761 of file GeometryCore.cxx.

1761  {
1762  return fChannelMapAlg->NTPCsets(cryoid);
1763  } // GeometryCore::NTPCsets()
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::Nviews ( ) const

Returns the number of views (different wire orientations)

Returns the number of different views, or wire orientations, in the detector.

The function assumes that all TPCs in all cryostats of a detector have the same number of planes, which should be a safe assumption.

Todo:
Change return type to size_t

Definition at line 307 of file GeometryCore.cxx.

308  {
309  return MaxPlanes();
310  }
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
unsigned int geo::GeometryCore::Nwires ( unsigned int  p,
unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const
inline

Returns the total number of wires in the specified plane.

Parameters
pplane number within the TPC
tpctpc number within the cryostat
cstatcryostat number
Todo:

Make all the arguments mandatory (as PlaneID)

Change return type to size_t

what happens if it does not exist?

Definition at line 3345 of file GeometryCore.h.

3346  { return Nwires(geo::PlaneID(cstat, tpc, p)); }
pdgs p
Definition: selectors.fcl:22
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
unsigned int geo::GeometryCore::Nwires ( geo::PlaneID const &  planeid) const
inline

Returns the total number of wires in the specified plane.

Parameters
planeidplane ID
Returns
number of wires in specified plane, or 0 if no plane found

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

Todo:
Change return type to size_t

Definition at line 3359 of file GeometryCore.h.

3360  {
3361  PlaneGeo const* pPlane = GetElementPtr(planeid);
3362  return pPlane? pPlane->NElements(): 0;
3363  }
CryostatGeo const * GetElementPtr(geo::CryostatID const &cryoid) const
unsigned int geo::GeometryCore::OpChannel ( int  detNum,
int  hardwareChannel 
) const

Convert detector number and hardware channel to unique channel.

Definition at line 271 of file GeometryCore.cxx.

272  {
273  return fChannelMapAlg->OpChannel(detNum, hardwareChannel);
274  }
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::OpDetFromCryo ( unsigned int  o,
unsigned int  c 
) const

Get unique opdet number from cryo and internal count.

Definition at line 1877 of file GeometryCore.cxx.

1878  {
1879  static bool Loaded=false;
1880  static std::vector<unsigned int> LowestID;
1881  static unsigned int NCryo;
1882  // If not yet loaded static parameters, do it
1883  if(Loaded == false){
1884 
1885  Loaded = true;
1886 
1887  // Store the lowest ID for each cryostat
1888  NCryo=Ncryostats();
1889  LowestID.resize(NCryo + 1);
1890  LowestID.at(0)=0;
1891  for(size_t cryo=0; cryo!=NCryo; ++cryo){
1892  LowestID.at(cryo+1)=LowestID.at(cryo)+Cryostat(c).NOpDet();
1893  }
1894 
1895  }
1896 
1897  if( (c < NCryo) && (o < Cryostat(c).NOpDet())){
1898  return LowestID.at(c)+o;
1899  }
1900  else{
1901  throw cet::exception("OpDetCryoToOpID Error") << "Coordinates c=" << c
1902  << ", o=" << o
1903  << " out of range. Abort\n";
1904  }
1905 
1906  // if all is well, we never get to this point in the method
1907  // but still a good idea to be sure to always return something.
1908 
1909  return INT_MAX;
1910  }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:361
unsigned int geo::GeometryCore::OpDetFromOpChannel ( int  opChannel) const

Convert unique channel to detector number.

Definition at line 277 of file GeometryCore.cxx.

278  {
279  return fChannelMapAlg->OpDetFromOpChannel(opChannel);
280  }
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
const OpDetGeo & geo::GeometryCore::OpDetGeoFromOpChannel ( unsigned int  OpChannel) const

Returns the geo::OpDetGeo object for the given channel number.

Parameters
OpChanneloptical detector unique channel number
See Also
GeometryCoreOpDetGeometry "optical detector identification"

Definition at line 1913 of file GeometryCore.cxx.

1914  {
1915  return this->OpDetGeoFromOpDet(this->OpDetFromOpChannel(OpChannel));
1916  }
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Returns the geo::OpDetGeo object for the given detector number.
unsigned int OpDetFromOpChannel(int opChannel) const
Convert unique channel to detector number.
unsigned int OpChannel(int detNum, int hardwareChannel) const
Convert detector number and hardware channel to unique channel.
const OpDetGeo & geo::GeometryCore::OpDetGeoFromOpDet ( unsigned int  OpDet) const

Returns the geo::OpDetGeo object for the given detector number.

Parameters
OpDetoptical detector unique number
See Also
GeometryCoreOpDetGeometry "optical detector identification"

Definition at line 1919 of file GeometryCore.cxx.

1920  {
1921  static bool Loaded=false;
1922  static std::vector<unsigned int> LowestID;
1923  static size_t NCryo;
1924  // If not yet loaded static parameters, do it
1925  if(Loaded == false){
1926 
1927  Loaded = true;
1928 
1929  // Store the lowest ID for each cryostat
1930  NCryo=Ncryostats();
1931  LowestID.resize(NCryo + 1);
1932  LowestID[0] = 0;
1933  for(size_t cryo = 0; cryo != NCryo; ++cryo){
1934  LowestID[cryo+1] = LowestID[cryo] + Cryostat(cryo).NOpDet();
1935  }
1936 
1937  }
1938 
1939  for(size_t i=0; i!=NCryo; ++i){
1940  if( (OpDet >= LowestID[i]) && (OpDet < LowestID[i+1]) ){
1941  int c = i;
1942  int o = OpDet-LowestID[i];
1943  return this->Cryostat(c).OpDet(o);
1944  }
1945  }
1946  // If we made it here, we didn't find the right combination. abort
1947  throw cet::exception("OpID To OpDetCryo error")<<"OpID out of range, "<< OpDet << "\n";
1948 
1949  // Will not reach due to exception
1950  return this->Cryostat(0).OpDet(0);
1951  }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
const OpDetGeo & OpDet(unsigned int iopdet) const
Return the iopdet&#39;th optical detector in the cryostat.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:361
std::string geo::GeometryCore::OpDetGeoName ( unsigned int  c = 0) const

Returns gdml string which gives sensitive opdet name.

Parameters
cID of the cryostat the detector is in

This name is defined in the geometry (GDML) description.

Todo:
Change to use CryostatID

Definition at line 1870 of file GeometryCore.cxx.

1871  {
1872  return Cryostat(c).OpDetGeoName();
1873  }
std::string OpDetGeoName() const
Get name of opdet geometry element.
Definition: CryostatGeo.h:377
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
GeometryCore& geo::GeometryCore::operator= ( GeometryCore const &  )
delete
GeometryCore& geo::GeometryCore::operator= ( GeometryCore &&  )
delete
PlaneGeo const& geo::GeometryCore::Plane ( unsigned int const  p,
unsigned int const  tpc = 0,
unsigned int const  cstat = 0 
) const
inline

Returns the specified wire.

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

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

Todo:
remove the version with integers

Definition at line 3000 of file GeometryCore.h.

3002  { return Plane(geo::PlaneID(cstat, tpc, p)); }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
pdgs p
Definition: selectors.fcl:22
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
PlaneGeo const& geo::GeometryCore::Plane ( geo::PlaneID const &  planeid) const
inline

Definition at line 3003 of file GeometryCore.h.

3004  { return TPC(planeid).Plane(planeid); }
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:263
std::set< PlaneID > const & geo::GeometryCore::PlaneIDs ( ) const

Returns a list of possible PlaneIDs in the detector.

Returns
a constant reference to the set of plane IDs
Deprecated:
use IteratePlaneIDs() instead plane IDs of DUNE FD? probably better to use iterators instead

Definition at line 634 of file GeometryCore.cxx.

635  {
636  return fChannelMapAlg->PlaneIDs();
637  }
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
double geo::GeometryCore::PlanePitch ( geo::TPCID const &  tpcid,
geo::PlaneID::PlaneID_t  p1 = 0,
geo::PlaneID::PlaneID_t  p2 = 1 
) const

Returns the distance between two planes.

Parameters
p1index of the first plane
p2index of the second plane
tpctpc number within the cryostat
cstatcryostat number
Returns
distance between the planes
Todo:

add a version with plane IDs

deprecate this function

add a default version for a given TPCID

add a version with two plane indices for a given TPCID

return the absolute value of the distance (makes the order unimportant)

document what will happen (in the future methods) with planes on different TPCs

Definition at line 849 of file GeometryCore.cxx.

853  {
854  return TPC(tpcid).PlanePitch(p1, p2);
855  }
double PlanePitch(unsigned int p1=0, unsigned int p2=1) const
Definition: TPCGeo.cxx:388
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
physics associatedGroupsWithLeft p1
double geo::GeometryCore::PlanePitch ( geo::PlaneID const &  pid1,
geo::PlaneID const &  pid2 
) const

Definition at line 858 of file GeometryCore.cxx.

859  {
860  return PlanePitch(pid1.asTPCID(), pid1.Plane, pid2.Plane);
861  }
geo::Length_t PlanePitch(geo::TPCID const &tpcid, geo::PlaneID::PlaneID_t p1=0, geo::PlaneID::PlaneID_t p2=1) const
Returns the distance between two planes.
double geo::GeometryCore::PlanePitch ( unsigned int  p1 = 0,
unsigned int  p2 = 1,
unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const

Definition at line 863 of file GeometryCore.cxx.

867  {
868  return PlanePitch(geo::TPCID(cstat, tpc), p1, p2);
869  }
geo::Length_t PlanePitch(geo::TPCID const &tpcid, geo::PlaneID::PlaneID_t p1=0, geo::PlaneID::PlaneID_t p2=1) const
Returns the distance between two planes.
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
physics associatedGroupsWithLeft p1
PlaneGeo const* geo::GeometryCore::PlanePtr ( geo::PlaneID const &  planeid) const
inline

Returns the specified plane.

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

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

Definition at line 3018 of file GeometryCore.h.

3019  {
3020  geo::TPCGeo const* pTPC = TPCPtr(planeid);
3021  return pTPC? pTPC->PlanePtr(planeid): nullptr;
3022  } // PlanePtr()
Geometry information for a single TPC.
Definition: TPCGeo.h:38
TPCGeo const * TPCPtr(geo::TPCID const &tpcid) const
Returns the specified TPC.
PlaneGeo const * PlanePtr(unsigned int iplane) const
Returns the plane number iplane from this TPC.
Definition: TPCGeo.h:223
raw::ChannelID_t geo::GeometryCore::PlaneWireToChannel ( WireID const &  wireid) const

Returns the ID of the TPC channel connected to the specified wire.

Parameters
planethe number of plane
wirethe number of wire
tpcthe number of TPC
cryostatthe number of cryostat
wireidthe ID of the wire
Returns
the ID of the channel, or raw::InvalidChannelID if invalid wire
Todo:

Verify the raw::InvalidChannelID part

remove the integers version

Definition at line 1315 of file GeometryCore.cxx.

1316  {
1317  return fChannelMapAlg->PlaneWireToChannel(wireid);
1318  }
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
raw::ChannelID_t geo::GeometryCore::PlaneWireToChannel ( unsigned int const  plane,
unsigned int const  wire,
unsigned int const  tpc = 0,
unsigned int const  cstat = 0 
) const
inline

Definition at line 4737 of file GeometryCore.h.

4741  { return PlaneWireToChannel(geo::WireID(cstat, tpc, plane, wire)); }
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
bool geo::GeometryCore::PointWithinSegments ( double  A_start_x,
double  A_start_y,
double  A_end_x,
double  A_end_y,
double  B_start_x,
double  B_start_y,
double  B_end_x,
double  B_end_y,
double  x,
double  y 
)
staticprivate

Returns whether x and y are within both specified ranges (A and B).

Definition at line 2002 of file GeometryCore.cxx.

2006  {
2007  return coordIs.withinSorted(x, A_start_x, A_end_x)
2008  && coordIs.withinSorted(y, A_start_y, A_end_y)
2009  && coordIs.withinSorted(x, B_start_x, B_end_x)
2010  && coordIs.withinSorted(y, B_start_y, B_end_y)
2011  ;
2012 
2013  } // GeometryCore::PointWithinSegments()
process_name opflash particleana ie x
constexpr bool withinSorted(Value_t value, Value_t lower, Value_t upper) const
Returns whether value is between bounds (included); bounds are sorted.
static lar::util::RealComparisons< geo::Length_t > coordIs
Value of tolerance for equality comparisons.
process_name opflash particleana ie ie y
const AuxDetGeo & geo::GeometryCore::PositionToAuxDet ( geo::Point_t const &  point,
unsigned int &  ad,
double  tolerance = 0 
) const

Returns the auxiliary detector at specified location.

Parameters
pointlocation to be tested
ad_(output)_ the auxiliary detector index
tolerancetolerance (cm) for matches. Default 0.
Returns
constant reference to AuxDetGeo object of the auxiliary detector
Todo:
what happens if it does not exist?

Definition at line 532 of file GeometryCore.cxx.

533  {
534  // locate the desired Auxiliary Detector
535  ad = FindAuxDetAtPosition(point, tolerance);
536  return AuxDet(ad);
537  }
unsigned int FindAuxDetAtPosition(double const worldLoc[3], double tolerance=0) const
Returns the index of the auxiliary detector at specified location.
auto const tolerance
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
const AuxDetGeo & geo::GeometryCore::PositionToAuxDet ( double const  worldLoc[3],
unsigned int &  ad,
double  tolerance = 0 
) const

Returns the auxiliary detector at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
ad(output) the auxiliary detector index
tolerancetolerance (cm) for matches. Default 0.
Returns
constant reference to AuxDetGeo object of the auxiliary detector
Deprecated:
Use the version with geo::Point_t.
Todo:
what happens if it does not exist?

Definition at line 541 of file GeometryCore.cxx.

542  { return PositionToAuxDet(geo::vect::makePointFromCoords(worldLoc), ad, tolerance); }
auto const tolerance
AuxDetGeo const & PositionToAuxDet(geo::Point_t const &point, unsigned int &ad, double tolerance=0) const
Returns the auxiliary detector at specified location.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
const AuxDetSensitiveGeo & geo::GeometryCore::PositionToAuxDetSensitive ( geo::Point_t const &  point,
size_t &  ad,
size_t &  sv,
double  tolerance = 0 
) const

Returns the auxiliary detector at specified location.

Parameters
pointlocation to be tested
ad_(output)_ the auxiliary detector index
sv_(output)_ the auxiliary detector sensitive volume index
tolerancetolerance (cm) for matches. Default 0.
Returns
reference to AuxDetSensitiveGeo object of the auxiliary detector
Todo:
what happens if it does not exist?

Definition at line 563 of file GeometryCore.cxx.

564  {
565  // locate the desired Auxiliary Detector
567  return AuxDet(ad).SensitiveVolume(sv);
568  }
void FindAuxDetSensitiveAtPosition(geo::Point_t const &point, std::size_t &adg, std::size_t &sv, double tolerance=0) const
Fills the indices of the sensitive auxiliary detector at location.
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
Definition: AuxDetGeo.h:171
auto const tolerance
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
const AuxDetSensitiveGeo & geo::GeometryCore::PositionToAuxDetSensitive ( double const  worldLoc[3],
size_t &  ad,
size_t &  sv,
double  tolerance = 0 
) const

Returns the auxiliary detector at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
ad(output) the auxiliary detector index
sv(output) the auxiliary detector sensitive volume index
tolerancetolerance (cm) for matches. Default 0.
Returns
reference to AuxDetSensitiveGeo object of the auxiliary detector
Todo:
what happens if it does not exist?
Deprecated:
Use the version with geo::Point_t.

Definition at line 572 of file GeometryCore.cxx.

auto const tolerance
const AuxDetSensitiveGeo & PositionToAuxDetSensitive(geo::Point_t const &point, size_t &ad, size_t &sv, double tolerance=0) const
Returns the auxiliary detector at specified location.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
geo::CryostatGeo const & geo::GeometryCore::PositionToCryostat ( geo::Point_t const &  point) const

Returns the cryostat at specified location.

Parameters
pointthe location [cm]
Returns
a constant reference to the geo::CryostatGeo containing point
Exceptions
cet::exception("Geometry" category) if no cryostat matches

The tolerance used here is the one returned by DefaultWiggle().

Definition at line 481 of file GeometryCore.cxx.

482  {
483  geo::CryostatGeo const* cstat = PositionToCryostatPtr(point);
484  if (!cstat) {
485  throw cet::exception("GeometryCore")
486  << "Can't find any cryostat at position " << point << "\n";
487  }
488  return *cstat;
489  } // GeometryCore::PositionToCryostat()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
geo::CryostatGeo const * PositionToCryostatPtr(geo::Point_t const &point) const
Returns the cryostat at specified location.
CryostatGeo const& geo::GeometryCore::PositionToCryostat ( double const  point[3]) const
inline

Definition at line 2105 of file GeometryCore.h.

CryostatGeo const & PositionToCryostat(geo::Point_t const &point) const
Returns the cryostat at specified location.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
const CryostatGeo & geo::GeometryCore::PositionToCryostat ( double const  worldLoc[3],
geo::CryostatID cid 
) const

Returns the cryostat at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
cid(output) cryostat ID
Returns
a constant reference to the CryostatGeo object of the cryostat
Exceptions
cet::exception("Geometry" category) if no cryostat matches

The tolerance used here is the one returned by DefaultWiggle().

Deprecated:
Use PositionToCryostat(geo::Point_t const&) instead.

Definition at line 494 of file GeometryCore.cxx.

495  {
497 
498  if(cstat == geo::CryostatID::InvalidID)
499  throw cet::exception("GeometryCore") << "Can't find Cryostat for position ("
500  << worldLoc[0] << ","
501  << worldLoc[1] << ","
502  << worldLoc[2] << ")\n";
503  cid = geo::CryostatID(cstat);
504  return Cryostat(cid);
505  } // GeometryCore::PositionToCryostat(double[3], CryostatID)
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
unsigned int CryostatID_t
Type for the ID number.
Definition: geo_types.h:191
static constexpr CryostatID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:208
geo::CryostatID::CryostatID_t FindCryostatAtPosition(geo::Point_t const &worldLoc) const
Returns the index of the cryostat at specified location.
const CryostatGeo & geo::GeometryCore::PositionToCryostat ( double const  worldLoc[3],
unsigned int &  cstat 
) const

Returns the cryostat at specified location.

Parameters
worldLoc3D coordinates of the point (world reference frame)
cstat(output) number of cryostat
Returns
a constant reference to the CryostatGeo object of the cryostat
Exceptions
cet::exception("Geometry" category) if no cryostat matches

The tolerance used here is the one returned by DefaultWiggle().

Deprecated:
Use PositionToCryostat(geo::Point_t const&) instead.

Definition at line 508 of file GeometryCore.cxx.

509  {
510  geo::CryostatID cid;
511  geo::CryostatGeo const& cryo = PositionToCryostat(worldLoc, cid);
512  cstat = cid.Cryostat;
513  return cryo;
514  } // GeometryCore::PositionToCryostat(double[3], unsigned int)
CryostatGeo const & PositionToCryostat(geo::Point_t const &point) const
Returns the cryostat at specified location.
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
The data type to uniquely identify a cryostat.
Definition: geo_types.h:190
geo::CryostatID geo::GeometryCore::PositionToCryostatID ( geo::Point_t const &  point) const

Returns the ID of the cryostat at specified location.

Parameters
pointthe location [cm]
Returns
ID of the cryostat including point (invalid if none)

The tolerance used here is the one returned by DefaultWiggle().

Definition at line 384 of file GeometryCore.cxx.

385  {
386  geo::CryostatGeo const* cryo = PositionToCryostatPtr(point);
387  return cryo? cryo->ID(): geo::CryostatID{};
388  } // GeometryCore::PositionToCryostatID()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
geo::CryostatGeo const * PositionToCryostatPtr(geo::Point_t const &point) const
Returns the cryostat at specified location.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:190
geo::CryostatID const & ID() const
Returns the identifier of this cryostat.
Definition: CryostatGeo.h:132
geo::CryostatGeo const * geo::GeometryCore::PositionToCryostatPtr ( geo::Point_t const &  point) const

Returns the cryostat at specified location.

Parameters
pointthe location [cm]
Returns
pointer to the geo::CryostatGeo including point, or nullptr

The tolerance used here is the one returned by DefaultWiggle().

Definition at line 372 of file GeometryCore.cxx.

373  {
374  for (geo::CryostatGeo const& cryostat: IterateCryostats()) {
375  if (cryostat.ContainsPosition(point, 1.0 + fPositionWiggle))
376  return &cryostat;
377  }
378  return nullptr;
379  } // GeometryCore::PositionToCryostatPtr()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
double fPositionWiggle
accounting for rounding errors when testing positions
IteratorBox< cryostat_iterator,&GeometryCore::begin_cryostat,&GeometryCore::end_cryostat > IterateCryostats() const
Enables ranged-for loops on all cryostats of the detector.
geo::TPCGeo const & geo::GeometryCore::PositionToTPC ( geo::Point_t const &  point) const

Returns the TPC at specified location.

Parameters
pointthe location [cm]
Returns
a constant reference to the geo::TPCGeo including point
Exceptions
cet::exception("Geometry" category) if no TPC matches

Definition at line 419 of file GeometryCore.cxx.

420  {
421  geo::TPCGeo const* tpc = PositionToTPCptr(point);
422  if (!tpc) {
423  throw cet::exception("GeometryCore")
424  << "Can't find any TPC at position " << point << "\n";
425  }
426  return *tpc;
427  } // GeometryCore::PositionToTPC()
Geometry information for a single TPC.
Definition: TPCGeo.h:38
geo::TPCGeo const * PositionToTPCptr(geo::Point_t const &point) const
Returns the TPC at specified location.
TPCGeo const& geo::GeometryCore::PositionToTPC ( double const  point[3]) const
inline

Definition at line 2492 of file GeometryCore.h.

2493  { return PositionToTPC(geo::vect::makePointFromCoords(point)); }
geo::TPCGeo const & PositionToTPC(geo::Point_t const &point) const
Returns the TPC at specified location.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
TPCGeo const & geo::GeometryCore::PositionToTPC ( double const  worldLoc[3],
unsigned int &  tpc,
unsigned int &  cstat 
) const

Returns the TPC at specified location.

Parameters
pointthe location [cm]
tpc_(output)_ where to store the number of TPC
cstat_(output)_ where to store the number of cryostat
Returns
a constant reference to the geo::TPCGeo including point
Exceptions
cet::exception("Geometry" category) if no TPC matches
Deprecated:
Use PositionToTPCID() or PositionToTPC().ID()

Definition at line 442 of file GeometryCore.cxx.

443  {
444  geo::TPCGeo const& TPC = PositionToTPC(worldLoc);
445  cstat = TPC.ID().Cryostat;
446  tpc = TPC.ID().TPC;
447  return TPC;
448  } // GeometryCore::PositionToTPC(double*, TPCID&)
geo::TPCID const & ID() const
Returns the identifier of this TPC.
Definition: TPCGeo.h:333
Geometry information for a single TPC.
Definition: TPCGeo.h:38
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
geo::TPCGeo const & PositionToTPC(geo::Point_t const &point) const
Returns the TPC at specified location.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
TPCGeo const & geo::GeometryCore::PositionToTPC ( double const  worldLoc[3],
TPCID tpcid 
) const

Returns the TPC at specified location.

Parameters
pointthe location [cm]
tpcid_(output)_ where to store the TPC ID
Returns
a constant reference to the geo::TPCGeo including point
Exceptions
cet::exception("Geometry" category) if no TPC matches
Deprecated:
Use PositionToTPCID() or PositionToTPC().ID()

Definition at line 432 of file GeometryCore.cxx.

433  {
434  geo::TPCGeo const& TPC = PositionToTPC(worldLoc);
435  tpcid = TPC.ID();
436  return TPC;
437  } // GeometryCore::PositionToTPC(double*, TPCID&)
geo::TPCID const & ID() const
Returns the identifier of this TPC.
Definition: TPCGeo.h:333
Geometry information for a single TPC.
Definition: TPCGeo.h:38
geo::TPCGeo const & PositionToTPC(geo::Point_t const &point) const
Returns the TPC at specified location.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
geo::TPCID geo::GeometryCore::PositionToTPCID ( geo::Point_t const &  point) const

Returns the ID of the TPC at specified location.

Parameters
pointthe location [cm]
Returns
ID of the TPC at specified location, invalid if none
See Also
PositionToTPC()

Definition at line 452 of file GeometryCore.cxx.

452  {
453  geo::TPCGeo const* tpc = PositionToTPCptr(point);
454  return tpc? tpc->ID(): geo::TPCID{};
455  } // GeometryCore::PositionToTPCID()
geo::TPCID const & ID() const
Returns the identifier of this TPC.
Definition: TPCGeo.h:333
Geometry information for a single TPC.
Definition: TPCGeo.h:38
geo::TPCGeo const * PositionToTPCptr(geo::Point_t const &point) const
Returns the TPC at specified location.
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
geo::TPCGeo const * geo::GeometryCore::PositionToTPCptr ( geo::Point_t const &  point) const

Returns the TPC at specified location.

Parameters
pointthe location [cm]
Returns
the geo::TPCGeo including point, or nullptr if none

Definition at line 410 of file GeometryCore.cxx.

411  {
412  geo::CryostatGeo const* cryo = PositionToCryostatPtr(point);
413  return cryo? cryo->PositionToTPCptr(point, 1. + fPositionWiggle): nullptr;
414  } // GeometryCore::PositionToTPCptr()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
geo::TPCGeo const * PositionToTPCptr(geo::Point_t const &point, double wiggle) const
Returns a pointer to the TPC at specified location.
double fPositionWiggle
accounting for rounding errors when testing positions
geo::CryostatGeo const * PositionToCryostatPtr(geo::Point_t const &point) const
Returns the cryostat at specified location.
template<typename Stream >
void geo::GeometryCore::Print ( Stream &&  out,
std::string  indent = "  " 
) const

Prints geometry information with maximum verbosity.

Definition at line 5703 of file GeometryCore.h.

5704 {
5705 
5706  out << "Detector " << DetectorName() << " has "
5707  << Ncryostats() << " cryostats and "
5708  << NAuxDets() << " auxiliary detectors:";
5709 
5710  auto const& detEnclosureBox = DetectorEnclosureBox();
5711  out << "\n" << indent << "Detector enclosure: "
5712  << detEnclosureBox.Min() << " -- " << detEnclosureBox.Max()
5713  << " cm => ( " << detEnclosureBox.SizeX() << " x "
5714  << detEnclosureBox.SizeY() << " x "
5715  << detEnclosureBox.SizeZ() << " ) cm^3"
5716  ;
5717 
5718  for (geo::CryostatGeo const& cryostat: IterateCryostats()) {
5719  out << "\n" << indent;
5720  cryostat.PrintCryostatInfo
5721  (std::forward<Stream>(out), indent + " ", cryostat.MaxVerbosity);
5722 
5723  const unsigned int nTPCs = cryostat.NTPC();
5724  for(unsigned int t = 0; t < nTPCs; ++t) {
5725  const geo::TPCGeo& tpc = cryostat.TPC(t);
5726 
5727  out << "\n" << indent << " ";
5728  tpc.PrintTPCInfo
5729  (std::forward<Stream>(out), indent + " ", tpc.MaxVerbosity);
5730 
5731  const unsigned int nPlanes = tpc.Nplanes();
5732  for(unsigned int p = 0; p < nPlanes; ++p) {
5733  const geo::PlaneGeo& plane = tpc.Plane(p);
5734  const unsigned int nWires = plane.Nwires();
5735 
5736  out << "\n" << indent << " ";
5737  plane.PrintPlaneInfo
5738  (std::forward<Stream>(out), indent + " ", plane.MaxVerbosity);
5739  geo::SigType_t const sigType = SignalType(plane.ID());
5740  out << "\n" << indent << " "
5741  << "signal type: " << SignalTypeName(sigType)
5742  << " (" << static_cast<int>(sigType) << ")";
5743 
5744  for(unsigned int w = 0; w < nWires; ++w) {
5745  const geo::WireGeo& wire = plane.Wire(w);
5746  geo::WireID wireID(plane.ID(), w);
5747 
5748  // the wire should be aligned on z axis, half on each side of 0,
5749  // in its local frame
5750  out << "\n" << indent << " " << wireID << " ";
5751  wire.PrintWireInfo
5752  (std::forward<Stream>(out), indent + " ", wire.MaxVerbosity);
5753  } // for wire
5754  } // for plane
5755  } // for TPC
5756 
5757  unsigned int nOpDets = cryostat.NOpDet();
5758  for (unsigned int iOpDet = 0; iOpDet < nOpDets; ++iOpDet) {
5759  geo::OpDetGeo const& opDet = cryostat.OpDet(iOpDet);
5760  out << "\n" << indent << " [OpDet #" << iOpDet << "] ";
5761  opDet.PrintOpDetInfo
5762  (std::forward<Stream>(out), indent + " ", opDet.MaxVerbosity);
5763  } // for
5764  } // for cryostat
5765 
5766  unsigned int const nAuxDets = NAuxDets();
5767  for (unsigned int iDet = 0; iDet < nAuxDets; ++iDet) {
5768  geo::AuxDetGeo const& auxDet = AuxDet(iDet);
5769 
5770  out << "\n" << indent << "[#" << iDet << "] ";
5771  auxDet.PrintAuxDetInfo
5772  (std::forward<Stream>(out), indent + " ", auxDet.MaxVerbosity);
5773 
5774  unsigned int const nSensitive = auxDet.NSensitiveVolume();
5775  switch (nSensitive) {
5776  case 0: break;
5777  case 1: {
5778  geo::AuxDetSensitiveGeo const& auxDetS = auxDet.SensitiveVolume(0U);
5779  out << "\n" << indent << " ";
5780  auxDetS.PrintAuxDetInfo
5781  (std::forward<Stream>(out), indent + " ", auxDetS.MaxVerbosity);
5782  break;
5783  }
5784  default:
5785  for (unsigned int iSens = 0; iSens < nSensitive; ++iSens) {
5786  out << "\n" << indent << "[#" << iSens << "] ";
5787  geo::AuxDetSensitiveGeo const& auxDetS
5788  = auxDet.SensitiveVolume(iSens);
5789  auxDetS.PrintAuxDetInfo
5790  (std::forward<Stream>(out), indent + " ", auxDetS.MaxVerbosity);
5791  } // for
5792  break;
5793  } // if sensitive detectors
5794 
5795  } // for auxiliary detector
5796 
5797  out << '\n';
5798 
5799 } // geo::GeometryCore::Print()
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:65
void PrintWireInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this wire.
Definition: WireGeo.h:596
void PrintTPCInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this TPC.
Definition: TPCGeo.h:789
WireGeo const & Wire(unsigned int iwire) const
Definition: PlaneGeo.cxx:506
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
Definition: AuxDetGeo.h:171
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
pdgs p
Definition: selectors.fcl:22
Geometry information for a single TPC.
Definition: TPCGeo.h:38
geo::BoxBoundedGeo DetectorEnclosureBox(std::string const &name="volDetEnclosure") const
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
enum geo::_plane_sigtype SigType_t
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
void PrintOpDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=0) const
Prints information about this optical detector.
Definition: OpDetGeo.h:296
size_t NSensitiveVolume() const
Definition: AuxDetGeo.h:172
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
void PrintAuxDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=0) const
Prints information about this auxiliary sensitive detector.
IteratorBox< cryostat_iterator,&GeometryCore::begin_cryostat,&GeometryCore::end_cryostat > IterateCryostats() const
Enables ranged-for loops on all cryostats of the detector.
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintAuxDetInfo().
void PrintPlaneInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this plane.
Definition: PlaneGeo.h:1539
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintOpDetInfo().
Definition: OpDetGeo.h:240
geo::PlaneID const & ID() const
Returns the identifier of this plane.
Definition: PlaneGeo.h:203
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintAuxDetInfo().
Definition: AuxDetGeo.h:215
unsigned int Nwires() const
Number of wires in this plane.
Definition: PlaneGeo.h:269
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintWireInfo().
Definition: WireGeo.h:338
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:263
static constexpr unsigned int MaxVerbosity
Maximum value for print verbosity.
Definition: PlaneGeo.h:802
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintTPCInfo().
Definition: TPCGeo.h:677
void PrintAuxDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this auxiliary detector.
Definition: AuxDetGeo.h:245
std::string SignalTypeName(geo::SigType_t sigType)
Returns the name of the specified signal type.
Definition: geo_types.cxx:19
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
std::string geo::GeometryCore::ROOTFile ( ) const
inline

Returns the full directory path to the geometry file source.

Returns
the full directory path to the geometry file source

This is the full path of the source of the detector geometry GeometryCore relies on.

Definition at line 1748 of file GeometryCore.h.

1748 { return fROOTfile; }
std::string fROOTfile
path to geometry file for geometry in GeometryCore
TGeoManager * geo::GeometryCore::ROOTGeoManager ( ) const

Access to the ROOT geometry description manager.

Definition at line 202 of file GeometryCore.cxx.

203  {
204  return gGeoManager;
205  }
std::vector< geo::TPCID > geo::GeometryCore::ROPtoTPCs ( readout::ROPID const &  ropid) const

Returns a list of ID of TPCs the specified ROP spans.

Parameters
ropidID of the readout plane
Returns
the list of TPC IDs, empty if readout plane ID is invalid

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

Definition at line 1839 of file GeometryCore.cxx.

1840  {
1841  return fChannelMapAlg->ROPtoTPCs(ropid);
1842  } // GeometryCore::ROPtoTPCs()
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
std::vector< geo::PlaneID > geo::GeometryCore::ROPtoWirePlanes ( readout::ROPID const &  ropid) const

Returns a list of ID of planes belonging to the specified ROP.

Parameters
ropidID of the readout plane
Returns
list of ID of wire planes belonging to the specified ROP

If ropid is an invalid ID, an empty list is returned. If ropid is a valid ID (i.e. an ID whose isValid flag is set) that points to a non-existent readout plane, the result is undefined. Use HasROP() to check if the readout plane actually exists.

Definition at line 1831 of file GeometryCore.cxx.

1832  {
1833  return fChannelMapAlg->ROPtoWirePlanes(ropid);
1834  } // GeometryCore::ROPtoWirePlanes()
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
void geo::GeometryCore::SetDetectorName ( std::string const &  new_name)
inlineprotected

Sets the detector name.

Definition at line 5488 of file GeometryCore.h.

5488 { fDetectorName = new_name; }
std::string fDetectorName
Name of the detector.
SigType_t geo::GeometryCore::SignalType ( geo::PlaneID const &  pid) const

Returns the type of signal on the channels of specified TPC plane.

Parameters
planeTPC plane ID
Returns
the type of signal on the specified plane, or geo::kMysteryType

Assumes that all the channels on the plane have the same signal type.

Todo:
verify that kMysteryType is returned on invalid plane

Definition at line 599 of file GeometryCore.cxx.

600  {
601  // map wire plane -> readout plane -> first channel,
602  // then use SignalType(channel)
603 
604  auto const ropid = WirePlaneToROP(pid);
605  if (!ropid.isValid) {
606  throw cet::exception("GeometryCore")
607  << "SignalType(): Mapping of wire plane " << std::string(pid)
608  << " to readout plane failed!\n";
609  }
610  return SignalType(ropid);
611 
612  } // GeometryCore::SignalType(PlaneID)
readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const
Returns the ID of the ROP planeid belongs to.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
SigType_t geo::GeometryCore::SignalType ( raw::ChannelID_t const  channel) const

Returns the type of signal on the specified TPC channel.

Parameters
channelTPC channel ID
Returns
the type of signal on the specified channel, or geo::kMysteryType
Todo:
verify that kMysteryType is returned on invalid channel

Definition at line 593 of file GeometryCore.cxx.

594  {
595  return fChannelMapAlg->SignalTypeForChannel(channel);
596  }
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
geo::SigType_t geo::GeometryCore::SignalType ( readout::ROPID const &  ropid) const

Returns the type of signal of channels in specified readout plane.

Parameters
ropidreadout plane ID
Returns
the type of signal on the specified ROP

Assumes that all the channels on the readout plane have the same signal type. If ropid is an invalid ID, geo::kMysteryType is returned. If ropid is a valid ID (i.e. an ID whose isValid flag is set) that points to a non-existent readout plane, the result is undefined. Use HasROP() to check if the readout plane actually exists.

Definition at line 1860 of file GeometryCore.cxx.

1860  {
1861  return fChannelMapAlg->SignalTypeForROPID(ropid);
1862  } // GeometryCore::SignalType(ROPID)
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
void geo::GeometryCore::SortGeometry ( geo::GeoObjectSorter const &  sorter)
private

Runs the sorting of geometry with the sorter provided by channel mapping.

Definition at line 168 of file GeometryCore.cxx.

169  {
170  mf::LogInfo("GeometryCore") << "Sorting volumes...";
171 
172  sorter.SortAuxDets(AuxDets());
173  sorter.SortCryostats(Cryostats());
174 
176  for (geo::CryostatGeo& cryo: Cryostats())
177  {
178  cryo.SortSubVolumes(sorter);
179  cryo.UpdateAfterSorting(geo::CryostatID(c));
180  ++c;
181  } // for
182 
183  } // GeometryCore::SortGeometry()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
AuxDetList_t & AuxDets()
Return the interfal auxiliary detectors list.
unsigned int CryostatID_t
Type for the ID number.
Definition: geo_types.h:191
CryostatList_t & Cryostats()
Return the internal cryostat list.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:190
geo::Length_t geo::GeometryCore::SurfaceY ( ) const
inline

The position of the detector respect to earth surface.

Returns
typical y position at surface in units of cm

This is the depth (y) of the surface (where earth meets air) for this detector site. The number is expressed in world coordinates and in centimetres, and it represents the y coordinate of earth surface. A negative value means that the origin of coordinates, typically matching the detector centre, is above surface.

Todo:
check that this is actually how it is used

Definition at line 1820 of file GeometryCore.h.

1820 { return fSurfaceY; }
double fSurfaceY
The point where air meets earth for this detector.
geo::PlaneID geo::GeometryCore::ThirdPlane ( geo::PlaneID const &  pid1,
geo::PlaneID const &  pid2 
) const

Returns the plane that is not in the specified arguments.

Parameters
pid1a plane
pid2another plane
Returns
the ID to the third plane
Exceptions
cet::exception(category: "GeometryCore") if other than 3 planes
cet::exception(category: "GeometryCore") if pid1 and pid2 match

This function requires a geometry with exactly three planes. If the two input planes are not on the same TPC, the result is undefined.

Definition at line 1571 of file GeometryCore.cxx.

1572  {
1573  // how many planes in the TPC pid1 belongs to:
1574  const unsigned int nPlanes = Nplanes(pid1);
1575  if(nPlanes != 3) {
1576  throw cet::exception("GeometryCore")
1577  << "ThirdPlane() supports only TPCs with 3 planes, and I see "
1578  << nPlanes << " instead\n";
1579  }
1580 
1581  geo::PlaneID::PlaneID_t target_plane = nPlanes;
1582  for (geo::PlaneID::PlaneID_t iPlane = 0; iPlane < nPlanes; ++iPlane){
1583  if ((iPlane == pid1.Plane) || (iPlane == pid2.Plane)) continue;
1584  if (target_plane != nPlanes) {
1585  throw cet::exception("GeometryCore")
1586  << "ThirdPlane() found too many planes that are not "
1587  << std::string(pid1) << " nor " << std::string(pid2)
1588  << "! (first " << target_plane << ", then " << iPlane << ")\n";
1589  } // if we had a target already
1590  target_plane = iPlane;
1591  } // for
1592  if (target_plane == nPlanes) {
1593  throw cet::exception("GeometryCore")
1594  << "ThirdPlane() can't find a plane that is not " << std::string(pid1)
1595  << " nor " << std::string(pid2) << "!\n";
1596  }
1597 
1598  return geo::PlaneID(pid1, target_plane);
1599  } // GeometryCore::ThirdPlane()
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:473
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
double geo::GeometryCore::ThirdPlane_dTdW ( geo::PlaneID const &  pid1,
double  slope1,
geo::PlaneID const &  pid2,
double  slope2,
geo::PlaneID const &  output_plane 
) const

Returns dT/dW on the third plane, given it in the other two.

Parameters
pid1ID of the plane of the first dT/dW
dTdW1dT/dW as seen on the first plane
pid2ID of the plane of the second dT/dW
dTdW2dT/dW as seen on the second plane
output_planeID of the plane on which to calculate the slope
Returns
dT/dW on the third plane, or -999. if dT/dW would be infinity
Exceptions
cet::exception(category: "GeometryCore") if different TPC
cet::exception(category: "GeometryCore") if same plane
cet::exception(category: "GeometryCore") if other than 3 planes

Given a dT/dW as projected in two planes, returns the dT/dW as projected in the third plane. The dT/dW are defined in time ticks/wide number units.

Definition at line 1648 of file GeometryCore.cxx.

1652  {
1653 
1654  CheckIndependentPlanesOnSameTPC(pid1, pid2, "ThirdPlane_dTdW()");
1655 
1656  geo::TPCGeo const& TPC = this->TPC(pid1);
1657 
1658  double angle[3], pitch[3];
1659  geo::PlaneGeo const* const planes[3]
1660  = { &TPC.Plane(pid1), &TPC.Plane(pid2), &TPC.Plane(output_plane) };
1661 
1662  // We need wire pitch and "wire coordinate direction" for each plane.
1663  // The latter is perpendicular to the wire orientation.
1664  // PlaneGeo::PhiZ() defines the right orientation too.
1665  for (size_t i = 0; i < 3; ++i) {
1666  angle[i] = planes[i]->PhiZ();
1667  pitch[i] = planes[i]->WirePitch();
1668  } // for
1669 
1670  return ComputeThirdPlane_dTdW(
1671  angle[0], pitch[0], slope1,
1672  angle[1], pitch[1], slope2,
1673  angle[2], pitch[2]
1674  );
1675 
1676  } // GeometryCore::ThirdPlane_dTdW()
static double ComputeThirdPlane_dTdW(double angle1, double pitch1, double dTdW1, double angle2, double pitch2, double dTdW2, double angle_target, double pitch_target)
Returns the slope on the third plane, given it in the other two.
Geometry information for a single TPC.
Definition: TPCGeo.h:38
double PhiZ() const
Angle from positive z axis of the wire coordinate axis, in radians.
Definition: PlaneGeo.h:193
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
BEGIN_PROLOG Z planes
static void CheckIndependentPlanesOnSameTPC(geo::PlaneID const &pid1, geo::PlaneID const &pid2, const char *caller)
finds tracks best matching by angle
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:263
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Definition: PlaneGeo.h:411
double geo::GeometryCore::ThirdPlane_dTdW ( geo::PlaneID const &  pid1,
double  slope1,
geo::PlaneID const &  pid2,
double  slope2 
) const

Returns dT/dW on the third plane, given it in the other two.

Parameters
pid1ID of the plane of the first dT/dW
dTdW1dT/dW as seen on the first plane
pid2ID of the plane of the second dT/dW
dTdW2dT/dW as seen on the second plane
Returns
dT/dW on the third plane, or -999. if dT/dW would be infinity
Exceptions
cet::exception(category: "GeometryCore") if different TPC
cet::exception(category: "GeometryCore") if same plane
cet::exception(category: "GeometryCore") if other than 3 planes

Given a dT/dW as projected in two planes, returns the dT/dW as projected in the third plane. This function is a shortcut assuming exactly three wire planes in the TPC, in which case the output plane is chosen as the one that is neither of the input planes.

Definition at line 1679 of file GeometryCore.cxx.

1682  {
1683  geo::PlaneID target_plane = ThirdPlane(pid1, pid2);
1684  return ThirdPlane_dTdW(pid1, slope1, pid2, slope2, target_plane);
1685  } // ThirdPlane_dTdW()
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
geo::PlaneID ThirdPlane(geo::PlaneID const &pid1, geo::PlaneID const &pid2) const
Returns the plane that is not in the specified arguments.
double ThirdPlane_dTdW(geo::PlaneID const &pid1, double slope1, geo::PlaneID const &pid2, double slope2, geo::PlaneID const &output_plane) const
Returns dT/dW on the third plane, given it in the other two.
double geo::GeometryCore::ThirdPlaneSlope ( geo::PlaneID const &  pid1,
double  slope1,
geo::PlaneID const &  pid2,
double  slope2,
geo::PlaneID const &  output_plane 
) const

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

Parameters
pid1ID of the plane of the first slope
slope1slope as seen on the first plane
pid2ID of the plane of the second slope
slope2slope as seen on the second plane
output_planeID of the plane on which to calculate the slope
Returns
the slope on the third plane, or -999. if slope would be infinity
Exceptions
cet::exception(category: "GeometryCore") if different TPC
cet::exception(category: "GeometryCore") if input planes match

Given a slope as projected in two planes, returns the slope as projected in the specified output plane. The slopes are defined in uniform units; they should be computed as distance ratios (or tangent of a geometrical angle; the formula is still valid using dt/dw directly in case of equal wire pitch in all planes and uniform drift velocity.

Definition at line 1618 of file GeometryCore.cxx.

1622  {
1623 
1624  CheckIndependentPlanesOnSameTPC(pid1, pid2, "ThirdPlaneSlope()");
1625 
1626  geo::TPCGeo const& TPC = this->TPC(pid1);
1627 
1628  // We need the "wire coordinate direction" for each plane.
1629  // This is perpendicular to the wire orientation.
1630  // PlaneGeo::PhiZ() defines the right orientation too.
1631  return ComputeThirdPlaneSlope(
1632  TPC.Plane(pid1).PhiZ(), slope1,
1633  TPC.Plane(pid2).PhiZ(), slope2,
1634  TPC.Plane(output_plane).PhiZ()
1635  );
1636  } // ThirdPlaneSlope()
Geometry information for a single TPC.
Definition: TPCGeo.h:38
double PhiZ() const
Angle from positive z axis of the wire coordinate axis, in radians.
Definition: PlaneGeo.h:193
static double ComputeThirdPlaneSlope(double angle1, double slope1, double angle2, double slope2, double angle_target)
Returns the slope on the third plane, given it in the other two.
static void CheckIndependentPlanesOnSameTPC(geo::PlaneID const &pid1, geo::PlaneID const &pid2, const char *caller)
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:263
double geo::GeometryCore::ThirdPlaneSlope ( geo::PlaneID const &  pid1,
double  slope1,
geo::PlaneID const &  pid2,
double  slope2 
) const

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

Parameters
pid1ID of the plane of the first slope
slope1slope as seen on the first plane
pid2ID of the plane of the second slope
slope2slope as seen on the second plane
Returns
the slope on the third plane, or -999. if slope would be infinity
Exceptions
cet::exception(category: "GeometryCore") if different TPC
cet::exception(category: "GeometryCore") if same plane
cet::exception(category: "GeometryCore") if other than 3 planes

Given a slope as projected in two planes, returns the slope as projected in the third plane. This function is a shortcut assuming exactly three wire planes in the TPC, in which case the output plane is chosen as the one that is neither of the input planes.

Definition at line 1639 of file GeometryCore.cxx.

1642  {
1643  geo::PlaneID target_plane = ThirdPlane(pid1, pid2);
1644  return ThirdPlaneSlope(pid1, slope1, pid2, slope2, target_plane);
1645  } // ThirdPlaneSlope()
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
double ThirdPlaneSlope(geo::PlaneID const &pid1, double slope1, geo::PlaneID const &pid2, double slope2, geo::PlaneID const &output_plane) const
Returns the slope on the third plane, given it in the other two.
geo::PlaneID ThirdPlane(geo::PlaneID const &pid1, geo::PlaneID const &pid2) const
Returns the plane that is not in the specified arguments.
double geo::GeometryCore::ThirdPlaneSlope ( geo::PlaneID::PlaneID_t  plane1,
double  slope1,
geo::PlaneID::PlaneID_t  plane2,
double  slope2,
geo::TPCID const &  tpcid 
) const
inline

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

Parameters
plane1index of the plane of the first slope
slope1slope as seen on the first plane
plane2index of the plane of the second slope
slope2slope as seen on the second plane
tpcidTPC where the two planes belong
Returns
the slope on the third plane, or -999. if slope would be infinity
Exceptions
cet::exception(category: "GeometryCore") if different TPC
cet::exception(category: "GeometryCore") if same plane
cet::exception(category: "GeometryCore") if other than 3 planes

Given a slope as projected in two planes, returns the slope as projected in the third plane.

Definition at line 4348 of file GeometryCore.h.

4351  {
4352  return ThirdPlaneSlope(
4353  geo::PlaneID(tpcid, plane1), slope1,
4354  geo::PlaneID(tpcid, plane2), slope2
4355  );
4356  }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
double ThirdPlaneSlope(geo::PlaneID const &pid1, double slope1, geo::PlaneID const &pid2, double slope2, geo::PlaneID const &output_plane) const
Returns the slope on the third plane, given it in the other two.
double geo::GeometryCore::ThirdPlaneSlope ( unsigned int  plane1,
double  slope1,
unsigned int  plane2,
double  slope2,
unsigned int  tpc,
unsigned int  cstat 
) const
inline

Definition at line 4357 of file GeometryCore.h.

4360  {
4361  return ThirdPlaneSlope
4362  (plane1, slope1, plane2, slope2, geo::TPCID(cstat, tpc));
4363  }
double ThirdPlaneSlope(geo::PlaneID const &pid1, double slope1, geo::PlaneID const &pid2, double slope2, geo::PlaneID const &output_plane) const
Returns the slope on the third plane, given it in the other two.
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
double geo::GeometryCore::TotalMass ( ) const
inline

Returns the total mass [kg] of the specified volume (default: world).

Definition at line 1899 of file GeometryCore.h.

1899 { return TotalMass(GetWorldVolumeName()); }
const std::string GetWorldVolumeName() const
Return the name of the world volume (needed by Geant4 simulation)
double TotalMass() const
Returns the total mass [kg] of the specified volume (default: world).
double geo::GeometryCore::TotalMass ( std::string  vol) const

Definition at line 1131 of file GeometryCore.cxx.

1132  {
1133  //the TGeoNode::GetVolume() returns the TGeoVolume of the detector outline
1134  //and ROOT calculates the mass in kg for you
1135  TGeoVolume *gvol = gGeoManager->FindVolumeFast(vol.c_str());
1136  if(gvol) return gvol->Weight();
1137 
1138  throw cet::exception("GeometryCore") << "could not find specified volume '"
1139  << vol
1140  << " 'to determine total mass\n";
1141  }
unsigned int geo::GeometryCore::TotalNTPC ( ) const

Returns the total number of TPCs in the detector.

Definition at line 917 of file GeometryCore.cxx.

917  {
918  // it looks like C++11 lambdas have made STL algorithms easier to use,
919  // but only so much:
920  return std::accumulate(Cryostats().begin(), Cryostats().end(), 0U,
921  [](unsigned int sum, geo::CryostatGeo const& cryo)
922  { return sum + cryo.NTPC(); }
923  );
924  } // GeometryCore::TotalNTPC()
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:181
auto begin(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:573
CryostatList_t & Cryostats()
Return the internal cryostat list.
TPCGeo const& geo::GeometryCore::TPC ( unsigned int const  tpc = 0,
unsigned int const  cstat = 0 
) const
inline

Returns the specified TPC.

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

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

Todo:
remove the version with integers

Definition at line 2431 of file GeometryCore.h.

2432  { return TPC(geo::TPCID(cstat, tpc)); }
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
TPCGeo const& geo::GeometryCore::TPC ( geo::TPCID const &  tpcid) const
inline

Definition at line 2433 of file GeometryCore.h.

2434  { return Cryostat(tpcid).TPC(tpcid); }
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
Definition: CryostatGeo.cxx:93
TPCGeo const* geo::GeometryCore::TPCPtr ( geo::TPCID const &  tpcid) const
inline

Returns the specified TPC.

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

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

Definition at line 2448 of file GeometryCore.h.

2449  {
2450  CryostatGeo const* pCryo = CryostatPtr(tpcid);
2451  return pCryo? pCryo->TPCPtr(tpcid): nullptr;
2452  } // TPCPtr()
CryostatGeo const * CryostatPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
std::vector< geo::TPCID > geo::GeometryCore::TPCsetToTPCs ( readout::TPCsetID const &  tpcsetid) const

Returns a list of ID of TPCs belonging to the specified TPC set.

Parameters
tpcsetidID of the TPC set to convert into TPC IDs
Returns
the list of TPCs, empty if TPC set is invalid

Note that the check is performed on the validity of the TPC set ID, that does not necessarily imply that the TPC set specified by the ID actually exists. Check the existence of the TPC set first (HasTPCset()). Behaviour on valid, non-existent TPC set IDs is undefined.

Definition at line 1795 of file GeometryCore.cxx.

1796  {
1797  return fChannelMapAlg->TPCsetToTPCs(tpcsetid);
1798  } // GeometryCore::TPCsetToTPCs()
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
readout::TPCsetID geo::GeometryCore::TPCtoTPCset ( geo::TPCID const &  tpcid) const

Returns the ID of the TPC set tpcid belongs to.

Definition at line 1787 of file GeometryCore.cxx.

1788  {
1789  return fChannelMapAlg->TPCtoTPCset(tpcid);
1790  } // GeometryCore::TPCtoTPCset()
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
void geo::GeometryCore::UpdateAfterSorting ( )
private

Performs all the updates needed after sorting.

Definition at line 187 of file GeometryCore.cxx.

187  {
188 
189  for (size_t c = 0; c < Ncryostats(); ++c)
190  Cryostats()[c].UpdateAfterSorting(geo::CryostatID(c));
191 
192  allViews.clear();
193  for (geo::TPCGeo const& tpc: IterateTPCs()) {
194  auto const& TPCviews = tpc.Views();
195  allViews.insert(TPCviews.cbegin(), TPCviews.cend());
196  }
197 
198  } // GeometryCore::UpdateAfterSorting()
Geometry information for a single TPC.
Definition: TPCGeo.h:38
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
std::set< geo::View_t > allViews
All views in the detector.
IteratorBox< TPC_iterator,&GeometryCore::begin_TPC,&GeometryCore::end_TPC > IterateTPCs() const
Enables ranged-for loops on all TPCs of the detector.
CryostatList_t & Cryostats()
Return the internal cryostat list.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:190
bool geo::GeometryCore::ValueInRange ( double  value,
double  min,
double  max 
) const

Returns whether a value is within the specified range.

Parameters
valuethe value to be tested
minthe lower boundary
maxthe upper boundary
Returns
whether the value is within range

If min is larger than max, they are swapped. A tolerance of 10^-6 (absolute) is used.

Todo:

Use wiggle instead of 10^-6

resort source code for a bit of speed up

Definition at line 1323 of file GeometryCore.cxx.

1324  {
1325  if(min>max) std::swap(min,max);//protect against funny business due to wire angles
1326  if (std::abs(value-min)<1e-6||std::abs(value-max)<1e-6) return true;
1327  return (value>=min) && (value<=max);
1328  }
T abs(T value)
do i e
temporary value
View_t geo::GeometryCore::View ( geo::PlaneID const &  pid) const

Returns the view (wire orientation) on the channels of specified TPC plane.

Parameters
planeTPC plane ID
Returns
the type of signal on the specified plane, or geo::kUnknown

Definition at line 622 of file GeometryCore.cxx.

623  {
624  return pid? Plane(pid).View(): geo::kUnknown;
625  }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
Unknown view.
Definition: geo_types.h:136
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:184
View_t geo::GeometryCore::View ( raw::ChannelID_t const  channel) const

Returns the view (wire orientation) on the specified TPC channel.

Parameters
channelTPC channel ID
Returns
the type of signal on the specified channel, or geo::kUnknown

The view of the readout plane channel belongs to is returned, as in View(readout::ROPID const&) const.

Definition at line 616 of file GeometryCore.cxx.

616  {
617  return (channel == raw::InvalidChannelID)
618  ? geo::kUnknown: View(ChannelToROP(channel));
619  } // GeometryCore::View()
Unknown view.
Definition: geo_types.h:136
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:32
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
readout::ROPID ChannelToROP(raw::ChannelID_t channel) const
geo::View_t geo::GeometryCore::View ( readout::ROPID const &  ropid) const

Returns the view of the channels in the specified readout plane.

Parameters
ropidreadout plane ID
Returns
the type of signal on the specified ROP

Returns the view (wire orientation) on the channels of specified readout plane. If ropid is an invalid ID, geo::kUnknown is returned. If ropid is a valid ID (i.e. an ID whose isValid flag is set) that points to a non-existent readout plane, the result is undefined. Use HasROP() to check if the readout plane actually exists.

Definition at line 1854 of file GeometryCore.cxx.

1854  {
1855  return View(fChannelMapAlg->FirstWirePlaneInROP(ropid));
1856  } // GeometryCore::View()
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
std::set<geo::View_t> const& geo::GeometryCore::Views ( ) const
inline

Returns a list of possible views in the detector.

Returns
the set of views

Definition at line 4706 of file GeometryCore.h.

4706 { return allViews; }
std::set< geo::View_t > allViews
All views in the detector.
std::string geo::GeometryCore::VolumeName ( geo::Point_t const &  point) const

Returns the name of the deepest volume containing specified point.

Parameters
pointthe location to query, in world coordinates
Returns
name of the volume containing the point
Todo:

what happens if none?

Unify the coordinates type

Definition at line 1029 of file GeometryCore.cxx.

1030  {
1031  // check that the given point is in the World volume at least
1032  TGeoVolume const*volWorld = WorldVolume();
1033  double halflength = ((TGeoBBox*)volWorld->GetShape())->GetDZ();
1034  double halfheight = ((TGeoBBox*)volWorld->GetShape())->GetDY();
1035  double halfwidth = ((TGeoBBox*)volWorld->GetShape())->GetDX();
1036  if(std::abs(point.x()) > halfwidth ||
1037  std::abs(point.y()) > halfheight ||
1038  std::abs(point.z()) > halflength
1039  ){
1040  mf::LogWarning("GeometryCoreBadInputPoint") << "point (" << point.x() << ","
1041  << point.y() << "," << point.z() << ") "
1042  << "is not inside the world volume "
1043  << " half width = " << halfwidth
1044  << " half height = " << halfheight
1045  << " half length = " << halflength
1046  << " returning unknown volume name";
1047  const std::string unknown("unknownVolume");
1048  return unknown;
1049  }
1050 
1051  return gGeoManager->FindNode(point.X(), point.Y(), point.Z())->GetName();
1052  }
TGeoVolume const * WorldVolume() const
Returns a pointer to the world volume.
T abs(T value)
process_name showerreco Particles Coinciding wih the Vertex services ScanOptions nu_mu unknown
std::string geo::GeometryCore::VolumeName ( TVector3 const &  point) const
inline

Definition at line 1850 of file GeometryCore.h.

1851  { return VolumeName(geo::vect::toPoint(point)); }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
std::string VolumeName(geo::Point_t const &point) const
Returns the name of the deepest volume containing specified point.
WireGeo const& geo::GeometryCore::Wire ( geo::WireID const &  wireid) const
inline

Returns the specified wire.

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

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

Definition at line 3422 of file GeometryCore.h.

3423  { return Plane(wireid).Wire(wireid); }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
WireGeo const & Wire(unsigned int iwire) const
Definition: PlaneGeo.cxx:506
double geo::GeometryCore::WireAngleToVertical ( geo::View_t  view,
geo::TPCID const &  tpcid 
) const

Returns the angle of the wires in the specified view from vertical.

Parameters
viewthe view
TPCthe index of the TPC in the specified cryostat
Cryothe cryostat
tpcidID of the TPC
Returns
the angle [radians]
Exceptions
cet::exception("GeometryCore" category) if no such view

The angle is defined as in WireGeo::ThetaZ().

This method assumes all wires in the view have the same angle (it queries for the first).

Deprecated:
This does not feel APA-ready

Definition at line 892 of file GeometryCore.cxx.

893  {
894  // loop over the planes in cryostat 0, tpc 0 to find the plane with the
895  // specified view
896  geo::TPCGeo const& TPC = this->TPC(tpcid);
897  for (unsigned int p = 0; p < TPC.Nplanes(); ++p) {
898  geo::PlaneGeo const& plane = TPC.Plane(p);
899  if (plane.View() == view) return plane.ThetaZ();
900  } // for
901  throw cet::exception("GeometryCore") << "WireAngleToVertical(): no view \""
902  << geo::PlaneGeo::ViewName(view) << "\" (#" << ((int) view)
903  << ") in " << std::string(tpcid);
904  } // GeometryCore::WireAngleToVertical()
static std::string ViewName(geo::View_t view)
Returns the name of the specified view.
Definition: PlaneGeo.cxx:763
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
pdgs p
Definition: selectors.fcl:22
Geometry information for a single TPC.
Definition: TPCGeo.h:38
double ThetaZ() const
Angle of the wires from positive z axis; .
Definition: PlaneGeo.cxx:726
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:184
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:263
double geo::GeometryCore::WireAngleToVertical ( geo::View_t  view,
int  TPC = 0,
int  Cryo = 0 
) const
inline

Definition at line 3801 of file GeometryCore.h.

3802  { return WireAngleToVertical(view, geo::TPCID(Cryo, TPC)); }
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
double WireAngleToVertical(geo::View_t view, geo::TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
geo::Length_t geo::GeometryCore::WireCoordinate ( double  YPos,
double  ZPos,
geo::PlaneID const &  planeid 
) const

Returns the index of the nearest wire to the specified position.

Parameters
YPosy coordinate on the wire plane
ZPosz coordinate on the wire plane
planeidID of the plane
Returns
an index interpolation between the two nearest wires
Deprecated:
Use WireCoordinate(geo::Point_t const&, geo::PlaneID const&) instead

Respect to NearestWireID(), this method returns a real number, representing a continuous coordinate in the wire axis, with the round values corresponding to the actual wires.

Todo:
Unify (y, z) coordinate

Definition at line 1217 of file GeometryCore.cxx.

1218  {
1219  return fChannelMapAlg->WireCoordinate(YPos, ZPos, planeid);
1220  }
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
geo::Length_t geo::GeometryCore::WireCoordinate ( double  YPos,
double  ZPos,
unsigned int  PlaneNo,
unsigned int  TPCNo,
unsigned int  cstat 
) const
inline

Returns the index of the nearest wire to the specified position.

Parameters
YPosy coordinate on the wire plane
ZPosz coordinate on the wire plane
PlaneNonumber of plane
TPCNonumber of TPC
cstatnumber of cryostat
Returns
an index interpolation between the two nearest wires
See Also
ChannelMapAlg::WireCoordinate()
Deprecated:
Use the version with plane ID instead

Definition at line 4060 of file GeometryCore.h.

4064  { return WireCoordinate(YPos, ZPos, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
geo::Length_t WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
geo::Length_t geo::GeometryCore::WireCoordinate ( geo::Point_t const &  pos,
geo::PlaneID const &  planeid 
) const

Returns the index of the nearest wire to the specified position.

Parameters
posworld coordinates of the position (it will be projected)
planeidID of the plane
Returns
an index interpolation between the two nearest wires
See Also
ChannelMapAlg::WireCoordinate()

Respect to NearestWireID(), this method returns a real number, representing a continuous coordinate in the wire axis, with the round values corresponding to the actual wires.

Definition at line 1210 of file GeometryCore.cxx.

1211  {
1212  return Plane(planeid).WireCoordinate(pos);
1213  }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
double WireCoordinate(Point const &point) const
Returns the coordinate of the point on the plane, in wire units.
Definition: PlaneGeo.h:882
geo::Length_t geo::GeometryCore::WireCoordinate ( TVector3 const &  pos,
geo::PlaneID const &  planeid 
) const
inline

Definition at line 4081 of file GeometryCore.h.

4082  { return WireCoordinate(geo::vect::toPoint(pos), planeid); }
geo::Length_t WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
void geo::GeometryCore::WireEndPoints ( geo::WireID const &  wireid,
double *  xyzStart,
double *  xyzEnd 
) const

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

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

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

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

Definition at line 1332 of file GeometryCore.cxx.

1333  {
1334  Segment_t result = WireEndPoints(wireid);
1335 
1336  xyzStart[0] = result.start().X();
1337  xyzStart[1] = result.start().Y();
1338  xyzStart[2] = result.start().Z();
1339  xyzEnd[0] = result.end().X();
1340  xyzEnd[1] = result.end().Y();
1341  xyzEnd[2] = result.end().Z();
1342 
1343  if(xyzEnd[2]<xyzStart[2]){
1344  //ensure that "End" has higher z-value than "Start"
1345  std::swap(xyzStart[0],xyzEnd[0]);
1346  std::swap(xyzStart[1],xyzEnd[1]);
1347  std::swap(xyzStart[2],xyzEnd[2]);
1348  }
1349  if(xyzEnd[1]<xyzStart[1] && std::abs(xyzEnd[2]-xyzStart[2])<0.01){
1350  // if wire is vertical ensure that "End" has higher y-value than "Start"
1351  std::swap(xyzStart[0],xyzEnd[0]);
1352  std::swap(xyzStart[1],xyzEnd[1]);
1353  std::swap(xyzStart[2],xyzEnd[2]);
1354  }
1355 
1356  } // GeometryCore::WireEndPoints(WireID, 2x double*)
T abs(T value)
Segment< DefaultPoint_t > Segment_t
void WireEndPoints(geo::WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
void geo::GeometryCore::WireEndPoints ( unsigned int  cstat,
unsigned int  tpc,
unsigned int  plane,
unsigned int  wire,
double *  xyzStart,
double *  xyzEnd 
) const
inline

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

Parameters
cstatcryostat number
tpctpc number within the cryostat
planeplane number within the TPC
wirewire number within the plane
xyzStart(output) an array with the start coordinate
xyzEnd(output) an array with the end coordinate
Exceptions
cet::exceptionwire not present

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

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

Definition at line 3855 of file GeometryCore.h.

3859  { WireEndPoints(geo::WireID(cstat, tpc, plane, wire), xyzStart, xyzEnd); }
void WireEndPoints(geo::WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
template<typename Point >
Segment<Point> geo::GeometryCore::WireEndPoints ( geo::WireID const &  wireID) const

Returns a segment whose ends are the wire end points.

Parameters
wireidID of the wire
Returns
a segment whose ends are the wire end points
Exceptions
cet::exceptionwire not present

The start and end are assigned as returned from the geo::WireGeo object. The rules for this assignment are documented in that class.

Deprecated:
use the wire ID interface instead (but note that it does not sort the ends)
geo::GeometryCore::Segment< Point > geo::GeometryCore::WireEndPoints ( geo::WireID const &  wireID) const
inline

Definition at line 3876 of file GeometryCore.h.

3877  { return WireEndPoints<DefaultPoint_t>(wireID); }
bool geo::GeometryCore::WireIDIntersectionCheck ( const geo::WireID wid1,
const geo::WireID wid2 
) const
private

Wire ID check for WireIDsIntersect methods.

Definition at line 1973 of file GeometryCore.cxx.

1974  {
1975  if (wid1.asTPCID() != wid2) {
1976  mf::LogError("WireIDIntersectionCheck")
1977  << "Comparing two wires on different TPCs: return failure.";
1978  return false;
1979  }
1980  if (wid1.Plane == wid2.Plane) {
1981  mf::LogError("WireIDIntersectionCheck")
1982  << "Comparing two wires in the same plane: return failure";
1983  return false;
1984  }
1985  if (!HasWire(wid1)) {
1986  mf::LogError("WireIDIntersectionCheck")
1987  << "1st wire " << wid1 << " does not exist (max wire number: "
1988  << Nwires(wid1.planeID()) << ")";
1989  return false;
1990  }
1991  if (!HasWire(wid2)) {
1992  mf::LogError("WireIDIntersectionCheck")
1993  << "2nd wire " << wid2 << " does not exist (max wire number: "
1994  << Nwires(wid2.planeID()) << ")";
1995  return false;
1996  }
1997  return true;
1998  } // GeometryCore::WireIDIntersectionCheck()
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
constexpr TPCID const & asTPCID() const
Conversion to TPCID (for convenience of notation).
Definition: geo_types.h:446
constexpr PlaneID const & planeID() const
Definition: geo_types.h:638
bool HasWire(geo::WireID const &wireid) const
Returns whether we have the specified wire.
bool geo::GeometryCore::WireIDsIntersect ( WireID const &  wid1,
WireID const &  wid2,
geo::Point_t intersection 
) const

Computes the intersection between two wires.

Parameters
wid1ID of the first wire
wid2ID of the other wire
[out]intersectionthe intersection point (global coordinates)
Returns
whether an intersection was found inside the TPC the wires belong
See Also
geo::WiresIntersection(), geo::LineClosestPoint()

The wires identified by wid1 and wid2 are intersected, and the 3D intersection point is written into the intersection parameter. The "intersection" point is actually the point belonging to the first wire (wid2) which is the closest (in Euclidean 3D metric) to the second wire.

The intersection is computed only if the wires belong to different planes of the same TPC. If that is not the case (i.e. they belong to different TPC or cryostat, or if they belong to the same plane), false is returned and intersection is set with all components to infinity (std::numeric_limits<>::infinity()).

When the intersection is computed, it is always stored in the intersection output parameter. Return value is true if this intersection lies within the physical boundaries first wire, while it is instead false if it lies on the extrapolation of the wire direction, but not within the wire physical extension.

To test that the result is not infinity (nor NaN), use geo::vect::isfinite(intersection) etc.

Note
If geo::WireGeo objects are already available, using instead the free function geo::WiresIntersection() or the method geo::WireGeo::IntersectionWith() is faster (and recommended). For purely geometric intersection, geo::LineClosestPoint() is also available.

Definition at line 1512 of file GeometryCore.cxx.

1517  {
1518  //
1519  // This is not a real 3D intersection: the wires do not cross, since they
1520  // are required to belong to two different planes.
1521  //
1522  // After Christopher Backhouse suggestion, we take the point on the first
1523  // wire which is closest to the other one.
1524  //
1525  //
1526  static_assert(
1527  std::numeric_limits<decltype(intersection.X())>::has_infinity,
1528  "the vector coordinate type can't represent infinity!"
1529  );
1530  constexpr auto infinity
1531  = std::numeric_limits<decltype(intersection.X())>::infinity();
1532 
1533  if (!WireIDIntersectionCheck(wid1, wid2)) {
1534  intersection = { infinity, infinity, infinity };
1535  return false;
1536  }
1537 
1538  geo::WireGeo const& wire1 = Wire(wid1);
1539  geo::WireGeo const& wire2 = Wire(wid2);
1540 
1541  // distance of the intersection point from the center of the two wires:
1543  = geo::WiresIntersectionAndOffsets(wire1, wire2);
1544  intersection = intersectionAndOffset.point;
1545 
1546  bool const within = (
1547  (std::abs(intersectionAndOffset.offset1) <= wire1.HalfL())
1548  && (std::abs(intersectionAndOffset.offset2) <= wire2.HalfL())
1549  );
1550 
1551  // return whether the intersection is within the length of both wires
1552  return within;
1553 
1554  } // GeometryCore::WireIDsIntersect(Point3D_t)
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:65
double offset2
Distance from reference point of second line.
T abs(T value)
bool WireIDIntersectionCheck(const geo::WireID &wid1, const geo::WireID &wid2) const
Wire ID check for WireIDsIntersect methods.
Point point
Intersection point.
double HalfL() const
Returns half the length of the wire [cm].
Definition: WireGeo.h:128
WireGeo const & Wire(geo::WireID const &wireid) const
Returns the specified wire.
Data structure for return values of LineClosestPointAndOffsets().
double offset1
Distance from reference point of first line.
geo::IntersectionPointAndOffsets< geo::Point_t > WiresIntersectionAndOffsets(geo::WireGeo const &wireA, geo::WireGeo const &wireB)
Returns the point of wireA that is closest to wireB.
Definition: WireGeo.h:668
bool geo::GeometryCore::WireIDsIntersect ( WireID const &  wid1,
WireID const &  wid2,
TVector3 &  intersection 
) const

Definition at line 1559 of file GeometryCore.cxx.

1561  {
1562  geo::Point_t p;
1563  bool res = WireIDsIntersect(wid1, wid2, p);
1564  intersection = geo::vect::toTVector3(p);
1565  return res;
1566  } // GeometryCore::WireIDsIntersect(TVector3)
pdgs p
Definition: selectors.fcl:22
bool WireIDsIntersect(WireID const &wid1, WireID const &wid2, geo::Point_t &intersection) const
Computes the intersection between two wires.
TVector3 toTVector3(Vector const &v)
Converts a vector into a TVector3.
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:184
bool geo::GeometryCore::WireIDsIntersect ( WireID const &  wid1,
WireID const &  wid2,
geo::WireIDIntersection widIntersect 
) const

Computes the intersection between two wires.

Parameters
wid1ID of the first wire
wid2ID of the other wire
widIntersect(output) the coordinate of the intersection point
Returns
whether an intersection was found within the TPC

The "intersection" refers to the projection of the wires into the same $ x = 0 $ plane. Wires are assumed to have at most one intersection. If wires are parallel, widIntersect will have the two components set to infinity (std::numeric_limits<>::infinity()) and the TPC number set to invalid (geo::TPCID::InvalidID). Also, false is returned. If the intersection is outside the TPC, false is also returned, but the widIntersect will contain the coordinates of that intersection. The TPC number is still set to invalid, although the intersection might belong to a valid TPC somewhere else.

Deprecated:
This method uses arbitrary assumptions and should not be used. Use the interface returning a full vector instead.

Definition at line 1463 of file GeometryCore.cxx.

1466  {
1467 
1468  static_assert(
1469  std::numeric_limits<decltype(widIntersect.y)>::has_infinity,
1470  "the vector coordinate type can't represent infinity!"
1471  );
1472  constexpr auto infinity
1473  = std::numeric_limits<decltype(widIntersect.y)>::infinity();
1474 
1475  if (!WireIDIntersectionCheck(wid1, wid2)) {
1476  widIntersect.y = widIntersect.z = infinity;
1477  widIntersect.TPC = geo::TPCID::InvalidID;
1478  return false;
1479  }
1480 
1481  // get the endpoints to see if wires intersect
1482  Segment_t const w1 = WireEndPoints(wid1);
1483  Segment_t const w2 = WireEndPoints(wid2);
1484 
1485  // TODO extract the coordinates in the right way;
1486  // is it any worth, since then the result is in (y, z), whatever it means?
1487  bool const cross = IntersectLines(
1488  w1.start()[1], w1.start()[2], w1.end()[1], w1.end()[2],
1489  w2.start()[1], w2.start()[2], w2.end()[1], w2.end()[2],
1490  widIntersect.y, widIntersect.z
1491  );
1492  if (!cross) {
1493  widIntersect.y = widIntersect.z = infinity;
1494  widIntersect.TPC = geo::TPCID::InvalidID;
1495  return false;
1496  }
1497  bool const within = PointWithinSegments(
1498  w1.start()[1], w1.start()[2], w1.end()[1], w1.end()[2],
1499  w2.start()[1], w2.start()[2], w2.end()[1], w2.end()[2],
1500  widIntersect.y, widIntersect.z
1501  );
1502 
1503  widIntersect.TPC = (within? wid1.TPC: geo::TPCID::InvalidID);
1504 
1505  // return whether the intersection is within the length of both wires
1506  return within;
1507 
1508  } // GeometryCore::WireIDsIntersect(WireIDIntersection)
double z
z position of intersection
Definition: geo_types.h:805
static constexpr TPCID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:403
unsigned int TPC
TPC of intersection.
Definition: geo_types.h:806
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 WireIDIntersectionCheck(const geo::WireID &wid1, const geo::WireID &wid2) const
Wire ID check for WireIDsIntersect methods.
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.
double y
y position of intersection
Definition: geo_types.h:804
Segment< DefaultPoint_t > Segment_t
void WireEndPoints(geo::WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
Vector cross(Vector const &a, Vector const &b)
Return cross product of two vectors.
WireGeo const& geo::GeometryCore::WireIDToWireGeo ( geo::WireID const &  wireid) const
inline

Definition at line 3424 of file GeometryCore.h.

3425  { return Wire(wireid); }
WireGeo const & Wire(geo::WireID const &wireid) const
Returns the specified wire.
geo::Length_t geo::GeometryCore::WirePitch ( geo::PlaneID const &  planeid) const

Returns the distance between two consecutive wires.

Parameters
pplane number within the TPC
tpctpc number within the cryostat
cstatcryostat number
Returns
the distance between the two wires
Note
The current geometry assumptions imply that wire pitch is constant between all wires on the same wire plane. This is an assumption non-trivial to remove.
Todo:

add a version with wire IDs

deprecate this function

document what will happen (in the future methods) with wires on different planes

Definition at line 873 of file GeometryCore.cxx.

874  {
875  return Plane(planeid).WirePitch();
876  }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Definition: PlaneGeo.h:411
geo::Length_t geo::GeometryCore::WirePitch ( unsigned int  plane = 0,
unsigned int  tpc = 0,
unsigned int  cstat = 0 
) const
inline

Definition at line 3762 of file GeometryCore.h.

3765  { return WirePitch(geo::PlaneID(cstat, tpc, plane)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
geo::Length_t geo::GeometryCore::WirePitch ( geo::View_t  view) const

Returns the distance between two wires in the specified view.

Parameters
w1index of the first wire
w2index of the second wire
pplane number within the TPC
tpctpc number within the cryostat
cstatcryostat number
Returns
the distance between the two wires

This method assumes that all the wires on all the planes on the specified view of all TPCs have the same pitch.

Definition at line 881 of file GeometryCore.cxx.

882  {
883  // look in cryostat 0, tpc 0 to find the plane with the
884  // specified view
885  return TPC({ 0, 0 }).Plane(view).WirePitch();
886  }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Definition: PlaneGeo.h:411
readout::ROPID geo::GeometryCore::WirePlaneToROP ( geo::PlaneID const &  planeid) const

Returns the ID of the ROP planeid belongs to.

Parameters
planeidID of the wire plane
Returns
the ID of the ROP planeid belongs to

If planeid is an invalid ID, an invalid ROP ID is returned. If planeid is a valid ID (i.e. an ID whose isValid flag is set) that points to a non-existent wire plane, the result is undefined. Use HasPlaneID() to check if the wire plane actually exists.

Definition at line 1823 of file GeometryCore.cxx.

1824  {
1825  return fChannelMapAlg->WirePlaneToROP(planeid);
1826  } // GeometryCore::WirePlaneToROP()
std::unique_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
WireGeo const* geo::GeometryCore::WirePtr ( geo::WireID const &  wireid) const
inline

Returns the specified wire.

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

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

Definition at line 3403 of file GeometryCore.h.

3404  {
3405  geo::PlaneGeo const* pPlane = PlanePtr(wireid);
3406  return pPlane? pPlane->WirePtr(wireid): nullptr;
3407  } // WirePtr()
geo::WirePtr WirePtr(unsigned int iwire) const
Returns the wire number iwire from this plane.
Definition: PlaneGeo.h:324
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:82
void geo::GeometryCore::WorldBox ( double *  xlo,
double *  xhi,
double *  ylo,
double *  yhi,
double *  zlo,
double *  zhi 
) const

Fills the arguments with the boundaries of the world.

Parameters
xlo(output) pointer to the lower x coordinate
xlo(output) pointer to the upper x coordinate
ylo(output) pointer to the lower y coordinate
ylo(output) pointer to the upper y coordinate
zlo(output) pointer to the lower z coordinate
zlo(output) pointer to the upper z coordinate
Exceptions
cet::exception("GeometryCore" category) if no world found
See Also
GetWorldVolumeName()

This method fills the boundaries of the world volume (GetWorldVolumeName()).

If a pointer is null, its coordinate is skipped.

Deprecated:
Use the version without arguments instead.

Definition at line 1015 of file GeometryCore.cxx.

1018  {
1019  geo::BoxBoundedGeo const box = WorldBox();
1020  if (xlo) *xlo = box.MinX();
1021  if (ylo) *ylo = box.MinY();
1022  if (zlo) *zlo = box.MinZ();
1023  if (xhi) *xhi = box.MaxX();
1024  if (yhi) *yhi = box.MaxY();
1025  if (zhi) *zhi = box.MaxZ();
1026  }
double MinX() const
Returns the world x coordinate of the start of the box.
Definition: BoxBoundedGeo.h:88
double MaxX() const
Returns the world x coordinate of the end of the box.
Definition: BoxBoundedGeo.h:91
double MinZ() const
Returns the world z coordinate of the start of the box.
double MaxY() const
Returns the world y coordinate of the end of the box.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:33
double MaxZ() const
Returns the world z coordinate of the end of the box.
double MinY() const
Returns the world y coordinate of the start of the box.
geo::BoxBoundedGeo WorldBox() const
geo::BoxBoundedGeo geo::GeometryCore::WorldBox ( ) const

Returns a box with the extremes of the world volume (from shape axes).

See Also
GetWorldVolumeName()

Definition at line 992 of file GeometryCore.cxx.

992  {
993 
994  TGeoVolume const* world = WorldVolume();
995  if(!world) {
996  throw cet::exception("GeometryCore")
997  << "no world volume '" << GetWorldVolumeName() << "'\n";
998  }
999  TGeoShape const* s = world->GetShape();
1000  if(!s) {
1001  throw cet::exception("GeometryCore")
1002  << "world volume '" << GetWorldVolumeName() << "' is shapeless!!!\n";
1003  }
1004 
1005  double x1, x2, y1, y2, z1, z2;
1006  s->GetAxisRange(1, x1, x2);
1007  s->GetAxisRange(2, y1, y2);
1008  s->GetAxisRange(3, z1, z2);
1009 
1010  // geo::BoxBoundedGeo constructor will sort the coordinates as needed
1011  return geo::BoxBoundedGeo{ x1, x2, y1, y2, z1, z2 };
1012  } // GeometryCore::WorldBox()
const std::string GetWorldVolumeName() const
Return the name of the world volume (needed by Geant4 simulation)
TGeoVolume const * WorldVolume() const
Returns a pointer to the world volume.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:33
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
TGeoVolume const * geo::GeometryCore::WorldVolume ( ) const

Returns a pointer to the world volume.

Definition at line 987 of file GeometryCore.cxx.

987  {
988  return gGeoManager->FindVolumeFast(GetWorldVolumeName().c_str());
989  }
const std::string GetWorldVolumeName() const
Return the name of the world volume (needed by Geant4 simulation)

Member Data Documentation

std::set<geo::View_t> geo::GeometryCore::allViews
private

All views in the detector.

Definition at line 5525 of file GeometryCore.h.

lar::util::RealComparisons< geo::Length_t > geo::GeometryCore::coordIs { 1e-8 }
static

Value of tolerance for equality comparisons.

Definition at line 1521 of file GeometryCore.h.

fhicl::ParameterSet geo::GeometryCore::fBuilderParameters
private

Configuration for the geometry builder (needed since builder is created after construction).

Definition at line 5520 of file GeometryCore.h.

std::unique_ptr<const geo::ChannelMapAlg> geo::GeometryCore::fChannelMapAlg
private

Object containing the channel to wire mapping.

Definition at line 5521 of file GeometryCore.h.

std::string geo::GeometryCore::fDetectorName
private

Name of the detector.

Definition at line 5511 of file GeometryCore.h.

std::string geo::GeometryCore::fGDMLfile
private

path to geometry file used for Geant4 simulation

Definition at line 5512 of file GeometryCore.h.

GeometryData_t geo::GeometryCore::fGeoData
private

The detector description data.

Definition at line 5508 of file GeometryCore.h.

double geo::GeometryCore::fMinWireZDist
private

Minimum distance in Z from a point in which to look for the closest wire

Definition at line 5514 of file GeometryCore.h.

double geo::GeometryCore::fPositionWiggle
private

accounting for rounding errors when testing positions

Definition at line 5516 of file GeometryCore.h.

std::string geo::GeometryCore::fROOTfile
private

path to geometry file for geometry in GeometryCore

Definition at line 5513 of file GeometryCore.h.

double geo::GeometryCore::fSurfaceY
private

The point where air meets earth for this detector.

Definition at line 5510 of file GeometryCore.h.

constexpr std::size_t geo::GeometryCore::MaxWireDepthInGDML = 20U
static

Wires must be found in GDML description within this number of nested volumes.

Definition at line 1518 of file GeometryCore.h.


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