9 #ifndef LARCOREALG_GEOMETRY_WIREGEO_H 10 #define LARCOREALG_GEOMETRY_WIREGEO_H 18 #include "TGeoMatrix.h" 125 void GetCenter(
double* xyz,
double localz=0.0)
const;
149 template <
typename Po
int = DefaultPo
int_t>
151 {
return GetPositionFromCenterUnbounded<Point>(
capLength(localz)); }
166 template <
typename Po
int = DefaultPo
int_t>
170 template <
typename Po
int = DefaultPo
int_t>
174 template <
typename Po
int = DefaultPo
int_t>
176 {
return GetPositionFromCenterUnbounded<Point>(-
HalfL()); }
179 template <
typename Po
int = DefaultPo
int_t>
181 {
return GetPositionFromCenterUnbounded<Point>(+
HalfL()); }
199 double ThetaZ(
bool degrees)
const;
222 template <
typename Vector = DefaultVector_t>
246 template <
typename Stream>
248 (Stream&& out, std::string
indent =
"",
unsigned int verbosity = 1)
const;
268 void LocalToWorld(
const double* wire,
double* world)
const 358 static double gausSum(
double a,
double b) {
return std::sqrt(a*a + b*b); }
368 template <
typename Po
int>
370 return geo::vect::convertTo<Point>
376 template <
typename Vector >
380 return geo::vect::convertTo<Vector>(GetEnd<geo::Point_t>() - GetStart<geo::Point_t>()) * (1.0 /
Length());
385 template <
typename Stream>
389 unsigned int verbosity
393 out <<
"wire from " << GetStart<geo::Point_t>()
394 <<
" to " << GetEnd<geo::Point_t>();
396 if (verbosity-- <= 0)
return;
399 out <<
" (" <<
Length() <<
" cm long)";
401 if (verbosity-- <= 0)
return;
404 out <<
", theta(z)=" <<
ThetaZ() <<
" rad";
406 if (verbosity-- <= 0)
return;
409 out <<
"\n" << indent
410 <<
" center at " << GetCenter<geo::Point_t>() <<
" cm";
412 if (verbosity-- <= 0)
return;
415 out <<
", direction: " << Direction<geo::Vector_t>();
427 #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.
void GetStart(double *xyz) const
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
void PrintWireInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this wire.
Point GetCenter() const
Returns the world coordinate of the center of the wire [cm].
double fThetaZ
angle of the wire with respect to the z direction
geo::Point_t fCenter
Center of the wire in world coordinates.
Point GetEnd() const
Returns the world coordinate of one end of the wire [cm].
double DistanceFrom(geo::WireGeo const &wire) const
Returns 3D distance from the specified wire.
double Length() const
Returns the wire length in centimeters.
const TGeoNode * Node() const
double SinThetaZ() const
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
static double WirePitch(geo::WireGeo const &w1, geo::WireGeo const &w2)
Returns the pitch (distance on y/z plane) between two wires, in cm.
geo::Point_t toWorldCoords(LocalPoint_t const &local) const
Transform point from local wire frame to world frame.
double ThetaZ() const
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
double fHalfL
half length of the wire
void LocalToWorldVect(const double *wire, double *world) const
Transform direction vector from local to world.
Point GetPositionFromCenter(double localz) const
Returns the position (world coordinate) of a point on the wire.
void UpdateAfterSorting(geo::WireID const &, bool flip)
void LocalToWorld(const double *wire, double *world) const
Transform point from local wire frame to world frame.
bool isHorizontal() const
Returns if this wire is horizontal (theta_z ~ 0)
geo::Vector3DBase_t< WireGeoCoordinatesTag > LocalVector_t
Type of displacement vectors in the local GDML wire plane frame.
double RMax() const
Returns the outer half-size of the wire [cm].
static double gausSum(double a, double b)
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
std::string indent(std::size_t const i)
Utilities to extend the interface of geometry vectors.
double capRelLength(double local) const
Stacked capLength() and relLength().
LocalVector_t toLocalCoords(geo::Vector_t const &world) const
Transform direction vector from world to local.
Vector Direction() const
Returns the wire direction as a norm-one vector.
LocalPoint_t toLocalCoords(geo::Point_t const &world) const
Transform point from world frame to local wire frame.
void WorldToLocalVect(const double *world, double *wire) const
Transform direction vector from world to local.
double HalfL() const
Returns half the length of the wire [cm].
double TanThetaZ() const
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
Point GetPositionFromCenterUnbounded(double localz) const
Returns the position (world coordinate) of a point on the wire.
double relLength(double local) const
Returns the relative length from center to be used when transforming.
std::vector< TGeoNode const * > GeoNodePath_t
void GetEnd(double *xyz) const
LocalTransformation_t fTrans
Wire to world transform.
double capLength(double local) const
Caps the specified local length coordinate to lay on the wire.
Point GetStart() const
Returns the world coordinate of one end of the wire [cm].
geo::Point3DBase_t< WireGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML wire plane frame.
Tag for vectors in the "local" GDML coordinate frame of the plane.
geo::Vector_t toWorldCoords(LocalVector_t const &local) const
Transform direction vector from local to world.
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()
double ComputeZatY0() const
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Namespace collecting geometry-related classes utilities.
bool isParallelTo(geo::WireGeo const &wire) const
Returns if this wire is parallel to another.
double RMin() const
Returns the inner radius of the wire (usually 0) [cm].
WireGeo(GeoNodePath_t const &path, size_t depth)
const TGeoNode * fWireNode
Pointer to the wire node.
bool flipped
whether start and end are reversed
void WorldToLocal(const double *world, double *wire) const
Transform point from world frame to local wire frame.