public class HelixUtils extends Object
Modifier and Type | Field and Description |
---|---|
private static double |
_epsilon |
private static double |
_maxpath |
private static double |
_minslope |
private static double |
_tol |
Constructor and Description |
---|
HelixUtils()
Creates a new instance of HelixUtils.
|
Modifier and Type | Method and Description |
---|---|
static TrackDirection |
CalculateTrackDirection(HelicalTrackFit helix,
double s)
Return the TrackDirection object for a given point on a helix.
|
static Hep3Vector |
Direction(HelicalTrackFit helix,
double s)
Return a unit vector giving the track direction at a given point on
the helix.
|
private static Matrix |
DirectionDerivates(HelicalTrackFit helix,
Hep3Vector u,
double s)
Return the derivatives of the momentum unit vector with respect to the
helix parameters.
|
private static Hep3Vector |
getPositionOnCircle(CircleFit cfit,
HelicalTrackHit hit) |
private static double |
insidePolygon(Hep3Vector q,
List<Hep3Vector> p)
adapted from http://local.wasp.uwa.edu.au/~pbourke/geometry/insidepoly/
find if a point is inside a given polygon in 3Dspace
if the point is in the polygone the returned value is 2*PI
if the point is outside of the polygone the returned value is 0
if the point is not of the plan of the polygone the value is between 0 and 2PI
The polygone HAVE to Be convex for the algorythme to work
This fonction sum all the angle made by q and 2 consecutives point of the polygone
as this method is generic, it might be usefull to make it public,and mabe in another
file because it can be used for anything else than helix
|
static boolean |
isInterceptingBoundedCylinder(HelicalTrackFit helix,
double r,
double zmin,
double zmax)
return true if the helix is intercepting the bounded cylinder
Check if at least one of the first ten intersection of the helix with the cylinder
is between zmin and zmax...there might be a better way to do this
|
static boolean |
isInterceptingBoundedXYPlane(HelicalTrackFit helix,
Hep3Vector normal,
List<Hep3Vector> nodes)
Check if the given helix is intercepting an XY plane bouded by a
list of nodes
|
static boolean |
isInterceptingXYPlane(HelicalTrackFit helix,
Hep3Vector normal,
Hep3Vector orig)
Check if the given helix is intercepting XY plan
note, the z coordinate of the XY plane should be 0, but due to numerical
approximation, it accept all z value < _epsilon
|
static boolean |
isInterceptingZDisk(HelicalTrackFit helix,
double rmin,
double rmax,
double z)
return true if the helix is intercepting the given disk
|
static boolean |
isInterceptingZpolygon(HelicalTrackFit helix,
double z,
List<Hep3Vector> vertices)
return true if the point on the helix at coord z is intercepting a given ZPolygon, the
method don't check if the polygone is parallel to a z plane
this method check if the private methode insidePolygone return a value a less than .5 deg from 2PI
|
private static double |
PathCalc(double xc,
double yc,
double RC,
double x1,
double y1,
double x2,
double y2) |
static double |
PathLength(CircleFit cfit,
HelicalTrackHit hit)
Return the x-y path length from the DCA.
|
static double |
PathLength(CircleFit cfit,
HelicalTrackHit hit1,
HelicalTrackHit hit2)
Return the x-y path length between two HelicalTrackHits.
|
static double |
PathLength(HelicalTrackFit helix,
HelicalTrackHit hit)
Return the x-y path length from the DCA to a HelicalTrackHit.
|
static List<Double> |
PathToCylinder(HelicalTrackFit helix,
double r,
double smax,
int mxint)
Return a list of x-y path lengths to a cylinder centered on the z axis.
|
static List<Double> |
PathToXPlane(HelicalTrackFit helix,
double x,
double smax,
int mxint)
Return the x-y path length to an x-plane.
|
static double |
PathToXYPlan(HelicalTrackFit helix,
Hep3Vector normal,
Hep3Vector origin)
return one path length (projection on the XY plane) to an XY plane
the methode is for now only used to check IF an helix is intercepting an
XY plane
note, the z coordinate of the XY plane should be 0, but due to numerical
approximation, it accept all z value < _epsilon
|
static double |
PathToZPlane(HelicalTrackFit helix,
double z)
Return the x-y path length to a z-plane.
|
static Hep3Vector |
PointOnHelix(HelicalTrackFit helix,
double s)
Return the location in space for a particular point on a helix.
|
private static double |
RC(CircleFit cfit) |
private static double |
x0(CircleFit cfit) |
private static double |
xc(CircleFit cfit) |
private static double |
y0(CircleFit cfit) |
private static double |
yc(CircleFit cfit) |
private static double _minslope
private static double _maxpath
private static double _epsilon
private static double _tol
public static double PathLength(CircleFit cfit, HelicalTrackHit hit1, HelicalTrackHit hit2)
cfit
- CircleFit to be used in calculating the path lengthhit1
- first hithit2
- second hitpublic static double PathLength(CircleFit cfit, HelicalTrackHit hit)
cfit
- CircleFit to be used in calculating the path lengthhit
- hit to be used for the path length calculationpublic static double PathLength(HelicalTrackFit helix, HelicalTrackHit hit)
helix
- HelicalTrackFit to be used in calculating the path lengthhit
- hit to be used for the path length calculationpublic static double PathToZPlane(HelicalTrackFit helix, double z)
helix
- HelicalTrackFit to be used in calculating the path lengthz
- location of z-planepublic static List<Double> PathToXPlane(HelicalTrackFit helix, double x, double smax, int mxint)
helix
- HelicalTrackFit to be used in calculating the path lengthx
- location of x-planepublic static List<Double> PathToCylinder(HelicalTrackFit helix, double r, double smax, int mxint)
helix
- HelicalTrackFit to be used in calculating the path lengthr
- desired radiussmax
- maximum path length to be consideredmxint
- Maximum number of intersectionspublic static Hep3Vector Direction(HelicalTrackFit helix, double s)
helix
- HelicalTrackFit to be used in calculating directions
- path length to the desired point on helixpublic static TrackDirection CalculateTrackDirection(HelicalTrackFit helix, double s)
helix
- HelicalTrackFit to use in constructing the TrackDirections
- path length specifying location on helixpublic static Hep3Vector PointOnHelix(HelicalTrackFit helix, double s)
helix
- HelicalTrackFit to be useds
- path lengthprivate static Hep3Vector getPositionOnCircle(CircleFit cfit, HelicalTrackHit hit)
private static double PathCalc(double xc, double yc, double RC, double x1, double y1, double x2, double y2)
private static Matrix DirectionDerivates(HelicalTrackFit helix, Hep3Vector u, double s)
helix
- HelicalTrackFit to be used in calculating derivativess
- path length to the desired point on the helixpublic static boolean isInterceptingBoundedCylinder(HelicalTrackFit helix, double r, double zmin, double zmax)
helix
- r
- rarius of the cylinderzmin
- lower bound of the cylinderzmax
- higher bound of the cylinderpublic static boolean isInterceptingZDisk(HelicalTrackFit helix, double rmin, double rmax, double z)
helix
- rmin
- rmax
- z
- public static boolean isInterceptingZpolygon(HelicalTrackFit helix, double z, List<Hep3Vector> vertices)
helix
- z
- vertices
- public static boolean isInterceptingXYPlane(HelicalTrackFit helix, Hep3Vector normal, Hep3Vector orig)
helix
- the Helixnormal
- a unitary normal vector to the planorig
- one point of the planepublic static boolean isInterceptingBoundedXYPlane(HelicalTrackFit helix, Hep3Vector normal, List<Hep3Vector> nodes)
helix
- normal
- normal vector to the planenodes
- public static double PathToXYPlan(HelicalTrackFit helix, Hep3Vector normal, Hep3Vector origin)
helix
- normal
- a UNITARY vector NORMAL to the planorigin
- one point of the planeprivate static double insidePolygon(Hep3Vector q, List<Hep3Vector> p)
q
- the point to determine if it is or not in the polygonp
- List of edges of the polygoneprivate static double RC(CircleFit cfit)
private static double xc(CircleFit cfit)
private static double yc(CircleFit cfit)
private static double x0(CircleFit cfit)
private static double y0(CircleFit cfit)
Copyright © 2016 Linear Collider Detector (LCD). All rights reserved.