9 #ifndef LARCOREALG_GEOMETRY_WIREGEO_H 10 #define LARCOREALG_GEOMETRY_WIREGEO_H 19 #include "Math/GenVector/Transform3D.h" 25 #include <type_traits> 85 WireGeo
const& wireB);
257 double ThetaZ(
bool degrees)
const;
324 template <
typename Stream>
325 void PrintWireInfo(Stream&& out, std::string
indent =
"",
unsigned int verbosity = 1)
const;
333 std::string
WireInfo(std::string
indent =
"",
unsigned int verbosity = 1)
const;
438 return {point, ofsA, ofsB};
466 double relLength(
double local)
const {
return flipped ? -local : local; }
476 static_assert(std::is_move_assignable_v<WireGeo>);
477 static_assert(std::is_move_constructible_v<WireGeo>);
485 template <
typename Stream>
488 unsigned int verbosity
494 if (verbosity-- <= 0)
return;
497 out <<
" (" <<
Length() <<
" cm long)";
499 if (verbosity-- <= 0)
return;
502 out <<
", theta(z)=" <<
ThetaZ() <<
" rad";
504 if (verbosity-- <= 0)
return;
507 out <<
"\n" << indent <<
" center at " <<
GetCenter() <<
" cm";
509 if (verbosity-- <= 0)
return;
536 #endif // LARCOREALG_GEOMETRY_WIREGEO_H bool isVertical() const
Returns if this wire is vertical (theta_z ~ pi/2)
void Flip()
Set to swap the start and end wire.
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
bool isParallelTo(WireGeo const &wire) const
Returns if this wire is parallel to another.
void PrintWireInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this wire.
Point_t const & GetCenter() const
Returns the world coordinate of the center of the wire [cm].
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
double fThetaZ
angle of the wire with respect to the z direction
WireGeo(TGeoNode const &node, TransformationMatrix &&trans)
Constructor from a ROOT geometry node and a transformation.
double Length() const
Returns the wire length in centimeters.
Point_t fCenter
Center of the wire in world coordinates.
const TGeoNode * Node() const
double SinThetaZ() const
Returns trigonometric operations on ThetaZ()
Point_t GetPositionFromCenter(double localz) const
Returns the position (world coordinate) of a point on the wire.
constexpr auto abs(T v)
Returns the absolute value of the argument.
Point_t GetPositionFromCenterUnbounded(double localz) const
Returns the position (world coordinate) of a point on the wire.
Vector_t toWorldCoords(LocalVector_t const &local) const
Transform direction vector from local to world.
Point_t WiresIntersection(WireGeo const &wireA, WireGeo const &wireB)
Returns the point of wireA that is closest to wireB.
Point_t GetStart() const
Returns the world coordinate of one end of the wire [cm].
Point_t GetEnd() const
Returns the world coordinate of one end of the wire [cm].
double ThetaZ() const
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
void UpdateAfterSorting(WireID const &, bool flip)
recob::tracking::Point_t Point_t
double fHalfL
half length of the wire
IntersectionPointAndOffsets< Point_t > WiresIntersectionAndOffsets(WireGeo const &wireA, WireGeo const &wireB)
Returns the point of wireA that is closest to wireB.
std::string WireInfo(std::string indent="", unsigned int verbosity=1) const
Returns a string with all the information of the wire.
IntersectionPointAndOffsets< Point > LineClosestPointAndOffsetsWithUnitVectors(Point const &startA, UnitVector const &dirA, Point const &startB, UnitVector const &dirB)
Returns the point of a line that is closest to a second line.
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
bool isHorizontal() const
Returns if this wire is horizontal (theta_z ~ 0)
Vector_t Direction() const
double RMax() const
Returns the outer half-size of the wire [cm].
Utility for intersection of two 3D lines.
LocalPoint_t toLocalCoords(Point_t const &world) const
Transform point from world frame to local wire frame.
LocalVector_t toLocalCoords(Vector_t const &world) const
Transform direction vector from world to local.
std::string indent(std::size_t const i)
Utilities to extend the interface of geometry vectors.
Point_t IntersectionWith(WireGeo const &other) const
Returns the point of this wire that is closest to other wire.
Point LineClosestPointWithUnitVectors(Point const &startA, UnitVector const &dirA, Point const &startB, UnitVector const &dirB)
Returns the point of a line that is closest to a second line.
double HalfL() const
Returns half the length of the wire [cm].
double TanThetaZ() const
Returns trigonometric operations on ThetaZ()
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
double relLength(double local) const
Returns the relative length from center to be used when transforming.
std::vector< TGeoNode const * > GeoNodePath_t
LocalTransformation_t fTrans
Wire to world transform.
double capLength(double local) const
Caps the specified local length coordinate to lay on the wire.
static double WirePitch(WireGeo const &w1, WireGeo const &w2)
Returns the pitch (distance on y/z plane) between two wires, in cm.
Data structure for return values of LineClosestPointAndOffsets().
IntersectionPointAndOffsets< Point_t > IntersectionAndOffsetsWith(WireGeo const &other) const
Returns the point of this wire that is closest to other wire.
Tag for vectors in the "local" GDML coordinate frame of the plane.
double DistanceFrom(WireGeo const &wire) const
Returns 3D distance from the specified wire.
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintWireInfo().
GenPoint3DBase_t< double, C > Point3DBase_t
Type of 3D point with representation in double precision.
GenVector3DBase_t< double, C > Vector3DBase_t
double CosThetaZ() const
Returns trigonometric operations on ThetaZ()
Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local wire frame to world frame.
double ComputeZatY0() const
Namespace collecting geometry-related classes utilities.
Vector3DBase_t< WireGeoCoordinatesTag > LocalVector_t
Type of displacement vectors in the local GDML wire plane frame.
double RMin() const
Returns the inner radius of the wire (usually 0) [cm].
ROOT::Math::Transform3D TransformationMatrix
Type of transformation matrix used in geometry.
const TGeoNode * fWireNode
Pointer to the wire node.
Point3DBase_t< WireGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML wire plane frame.
bool flipped
whether (0, 0, fHalfL) identified end (false) or start (true)