QwAnalysis
|
Converts between (u,v) and (x,y) coordinates. More...
#include <uv2xy.h>
Public Member Functions | |
Uv2xy (EQwRegionID region) | |
Create a transformation helper by region. More... | |
Uv2xy (const double angleUdeg) | |
Create a transformation helper from one angle. More... | |
Uv2xy (const double angleUdeg, const double angleVdeg) | |
Create a transformation helper from two angles. More... | |
void | SetWireSpacing (const double spacing) |
Set the wire spacing (perpendicular distance between wires) More... | |
void | SetOffset (const double offsetX, const double offsetY) |
Set the offset (origin of UV frame in XY coordinates) More... | |
void | SetAngleUVinXY (const double angleUrad, const double angleVrad) |
Set the angles of the U and V axis in the X and Y frame. More... | |
void | SetOriginUVinXY (const double originX, const double originY) |
Set the origin of the UV frame in the XY frame. More... | |
void | SetOriginXYinUV (const double originU, const double originV) |
Set the origin of the XY frame in the UV frame. More... | |
void | ShiftOriginUVinXY (const double shiftX, const double shiftY) |
Shift origin of the UV frame by XY coordinates. More... | |
void | ShiftOriginXYinUV (const double shiftU, const double shiftV) |
Shift origin of the XY frame by UV coordinates. More... | |
void | PrintUV () |
Print UV transformation matrix. More... | |
void | PrintXY () |
Print XY transformation matrix. More... | |
void | Print () |
Print UV and XY transformation matrices. More... | |
double | uv2x (double u, double v) |
Transform from [u,v] to x. More... | |
double | uv2y (double u, double v) |
Transform from [u,v] to y. More... | |
double | uv2mx (double u, double v) |
Transform from [u,v] to mx. More... | |
double | uv2my (double u, double v) |
Transform from [u,v] to my. More... | |
double | xy2u (double x, double y) |
Transform from [x,y] to u. More... | |
double | xy2v (double x, double y) |
Transform from [x,y] to v. More... | |
double | xy2mu (double x, double y) |
Transform from [x,y] to mu. More... | |
double | xy2mv (double x, double y) |
Transform from [x,y] to mv. More... | |
Private Member Functions | |
void | InitializeRotationMatrices () |
Initialize the rotation matrixes based on the stored angles. More... | |
Private Attributes | |
double | fUV [2][2] |
Transformation matrix UV from [u,v] to [x,y],. More... | |
double | fXY [2][2] |
which satisifies ![]() | |
double | fOffset [2] |
which satisifies ![]() | |
double | fWireSpacing |
Wirespacing in the u/v direction. More... | |
double | fAngleUrad |
Angle of the U direction in radians. More... | |
double | fAngleVrad |
Angle of the V direction in radians. More... | |
double | fOriginXYinUV [2] |
Origin of the XY system in UV coordinates. More... | |
double | fOriginUVinXY [2] |
Origin of the UV system in XY coordinates. More... | |
Friends | |
class | QwTrackingTreeCombine |
Friend class because of heavy use of private attributes. More... | |
Converts between (u,v) and (x,y) coordinates.
This class is to be used to convert the un-orthogonal(word?) u and v coordinates of the Region 2 and 3 drift chamber wire planes into x and y coordinates.
The transformation formulas with identical origins are
with the angle of the u wires and
the angle of the v wires with respect to the x axis. When
and
are not orthogonal, the transformation matrices are not normalized.
It is important to realize that the angle of the U wires is not equal to the angle of the U axis! If U wires are strung at constant values of the U coordinate (i.e. with u = 1 wire, u = 2 wire, u = 3 wire, etc), the U wires are orthogonal to the U axis.
The origins are not identical and an offset can be included.
Uv2xy::Uv2xy | ( | EQwRegionID | region | ) |
Create a transformation helper by region.
Uv2xy::Uv2xy | ( | const double | angleU | ) |
Create a transformation helper from one angle.
Create a coordinate transformation helper object based on a single angle
angleU | Angle (in radians) of the U axis |
Definition at line 33 of file uv2xy.cc.
References InitializeRotationMatrices(), Qw::pi, SetAngleUVinXY(), SetOffset(), SetOriginUVinXY(), and SetWireSpacing().
Uv2xy::Uv2xy | ( | const double | angleUrad, |
const double | angleVrad | ||
) |
Create a transformation helper from two angles.
Create a coordinate transformation helper object based on two angles.
angleUrad | Angle (in radians) of the U axis |
angleVrad | Angle (in radians) of the V axis |
Definition at line 58 of file uv2xy.cc.
References InitializeRotationMatrices(), SetAngleUVinXY(), SetOffset(), SetOriginUVinXY(), and SetWireSpacing().
|
private |
Initialize the rotation matrixes based on the stored angles.
Initialize the rotation matrices UV and XY based on the stored angles for the U and V axes.
Definition at line 95 of file uv2xy.cc.
References QwLog::endl(), fAngleUrad, fAngleVrad, fUV, fXY, and QwVerbose.
Referenced by Uv2xy().
|
inline |
|
inline |
|
inline |
void Uv2xy::SetAngleUVinXY | ( | const double | angleUrad, |
const double | angleVrad | ||
) |
Set the angles of the U and V axis in the X and Y frame.
Definition at line 74 of file uv2xy.cc.
References Qw::deg, QwLog::endl(), fAngleUrad, fAngleVrad, Qw::pi, and QwWarning.
Referenced by Uv2xy().
|
inline |
|
inline |
Set the origin of the UV frame in the XY frame.
Definition at line 81 of file uv2xy.h.
References fOriginUVinXY, fOriginXYinUV, xy2u(), and xy2v().
Referenced by Uv2xy().
|
inline |
Set the origin of the XY frame in the UV frame.
Definition at line 88 of file uv2xy.h.
References fOriginUVinXY, fOriginXYinUV, uv2x(), and uv2y().
|
inline |
Set the wire spacing (perpendicular distance between wires)
Definition at line 65 of file uv2xy.h.
References QwLog::endl(), fWireSpacing, and QwVerbose.
Referenced by Uv2xy().
|
inline |
Shift origin of the UV frame by XY coordinates.
Definition at line 95 of file uv2xy.h.
References fOriginUVinXY, fOriginXYinUV, xy2u(), and xy2v().
|
inline |
Shift origin of the XY frame by UV coordinates.
Definition at line 102 of file uv2xy.h.
References fOriginUVinXY, fOriginXYinUV, uv2x(), and uv2y().
double Uv2xy::uv2mx | ( | double | u, |
double | v | ||
) |
double Uv2xy::uv2my | ( | double | u, |
double | v | ||
) |
double Uv2xy::uv2x | ( | double | u, |
double | v | ||
) |
Transform from [u,v] to x.
Definition at line 129 of file uv2xy.cc.
References fOffset, fOriginXYinUV, fUV, fWireSpacing, and fXY.
Referenced by SetOriginXYinUV(), and ShiftOriginXYinUV().
double Uv2xy::uv2y | ( | double | u, |
double | v | ||
) |
Transform from [u,v] to y.
Definition at line 134 of file uv2xy.cc.
References fOffset, fOriginXYinUV, fUV, fWireSpacing, and fXY.
Referenced by SetOriginXYinUV(), and ShiftOriginXYinUV().
double Uv2xy::xy2mu | ( | double | x, |
double | y | ||
) |
double Uv2xy::xy2mv | ( | double | x, |
double | y | ||
) |
double Uv2xy::xy2u | ( | double | x, |
double | y | ||
) |
Transform from [x,y] to u.
Definition at line 149 of file uv2xy.cc.
References fOffset, fOriginUVinXY, fWireSpacing, and fXY.
Referenced by QwTreeEventBuffer::CreateHitRegion2(), QwTreeEventBuffer::CreateHitRegion3(), SetOriginUVinXY(), and ShiftOriginUVinXY().
double Uv2xy::xy2v | ( | double | x, |
double | y | ||
) |
Transform from [x,y] to v.
Definition at line 155 of file uv2xy.cc.
References fOffset, fOriginUVinXY, fWireSpacing, and fXY.
Referenced by QwTreeEventBuffer::CreateHitRegion2(), QwTreeEventBuffer::CreateHitRegion3(), SetOriginUVinXY(), and ShiftOriginUVinXY().
|
friend |
|
private |
Angle of the U direction in radians.
Definition at line 154 of file uv2xy.h.
Referenced by InitializeRotationMatrices(), and SetAngleUVinXY().
|
private |
Angle of the V direction in radians.
Definition at line 155 of file uv2xy.h.
Referenced by InitializeRotationMatrices(), and SetAngleUVinXY().
|
private |
|
private |
Origin of the UV system in XY coordinates.
Definition at line 158 of file uv2xy.h.
Referenced by SetOriginUVinXY(), SetOriginXYinUV(), ShiftOriginUVinXY(), ShiftOriginXYinUV(), xy2u(), and xy2v().
|
private |
Origin of the XY system in UV coordinates.
Definition at line 157 of file uv2xy.h.
Referenced by SetOriginUVinXY(), SetOriginXYinUV(), ShiftOriginUVinXY(), ShiftOriginXYinUV(), uv2x(), and uv2y().
|
private |
|
private |
|
private |