CMS 3D CMS Logo

List of all members | Public Member Functions
riemannFit::helixFit< N > Class Template Reference

Helix fit by three step: -fast pre-fit (see Fast_fit() for further info);
-circle fit of hits projected in the transverse plane by Riemann-Chernov algorithm (see Circle_fit() for further info);
-line fit of hits projected on cylinder surface by orthogonal distance regression (see Line_fit for further info).
Points must be passed ordered (from inner to outer layer). More...

#include <RiemannFit.h>

Public Member Functions

template<typename TAcc >
ALPAKA_FN_ACC ALPAKA_FN_INLINE void operator() (const TAcc &acc, const Matrix3xNd< N > *hits, const Eigen::Matrix< float, 6, N > *hits_ge, const double bField, const bool error, HelixFit *helix) const
 

Detailed Description

template<int N>
class riemannFit::helixFit< N >

Helix fit by three step: -fast pre-fit (see Fast_fit() for further info);
-circle fit of hits projected in the transverse plane by Riemann-Chernov algorithm (see Circle_fit() for further info);
-line fit of hits projected on cylinder surface by orthogonal distance regression (see Line_fit for further info).
Points must be passed ordered (from inner to outer layer).

Parameters
hitsMatrix3xNd hits coordinates in this form:
|x0|x1|x2|...|xn|
|y0|y1|y2|...|yn|
|z0|z1|z2|...|zn|
hits_covMatrix3Nd covariance matrix in this form (()->cov()):
|(x0,x0)|(x1,x0)|(x2,x0)|.|(y0,x0)|(y1,x0)|(y2,x0)|.|(z0,x0)|(z1,x0)|(z2,x0)|
|(x0,x1)|(x1,x1)|(x2,x1)|.|(y0,x1)|(y1,x1)|(y2,x1)|.|(z0,x1)|(z1,x1)|(z2,x1)|
|(x0,x2)|(x1,x2)|(x2,x2)|.|(y0,x2)|(y1,x2)|(y2,x2)|.|(z0,x2)|(z1,x2)|(z2,x2)|
. . . . . . . . . . .
|(x0,y0)|(x1,y0)|(x2,y0)|.|(y0,y0)|(y1,y0)|(y2,x0)|.|(z0,y0)|(z1,y0)|(z2,y0)|
|(x0,y1)|(x1,y1)|(x2,y1)|.|(y0,y1)|(y1,y1)|(y2,x1)|.|(z0,y1)|(z1,y1)|(z2,y1)|
|(x0,y2)|(x1,y2)|(x2,y2)|.|(y0,y2)|(y1,y2)|(y2,x2)|.|(z0,y2)|(z1,y2)|(z2,y2)|
. . . . . . . . . . .
|(x0,z0)|(x1,z0)|(x2,z0)|.|(y0,z0)|(y1,z0)|(y2,z0)|.|(z0,z0)|(z1,z0)|(z2,z0)|
|(x0,z1)|(x1,z1)|(x2,z1)|.|(y0,z1)|(y1,z1)|(y2,z1)|.|(z0,z1)|(z1,z1)|(z2,z1)|
|(x0,z2)|(x1,z2)|(x2,z2)|.|(y0,z2)|(y1,z2)|(y2,z2)|.|(z0,z2)|(z1,z2)|(z2,z2)|
bFieldmagnetic field in the center of the detector in Gev/cm/c unit, in order to perform pt calculation.
errorflag for error computation.
scatteringflag for multiple scattering treatment. (see Circle_fit() documentation for further info).
Warning
see Circle_fit(), Line_fit() and Fast_fit() warnings.

Definition at line 987 of file RiemannFit.h.

Member Function Documentation

◆ operator()()

template<int N>
template<typename TAcc >
ALPAKA_FN_ACC ALPAKA_FN_INLINE void riemannFit::helixFit< N >::operator() ( const TAcc &  acc,
const Matrix3xNd< N > *  hits,
const Eigen::Matrix< float, 6, N > *  hits_ge,
const double  bField,
const bool  error,
HelixFit helix 
) const
inline

