LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane. Different wires may be connected to the same readout channel. That is of no relevance for the geometry description. More...
#include "WireGeo.h"
Classes | |
struct | WireGeoCoordinatesTag |
Tag for vectors in the "local" GDML coordinate frame of the plane. More... | |
Public Types | |
using | GeoNodePath_t = std::vector< TGeoNode const * > |
Types for geometry-local reference vectors. | |
These types represents points and displacement vectors in the reference frame defined in the wire geometry "box" from the GDML geometry description. No alias is explicitly defined for the LArSoft global vector types, Remember the | |
using | LocalPoint_t = geo::Point3DBase_t< WireGeoCoordinatesTag > |
Type of points in the local GDML wire plane frame. More... | |
using | LocalVector_t = geo::Vector3DBase_t< WireGeoCoordinatesTag > |
Type of displacement vectors in the local GDML wire plane frame. More... | |
Public Member Functions | |
WireGeo (GeoNodePath_t const &path, size_t depth) | |
bool | isHorizontal () const |
Returns if this wire is horizontal (theta_z ~ 0) More... | |
bool | isVertical () const |
Returns if this wire is vertical (theta_z ~ pi/2) More... | |
bool | isParallelTo (geo::WireGeo const &wire) const |
Returns if this wire is parallel to another. More... | |
template<typename Vector = DefaultVector_t> | |
Vector | Direction () const |
Returns the wire direction as a norm-one vector. More... | |
template<typename Stream > | |
void | PrintWireInfo (Stream &&out, std::string indent="", unsigned int verbosity=1) const |
Prints information about this wire. More... | |
const TGeoNode * | Node () const |
double | ComputeZatY0 () const |
double | DistanceFrom (geo::WireGeo const &wire) const |
Returns 3D distance from the specified wire. More... | |
void | UpdateAfterSorting (geo::WireID const &, bool flip) |
Size and coordinates | |
double | RMax () const |
Returns the outer half-size of the wire [cm]. More... | |
double | HalfL () const |
Returns half the length of the wire [cm]. More... | |
double | RMin () const |
Returns the inner radius of the wire (usually 0) [cm]. More... | |
void | GetCenter (double *xyz, double localz=0.0) const |
Fills the world coordinate of a point on the wire. More... | |
void | GetStart (double *xyz) const |
void | GetEnd (double *xyz) const |
template<typename Point = DefaultPoint_t> | |
Point | GetPositionFromCenter (double localz) const |
Returns the position (world coordinate) of a point on the wire. More... | |
template<typename Point = DefaultPoint_t> | |
Point | GetPositionFromCenterUnbounded (double localz) const |
Returns the position (world coordinate) of a point on the wire. More... | |
template<typename Point = DefaultPoint_t> | |
Point | GetCenter () const |
Returns the world coordinate of the center of the wire [cm]. More... | |
template<typename Point = DefaultPoint_t> | |
Point | GetStart () const |
Returns the world coordinate of one end of the wire [cm]. More... | |
template<typename Point = DefaultPoint_t> | |
Point | GetEnd () const |
Returns the world coordinate of one end of the wire [cm]. More... | |
double | Length () const |
Returns the wire length in centimeters. More... | |
Orientation and angles | |
double | ThetaZ () const |
Returns angle of wire with respect to z axis in the Y-Z plane in radians. More... | |
double | ThetaZ (bool degrees) const |
double | CosThetaZ () const |
Returns trigonometric operations on ThetaZ() More... | |
double | SinThetaZ () const |
Returns angle of wire with respect to z axis in the Y-Z plane in radians. More... | |
double | TanThetaZ () const |
Returns angle of wire with respect to z axis in the Y-Z plane in radians. More... | |
Coordinate transformation | |
Local points and displacement vectors are described by the types | |
void | LocalToWorld (const double *wire, double *world) const |
Transform point from local wire frame to world frame. More... | |
geo::Point_t | toWorldCoords (LocalPoint_t const &local) const |
Transform point from local wire frame to world frame. More... | |
void | LocalToWorldVect (const double *wire, double *world) const |
Transform direction vector from local to world. More... | |
geo::Vector_t | toWorldCoords (LocalVector_t const &local) const |
Transform direction vector from local to world. More... | |
void | WorldToLocal (const double *world, double *wire) const |
Transform point from world frame to local wire frame. More... | |
LocalPoint_t | toLocalCoords (geo::Point_t const &world) const |
Transform point from world frame to local wire frame. More... | |
void | WorldToLocalVect (const double *world, double *wire) const |
Transform direction vector from world to local. More... | |
LocalVector_t | toLocalCoords (geo::Vector_t const &world) const |
Transform direction vector from world to local. More... | |
Static Public Member Functions | |
static double | WirePitch (geo::WireGeo const &w1, geo::WireGeo const &w2) |
Returns the pitch (distance on y/z plane) between two wires, in cm. More... | |
Static Public Attributes | |
static constexpr unsigned int | MaxVerbosity = 4 |
Maximum verbosity supported by PrintWireInfo() . More... | |
Private Types | |
using | DefaultVector_t = TVector3 |
using | DefaultPoint_t = TVector3 |
using | LocalTransformation_t = geo::LocalTransformationGeo< TGeoHMatrix, LocalPoint_t, LocalVector_t > |
Private Member Functions | |
bool | isFlipped () const |
double | relLength (double local) const |
Returns the relative length from center to be used when transforming. More... | |
double | capLength (double local) const |
Caps the specified local length coordinate to lay on the wire. More... | |
double | capRelLength (double local) const |
Stacked capLength() and relLength() . More... | |
void | Flip () |
Set to swap the start and end wire. More... | |
Static Private Member Functions | |
static double | gausSum (double a, double b) |
Private Attributes | |
const TGeoNode * | fWireNode |
Pointer to the wire node. More... | |
double | fThetaZ |
angle of the wire with respect to the z direction More... | |
double | fHalfL |
half length of the wire More... | |
geo::Point_t | fCenter |
Center of the wire in world coordinates. More... | |
LocalTransformation_t | fTrans |
Wire to world transform. More... | |
bool | flipped |
whether start and end are reversed More... | |
Geometry description of a TPC wire
The wire is a single straight segment on a wire plane. Different wires may be connected to the same readout channel. That is of no relevance for the geometry description.
The wire has a start and an end point. Their definition of them is related to the other wires in the plane and to the TPC itself.
The direction of increasing wire coordinate, defined in the wire plane, is orthogonal to the wire direction and of course points to the direction where the wire number within the plane increases. This direction is indirectly defined when sorting the wires in the plane, which is done by the plane (geo::PlaneGeo). This direction lies by definition on the wire plane. The direction normal to the wire plane is defined by the TPC so that it points inward the TPC rather than outward. Finally, the wire direction is defined so that the triplet of unit vectors direction of the wire , direction of increasing wire number , and normal to the plane is positively defined ( ). The start and the end of the wire are defined so that their difference points in the same direction as .
|
private |
|
private |
using geo::WireGeo::GeoNodePath_t = std::vector<TGeoNode const*> |
|
private |
geo::WireGeo::WireGeo | ( | GeoNodePath_t const & | path, |
size_t | depth | ||
) |
Definition at line 29 of file WireGeo.cxx.
References evd::details::end(), fCenter, fHalfL, fThetaZ, fWireNode, util::pi(), and toWorldCoords().
|
inlineprivate |
Caps the specified local length coordinate to lay on the wire.
Definition at line 347 of file WireGeo.h.
References HalfL(), max, and min.
Referenced by capRelLength(), and GetPositionFromCenter().
|
inlineprivate |
Stacked capLength()
and relLength()
.
Definition at line 351 of file WireGeo.h.
References capLength(), Flip(), and relLength().
|
inline |
Returns the z coordinate, in centimetres, at the point where y = 0. Assumes the wire orthogonal to x axis and the wire not parallel to z.
Definition at line 307 of file WireGeo.h.
References DistanceFrom(), fCenter, TanThetaZ(), and UpdateAfterSorting().
|
inline |
Returns trigonometric operations on ThetaZ()
Definition at line 203 of file WireGeo.h.
Referenced by geo::ChannelMapStandardAlg::Initialize(), isVertical(), and ThetaZ().
Vector geo::WireGeo::Direction | ( | ) | const |
Returns the wire direction as a norm-one vector.
Definition at line 377 of file WireGeo.h.
References Length().
Referenced by lar_cluster3d::MinSpanTreeAlg::configure(), DistanceFrom(), lar_cluster3d::PrincipalComponentsAlg::getHit2DPocaToAxis(), geo::PlaneGeo::GetNormalAxis(), geo::GeometryCore::IntersectSegments(), isParallelTo(), lar_cluster3d::PrincipalComponentsAlg::PCAAnalysis_2D(), lar_cluster3d::PrincipalComponentsAlg::PCAAnalysis_calc2DDocas(), and geo::PlaneGeo::shouldFlipWire().
double geo::WireGeo::DistanceFrom | ( | geo::WireGeo const & | wire | ) | const |
Returns 3D distance from the specified wire.
If the specified wire is "ahead" in z respect to this, the distance is returned negative.
Definition at line 100 of file WireGeo.cxx.
References Direction(), GetCenter(), and isParallelTo().
Referenced by ComputeZatY0(), and WirePitch().
|
private |
Set to swap the start and end wire.
Definition at line 131 of file WireGeo.cxx.
References flipped.
Referenced by capRelLength(), and UpdateAfterSorting().
|
inlinestaticprivate |
void geo::WireGeo::GetCenter | ( | double * | xyz, |
double | localz = 0.0 |
||
) | const |
Fills the world coordinate of a point on the wire.
xyz | _(output)_ the position to be filled, as [ x, y, z ] (in cm) |
localz | distance of the requested point from the middle of the wire |
GetCenter()
, GetStart()
, GetEnd()
, GetPositionFromCenter()
The center of the wires corresponds to localz
equal to 0
; negative positions head toward the start of the wire, positive toward the end.
If the localz
position would put the point outside the wire, the returned position is the wire end closest to the requested position.
Definition at line 68 of file WireGeo.cxx.
References fCenter, fHalfL, LocalToWorld(), and relLength().
Referenced by hit::MagDriftAna::analyze(), trkf::SpacePointAlg::compatible(), lar_pandora::LArPandoraInput::CreatePandoraHits2D(), lar_pandora::LArPandoraInput::CreatePandoraReadoutGaps(), hit::DisambigCheater::DisambigCheater(), DistanceFrom(), trkf::SpacePointAlg::fillComplexSpacePoint(), trkf::SpacePointAlg::fillSpacePoint(), lar_cluster3d::PrincipalComponentsAlg::getHit2DPocaToAxis(), geo::PlaneGeo::GetNormalAxis(), cluster::MergeClusterAlg::GlobalWire(), cluster::BlurredClusteringAlg::GlobalWire(), shower::EMShowerAlg::GlobalWire(), geo::ChannelMapStandardAlg::Initialize(), geo::GeometryCore::IntersectSegments(), recob::tracking::makePlane(), trkf::Track3DKalmanHitAlg::makeSeed(), trkf::SpacePointAlg::makeSpacePoints(), lar_cluster3d::PrincipalComponentsAlg::PCAAnalysis_2D(), lar_cluster3d::PrincipalComponentsAlg::PCAAnalysis_calc2DDocas(), geo::PlaneGeo::PlaneCoordinateFrom(), trkf::SpacePointAlg::separation(), geo::sortWireStandard(), trkf::SurfWireLine::SurfWireLine(), trkf::SurfWireX::SurfWireX(), and apa::APAGeometryAlg::ThreeChanPos().
|
inline |
Returns the world coordinate of the center of the wire [cm].
Definition at line 171 of file WireGeo.h.
References fCenter.
Referenced by DistanceFrom(), GetEnd(), GetStart(), and HalfL().
|
inline |
Fills the world coordinate of one end of the wire
Definition at line 133 of file WireGeo.h.
References fHalfL, and GetCenter().
Referenced by geo::PlaneGeo::Coverage(), evd_tool::ICARUSDrawer::DrawBadChannels(), evd_tool::MicroBooNEDrawer::DrawBadChannels(), lar_pandora::PFParticleHitDumper::GetUVW(), geo::details::ActiveAreaCalculator::initializeWireEnds(), and geo::GeometryCore::WireEndPoints().
|
inline |
Returns the world coordinate of one end of the wire [cm].
Definition at line 180 of file WireGeo.h.
References HalfL().
|
inline |
Returns the position (world coordinate) of a point on the wire.
Point | type of vector to be returned (current default: TVector3 ) |
localz | distance of the requested point from the middle of the wire |
The center of the wires corresponds to localz
equal to 0
; negative positions head toward the start of the wire, positive toward the end.
If the localz
position would put the point outside the wire, the returned position is the wire end closest to the requested position.
Definition at line 150 of file WireGeo.h.
References capLength(), and GetPositionFromCenterUnbounded().
Point geo::WireGeo::GetPositionFromCenterUnbounded | ( | double | localz | ) | const |
Returns the position (world coordinate) of a point on the wire.
Point | type of vector to be returned (current default: TVector3 ) |
localz | distance of the requested point from the middle of the wire |
GetCenter()
, GetStart()
, GetEnd()
, GetPositionFromCenter()
The center of the wires corresponds to localz
equal to 0
; negative positions head toward the start of the wire, positive toward the end.
If the localz
position would put the point outside the wire, the returned position will lie beyond the end of the wire.
Definition at line 369 of file WireGeo.h.
References relLength(), and toWorldCoords().
Referenced by GetPositionFromCenter().
|
inline |
Fills the world coordinate of one end of the wire
Definition at line 129 of file WireGeo.h.
References fHalfL, and GetCenter().
Referenced by geo::PlaneGeo::Coverage(), evd_tool::ICARUSDrawer::DrawBadChannels(), evd_tool::MicroBooNEDrawer::DrawBadChannels(), lar_pandora::PFParticleHitDumper::GetUVW(), geo::details::ActiveAreaCalculator::initializeWireEnds(), and geo::GeometryCore::WireEndPoints().
|
inline |
Returns the world coordinate of one end of the wire [cm].
Definition at line 175 of file WireGeo.h.
References HalfL().
|
inline |
Returns half the length of the wire [cm].
Definition at line 106 of file WireGeo.h.
References fHalfL, GetCenter(), and RMin().
Referenced by capLength(), trkf::SpacePointAlg::compatible(), trkf::SpacePointAlg::fillComplexSpacePoint(), trkf::SpacePointAlg::fillSpacePoint(), GetEnd(), GetStart(), geo::GeometryCore::IntersectSegments(), Length(), trkf::SpacePointAlg::makeSpacePoints(), lar_cluster3d::PrincipalComponentsAlg::PCAAnalysis_calc2DDocas(), and trkf::SpacePointAlg::separation().
|
inlineprivate |
Returns whether ( 0, 0, fHalfL ) identifies end (false) or start (true) of the wire.
Definition at line 341 of file WireGeo.h.
References flipped.
Referenced by relLength().
|
inline |
Returns if this wire is horizontal (theta_z ~ 0)
Definition at line 209 of file WireGeo.h.
References e, and SinThetaZ().
Referenced by PrintWireInfo().
|
inline |
Returns if this wire is parallel to another.
Definition at line 215 of file WireGeo.h.
References Direction(), e, art::detail::indent(), and PrintWireInfo().
Referenced by DistanceFrom().
|
inline |
Returns if this wire is vertical (theta_z ~ pi/2)
Definition at line 212 of file WireGeo.h.
References CosThetaZ(), and e.
Referenced by PrintWireInfo().
|
inline |
Returns the wire length in centimeters.
Definition at line 184 of file WireGeo.h.
References HalfL().
Referenced by Direction(), and PrintWireInfo().
|
inline |
Transform point from local wire frame to world frame.
Definition at line 269 of file WireGeo.h.
Referenced by GetCenter().
|
inline |
Transform direction vector from local to world.
Definition at line 277 of file WireGeo.h.
References fTrans, and geo::LocalTransformation< StoredMatrix >::LocalToWorldVect().
|
inline |
Definition at line 303 of file WireGeo.h.
References fWireNode.
void geo::WireGeo::PrintWireInfo | ( | Stream && | out, |
std::string | indent = "" , |
||
unsigned int | verbosity = 1 |
||
) | const |
Prints information about this wire.
Stream | type of output stream to use |
out | stream to send the information to |
indent | prepend each line with this string |
verbosity | amount of information printed |
Note that the first line out the output is not indented.
The constant MaxVerbosity
is set to the highest supported verbosity level.
Definition at line 386 of file WireGeo.h.
References isHorizontal(), isVertical(), Length(), and ThetaZ().
Referenced by isParallelTo(), and geo::GeometryCore::Print().
|
inlineprivate |
Returns the relative length from center to be used when transforming.
Definition at line 344 of file WireGeo.h.
References isFlipped().
Referenced by capRelLength(), GetCenter(), and GetPositionFromCenterUnbounded().
double geo::WireGeo::RMax | ( | ) | const |
Returns the outer half-size of the wire [cm].
Definition at line 88 of file WireGeo.cxx.
References fWireNode.
double geo::WireGeo::RMin | ( | ) | const |
Returns the inner radius of the wire (usually 0) [cm].
Definition at line 92 of file WireGeo.cxx.
References fWireNode.
Referenced by HalfL().
|
inline |
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
Definition at line 204 of file WireGeo.h.
References ThetaZ().
Referenced by geo::ChannelMapStandardAlg::Initialize(), and isHorizontal().
|
inline |
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
Definition at line 205 of file WireGeo.h.
References ThetaZ().
Referenced by ComputeZatY0().
|
inline |
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
Definition at line 192 of file WireGeo.h.
References CosThetaZ(), and fThetaZ.
Referenced by trkf::Track3DKalmanSPS::dQdxCalc(), evd::RecoBaseDrawer::DrawTrack2D(), recob::tracking::makePlane(), trkf::Track3DKalmanHitAlg::makeSeed(), PrintWireInfo(), trkf::SpacePts::produce(), trkf::Track3Dreco::produce(), vertex::VertexFinder2D::produce(), util::GeometryUtilities::Reconfigure(), SinThetaZ(), trkf::SurfWireLine::SurfWireLine(), trkf::SurfWireX::SurfWireX(), TanThetaZ(), geo::PlaneGeo::ThetaZ(), and trkf::SpacePointAlg::update().
double geo::WireGeo::ThetaZ | ( | bool | degrees | ) | const |
Returns angle of wire with respect to z axis in the Y-Z plane
degrees | return the angle in degrees rather than radians |
Definition at line 96 of file WireGeo.cxx.
References fThetaZ, and util::RadiansToDegrees().
|
inline |
Transform point from world frame to local wire frame.
Definition at line 289 of file WireGeo.h.
References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toLocalCoords().
|
inline |
Transform direction vector from world to local.
Definition at line 297 of file WireGeo.h.
References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toLocalCoords().
|
inline |
Transform point from local wire frame to world frame.
Definition at line 273 of file WireGeo.h.
References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toWorldCoords().
Referenced by GetPositionFromCenterUnbounded(), and WireGeo().
|
inline |
Transform direction vector from local to world.
Definition at line 281 of file WireGeo.h.
References fTrans, and geo::LocalTransformationGeo< StoredMatrix, LocalPoint, LocalVector >::toWorldCoords().
void geo::WireGeo::UpdateAfterSorting | ( | geo::WireID const & | , |
bool | flip | ||
) |
Internal updates after the relative position of the wire is known (currently no-op)
Definition at line 123 of file WireGeo.cxx.
References Flip().
Referenced by ComputeZatY0().
|
inlinestatic |
Returns the pitch (distance on y/z plane) between two wires, in cm.
Definition at line 325 of file WireGeo.h.
References DistanceFrom().
Referenced by geo::PlaneGeo::UpdateWirePitch(), and geo::PlaneGeo::UpdateWirePitchSlow().
|
inline |
Transform point from world frame to local wire frame.
Definition at line 285 of file WireGeo.h.
References fTrans, and geo::LocalTransformation< StoredMatrix >::WorldToLocal().
|
inline |
Transform direction vector from world to local.
Definition at line 293 of file WireGeo.h.
References fTrans, and geo::LocalTransformation< StoredMatrix >::WorldToLocalVect().
|
private |
Center of the wire in world coordinates.
Definition at line 335 of file WireGeo.h.
Referenced by ComputeZatY0(), GetCenter(), and WireGeo().
|
private |
half length of the wire
Definition at line 334 of file WireGeo.h.
Referenced by GetCenter(), GetEnd(), GetStart(), HalfL(), and WireGeo().
|
private |
whether start and end are reversed
Definition at line 337 of file WireGeo.h.
Referenced by Flip(), and isFlipped().
|
private |
|
private |
Wire to world transform.
Definition at line 336 of file WireGeo.h.
Referenced by LocalToWorldVect(), toLocalCoords(), toWorldCoords(), WorldToLocal(), and WorldToLocalVect().
|
private |
|
static |
Maximum verbosity supported by PrintWireInfo()
.
Definition at line 251 of file WireGeo.h.
Referenced by geo::GeometryCore::Print().