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

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

#include "Geometry.h"

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

Public Types

using provider_type = GeometryCore
 type of service provider More...
 
using 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

 Geometry (fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
 
provider_type const * provider () const
 Returns a pointer to the geometry service provider. More...
 
sumdata::GeometryConfigurationInfo const & configurationInfo () const
 Returns the current geometry configuration information. More...
 
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 , typename ContextID >
GeoID GetBeginID (ContextID const &id) const
 Returns the ID of the first subelement of the specified element. More...
 
void GetBeginID (TPCID &id) const
 Initializes the specified ID with the ID of the first TPC. More...
 
void GetBeginID (PlaneID &id) const
 Initializes the specified ID with the ID of the first plane. More...
 
void GetBeginID (WireID &id) const
 Initializes the specified ID with the ID of the first wire. More...
 
void GetBeginID (readout::TPCsetID &id) const
 Initializes the specified ID with the ID of the first TPC set. More...
 
void GetBeginID (readout::ROPID &id) const
 Initializes the specified ID with the ID of the first readout plane. More...
 
template<>
TPCID GetBeginID (CryostatID const &id) const
 
template<>
PlaneID GetBeginID (CryostatID const &id) const
 
template<>
PlaneID GetBeginID (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<typename GeoID >
GeoID GetNextID (GeoID const &id) const
 Returns the ID next to the specified one. More...
 
template<typename GeoID >
GeoID GetEndID () const
 Returns the (possibly invalid) ID after the last subelement of the detector. More...
 
template<typename GeoID , typename ContextID >
GeoID GetEndID (ContextID const &id) const
 Returns the (possibly invalid) ID after the last subelement of the specified element. More...
 
void GetEndID (TPCID &id) const
 Initializes the specified ID with the invalid ID after the last TPC. More...
 
void GetEndID (PlaneID &id) const
 Initializes the specified ID with the invalid ID after the last plane. More...
 
void GetEndID (WireID &id) const
 Initializes the specified ID with the invalid ID after the last wire. More...
 
void GetEndID (readout::TPCsetID &id) const
 Initializes the specified ID with the invalid ID after the last TPC set. More...
 
void GetEndID (readout::ROPID &id) const
 Initializes the specified ID with the invalid ID after the last ROP. More...
 
template<>
TPCID GetEndID (CryostatID const &id) const
 
template<>
PlaneID GetEndID (CryostatID const &id) const
 
template<>
PlaneID GetEndID (TPCID const &id) const
 
template<>
WireID GetEndID (CryostatID const &id) const
 
template<>
WireID GetEndID (TPCID const &id) const
 
template<>
WireID GetEndID (PlaneID const &id) const
 
bool HasElement (TPCID const &tpcid) const
 Returns whether we have the specified TPC. More...
 
bool HasElement (readout::TPCsetID const &tpcsetid) const
 Returns whether we have the specified TPC set. More...
 
bool HasElement (readout::ROPID const &ropid) const
 
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 IncrementID (TPCID &id) const
 
bool IncrementID (PlaneID &id) const
 
bool IncrementID (WireID &id) const
 
bool IncrementID (readout::TPCsetID &id) const
 
bool IncrementID (readout::ROPID &id) const
 
bool HasTPC (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...
 
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...
 
PlaneID GetBeginPlaneID (CryostatID const &id) const
 Returns the ID of the first plane of the specified cryostat. More...
 
PlaneID GetBeginPlaneID (TPCID const &id) const
 Returns the ID of the first plane of the specified TPC. More...
 
PlaneID GetEndPlaneID (CryostatID const &id) const
 
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...
 
View_t View (raw::ChannelID_t const channel) const
 Returns the view (wire orientation) on the specified TPC channel. More...
 
View_t View (readout::ROPID const &ropid) const
 Returns the view of the channels in the specified readout plane. More...
 
SigType_t SignalType (PlaneID const &pid) const
 Returns the type of signal on the channels of specified TPC plane. More...
 
SigType_t SignalType (raw::ChannelID_t const channel) const
 Returns the type of signal on the specified TPC channel. More...
 
SigType_t SignalType (readout::ROPID const &ropid) const
 Returns the type of signal of channels in specified readout plane. More...
 
WireID GetBeginWireID (CryostatID const &id) const
 Returns the ID of the first wire in the specified cryostat. More...
 
WireID GetBeginWireID (TPCID const &id) const
 Returns the ID of the first wire of the specified TPC. More...
 
WireID GetBeginWireID (PlaneID const &id) const
 Returns the ID of the first wire of the specified wire plane. More...
 
WireID GetEndWireID (CryostatID const &id) const
 
WireID GetEndWireID (TPCID const &id) const
 
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...
 
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
 
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...
 
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
 
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...
 
readout::ROPID GetBeginROPID (CryostatID const &id) const
 Returns the ID of the first readout plane of the specified cryostat. More...
 
readout::ROPID GetBeginROPID (readout::TPCsetID const &id) const
 Returns the ID of the first readout plane of the specified TPC set. More...
 
readout::ROPID GetEndROPID (CryostatID const &id) const
 
readout::ROPID GetEndROPID (readout::TPCsetID 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...
 
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...
 
CryostatGeo const & PositionToCryostat (Point_t const &point) const
 Returns the cryostat at specified location. 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 , 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 >
details::end_type< T > end () 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 >
details::range_type< T > Iterate () 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...
 
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...
 
TPC access and information
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...
 
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...
 
Plane access and information
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...
 
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...
 
Wire access and information
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 Nwires (PlaneID const &planeid) const
 Returns the total number of wires in the specified plane. More...
 
unsigned int MaxWires () const
 Returns the largest number of wires among all planes in this detector. More...
 
TPC set information
unsigned int NSiblingElements (readout::TPCsetID const &tpcsetid) const
 Returns the total number of TPC sets in the specified cryostat. More...
 
unsigned int NTPCsets (geo::CryostatID const &cryoid) const
 Returns the total number of TPC sets in the specified cryostat. More...
 
Readout plane information
unsigned int NSiblingElements (readout::ROPID const &ropid) const
 Returns the total number of ROP in the specified TPC set. More...
 
unsigned int NROPs (readout::TPCsetID const &tpcsetid) const
 Returns the total number of ROP in the specified TPC set. More...
 
bool HasCryostat (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...
 
bool HasElement (PlaneID const &planeid) const
 Returns whether we have the specified plane. More...
 
bool HasPlane (PlaneID const &planeid) const
 Returns whether we have the specified plane. More...
 
bool HasElement (WireID const &wireid) const
 Returns whether we have the specified wire. More...
 
bool HasWire (WireID const &wireid) const
 Returns whether we have the specified wire. More...
 
PlaneGeo const & GetElement (PlaneID const &planeid) const
 Returns the specified wire. More...
 
PlaneGeo const & Plane (PlaneID const &planeid) const
 Returns the specified wire. More...
 
WireGeo const & GetElement (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...
 
CryostatGeo const * CryostatPtr (CryostatID const &cryoid) const
 Returns the specified cryostat. More...
 
CryostatGeo const * GetElementPtr (CryostatID const &cryoid) const
 Returns the specified cryostat. More...
 
TPCGeo const * GetElementPtr (TPCID const &tpcid) const
 Returns the specified TPC. More...
 
TPCGeo const * TPCPtr (TPCID const &tpcid) const
 Returns the specified TPC. More...
 
PlaneGeo const * GetElementPtr (PlaneID const &planeid) const
 Returns the specified plane. More...
 
PlaneGeo const * PlanePtr (PlaneID const &planeid) const
 Returns the specified plane. More...
 
WireGeo const * GetElementPtr (WireID const &wireid) const
 Returns the specified wire. More...
 
WireGeo const * WirePtr (WireID const &wireid) const
 Returns the specified wire. 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...
 
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...
 
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...
 
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...
 
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

void preBeginRun (art::Run const &run)
 Updates the geometry if needed at the beginning of each new run. More...
 
void LoadNewGeometry (std::string gdmlfile, std::string rootfile, bool bForceReload=false)
 Expands the provided paths and loads the geometry description(s) More...
 
void InitializeChannelMap ()
 

Private Attributes

std::string fRelPath
 
bool fDisableWiresInG4
 
bool fNonFatalConfCheck
 
fhicl::ParameterSet fSortingParameters
 Parameter set to define the channel map sorting. More...
 
fhicl::ParameterSet fBuilderParameters
 Parameter set for geometry builder. More...
 
sumdata::GeometryConfigurationInfo fConfInfo
 Summary of service configuration. More...
 

Configuration information checks

void FillGeometryConfigurationInfo (fhicl::ParameterSet const &config)
 Fills the service configuration information into fConfInfo. More...
 
bool CheckConfigurationInfo (sumdata::GeometryConfigurationInfo const &other) const
 Returns if the other configuration is compatible with our current. More...
 
static sumdata::GeometryConfigurationInfo const & ReadConfigurationInfo (art::Run const &run)
 Reads and returns the geometry configuration information from the run. More...
 
static bool CompareConfigurationInfo (sumdata::GeometryConfigurationInfo const &A, sumdata::GeometryConfigurationInfo const &B)
 Returns if A and B are compatible geometry service configurations. More...
 
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 CryostatID cryostat_zero {0}
 Returns the specified cryostat. More...
 
TPCGeo const & GetElement (TPCID const &tpcid) const
 Returns the specified TPC. More...
 
TPCGeo const & TPC (TPCID const &tpcid=tpc_zero) const
 Returns the specified TPC. More...
 
static constexpr TPCID tpc_zero {cryostat_zero, 0}
 Returns the specified TPC. More...
 
Length_t WirePitch (PlaneID const &planeid=plane_zero) const
 Returns the distance between two consecutive wires. More...
 
static constexpr PlaneID plane_zero {tpc_zero, 0}
 Returns the distance between two consecutive wires. More...
 

Detailed Description

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

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

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

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

Configuration

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

  • RelativePath (string, default: no path): this path is prepended to the geometry file names before searching from them; the path string does not affect the file name
  • GDML (string, mandatory): path of the GDML file to be served to Geant4 for detector simulation. The full file is composed out of the optional relative path specified by RelativePath path and the base name specified in GDML parameter; this path is searched for in the directories configured in the FW_SEARCH_PATH environment variable;
  • ROOT (string, mandatory): currently overridden by GDML parameter, whose value is used instead; this path is assembled in the same way as the one for GDML parameter, except that no alternative (wireless) geometry is used even if DisableWiresInG4 is specified (see below); this file is used to load the geometry used in the internal simulation and reconstruction, basically everywhere except for the Geant4 simulation
  • DisableWiresInG4 (boolean, default: false): if true, Geant4 is loaded with an alternative geometry from a file with the standard name as configured with the /GDML/ parameter, but with an additional "_nowires" appended before the ".gdml" suffix
  • SkipConfigurationCheck (boolean, default: false): if set to true, failure of configuration consistency check described below is not fatal and it will just produce a warning on each failure;
  • SortingParameters (a parameter set; default: empty): this configuration is directly passed to the channel mapping algorithm (see geo::ChannelMapAlg); its content is dependent on the chosen implementation of geo::ChannelMapAlg
  • Builder (a parameter set: default: empty): configuration for the geometry builder; if omitted, the standard builder (geo::GeometryBuilderStandard) with standard configuration will be used; if specified, currently the standard builder is nevertheless used; this interface can be "toolized", in which case this parameter set will select and configure the chosen tool.
Note
Currently, the file defined by GDML parameter is also served to ROOT for the internal geometry representation.

Configuration consistency check

The Geometry service checks that the input files were processed with a configuration of Geometry service compatible with the current one.

Two checks may be performed: the standard check, and a legacy check.

Consistency check

The Geometry service checks at the beginning of each run that the current configuration is compatible with the geometry configuration declared in the input file. The Geometry service requires that an additional service, GeometryConfigurationWriter, is run: this service is charged with writing the configuration information into the output files, for the checks in the future job.

The compatibility check is currently very silly, but it can improved in future versions. This check is the same as the legacy check, that verifies that the configured detector name (geo::GeometryCore::DetectorName()) has not changed.

To allow this check to operate correctly, the only requirement is that the service GeometryConfigurationWriter be included in the job:

services.GeometryConfigurationWriter: {}

This must happen on the first job in the processing chain that configures Geometry service. It is irrelevant, but not harmful, in the jobs that follow.

Design details

This section describes the full design of the check from a technical point of view. Users do not need to understand the mechanisms of this check in order to configure their jobs to successfully pass it.

The check happens based on the data contained in the sumdata::GeometryConfigurationInfo data product. Starting from after the construction is complete, geo::Geometry is able to provide at any time an instance of sumdata::GeometryConfigurationInfo describing the geometry configuration for this job, whether the geometry is already configured or not.

The Geometry service loads the geometry at the beginning of the job. At the start of each run from the input file, the Geometry service reads a configuration information sumdata::GeometryConfigurationInfo from the art::Run record and verifies that it is compatible with the current configuration. It is a fatal error for this information not to be available in art::Run, and it is a fatal check failure if the available information is not compatible with the current configuration.

The sumdata::GeometryConfigurationInfo information is put into art::Run record by the geo::GeometryConfigurationWriter producing service. This service verifies whether there is already such information in the run. If no information is available yet in art::Run, the service obtains the current configuration information from the Geometry service, and then puts it into the art::Run record. The art framework guarantees that this happens before the Geometry service itself is notified by art of the start of the new run. If some geo::GeometryConfigurationWriter information is already in the run record, geo::GeometryConfigurationWriter replicates it again. As legacy check, if there is no information in the sumdata::GeometryConfigurationInfo form but there is a sumdata::RunData data product, the latter is used as a base for the check.

Design notes:

  • the choice of delegating the writing of data product to a producing service rather than to modules is driven by the fact that there is a way to enforce this service to be actually run, and that no further instrumentation is needed;
  • the choice of putting the configuration information in the art::Run is driven by the fact that the run is the highest available container; job-level data products (art::Results) behave very differently from the others and are not currently interfaced with a producing service;
  • the information in sumdata::GeometryConfigurationInfo should be compact enough not to bloat the data files with very few events per run, as it may be for the selection of rare processes or signatures.

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

type of service provider

Definition at line 183 of file Geometry.h.

Definition at line 136 of file GeometryCore.h.

Constructor & Destructor Documentation

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

Definition at line 42 of file Geometry.cc.

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

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

Member Function Documentation

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

Initializes the geometry to work with this channel map.

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

The specified channel mapping is used with this geometry. 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 geo::GeometryCore::fChannelMapAlg, geo::GeometryCore::fGeoData, geo::GeometryCore::SortGeometry(), and geo::GeometryCore::UpdateAfterSorting().

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

Returns the specified auxiliary detector.

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

what happens if it does not exist?

remove the default parameter?

Definition at line 318 of file GeometryCore.cxx.

References geo::GeometryCore::AuxDets(), and geo::GeometryCore::NAuxDets().

Referenced by geo::GeometryCore::ChannelToAuxDet(), geo::GeometryCore::ChannelToAuxDetSensitive(), geo::GeometryCore::NAuxDets(), geo::GeometryCore::PositionToAuxDet(), geo::GeometryCore::PositionToAuxDetSensitive(), geo::GeometryCore::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.
template<typename T >
details::begin_type<T> geo::GeometryCore::begin ( ) const
inlineinherited

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

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)
bool geo::GeometryCore::ChannelsIntersect ( raw::ChannelID_t  c1,
raw::ChannelID_t  c2,
double &  y,
double &  z 
) const
inherited

Returns an intersection point of two channels.

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

what happens for channels from different TPCs?

what happens for channels with multiple intersection points?

Deprecated:
This is clearly not APA-aware

Definition at line 1157 of file GeometryCore.cxx.

References util::abs(), geo::GeometryCore::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, geo::GeometryCore::Wire(), geo::GeometryCore::WireEndPoints(), geo::GeometryCore::WireIDIntersectionCheck(), geo::GeometryCore::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 geo::GeometryCore::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
inherited

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

Definition at line 210 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

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

Returns the number of auxiliary detectors.

Todo:
use a AutDetID_t instead of unsigned int?

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

Todo:
Change return type to size_t

Definition at line 447 of file GeometryCore.cxx.

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

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

Returns the number of auxiliary detectors.

Todo:
use a AutDetID_t instead of unsigned int?

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

Todo:
Change return type to size_t

Definition at line 455 of file GeometryCore.cxx.

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

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

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 geo::GeometryCore::fChannelMapAlg.

Referenced by reco3d::TripletFinder::FillBadMap(), reco3d::TripletFinder::FillHitMap(), geo::GeometryCore::View(), and geo::GeometryCore::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
inherited

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

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

Definition at line 1081 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

Referenced by hit::MCHitAnaExample::analyze(), MCBTDemo::analyze(), detsim::WienerFilterAna::analyze(), apa::APAGeometryAlg::APAChannelsIntersect(), lar_cluster3d::StandardHit3DBuilder::BuildChannelStatusVec(), lar_cluster3d::SnippetHit3DBuilder::BuildChannelStatusVec(), geo::GeometryCore::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(), geo::GeometryCore::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.
bool geo::Geometry::CheckConfigurationInfo ( sumdata::GeometryConfigurationInfo const &  other) const
private

Returns if the other configuration is compatible with our current.

Definition at line 183 of file Geometry.cc.

References CompareConfigurationInfo(), fConfInfo, MF_LOG_DEBUG, and fhicl::other.

Referenced by preBeginRun().

184  {
185 
186  MF_LOG_DEBUG("Geometry") << "New geometry information:\n" << other;
187 
189 
190  } // Geometry::CheckConfigurationInfo()
static bool CompareConfigurationInfo(sumdata::GeometryConfigurationInfo const &A, sumdata::GeometryConfigurationInfo const &B)
Returns if A and B are compatible geometry service configurations.
Definition: Geometry.cc:210
sumdata::GeometryConfigurationInfo fConfInfo
Summary of service configuration.
Definition: Geometry.h:231
#define MF_LOG_DEBUG(id)
bool geo::Geometry::CompareConfigurationInfo ( sumdata::GeometryConfigurationInfo const &  A,
sumdata::GeometryConfigurationInfo const &  B 
)
staticprivate

Returns if A and B are compatible geometry service configurations.

Definition at line 210 of file Geometry.cc.

References sumdata::GeometryConfigurationInfo::dataVersion, sumdata::GeometryConfigurationInfo::detectorName, and sumdata::GeometryConfigurationInfo::isDataValid().

Referenced by CheckConfigurationInfo().

212  {
213  /*
214  * Implemented criteria:
215  *
216  * * both informations must be valid
217  * * the detector names must exactly match
218  *
219  */
220 
221  if (!A.isDataValid()) {
222  mf::LogWarning("Geometry") << "Geometry::CompareConfigurationInfo(): "
223  "invalid version for configuration A:\n"
224  << A;
225  return false;
226  }
227  if (!B.isDataValid()) {
228  mf::LogWarning("Geometry") << "Geometry::CompareConfigurationInfo(): "
229  "invalid version for configuration B:\n"
230  << B;
231  return false;
232  }
233 
234  // currently used only in debug mode (assert())
235  [[maybe_unused]] auto const commonVersion = std::min(A.dataVersion, B.dataVersion);
236 
237  assert(commonVersion >= 1);
238 
239  if (A.detectorName != B.detectorName) { // case sensitive so far
240  mf::LogWarning("Geometry") << "Geometry::CompareConfigurationInfo(): "
241  "detector name mismatch: '"
242  << A.detectorName << "' vs. '" << B.detectorName << "'";
243  return false;
244  }
245 
246  return true;
247  } // CompareConfigurationInfo()
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
double geo::GeometryCore::ComputeThirdPlane_dTdW ( double  angle1,
double  pitch1,
double  dTdW1,
double  angle2,
double  pitch2,
double  dTdW2,
double  angle_target,
double  pitch_target 
)
staticinherited

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

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

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

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

Definition at line 1424 of file GeometryCore.cxx.

References geo::GeometryCore::ComputeThirdPlaneSlope().

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

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

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

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

Definition at line 1396 of file GeometryCore.cxx.

References util::abs().

Referenced by geo::GeometryCore::ComputeThirdPlane_dTdW(), and geo::GeometryCore::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.
sumdata::GeometryConfigurationInfo const& geo::Geometry::configurationInfo ( ) const
inline

Returns the current geometry configuration information.

Definition at line 191 of file Geometry.h.

References fhicl::other.

191 { return fConfInfo; }
sumdata::GeometryConfigurationInfo fConfInfo
Summary of service configuration.
Definition: Geometry.h:231
CryostatGeo const & geo::GeometryCore::Cryostat ( CryostatID const &  cryoid = cryostat_zero) const
inherited

Returns the specified cryostat.

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

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

Todo:
Make the cryostat number mandatory (as CryostatID)

Definition at line 303 of file GeometryCore.cxx.

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

Referenced by phot::PDFastSimANN::beginJob(), opdet::SimPhotonCounter::beginJob(), evgen::PhotonGen::beginRun(), larg4::LArVoxelReadoutGeometry::Construct(), ems::MultiEMShowers::convCluster(), geo::GeometryCore::CryostatHalfHeight(), geo::GeometryCore::CryostatHalfWidth(), geo::GeometryCore::CryostatLength(), detinfo::DetectorPropertiesStandard::DataFor(), cosmic::BeamFlashTrackMatchTaggerAlg::FillFlashProperties(), opdet::FlashHypothesisAnaAlg::FillOpDetPositions(), geo::GeometryCore::GetCryostatVolumeName(), geo::GeometryCore::GetElement(), ems::EMShower3D::LinkCandidates(), trkf::SpacePointAlg::makeSpacePoints(), geo::GeometryCore::NOpDets(), geo::GeometryCore::OpDetFromCryo(), geo::GeometryCore::OpDetGeoFromOpDet(), geo::GeometryCore::OpDetGeoName(), larg4::LArG4::produce(), phot::PhotonVisibilityService::reconfigure(), and geo::GeometryCore::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
inherited

Returns the height of the cryostat (y direction)

Definition at line 706 of file GeometryCore.cxx.

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

Referenced by simfilter::FilterNoDirtNeutrinos::filter(), geo::GeometryCore::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
inherited

Returns the half width of the cryostat (x direction)

Definition at line 700 of file GeometryCore.cxx.

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

Referenced by simfilter::FilterNoDirtNeutrinos::filter(), geo::GeometryCore::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
inherited

Returns the length of the cryostat (z direction)

Definition at line 712 of file GeometryCore.cxx.

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

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

Returns the specified cryostat.

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

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

Definition at line 477 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::Cryostat(), geo::GeometryCore::GetElementPtr(), geo::GeometryCore::GetEndPlaneID(), geo::GeometryCore::GetEndTPCID(), geo::GeometryCore::GetEndWireID(), geo::GeometryCore::HasTPC(), and geo::GeometryCore::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.
double geo::GeometryCore::DefaultWiggle ( ) const
inlineinherited

Returns the tolerance used in looking for positions.

Returns
the tolerance value

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

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

Definition at line 175 of file GeometryCore.h.

References geo::GeometryCore::fPositionWiggle.

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

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 geo::GeometryCore::FindDetectorEnclosure(), and geo::LocalTransformation< StoredMatrix >::LocalToWorld().

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

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

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

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

Todo:

deprecate this function

rename the function

Definition at line 688 of file GeometryCore.cxx.

References geo::TPCGeo::ActiveHalfHeight(), and geo::GeometryCore::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(), geo::GeometryCore::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
inherited

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

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

deprecate this function

rename the function

Definition at line 682 of file GeometryCore.cxx.

References geo::TPCGeo::ActiveHalfWidth(), and geo::GeometryCore::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(), geo::GeometryCore::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
inherited

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

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

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

Todo:

deprecate this function

rename the function

Definition at line 694 of file GeometryCore.cxx.

References geo::TPCGeo::ActiveLength(), and geo::GeometryCore::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(), geo::GeometryCore::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
inlineinherited

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

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)
void geo::Geometry::FillGeometryConfigurationInfo ( fhicl::ParameterSet const &  config)
private

Fills the service configuration information into fConfInfo.

Definition at line 165 of file Geometry.cc.

References sumdata::GeometryConfigurationInfo::dataVersion, sumdata::GeometryConfigurationInfo::detectorName, geo::GeometryCore::DetectorName(), fConfInfo, sumdata::GeometryConfigurationInfo::geometryServiceConfiguration, MF_LOG_TRACE, and fhicl::ParameterSet::to_indented_string().

Referenced by Geometry().

166  {
167 
170 
171  // version 1+:
172  confInfo.detectorName = DetectorName();
173 
174  // version 2+:
175  confInfo.geometryServiceConfiguration = config.to_indented_string();
176  fConfInfo = std::move(confInfo);
177 
178  MF_LOG_TRACE("Geometry") << "Geometry configuration information:\n" << fConfInfo;
179 
180  } // Geometry::FillGeometryConfigurationInfo()
DataVersion_t dataVersion
Version of the data in this object (0 is invalid version).
std::string geometryServiceConfiguration
geo::Geometry service configuration, as FHiCL table.
#define MF_LOG_TRACE(id)
sumdata::GeometryConfigurationInfo fConfInfo
Summary of service configuration.
Definition: Geometry.h:231
unsigned int DataVersion_t
Type used for the version of data.
std::string const & DetectorName() const
Returns a string with the name of the detector, as configured.
Definition: GeometryCore.h:203
Description of the current configuration of detector geometry.
std::vector< std::vector< TGeoNode const * > > geo::GeometryCore::FindAllVolumePaths ( std::set< std::string > const &  vol_names) const
inherited

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

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

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

Definition at line 654 of file GeometryCore.cxx.

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

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

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

Parameters
vol_nameslist of names of volumes
Returns
list of nodes found

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

Definition at line 637 of file GeometryCore.cxx.

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

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

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

Referenced by geo::GeometryCore::FindAuxDetSensitiveAtPosition(), geo::GeometryCore::NAuxDets(), and geo::GeometryCore::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
inherited

Fills the indices of the sensitive auxiliary detector at location.

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

Definition at line 426 of file GeometryCore.cxx.

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

Referenced by larg4::AuxDetReadoutGeometry::FindAndMakeAuxDetSensitive(), sim::GenericCRTUtility::GetAuxDetSimChannelByNumber(), geo::GeometryCore::NAuxDets(), and geo::GeometryCore::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.
TPCID geo::GeometryCore::FindTPCAtPosition ( Point_t const &  point) const
inherited

Returns the ID of the TPC at specified location.

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

Definition at line 326 of file GeometryCore.cxx.

References geo::CryostatID::Cryostat, geo::GeometryCore::fPositionWiggle, geo::CryostatGeo::ID(), geo::CryostatID::markInvalid(), geo::GeometryCore::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(), geo::GeometryCore::FindTPCsetAtPosition(), geo::GeometryCore::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
inherited

Returns the ID of the TPC set at specified location.

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

Definition at line 1485 of file GeometryCore.cxx.

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

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

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

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

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

Definition at line 1542 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

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

Returns the full directory path to the GDML file source.

Returns
the full directory path to the GDML file source

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

Definition at line 193 of file GeometryCore.h.

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

Returns the ID of the first element of the detector.

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

Definition at line 357 of file GeometryCore.h.

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

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

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

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

Definition at line 518 of file GeometryCore.h.

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

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

iterators

Definition at line 782 of file GeometryCore.h.

References geo::GeometryCore::GetBeginID(), geo::GeometryCore::GetEndID(), and geo::GeometryCore::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
inlineinherited

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

Definition at line 1060 of file GeometryCore.h.

References geo::GeometryCore::GetBeginID(), geo::GeometryCore::GetEndID(), and geo::GeometryCore::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
inlineinherited

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

Definition at line 1220 of file GeometryCore.h.

References geo::GeometryCore::GetBeginID(), geo::GeometryCore::GetEndID(), and geo::GeometryCore::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
inlineinherited

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

iterators

Definition at line 2091 of file GeometryCore.h.

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

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

iterators

Definition at line 2256 of file GeometryCore.h.

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

Definition at line 2549 of file GeometryCore.h.

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

Definition at line 2562 of file GeometryCore.h.

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

Definition at line 2568 of file GeometryCore.h.

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

Definition at line 2587 of file GeometryCore.h.

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

Definition at line 2593 of file GeometryCore.h.

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

Definition at line 2599 of file GeometryCore.h.

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

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

Definition at line 1074 of file GeometryCore.h.

References geo::GeometryCore::GetBeginTPCID(), and geo::GeometryCore::GetEndPlaneID().

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

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

Definition at line 1081 of file GeometryCore.h.

References geo::GeometryCore::GetEndPlaneID(), geo::GeometryCore::PlanePitch(), geo::GeometryCore::SignalType(), and geo::GeometryCore::View().

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

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

Definition at line 2274 of file GeometryCore.h.

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

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
inlineinherited
readout::TPCsetID geo::GeometryCore::GetBeginTPCsetID ( CryostatID const &  id) const
inlineinherited

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

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

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

Definition at line 1234 of file GeometryCore.h.

References geo::GeometryCore::GetBeginPlaneID(), and geo::GeometryCore::GetEndWireID().

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

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

Definition at line 1241 of file GeometryCore.h.

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

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

Definition at line 1248 of file GeometryCore.h.

References geo::GeometryCore::GetEndWireID().

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

Find the nearest OpChannel to some point.

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

Definition at line 1635 of file GeometryCore.cxx.

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

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

Return the name of LAr TPC volume.

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

This information is used in the event display.

Todo:

Use a cryostat ID instead

What if it does not exist?

Definition at line 676 of file GeometryCore.cxx.

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

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

Returns the specified cryostat.

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

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

Todo:
Make the cryostat number mandatory (as CryostatID)

Definition at line 465 of file GeometryCore.h.

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

Returns the specified TPC.

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

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

Definition at line 723 of file GeometryCore.h.

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

Returns the specified wire.

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

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

Definition at line 1035 of file GeometryCore.h.

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

Returns the specified wire.

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

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

Definition at line 1212 of file GeometryCore.h.

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

Returns the specified cryostat.

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

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

Definition at line 481 of file GeometryCore.h.

References geo::GeometryCore::CryostatPtr(), geo::GeometryCore::PositionToCryostat(), geo::GeometryCore::PositionToCryostatID(), and geo::GeometryCore::PositionToCryostatPtr().

Referenced by geo::details::getElementPtr(), geo::GeometryCore::Nplanes(), geo::GeometryCore::NTPC(), and geo::GeometryCore::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
inlineinherited

Returns the specified TPC.

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

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

Definition at line 740 of file GeometryCore.h.

References geo::GeometryCore::FindTPCAtPosition(), geo::GeometryCore::PositionToTPC(), geo::GeometryCore::PositionToTPCID(), geo::GeometryCore::PositionToTPCptr(), and geo::GeometryCore::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
inlineinherited

Returns the specified plane.

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

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

Definition at line 1052 of file GeometryCore.h.

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

Returns the specified wire.

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

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

Definition at line 1197 of file GeometryCore.h.

References geo::GeometryCore::WirePtr().

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

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

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

Definition at line 385 of file GeometryCore.h.

References geo::GeometryCore::GetBeginID().

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

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

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

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

Definition at line 521 of file GeometryCore.h.

References geo::GeometryCore::IncrementID(), and geo::GeometryCore::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
inherited

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

Definition at line 380 of file GeometryCore.cxx.

References geo::GeometryCore::GetBeginID(), geo::GeometryCore::GetEndID(), and geo::GeometryCore::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
inherited

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

Definition at line 718 of file GeometryCore.cxx.

References geo::GeometryCore::GetBeginID(), geo::GeometryCore::GetEndID(), and geo::GeometryCore::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
inherited

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

Definition at line 840 of file GeometryCore.cxx.

References geo::GeometryCore::GetBeginID(), geo::GeometryCore::GetEndID(), and geo::GeometryCore::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
inlineinherited

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

Definition at line 2098 of file GeometryCore.h.

References geo::GeometryCore::GetEndID(), and geo::GeometryCore::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
inlineinherited

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

Definition at line 2263 of file GeometryCore.h.

References geo::GeometryCore::GetEndID(), and geo::GeometryCore::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
inlineinherited

Definition at line 2555 of file GeometryCore.h.

References geo::GeometryCore::GetEndTPCID().

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

Definition at line 2574 of file GeometryCore.h.

References geo::GeometryCore::GetEndPlaneID().

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

Definition at line 2580 of file GeometryCore.h.

References geo::GeometryCore::GetEndPlaneID().

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

Definition at line 2605 of file GeometryCore.h.

References geo::GeometryCore::GetEndWireID().

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

Definition at line 2611 of file GeometryCore.h.

References geo::GeometryCore::GetEndWireID().

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

Definition at line 2617 of file GeometryCore.h.

References geo::GeometryCore::GetEndWireID().

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

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

Definition at line 731 of file GeometryCore.cxx.

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

Referenced by geo::GeometryCore::GetBeginPlaneID(), geo::GeometryCore::GetEndID(), and geo::GeometryCore::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
inherited

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

Definition at line 738 of file GeometryCore.cxx.

References geo::GeometryCore::GetBeginPlaneID(), geo::GeometryCore::GetNextID(), geo::CryostatID::markInvalid(), geo::TPCGeo::Nplanes(), geo::GeometryCore::TPC(), and geo::GeometryCore::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
inlineinherited

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

Definition at line 2278 of file GeometryCore.h.

References geo::GeometryCore::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
TPCID geo::GeometryCore::GetEndTPCID ( CryostatID const &  id) const
inherited

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, geo::GeometryCore::CryostatPtr(), geo::GeometryCore::GetBeginTPCID(), geo::CryostatID::markInvalid(), and geo::CryostatGeo::NTPC().

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

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

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

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

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

Definition at line 853 of file GeometryCore.cxx.

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

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

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

Definition at line 863 of file GeometryCore.cxx.

References geo::GeometryCore::GetBeginWireID(), geo::GeometryCore::GetEndPlaneID(), geo::CryostatID::markInvalid(), geo::TPCGeo::MaxWires(), geo::GeometryCore::TPC(), and geo::GeometryCore::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
inherited

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

Definition at line 873 of file GeometryCore.cxx.

References geo::GeometryCore::GetBeginWireID(), geo::GeometryCore::GetNextID(), geo::CryostatID::markInvalid(), geo::PlaneGeo::Nwires(), and geo::GeometryCore::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
inherited

Return the name of specified LAr TPC volume.

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

This information is used by Geant4 simulation

Todo:
What if it does not exist?

Definition at line 670 of file GeometryCore.cxx.

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

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

Returns the ID next to the specified one.

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

Definition at line 371 of file GeometryCore.h.

References geo::GeometryCore::IncrementID().

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

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(), geo::GeometryCore::GetLArTPCVolumeName(), geo::GeometryCore::MaxPlanes(), geo::GeometryCore::TPC(), and geo::GeometryCore::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
inherited

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

Definition at line 501 of file GeometryCore.cxx.

Referenced by geo::GeometryCore::SurfaceY(), geo::GeometryCore::WorldBox(), and geo::GeometryCore::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
inherited

Convert unique channel to hardware channel.

Definition at line 268 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

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

Returns whether the specified channel exists and is valid.

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

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

Definition at line 495 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

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

Returns whether we have the specified cryostat.

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

Definition at line 446 of file GeometryCore.h.

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

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

Returns whether we have the specified cryostat.

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

Definition at line 447 of file GeometryCore.h.

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

Returns whether we have the specified TPC.

Definition at line 706 of file GeometryCore.h.

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

Returns whether we have the specified plane.

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

Definition at line 1016 of file GeometryCore.h.

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

Returns whether we have the specified wire.

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

Definition at line 1180 of file GeometryCore.h.

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

Returns whether we have the specified TPC set.

Definition at line 2059 of file GeometryCore.h.

References geo::GeometryCore::FindTPCsetAtPosition(), geo::GeometryCore::HasTPCset(), geo::GeometryCore::TPCsetToTPCs(), and geo::GeometryCore::TPCtoTPCset().

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

Returns whether we have the specified readout plane

Returns
whether the readout plane is valid and exists

Definition at line 2198 of file GeometryCore.h.

References geo::GeometryCore::FirstChannelInROP(), geo::GeometryCore::HasROP(), geo::GeometryCore::ROPtoTPCs(), geo::GeometryCore::ROPtoWirePlanes(), and geo::GeometryCore::WirePlaneToROP().

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

Returns whether we have the specified plane.

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

Definition at line 1011 of file GeometryCore.h.

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

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

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 geo::GeometryCore::fChannelMapAlg.

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

Returns whether we have the specified TPC.

Definition at line 699 of file GeometryCore.h.

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

Referenced by pma::ProjectionMatchingAlg::buildShowerSeg(), ems::MultiEMShowers::convCluster(), geo::GeometryCore::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
inherited

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 geo::GeometryCore::fChannelMapAlg.

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

Returns whether we have the specified wire.

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

Definition at line 1175 of file GeometryCore.h.

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

Referenced by tca::FillmAllTraj(), geo::GeometryCore::HasElement(), pma::ProjectionMatchingAlg::validate(), pma::ProjectionMatchingAlg::validate_on_adc(), pma::ProjectionMatchingAlg::validate_on_adc_test(), and geo::GeometryCore::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
inlineinherited

Sets the ID to the ID after the specified one.

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

Definition at line 2481 of file GeometryCore.h.

References geo::GeometryCore::HasCryostat().

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

Sets the ID to the ID after the specified one.

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

Definition at line 2488 of file GeometryCore.h.

References geo::GeometryCore::IncrementID(), geo::GeometryCore::NTPC(), and geo::GeometryCore::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
inlineinherited

Sets the ID to the ID after the specified one.

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

Definition at line 2497 of file GeometryCore.h.

References geo::GeometryCore::IncrementID(), geo::GeometryCore::Nplanes(), and geo::GeometryCore::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
inlineinherited

Sets the ID to the ID after the specified one.

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

Definition at line 2508 of file GeometryCore.h.

References geo::GeometryCore::IncrementID(), geo::GeometryCore::Nwires(), and geo::GeometryCore::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
inlineinherited

Sets the ID to the ID after the specified one.

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

Definition at line 2519 of file GeometryCore.h.

References geo::GeometryCore::IncrementID(), and geo::GeometryCore::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
inlineinherited

Sets the ID to the ID after the specified one.

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

Definition at line 2528 of file GeometryCore.h.

References geo::GeometryCore::IncrementID(), and geo::GeometryCore::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
inherited

Returns a string with complete geometry information.

See also
Print()

Definition at line 1073 of file GeometryCore.cxx.

References geo::GeometryCore::Print().

Referenced by geo::GeometryCore::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)
void geo::Geometry::InitializeChannelMap ( )
private

Definition at line 102 of file Geometry.cc.

References geo::GeometryCore::ApplyChannelMap(), geo::GeometryCore::DetectorName(), and fSortingParameters.

Referenced by LoadNewGeometry().

103  {
104  // the channel map is responsible of calling the channel map configuration
105  // of the geometry
107  auto channelMapAlg = helper->ConfigureChannelMapAlg(fSortingParameters, DetectorName());
108  if (!channelMapAlg) {
109  throw cet::exception("ChannelMapLoadFail") << " failed to load new channel map";
110  }
111  ApplyChannelMap(move(channelMapAlg));
112  } // Geometry::InitializeChannelMap()
fhicl::ParameterSet fSortingParameters
Parameter set to define the channel map sorting.
Definition: Geometry.h:228
void ApplyChannelMap(std::unique_ptr< ChannelMapAlg > pChannelMap)
Initializes the geometry to work with this channel map.
std::string const & DetectorName() const
Returns a string with the name of the detector, as configured.
Definition: GeometryCore.h:203
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool geo::GeometryCore::IntersectionPoint ( WireID const &  wid1,
WireID const &  wid2,
double &  y,
double &  z 
) const
inherited

Returns the intersection point of two wires.

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

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

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

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

Definition at line 1451 of file GeometryCore.cxx.

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

Is this a valid OpChannel number?

Definition at line 274 of file GeometryCore.cxx.

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

Referenced by cosmic::BeamFlashTrackMatchTaggerAlg::CheckCompatibility(), geo::GeometryCore::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
inlineinherited

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(), tss::TrackShowerHits::produce(), evgen::CosmicsGen::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
inlineinherited
void geo::GeometryCore::LoadGeometryFile ( std::string  gdmlfile,
std::string  rootfile,
GeometryBuilder builder,
bool  bForceReload = false 
)
inherited

Loads the geometry information from the specified files.

Parameters
gdmlfilepath to file to be used for Geant4 simulation
rootfilepath to file for internal geometry representation
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 geo::GeometryCore::BuildGeometry(), geo::GeometryCore::ClearGeometry(), geo::GeometryCore::fGDMLfile, and geo::GeometryCore::fROOTfile.

Referenced by geo::GeometryCore::GetEndROPID(), geo::GeometryCore::LoadGeometryFile(), and 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 
)
inherited

Loads the geometry information from the specified files.

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

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 geo::GeometryCore::fBuilderParameters, and geo::GeometryCore::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
void geo::Geometry::LoadNewGeometry ( std::string  gdmlfile,
std::string  rootfile,
bool  bForceReload = false 
)
private

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

Definition at line 115 of file Geometry.cc.

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

Referenced by Geometry().

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

Returns a container with one entry per wire plane.

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

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

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

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

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

Definition at line 937 of file GeometryCore.h.

References geo::GeometryCore::MaxPlanes(), geo::GeometryCore::MaxTPCs(), and geo::GeometryCore::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
inlineinherited

Returns a container with one entry per wire plane.

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

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

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

Definition at line 961 of file GeometryCore.h.

References geo::GeometryCore::MaxPlanes(), geo::GeometryCore::MaxTPCs(), and geo::GeometryCore::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
inlineinherited

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 geo::GeometryCore::MaxROPs(), geo::GeometryCore::MaxTPCsets(), and geo::GeometryCore::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
inlineinherited

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 geo::GeometryCore::HasROP(), geo::GeometryCore::MaxROPs(), geo::GeometryCore::MaxTPCsets(), and geo::GeometryCore::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
inlineinherited

Returns a container with one entry per TPC.

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

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

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

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

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

Definition at line 645 of file GeometryCore.h.

References geo::GeometryCore::MaxTPCs(), and geo::GeometryCore::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
inlineinherited

Returns a container with one entry per TPC.

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

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

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

Definition at line 670 of file GeometryCore.h.

References geo::GeometryCore::MaxTPCs(), and geo::GeometryCore::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
inlineinherited

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

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 geo::GeometryCore::HasTPCset(), geo::GeometryCore::MaxTPCsets(), and geo::GeometryCore::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
inherited

Returns the column density between two points.

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

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

Both points are specified in world coordinates.

Definition at line 1033 of file GeometryCore.cxx.

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

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

Returns the material at the specified position.

Definition at line 949 of file GeometryCore.cxx.

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

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(), geo::GeometryCore::Material(), geo::BoxBoundedGeo::Max(), geo::BoxBoundedGeo::Min(), and geo::GeometryCore::WorldBox().

Referenced by larg4::LArG4Ana::analyze(), and geo::GeometryCore::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
inherited

Largest optical channel number.

Definition at line 244 of file GeometryCore.cxx.

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

Referenced by cosmic::BeamFlashTrackMatchTaggerAlg::CheckCompatibility(), opdet::ConstructFlash(), geo::GeometryCore::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::MaxROPs ( ) const
inherited

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

Definition at line 1512 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

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

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

Definition at line 796 of file GeometryCore.cxx.

References geo::GeometryCore::Cryostats().

Referenced by geo::GeometryCore::GetEndID(), geo::GeometryCore::Iterate(), geo::GeometryCore::makePlaneData(), geo::GeometryCore::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
inherited

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

Definition at line 1473 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

Referenced by geo::GeometryCore::makeROPdata(), geo::GeometryCore::makeTPCsetData(), and geo::GeometryCore::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
inherited

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

Definition at line 829 of file GeometryCore.cxx.

References geo::GeometryCore::Cryostats().

Referenced by cluster::BlurredClusteringAlg::ConvertRecobHitsToVector(), geo::GeometryCore::GetEndID(), and geo::GeometryCore::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
inlineinherited

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 geo::GeometryCore::AuxDet(), geo::GeometryCore::AuxDets(), geo::GeometryCore::ChannelsInTPCs(), geo::GeometryCore::ChannelToAuxDet(), geo::GeometryCore::ChannelToAuxDetSensitive(), geo::GeometryCore::FindAuxDetAtPosition(), geo::GeometryCore::FindAuxDetSensitiveAtPosition(), geo::GeometryCore::NAuxDetSensitive(), geo::GeometryCore::Nchannels(), geo::GeometryCore::PositionToAuxDet(), and geo::GeometryCore::PositionToAuxDetSensitive().

Referenced by geo::GeometryCore::AuxDet(), geo::GeometryCore::NAuxDetSensitive(), geo::GeometryCore::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
inherited

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

Referenced by geo::GeometryCore::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
inherited
unsigned int geo::GeometryCore::Nchannels ( readout::ROPID const &  ropid) const
inherited

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

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 geo::GeometryCore::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(), geo::GeometryCore::GetEndID(), geo::GeometryCore::HasCryostat(), lar_cluster3d::SpacePointHit3DBuilder::Hit3DBuilder(), geo::GeometryCore::makePlaneData(), geo::GeometryCore::makeROPdata(), trkf::SpacePointAlg::makeSpacePoints(), geo::GeometryCore::makeTPCData(), geo::GeometryCore::makeTPCsetData(), geo::GeometryCore::NElements(), geo::GeometryCore::NOpDets(), geo::GeometryCore::NSiblingElements(), geo::GeometryCore::OpDetFromCryo(), geo::GeometryCore::OpDetGeoFromOpDet(), larg4::OpFastScintillation::OpFastScintillation(), phot::PDFastSimPAR::PDFastSimPAR(), geo::GeometryCore::Print(), larg4::LArG4::produce(), evd::TWQProjectionView::SelectTPC(), evd::TWQProjectionView::SetUpTPCselection(), cheat::BackTracker::SpacePointHitsToWeightedXYZ(), and geo::GeometryCore::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
inherited

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

Referenced by larg4::LArVoxelReadout::DriftIonizationElectrons(), sim::MCRecoEdep::MakeMCEdep(), vertex::FeatureVertexFinder::produce(), detsim::SimDriftElectrons::produce(), apa::DisambigAlg::TrivialDisambig(), and geo::GeometryCore::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
inherited

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 geo::GeometryCore::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(), geo::GeometryCore::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
inlineinherited

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

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

Definition at line 691 of file GeometryCore.h.

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

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

Definition at line 982 of file GeometryCore.h.

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

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

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

Referenced by opdet::OpHitAna::analyze(), opdet::OpFlashAna::analyze(), opdet::SimPhotonCounter::analyze(), opdet::OpDetResponseInterface::doNOpChannels(), opdet::OpDigiProperties::FillGainArray(), opdet::OpDigiProperties::FillPedMeanArray(), geo::GeometryCore::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
inherited

Number of OpDets in the whole detector.

Definition at line 229 of file GeometryCore.cxx.

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

Referenced by cosmic::BeamFlashTrackMatchTaggerAlg::CheckCompatibility(), phot::CreateHybridLibrary::CreateHybridLibrary(), opdet::FlashHypothesisAnaAlg::FillOpDetPositions(), larg4::OpDetLookup::FindClosestOpDet(), geo::GeometryCore::IsValidOpChannel(), phot::PhotonVisibilityService::LoadLibrary(), phot::PhotonMappingIdentityTransformations::makeLibraryIndicesToOpDetsMap(), phot::PhotonMappingIdentityTransformations::makeOpDetsToLibraryIndicesMap(), geo::GeometryCore::MaxOpChannel(), geo::GeometryCore::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 geo::GeometryCore::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
inherited

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 geo::GeometryCore::fChannelMapAlg.

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

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 geo::GeometryCore::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(), geo::GeometryCore::IncrementID(), evd::InfoTransfer::InfoTransfer(), corner::CornerFinderAlg::InitializeGeometry(), reco::shower::LArPandoraModularShowerCreation::LArPandoraModularShowerCreation(), trkf::CCTrackMaker::MakeClusterChains(), trkf::CCTrackMaker::MakeFamily(), cluster::ClusterMatchTQ::MatchedClusters(), hit::MCHitAnaExample::MCHitAnaExample(), geo::GeometryCore::NElements(), geo::GeometryCore::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(), geo::GeometryCore::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
inherited

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 geo::GeometryCore::fChannelMapAlg.

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

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

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

Definition at line 692 of file GeometryCore.h.

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

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

Definition at line 983 of file GeometryCore.h.

References geo::GeometryCore::Nplanes(), and geo::GeometryCore::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
inlineinherited

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

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

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

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 geo::GeometryCore::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(), geo::GeometryCore::IncrementID(), apa::APAGeometryAlg::Init(), geo::GeometryCore::NElements(), geo::GeometryCore::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
inherited

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 geo::GeometryCore::fChannelMapAlg.

Referenced by geo::GeometryCore::IncrementID(), geo::GeometryCore::NSiblingElements(), and geo::GeometryCore::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
inherited

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

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

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 geo::GeometryCore::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(), geo::GeometryCore::IncrementID(), corner::CornerFinderAlg::InitializeGeometry(), lar_cluster3d::StandardHit3DBuilder::NearestWireID(), lar_cluster3d::SnippetHit3DBuilder::NearestWireID(), geo::GeometryCore::NElements(), geo::GeometryCore::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(), geo::GeometryCore::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
inherited

Convert detector number and hardware channel to unique channel.

Definition at line 256 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

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

Get unique opdet number from cryo and internal count.

Definition at line 1569 of file GeometryCore.cxx.

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

Referenced by geo::GeometryCore::GetClosestOpDet(), and geo::GeometryCore::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
const OpDetGeo & geo::GeometryCore::OpDetGeoFromOpChannel ( unsigned int  OpChannel) const
inherited

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

Referenced by evdb_tool::OpHit3DDrawer::Draw(), evdb_tool::DrawSimPhoton3D::Draw(), evdb_tool::OpFlash3DDrawer::Draw(), opdet::GetHitGeometryInfo(), and geo::GeometryCore::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
inherited

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 geo::GeometryCore::Cryostat(), geo::GeometryCore::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(), geo::GeometryCore::OpDetGeoFromOpChannel(), phot::PropagationTimeModel::opDetOrientations(), larg4::OpFastScintillation::OpFastScintillation(), phot::SemiAnalyticalModel::opticalDetectors(), phot::PhotonVisibilityService::SolidAngleFactorImpl(), and geo::GeometryCore::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
inherited

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 geo::GeometryCore::Cryostat(), and geo::CryostatGeo::OpDetGeoName().

Referenced by larg4::LArG4::beginJob(), and geo::GeometryCore::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
PlaneGeo const& geo::GeometryCore::Plane ( PlaneID const &  planeid) const
inlineinherited

Returns the specified wire.

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

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

Definition at line 1034 of file GeometryCore.h.

References geo::TPCGeo::Plane(), and geo::GeometryCore::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_(), geo::GeometryCore::GetElement(), calo::Calorimetry::GetPitch(), util::GeometryUtilities::GetProjectedPoint(), pma::GetProjectionToPlane(), util::GeometryUtilities::GetTimeTicks(), util::GeometryUtilities::GetXYZ(), cluster::HoughBaseAlg::HoughBaseAlg(), geo::GeometryCore::IncrementID(), shower::EMShowerAlg::MakeShower(), trkf::SpacePointAlg::makeSpacePoints(), lar_cluster3d::StandardHit3DBuilder::NearestWireID(), lar_cluster3d::SnippetHit3DBuilder::NearestWireID(), geo::GeometryCore::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(), geo::GeometryCore::View(), geo::GeometryCore::Wire(), geo::GeometryCore::WireCoordinate(), pma::WireDriftToCm(), and geo::GeometryCore::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
inherited

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

Referenced by geo::GeometryCore::GetBeginPlaneID(), geo::GeometryCore::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
inherited

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

Returns the specified plane.

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

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

Definition at line 1047 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::GetElementPtr(), geo::GeometryCore::GetEndWireID(), geo::GeometryCore::HasWire(), and geo::GeometryCore::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
inherited

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 geo::GeometryCore::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(), geo::GeometryCore::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(), geo::GeometryCore::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
inherited

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

Referenced by larg4::AuxDetReadoutGeometry::FindAndMakeAuxDet(), and geo::GeometryCore::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
inherited

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 geo::GeometryCore::AuxDet(), geo::GeometryCore::FindAuxDetSensitiveAtPosition(), and geo::AuxDetGeo::SensitiveVolume().

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

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

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

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

Referenced by pma::ProjectionMatchingAlg::buildShowerSeg(), ems::MultiEMShowers::convCluster(), larg4::LArVoxelReadoutGeometry::FindNestedVolume(), geo::GeometryCore::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
inherited

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 geo::GeometryCore::fPositionWiggle.

Referenced by geo::GeometryCore::FindTPCAtPosition(), geo::GeometryCore::GetClosestOpDet(), geo::GeometryCore::GetElementPtr(), geo::GeometryCore::PositionToCryostat(), geo::GeometryCore::PositionToCryostatID(), and geo::GeometryCore::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
inherited

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

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

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

Referenced by larg4::ISCalcCorrelated::AngleToEFieldAtStep(), evdb_tool::DrawLArVoxel3D::Draw(), evdb_tool::DrawSimEnergyDeposit3D::drawAll(), evdb_tool::DrawSimEnergyDeposit3D::drawMCPartAssociated(), larg4::ISCalcCorrelated::EFieldAtStep(), larg4::LArVoxelReadoutGeometry::FindNestedVolume(), geo::GeometryCore::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
inherited

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 geo::GeometryCore::fPositionWiggle, geo::GeometryCore::PositionToCryostatPtr(), and geo::CryostatGeo::PositionToTPCptr().

Referenced by geo::GeometryCore::GetElementPtr(), lar_pandora::PFParticleMonitoring::GetStartAndEndPoints(), geo::GeometryCore::PositionToTPC(), and geo::GeometryCore::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
void geo::Geometry::preBeginRun ( art::Run const &  run)
private

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

Definition at line 79 of file Geometry.cc.

References CheckConfigurationInfo(), fConfInfo, fNonFatalConfCheck, art::Run::id(), and ReadConfigurationInfo().

Referenced by Geometry().

80  {
81 
83  if (!CheckConfigurationInfo(inputGeomInfo)) {
84  if (fNonFatalConfCheck) {
85  // disable the non-fatal option if you need the details
86  mf::LogWarning("Geometry") << "Geometry used for " << run.id()
87  << " is incompatible with the one configured in the job.";
88  }
89  else {
90  throw cet::exception("Geometry")
91  << "Geometry used for run " << run.id()
92  << " is incompatible with the one configured in the job!"
93  << "\n=== job configuration " << std::string(50, '=') << "\n"
94  << fConfInfo << "\n=== run configuration " << std::string(50, '=') << "\n"
95  << inputGeomInfo << "\n======================" << std::string(50, '=') << "\n";
96  }
97  }
98 
99  } // Geometry::preBeginRun()
bool fNonFatalConfCheck
Definition: Geometry.h:226
bool CheckConfigurationInfo(sumdata::GeometryConfigurationInfo const &other) const
Returns if the other configuration is compatible with our current.
Definition: Geometry.cc:183
static sumdata::GeometryConfigurationInfo const & ReadConfigurationInfo(art::Run const &run)
Reads and returns the geometry configuration information from the run.
Definition: Geometry.cc:193
sumdata::GeometryConfigurationInfo fConfInfo
Summary of service configuration.
Definition: Geometry.h:231
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Description of the current configuration of detector geometry.
template<typename Stream >
void geo::GeometryCore::Print ( Stream &&  out,
std::string  indent = "  " 
) const
inherited

Prints geometry information with maximum verbosity.

Definition at line 2677 of file GeometryCore.h.

References geo::GeometryCore::AuxDet(), geo::GeometryCore::DetectorEnclosureBox(), geo::GeometryCore::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, geo::GeometryCore::NAuxDets(), geo::GeometryCore::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(), geo::GeometryCore::SignalType(), geo::SignalTypeName(), w, and geo::PlaneGeo::Wire().

Referenced by geo::DumpGeometry::dumpGeometryCore(), geo::GeometryCore::Info(), and geo::GeometryCore::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.
provider_type const* geo::Geometry::provider ( ) const
inline

Returns a pointer to the geometry service provider.

Definition at line 188 of file Geometry.h.

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

Reads and returns the geometry configuration information from the run.

Definition at line 193 of file Geometry.cc.

References e, and art::ProductRetriever::getProduct().

Referenced by preBeginRun().

194  {
195 
196  try {
197  return run.getProduct<sumdata::GeometryConfigurationInfo>(
198  art::InputTag{"GeometryConfigurationWriter"});
199  }
200  catch (art::Exception const& e) {
201  throw art::Exception{e.categoryCode(),
202  "Can't read geometry configuration information.\n"
203  "Is `GeometryConfigurationWriter` service configured?\n",
204  e};
205  }
206 
207  } // Geometry::ReadConfigurationInfo()
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
Float_t e
Definition: plot.C:35
Description of the current configuration of detector geometry.
std::string const& geo::GeometryCore::ROOTFile ( ) const
inlineinherited

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 geo::GeometryCore::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
inherited
std::vector< TPCID > geo::GeometryCore::ROPtoTPCs ( readout::ROPID const &  ropid) const
inherited

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 geo::GeometryCore::fChannelMapAlg.

Referenced by reco3d::TripletFinder::FillBadMap(), reco3d::TripletFinder::FillHitMap(), and geo::GeometryCore::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
inherited

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 geo::GeometryCore::fChannelMapAlg.

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

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 geo::GeometryCore::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(), geo::GeometryCore::GetBeginPlaneID(), geo::GeometryCore::GetEndROPID(), cluster::MergeClusterAlg::GlobalWire(), cluster::BlurredClusteringAlg::GlobalWire(), shower::EMShowerAlg::GlobalWire_(), cluster::HoughBaseAlg::HoughBaseAlg(), shwf::ShowerReco::LongTransEnergy(), trkf::SpacePointAlg::makeSpacePoints(), geo::GeometryCore::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(), geo::GeometryCore::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
inherited

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

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 geo::GeometryCore::fChannelMapAlg.

1555  {
1556  return fChannelMapAlg->SignalTypeForROPID(ropid);
1557  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
Length_t geo::GeometryCore::SurfaceY ( ) const
inlineinherited

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 geo::GeometryCore::DetectorEnclosureBox(), geo::GeometryCore::FindAllVolumePaths(), geo::GeometryCore::FindAllVolumes(), geo::GeometryCore::fSurfaceY, geo::GeometryCore::GetWorldVolumeName(), art::detail::indent(), geo::GeometryCore::Info(), geo::GeometryCore::MassBetweenPoints(), geo::GeometryCore::Material(), geo::GeometryCore::MaterialName(), geo::GeometryCore::Print(), geo::GeometryCore::ROOTGeoManager(), geo::GeometryCore::TotalMass(), and geo::GeometryCore::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
inherited

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 geo::GeometryCore::Nplanes(), and geo::PlaneID::Plane.

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

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 geo::GeometryCore::ComputeThirdPlane_dTdW(), geo::PlaneGeo::PhiZ(), geo::TPCGeo::Plane(), geo::GeometryCore::TPC(), and geo::PlaneGeo::WirePitch().

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

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 geo::GeometryCore::ThirdPlane(), and geo::GeometryCore::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
inherited

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 geo::GeometryCore::ComputeThirdPlaneSlope(), geo::PlaneGeo::PhiZ(), geo::TPCGeo::Plane(), and geo::GeometryCore::TPC().

Referenced by trkf::CCTrackMaker::FillEndMatch(), trkf::CCTrackMaker::PlnMatch(), and geo::GeometryCore::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
inherited

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

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 geo::GeometryCore::ComputeThirdPlane_dTdW(), geo::GeometryCore::ComputeThirdPlaneSlope(), geo::GeometryCore::cryostat_zero, geo::GeometryCore::GetClosestOpDet(), geo::GeometryCore::NOpDets(), geo::GeometryCore::OpChannel(), geo::GeometryCore::OpDetGeoFromOpChannel(), geo::GeometryCore::OpDetGeoFromOpDet(), geo::GeometryCore::OpDetGeoName(), geo::GeometryCore::ThirdPlane_dTdW(), and geo::GeometryCore::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
inlineinherited

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

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
inherited

Returns the total number of TPCs in the detector.

Definition at line 807 of file GeometryCore.cxx.

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

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

Returns the specified TPC.

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

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

Definition at line 722 of file GeometryCore.h.

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

Referenced by hit::MagDriftAna::analyze(), larg4::ISCalcCorrelated::AngleToEFieldAtStep(), pma::ProjectionMatchingAlg::buildShowerSeg(), phot::PropagationTimeModel::cathodeCentre(), pma::VtxCandidate::ComputeMse2D(), geo::GeometryCore::DetHalfHeight(), geo::GeometryCore::DetHalfWidth(), geo::GeometryCore::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(), geo::GeometryCore::GetElement(), geo::GeometryCore::GetEndPlaneID(), geo::GeometryCore::GetEndWireID(), geo::GeometryCore::GetLArTPCVolumeName(), trkf::FeatureTracker::GetProjectedEnds(), nnet::TrainingDataAlg::getProjection(), geo::GeometryCore::GetTPCFrontFaceCenter(), lar_pandora::LArPandoraInput::GetTrueX0(), pma::ProjectionMatchingAlg::guideEndpoints(), geo::GeometryCore::IncrementID(), pma::Track3D::InitFromMiddle(), trkf::SpacePointAlg::makeSpacePoints(), pma::PMAlgTracker::matchCluster(), larg4::OpFastScintillation::OpFastScintillation(), geo::GeometryCore::Plane(), geo::GeometryCore::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(), geo::GeometryCore::ThirdPlane_dTdW(), geo::GeometryCore::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(), geo::GeometryCore::WireAngleToVertical(), and geo::GeometryCore::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
inlineinherited

Returns the specified TPC.

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

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

Definition at line 735 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::GetElementPtr(), geo::GeometryCore::GetEndPlaneID(), geo::GeometryCore::GetEndWireID(), geo::GeometryCore::HasPlane(), and geo::GeometryCore::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
inherited

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 geo::GeometryCore::fChannelMapAlg.

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

Returns the ID of the TPC set tpcid belongs to.

Definition at line 1491 of file GeometryCore.cxx.

References geo::GeometryCore::fChannelMapAlg.

Referenced by geo::GeometryCore::FindTPCsetAtPosition(), and geo::GeometryCore::HasElement().

1492  {
1493  return fChannelMapAlg->TPCtoTPCset(tpcid);
1494  }
std::unique_ptr< const ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
View_t geo::GeometryCore::View ( PlaneID const &  pid) const
inherited

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, geo::GeometryCore::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(), geo::GeometryCore::GetBeginPlaneID(), geo::GeometryCore::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(), geo::GeometryCore::View(), and geo::GeometryCore::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
inherited

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 geo::GeometryCore::ChannelToROP(), raw::InvalidChannelID, geo::kUnknown, and geo::GeometryCore::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
inherited

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

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

Referenced by larg4::LArG4Ana::analyze(), LArStackingAction::InsideTPC(), and geo::GeometryCore::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
inlineinherited

Returns the specified wire.

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

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

Definition at line 1210 of file GeometryCore.h.

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

Referenced by geo::GeometryCore::ChannelsIntersect(), lar_pandora::LArPandoraInput::CreatePandoraHits2D(), util::GeometryUtilities::GeometryUtilities(), geo::GeometryCore::GetElement(), lar_pandora::PFParticleHitDumper::GetUVW(), geo::GeometryCore::IncrementID(), trkf::Track3DKalmanHitAlg::makeSeed(), geo::GeometryCore::WireEndPoints(), and geo::GeometryCore::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
inherited

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(), geo::GeometryCore::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
inherited

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

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(), geo::GeometryCore::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
inlineinherited

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 geo::GeometryCore::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::WireIDsIntersect ( WireID const &  wid1,
WireID const &  wid2,
Point_t intersection 
) const
inherited

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(), geo::GeometryCore::ChannelsIntersect(), apa::DisambigAlg::CompareViews(), shower::EMShowerAlg::Construct3DPoint_(), evd::TWQProjectionView::FindEndPoint(), evd::TWQProjectionView::FindLineLength(), geo::GeometryCore::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
inherited

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
inherited

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

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 geo::GeometryCore::Plane(), geo::GeometryCore::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
inherited

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 geo::GeometryCore::fChannelMapAlg.

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

Returns the specified wire.

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

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

Definition at line 1192 of file GeometryCore.h.

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

Referenced by lar_cluster3d::MinSpanTreeAlg::configure(), evd_tool::MicroBooNEDrawer::DrawBadChannels(), evd_tool::ICARUSDrawer::DrawBadChannels(), and geo::GeometryCore::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
inherited

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

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 geo::GeometryCore::GetWorldVolumeName(), geo::GeometryCore::WorldVolume(), x1, x2, y1, and y2.

Referenced by geo::GeometryCore::DetectorName(), geo::GeometryCore::MaterialName(), and geo::GeometryCore::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
inherited

Returns a pointer to the world volume.

Definition at line 883 of file GeometryCore.cxx.

References geo::GeometryCore::GetWorldVolumeName().

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

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

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

fhicl::ParameterSet geo::Geometry::fBuilderParameters
private

Parameter set for geometry builder.

Definition at line 229 of file Geometry.h.

Referenced by LoadNewGeometry().

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

Summary of service configuration.

Definition at line 231 of file Geometry.h.

Referenced by CheckConfigurationInfo(), FillGeometryConfigurationInfo(), and preBeginRun().

bool geo::Geometry::fDisableWiresInG4
private

If set true, supply G4 with GDMLfileNoWires rather than GDMLfile

Definition at line 224 of file Geometry.h.

Referenced by LoadNewGeometry().

bool geo::Geometry::fNonFatalConfCheck
private

Don't stop if configuration check fails. files specified in the fcl file

Definition at line 226 of file Geometry.h.

Referenced by preBeginRun().

std::string geo::Geometry::fRelPath
private

Relative path added to FW_SEARCH_PATH to search for geometry file

Definition at line 222 of file Geometry.h.

Referenced by Geometry(), and LoadNewGeometry().

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

Parameter set to define the channel map sorting.

Definition at line 228 of file Geometry.h.

Referenced by InitializeChannelMap().

constexpr std::size_t geo::GeometryCore::MaxWireDepthInGDML = 20U
staticinherited

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}
staticinherited

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}
staticinherited

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


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