Definition at line 990 of file RiemannFit.h.

References Calorimetry_cff::bField, riemannFit::CircleFit::chi2, riemannFit::HelixFit::chi2_circle, riemannFit::HelixFit::chi2_line, ALPAKA_ACCELERATOR_NAMESPACE::riemannFit::circleFit(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), riemannFit::CircleFit::cov, riemannFit::HelixFit::cov, relativeConstraints::error, ALPAKA_ACCELERATOR_NAMESPACE::brokenline::fast_fit, ALPAKA_ACCELERATOR_NAMESPACE::riemannFit::fastFit(), hfClusterShapes_cfi::hits, mps_splice::line, ALPAKA_ACCELERATOR_NAMESPACE::riemannFit::lineFit(), ALPAKA_ACCELERATOR_NAMESPACE::riemannFit::loadCovariance2D(), N, dqmiodumpmetadata::n, riemannFit::CircleFit::par, riemannFit::HelixFit::par, ALPAKA_ACCELERATOR_NAMESPACE::riemannFit::par_uvrtopak(), riemannFit::CircleFit::qCharge, riemannFit::HelixFit::qCharge, and parallelization::uint.

995  {
996  constexpr uint n = N;
997  VectorNd<4> rad = (hits->block(0, 0, 2, n).colwise().norm());
998 
999  // Fast_fit gives back (X0, Y0, R, theta) w/o errors, using only 3 points.
1002  riemannFit::Matrix2Nd<N> hits_cov = MatrixXd::Zero(2 * n, 2 * n);
1005  acc, hits->block(0, 0, 2, n), hits_cov, fast_fit, rad, bField, error);
1006  LineFit line =
1008 
1010 
1011  helix->par << circle.par, line.par;
1012  if (error) {
1013  helix->cov = MatrixXd::Zero(5, 5);
1014  helix->cov.block(0, 0, 3, 3) = circle.cov;
1015  helix->cov.block(3, 3, 2, 2) = line.cov;
1016  }
1017  helix->qCharge = circle.qCharge;
1018  helix->chi2_circle = circle.chi2;
1019  helix->chi2_line = line.chi2;
1020  }
Eigen::Vector4d Vector4d
Definition: FitResult.h:14
ALPAKA_FN_ACC ALPAKA_FN_INLINE LineFit lineFit(const TAcc &acc, const M3xN &hits, const M6xN &hits_ge, const CircleFit &circle, const V4 &fast_fit, const double bField, const bool error)
Perform an ordinary least square fit in the s-z plane to compute the parameters cotTheta and Zip...
Definition: RiemannFit.h:792
ALPAKA_FN_ACC void loadCovariance2D(const TAcc &acc, M6xNf const &ge, M2Nd &hits_cov)
Definition: FitUtils.h:120
ALPAKA_FN_ACC ALPAKA_FN_INLINE void par_uvrtopak(const TAcc &acc, CircleFit &circle, const double B, const bool error)
Transform circle parameter from (X0,Y0,R) to (phi,Tip,p_t) and consequently covariance matrix...
Definition: FitUtils.h:206
ALPAKA_FN_ACC ALPAKA_FN_INLINE void fastFit(const TAcc &acc, const M3xN &hits, V4 &result)
A very fast helix fit: it fits a circle by three points (first, middle and last point) and a line by ...
Definition: RiemannFit.h:381
ALPAKA_FN_ACC ALPAKA_FN_INLINE void const M3xN const V4 & fast_fit
Definition: BrokenLine.h:156
Eigen::Matrix< double, 2 *N, 2 *N > Matrix2Nd
Definition: FitUtils.h:19
#define N
Definition: blowfish.cc:9
ALPAKA_FN_ACC ALPAKA_FN_INLINE CircleFit circleFit(const TAcc &acc, const M2xN &hits2D, const Matrix2Nd< N > &hits_cov2D, const V4 &fast_fit, const VectorNd< N > &rad, const double bField, const bool error)
Fit a generic number of 2D points with a circle using Riemann-Chernov algorithm. Covariance matrix of...
Definition: RiemannFit.h:461