LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
geo::GeometryCore Class Reference

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

#include "GeometryCore.h"

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

Classes

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

Public Types

using Segment_t = Segment< Point_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...
 

Public Member Functions

 GeometryCore (fhicl::ParameterSet const &pset)
 Initialize geometry from a given configuration. 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 const & ROOTFile () const
 Returns the full directory path to the geometry file source. More...
 
std::string const & 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 (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...
 
CryostatGeo const * PositionToCryostatPtr (Point_t const &point) const
 Returns the cryostat at specified location. More...
 
CryostatID PositionToCryostatID (Point_t const &point) const
 Returns the ID of the cryostat at specified location. More...
 
bool HasTPC (TPCID const &tpcid) const
 Returns whether we have the specified TPC. More...
 
bool HasElement (TPCID const &tpcid) const
 Returns whether we have the specified TPC. More...
 
TPCGeo const * PositionToTPCptr (Point_t const &point) const
 Returns the TPC at specified location. More...
 
TPCID PositionToTPCID (Point_t const &point) const
 Returns the ID of the TPC at specified location. More...
 
void GetBeginID (TPCID &id) const
 Initializes the specified ID with the ID of the first TPC. More...
 
void GetEndID (TPCID &id) const
 Initializes the specified ID with the invalid ID after the last TPC. More...
 
bool IncrementID (TPCID &id) const
 
TPCID GetBeginTPCID (CryostatID const &id) const
 Returns the ID of the first TPC in the specified cryostat. More...
 
TPCID GetEndTPCID (CryostatID const &id) const
 
unsigned int Nviews () const
 Returns the number of views (different wire orientations) More...
 
void GetBeginID (PlaneID &id) const
 Initializes the specified ID with the ID of the first plane. More...
 
void GetEndID (PlaneID &id) const
 Initializes the specified ID with the invalid ID after the last plane. More...
 
bool IncrementID (PlaneID &id) const
 
PlaneID GetBeginPlaneID (CryostatID const &id) const
 Returns the ID of the first plane of the specified cryostat. More...
 
PlaneID GetEndPlaneID (CryostatID const &id) const
 
PlaneID GetBeginPlaneID (TPCID const &id) const
 Returns the ID of the first plane of the specified TPC. More...
 
PlaneID GetEndPlaneID (TPCID const &id) const
 
View_t View (PlaneID const &pid) const
 Returns the view (wire orientation) on the channels of specified TPC plane. More...
 
SigType_t SignalType (PlaneID const &pid) const
 Returns the type of signal on the channels of specified TPC plane. More...
 
void GetBeginID (WireID &id) const
 Initializes the specified ID with the ID of the first wire. More...
 
void GetEndID (WireID &id) const
 Initializes the specified ID with the invalid ID after the last wire. More...
 
bool IncrementID (WireID &id) const
 
WireID GetBeginWireID (CryostatID const &id) const
 Returns the ID of the first wire in the specified cryostat. More...
 
WireID GetEndWireID (CryostatID const &id) const
 
WireID GetBeginWireID (TPCID const &id) const
 Returns the ID of the first wire of the specified TPC. More...
 
WireID GetEndWireID (TPCID const &id) const
 
WireID GetBeginWireID (PlaneID const &id) const
 Returns the ID of the first wire of the specified wire plane. More...
 
WireID GetEndWireID (PlaneID const &id) const
 
Length_t WirePitch (View_t view) const
 Returns the distance between two wires in the specified view. More...
 
WireID NearestWireID (Point_t const &point, PlaneID const &planeid) const
 Returns the ID of wire closest to position in the specified TPC. More...
 
bool IntersectionPoint (WireID const &wid1, WireID const &wid2, double &y, double &z) const
 Returns the intersection point of two wires. More...
 
PlaneID ThirdPlane (PlaneID const &pid1, PlaneID const &pid2) const
 Returns the plane that is not in the specified arguments. More...
 
double ThirdPlaneSlope (PlaneID const &pid1, double slope1, PlaneID const &pid2, double slope2, PlaneID const &output_plane) const
 Returns the slope on the third plane, given it in the other two. More...
 
double ThirdPlaneSlope (PlaneID const &pid1, double slope1, PlaneID const &pid2, double slope2) const
 Returns the slope on the third plane, given it in the other two. More...
 
double ThirdPlane_dTdW (PlaneID const &pid1, double slope1, PlaneID const &pid2, double slope2, PlaneID const &output_plane) const
 Returns dT/dW on the third plane, given it in the other two. More...
 
double ThirdPlane_dTdW (PlaneID const &pid1, double slope1, PlaneID const &pid2, double slope2) const
 Returns dT/dW on the third plane, given it in the other two. More...
 
std::string OpDetGeoName (CryostatID const &cid=cryostat_zero) 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< 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 (Point_t const &worldLoc, 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 (Point_t const &worldLoc) const
 Returns the ID of the TPC set at specified location. More...
 
readout::TPCsetID TPCtoTPCset (TPCID const &tpcid) const
 Returns the ID of the TPC set tpcid belongs to. More...
 
std::vector< 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 (CryostatID const &id) const
 Returns the ID of the first TPC set in the specified cryostat. More...
 
readout::TPCsetID GetEndTPCsetID (CryostatID const &id) const
 
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 (PlaneID const &planeid) const
 Returns the ID of the ROP planeid belongs to. More...
 
std::vector< PlaneIDROPtoWirePlanes (readout::ROPID const &ropid) const
 Returns a list of ID of planes belonging to the specified ROP. More...
 
std::vector< 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 (CryostatID const &id) const
 Returns the ID of the first readout plane of the specified cryostat. More...
 
readout::ROPID GetEndROPID (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
 
View_t View (readout::ROPID const &ropid) const
 Returns the view of the channels in the specified readout plane. More...
 
SigType_t SignalType (readout::ROPID const &ropid) const
 Returns the type of signal of channels in specified readout plane. More...
 
template<>
TPCID GetBeginID (CryostatID const &id) const
 
template<>
TPCID GetEndID (CryostatID const &id) const
 
template<>
PlaneID GetBeginID (CryostatID const &id) const
 
template<>
PlaneID GetBeginID (TPCID const &id) const
 
template<>
PlaneID GetEndID (CryostatID const &id) const
 
template<>
PlaneID GetEndID (TPCID const &id) const
 
template<>
WireID GetBeginID (CryostatID const &id) const
 
template<>
WireID GetBeginID (TPCID const &id) const
 
template<>
WireID GetBeginID (PlaneID const &id) const
 
template<>
WireID GetEndID (CryostatID const &id) const
 
template<>
WireID GetEndID (TPCID const &id) const
 
template<>
WireID GetEndID (PlaneID const &id) const
 
Detector information
std::string const & 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...
 
BoxBoundedGeo WorldBox () const
 
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...
 
BoxBoundedGeo DetectorEnclosureBox (std::string const &name="volDetEnclosure") const
 
std::string VolumeName (Point_t const &point) const
 Returns the name of the deepest volume containing specified point. More...
 
std::string MaterialName (Point_t const &point) const
 Name of the deepest material containing the point xyz. More...
 
double TotalMass () const
 Returns the total mass [kg] of the specified volume (default: world). More...
 
double TotalMass (std::string vol) const
 Returns the total mass [kg] of the specified volume (default: world). More...
 
double MassBetweenPoints (Point_t const &p1, Point_t const &p2) const
 Returns the column density between two points. More...
 
Cryostat access and information
unsigned int Ncryostats () const
 Returns the number of cryostats in the detector. More...
 
unsigned int NElements () const
 Returns the number of cryostats in the detector. More...
 
unsigned int NSiblingElements (CryostatID const &) const
 Returns the number of cryostats in the detector. More...
 
bool HasCryostat (CryostatID const &cryoid) const
 Returns whether we have the specified cryostat. More...
 
bool HasElement (CryostatID const &cryoid) const
 Returns whether we have the specified cryostat. More...
 
CryostatGeo const * CryostatPtr (CryostatID const &cryoid) const
 Returns the specified cryostat. More...
 
CryostatGeo const * GetElementPtr (CryostatID const &cryoid) const
 Returns the specified cryostat. More...
 
CryostatGeo const & PositionToCryostat (Point_t const &point) const
 Returns the cryostat at specified location. More...
 
void GetBeginID (CryostatID &id) const
 Initializes the specified ID with the ID of the first cryostat. More...
 
void GetEndID (CryostatID &id) const
 Initializes the specified ID with the invalid ID after the last cryostat. More...
 
bool IncrementID (CryostatID &id) const
 
template<typename T >
details::begin_type< T > begin () const
 Initializes the specified ID with the ID of the first cryostat. More...
 
template<typename T >
details::end_type< T > end () const
 Initializes the specified ID with the ID of the first cryostat. More...
 
template<typename T >
details::range_type< T > Iterate () const
 Initializes the specified ID with the ID of the first cryostat. More...
 
template<typename T , typename BaseID >
details::begin_type< T > begin (BaseID const &id) const
 Initializes the specified ID with the ID of the first cryostat. More...
 
template<typename T , typename BaseID >
details::end_type< T > end (BaseID const &id) const
 Initializes the specified ID with the ID of the first cryostat. More...
 
template<typename T , typename ID >
details::range_type< T > Iterate (ID const &id) const
 Initializes the specified ID with the ID of the first cryostat. More...
 
Length_t CryostatHalfWidth (CryostatID const &cid=cryostat_zero) const
 Returns the half width of the cryostat (x direction) More...
 
Length_t CryostatHalfHeight (CryostatID const &cid=cryostat_zero) const
 Returns the height of the cryostat (y direction) More...
 
Length_t CryostatLength (CryostatID const &cid=cryostat_zero) const
 Returns the length of the cryostat (z direction) More...
 
std::string GetCryostatVolumeName (CryostatID const &cid) const
 Return the name of LAr TPC volume. More...
 
TPC access and information
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 >
TPCDataContainer< T > makeTPCData () const
 Returns a container with one entry per TPC. More...
 
template<typename T >
TPCDataContainer< T > makeTPCData (T const &defValue) const
 Returns a container with one entry per TPC. More...
 
unsigned int NTPC (CryostatID const &cryoid=cryostat_zero) const
 Returns the total number of TPCs in the specified cryostat. More...
 
unsigned int NElements (CryostatID const &cryoid) const
 Returns the largest number of TPCs a cryostat in the detector has. More...
 
unsigned int NSiblingElements (TPCID const &tpcid) const
 Returns the largest number of TPCs a cryostat in the detector has. More...
 
TPCGeo const * TPCPtr (TPCID const &tpcid) const
 Returns the specified TPC. More...
 
TPCGeo const * GetElementPtr (TPCID const &tpcid) const
 Returns the specified TPC. More...
 
TPCID FindTPCAtPosition (Point_t const &point) const
 Returns the ID of the TPC at specified location. More...
 
TPCGeo const & PositionToTPC (Point_t const &point) const
 Returns the TPC at specified location. More...
 
Length_t DetHalfWidth (TPCID const &tpcid=tpc_zero) const
 Returns the half width of the active volume of the specified TPC. More...
 
Length_t DetHalfHeight (TPCID const &tpcid=tpc_zero) const
 Returns the half height of the active volume of the specified TPC. More...
 
Length_t DetLength (TPCID const &tpcid=tpc_zero) const
 Returns the length of the active volume of the specified TPC. More...
 
Point_t GetTPCFrontFaceCenter (TPCID const &tpcid) const
 Returns the center of side of the detector facing the beam. More...
 
std::string GetLArTPCVolumeName (TPCID const &tpcid=tpc_zero) const
 Return the name of specified LAr TPC volume. More...
 
Plane access and information
unsigned int MaxPlanes () const
 Returns the largest number of planes among all TPCs in this detector. More...
 
template<typename T >
PlaneDataContainer< T > makePlaneData () const
 Returns a container with one entry per wire plane. More...
 
template<typename T >
PlaneDataContainer< T > makePlaneData (T const &defValue) const
 Returns a container with one entry per wire plane. More...
 
unsigned int Nplanes (TPCID const &tpcid=tpc_zero) const
 Returns the total number of planes in the specified TPC. More...
 
unsigned int NElements (TPCID const &tpcid) const
 Returns the largest number of planes among all TPCs in this detector. More...
 
unsigned int NSiblingElements (PlaneID const &planeid) const
 Returns the largest number of planes among all TPCs in this detector. More...
 
bool HasPlane (PlaneID const &planeid) const
 Returns whether we have the specified plane. More...
 
bool HasElement (PlaneID const &planeid) const
 Returns whether we have the specified plane. More...
 
PlaneGeo const & Plane (PlaneID const &planeid) const
 Returns the specified wire. More...
 
PlaneGeo const & GetElement (PlaneID const &planeid) const
 Returns the specified wire. More...
 
PlaneGeo const * PlanePtr (PlaneID const &planeid) const
 Returns the specified plane. More...
 
PlaneGeo const * GetElementPtr (PlaneID const &planeid) const
 Returns the specified plane. More...
 
Length_t PlanePitch (TPCID const &tpcid, PlaneID::PlaneID_t p1=0, PlaneID::PlaneID_t p2=1) const
 Returns the distance between two planes. More...
 
Length_t PlanePitch (PlaneID const &pid1, PlaneID const &pid2) const
 Returns the distance between two planes. More...
 
Wire access and information
unsigned int Nwires (PlaneID const &planeid) const
 Returns the total number of wires in the specified plane. More...
 
unsigned int NElements (PlaneID const &planeid) const
 Returns the total number of wires in the specified plane. More...
 
unsigned int NSiblingElements (WireID const &wireid) const
 Returns the total number of wires in the specified plane. More...
 
unsigned int MaxWires () const
 Returns the largest number of wires among all planes in this detector. More...
 
bool HasWire (WireID const &wireid) const
 Returns whether we have the specified wire. More...
 
bool HasElement (WireID const &wireid) const
 Returns whether we have the specified wire. More...
 
WireGeo const * WirePtr (WireID const &wireid) const
 Returns the specified wire. More...
 
WireGeo const * GetElementPtr (WireID const &wireid) const
 Returns the specified wire. More...
 
WireGeo const & Wire (WireID const &wireid) const
 Returns the specified wire. More...
 
WireGeo const & WireIDToWireGeo (WireID const &wireid) const
 Returns the specified wire. More...
 
WireGeo const & GetElement (WireID const &wireid) const
 Returns the specified wire. More...
 
double WireAngleToVertical (View_t view, TPCID const &tpcid) const
 Returns the angle of the wires in the specified view from vertical. More...
 
Wire geometry queries

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

void WireEndPoints (WireID const &wireid, double *xyzStart, double *xyzEnd) const
 Fills two arrays with the coordinates of the wire end points. More...
 
Segment< Point_tWireEndPoints (WireID const &wireID) const
 Returns a segment whose ends are the wire end points. More...
 
Length_t WireCoordinate (Point_t const &pos, PlaneID const &planeid) const
 Returns the index of the nearest wire to the specified position. More...
 
bool WireIDsIntersect (WireID const &wid1, WireID const &wid2, Point_t &intersection) const
 Computes the intersection between two wires. More...
 
bool WireIDsIntersect (WireID const &wid1, WireID const &wid2, WireIDIntersection &widIntersect) const
 Computes the intersection between two wires. More...
 
double ThirdPlaneSlope (PlaneID::PlaneID_t plane1, double slope1, PlaneID::PlaneID_t plane2, double slope2, TPCID const &tpcid) const
 Returns the slope on the third plane, given it in the other two. More...
 
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 (Point_t const &point) const
 Find the nearest OpChannel to some point. More...
 
Auxiliary detectors access and information
unsigned int NAuxDets () const
 Returns the number of auxiliary detectors. More...
 
unsigned int NAuxDetSensitive (size_t const &aid) const
 Returns the number of sensitive components of auxiliary detector. More...
 
AuxDetGeo const & AuxDet (unsigned int const ad=0) const
 Returns the specified auxiliary detector. More...
 
unsigned int FindAuxDetAtPosition (Point_t const &point, double tolerance=0) const
 Returns the index of the auxiliary detector at specified location. More...
 
void FindAuxDetSensitiveAtPosition (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...
 
AuxDetGeo const & PositionToAuxDet (Point_t const &point, unsigned int &ad, double tolerance=0) const
 Returns the auxiliary detector at specified location. More...
 
const AuxDetSensitiveGeoPositionToAuxDetSensitive (Point_t const &point, 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
 Returns the number of auxiliary detectors. More...
 
const AuxDetSensitiveGeoChannelToAuxDetSensitive (std::string const &auxDetName, uint32_t const &channel) const
 Returns the number of auxiliary detectors. More...
 
TPC readout channels and views
unsigned int Nchannels () const
 Returns the number of TPC readout channels in the detector. More...
 
unsigned int Nchannels (readout::ROPID const &ropid) const
 Returns the number of channels in the specified ROP. More...
 
std::vector< raw::ChannelID_tChannelsInTPCs () const
 Returns an std::vector<ChannelID_t> in all TPCs in a TPCSet. More...
 
std::set< 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...
 
TPC set information
unsigned int NTPCsets (geo::CryostatID const &cryoid) const
 Returns the total number of TPC sets in the specified cryostat. More...
 
unsigned int NSiblingElements (readout::TPCsetID const &tpcsetid) const
 Returns the total number of TPC sets in the specified cryostat. More...
 
Readout plane information
unsigned int NROPs (readout::TPCsetID const &tpcsetid) const
 Returns the total number of ROP in the specified TPC set. More...
 
unsigned int NSiblingElements (readout::ROPID const &ropid) const
 Returns the total number of ROP in the specified TPC set. More...
 
Optical readout channels
unsigned int NOpChannels () const
 Number of electronics channels for all the optical detectors. More...
 
unsigned int MaxOpChannel () const
 Largest optical channel number. More...
 
unsigned int NOpHardwareChannels (int opDet) const
 Number of electronics channels for all the optical detectors. More...
 
bool IsValidOpChannel (int opChannel) const
 Is this a valid OpChannel number? More...
 
unsigned int OpChannel (int detNum, int hardwareChannel) const
 Convert detector number and hardware channel to unique channel. More...
 
unsigned int OpDetFromOpChannel (int opChannel) const
 Convert unique channel to detector number. More...
 
unsigned int HardwareChannelFromOpChannel (int opChannel) const
 Convert unique channel to hardware channel. More...
 
unsigned int OpDetFromCryo (unsigned int o, unsigned int c) const
 Get unique opdet number from cryo and internal count. More...
 
Geometry initialization
void LoadGeometryFile (std::string gdmlfile, std::string rootfile, 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< 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
 

Private Member Functions

CryostatList_tCryostats ()
 Return the internal cryostat list. More...
 
CryostatList_t const & Cryostats () const
 
AuxDetList_tAuxDets ()
 Return the internal auxdet list. More...
 
AuxDetList_t const & AuxDets () const
 
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 (GeometryBuilder &builder)
 
bool WireIDIntersectionCheck (const WireID &wid1, const WireID &wid2) const
 Wire ID check for WireIDsIntersect methods. More...
 
void SortGeometry (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...
 

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 ChannelMapAlgfChannelMapAlg
 Object containing the channel to wire mapping. More...
 
std::set< View_tallViews
 All views in the detector. More...
 
static constexpr CryostatID cryostat_zero {0}
 Returns the specified cryostat. More...
 
CryostatGeo const & Cryostat (CryostatID const &cryoid=cryostat_zero) const
 Returns the specified cryostat. More...
 
CryostatGeo const & GetElement (CryostatID const &cryoid) const
 Returns the specified cryostat. More...
 
static constexpr TPCID tpc_zero {cryostat_zero, 0}
 Returns the specified TPC. More...
 
TPCGeo const & TPC (TPCID const &tpcid=tpc_zero) const
 Returns the specified TPC. More...
 
TPCGeo const & GetElement (TPCID const &tpcid) const
 Returns the specified TPC. More...
 
static constexpr PlaneID plane_zero {tpc_zero, 0}
 Returns the distance between two consecutive wires. More...
 
Length_t WirePitch (PlaneID const &planeid=plane_zero) const
 Returns the distance between two consecutive wires. 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

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

Definition at line 119 of file GeometryCore.h.

Member Typedef Documentation

Type of list of auxiliary detectors.

Definition at line 141 of file GeometryCore.h.

Type of list of cryostats.

Definition at line 139 of file GeometryCore.h.

Definition at line 136 of file GeometryCore.h.

Constructor & Destructor Documentation

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

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

References fDetectorName.

74  : fSurfaceY(pset.get<double>("SurfaceY"))
75  , fDetectorName(pset.get<std::string>("Name"))
76  , fMinWireZDist(pset.get<double>("MinWireZDist", 3.0))
77  , fPositionWiggle(pset.get<double>("PositionEpsilon", 1.e-4))
79  {
80  std::transform(fDetectorName.begin(), fDetectorName.end(), fDetectorName.begin(), ::tolower);
81  }
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 ( GeometryCore const &  )
delete
geo::GeometryCore::GeometryCore ( GeometryCore &&  )
delete

Member Function Documentation

void geo::GeometryCore::ApplyChannelMap ( std::unique_ptr< 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 84 of file GeometryCore.cxx.

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

Referenced by GetEndROPID(), and geo::Geometry::InitializeChannelMap().

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

Returns the specified auxiliary detector.

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

what happens if it does not exist?

remove the default parameter?

Definition at line 318 of file GeometryCore.cxx.

References AuxDets(), and NAuxDets().

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

319  {
320  if (ad >= NAuxDets())
321  throw cet::exception("GeometryCore") << "AuxDet " << ad << " does not exist\n";
322  return AuxDets()[ad];
323  }
AuxDetList_t & AuxDets()
Return the internal auxdet list.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
AuxDetList_t& geo::GeometryCore::AuxDets ( )
inlineprivate

Return the internal auxdet list.

Definition at line 2428 of file GeometryCore.h.

References geo::GeometryData_t::auxDets, and fGeoData.

Referenced by AuxDet(), BuildGeometry(), ChannelToAuxDet(), ChannelToAuxDetSensitive(), FindAuxDetAtPosition(), FindAuxDetSensitiveAtPosition(), NAuxDets(), NAuxDetSensitive(), and SortGeometry().

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

Definition at line 2429 of file GeometryCore.h.

References geo::GeometryData_t::auxDets, and fGeoData.

2429 { return fGeoData.auxDets; }
GeometryData_t fGeoData
The detector description data.
AuxDetList_t auxDets
The auxiliary detectors.
Definition: GeometryData.h:38
template<typename T >
details::begin_type<T> geo::GeometryCore::begin ( ) const
inline

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

Definition at line 529 of file GeometryCore.h.

References geo::details::IteratorMaker< T, typename >::create_begin().

Referenced by TotalNTPC().

530  {
532  }
static begin_type create_begin(Geom const *geom)
template<typename T , typename BaseID >
details::begin_type<T> geo::GeometryCore::begin ( BaseID const &  id) const
inline

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

Definition at line 547 of file GeometryCore.h.

References geo::details::IteratorMaker< T, typename >::create_begin().

548  {
550  }
static begin_type create_begin(Geom const *geom)
void geo::GeometryCore::BuildGeometry ( GeometryBuilder builder)
private

Parses ROOT geometry nodes and builds LArSoft geometry representation.

Parameters
builderthe algorithm to be used

Definition at line 1009 of file GeometryCore.cxx.

References AuxDets(), Cryostats(), geo::GeometryBuilder::extractAuxiliaryDetectors(), and geo::GeometryBuilder::extractCryostats().

Referenced by LoadGeometryFile().

1010  {
1011  GeoNodePath path{gGeoManager->GetTopNode()};
1012  Cryostats() = builder.extractCryostats(path);
1013  AuxDets() = builder.extractAuxiliaryDetectors(path);
1014  }
AuxDetList_t & AuxDets()
Return the internal auxdet list.
CryostatList_t & Cryostats()
Return the internal cryostat list.
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 1157 of file GeometryCore.cxx.

References util::abs(), ChannelToWire(), geo::vect::cross(), geo::GeometryCore::Segment< Point >::end(), geo::WireGeo::HalfL(), geo::IntersectLines(), geo::TPCID::InvalidID, geo::IntersectionPointAndOffsets< Point >::offset1, geo::IntersectionPointAndOffsets< Point >::offset2, geo::IntersectionPointAndOffsets< Point >::point, lar::util::PointWithinSegments(), geo::GeometryCore::Segment< Point >::start(), geo::TPCID::TPC, geo::WireIDIntersection::TPC, Wire(), WireEndPoints(), WireIDIntersectionCheck(), WireIDsIntersect(), geo::WiresIntersectionAndOffsets(), geo::WireIDIntersection::y, and geo::WireIDIntersection::z.

Referenced by vertex::FeatureVertexFinder::Find3dVtxFrom2dClusterVtxCand(), evd::TWQMultiTPCProjectionView::FindEndPoint(), evd::TWQMultiTPCProjectionView::FindLineLength(), vertex::FeatureVertexFinder::Get3dVertexCandidates(), util::GeometryUtilities::GetProjectedPoint(), util::GeometryUtilities::GetYZ(), vertex::VertexFinder2D::produce(), and Views().

1161  {
1162  // [GP] these errors should be exceptions, and this function is deprecated
1163  // because it violates interoperability
1164  std::vector<WireID> chan1wires = ChannelToWire(c1);
1165  if (chan1wires.empty()) {
1166  mf::LogError("ChannelsIntersect")
1167  << "1st channel " << c1 << " maps to no wire (is it a real one?)";
1168  return false;
1169  }
1170  std::vector<WireID> chan2wires = ChannelToWire(c2);
1171  if (chan2wires.empty()) {
1172  mf::LogError("ChannelsIntersect")
1173  << "2nd channel " << c2 << " maps to no wire (is it a real one?)";
1174  return false;
1175  }
1176 
1177  if (chan1wires.size() > 1) {
1178  mf::LogWarning("ChannelsIntersect")
1179  << "1st channel " << c1 << " maps to " << chan2wires.size() << " wires; using the first!";
1180  return false;
1181  }
1182  if (chan2wires.size() > 1) {
1183  mf::LogError("ChannelsIntersect")
1184  << "2nd channel " << c2 << " maps to " << chan2wires.size() << " wires; using the first!";
1185  return false;
1186  }
1187 
1188  WireIDIntersection widIntersect;
1189  if (this->WireIDsIntersect(chan1wires[0], chan2wires[0], widIntersect)) {
1190  y = widIntersect.y;
1191  z = widIntersect.z;
1192  return true;
1193  }
1194  else {
1195  y = widIntersect.y;
1196  z = widIntersect.z;
1197  return false;
1198  }
1199  }
std::vector< WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
bool WireIDsIntersect(WireID const &wid1, WireID const &wid2, Point_t &intersection) const
Computes the intersection between two wires.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
TCanvas * c1
Definition: plotHisto.C:7
TCanvas * c2
Definition: plot_hist.C:75
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< raw::ChannelID_t > geo::GeometryCore::ChannelsInTPCs ( ) const

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

Definition at line 210 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by NAuxDets().

211  {
212  std::vector<raw::ChannelID_t> channels;
213  channels.reserve(fChannelMapAlg->Nchannels());
214 
215  for (auto const& ts : Iterate<readout::TPCsetID>()) {
216  for (auto const t : fChannelMapAlg->TPCsetToTPCs(ts)) {
217  for (auto const& wire : Iterate<WireID>(t)) {
218  channels.push_back(fChannelMapAlg->PlaneWireToChannel(wire));
219  }
220  }
221  }
222  std::sort(channels.begin(), channels.end());
223  auto last = std::unique(channels.begin(), channels.end());
224  channels.erase(last, channels.end());
225  return channels;
226  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
const AuxDetGeo & geo::GeometryCore::ChannelToAuxDet ( std::string const &  auxDetName,
uint32_t const &  channel 
) const

Returns the number of auxiliary detectors.

Todo:
use a AutDetID_t instead of unsigned int?

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

Todo:
Change return type to size_t

Definition at line 447 of file GeometryCore.cxx.

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

Referenced by NAuxDets().

449  {
450  size_t adIdx = fChannelMapAlg->ChannelToAuxDet(AuxDets(), auxDetName, channel);
451  return this->AuxDet(adIdx);
452  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
AuxDetList_t & AuxDets()
Return the internal auxdet list.
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
const AuxDetSensitiveGeo & geo::GeometryCore::ChannelToAuxDetSensitive ( std::string const &  auxDetName,
uint32_t const &  channel 
) const

Returns the number of auxiliary detectors.

Todo:
use a AutDetID_t instead of unsigned int?

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

Todo:
Change return type to size_t

Definition at line 455 of file GeometryCore.cxx.

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

Referenced by NAuxDets().

457  {
458  auto idx = fChannelMapAlg->ChannelToSensitiveAuxDet(AuxDets(), auxDetName, channel);
459  return this->AuxDet(idx.first).SensitiveVolume(idx.second);
460  }
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
Definition: AuxDetGeo.h:143
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
AuxDetList_t & AuxDets()
Return the internal auxdet 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 1087 of file GeometryCore.cxx.

References fChannelMapAlg.

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

1088  {
1089  return fChannelMapAlg->ChannelToROP(channel);
1090  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
std::vector< 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 1081 of file GeometryCore.cxx.

References fChannelMapAlg.

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

1082  {
1083  return fChannelMapAlg->ChannelToWire(channel);
1084  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
void geo::GeometryCore::ClearGeometry ( )
private

Deletes the detector geometry structures.

Definition at line 157 of file GeometryCore.cxx.

References fGeoData.

Referenced by LoadGeometryFile().

158  {
159  fGeoData = {};
160  }
GeometryData_t fGeoData
The detector description data.
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 1424 of file GeometryCore.cxx.

References ComputeThirdPlaneSlope().

Referenced by ThirdPlane_dTdW(), and ThirdPlaneSlope().

1432  {
1433  // we need to convert dt/dw into homogeneous coordinates, and then back;
1434  // slope = [dT * (TDCperiod / driftVelocity)] / [dW * wirePitch]
1435  // The coefficient of dT is assumed to be the same for all the planes,
1436  // and it finally cancels out. Pitches cancel out only if they are all
1437  // the same.
1438  return pitch_target *
1439  ComputeThirdPlaneSlope(angle1, dTdW1 / pitch1, angle2, dTdW2 / pitch2, angle_target);
1440  }
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 1396 of file GeometryCore.cxx.

References util::abs().

Referenced by ComputeThirdPlane_dTdW(), and ThirdPlaneSlope().

1401  {
1402  // note that, if needed, the trigonometric functions can be pre-calculated.
1403 
1404  // Can't resolve very small slopes
1405  if ((std::abs(slope1) < 0.001) && (std::abs(slope2)) < 0.001) return 0.001;
1406 
1407  // We need the "wire coordinate direction" for each plane.
1408  // This is perpendicular to the wire orientation.
1409  double slope3 = 0.001;
1410  if (std::abs(slope1) > 0.001 && std::abs(slope2) > 0.001) {
1411  slope3 =
1412  (+(1. / slope1) * std::sin(angle3 - angle2) - (1. / slope2) * std::sin(angle3 - angle1)) /
1413  std::sin(angle1 - angle2);
1414  }
1415  if (slope3 != 0.)
1416  slope3 = 1. / slope3;
1417  else
1418  slope3 = 999.;
1419 
1420  return slope3;
1421  }
constexpr auto abs(T v)
Returns the absolute value of the argument.
CryostatGeo const & geo::GeometryCore::Cryostat ( CryostatID const &  cryoid = cryostat_zero) 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 303 of file GeometryCore.cxx.

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

Referenced by phot::PDFastSimANN::beginJob(), opdet::SimPhotonCounter::beginJob(), evgen::PhotonGen::beginRun(), larg4::LArVoxelReadoutGeometry::Construct(), ems::MultiEMShowers::convCluster(), CryostatHalfHeight(), CryostatHalfWidth(), CryostatLength(), detinfo::DetectorPropertiesStandard::DataFor(), cosmic::BeamFlashTrackMatchTaggerAlg::FillFlashProperties(), opdet::FlashHypothesisAnaAlg::FillOpDetPositions(), GetCryostatVolumeName(), GetElement(), ems::EMShower3D::LinkCandidates(), trkf::SpacePointAlg::makeSpacePoints(), NOpDets(), OpDetFromCryo(), OpDetGeoFromOpDet(), OpDetGeoName(), larg4::LArG4::produce(), phot::PhotonVisibilityService::reconfigure(), and TPC().

304  {
305  if (auto pCryo = CryostatPtr(cryoid)) { return *pCryo; }
306  throw cet::exception("GeometryCore") << "Cryostat #" << cryoid.Cryostat << " does not exist\n";
307  }
CryostatGeo const * CryostatPtr(CryostatID const &cryoid) const
Returns the specified cryostat.
Definition: GeometryCore.h:477
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Length_t geo::GeometryCore::CryostatHalfHeight ( CryostatID const &  cid = cryostat_zero) const

Returns the height of the cryostat (y direction)

Definition at line 706 of file GeometryCore.cxx.

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

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

707  {
708  return Cryostat(cid).HalfHeight();
709  }
CryostatGeo const & Cryostat(CryostatID const &cryoid=cryostat_zero) const
Returns the specified cryostat.
double HalfHeight() const
Half height of the cryostat [cm].
Length_t geo::GeometryCore::CryostatHalfWidth ( CryostatID const &  cid = cryostat_zero) const

Returns the half width of the cryostat (x direction)

Definition at line 700 of file GeometryCore.cxx.

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

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

701  {
702  return Cryostat(cid).HalfWidth();
703  }
CryostatGeo const & Cryostat(CryostatID const &cryoid=cryostat_zero) const
Returns the specified cryostat.
double HalfWidth() const
Half width of the cryostat [cm].
Length_t geo::GeometryCore::CryostatLength ( CryostatID const &  cid = cryostat_zero) const

Returns the length of the cryostat (z direction)

Definition at line 712 of file GeometryCore.cxx.

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

Referenced by Iterate(), and evgen::FileMuons::ReadEvents().

713  {
714  return Cryostat(cid).Length();
715  }
CryostatGeo const & Cryostat(CryostatID const &cryoid=cryostat_zero) const
Returns the specified cryostat.
double Length() const
Length of the cryostat [cm].
Definition: CryostatGeo.h:106
CryostatGeo const* geo::GeometryCore::CryostatPtr ( 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 477 of file GeometryCore.h.

References geo::CryostatID::Cryostat, Cryostats(), and HasCryostat().

Referenced by Cryostat(), GetElementPtr(), GetEndPlaneID(), GetEndTPCID(), GetEndWireID(), HasTPC(), and TPCPtr().

478  {
479  return HasCryostat(cryoid) ? &(Cryostats()[cryoid.Cryostat]) : nullptr;
480  }
bool HasCryostat(CryostatID const &cryoid) const
Returns whether we have the specified cryostat.
Definition: GeometryCore.h:446
CryostatList_t & Cryostats()
Return the internal cryostat list.
CryostatList_t& geo::GeometryCore::Cryostats ( )
inlineprivate

Return the internal cryostat list.

Definition at line 2424 of file GeometryCore.h.

References geo::GeometryData_t::cryostats, and fGeoData.

Referenced by BuildGeometry(), CryostatPtr(), MaxPlanes(), MaxTPCs(), MaxWires(), Ncryostats(), SortGeometry(), TotalNTPC(), and UpdateAfterSorting().

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

Definition at line 2425 of file GeometryCore.h.

References geo::GeometryData_t::cryostats, and fGeoData.

2425 { return fGeoData.cryostats; }
GeometryData_t fGeoData
The detector description data.
CryostatList_t cryostats
The detector cryostats.
Definition: GeometryData.h:37
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 175 of file GeometryCore.h.

References fPositionWiggle.

175 { return fPositionWiggle; }
double fPositionWiggle
accounting for rounding errors when testing positions
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 509 of file GeometryCore.cxx.

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

Referenced by Print(), and SurfaceY().

511  {
512  auto const& path = FindDetectorEnclosure(name);
513  if (path.empty()) {
514  throw cet::exception("GeometryCore")
515  << "DetectorEnclosureBox(): can't find enclosure volume '" << name << "'\n";
516  }
517 
518  TGeoVolume const* pEncl = path.back()->GetVolume();
519  auto const* pBox = dynamic_cast<TGeoBBox const*>(pEncl->GetShape());
520 
521  // check that this is indeed a box
522  if (!pBox) {
523  // at initialisation time we don't know yet our real ID
524  throw cet::exception("GeometryCore")
525  << "Detector enclosure '" << name << "' is not a box! (it is a "
526  << pEncl->GetShape()->IsA()->GetName() << ")\n";
527  }
528 
529  LocalTransformation<TGeoHMatrix> trans(path, path.size() - 1);
530  // get the half width, height, etc of the cryostat
531  const double halfwidth = pBox->GetDX();
532  const double halfheight = pBox->GetDY();
533  const double halflength = pBox->GetDZ();
534 
535  return {trans.LocalToWorld(Point_t{-halfwidth, -halfheight, -halflength}),
536  trans.LocalToWorld(Point_t{+halfwidth, +halfheight, +halflength})};
537  }
std::vector< TGeoNode const * > FindDetectorEnclosure(std::string const &name="volDetEnclosure") const
recob::tracking::Point_t Point_t
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Length_t geo::GeometryCore::DetHalfHeight ( TPCID const &  tpcid = tpc_zero) 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 688 of file GeometryCore.cxx.

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

Referenced by lar::example::AnalysisExample::analyze(), evgen::NDKGen::beginJob(), evgen::GENIEGen::beginJob(), trkf::SpacePointAna::bookHistograms(), LArStackingAction::ClassifyNewTrack(), cosmic::CosmicPCAxisTagger::CosmicPCAxisTagger(), evd_tool::MicroBooNEDrawer::DetOutline3D(), evd::Display3DPad::Draw(), lar_pandora::PFParticleCosmicAna::FillRecoTree(), simfilter::FilterNoDirtNeutrinos::filter(), util::GeometryUtilities::Get2DangleFrom3D(), GetBeginTPCID(), trk::TrackContainmentAlg::GetCosmicTagID(), cosmic::BeamFlashTrackMatchTaggerAlg::InDetector(), trk::TrackContainmentAlg::IsContained(), trkf::SeedAna::MCHists::MCHists(), trkf::TrackAna::MCHists::MCHists(), trk::TrackContainmentAlg::ProcessTracks(), trkf::SpacePts::produce(), trkf::Track3Dreco::produce(), vertex::VertexFinder2D::produce(), trkf::Track3DKalmanSPS::produce(), trkf::SeedAna::RecoHists::RecoHists(), and trkf::TrackAna::RecoHists::RecoHists().

689  {
690  return TPC(tpcid).ActiveHalfHeight();
691  }
double ActiveHalfHeight() const
Half height (associated with y coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:88
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
Length_t geo::GeometryCore::DetHalfWidth ( TPCID const &  tpcid = tpc_zero) 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 682 of file GeometryCore.cxx.

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

Referenced by lar::example::AnalysisExample::analyze(), evgen::NDKGen::beginJob(), evgen::GENIEGen::beginJob(), trkf::SpacePointAna::bookHistograms(), LArStackingAction::ClassifyNewTrack(), cosmic::CosmicPCAxisTagger::CosmicPCAxisTagger(), evd_tool::MicroBooNEDrawer::DetOutline3D(), evd::Display3DPad::Draw(), lar_pandora::PFParticleCosmicAna::FillRecoTree(), simfilter::FilterNoDirtNeutrinos::filter(), util::GeometryUtilities::Get2DangleFrom3D(), GetBeginTPCID(), trk::TrackContainmentAlg::GetCosmicTagID(), cosmic::BeamFlashTrackMatchTaggerAlg::InDetector(), cosmic::BeamFlashTrackMatchTaggerAlg::InDriftWindow(), trk::TrackContainmentAlg::IsContained(), trkf::SeedAna::MCHists::MCHists(), trkf::TrackAna::MCHists::MCHists(), trkf::CCTrackMaker::PlnMatch(), trk::TrackContainmentAlg::ProcessTracks(), trkf::Track3DKalmanSPS::produce(), trkf::SeedAna::RecoHists::RecoHists(), and trkf::TrackAna::RecoHists::RecoHists().

683  {
684  return TPC(tpcid).ActiveHalfWidth();
685  }
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
double ActiveHalfWidth() const
Half width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:84
Length_t geo::GeometryCore::DetLength ( TPCID const &  tpcid = tpc_zero) 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 694 of file GeometryCore.cxx.

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

Referenced by lar::example::AnalysisExample::analyze(), evgen::NDKGen::beginJob(), evgen::GENIEGen::beginJob(), trkf::SpacePointAna::bookHistograms(), LArStackingAction::ClassifyNewTrack(), cosmic::CosmicPCAxisTagger::CosmicPCAxisTagger(), evd_tool::MicroBooNEDrawer::DetOutline3D(), evd::Display3DPad::Draw(), lar_pandora::PFParticleCosmicAna::FillRecoTree(), simfilter::FilterNoDirtNeutrinos::filter(), util::GeometryUtilities::Get2DangleFrom3D(), GetBeginTPCID(), trk::TrackContainmentAlg::GetCosmicTagID(), cosmic::BeamFlashTrackMatchTaggerAlg::InDetector(), trk::TrackContainmentAlg::IsContained(), trkf::SeedAna::MCHists::MCHists(), trkf::TrackAna::MCHists::MCHists(), lar_cluster3d::StandardHit3DBuilder::NearestWireID(), lar_cluster3d::SnippetHit3DBuilder::NearestWireID(), trkf::CCTrackMaker::PlnMatch(), trk::TrackContainmentAlg::ProcessTracks(), evgen::CosmicsGen::produce(), trkf::Track3DKalmanSPS::produce(), trkf::SeedAna::RecoHists::RecoHists(), and trkf::TrackAna::RecoHists::RecoHists().

695  {
696  return TPC(tpcid).ActiveLength();
697  }
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
double ActiveLength() const
Length (associated with z coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:92
template<typename T >
details::end_type<T> geo::GeometryCore::end ( ) const
inline

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

Definition at line 535 of file GeometryCore.h.

References geo::details::IteratorMaker< T, typename >::create_end().

Referenced by TotalNTPC().

536  {
538  }
static end_type create_end(Geom const *geom)
template<typename T , typename BaseID >
details::end_type<T> geo::GeometryCore::end ( BaseID const &  id) const
inline

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

Definition at line 553 of file GeometryCore.h.

References geo::details::IteratorMaker< T, typename >::create_end().

554  {
555  return details::IteratorMaker<T>::create_end(this, id);
556  }
static end_type create_end(Geom const *geom)
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 654 of file GeometryCore.cxx.

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

Referenced by SurfaceY().

656  {
657  CollectPathsByName path_collector(vol_names);
658 
659  ROOTGeoNodeForwardIterator iNode(ROOTGeoManager()->GetTopNode());
660 
661  while (*iNode) {
662  path_collector(iNode);
663  ++iNode;
664  }
665 
666  return path_collector.paths;
667  }
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 637 of file GeometryCore.cxx.

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

Referenced by SurfaceY().

639  {
640  CollectNodesByName node_collector(vol_names);
641 
642  ROOTGeoNodeForwardIterator iNode{ROOTGeoManager()->GetTopNode()};
643  TGeoNode const* pCurrentNode;
644 
645  while ((pCurrentNode = *iNode)) {
646  node_collector(*pCurrentNode);
647  ++iNode;
648  }
649 
650  return node_collector.nodes;
651  }
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
unsigned int geo::GeometryCore::FindAuxDetAtPosition ( 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 410 of file GeometryCore.cxx.

References AuxDets(), and fChannelMapAlg.

Referenced by FindAuxDetSensitiveAtPosition(), NAuxDets(), and PositionToAuxDet().

411  {
412  return fChannelMapAlg->NearestAuxDet(point, AuxDets(), tolerance);
413  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
AuxDetList_t & AuxDets()
Return the internal auxdet list.
void geo::GeometryCore::FindAuxDetSensitiveAtPosition ( 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 426 of file GeometryCore.cxx.

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

Referenced by larg4::AuxDetReadoutGeometry::FindAndMakeAuxDetSensitive(), sim::GenericCRTUtility::GetAuxDetSimChannelByNumber(), NAuxDets(), and PositionToAuxDetSensitive().

430  {
431  adg = FindAuxDetAtPosition(point, tolerance);
432  sv = fChannelMapAlg->NearestSensitiveAuxDet(point, AuxDets(), tolerance);
433  }
unsigned int FindAuxDetAtPosition(Point_t const &point, double tolerance=0) const
Returns the index of the auxiliary detector at specified location.
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
AuxDetList_t & AuxDets()
Return the internal auxdet list.
std::vector< TGeoNode const * > geo::GeometryCore::FindDetectorEnclosure ( std::string const &  name = "volDetEnclosure") const
private

Definition at line 978 of file GeometryCore.cxx.

References FindFirstVolume(), and ROOTGeoManager().

Referenced by DetectorEnclosureBox().

980  {
981  std::vector<TGeoNode const*> path{ROOTGeoManager()->GetTopNode()};
982  if (!FindFirstVolume(name, path)) path.clear();
983  return path;
984  }
bool FindFirstVolume(std::string const &name, std::vector< const TGeoNode * > &path) const
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
bool geo::GeometryCore::FindFirstVolume ( std::string const &  name,
std::vector< const TGeoNode * > &  path 
) const
private

Definition at line 987 of file GeometryCore.cxx.

Referenced by FindDetectorEnclosure().

989  {
990  assert(!path.empty());
991 
992  auto const* pCurrent = path.back();
993 
994  // first check the current layer
995  if (strncmp(name.c_str(), pCurrent->GetName(), name.length()) == 0) return true;
996 
997  //explore the next layer down
998  auto const* pCurrentVolume = pCurrent->GetVolume();
999  unsigned int nd = pCurrentVolume->GetNdaughters();
1000  for (unsigned int i = 0; i < nd; ++i) {
1001  path.push_back(pCurrentVolume->GetNode(i));
1002  if (FindFirstVolume(name, path)) return true;
1003  path.pop_back();
1004  }
1005  return false;
1006  }
bool FindFirstVolume(std::string const &name, std::vector< const TGeoNode * > &path) const
TPCID geo::GeometryCore::FindTPCAtPosition ( 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 326 of file GeometryCore.cxx.

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

Referenced by trkf::TrajectoryMCSFitter::breakTrajInSegments(), pma::ProjectionMatchingAlg::buildShowerSeg(), ShowerRecoTools::ShowerUnidirectiondEdx::CalculateElement(), ShowerRecoTools::ShowerTrajPointdEdx::CalculateElement(), ems::MultiEMShowers::convCluster(), evd::RecoBaseDrawer::DrawTrack2D(), hit::HitCheater::FindHitsOnChannel(), shower::EMShowerAlg::FindInitialTrackHits(), FindTPCsetAtPosition(), GetElementPtr(), opdet::GetHitGeometryInfo(), nnet::TrainingDataAlg::getProjection(), lar_pandora::LArPandoraInput::GetTrueStartAndEndPoints(), hit::DisambigCheater::InitHitToWids(), trkf::TrajectoryMCSFitter::linearRegression(), evd::SimulationDrawer::MCTruthOrtho(), shower::EMShowerAlg::OrderShowerHits_(), calo::Calorimetry::produce(), shower::EMShowerAlg::Project3DPointOntoPlane_(), filt::LArG4ParticleFilter::StartInTPCCheck(), filt::LArG4ParticleFilter::StopInTPCCheck(), filt::LArG4ParticleFilter::TPCTrajLengthCheck(), DUNE::NeutrinoTrackingEff::truthLength(), and DUNE::MuonTrackingEff::truthLength().

327  {
328  // first find the cryostat
329  CryostatGeo const* cryo = PositionToCryostatPtr(point);
330  if (!cryo) return {};
331 
332  // then ask it about the TPC
333  TPCID tpcid = cryo->PositionToTPCID(point, 1. + fPositionWiggle);
334  if (tpcid) return tpcid;
335 
336  // return an invalid TPC ID with cryostat information set:
337  tpcid.Cryostat = cryo->ID().Cryostat;
338  tpcid.markInvalid();
339  return tpcid;
340  }
CryostatGeo const * PositionToCryostatPtr(Point_t const &point) const
Returns the cryostat at specified location.
double fPositionWiggle
accounting for rounding errors when testing positions
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
readout::TPCsetID geo::GeometryCore::FindTPCsetAtPosition ( Point_t const &  worldLoc) 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 1485 of file GeometryCore.cxx.

References FindTPCAtPosition(), and TPCtoTPCset().

Referenced by HasElement().

1486  {
1487  return TPCtoTPCset(FindTPCAtPosition(worldLoc));
1488  }
TPCID FindTPCAtPosition(Point_t const &point) const
Returns the ID of the TPC at specified location.
readout::TPCsetID TPCtoTPCset(TPCID const &tpcid) const
Returns the ID of the TPC set tpcid belongs to.
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 1542 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by HasElement().

1543  {
1544  return fChannelMapAlg->FirstChannelInROP(ropid);
1545  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
std::string const& 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 193 of file GeometryCore.h.

References fGDMLfile.

Referenced by larg4::LArG4::beginJob().

193 { 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 357 of file GeometryCore.h.

Referenced by GetBeginID(), and GetEndID().

358  {
359  GeoID id;
360  GetBeginID(id);
361  return id;
362  }
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
Definition: GeometryCore.h:357
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 ( CryostatID id) const
inline

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

Definition at line 518 of file GeometryCore.h.

References HasCryostat().

518 { id = CryostatID(0, HasCryostat(CryostatID(0))); }
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
bool HasCryostat(CryostatID const &cryoid) const
Returns whether we have the specified cryostat.
Definition: GeometryCore.h:446
void geo::GeometryCore::GetBeginID ( TPCID id) const
inline

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

iterators

Definition at line 782 of file GeometryCore.h.

References GetBeginID(), GetEndID(), and IncrementID().

783  {
784  GetBeginID(id.asCryostatID());
785  id.TPC = 0;
786  }
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
Definition: GeometryCore.h:357
void geo::GeometryCore::GetBeginID ( PlaneID id) const
inline

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

Definition at line 1060 of file GeometryCore.h.

References GetBeginID(), GetEndID(), and IncrementID().

1061  {
1062  GetBeginID(id.asTPCID());
1063  id.Plane = 0;
1064  }
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
Definition: GeometryCore.h:357
void geo::GeometryCore::GetBeginID ( WireID id) const
inline

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

Definition at line 1220 of file GeometryCore.h.

References GetBeginID(), GetEndID(), and IncrementID().

1221  {
1222  GetBeginID(id.asPlaneID());
1223  id.Wire = 0;
1224  }
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
Definition: GeometryCore.h:357
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 2091 of file GeometryCore.h.

References GetBeginID().

2092  {
2093  GetBeginID(id.asCryostatID());
2094  id.TPCset = 0;
2095  }
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
Definition: GeometryCore.h:357
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 2256 of file GeometryCore.h.

References GetBeginID().

2257  {
2258  GetBeginID(id.asTPCsetID());
2259  id.ROP = 0;
2260  }
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
Definition: GeometryCore.h:357
template<>
TPCID geo::GeometryCore::GetBeginID ( CryostatID const &  id) const
inline

Definition at line 2549 of file GeometryCore.h.

References GetBeginTPCID().

2550  {
2551  return GetBeginTPCID(id);
2552  }
TPCID GetBeginTPCID(CryostatID const &id) const
Returns the ID of the first TPC in the specified cryostat.
Definition: GeometryCore.h:796
template<>
PlaneID geo::GeometryCore::GetBeginID ( CryostatID const &  id) const
inline

Definition at line 2562 of file GeometryCore.h.

References GetBeginPlaneID().

2563  {
2564  return GetBeginPlaneID(id);
2565  }
PlaneID GetBeginPlaneID(CryostatID const &id) const
Returns the ID of the first plane of the specified cryostat.
template<>
PlaneID geo::GeometryCore::GetBeginID ( TPCID const &  id) const
inline

Definition at line 2568 of file GeometryCore.h.

References GetBeginPlaneID().

2569  {
2570  return GetBeginPlaneID(id);
2571  }
PlaneID GetBeginPlaneID(CryostatID const &id) const
Returns the ID of the first plane of the specified cryostat.
template<>
WireID geo::GeometryCore::GetBeginID ( CryostatID const &  id) const
inline

Definition at line 2587 of file GeometryCore.h.

References GetBeginWireID().

2588  {
2589  return GetBeginWireID(id);
2590  }
WireID GetBeginWireID(CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
template<>
WireID geo::GeometryCore::GetBeginID ( TPCID const &  id) const
inline

Definition at line 2593 of file GeometryCore.h.

References GetBeginWireID().

2594  {
2595  return GetBeginWireID(id);
2596  }
WireID GetBeginWireID(CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
template<>
WireID geo::GeometryCore::GetBeginID ( PlaneID const &  id) const
inline

Definition at line 2599 of file GeometryCore.h.

References GetBeginWireID().

2600  {
2601  return GetBeginWireID(id);
2602  }
WireID GetBeginWireID(CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
PlaneID geo::GeometryCore::GetBeginPlaneID ( CryostatID const &  id) const
inline

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

Definition at line 1074 of file GeometryCore.h.

References GetBeginTPCID(), and GetEndPlaneID().

Referenced by GetBeginID(), GetBeginWireID(), and GetEndPlaneID().

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

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

Definition at line 1081 of file GeometryCore.h.

References GetEndPlaneID(), PlanePitch(), SignalType(), and View().

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

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

Definition at line 2274 of file GeometryCore.h.

References GetBeginTPCsetID().

Referenced by geo::GeometryCore::GetBeginID< readout::ROPID, CryostatID >(), and geo::GeometryCore::GetBeginID< readout::ROPID, readout::TPCsetID >().

2274 { return {GetBeginTPCsetID(id), 0}; }
readout::TPCsetID GetBeginTPCsetID(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 2281 of file GeometryCore.h.

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

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

Definition at line 796 of file GeometryCore.h.

References DetHalfHeight(), DetHalfWidth(), DetLength(), GetEndTPCID(), and tpc_zero.

Referenced by GetBeginID(), GetBeginPlaneID(), and GetEndTPCID().

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

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

Definition at line 2109 of file GeometryCore.h.

Referenced by geo::GeometryCore::GetBeginID< readout::TPCsetID, CryostatID >(), and GetBeginROPID().

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

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

Definition at line 1234 of file GeometryCore.h.

References GetBeginPlaneID(), and GetEndWireID().

Referenced by GetBeginID(), and GetEndWireID().

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

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

Definition at line 1241 of file GeometryCore.h.

References GetEndWireID().

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

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

Definition at line 1248 of file GeometryCore.h.

References GetEndWireID().

1248 { return {id, 0}; }
unsigned int geo::GeometryCore::GetClosestOpDet ( 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 1635 of file GeometryCore.cxx.

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

Referenced by ThirdPlaneSlope().

1636  {
1637  CryostatGeo const* cryo = PositionToCryostatPtr(point);
1638  if (!cryo) return std::numeric_limits<unsigned int>::max();
1639  int o = cryo->GetClosestOpDet(point);
1640  return OpDetFromCryo(o, cryo->ID().Cryostat);
1641  }
CryostatGeo const * PositionToCryostatPtr(Point_t const &point) const
Returns the cryostat at specified location.
unsigned int OpDetFromCryo(unsigned int o, unsigned int c) const
Get unique opdet number from cryo and internal count.
std::string geo::GeometryCore::GetCryostatVolumeName ( 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 676 of file GeometryCore.cxx.

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

Referenced by Iterate().

677  {
678  return Cryostat(cid).Volume()->GetName();
679  }
CryostatGeo const & Cryostat(CryostatID const &cryoid=cryostat_zero) const
Returns the specified cryostat.
const TGeoVolume * Volume() const
Pointer to ROOT&#39;s volume descriptor.
Definition: CryostatGeo.h:110
CryostatGeo const& geo::GeometryCore::GetElement ( CryostatID const &  cryoid) const
inline

Returns the specified cryostat.

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

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

Todo:
Make the cryostat number mandatory (as CryostatID)

Definition at line 465 of file GeometryCore.h.

References Cryostat().

Referenced by sce::SCECorrection::applyT0Shift(), and evd::SimulationDrawer::MCTruthOrtho().

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

Returns the specified TPC.

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

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

Definition at line 723 of file GeometryCore.h.

References TPC().

723 { return TPC(tpcid); }
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
PlaneGeo const& geo::GeometryCore::GetElement ( PlaneID const &  planeid) const
inline

Returns the specified wire.

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

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

Definition at line 1035 of file GeometryCore.h.

References Plane().

1035 { return Plane(planeid); }
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
WireGeo const& geo::GeometryCore::GetElement ( 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 1212 of file GeometryCore.h.

References Wire().

1212 { return Wire(wireid); }
WireGeo const & Wire(WireID const &wireid) const
Returns the specified wire.
CryostatGeo const* geo::GeometryCore::GetElementPtr ( 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 481 of file GeometryCore.h.

References CryostatPtr(), PositionToCryostat(), PositionToCryostatID(), and PositionToCryostatPtr().

Referenced by geo::details::getElementPtr(), Nplanes(), NTPC(), and Nwires().

481 { return CryostatPtr(cryoid); }
CryostatGeo const * CryostatPtr(CryostatID const &cryoid) const
Returns the specified cryostat.
Definition: GeometryCore.h:477
TPCGeo const* geo::GeometryCore::GetElementPtr ( 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 740 of file GeometryCore.h.

References FindTPCAtPosition(), PositionToTPC(), PositionToTPCID(), PositionToTPCptr(), and TPCPtr().

740 { return TPCPtr(tpcid); }
TPCGeo const * TPCPtr(TPCID const &tpcid) const
Returns the specified TPC.
Definition: GeometryCore.h:735
PlaneGeo const* geo::GeometryCore::GetElementPtr ( 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 1052 of file GeometryCore.h.

References PlanePtr().

1052 { return PlanePtr(planeid); }
PlaneGeo const * PlanePtr(PlaneID const &planeid) const
Returns the specified plane.
WireGeo const* geo::GeometryCore::GetElementPtr ( 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 1197 of file GeometryCore.h.

References WirePtr().

1197 { return WirePtr(wireid); }
WireGeo const * WirePtr(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 385 of file GeometryCore.h.

References GetBeginID().

Referenced by GetBeginID(), and GetEndID().

386  {
387  GeoID id;
388  GetEndID(id);
389  return id;
390  }
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
Definition: GeometryCore.h:385
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 ( CryostatID id) const
inline

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

Definition at line 521 of file GeometryCore.h.

References IncrementID(), and Ncryostats().

521 { id = 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.
Definition: GeometryCore.h:430
void geo::GeometryCore::GetEndID ( TPCID id) const

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

Definition at line 380 of file GeometryCore.cxx.

References GetBeginID(), GetEndID(), and MaxTPCs().

381  {
382  if (MaxTPCs() == 0) {
383  GetBeginID(id);
384  id.markInvalid();
385  }
386  else {
387  GetEndID(id.asCryostatID());
388  id.deepestIndex() = 0;
389  }
390  }
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
Definition: GeometryCore.h:385
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
Definition: GeometryCore.h:357
unsigned int MaxTPCs() const
Returns the largest number of TPCs a cryostat in the detector has.
void geo::GeometryCore::GetEndID ( PlaneID id) const

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

Definition at line 718 of file GeometryCore.cxx.

References GetBeginID(), GetEndID(), and MaxPlanes().

719  {
720  if (MaxPlanes() == 0) {
721  GetBeginID(id);
722  id.markInvalid();
723  }
724  else {
725  GetEndID(id.asTPCID());
726  id.deepestIndex() = 0;
727  }
728  }
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
Definition: GeometryCore.h:385
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
Definition: GeometryCore.h:357
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
void geo::GeometryCore::GetEndID ( WireID id) const

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

Definition at line 840 of file GeometryCore.cxx.

References GetBeginID(), GetEndID(), and MaxWires().

841  {
842  if (MaxWires() == 0) {
843  GetBeginID(id);
844  id.markInvalid();
845  }
846  else {
847  GetEndID(id.asPlaneID());
848  id.deepestIndex() = 0;
849  }
850  }
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
Definition: GeometryCore.h:385
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
Definition: GeometryCore.h:357
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 2098 of file GeometryCore.h.

References GetEndID(), and IncrementID().

2099  {
2100  GetEndID(id.asCryostatID());
2101  id.TPCset = 0;
2102  }
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
Definition: GeometryCore.h:385
void geo::GeometryCore::GetEndID ( readout::ROPID id) const
inline

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

Definition at line 2263 of file GeometryCore.h.

References GetEndID(), and IncrementID().

2264  {
2265  GetEndID(id.asTPCsetID());
2266  id.ROP = 0;
2267  }
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
Definition: GeometryCore.h:385
template<>
TPCID geo::GeometryCore::GetEndID ( CryostatID const &  id) const
inline

Definition at line 2555 of file GeometryCore.h.

References GetEndTPCID().

2556  {
2557  return GetEndTPCID(id);
2558  }
TPCID GetEndTPCID(CryostatID const &id) const
template<>
PlaneID geo::GeometryCore::GetEndID ( CryostatID const &  id) const
inline

Definition at line 2574 of file GeometryCore.h.

References GetEndPlaneID().

2575  {
2576  return GetEndPlaneID(id);
2577  }
PlaneID GetEndPlaneID(CryostatID const &id) const
template<>
PlaneID geo::GeometryCore::GetEndID ( TPCID const &  id) const
inline

Definition at line 2580 of file GeometryCore.h.

References GetEndPlaneID().

2581  {
2582  return GetEndPlaneID(id);
2583  }
PlaneID GetEndPlaneID(CryostatID const &id) const
template<>
WireID geo::GeometryCore::GetEndID ( CryostatID const &  id) const
inline

Definition at line 2605 of file GeometryCore.h.

References GetEndWireID().

2606  {
2607  return GetEndWireID(id);
2608  }
WireID GetEndWireID(CryostatID const &id) const
template<>
WireID geo::GeometryCore::GetEndID ( TPCID const &  id) const
inline

Definition at line 2611 of file GeometryCore.h.

References GetEndWireID().

2612  {
2613  return GetEndWireID(id);
2614  }
WireID GetEndWireID(CryostatID const &id) const
template<>
WireID geo::GeometryCore::GetEndID ( PlaneID const &  id) const
inline

Definition at line 2617 of file GeometryCore.h.

References GetEndWireID().

2618  {
2619  return GetEndWireID(id);
2620  }
WireID GetEndWireID(CryostatID const &id) const
PlaneID geo::GeometryCore::GetEndPlaneID ( CryostatID const &  id) const

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

Definition at line 731 of file GeometryCore.cxx.

References CryostatPtr(), GetBeginPlaneID(), GetEndTPCID(), and geo::CryostatGeo::MaxPlanes().

Referenced by GetBeginPlaneID(), GetEndID(), and GetEndWireID().

732  {
733  CryostatGeo const* cryo = CryostatPtr(id);
734  return (cryo && cryo->MaxPlanes() > 0) ? PlaneID{GetEndTPCID(id), 0} : GetBeginPlaneID(id);
735  }
TPCID GetEndTPCID(CryostatID const &id) const
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
CryostatGeo const * CryostatPtr(CryostatID const &cryoid) const
Returns the specified cryostat.
Definition: GeometryCore.h:477
PlaneID GetBeginPlaneID(CryostatID const &id) const
Returns the ID of the first plane of the specified cryostat.
PlaneID geo::GeometryCore::GetEndPlaneID ( TPCID const &  id) const

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

Definition at line 738 of file GeometryCore.cxx.

References GetBeginPlaneID(), GetNextID(), geo::CryostatID::markInvalid(), geo::TPCGeo::Nplanes(), TPC(), and TPCPtr().

739  {
740  if (TPCGeo const* TPC = TPCPtr(id); TPC && TPC->Nplanes() > 0) return {GetNextID(id), 0};
742  pid.markInvalid();
743  return pid;
744  }
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:137
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
PlaneID GetBeginPlaneID(CryostatID const &id) const
Returns the ID of the first plane of the specified cryostat.
TPCGeo const * TPCPtr(TPCID const &tpcid) const
Returns the specified TPC.
Definition: GeometryCore.h:735
GeoID GetNextID(GeoID const &id) const
Returns the ID next to the specified one.
Definition: GeometryCore.h:371
readout::ROPID geo::GeometryCore::GetEndROPID ( CryostatID const &  id) const
inline

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

Definition at line 2278 of file GeometryCore.h.

References GetEndTPCsetID().

Referenced by geo::GeometryCore::GetEndID< readout::ROPID, CryostatID >(), and geo::GeometryCore::GetEndID< readout::ROPID, readout::TPCsetID >().

2278 { return {GetEndTPCsetID(id), 0}; }
readout::TPCsetID GetEndTPCsetID(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 2285 of file GeometryCore.h.

References ApplyChannelMap(), GetNextID(), HardwareChannelFromOpChannel(), IsValidOpChannel(), LoadGeometryFile(), MaxOpChannel(), NOpChannels(), NOpHardwareChannels(), OpChannel(), OpDetFromCryo(), OpDetFromOpChannel(), SignalType(), and View().

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

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

Definition at line 393 of file GeometryCore.cxx.

References geo::CryostatID::Cryostat, CryostatPtr(), GetBeginTPCID(), geo::CryostatID::markInvalid(), and geo::CryostatGeo::NTPC().

Referenced by GetBeginTPCID(), GetEndID(), and GetEndPlaneID().

394  {
395  if (CryostatGeo const* cryo = CryostatPtr(id); cryo && cryo->NTPC() > 0)
396  return {id.Cryostat + 1, 0};
397  TPCID tpcid = GetBeginTPCID(id);
398  tpcid.markInvalid();
399  return tpcid;
400  }
CryostatGeo const * CryostatPtr(CryostatID const &cryoid) const
Returns the specified cryostat.
Definition: GeometryCore.h:477
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:175
TPCID GetBeginTPCID(CryostatID const &id) const
Returns the ID of the first TPC in the specified cryostat.
Definition: GeometryCore.h:796
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
readout::TPCsetID geo::GeometryCore::GetEndTPCsetID ( CryostatID const &  id) const
inline

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

Definition at line 2113 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::GetEndID< readout::TPCsetID, CryostatID >(), and GetEndROPID().

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

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

Definition at line 853 of file GeometryCore.cxx.

References CryostatPtr(), GetBeginWireID(), GetEndPlaneID(), geo::CryostatID::markInvalid(), and geo::CryostatGeo::MaxWires().

Referenced by GetBeginWireID(), and GetEndID().

854  {
855  CryostatGeo const* cryo = CryostatPtr(id);
856  if (cryo && cryo->MaxWires() > 0) return {GetEndPlaneID(id), 0};
857  WireID wid = GetBeginWireID(id);
858  wid.markInvalid();
859  return wid;
860  }
WireID GetBeginWireID(CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
CryostatGeo const * CryostatPtr(CryostatID const &cryoid) const
Returns the specified cryostat.
Definition: GeometryCore.h:477
PlaneID GetEndPlaneID(CryostatID const &id) const
WireID geo::GeometryCore::GetEndWireID ( TPCID const &  id) const

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

Definition at line 863 of file GeometryCore.cxx.

References GetBeginWireID(), GetEndPlaneID(), geo::CryostatID::markInvalid(), geo::TPCGeo::MaxWires(), TPC(), and TPCPtr().

864  {
865  TPCGeo const* TPC = TPCPtr(id);
866  if (TPC && TPC->MaxWires() > 0) return {GetEndPlaneID(id), 0};
867  WireID wid = GetBeginWireID(id);
868  wid.markInvalid();
869  return wid;
870  }
WireID GetBeginWireID(CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
TPCGeo const * TPCPtr(TPCID const &tpcid) const
Returns the specified TPC.
Definition: GeometryCore.h:735
PlaneID GetEndPlaneID(CryostatID const &id) const
WireID geo::GeometryCore::GetEndWireID ( PlaneID const &  id) const

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

Definition at line 873 of file GeometryCore.cxx.

References GetBeginWireID(), GetNextID(), geo::CryostatID::markInvalid(), geo::PlaneGeo::Nwires(), and PlanePtr().

874  {
875  if (PlaneGeo const* plane = PlanePtr(id); plane && plane->Nwires() > 0)
876  return {GetNextID(id), 0};
877  WireID wid = GetBeginWireID(id);
878  wid.markInvalid();
879  return wid;
880  }
WireID GetBeginWireID(CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
PlaneGeo const * PlanePtr(PlaneID const &planeid) const
Returns the specified plane.
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
unsigned int Nwires() const
Number of wires in this plane.
Definition: PlaneGeo.h:242
GeoID GetNextID(GeoID const &id) const
Returns the ID next to the specified one.
Definition: GeometryCore.h:371
std::string geo::GeometryCore::GetLArTPCVolumeName ( TPCID const &  tpcid = tpc_zero) 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:
What if it does not exist?

Definition at line 670 of file GeometryCore.cxx.

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

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

671  {
672  return TPC(tpcid).ActiveVolume()->GetName();
673  }
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
const TGeoVolume * ActiveVolume() const
Half width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:108
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 371 of file GeometryCore.h.

References IncrementID().

Referenced by GetEndPlaneID(), GetEndROPID(), and GetEndWireID().

372  {
373  auto nextID(id);
374  IncrementID(nextID);
375  return nextID;
376  }
bool IncrementID(CryostatID &id) const
Point_t geo::GeometryCore::GetTPCFrontFaceCenter ( TPCID const &  tpcid) const
inline

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

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

References geo::TPCGeo::GetFrontFaceCenter(), GetLArTPCVolumeName(), MaxPlanes(), TPC(), and tpc_zero.

873  {
874  return TPC(tpcid).GetFrontFaceCenter();
875  }
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
geo::Point_t GetFrontFaceCenter() const
Returns the center of the active TPC volume side facing negative z.
Definition: TPCGeo.h:257
const std::string geo::GeometryCore::GetWorldVolumeName ( ) const

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

Definition at line 501 of file GeometryCore.cxx.

Referenced by SurfaceY(), WorldBox(), and WorldVolume().

502  {
503  // For now, and possibly forever, this is a constant (given the
504  // definition of "nodeNames" above).
505  return std::string("volWorld");
506  }
unsigned int geo::GeometryCore::HardwareChannelFromOpChannel ( int  opChannel) const

Convert unique channel to hardware channel.

Definition at line 268 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by GetEndROPID().

269  {
270  return fChannelMapAlg->HardwareChannelFromOpChannel(opChannel);
271  }
std::unique_ptr< const 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 495 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by Views().

496  {
497  return fChannelMapAlg->HasChannel(channel);
498  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
bool geo::GeometryCore::HasCryostat ( 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 446 of file GeometryCore.h.

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

Referenced by CryostatPtr(), GetBeginID(), HasElement(), and IncrementID().

446 { return cryoid.Cryostat < Ncryostats(); }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
bool geo::GeometryCore::HasElement ( 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 447 of file GeometryCore.h.

References HasCryostat().

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

Returns whether we have the specified TPC.

Definition at line 706 of file GeometryCore.h.

References HasTPC().

706 { return HasTPC(tpcid); }
bool HasTPC(TPCID const &tpcid) const
Returns whether we have the specified TPC.
Definition: GeometryCore.h:699
bool geo::GeometryCore::HasElement ( 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 1016 of file GeometryCore.h.

References HasPlane().

1016 { return HasPlane(planeid); }
bool HasPlane(PlaneID const &planeid) const
Returns whether we have the specified plane.
bool geo::GeometryCore::HasElement ( 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 1180 of file GeometryCore.h.

References HasWire().

1180 { return HasWire(wireid); }
bool HasWire(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 2059 of file GeometryCore.h.

References FindTPCsetAtPosition(), HasTPCset(), TPCsetToTPCs(), and TPCtoTPCset().

2059 { 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 2198 of file GeometryCore.h.

References FirstChannelInROP(), HasROP(), ROPtoTPCs(), ROPtoWirePlanes(), and WirePlaneToROP().

2198 { return HasROP(ropid); }
bool HasROP(readout::ROPID const &ropid) const
bool geo::GeometryCore::HasPlane ( 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 1011 of file GeometryCore.h.

References geo::TPCGeo::HasPlane(), and TPCPtr().

Referenced by HasElement().

1012  {
1013  TPCGeo const* pTPC = TPCPtr(planeid);
1014  return pTPC ? pTPC->HasPlane(planeid) : false;
1015  }
TPCGeo const * TPCPtr(TPCID const &tpcid) const
Returns the specified TPC.
Definition: GeometryCore.h:735
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 1518 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by HasElement(), and makeROPdata().

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

Returns whether we have the specified TPC.

Definition at line 699 of file GeometryCore.h.

References CryostatPtr(), and geo::CryostatGeo::HasTPC().

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

700  {
701  CryostatGeo const* pCryo = CryostatPtr(tpcid);
702  return pCryo ? pCryo->HasTPC(tpcid) : false;
703  }
CryostatGeo const * CryostatPtr(CryostatID const &cryoid) const
Returns the specified cryostat.
Definition: GeometryCore.h:477
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 1479 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by HasElement(), and makeTPCsetData().

1480  {
1481  return fChannelMapAlg->HasTPCset(tpcsetid);
1482  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
bool geo::GeometryCore::HasWire ( 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 1175 of file GeometryCore.h.

References geo::PlaneGeo::HasWire(), and PlanePtr().

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

1176  {
1177  PlaneGeo const* pPlane = PlanePtr(wireid);
1178  return pPlane ? pPlane->HasWire(wireid) : false;
1179  }
PlaneGeo const * PlanePtr(PlaneID const &planeid) const
Returns the specified plane.
bool geo::GeometryCore::IncrementID ( 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 2481 of file GeometryCore.h.

References HasCryostat().

Referenced by GetBeginID(), GetEndID(), GetNextID(), and IncrementID().

2482 {
2483  ++id.Cryostat;
2484  if (id) id.isValid = HasCryostat(id); // if invalid already, it stays so
2485  return bool(id);
2486 }
bool HasCryostat(CryostatID const &cryoid) const
Returns whether we have the specified cryostat.
Definition: GeometryCore.h:446
bool geo::GeometryCore::IncrementID ( 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 2488 of file GeometryCore.h.

References IncrementID(), NTPC(), and TPC().

2489 {
2490  unsigned int const nTPCsInCryo = NTPC(id);
2491  if (++id.TPC < nTPCsInCryo) return bool(id); // if was invalid, it stays so
2492  // no more TPCs in this cryostat
2493  id.TPC = 0;
2494  return IncrementID(id.asCryostatID()); // also sets validity
2495 }
unsigned int NTPC(CryostatID const &cryoid=cryostat_zero) const
Returns the total number of TPCs in the specified cryostat.
Definition: GeometryCore.h:686
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
bool IncrementID(CryostatID &id) const
bool geo::GeometryCore::IncrementID ( 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 2497 of file GeometryCore.h.

References IncrementID(), Nplanes(), and Plane().

2498 {
2499  // this implementation is non-optimal, in that the cryostat lookup is
2500  // performed both here and, potentially, in IncrementID(TPCID)
2501  unsigned int const nPlanesInTPC = Nplanes(id);
2502  if (++id.Plane < nPlanesInTPC) return bool(id); // if was invalid, stays so
2503  // no more planes in this TPCs
2504  id.Plane = 0;
2505  return IncrementID(id.asTPCID()); // also sets validity
2506 }
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
bool IncrementID(CryostatID &id) const
unsigned int Nplanes(TPCID const &tpcid=tpc_zero) const
Returns the total number of planes in the specified TPC.
Definition: GeometryCore.h:977
bool geo::GeometryCore::IncrementID ( 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 2508 of file GeometryCore.h.

References IncrementID(), Nwires(), and Wire().

2509 {
2510  // this implementation is non-optimal, in that the TPC lookup is
2511  // performed both here and, potentially, in IncrementID(PlaneID)
2512  unsigned int const nWiresInPlane = Nwires(id);
2513  if (++id.Wire < nWiresInPlane) return bool(id); // if was invalid, stays so
2514  // no more wires in this plane
2515  id.Wire = 0;
2516  return IncrementID(id.asPlaneID()); // also sets validity
2517 }
WireGeo const & Wire(WireID const &wireid) const
Returns the specified wire.
bool IncrementID(CryostatID &id) const
unsigned int Nwires(PlaneID const &planeid) const
Returns the total number of wires in the specified plane.
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 2519 of file GeometryCore.h.

References IncrementID(), and NTPCsets().

2520 {
2521  unsigned int const nTPCsetsInCryo = NTPCsets(id);
2522  if (++id.TPCset < nTPCsetsInCryo) return bool(id); // if was invalid, it stays so
2523  // no more TPC sets in this cryostat
2524  id.TPCset = 0;
2525  return IncrementID(id.asCryostatID()); // also sets validity
2526 }
bool IncrementID(CryostatID &id) const
unsigned int NTPCsets(geo::CryostatID const &cryoid) const
Returns the total number of TPC sets in the specified cryostat.
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 2528 of file GeometryCore.h.

References IncrementID(), and NROPs().

2529 {
2530  // this implementation is non-optimal, in that the cryostat lookup is
2531  // performed both here and, potentially, in IncrementID(TPCsetID)
2532  unsigned int const nROPinTPC = NROPs(id);
2533  if (++id.ROP < nROPinTPC) return bool(id); // if was invalid, stays so
2534  // no more readout planes in this TPC set
2535  id.ROP = 0;
2536  return IncrementID(id.asTPCsetID()); // also sets validity
2537 }
bool IncrementID(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 1073 of file GeometryCore.cxx.

References Print().

Referenced by SurfaceY().

1074  {
1075  std::ostringstream sstr;
1076  Print(sstr, indent);
1077  return sstr.str();
1078  }
void Print(Stream &&out, std::string indent=" ") const
Prints geometry information with maximum verbosity.
std::string indent(std::size_t const i)
bool geo::GeometryCore::IntersectionPoint ( WireID const &  wid1,
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 1451 of file GeometryCore.cxx.

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

Referenced by pma::ProjectionMatchingAlg::addEndpointRef_(), sppt::SpacePointAlg_TimeSort::fillCoordinatesArrays(), trkf::CCTrackMaker::FillEndMatch(), tca::FillWireIntersections(), filter::MuonFilter::filter(), tca::Find3DVertices(), vertex::FeatureVertexFinder::Get3dVertexCandidates(), pma::Track3D::InitFromHits(), tca::Match2Planes(), cluster::ClusterMatchAlg::Match_RoughZ(), trkf::CCTrackMaker::PlnMatch(), and trkf::TrackTrajectoryAlg::ShortTrackTrajectory().

1455  {
1456  WireIDIntersection widIntersect;
1457  bool const found = WireIDsIntersect(wid1, wid2, widIntersect);
1458  y = widIntersect.y;
1459  z = widIntersect.z;
1460  return found;
1461  }
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
bool WireIDsIntersect(WireID const &wid1, WireID const &wid2, Point_t &intersection) const
Computes the intersection between two wires.
bool geo::GeometryCore::IsValidOpChannel ( int  opChannel) const

Is this a valid OpChannel number?

Definition at line 274 of file GeometryCore.cxx.

References fChannelMapAlg, and NOpDets().

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

275  {
276  return fChannelMapAlg->IsValidOpChannel(opChannel, this->NOpDets());
277  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int NOpDets() const
Number of OpDets in the whole detector.
template<typename T >
details::range_type<T> geo::GeometryCore::Iterate ( ) const
inline

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

Definition at line 541 of file GeometryCore.h.

References geo::details::IteratorMaker< T, typename >::create_range().

Referenced by vertex::FeatureVertexFinderAna::analyze(), pfpf::PFPAna::analyze(), cluster::ClusterAna::analyze(), cluster::DBclusterAna::analyze(), evgen::GaisserParam::beginJob(), trkf::SpacePointAna::bookHistograms(), pma::PMAlgTracker::build(), ShowerRecoTools::ShowerTrajPointdEdx::CalculateElement(), corner::CornerFinderAlg::create_smaller_histos(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), sim::details::createPlaneIndexMap(), evd_tool::ICARUSDrawer::DetOutline3D(), trkf::TrackKalmanFitter::doFitWork(), larg4::ISTPC::extractActiveLArVolume(), larg4::OpFastScintillation::extractActiveVolumes(), cluster::HoughBaseAlg::FastTransform(), trkf::CCTrackMaker::FillChgNear(), tca::FillWireHitRange(), vertex::FeatureVertexFinder::Find2dClusterVertexCandidates(), vertex::FeatureVertexFinder::Find3dVtxFrom2dClusterVtxCand(), trkf::CCTrackMaker::FindMaybeVertices(), ems::MCinfo::Findtpcborders(), vertex::FeatureVertexFinder::Get3dVertexCandidates(), corner::CornerFinderAlg::get_feature_points(), corner::CornerFinderAlg::get_feature_points_fast(), corner::CornerFinderAlg::get_feature_points_LineIntegralScore(), mvapid::MVAAlg::GetDetectorEdges(), lar_pandora::LArPandoraInput::GetTrueStartAndEndPoints(), mvapid::MVAAlg::GetWireNormals(), corner::CornerFinderAlg::GrabWires(), cluster::HoughBaseAlg::HoughBaseAlg(), cluster::DBScan3DAlg::init(), corner::CornerFinderAlg::InitializeGeometry(), cluster::DBScanAlg::InitScan(), tca::InsideTPC(), lar_pandora::LArPandoraGeometry::LoadGeometry(), sim::MCRecoEdep::MakeMCEdep(), shower::TCShowerAlg::makeShowers(), trkf::SpacePointAlg::makeSpacePoints(), sim::MCRecoPart::MCRecoPart(), evd::RecoBaseDrawer::OpFlashOrtho(), evd::Ortho3DPad::Ortho3DPad(), evgen::CORSIKAGen::populateNShowers(), trkf::CCTrackMaker::PrintClusters(), evgen::CosmicsGen::produce(), tss::TrackShowerHits::produce(), evgen::NDKGen::produce(), trkf::CCTrackMaker::produce(), evgen::NucleonDecay::produce(), vertex::FeatureVertexFinder::produce(), evgen::NeutronOsc::produce(), evgen::CORSIKAGen::produce(), evd::RecoBaseDrawer::RecoBaseDrawer(), phot::PhotonVisibilityService::reconfigure(), lariov::SIOVElectronicsCalibProvider::Reconfigure(), lariov::DetPedestalRetrievalAlg::Reconfigure(), evgen::ActiveVolumeVertexSampler::reconfigure(), evgen::ActiveVolumeVertexSampler::sample_vertex_pos(), evd::SimulationDrawer::SimulationDrawer(), trkf::CCTrackMaker::StoreTrack(), evd::TWQProjectionView::TWQProjectionView(), and trkf::SpacePointAlg::update().

542  {
544  }
static range_type create_range(Geom const *geom)
template<typename T , typename ID >
details::range_type<T> geo::GeometryCore::Iterate ( ID const &  id) const
inline

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

Definition at line 559 of file GeometryCore.h.

References geo::details::IteratorMaker< T, typename >::create_range(), cryostat_zero, CryostatHalfHeight(), CryostatHalfWidth(), CryostatLength(), GetCryostatVolumeName(), MaxTPCs(), and TotalNTPC().

560  {
562  }
static range_type create_range(Geom const *geom)
void geo::GeometryCore::LoadGeometryFile ( std::string  gdmlfile,
std::string  rootfile,
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 93 of file GeometryCore.cxx.

References BuildGeometry(), ClearGeometry(), fGDMLfile, and fROOTfile.

Referenced by GetEndROPID(), LoadGeometryFile(), and geo::Geometry::LoadNewGeometry().

98  {
99  if (gdmlfile.empty()) {
100  throw cet::exception("GeometryCore") << "No GDML Geometry file specified!\n";
101  }
102 
103  if (rootfile.empty()) {
104  throw cet::exception("GeometryCore") << "No ROOT Geometry file specified!\n";
105  }
106 
107  ClearGeometry();
108 
109  // Open the GDML file, and convert it into ROOT TGeoManager format.
110  // Then lock the gGeoManager to prevent future imports, for example
111  // in AuxDetGeometry
112  if (!gGeoManager || bForceReload) {
113  if (gGeoManager)
114  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 = move(gdmlfile);
136  fROOTfile = move(rootfile);
137 
138  mf::LogInfo("GeometryCore") << "New detector geometry loaded from "
139  << "\n\t" << fROOTfile << "\n\t" << fGDMLfile << "\n";
140  } // GeometryCore::LoadGeometryFile()
void BuildGeometry(GeometryBuilder &builder)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
void ClearGeometry()
Deletes the detector geometry structures.
std::string fGDMLfile
path to geometry file used for Geant4 simulation
std::string fROOTfile
path to geometry file for geometry in GeometryCore
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void geo::GeometryCore::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 143 of file GeometryCore.cxx.

References fBuilderParameters, and LoadGeometryFile().

147  {
149  {"tool_type"});
150  // this is a wink to the understanding that we might be using an art-based
151  // service provider configuration sprinkled with tools.
152  GeometryBuilderStandard builder{builderConfig()};
153  LoadGeometryFile(gdmlfile, rootfile, builder, bForceReload);
154  }
void LoadGeometryFile(std::string gdmlfile, std::string rootfile, GeometryBuilder &builder, bool bForceReload=false)
Loads the geometry information from the specified files.
fhicl::ParameterSet fBuilderParameters
template<typename T >
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 937 of file GeometryCore.h.

References MaxPlanes(), MaxTPCs(), and Ncryostats().

938  {
939  return {Ncryostats(), MaxTPCs(), MaxPlanes()};
940  }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
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 >
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 961 of file GeometryCore.h.

References MaxPlanes(), MaxTPCs(), and Ncryostats().

962  {
963  return {Ncryostats(), MaxTPCs(), MaxPlanes(), defValue};
964  }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
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 2164 of file GeometryCore.h.

References MaxROPs(), MaxTPCsets(), and Ncryostats().

2165  {
2166  return {Ncryostats(), MaxTPCsets(), MaxROPs()};
2167  }
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.
Definition: GeometryCore.h:430
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 2184 of file GeometryCore.h.

References HasROP(), MaxROPs(), MaxTPCsets(), and Ncryostats().

2185  {
2186  return {Ncryostats(), MaxTPCsets(), MaxROPs(), defValue};
2187  }
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.
Definition: GeometryCore.h:430
unsigned int MaxTPCsets() const
Returns the largest number of TPC sets any cryostat in the detector has.
template<typename T >
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 645 of file GeometryCore.h.

References MaxTPCs(), and Ncryostats().

646  {
647  return {Ncryostats(), MaxTPCs()};
648  }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
unsigned int MaxTPCs() const
Returns the largest number of TPCs a cryostat in the detector has.
template<typename T >
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 670 of file GeometryCore.h.

References MaxTPCs(), and Ncryostats().

671  {
672  return {Ncryostats(), MaxTPCs(), defValue};
673  }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
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 2026 of file GeometryCore.h.

References MaxTPCsets(), and Ncryostats().

2027  {
2028  return {Ncryostats(), MaxTPCsets()};
2029  }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
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 2046 of file GeometryCore.h.

References HasTPCset(), MaxTPCsets(), and Ncryostats().

2047  {
2048  return {Ncryostats(), MaxTPCsets(), defValue};
2049  }
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
unsigned int MaxTPCsets() const
Returns the largest number of TPC sets any cryostat in the detector has.
double geo::GeometryCore::MassBetweenPoints ( Point_t const &  p1,
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 1033 of file GeometryCore.cxx.

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

Referenced by SurfaceY().

1034  {
1035  //The purpose of this method is to determine the column density
1036  //between the two points given. Do that by starting at p1 and
1037  //stepping until you get to the node of p2. calculate the distance
1038  //between the point just inside that node and p2 to get the last
1039  //bit of column density
1040  double columnD = 0.;
1041 
1042  //first initialize a track - get the direction cosines
1043  Vector_t const dir = (p2 - p1).Unit();
1044 
1045  double const dxyz[3] = {dir.X(), dir.Y(), dir.Z()};
1046  double const cp1[3] = {p1.X(), p1.Y(), p1.Z()};
1047  gGeoManager->InitTrack(cp1, dxyz);
1048 
1049  //might be helpful to have a point to a TGeoNode
1050  TGeoNode* node = gGeoManager->GetCurrentNode();
1051 
1052  //check that the points are not in the same volume already.
1053  //if they are in different volumes, keep stepping until you
1054  //are in the same volume as the second point
1055  while (!gGeoManager->IsSameLocation(p2.X(), p2.Y(), p2.Z())) {
1056  gGeoManager->FindNextBoundary();
1057  columnD += gGeoManager->GetStep() * node->GetMedium()->GetMaterial()->GetDensity();
1058 
1059  //the act of stepping puts you in the next node and returns that node
1060  node = gGeoManager->Step();
1061  } //end loop to get to volume of second point
1062 
1063  //now you are in the same volume as the last point, but not at that point.
1064  //get the distance between the current point and the last one
1065  Point_t const last = vect::makePointFromCoords(gGeoManager->GetCurrentPoint());
1066  double const lastStep = (p2 - last).R();
1067  columnD += lastStep * node->GetMedium()->GetMaterial()->GetDensity();
1068 
1069  return columnD;
1070  }
recob::tracking::Point_t Point_t
TDirectory * dir
Definition: macro.C:5
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
recob::tracking::Vector_t Vector_t
TGeoMaterial const * geo::GeometryCore::Material ( Point_t const &  point) const

Returns the material at the specified position.

Definition at line 949 of file GeometryCore.cxx.

Referenced by MaterialName(), and SurfaceY().

950  {
951  auto const pNode = gGeoManager->FindNode(point.X(), point.Y(), point.Z());
952  if (!pNode) return nullptr;
953  auto const pMedium = pNode->GetMedium();
954  return pMedium ? pMedium->GetMaterial() : nullptr;
955  }
std::string geo::GeometryCore::MaterialName ( Point_t const &  point) const

Name of the deepest material containing the point xyz.

Returns
material of the origin by default

Definition at line 958 of file GeometryCore.cxx.

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

Referenced by larg4::LArG4Ana::analyze(), and SurfaceY().

959  {
960  // check that the given point is in the World volume at least
961  BoxBoundedGeo worldBox = WorldBox();
962  if (!worldBox.ContainsPosition(point)) {
963  mf::LogWarning("GeometryCoreBadInputPoint")
964  << "point " << point << " is not inside the world volume " << worldBox.Min() << " -- "
965  << worldBox.Max() << "; returning unknown material name";
966  return {"unknownMaterial"};
967  }
968  auto const pMaterial = Material(point);
969  if (!pMaterial) {
970  mf::LogWarning("GeometryCoreBadInputPoint")
971  << "material for point " << point << " not found! returning unknown material name";
972  return {"unknownMaterial"};
973  }
974  return pMaterial->GetName();
975  }
TGeoMaterial const * Material(Point_t const &point) const
Returns the material at the specified position.
BoxBoundedGeo WorldBox() const
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
unsigned int geo::GeometryCore::MaxOpChannel ( ) const

Largest optical channel number.

Definition at line 244 of file GeometryCore.cxx.

References fChannelMapAlg, and NOpDets().

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

245  {
246  return fChannelMapAlg->MaxOpChannel(this->NOpDets());
247  }
std::unique_ptr< const 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
unsigned int geo::GeometryCore::MaxROPs ( ) const

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

Definition at line 1512 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by makeROPdata(), and NSiblingElements().

1513  {
1514  return fChannelMapAlg->MaxROPs();
1515  }
std::unique_ptr< const 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 796 of file GeometryCore.cxx.

References Cryostats().

Referenced by GetEndID(), Iterate(), makePlaneData(), makeTPCData(), and evd::TWQProjectionView::SetUpTPCselection().

797  {
798  unsigned int maxTPCs = 0;
799  for (CryostatGeo const& cryo : Cryostats()) {
800  unsigned int maxTPCsInCryo = cryo.NTPC();
801  if (maxTPCsInCryo > maxTPCs) maxTPCs = maxTPCsInCryo;
802  }
803  return maxTPCs;
804  }
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 1473 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by makeROPdata(), makeTPCsetData(), and NSiblingElements().

1474  {
1475  return fChannelMapAlg->MaxTPCsets();
1476  }
std::unique_ptr< const 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 829 of file GeometryCore.cxx.

References Cryostats().

Referenced by cluster::BlurredClusteringAlg::ConvertRecobHitsToVector(), GetEndID(), and NSiblingElements().

830  {
831  unsigned int maxWires = 0;
832  for (CryostatGeo const& cryo : Cryostats()) {
833  unsigned int maxWiresInCryo = cryo.MaxWires();
834  if (maxWiresInCryo > maxWires) maxWires = maxWiresInCryo;
835  }
836  return maxWires;
837  }
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 1775 of file GeometryCore.h.

References AuxDet(), AuxDets(), ChannelsInTPCs(), ChannelToAuxDet(), ChannelToAuxDetSensitive(), FindAuxDetAtPosition(), FindAuxDetSensitiveAtPosition(), NAuxDetSensitive(), Nchannels(), PositionToAuxDet(), and PositionToAuxDetSensitive().

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

1775 { return AuxDets().size(); }
AuxDetList_t & AuxDets()
Return the internal auxdet 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 280 of file GeometryCore.cxx.

References AuxDets(), and NAuxDets().

Referenced by NAuxDets().

281  {
282  if (aid < NAuxDets()) { return AuxDets()[aid].NSensitiveVolume(); }
283  throw cet::exception("Geometry")
284  << "Requested AuxDet index " << aid << " is out of range: " << NAuxDets();
285  }
AuxDetList_t & AuxDets()
Return the internal auxdet list.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
unsigned int geo::GeometryCore::Nchannels ( ) const

Returns the number of TPC readout channels in the detector.

Definition at line 198 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by larg4::LArG4Ana::beginJob(), lar_cluster3d::StandardHit3DBuilder::BuildChannelStatusVec(), lar_cluster3d::SnippetHit3DBuilder::BuildChannelStatusVec(), trkf::SeedFinderAlgorithm::CalculateGeometricalElements(), apa::APAGeometryAlg::Init(), cluster::DBScanAlg::InitScan(), NAuxDets(), hit::MCHitFinder::produce(), and detsim::SimWire::produce().

199  {
200  return fChannelMapAlg->Nchannels();
201  }
std::unique_ptr< const 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 204 of file GeometryCore.cxx.

References fChannelMapAlg.

205  {
206  return fChannelMapAlg->Nchannels(ropid);
207  }
std::unique_ptr< const 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 430 of file GeometryCore.h.

References Cryostats().

Referenced by detsim::WienerFilterAna::beginJob(), detsim::DriftElectronstoPlane::beginJob(), detsim::SimDriftElectrons::beginJob(), lar_cluster3d::StandardHit3DBuilder::BuildHitPairMap(), lar_cluster3d::SnippetHit3DBuilder::BuildHitPairMap(), larg4::LArVoxelReadout::ClearSimChannels(), lar_cluster3d::StandardHit3DBuilder::CollectArtHits(), lar_cluster3d::SnippetHit3DBuilder::CollectArtHits(), larg4::LArVoxelReadoutGeometry::Construct(), detinfo::DetectorPropertiesStandard::DataFor(), hit::DisambigCheater::DisambigCheater(), detsim::WienerFilterAna::endJob(), larg4::ISTPC::extractActiveLArVolume(), larg4::OpFastScintillation::extractActiveVolumes(), GetEndID(), HasCryostat(), lar_cluster3d::SpacePointHit3DBuilder::Hit3DBuilder(), makePlaneData(), makeROPdata(), trkf::SpacePointAlg::makeSpacePoints(), makeTPCData(), makeTPCsetData(), NElements(), NOpDets(), NSiblingElements(), OpDetFromCryo(), OpDetGeoFromOpDet(), larg4::OpFastScintillation::OpFastScintillation(), phot::PDFastSimPAR::PDFastSimPAR(), Print(), larg4::LArG4::produce(), evd::TWQProjectionView::SelectTPC(), evd::TWQProjectionView::SetUpTPCselection(), cheat::BackTracker::SpacePointHitsToWeightedXYZ(), and UpdateAfterSorting().

430 { return Cryostats().size(); }
CryostatList_t & Cryostats()
Return the internal cryostat list.
raw::ChannelID_t geo::GeometryCore::NearestChannel ( Point_t const &  worldLoc,
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 1105 of file GeometryCore.cxx.

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

Referenced by larg4::LArVoxelReadout::DriftIonizationElectrons(), sim::MCRecoEdep::MakeMCEdep(), vertex::FeatureVertexFinder::produce(), detsim::SimDriftElectrons::produce(), apa::DisambigAlg::TrivialDisambig(), and Views().

1107  {
1108  // This method is supposed to return a channel number rather than
1109  // a wire number. Perform the conversion here (although, maybe
1110  // faster if we deal in wire numbers rather than channel numbers?)
1111 
1112  // NOTE on failure both NearestChannel() and upstream:
1113  // * according to documentation, should return invalid channel
1114  // * in the actual code throw an exception because of a BUG
1115  //
1116  // The following implementation automatically becomes in fact compliant to
1117  // the documentation if upstreams becomes compliant to.
1118  // When that happens, just delete this comment.
1119  WireID const wireID = NearestWireID(worldPos, planeid);
1120  return wireID ? PlaneWireToChannel(wireID) : raw::InvalidChannelID;
1121  }
Raw data description.
Definition: RawTypes.h:6
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
WireID NearestWireID(Point_t const &point, PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
WireID geo::GeometryCore::NearestWireID ( Point_t const &  point,
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 1099 of file GeometryCore.cxx.

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

Referenced by vertex::FeatureVertexFinderAna::analyze(), trkf::TrackAna::analyze(), evd::RecoBaseDrawer::DrawTrack2D(), evd::TWQMultiTPCProjectionView::FindEndPoint(), evd::TWQProjectionView::FindEndPoint(), hit::HitCheater::FindHitsOnChannel(), util::GeometryUtilities::Get2DPointProjection(), util::GeometryUtilities::Get2DPointProjectionCM(), opdet::GetHitGeometryInfo(), trkf::FeatureTracker::GetProjectedEnds(), nnet::TrainingDataAlg::getProjection(), hit::DisambigCheater::InitHitToWids(), apa::APAGeometryAlg::LineSegChanIntersect(), NearestChannel(), apa::APAGeometryAlg::NearestWireIDOnChan(), evd::RecoBaseDrawer::OpFlash2D(), trk::TrackContainmentAlg::ProcessTracks(), cluster::ClusterCheater::produce(), vertex::FeatureVertexFinder::produce(), shower::EMShowerAlg::Project3DPointOntoPlane_(), and evd::RecoBaseDrawer::Seed2D().

1100  {
1101  return Plane(planeid).NearestWireID(worldPos);
1102  }
PlaneGeo const & Plane(PlaneID const &planeid) 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:572
unsigned int geo::GeometryCore::NElements ( ) const
inline

Returns the number of cryostats in the detector.

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

Todo:
Change return type to size_t

Definition at line 431 of file GeometryCore.h.

References Ncryostats().

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

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

Definition at line 691 of file GeometryCore.h.

References NTPC().

691 { return NTPC(cryoid); }
unsigned int NTPC(CryostatID const &cryoid=cryostat_zero) const
Returns the total number of TPCs in the specified cryostat.
Definition: GeometryCore.h:686
unsigned int geo::GeometryCore::NElements ( TPCID const &  tpcid) const
inline

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

Definition at line 982 of file GeometryCore.h.

References Nplanes().

982 { return Nplanes(tpcid); }
unsigned int Nplanes(TPCID const &tpcid=tpc_zero) const
Returns the total number of planes in the specified TPC.
Definition: GeometryCore.h:977
unsigned int geo::GeometryCore::NElements ( 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 1156 of file GeometryCore.h.

References Nwires().

1156 { return Nwires(planeid); }
unsigned int Nwires(PlaneID const &planeid) 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 238 of file GeometryCore.cxx.

References fChannelMapAlg, and NOpDets().

Referenced by opdet::OpHitAna::analyze(), opdet::OpFlashAna::analyze(), opdet::SimPhotonCounter::analyze(), opdet::OpDetResponseInterface::doNOpChannels(), opdet::OpDigiProperties::FillGainArray(), opdet::OpDigiProperties::FillPedMeanArray(), GetEndROPID(), opdet::OpDigiProperties::OpDigiProperties(), and opdet::OptDetDigitizer::produce().

239  {
240  return fChannelMapAlg->NOpChannels(this->NOpDets());
241  }
std::unique_ptr< const 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 229 of file GeometryCore.cxx.

References Cryostat(), and Ncryostats().

Referenced by cosmic::BeamFlashTrackMatchTaggerAlg::CheckCompatibility(), phot::CreateHybridLibrary::CreateHybridLibrary(), opdet::FlashHypothesisAnaAlg::FillOpDetPositions(), larg4::OpDetLookup::FindClosestOpDet(), IsValidOpChannel(), phot::PhotonVisibilityService::LoadLibrary(), phot::PhotonMappingIdentityTransformations::makeLibraryIndicesToOpDetsMap(), phot::PhotonMappingIdentityTransformations::makeOpDetsToLibraryIndicesMap(), MaxOpChannel(), NOpChannels(), cosmic::BeamFlashTrackMatchTaggerAlg::NormalizeLightHypothesis(), phot::PropagationTimeModel::opDetCenters(), phot::PropagationTimeModel::opDetOrientations(), phot::PDFastSimPAR::PDFastSimPAR(), phot::PhotonLibraryHybrid::PhotonLibraryHybrid(), cosmic::BeamFlashTrackMatchTaggerAlg::PrintHypothesisFlashComparison(), wc::CellTree::processOpFlash(), sim::PhotonHitConverter::produce(), larg4::LArG4::produce(), lariov::SIOVPmtGainProvider::Reconfigure(), phot::SemiAnalyticalModel::SemiAnalyticalModel(), opdet::FlashHypothesisAnaAlg::SetOutputObjects(), and ThirdPlaneSlope().

230  {
231  int N = 0;
232  for (size_t cstat = 0; cstat != Ncryostats(); ++cstat)
233  N += this->Cryostat(CryostatID(cstat)).NOpDet();
234  return N;
235  }
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
CryostatGeo const & Cryostat(CryostatID const &cryoid=cryostat_zero) const
Returns the specified cryostat.
unsigned int geo::GeometryCore::NOpHardwareChannels ( int  opDet) const

Number of electronics channels for all the optical detectors.

Todo:
add explanation of the different IDs

Definition at line 250 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by GetEndROPID().

251  {
252  return fChannelMapAlg->NOpHardwareChannels(opDet);
253  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
unsigned int geo::GeometryCore::Nplanes ( TPCID const &  tpcid = tpc_zero) 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 977 of file GeometryCore.h.

References GetElementPtr(), and geo::TPCGeo::NElements().

Referenced by hit::MCHitAnaExample::analyze(), hit::MagDriftAna::analyze(), pfpf::PFPAna::analyze(), cluster::ClusterAna::analyze(), trkf::TrackAna::analyze(), tca::AnalyzeHits(), detsim::WienerFilterAna::beginJob(), shwf::ShowerReco::beginJob(), cluster::SmallClusterFinder::beginJob(), lar_cluster3d::StandardHit3DBuilder::BuildChannelStatusVec(), lar_cluster3d::SnippetHit3DBuilder::BuildChannelStatusVec(), btutil::MCMatchAlg::BuildMap(), mvapid::MVAAlg::CalcSegmentdEdxDist(), ShowerRecoTools::ShowerUnidirectiondEdx::CalculateElement(), ShowerRecoTools::ShowerNumElectronsEnergy::CalculateElement(), opdet::ConstructFlash(), tca::TrajClusterAlg::CreateSlice(), evd::AnalysisBaseDrawer::DrawDeDx(), evd::AnalysisBaseDrawer::DrawKineticEnergy(), detsim::WienerFilterAna::endJob(), cluster::HoughBaseAlg::FastTransform(), trkf::CCTrackMaker::FillEndMatch(), hit::GausHitFinder::FillOutHitParameterVector(), hit::DPRawHitFinder::FillOutHitParameterVector(), trkf::CCTrackMaker::FillWireHitRange(), tca::FillWireHitRange(), filter::MuonFilter::filter(), trkf::CCTrackMaker::FitVertices(), util::GeometryUtilities::GeometryUtilities(), opdet::GetHitGeometryInfo(), mvapid::MVAAlg::GetWireNormals(), corner::CornerFinderAlg::GrabWires(), evd::GraphCluster::GraphCluster(), evd::GraphClusterAlg::GraphClusterAlg(), cluster::HoughBaseAlg::HoughBaseAlg(), IncrementID(), evd::InfoTransfer::InfoTransfer(), corner::CornerFinderAlg::InitializeGeometry(), reco::shower::LArPandoraModularShowerCreation::LArPandoraModularShowerCreation(), trkf::CCTrackMaker::MakeClusterChains(), trkf::CCTrackMaker::MakeFamily(), cluster::ClusterMatchTQ::MatchedClusters(), hit::MCHitAnaExample::MCHitAnaExample(), NElements(), NSiblingElements(), trkf::CCTrackMaker::PlnMatch(), cluster::ClusterMatchAlg::PrepareDetParams(), trkf::CCTrackMaker::PrintClusters(), btutil::MCBTAlg::ProcessSimChannel(), trk::TrackContainmentAlg::ProcessTracks(), calo::ShowerCalorimetry::produce(), calo::Calorimetry::produce(), calo::GnocchiCalorimetry::produce(), evd::RawDataDrawer::RawDataDrawer(), evd::InfoTransfer::Rebuild(), evd::InfoTransfer::reconfigure(), hit::RFFHitFinderAlg::SetFitterParamsVectors(), ShowerRecoTools::ShowerLinearEnergy::ShowerLinearEnergy(), showerreco::ShowerRecoManager::ShowerRecoManager(), cluster::SmallClusterFinderAlg::SmallClusterFinderAlg(), trkf::CCTrackMaker::SortMatches(), cheat::BackTracker::SpacePointHitsToWeightedXYZ(), trkf::CCTrackMaker::StoreTrack(), ThirdPlane(), evd::TQPad::TQPad(), evd::TWireProjPad::TWireProjPad(), evd::TWQMultiTPCProjectionView::TWQMultiTPCProjectionView(), evd::TWQProjectionView::TWQProjectionView(), trkf::CCTrackMaker::VtxMatch(), and nnet::WaveformDenoiseTest::WaveformDenoiseTest().

978  {
979  TPCGeo const* pTPC = GetElementPtr(tpcid);
980  return pTPC ? pTPC->NElements() : 0;
981  }
CryostatGeo const * GetElementPtr(CryostatID const &cryoid) const
Returns the specified cryostat.
Definition: GeometryCore.h:481
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 1506 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by GetEndTPCsetID(), IncrementID(), and NSiblingElements().

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

Returns the number of cryostats in the detector.

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

Todo:
Change return type to size_t

Definition at line 432 of file GeometryCore.h.

References Ncryostats().

Referenced by geo::details::NSiblings().

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

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

Definition at line 692 of file GeometryCore.h.

References NTPC().

692 { return NTPC(tpcid); }
unsigned int NTPC(CryostatID const &cryoid=cryostat_zero) const
Returns the total number of TPCs in the specified cryostat.
Definition: GeometryCore.h:686
unsigned int geo::GeometryCore::NSiblingElements ( PlaneID const &  planeid) const
inline

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

Definition at line 983 of file GeometryCore.h.

References Nplanes(), and Nviews().

983 { return Nplanes(planeid); }
unsigned int Nplanes(TPCID const &tpcid=tpc_zero) const
Returns the total number of planes in the specified TPC.
Definition: GeometryCore.h:977
unsigned int geo::GeometryCore::NSiblingElements ( WireID const &  wireid) 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 1157 of file GeometryCore.h.

References MaxWires(), and Nwires().

1157 { return Nwires(wireid); }
unsigned int Nwires(PlaneID const &planeid) const
Returns the total number of wires in the specified plane.
unsigned int geo::GeometryCore::NSiblingElements ( readout::TPCsetID const &  tpcsetid) const
inline

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

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

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

Definition at line 1996 of file GeometryCore.h.

References MaxTPCsets(), and NTPCsets().

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

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

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

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

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

Definition at line 2136 of file GeometryCore.h.

References MaxROPs(), and NROPs().

2136 { 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 ( CryostatID const &  cryoid = cryostat_zero) 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 686 of file GeometryCore.h.

References GetElementPtr(), and geo::CryostatGeo::NElements().

Referenced by detsim::WienerFilterAna::beginJob(), detsim::DriftElectronstoPlane::beginJob(), detsim::SimDriftElectrons::beginJob(), lar_cluster3d::StandardHit3DBuilder::BuildHitPairMap(), lar_cluster3d::SnippetHit3DBuilder::BuildHitPairMap(), mvapid::MVAAlg::CalcSegmentdEdxDist(), larg4::LArVoxelReadout::ClearSimChannels(), lar_cluster3d::StandardHit3DBuilder::CollectArtHits(), lar_cluster3d::SnippetHit3DBuilder::CollectArtHits(), hit::DisambigCheater::DisambigCheater(), detsim::WienerFilterAna::endJob(), mvapid::MVAAlg::GetWireNormals(), lar_cluster3d::SpacePointHit3DBuilder::Hit3DBuilder(), IncrementID(), apa::APAGeometryAlg::Init(), NElements(), NSiblingElements(), phot::PDFastSimPAR::PDFastSimPAR(), nnet::PointIdTrainingData::PointIdTrainingData(), evgen::ActiveVolumeVertexSampler::reconfigure(), evgen::ActiveVolumeVertexSampler::sample_vertex_pos(), evd::TWQProjectionView::SelectTPC(), phot::SemiAnalyticalModel::SemiAnalyticalModel(), tca::TrajClusterAlg::SetSourceHits(), evd::TWQProjectionView::SetUpTPCselection(), cheat::BackTracker::SpacePointHitsToWeightedXYZ(), tca::StitchPFPs(), apa::DisambigAlg::TrivialDisambig(), and evd::TWQMultiTPCProjectionView::TWQMultiTPCProjectionView().

687  {
688  CryostatGeo const* pCryo = GetElementPtr(cryoid);
689  return pCryo ? pCryo->NElements() : 0;
690  }
CryostatGeo const * GetElementPtr(CryostatID const &cryoid) const
Returns the specified cryostat.
Definition: GeometryCore.h:481
unsigned int geo::GeometryCore::NTPCsets ( geo::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 1467 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by IncrementID(), NSiblingElements(), and Views().

1468  {
1469  return fChannelMapAlg->NTPCsets(cryoid);
1470  }
std::unique_ptr< const 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 289 of file GeometryCore.cxx.

References MaxPlanes().

Referenced by evd_tool::MicroBooNEDrawer::DrawBadChannels(), evd_tool::ICARUSDrawer::DrawBadChannels(), and NSiblingElements().

290  {
291  return MaxPlanes();
292  }
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
unsigned int geo::GeometryCore::Nwires ( 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 1151 of file GeometryCore.h.

References GetElementPtr(), and geo::PlaneGeo::NElements().

Referenced by lar_cluster3d::StandardHit3DBuilder::BuildChannelStatusVec(), lar_cluster3d::SnippetHit3DBuilder::BuildChannelStatusVec(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), noisefilteralg::WireCellNoiseFilter::DoNoiseFilter(), evd_tool::MicroBooNEDrawer::DrawBadChannels(), evd_tool::ICARUSDrawer::DrawBadChannels(), sppt::SpacePointAlg_TimeSort::fillCoordinatesArrays(), trkf::CCTrackMaker::FillWireHitRange(), tca::FillWireHitRange(), vertex::FeatureVertexFinder::Find2dClusterVertexCandidates(), evd::RawDataDrawer::RoIextractorClass::Finish(), evd::RawDataDrawer::GetRegionOfInterest(), evd::RecoBaseDrawer::GetRegionOfInterest(), util::GeometryUtilities::GetYZ(), cluster::MergeClusterAlg::GlobalWire(), cluster::BlurredClusteringAlg::GlobalWire(), shower::EMShowerAlg::GlobalWire_(), corner::CornerFinderAlg::GrabWires(), IncrementID(), corner::CornerFinderAlg::InitializeGeometry(), lar_cluster3d::StandardHit3DBuilder::NearestWireID(), lar_cluster3d::SnippetHit3DBuilder::NearestWireID(), NElements(), NSiblingElements(), util::GeometryUtilities::SelectPolygonHitList(), evd::TWQProjectionView::SetWire(), img::DataProviderAlg::setWireDriftData(), cluster::HoughBaseAlg::Transform(), evd::TWireProjPad::TWireProjPad(), evd::TWQMultiTPCProjectionView::TWQMultiTPCProjectionView(), evd::TWQProjectionView::TWQProjectionView(), evd::RecoBaseDrawer::Wire2D(), WireIDIntersectionCheck(), evd::TWQMultiTPCProjectionView::ZoomInterest(), and evd::TWQProjectionView::ZoomInterest().

1152  {
1153  PlaneGeo const* pPlane = GetElementPtr(planeid);
1154  return pPlane ? pPlane->NElements() : 0;
1155  }
CryostatGeo const * GetElementPtr(CryostatID const &cryoid) const
Returns the specified cryostat.
Definition: GeometryCore.h:481
unsigned int geo::GeometryCore::OpChannel ( int  detNum,
int  hardwareChannel 
) const

Convert detector number and hardware channel to unique channel.

Definition at line 256 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by GetEndROPID(), and ThirdPlaneSlope().

257  {
258  return fChannelMapAlg->OpChannel(detNum, hardwareChannel);
259  }
std::unique_ptr< const 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 1569 of file GeometryCore.cxx.

References Cryostat(), Ncryostats(), and geo::CryostatGeo::NOpDet().

Referenced by GetClosestOpDet(), and GetEndROPID().

1570  {
1571  static bool Loaded = false;
1572  static std::vector<unsigned int> LowestID;
1573  static unsigned int NCryo;
1574 
1575  CryostatID const cid{c};
1576  // If not yet loaded static parameters, do it
1577  if (Loaded == false) {
1578 
1579  Loaded = true;
1580 
1581  // Store the lowest ID for each cryostat
1582  NCryo = Ncryostats();
1583  LowestID.resize(NCryo + 1);
1584  LowestID.at(0) = 0;
1585  for (size_t cryo = 0; cryo != NCryo; ++cryo) {
1586  LowestID.at(cryo + 1) = LowestID.at(cryo) + Cryostat(cid).NOpDet();
1587  }
1588  }
1589 
1590  if ((c < NCryo) && (o < Cryostat(cid).NOpDet())) { return LowestID.at(c) + o; }
1591 
1592  throw cet::exception("OpDetCryoToOpID Error")
1593  << "Coordinates c=" << c << ", o=" << o << " out of range. Abort\n";
1594  }
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
CryostatGeo const & Cryostat(CryostatID const &cryoid=cryostat_zero) const
Returns the specified cryostat.
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:321
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int geo::GeometryCore::OpDetFromOpChannel ( int  opChannel) const
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 1597 of file GeometryCore.cxx.

References OpDetFromOpChannel(), and OpDetGeoFromOpDet().

Referenced by evdb_tool::OpHit3DDrawer::Draw(), evdb_tool::DrawSimPhoton3D::Draw(), evdb_tool::OpFlash3DDrawer::Draw(), opdet::GetHitGeometryInfo(), and ThirdPlaneSlope().

1598  {
1599  return this->OpDetGeoFromOpDet(this->OpDetFromOpChannel(OpChannel));
1600  }
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 1603 of file GeometryCore.cxx.

References Cryostat(), Ncryostats(), geo::CryostatGeo::NOpDet(), and geo::CryostatGeo::OpDet().

Referenced by opdet::SimPhotonCounter::beginJob(), phot::CreateHybridLibrary::CreateHybridLibrary(), phot::PhotonVisibilityService::DistanceToOpDetImpl(), larg4::OpDetLookup::FindClosestOpDet(), phot::PhotonLibraryHybrid::GetCount(), phot::PropagationTimeModel::opDetCenters(), phot::PDFastSimPAR::opDetCenters(), OpDetGeoFromOpChannel(), phot::PropagationTimeModel::opDetOrientations(), larg4::OpFastScintillation::OpFastScintillation(), phot::SemiAnalyticalModel::opticalDetectors(), phot::PhotonVisibilityService::SolidAngleFactorImpl(), and ThirdPlaneSlope().

1604  {
1605  static bool Loaded = false;
1606  static std::vector<unsigned int> LowestID;
1607  static size_t NCryo;
1608  // If not yet loaded static parameters, do it
1609  if (Loaded == false) {
1610 
1611  Loaded = true;
1612 
1613  // Store the lowest ID for each cryostat
1614  NCryo = Ncryostats();
1615  LowestID.resize(NCryo + 1);
1616  LowestID[0] = 0;
1617  for (size_t cryo = 0; cryo != NCryo; ++cryo) {
1618  LowestID[cryo + 1] = LowestID[cryo] + Cryostat(CryostatID(cryo)).NOpDet();
1619  }
1620  }
1621 
1622  for (size_t i = 0; i != NCryo; ++i) {
1623  if ((OpDet >= LowestID[i]) && (OpDet < LowestID[i + 1])) {
1624  int c = i;
1625  int o = OpDet - LowestID[i];
1626  return this->Cryostat(CryostatID(c)).OpDet(o);
1627  }
1628  }
1629  // If we made it here, we didn't find the right combination. abort
1630  throw cet::exception("OpID To OpDetCryo error") << "OpID out of range, " << OpDet << "\n";
1631  }
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
CryostatGeo const & Cryostat(CryostatID const &cryoid=cryostat_zero) const
Returns the specified cryostat.
const OpDetGeo & OpDet(unsigned int iopdet) const
Return the iopdet&#39;th optical detector in the cryostat.
Definition: CryostatGeo.cxx:95
unsigned int NOpDet() const
Number of optical detectors in this TPC.
Definition: CryostatGeo.h:321
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::string geo::GeometryCore::OpDetGeoName ( CryostatID const &  cid = cryostat_zero) 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 1562 of file GeometryCore.cxx.

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

Referenced by larg4::LArG4::beginJob(), and ThirdPlaneSlope().

1563  {
1564  return Cryostat(cid).OpDetGeoName();
1565  }
CryostatGeo const & Cryostat(CryostatID const &cryoid=cryostat_zero) const
Returns the specified cryostat.
std::string OpDetGeoName() const
Get name of opdet geometry element.
Definition: CryostatGeo.h:337
GeometryCore& geo::GeometryCore::operator= ( GeometryCore const &  )
delete
GeometryCore& geo::GeometryCore::operator= ( GeometryCore &&  )
delete
PlaneGeo const& geo::GeometryCore::Plane ( PlaneID const &  planeid) const
inline

Returns the specified wire.

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

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

Definition at line 1034 of file GeometryCore.h.

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

Referenced by hit::MagDriftAna::analyze(), hit::GausHitFinderAna::analyze(), cluster::ClusterMergeHelper::AppendResult(), ShowerRecoTools::ShowerUnidirectiondEdx::CalculateElement(), ShowerRecoTools::ShowerTrajPointdEdx::CalculateElement(), util::GeometryUtilities::CalculatePitch(), util::GeometryUtilities::CalculatePitchPolar(), evd::RecoBaseDrawer::Cluster2D(), pma::CmToWireDrift(), tca::dEdx(), hit::DisambigCheater::DisambigCheater(), trkf::Track3DKalmanSPS::dQdxCalc(), evd::RecoBaseDrawer::DrawTrack2D(), evd::RecoBaseDrawer::DrawTrackVertexAssns2D(), cluster::EndPointAlg::EndPoint(), evd::RecoBaseDrawer::EndPoint2D(), evd::RecoBaseDrawer::Event2D(), cluster::HoughBaseAlg::FastTransform(), filter::MuonFilter::filter(), evd::TWQMultiTPCProjectionView::FindEndPoint(), evd::TWQProjectionView::FindEndPoint(), evd::TWQMultiTPCProjectionView::FindLineLength(), evd::TWQProjectionView::FindLineLength(), util::GeometryUtilities::Get2DangleFrom3D(), util::GeometryUtilities::Get2DPointProjection(), pma::ProjectionMatchingAlg::GetCloseHits_(), GetElement(), calo::Calorimetry::GetPitch(), util::GeometryUtilities::GetProjectedPoint(), pma::GetProjectionToPlane(), util::GeometryUtilities::GetTimeTicks(), util::GeometryUtilities::GetXYZ(), cluster::HoughBaseAlg::HoughBaseAlg(), IncrementID(), shower::EMShowerAlg::MakeShower(), trkf::SpacePointAlg::makeSpacePoints(), lar_cluster3d::StandardHit3DBuilder::NearestWireID(), lar_cluster3d::SnippetHit3DBuilder::NearestWireID(), NearestWireID(), shower::LArPandoraShowerAlg::OrderShowerHits(), util::GeometryUtilities::PitchInView(), cluster::ClusterCheater::produce(), trkf::SpacePts::produce(), trkf::Track3Dreco::produce(), cluster::SmallClusterFinder::produce(), vertex::VertexFinder2D::produce(), evd::GraphCluster::produce(), calo::Calorimetry::produce(), evd::RecoBaseDrawer::Prong2D(), pma::ProjectionMatchingAlg::validate(), pma::ProjectionMatchingAlg::validate_on_adc_test(), View(), Wire(), WireCoordinate(), pma::WireDriftToCm(), and WirePitch().

1034 { return TPC(planeid).Plane(planeid); }
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:252
double geo::GeometryCore::PlanePitch ( TPCID const &  tpcid,
PlaneID::PlaneID_t  p1 = 0,
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 749 of file GeometryCore.cxx.

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

Referenced by GetBeginPlaneID(), PlanePitch(), trkf::SpacePts::produce(), and trkf::Track3Dreco::produce().

752  {
753  return TPC(tpcid).PlanePitch(p1, p2);
754  }
double PlanePitch(unsigned int p1=0, unsigned int p2=1) const
Returns the center of the TPC volume in world coordinates [cm].
Definition: TPCGeo.cxx:361
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
double geo::GeometryCore::PlanePitch ( PlaneID const &  pid1,
PlaneID const &  pid2 
) const

Returns the distance between two planes.

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

add a version with plane IDs

deprecate this function

add a default version for a given TPCID

add a version with two plane indices for a given TPCID

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

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

Definition at line 756 of file GeometryCore.cxx.

References geo::TPCID::asTPCID(), geo::PlaneID::Plane, and PlanePitch().

757  {
758  return PlanePitch(pid1.asTPCID(), pid1.Plane, pid2.Plane);
759  }
Length_t PlanePitch(TPCID const &tpcid, PlaneID::PlaneID_t p1=0, PlaneID::PlaneID_t p2=1) const
Returns the distance between two planes.
PlaneGeo const* geo::GeometryCore::PlanePtr ( 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 1047 of file GeometryCore.h.

References geo::TPCGeo::PlanePtr(), and TPCPtr().

Referenced by GetElementPtr(), GetEndWireID(), HasWire(), and WirePtr().

1048  {
1049  TPCGeo const* pTPC = TPCPtr(planeid);
1050  return pTPC ? pTPC->PlanePtr(planeid) : nullptr;
1051  }
TPCGeo const * TPCPtr(TPCID const &tpcid) const
Returns the specified TPC.
Definition: GeometryCore.h:735
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

Definition at line 1124 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by hit::MCHitAnaExample::analyze(), cluster::BlurredClusteringAlg::ConvertRecobHitsToVector(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), evd::TQPad::Draw(), evd_tool::MicroBooNEDrawer::DrawBadChannels(), evd_tool::ICARUSDrawer::DrawBadChannels(), evd::RawDataDrawer::FillTQHisto(), tca::FillWireHitRange(), vertex::FeatureVertexFinder::Find3dVtxFrom2dClusterVtxCand(), evd::TWQMultiTPCProjectionView::FindEndPoint(), evd::TWQMultiTPCProjectionView::FindLineLength(), vertex::FeatureVertexFinder::Get3dVertexCandidates(), tca::GetOrigin(), util::GeometryUtilities::GetProjectedPoint(), util::GeometryUtilities::GetYZ(), cluster::DBScan3DAlg::init(), apa::DisambigAlg::MakeCloseHits(), tca::NearbySrcHit(), NearestChannel(), vertex::VertexFinder2D::produce(), calo::Calorimetry::produce(), lariov::SIOVElectronicsCalibProvider::Reconfigure(), lariov::DetPedestalRetrievalAlg::Reconfigure(), pma::ProjectionMatchingAlg::validate(), pma::ProjectionMatchingAlg::validate_on_adc(), pma::ProjectionMatchingAlg::validate_on_adc_test(), Views(), and evd::RecoBaseDrawer::Wire2D().

1125  {
1126  return fChannelMapAlg->PlaneWireToChannel(wireid);
1127  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
const AuxDetGeo & geo::GeometryCore::PositionToAuxDet ( 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 416 of file GeometryCore.cxx.

References AuxDet(), and FindAuxDetAtPosition().

Referenced by larg4::AuxDetReadoutGeometry::FindAndMakeAuxDet(), and NAuxDets().

419  {
420  // locate the desired Auxiliary Detector
421  ad = FindAuxDetAtPosition(point, tolerance);
422  return AuxDet(ad);
423  }
unsigned int FindAuxDetAtPosition(Point_t const &point, double tolerance=0) const
Returns the index of the auxiliary detector at specified location.
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
const AuxDetSensitiveGeo & geo::GeometryCore::PositionToAuxDetSensitive ( 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 436 of file GeometryCore.cxx.

References AuxDet(), FindAuxDetSensitiveAtPosition(), and geo::AuxDetGeo::SensitiveVolume().

Referenced by NAuxDets().

440  {
441  // locate the desired Auxiliary Detector
442  FindAuxDetSensitiveAtPosition(point, ad, sv, tolerance);
443  return AuxDet(ad).SensitiveVolume(sv);
444  }
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
Definition: AuxDetGeo.h:143
void FindAuxDetSensitiveAtPosition(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.
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
CryostatGeo const & geo::GeometryCore::PositionToCryostat ( 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 403 of file GeometryCore.cxx.

References PositionToCryostatPtr().

Referenced by GetElementPtr().

404  {
405  if (auto cstat = PositionToCryostatPtr(point)) { return *cstat; }
406  throw cet::exception("GeometryCore") << "Can't find any cryostat at position " << point << "\n";
407  }
CryostatGeo const * PositionToCryostatPtr(Point_t const &point) const
Returns the cryostat at specified location.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
CryostatID geo::GeometryCore::PositionToCryostatID ( 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 352 of file GeometryCore.cxx.

References geo::CryostatGeo::ID(), and PositionToCryostatPtr().

Referenced by pma::ProjectionMatchingAlg::buildShowerSeg(), ems::MultiEMShowers::convCluster(), larg4::LArVoxelReadoutGeometry::FindNestedVolume(), GetElementPtr(), sim::MCRecoEdep::MakeMCEdep(), evd::SimulationDrawer::MCTruthOrtho(), and detsim::SimDriftElectrons::produce().

353  {
354  CryostatGeo const* cryo = PositionToCryostatPtr(point);
355  return cryo ? cryo->ID() : CryostatID{};
356  }
CryostatGeo const * PositionToCryostatPtr(Point_t const &point) const
Returns the cryostat at specified location.
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
CryostatGeo const * geo::GeometryCore::PositionToCryostatPtr ( 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 343 of file GeometryCore.cxx.

References fPositionWiggle.

Referenced by FindTPCAtPosition(), GetClosestOpDet(), GetElementPtr(), PositionToCryostat(), PositionToCryostatID(), and PositionToTPCptr().

344  {
345  for (auto const& cryostat : Iterate<CryostatGeo>()) {
346  if (cryostat.ContainsPosition(point, 1.0 + fPositionWiggle)) return &cryostat;
347  }
348  return nullptr;
349  }
double fPositionWiggle
accounting for rounding errors when testing positions
TPCGeo const & geo::GeometryCore::PositionToTPC ( 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 366 of file GeometryCore.cxx.

References PositionToTPCptr().

Referenced by GetElementPtr(), and opreco::OpticalRecoAna::update_MC_particle_time().

367  {
368  if (auto tpc = PositionToTPCptr(point)) { return *tpc; }
369  throw cet::exception("GeometryCore") << "Can't find any TPC at position " << point << "\n";
370  }
TPCGeo const * PositionToTPCptr(Point_t const &point) const
Returns the TPC at specified location.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
TPCID geo::GeometryCore::PositionToTPCID ( 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 373 of file GeometryCore.cxx.

References geo::TPCGeo::ID(), and PositionToTPCptr().

Referenced by larg4::ISCalcCorrelated::AngleToEFieldAtStep(), evdb_tool::DrawLArVoxel3D::Draw(), evdb_tool::DrawSimEnergyDeposit3D::drawAll(), evdb_tool::DrawSimEnergyDeposit3D::drawMCPartAssociated(), larg4::ISCalcCorrelated::EFieldAtStep(), larg4::LArVoxelReadoutGeometry::FindNestedVolume(), GetElementPtr(), lar_pandora::LArPandoraInput::GetTrueX0(), apa::APAGeometryAlg::LineSegChanIntersect(), sim::MCRecoEdep::MakeMCEdep(), evd::SimulationDrawer::MCTruth3D(), detsim::SimDriftElectrons::produce(), and cheat::BackTracker::SpacePointHitsToWeightedXYZ().

374  {
375  TPCGeo const* tpc = PositionToTPCptr(point);
376  return tpc ? tpc->ID() : TPCID{};
377  }
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
TPCGeo const * PositionToTPCptr(Point_t const &point) const
Returns the TPC at specified location.
TPCGeo const * geo::GeometryCore::PositionToTPCptr ( 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 359 of file GeometryCore.cxx.

References fPositionWiggle, PositionToCryostatPtr(), and geo::CryostatGeo::PositionToTPCptr().

Referenced by GetElementPtr(), lar_pandora::PFParticleMonitoring::GetStartAndEndPoints(), PositionToTPC(), and PositionToTPCID().

360  {
361  CryostatGeo const* cryo = PositionToCryostatPtr(point);
362  return cryo ? cryo->PositionToTPCptr(point, 1. + fPositionWiggle) : nullptr;
363  }
CryostatGeo const * PositionToCryostatPtr(Point_t const &point) const
Returns the cryostat at specified location.
double fPositionWiggle
accounting for rounding errors when testing positions
template<typename Stream >
void geo::GeometryCore::Print ( Stream &&  out,
std::string  indent = "  " 
) const

Prints geometry information with maximum verbosity.

Definition at line 2677 of file GeometryCore.h.

References AuxDet(), DetectorEnclosureBox(), DetectorName(), geo::PlaneGeo::ID(), art::detail::indent(), geo::AuxDetSensitiveGeo::MaxVerbosity, geo::AuxDetGeo::MaxVerbosity, geo::OpDetGeo::MaxVerbosity, geo::WireGeo::MaxVerbosity, geo::TPCGeo::MaxVerbosity, geo::PlaneGeo::MaxVerbosity, NAuxDets(), Ncryostats(), geo::TPCGeo::Nplanes(), geo::AuxDetGeo::NSensitiveVolume(), geo::PlaneGeo::Nwires(), geo::TPCGeo::Plane(), geo::AuxDetSensitiveGeo::PrintAuxDetInfo(), geo::AuxDetGeo::PrintAuxDetInfo(), geo::OpDetGeo::PrintOpDetInfo(), geo::PlaneGeo::PrintPlaneInfo(), geo::TPCGeo::PrintTPCInfo(), geo::WireGeo::PrintWireInfo(), geo::AuxDetGeo::SensitiveVolume(), SignalType(), geo::SignalTypeName(), w, and geo::PlaneGeo::Wire().

Referenced by geo::DumpGeometry::dumpGeometryCore(), Info(), and SurfaceY().

2678 {
2679 
2680  out << "Detector " << DetectorName() << " has " << Ncryostats() << " cryostats and " << NAuxDets()
2681  << " auxiliary detectors:";
2682 
2683  auto const& detEnclosureBox = DetectorEnclosureBox();
2684  out << "\n"
2685  << indent << "Detector enclosure: " << detEnclosureBox.Min() << " -- "
2686  << detEnclosureBox.Max() << " cm => ( " << detEnclosureBox.SizeX() << " x "
2687  << detEnclosureBox.SizeY() << " x " << detEnclosureBox.SizeZ() << " ) cm^3";
2688 
2689  for (auto const& cryostat : Iterate<CryostatGeo>()) {
2690  out << "\n" << indent;
2691  cryostat.PrintCryostatInfo(std::forward<Stream>(out), indent + " ", cryostat.MaxVerbosity);
2692 
2693  const unsigned int nTPCs = cryostat.NTPC();
2694  for (unsigned int t = 0; t < nTPCs; ++t) {
2695  const TPCGeo& tpc = cryostat.TPC(t);
2696 
2697  out << "\n" << indent << " ";
2698  tpc.PrintTPCInfo(std::forward<Stream>(out), indent + " ", tpc.MaxVerbosity);
2699 
2700  const unsigned int nPlanes = tpc.Nplanes();
2701  for (unsigned int p = 0; p < nPlanes; ++p) {
2702  const PlaneGeo& plane = tpc.Plane(p);
2703  const unsigned int nWires = plane.Nwires();
2704 
2705  out << "\n" << indent << " ";
2706  plane.PrintPlaneInfo(std::forward<Stream>(out), indent + " ", plane.MaxVerbosity);
2707  SigType_t const sigType = SignalType(plane.ID());
2708  out << "\n"
2709  << indent << " "
2710  << "signal type: " << SignalTypeName(sigType) << " (" << static_cast<int>(sigType)
2711  << ")";
2712 
2713  for (unsigned int w = 0; w < nWires; ++w) {
2714  const WireGeo& wire = plane.Wire(w);
2715  WireID wireID(plane.ID(), w);
2716 
2717  // the wire should be aligned on z axis, half on each side of 0,
2718  // in its local frame
2719  out << "\n" << indent << " " << wireID << " ";
2720  wire.PrintWireInfo(std::forward<Stream>(out), indent + " ", wire.MaxVerbosity);
2721  } // for wire
2722  } // for plane
2723  } // for TPC
2724 
2725  unsigned int nOpDets = cryostat.NOpDet();
2726  for (unsigned int iOpDet = 0; iOpDet < nOpDets; ++iOpDet) {
2727  OpDetGeo const& opDet = cryostat.OpDet(iOpDet);
2728  out << "\n" << indent << " [OpDet #" << iOpDet << "] ";
2729  opDet.PrintOpDetInfo(std::forward<Stream>(out), indent + " ", opDet.MaxVerbosity);
2730  } // for
2731  } // for cryostat
2732 
2733  unsigned int const nAuxDets = NAuxDets();
2734  for (unsigned int iDet = 0; iDet < nAuxDets; ++iDet) {
2735  AuxDetGeo const& auxDet = AuxDet(iDet);
2736 
2737  out << "\n" << indent << "[#" << iDet << "] ";
2738  auxDet.PrintAuxDetInfo(std::forward<Stream>(out), indent + " ", auxDet.MaxVerbosity);
2739 
2740  unsigned int const nSensitive = auxDet.NSensitiveVolume();
2741  switch (nSensitive) {
2742  case 0: break;
2743  case 1: {
2744  AuxDetSensitiveGeo const& auxDetS = auxDet.SensitiveVolume(0U);
2745  out << "\n" << indent << " ";
2746  auxDetS.PrintAuxDetInfo(std::forward<Stream>(out), indent + " ", auxDetS.MaxVerbosity);
2747  break;
2748  }
2749  default:
2750  for (unsigned int iSens = 0; iSens < nSensitive; ++iSens) {
2751  out << "\n" << indent << "[#" << iSens << "] ";
2752  AuxDetSensitiveGeo const& auxDetS = auxDet.SensitiveVolume(iSens);
2753  auxDetS.PrintAuxDetInfo(std::forward<Stream>(out), indent + " ", auxDetS.MaxVerbosity);
2754  } // for
2755  break;
2756  } // if sensitive detectors
2757 
2758  } // for auxiliary detector
2759 
2760  out << '\n';
2761 
2762 } // geo::GeometryCore::Print()
BoxBoundedGeo DetectorEnclosureBox(std::string const &name="volDetEnclosure") const
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
std::string indent(std::size_t const i)
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
SigType_t SignalType(PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
std::string const & DetectorName() const
Returns a string with the name of the detector, as configured.
Definition: GeometryCore.h:203
Float_t w
Definition: plot.C:20
std::string SignalTypeName(geo::SigType_t sigType)
Returns the name of the specified signal type.
Definition: geo_types.cxx:18
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
std::string const& 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 184 of file GeometryCore.h.

References fROOTfile.

Referenced by geo::DumpGeometry::dumpGeometryCore(), and evgen::GENIEGen::GENIEGen().

184 { 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 192 of file GeometryCore.cxx.

Referenced by evgen::BaseRadioGen::BaseRadioGen(), evgen::LightSource::checkMaterials(), FindAllVolumePaths(), FindAllVolumes(), FindDetectorEnclosure(), evgen::GENIEGen::GENIEGen(), evgen::RadioGen::SampleOne(), and SurfaceY().

193  {
194  return gGeoManager;
195  }
std::vector< 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 1536 of file GeometryCore.cxx.

References fChannelMapAlg.

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

1537  {
1538  return fChannelMapAlg->ROPtoTPCs(ropid);
1539  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
std::vector< 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 1530 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by HasElement().

1531  {
1532  return fChannelMapAlg->ROPtoWirePlanes(ropid);
1533  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
SigType_t geo::GeometryCore::SignalType ( 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 469 of file GeometryCore.cxx.

References WirePlaneToROP().

Referenced by caldata::CalWireAna::analyze(), lar::example::AnalysisExample::analyze(), evdb_tool::DrawWireHist::BookHistogram(), evdb_tool::DrawRawHist::BookHistogram(), cluster::HoughBaseAlg::FastTransform(), reco3d::TripletFinder::FillHitMap(), hit::HitCheater::FindHitsOnChannel(), GetBeginPlaneID(), GetEndROPID(), cluster::MergeClusterAlg::GlobalWire(), cluster::BlurredClusteringAlg::GlobalWire(), shower::EMShowerAlg::GlobalWire_(), cluster::HoughBaseAlg::HoughBaseAlg(), shwf::ShowerReco::LongTransEnergy(), trkf::SpacePointAlg::makeSpacePoints(), Print(), evd::TWQMultiTPCProjectionView::PrintCharge(), evd::TWQProjectionView::PrintCharge(), hit::TTHitFinder::produce(), hit::RawHitFinder::produce(), hit::FFTHitFinder::produce(), cluster::DBcluster::produce(), caldata::CalWire::produce(), reco3d::SpacePointSolver::produce(), trkf::SpacePts::produce(), detsim::SimWire::produce(), evd::RawDataDrawer::QueueDrawingBoxes(), lariov::DetPedestalRetrievalAlg::Reconfigure(), hit::RFFHitFinderAlg::Run(), evd::TWireProjPad::TWireProjPad(), trkf::SpacePointAlg::update(), Views(), and evd::RecoBaseDrawer::Wire2D().

470  {
471  // map wire plane -> readout plane -> first channel,
472  // then use SignalType(channel)
473 
474  auto const ropid = WirePlaneToROP(pid);
475  if (!ropid.isValid) {
476  throw cet::exception("GeometryCore") << "SignalType(): Mapping of wire plane "
477  << std::string(pid) << " to readout plane failed!\n";
478  }
479  return SignalType(ropid);
480  }
readout::ROPID WirePlaneToROP(PlaneID const &planeid) const
Returns the ID of the ROP planeid belongs to.
SigType_t SignalType(PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
SigType_t geo::GeometryCore::SignalType ( raw::ChannelID_t const  channel) const

Returns the type of signal on the specified TPC channel.

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

Definition at line 463 of file GeometryCore.cxx.

References fChannelMapAlg.

464  {
465  return fChannelMapAlg->SignalTypeForChannel(channel);
466  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
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 1554 of file GeometryCore.cxx.

References fChannelMapAlg.

1555  {
1556  return fChannelMapAlg->SignalTypeForROPID(ropid);
1557  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
void geo::GeometryCore::SortGeometry ( GeoObjectSorter const &  sorter)
private

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

Definition at line 163 of file GeometryCore.cxx.

References AuxDets(), Cryostats(), geo::GeoObjectSorter::SortAuxDets(), and geo::GeoObjectSorter::SortCryostats().

Referenced by ApplyChannelMap().

164  {
165  mf::LogInfo("GeometryCore") << "Sorting volumes...";
166 
167  sorter.SortAuxDets(AuxDets());
168  sorter.SortCryostats(Cryostats());
169 
171  for (CryostatGeo& cryo : Cryostats()) {
172  cryo.SortSubVolumes(sorter);
173  cryo.UpdateAfterSorting(CryostatID(c));
174  ++c;
175  }
176  }
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
AuxDetList_t & AuxDets()
Return the internal auxdet list.
unsigned int CryostatID_t
Type for the ID number.
Definition: geo_types.h:193
CryostatList_t & Cryostats()
Return the internal cryostat list.
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 251 of file GeometryCore.h.

References DetectorEnclosureBox(), FindAllVolumePaths(), FindAllVolumes(), fSurfaceY, GetWorldVolumeName(), art::detail::indent(), Info(), MassBetweenPoints(), Material(), MaterialName(), Print(), ROOTGeoManager(), TotalMass(), and VolumeName().

Referenced by evgen::CosmicsGen::produce().

251 { return fSurfaceY; }
double fSurfaceY
The point where air meets earth for this detector.
PlaneID geo::GeometryCore::ThirdPlane ( PlaneID const &  pid1,
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 1292 of file GeometryCore.cxx.

References Nplanes(), and geo::PlaneID::Plane.

Referenced by ThirdPlane_dTdW(), and ThirdPlaneSlope().

1293  {
1294  // how many planes in the TPC pid1 belongs to:
1295  const unsigned int nPlanes = Nplanes(pid1);
1296  if (nPlanes != 3) {
1297  throw cet::exception("GeometryCore")
1298  << "ThirdPlane() supports only TPCs with 3 planes, and I see " << nPlanes << " instead\n";
1299  }
1300 
1301  PlaneID::PlaneID_t target_plane = nPlanes;
1302  for (PlaneID::PlaneID_t iPlane = 0; iPlane < nPlanes; ++iPlane) {
1303  if ((iPlane == pid1.Plane) || (iPlane == pid2.Plane)) continue;
1304  if (target_plane != nPlanes) {
1305  throw cet::exception("GeometryCore")
1306  << "ThirdPlane() found too many planes that are not " << std::string(pid1) << " nor "
1307  << std::string(pid2) << "! (first " << target_plane << ", then " << iPlane << ")\n";
1308  } // if we had a target already
1309  target_plane = iPlane;
1310  } // for
1311  if (target_plane == nPlanes) {
1312  throw cet::exception("GeometryCore")
1313  << "ThirdPlane() can't find a plane that is not " << std::string(pid1) << " nor "
1314  << std::string(pid2) << "!\n";
1315  }
1316 
1317  return PlaneID(pid1, target_plane);
1318  }
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:464
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
unsigned int Nplanes(TPCID const &tpcid=tpc_zero) const
Returns the total number of planes in the specified TPC.
Definition: GeometryCore.h:977
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
double geo::GeometryCore::ThirdPlane_dTdW ( PlaneID const &  pid1,
double  slope1,
PlaneID const &  pid2,
double  slope2,
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 1352 of file GeometryCore.cxx.

References ComputeThirdPlane_dTdW(), geo::PlaneGeo::PhiZ(), geo::TPCGeo::Plane(), TPC(), and geo::PlaneGeo::WirePitch().

Referenced by ThirdPlane_dTdW(), and ThirdPlaneSlope().

1357  {
1358  CheckIndependentPlanesOnSameTPC(pid1, pid2, "ThirdPlane_dTdW()");
1359 
1360  TPCGeo const& TPC = this->TPC(pid1);
1361 
1362  double angle[3], pitch[3];
1363  PlaneGeo const* const planes[3] = {
1364  &TPC.Plane(pid1), &TPC.Plane(pid2), &TPC.Plane(output_plane)};
1365 
1366  // We need wire pitch and "wire coordinate direction" for each plane.
1367  // The latter is perpendicular to the wire orientation.
1368  // PlaneGeo::PhiZ() defines the right orientation too.
1369  for (size_t i = 0; i < 3; ++i) {
1370  angle[i] = planes[i]->PhiZ();
1371  pitch[i] = planes[i]->WirePitch();
1372  }
1373 
1374  return ComputeThirdPlane_dTdW(
1375  angle[0], pitch[0], slope1, angle[1], pitch[1], slope2, angle[2], pitch[2]);
1376  }
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.
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
double geo::GeometryCore::ThirdPlane_dTdW ( PlaneID const &  pid1,
double  slope1,
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 1379 of file GeometryCore.cxx.

References ThirdPlane(), and ThirdPlane_dTdW().

1383  {
1384  PlaneID target_plane = ThirdPlane(pid1, pid2);
1385  return ThirdPlane_dTdW(pid1, slope1, pid2, slope2, target_plane);
1386  }
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
double ThirdPlane_dTdW(PlaneID const &pid1, double slope1, PlaneID const &pid2, double slope2, PlaneID const &output_plane) const
Returns dT/dW on the third plane, given it in the other two.
PlaneID ThirdPlane(PlaneID const &pid1, PlaneID const &pid2) const
Returns the plane that is not in the specified arguments.
double geo::GeometryCore::ThirdPlaneSlope ( PlaneID const &  pid1,
double  slope1,
PlaneID const &  pid2,
double  slope2,
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 1321 of file GeometryCore.cxx.

References ComputeThirdPlaneSlope(), geo::PlaneGeo::PhiZ(), geo::TPCGeo::Plane(), and TPC().

Referenced by trkf::CCTrackMaker::FillEndMatch(), trkf::CCTrackMaker::PlnMatch(), and ThirdPlaneSlope().

1326  {
1327  CheckIndependentPlanesOnSameTPC(pid1, pid2, "ThirdPlaneSlope()");
1328 
1329  TPCGeo const& TPC = this->TPC(pid1);
1330 
1331  // We need the "wire coordinate direction" for each plane.
1332  // This is perpendicular to the wire orientation.
1333  // PlaneGeo::PhiZ() defines the right orientation too.
1334  return ComputeThirdPlaneSlope(TPC.Plane(pid1).PhiZ(),
1335  slope1,
1336  TPC.Plane(pid2).PhiZ(),
1337  slope2,
1338  TPC.Plane(output_plane).PhiZ());
1339  }
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
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::ThirdPlaneSlope ( PlaneID const &  pid1,
double  slope1,
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 1342 of file GeometryCore.cxx.

References ThirdPlane(), and ThirdPlaneSlope().

1346  {
1347  PlaneID target_plane = ThirdPlane(pid1, pid2);
1348  return ThirdPlaneSlope(pid1, slope1, pid2, slope2, target_plane);
1349  }
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
double ThirdPlaneSlope(PlaneID const &pid1, double slope1, PlaneID const &pid2, double slope2, PlaneID const &output_plane) const
Returns the slope on the third plane, given it in the other two.
PlaneID ThirdPlane(PlaneID const &pid1, PlaneID const &pid2) const
Returns the plane that is not in the specified arguments.
double geo::GeometryCore::ThirdPlaneSlope ( PlaneID::PlaneID_t  plane1,
double  slope1,
PlaneID::PlaneID_t  plane2,
double  slope2,
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 1586 of file GeometryCore.h.

References ComputeThirdPlane_dTdW(), ComputeThirdPlaneSlope(), cryostat_zero, GetClosestOpDet(), NOpDets(), OpChannel(), OpDetGeoFromOpChannel(), OpDetGeoFromOpDet(), OpDetGeoName(), ThirdPlane_dTdW(), and ThirdPlaneSlope().

1591  {
1592  return ThirdPlaneSlope(PlaneID(tpcid, plane1), slope1, PlaneID(tpcid, plane2), slope2);
1593  }
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
double ThirdPlaneSlope(PlaneID const &pid1, double slope1, PlaneID const &pid2, double slope2, PlaneID const &output_plane) const
Returns the slope on the third plane, given it in the other two.
double geo::GeometryCore::TotalMass ( ) const
inline

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

Definition at line 319 of file GeometryCore.h.

Referenced by evgen::GENIEGen::GENIEGen(), and SurfaceY().

319 { 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).
Definition: GeometryCore.h:319
double geo::GeometryCore::TotalMass ( std::string  vol) const

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

Definition at line 1021 of file GeometryCore.cxx.

1022  {
1023  //the TGeoNode::GetVolume() returns the TGeoVolume of the detector outline
1024  //and ROOT calculates the mass in kg for you
1025  TGeoVolume* gvol = gGeoManager->FindVolumeFast(vol.c_str());
1026  if (gvol) return gvol->Weight();
1027 
1028  throw cet::exception("GeometryCore")
1029  << "could not find specified volume '" << vol << " 'to determine total mass\n";
1030  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int geo::GeometryCore::TotalNTPC ( ) const

Returns the total number of TPCs in the detector.

Definition at line 807 of file GeometryCore.cxx.

References begin(), Cryostats(), end(), geo::CryostatGeo::NTPC(), and sum.

Referenced by Iterate().

808  {
809  // it looks like C++11 lambdas have made STL algorithms easier to use,
810  // but only so much:
811  return std::accumulate(
812  Cryostats().begin(), Cryostats().end(), 0U, [](unsigned int sum, CryostatGeo const& cryo) {
813  return sum + cryo.NTPC();
814  });
815  }
details::begin_type< T > begin() const
Initializes the specified ID with the ID of the first cryostat.
Definition: GeometryCore.h:529
details::end_type< T > end() const
Initializes the specified ID with the ID of the first cryostat.
Definition: GeometryCore.h:535
CryostatList_t & Cryostats()
Return the internal cryostat list.
Double_t sum
Definition: plot.C:31
TPCGeo const& geo::GeometryCore::TPC ( TPCID const &  tpcid = tpc_zero) 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.

Definition at line 722 of file GeometryCore.h.

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

Referenced by hit::MagDriftAna::analyze(), larg4::ISCalcCorrelated::AngleToEFieldAtStep(), pma::ProjectionMatchingAlg::buildShowerSeg(), phot::PropagationTimeModel::cathodeCentre(), pma::VtxCandidate::ComputeMse2D(), DetHalfHeight(), DetHalfWidth(), DetLength(), hit::DisambigCheater::DisambigCheater(), larg4::LArVoxelReadout::DriftIonizationElectrons(), larg4::ISCalcCorrelated::EFieldAtStep(), larg::LArSimChannelAna::ensureHists(), hit::MagDriftAna::ensureHists(), trkf::SpacePointAlg::fillComplexSpacePoint(), tca::FillWireHitRange(), tca::FindShowers3D(), lar_pandora::detector_functions::GetDetectorType(), GetElement(), GetEndPlaneID(), GetEndWireID(), GetLArTPCVolumeName(), trkf::FeatureTracker::GetProjectedEnds(), nnet::TrainingDataAlg::getProjection(), GetTPCFrontFaceCenter(), lar_pandora::LArPandoraInput::GetTrueX0(), pma::ProjectionMatchingAlg::guideEndpoints(), IncrementID(), pma::Track3D::InitFromMiddle(), trkf::SpacePointAlg::makeSpacePoints(), pma::PMAlgTracker::matchCluster(), larg4::OpFastScintillation::OpFastScintillation(), Plane(), PlanePitch(), trkf::PMAlgTrajFitter::produce(), detsim::DriftElectronstoPlane::produce(), detsim::SimDriftElectrons::produce(), trkf::PMAlgTrackMaker::produce(), evgen::ActiveVolumeVertexSampler::sample_vertex_pos(), tca::SaveCRInfo(), phot::SemiAnalyticalModel::SemiAnalyticalModel(), lar_pandora::LArPandoraGeometry::ShouldSwitchUV(), trkf::CCTrackMaker::TagCosmics(), lar_pandora::VintageLArTPCThreeView::TargetViewU(), lar_pandora::VintageLArTPCThreeView::TargetViewV(), ThirdPlane_dTdW(), ThirdPlaneSlope(), apa::APAGeometryAlg::ThreeChanPos(), calo::GnocchiCalorimetry::TrajectoryToWirePosition(), apa::DisambigAlg::TrivialDisambig(), DUNE::NeutrinoTrackingEff::truthLength(), trkf::SpacePointAlg::update(), apa::DisambigAlg::UseEndPts(), pma::ProjectionMatchingAlg::validate(), pma::ProjectionMatchingAlg::validate_on_adc_test(), evd::RecoBaseDrawer::Vertex2D(), trkf::VertexFitAlg::VertexFit(), WireAngleToVertical(), and WirePitch().

722 { return Cryostat(tpcid).TPC(tpcid); }
CryostatGeo const & Cryostat(CryostatID const &cryoid=cryostat_zero) const
Returns the specified cryostat.
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
Definition: CryostatGeo.cxx:84
TPCGeo const* geo::GeometryCore::TPCPtr ( 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 735 of file GeometryCore.h.

References CryostatPtr(), and geo::CryostatGeo::TPCPtr().

Referenced by GetElementPtr(), GetEndPlaneID(), GetEndWireID(), HasPlane(), and PlanePtr().

736  {
737  CryostatGeo const* pCryo = CryostatPtr(tpcid);
738  return pCryo ? pCryo->TPCPtr(tpcid) : nullptr;
739  }
CryostatGeo const * CryostatPtr(CryostatID const &cryoid) const
Returns the specified cryostat.
Definition: GeometryCore.h:477
std::vector< 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 1497 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by HasElement().

1498  {
1499  return fChannelMapAlg->TPCsetToTPCs(tpcsetid);
1500  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
readout::TPCsetID geo::GeometryCore::TPCtoTPCset ( TPCID const &  tpcid) const

Returns the ID of the TPC set tpcid belongs to.

Definition at line 1491 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by FindTPCsetAtPosition(), and HasElement().

1492  {
1493  return fChannelMapAlg->TPCtoTPCset(tpcid);
1494  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
void geo::GeometryCore::UpdateAfterSorting ( )
private

Performs all the updates needed after sorting.

Definition at line 179 of file GeometryCore.cxx.

References allViews, Cryostats(), and Ncryostats().

Referenced by ApplyChannelMap().

180  {
181  for (size_t c = 0; c < Ncryostats(); ++c)
182  Cryostats()[c].UpdateAfterSorting(CryostatID(c));
183 
184  allViews.clear();
185  for (auto const& tpc : Iterate<TPCGeo>()) {
186  auto const& TPCviews = tpc.Views();
187  allViews.insert(TPCviews.cbegin(), TPCviews.cend());
188  }
189  }
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
std::set< View_t > allViews
All views in the detector.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
CryostatList_t & Cryostats()
Return the internal cryostat list.
View_t geo::GeometryCore::View ( 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 489 of file GeometryCore.cxx.

References geo::kUnknown, Plane(), and geo::PlaneGeo::View().

Referenced by nnet::WaveformDenoiseTest::analyze(), nnet::NoiseWaveformDump::analyze(), nnet::RawWaveformDump::analyze(), nnet::RawWaveformClnSigDump::analyze(), calo::TrackCalorimetryAlg::AnalyzeHit(), apa::APAGeometryAlg::APAChannelsIntersect(), apa::APAGeometryAlg::APAView(), tca::FillWireHitRange(), hit::HitCheater::FindHitsOnChannel(), apa::APAGeometryAlg::FirstChannelInView(), corner::CornerFinderAlg::get_feature_points(), corner::CornerFinderAlg::get_feature_points_LineIntegralScore(), GetBeginPlaneID(), GetEndROPID(), quad::GetPts2D(), apa::APAGeometryAlg::Init(), apa::DisambigAlg::MakeCloseHits(), apa::APAGeometryAlg::NearestWireIDOnChan(), reco3d::SpacePointSolver::produce(), cluster::TrajCluster::produce(), vertex::FeatureVertexFinder::produce(), shower::TCShowerTemplateMaker::showerProfileTrue(), lar_pandora::DUNEFarDetVDThreeView::TargetViewU(), lar_pandora::ProtoDUNEDualPhase::TargetViewU(), lar_pandora::VintageLArTPCThreeView::TargetViewU(), lar_pandora::DUNEFarDetVDThreeView::TargetViewV(), lar_pandora::ProtoDUNEDualPhase::TargetViewV(), lar_pandora::VintageLArTPCThreeView::TargetViewV(), lar_pandora::DUNEFarDetVDThreeView::TargetViewW(), lar_pandora::ICARUS::TargetViewW(), lar_pandora::VintageLArTPCThreeView::TargetViewW(), cheat::BackTracker::TrackIdToSimIDEs_Ps(), View(), and Views().

490  {
491  return pid ? Plane(pid).View() : kUnknown;
492  }
Unknown view.
Definition: geo_types.h:142
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:166
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 483 of file GeometryCore.cxx.

References ChannelToROP(), raw::InvalidChannelID, geo::kUnknown, and View().

484  {
485  return (channel == raw::InvalidChannelID) ? kUnknown : View(ChannelToROP(channel));
486  }
Unknown view.
Definition: geo_types.h:142
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
readout::ROPID ChannelToROP(raw::ChannelID_t channel) const
View_t View(PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
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 1548 of file GeometryCore.cxx.

References fChannelMapAlg, and View().

1549  {
1550  return View(fChannelMapAlg->FirstWirePlaneInROP(ropid));
1551  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
View_t View(PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
std::string geo::GeometryCore::VolumeName ( 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 928 of file GeometryCore.cxx.

References util::abs(), and WorldVolume().

Referenced by larg4::LArG4Ana::analyze(), LArStackingAction::InsideTPC(), and SurfaceY().

929  {
930  // check that the given point is in the World volume at least
931  TGeoVolume const* volWorld = WorldVolume();
932  double halflength = ((TGeoBBox*)volWorld->GetShape())->GetDZ();
933  double halfheight = ((TGeoBBox*)volWorld->GetShape())->GetDY();
934  double halfwidth = ((TGeoBBox*)volWorld->GetShape())->GetDX();
935  if (std::abs(point.x()) > halfwidth || std::abs(point.y()) > halfheight ||
936  std::abs(point.z()) > halflength) {
937  mf::LogWarning("GeometryCoreBadInputPoint")
938  << "point (" << point.x() << "," << point.y() << "," << point.z() << ") "
939  << "is not inside the world volume "
940  << " half width = " << halfwidth << " half height = " << halfheight
941  << " half length = " << halflength << " returning unknown volume name";
942  return "unknownVolume";
943  }
944 
945  return gGeoManager->FindNode(point.X(), point.Y(), point.Z())->GetName();
946  }
constexpr auto abs(T v)
Returns the absolute value of the argument.
TGeoVolume const * WorldVolume() const
Returns a pointer to the world volume.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
WireGeo const& geo::GeometryCore::Wire ( 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 1210 of file GeometryCore.h.

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

Referenced by ChannelsIntersect(), lar_pandora::LArPandoraInput::CreatePandoraHits2D(), util::GeometryUtilities::GeometryUtilities(), GetElement(), lar_pandora::PFParticleHitDumper::GetUVW(), IncrementID(), trkf::Track3DKalmanHitAlg::makeSeed(), WireEndPoints(), and WireIDToWireGeo().

1210 { return Plane(wireid).Wire(wireid); }
WireGeo const & Wire(unsigned int iwire) const
Definition: PlaneGeo.cxx:465
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
double geo::GeometryCore::WireAngleToVertical ( View_t  view,
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 781 of file GeometryCore.cxx.

References geo::TPCGeo::Nplanes(), geo::TPCGeo::Plane(), geo::PlaneGeo::ThetaZ(), TPC(), geo::PlaneGeo::View(), and geo::PlaneGeo::ViewName().

Referenced by ShowerRecoTools::ShowerUnidirectiondEdx::CalculateElement(), util::GeometryUtilities::CalculatePitch(), util::GeometryUtilities::CalculatePitchPolar(), util::GeometryUtilities::Get2DangleFrom3D(), calo::GnocchiCalorimetry::GetPitch(), shower::EMShowerAlg::MakeShower(), util::GeometryUtilities::PitchInView(), calo::ShowerCalorimetry::produce(), calo::Calorimetry::produce(), lar_pandora::detector_functions::WireAngle(), lar_pandora::PFParticleHitDumper::YZtoU(), and lar_pandora::PFParticleHitDumper::YZtoV().

782  {
783  // loop over the planes in cryostat 0, tpc 0 to find the plane with the
784  // specified view
785  TPCGeo const& TPC = this->TPC(tpcid);
786  for (unsigned int p = 0; p < TPC.Nplanes(); ++p) {
787  PlaneGeo const& plane = TPC.Plane(p);
788  if (plane.View() == view) return plane.ThetaZ();
789  } // for
790  throw cet::exception("GeometryCore")
791  << "WireAngleToVertical(): no view \"" << PlaneGeo::ViewName(view) << "\" (#" << ((int)view)
792  << ") in " << std::string(tpcid);
793  }
static std::string ViewName(geo::View_t view)
Returns the name of the specified view.
Definition: PlaneGeo.cxx:682
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Length_t geo::GeometryCore::WireCoordinate ( Point_t const &  pos,
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 1093 of file GeometryCore.cxx.

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

Referenced by tca::ChgFracBetween(), tca::ChgFracNearEnd(), evd::RecoBaseDrawer::DrawProng2D(), evd::RecoBaseDrawer::DrawTrackVertexAssns2D(), trkf::CCTrackMaker::FillEndMatch(), tca::Find3DVertices(), trkf::CCTrackMaker::FindMaybeVertices(), tca::FitTP3Ds(), shower::TCShowerElectronLikelihood::getShowerProfile(), cluster::MergeClusterAlg::GlobalWire(), cluster::BlurredClusteringAlg::GlobalWire(), shower::EMShowerAlg::GlobalWire_(), ems::Hit2D::Hit2D(), lar_cluster3d::PCASeedFinderAlg::LineFit2DHits(), lar_cluster3d::HoughSeedFinderAlg::LineFit2DHits(), tca::MakeBareTP(), shower::TCShowerAlg::makeShowers(), tca::MakeTP3D(), evd::SimulationDrawer::MCTruthVectors2D(), shower::LArPandoraShowerAlg::OrderShowerHits(), shower::EMShowerAlg::OrderShowerHits_(), trkf::CCTrackMaker::PlnMatch(), tca::PosInPlane(), trkf::CCTrackMaker::PrintClusters(), evd::RecoBaseDrawer::Prong2D(), tca::SetSection(), shower::TCShowerTemplateMaker::showerProfile(), shower::TCShowerTemplateMaker::showerProfileTrue(), evd::RecoBaseDrawer::Slice2D(), trkf::TrackLineFitAlg::TrkLineFit(), pma::ProjectionMatchingAlg::validate(), pma::ProjectionMatchingAlg::validate_on_adc(), pma::ProjectionMatchingAlg::validate_on_adc_test(), evd::RecoBaseDrawer::Vertex2D(), and trkf::VertexFitAlg::VertexFit().

1094  {
1095  return Plane(planeid).WireCoordinate(pos);
1096  }
double WireCoordinate(geo::Point_t const &point) const
Returns the coordinate of the point on the plane, in wire units.
Definition: PlaneGeo.h:797
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
void geo::GeometryCore::WireEndPoints ( 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 1130 of file GeometryCore.cxx.

References util::abs(), geo::GeometryCore::Segment< Point >::end(), and geo::GeometryCore::Segment< Point >::start().

Referenced by trkf::SeedFinderAlgorithm::CalculateGeometricalElements(), ChannelsIntersect(), lar_cluster3d::StandardHit3DBuilder::DistanceFromPointToHitWire(), trkf::SeedFinderAlgorithm::GetHitDistAndProj(), quad::GetPts2D(), and apa::DisambigAlg::TrivialDisambig().

1131  {
1132  Segment_t result = WireEndPoints(wireid);
1133 
1134  xyzStart[0] = result.start().X();
1135  xyzStart[1] = result.start().Y();
1136  xyzStart[2] = result.start().Z();
1137  xyzEnd[0] = result.end().X();
1138  xyzEnd[1] = result.end().Y();
1139  xyzEnd[2] = result.end().Z();
1140 
1141  if (xyzEnd[2] < xyzStart[2]) {
1142  //ensure that "End" has higher z-value than "Start"
1143  std::swap(xyzStart[0], xyzEnd[0]);
1144  std::swap(xyzStart[1], xyzEnd[1]);
1145  std::swap(xyzStart[2], xyzEnd[2]);
1146  }
1147  if (xyzEnd[1] < xyzStart[1] && std::abs(xyzEnd[2] - xyzStart[2]) < 0.01) {
1148  // if wire is vertical ensure that "End" has higher y-value than "Start"
1149  std::swap(xyzStart[0], xyzEnd[0]);
1150  std::swap(xyzStart[1], xyzEnd[1]);
1151  std::swap(xyzStart[2], xyzEnd[2]);
1152  }
1153  }
Segment< Point_t > Segment_t
Definition: GeometryCore.h:136
constexpr auto abs(T v)
Returns the absolute value of the argument.
void swap(lar::deep_const_fwd_iterator_nested< CITER, INNERCONTEXTRACT > &a, lar::deep_const_fwd_iterator_nested< CITER, INNERCONTEXTRACT > &b)
void WireEndPoints(WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
geo::GeometryCore::Segment< geo::Point_t > geo::GeometryCore::WireEndPoints ( WireID const &  wireID) const
inline

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)

Definition at line 2668 of file GeometryCore.h.

References geo::WireGeo::GetEnd(), geo::WireGeo::GetStart(), and Wire().

2670 {
2671  WireGeo const& wire = Wire(wireid);
2672  return {wire.GetStart(), wire.GetEnd()};
2673 }
WireGeo const & Wire(WireID const &wireid) const
Returns the specified wire.
bool geo::GeometryCore::WireIDIntersectionCheck ( const WireID wid1,
const WireID wid2 
) const
private

Wire ID check for WireIDsIntersect methods.

Definition at line 1644 of file GeometryCore.cxx.

References geo::TPCID::asTPCID(), HasWire(), Nwires(), geo::PlaneID::Plane, and geo::WireID::planeID().

Referenced by ChannelsIntersect().

1645  {
1646  if (wid1.asTPCID() != wid2) {
1647  mf::LogError("WireIDIntersectionCheck")
1648  << "Comparing two wires on different TPCs: return failure.";
1649  return false;
1650  }
1651  if (wid1.Plane == wid2.Plane) {
1652  mf::LogError("WireIDIntersectionCheck")
1653  << "Comparing two wires in the same plane: return failure";
1654  return false;
1655  }
1656  if (!HasWire(wid1)) {
1657  mf::LogError("WireIDIntersectionCheck")
1658  << "1st wire " << wid1 << " does not exist (max wire number: " << Nwires(wid1.planeID())
1659  << ")";
1660  return false;
1661  }
1662  if (!HasWire(wid2)) {
1663  mf::LogError("WireIDIntersectionCheck")
1664  << "2nd wire " << wid2 << " does not exist (max wire number: " << Nwires(wid2.planeID())
1665  << ")";
1666  return false;
1667  }
1668  return true;
1669  }
bool HasWire(WireID const &wireid) const
Returns whether we have the specified wire.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
unsigned int Nwires(PlaneID const &planeid) const
Returns the total number of wires in the specified plane.
bool geo::GeometryCore::WireIDsIntersect ( WireID const &  wid1,
WireID const &  wid2,
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.

Referenced by apa::APAGeometryAlg::APAChannelsIntersect(), ChannelsIntersect(), apa::DisambigAlg::CompareViews(), shower::EMShowerAlg::Construct3DPoint_(), evd::TWQProjectionView::FindEndPoint(), evd::TWQProjectionView::FindLineLength(), IntersectionPoint(), reco3d::IntersectionCache::ISect(), lar_cluster3d::StandardHit3DBuilder::makeDeadChannelPair(), lar_cluster3d::SnippetHit3DBuilder::makeDeadChannelPair(), lar_cluster3d::StandardHit3DBuilder::makeHitPair(), and apa::APAGeometryAlg::ThreeChanPos().

bool geo::GeometryCore::WireIDsIntersect ( WireID const &  wid1,
WireID const &  wid2,
WireIDIntersection widIntersect 
) const

Computes the intersection between two wires.

Parameters
wid1ID of the first wire
wid2ID of the other wire
widIntersect(output) the coordinate of the intersection point
Returns
whether an intersection was found within the TPC

The "intersection" refers to the projection of the wires into the same $ x = 0 $ plane. Wires are assumed to have at most one intersection. If wires are parallel, widIntersect will have the two components set to infinity (std::numeric_limits<>::infinity()) and the TPC number set to invalid (geo::TPCID::InvalidID). Also, false is returned. If the intersection is outside the TPC, false is also returned, but the widIntersect will contain the coordinates of that intersection. The TPC number is still set to invalid, although the intersection might belong to a valid TPC somewhere else.

Deprecated:
This method uses arbitrary assumptions and should not be used. Use the interface returning a full vector instead.
Length_t geo::GeometryCore::WirePitch ( PlaneID const &  planeid = plane_zero) 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 763 of file GeometryCore.cxx.

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

Referenced by vertex::FeatureVertexFinderAna::analyze(), shwf::ShowerReco::beginJob(), mvapid::MVAAlg::CalcSegmentdEdxDist(), ShowerRecoTools::ShowerUnidirectiondEdx::CalculateElement(), ShowerRecoTools::ShowerTrajPointdEdx::CalculateElement(), trkf::SeedFinderAlgorithm::CalculateGeometricalElements(), evd::RecoBaseDrawer::Cluster2D(), lar_cluster3d::DBScanAlg::configure(), lar_pandora::LArPandoraInput::CreatePandoraHits2D(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), tca::dEdx(), trkf::Track3DKalmanSPS::dQdxCalc(), evd::RecoBaseDrawer::DrawTrack2D(), cluster::EndPointAlg::EndPoint(), trkf::SpacePointAlg::fillComplexSpacePoint(), trkf::SpacePointAlg::fillSpacePoint(), tca::FillWireHitRange(), apa::DisambigAlg::FindChanTimeEndPts(), lar_cluster3d::HoughSeedFinderAlg::findHoughClusters(), cluster::SmallClusterFinderAlg::FindSmallClusters(), util::GeometryUtilities::GeometryUtilities(), lar_pandora::LArPandoraInput::GetMips(), calo::Calorimetry::GetPitch(), calo::GnocchiCalorimetry::GetPitch(), shower::TCShowerElectronLikelihood::getShowerProfile(), shower::TCShowerAlg::goodHit(), evd::RecoBaseDrawer::Hit2D(), shower::LArPandoraShowerAlg::HitCoordinates(), shower::EMShowerAlg::HitPosition_(), apa::APAGeometryAlg::Init(), lar_cluster3d::PCASeedFinderAlg::LineFit2DHits(), lar_cluster3d::HoughSeedFinderAlg::LineFit2DHits(), shower::EMShowerAlg::MakeShower(), trkf::SpacePointAlg::makeSpacePoints(), cluster::ClusterMatchTQ::MatchedClusters(), shower::LArPandoraShowerAlg::OrderShowerHits(), cluster::DBCluster3D::produce(), calo::ShowerCalorimetry::produce(), trkf::SpacePts::produce(), trkf::Track3Dreco::produce(), trkf::CCTrackMaker::produce(), vertex::VertexFinder2D::produce(), calo::Calorimetry::produce(), shower::TCShowerTemplateMaker::showerProfile(), shower::TCShowerTemplateMaker::showerProfileTrue(), trkf::KHitWireLine::subpredict(), trkf::KHitWireX::subpredict(), trkf::TrackLineFitAlg::TrkLineFit(), trkf::VertexFitAlg::VertexFit(), lar_pandora::VintageLArTPCThreeView::WirePitchU(), lar_pandora::VintageLArTPCThreeView::WirePitchV(), and lar_pandora::VintageLArTPCThreeView::WirePitchW().

764  {
765  return Plane(planeid).WirePitch();
766  }
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Definition: PlaneGeo.h:378
Length_t geo::GeometryCore::WirePitch ( 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 771 of file GeometryCore.cxx.

References Plane(), TPC(), and geo::PlaneGeo::WirePitch().

772  {
773  // look in cryostat 0, tpc 0 to find the plane with the
774  // specified view
775  return TPC({0, 0}).Plane(view).WirePitch();
776  }
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Definition: PlaneGeo.h:378
readout::ROPID geo::GeometryCore::WirePlaneToROP ( 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 1524 of file GeometryCore.cxx.

References fChannelMapAlg.

Referenced by HasElement(), and SignalType().

1525  {
1526  return fChannelMapAlg->WirePlaneToROP(planeid);
1527  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
WireGeo const* geo::GeometryCore::WirePtr ( 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 1192 of file GeometryCore.h.

References PlanePtr(), and geo::PlaneGeo::WirePtr().

Referenced by lar_cluster3d::MinSpanTreeAlg::configure(), evd_tool::MicroBooNEDrawer::DrawBadChannels(), evd_tool::ICARUSDrawer::DrawBadChannels(), and GetElementPtr().

1193  {
1194  PlaneGeo const* pPlane = PlanePtr(wireid);
1195  return pPlane ? pPlane->WirePtr(wireid) : nullptr;
1196  } // WirePtr()
PlaneGeo const * PlanePtr(PlaneID const &planeid) const
Returns the specified plane.
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 911 of file GeometryCore.cxx.

References geo::BoxBoundedGeo::MaxX(), geo::BoxBoundedGeo::MaxY(), geo::BoxBoundedGeo::MaxZ(), geo::BoxBoundedGeo::MinX(), geo::BoxBoundedGeo::MinY(), geo::BoxBoundedGeo::MinZ(), and WorldBox().

Referenced by evd_tool::ICARUSDrawer::DetOutline3D(), and evgen::CORSIKAGen::GetSample().

917  {
918  BoxBoundedGeo const box = WorldBox();
919  if (xlo) *xlo = box.MinX();
920  if (ylo) *ylo = box.MinY();
921  if (zlo) *zlo = box.MinZ();
922  if (xhi) *xhi = box.MaxX();
923  if (yhi) *yhi = box.MaxY();
924  if (zhi) *zhi = box.MaxZ();
925  }
BoxBoundedGeo WorldBox() const
BoxBoundedGeo geo::GeometryCore::WorldBox ( ) const

Returns a box with the extremes of the world volume (from shape axes).

See also
GetWorldVolumeName()

Definition at line 889 of file GeometryCore.cxx.

References GetWorldVolumeName(), WorldVolume(), x1, x2, y1, and y2.

Referenced by DetectorName(), MaterialName(), and WorldBox().

890  {
891  TGeoVolume const* world = WorldVolume();
892  if (!world) {
893  throw cet::exception("GeometryCore") << "no world volume '" << GetWorldVolumeName() << "'\n";
894  }
895  TGeoShape const* s = world->GetShape();
896  if (!s) {
897  throw cet::exception("GeometryCore")
898  << "world volume '" << GetWorldVolumeName() << "' is shapeless!!!\n";
899  }
900 
901  double x1, x2, y1, y2, z1, z2;
902  s->GetAxisRange(1, x1, x2);
903  s->GetAxisRange(2, y1, y2);
904  s->GetAxisRange(3, z1, z2);
905 
906  // BoxBoundedGeo constructor will sort the coordinates as needed
907  return BoxBoundedGeo{x1, x2, y1, y2, z1, z2};
908  }
Float_t y1[n_points_granero]
Definition: compare.C:5
Float_t x1[n_points_granero]
Definition: compare.C:5
const std::string GetWorldVolumeName() const
Return the name of the world volume (needed by Geant4 simulation)
TGeoVolume const * WorldVolume() const
Returns a pointer to the world volume.
Float_t y2[n_points_geant4]
Definition: compare.C:26
Float_t x2[n_points_geant4]
Definition: compare.C:26
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
TGeoVolume const * geo::GeometryCore::WorldVolume ( ) const

Returns a pointer to the world volume.

Definition at line 883 of file GeometryCore.cxx.

References GetWorldVolumeName().

Referenced by DetectorName(), VolumeName(), and WorldBox().

884  {
885  return gGeoManager->FindVolumeFast(GetWorldVolumeName().c_str());
886  }
const std::string GetWorldVolumeName() const
Return the name of the world volume (needed by Geant4 simulation)

Member Data Documentation

std::set<View_t> geo::GeometryCore::allViews
private

All views in the detector.

Definition at line 2448 of file GeometryCore.h.

Referenced by UpdateAfterSorting(), and Views().

constexpr CryostatID geo::GeometryCore::cryostat_zero {0}
static

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

Referenced by Iterate(), and ThirdPlaneSlope().

fhicl::ParameterSet geo::GeometryCore::fBuilderParameters
private

Configuration for the geometry builder (needed since builder is created after construction).

Definition at line 2443 of file GeometryCore.h.

Referenced by LoadGeometryFile().

std::string geo::GeometryCore::fDetectorName
private

Name of the detector.

Definition at line 2434 of file GeometryCore.h.

Referenced by DetectorName(), and GeometryCore().

std::string geo::GeometryCore::fGDMLfile
private

path to geometry file used for Geant4 simulation

Definition at line 2435 of file GeometryCore.h.

Referenced by GDMLFile(), and LoadGeometryFile().

GeometryData_t geo::GeometryCore::fGeoData
private

The detector description data.

Definition at line 2431 of file GeometryCore.h.

Referenced by ApplyChannelMap(), AuxDets(), ClearGeometry(), and Cryostats().

double geo::GeometryCore::fMinWireZDist
private

Minimum distance in Z from a point in which to look for the closest wire

Definition at line 2437 of file GeometryCore.h.

double geo::GeometryCore::fPositionWiggle
private

accounting for rounding errors when testing positions

Definition at line 2439 of file GeometryCore.h.

Referenced by DefaultWiggle(), FindTPCAtPosition(), PositionToCryostatPtr(), and PositionToTPCptr().

std::string geo::GeometryCore::fROOTfile
private

path to geometry file for geometry in GeometryCore

Definition at line 2436 of file GeometryCore.h.

Referenced by LoadGeometryFile(), and ROOTFile().

double geo::GeometryCore::fSurfaceY
private

The point where air meets earth for this detector.

Definition at line 2433 of file GeometryCore.h.

Referenced by SurfaceY().

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

constexpr PlaneID geo::GeometryCore::plane_zero {tpc_zero, 0}
static

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

constexpr TPCID geo::GeometryCore::tpc_zero {cryostat_zero, 0}
static

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.

Definition at line 721 of file GeometryCore.h.

Referenced by GetBeginTPCID(), and GetTPCFrontFaceCenter().


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