Belle II Software development
CIRCLECENTERXY_NAME< PointType > Class Template Reference

calculates the center of the circle for 3 hits in the XY plane and returns a B2Vector3 with the result (z=0). More...

#include <CircleCenterXY.h>

Inheritance diagram for CIRCLECENTERXY_NAME< PointType >:
SelectionVariable< PointType, 3, B2Vector3D >

Public Types

typedef B2Vector3D variableType
 Type of the returned object.
 
typedef PointType argumentType
 Type of the argument object.
 
typedef FunctionOf< Nargs, variableType, constargumentType & >::functionType functionType
 Type of the function returning the value.
 

Public Member Functions

 BELLE2_DEFINE_EXCEPTION (Straight_Line, "The hits are on a straight Line (or indistinguishably near to being on it).")
 this exception is thrown by the CircleFit and occurs when the track is too straight.
 
 PUT_NAME_FUNCTION (CIRCLECENTERXY_NAME)
 is replaced by "static const std:string name(void)" frunction which returns name of the Class
 

Static Public Member Functions

static B2Vector3D value (const PointType &a, const PointType &b, const PointType &c)
 calculates an estimation of circleCenter position, result is returned as the x and y value of the B2Vector3.
 
static variableType value (const PointType &arg1, const PointType &arg2)
 Static method that return the variable associated to:
 

Static Public Attributes

static const size_t c_Nargs
 Number of arguments.
 

Detailed Description

template<typename PointType>
class Belle2::CIRCLECENTERXY_NAME< PointType >

calculates the center of the circle for 3 hits in the XY plane and returns a B2Vector3 with the result (z=0).

WARNING this method throws an exception!

Definition at line 27 of file CircleCenterXY.h.

Member Typedef Documentation

◆ argumentType

typedef PointType argumentType
inherited

Type of the argument object.

Needed for SFINAE in Filter.hh

Definition at line 84 of file SelectionVariable.h.

◆ functionType

typedef FunctionOf<Nargs,variableType,constargumentType&>::functionType functionType
inherited

Type of the function returning the value.

Needed for the automated training

Definition at line 88 of file SelectionVariable.h.

◆ variableType

typedef B2Vector3D variableType
inherited

Type of the returned object.

Needed for SFINAE in Filter.hh

Definition at line 81 of file SelectionVariable.h.

Member Function Documentation

◆ value() [1/2]

static B2Vector3D value ( const PointType &  a,
const PointType &  b,
const PointType &  c 
)
inlinestatic

calculates an estimation of circleCenter position, result is returned as the x and y value of the B2Vector3.

Definition at line 36 of file CircleCenterXY.h.

37 {
38 // calculates the intersection point using Cramer's rule.
39 // x_1+s*n_1==x_2+t*n_2 --> n_1 *s - n_2 *t == x_2 - x_1 --> http://en.wikipedia.org/wiki/Cramer%27s_rule
40 double inX = b.X() - c.X(); // x value of the normal vector of the inner segment (b-c)
41 double inY = b.Y() - c.Y(); // y value of the normal vector of the inner segment (b-c)
42 double outX = a.X() - b.X(); // x value of the normal vector of the outer segment (a-b)
43 double outY = a.Y() - b.Y(); // y value of the normal vector of the outer segment (a-b)
44
45 //searching solution for Ax = b, aij are the matrix elements of A, bi are elements of b
46 double a11 = inY;
47 double a12 = -inX;
48 double a21 = -outY;
49 double a22 = outX;
50 double b1 = b.X() + outX * 0.5 - (c.X() + inX * 0.5);
51 double b2 = b.Y() + outY * 0.5 - (c.Y() + inY * 0.5);
52
53 if (a11 * a22 == a12 * a21) { throw Straight_Line(); }
54
55 double s = (b1 * a22 - b2 * a21) / (a11 * a22 - a12 * a21); //the determinant is zero if the three hits are on a line in (x,y).
56
57 return B2Vector3D(c.X() + inX * 0.5 + s * inY, c.Y() + inY * 0.5 - s * inX, 0.);
58 }
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition: B2Vector3.h:516

◆ value() [2/2]

static variableType value ( const PointType &  arg1,
const PointType &  arg2 
)
inlinestaticinherited

Static method that return the variable associated to:

Parameters
arg1first object of the pair
arg2second object of the pair

N.B. this method must be static.

Member Data Documentation

◆ c_Nargs

const size_t c_Nargs
staticinherited

Number of arguments.

Definition at line 91 of file SelectionVariable.h.


The documentation for this class was generated from the following file: