Classes | |
struct | PreparedBrokenLineData |
data needed for the Broken Line fit procedure. More... | |
Typedefs | |
using | karimaki_circle_fit = riemannFit::CircleFit |
< Karimäki's parameters: (phi, d, k=1/R) More... | |
Functions | |
template<typename M3xN , typename M6xN , typename V4 , int n> | |
__host__ __device__ void | circleFit (const M3xN &hits, const M6xN &hits_ge, const V4 &fast_fit, const double bField, PreparedBrokenLineData< n > &data, karimaki_circle_fit &circle_results) |
Performs the Broken Line fit in the curved track case (that is, the fit parameters are the interceptions u and the curvature correction ). More... | |
template<typename M3xN , typename V4 > | |
__host__ __device__ void | fastFit (const M3xN &hits, V4 &result) |
A very fast helix fit. More... | |
template<int n> | |
riemannFit::HelixFit | helixFit (const riemannFit::Matrix3xNd< n > &hits, const Eigen::Matrix< float, 6, 4 > &hits_ge, const double bField) |
Helix fit by three step: -fast pre-fit (see Fast_fit() for further info); -circle fit of the hits projected in the transverse plane by Broken Line algorithm (see BL_Circle_fit() for further info); -line fit of the hits projected on the (pre-fitted) cilinder surface by Broken Line algorithm (see BL_Line_fit() for further info); Points must be passed ordered (from inner to outer layer). More... | |
template<typename V4 , typename M6xN , int n> | |
__host__ __device__ void | lineFit (const M6xN &hits_ge, const V4 &fast_fit, const double bField, const PreparedBrokenLineData< n > &data, riemannFit::LineFit &line_results) |
Performs the Broken Line fit in the straight track case (that is, the fit parameters are only the interceptions u). More... | |
template<int n> | |
__host__ __device__ riemannFit::MatrixNd< n > | matrixC_u (const riemannFit::VectorNd< n > &weights, const riemannFit::VectorNd< n > &sTotal, const riemannFit::VectorNd< n > &varBeta) |
Computes the n-by-n band matrix obtained minimizing the Broken Line's cost function w.r.t u. This is the whole matrix in the case of the line fit and the main n-by-n block in the case of the circle fit. More... | |
__host__ __device__ double | multScatt (const double &length, const double bField, const double radius, int layer, double slope) |
Computes the Coulomb multiple scattering variance of the planar angle. More... | |
template<typename M3xN , typename V4 , int n> | |
__host__ __device__ void | prepareBrokenLineData (const M3xN &hits, const V4 &fast_fit, const double bField, PreparedBrokenLineData< n > &results) |
Computes the data needed for the Broken Line fit procedure that are mainly common for the circle and the line fit. More... | |
__host__ __device__ riemannFit::Matrix2d | rotationMatrix (double slope) |
Computes the 2D rotation matrix that transforms the line y=slope*x into the line y=0. More... | |
__host__ __device__ void | translateKarimaki (karimaki_circle_fit &circle, double x0, double y0, riemannFit::Matrix3d &jacobian) |
Changes the Karimäki parameters (and consequently their covariance matrix) under a translation of the coordinate system, such that the old origin has coordinates (x0,y0) in the new coordinate system. The formulas are taken from Karimäki V., 1990, Effective circle fitting for particle trajectories, Nucl. Instr. and Meth. A305 (1991) 187. More... | |
using brokenline::karimaki_circle_fit = typedef riemannFit::CircleFit |
< Karimäki's parameters: (phi, d, k=1/R)
< covariance matrix:
|cov(phi,phi)|cov( d ,phi)|cov( k ,phi)|
|cov(phi, d )|cov( d , d )|cov( k , d )|
|cov(phi, k )|cov( d , k )|cov( k , k )|
as defined in Karimäki V., 1990, Effective circle fitting for particle trajectories, Nucl. Instr. and Meth. A305 (1991) 187.
Definition at line 18 of file BrokenLine.h.
|
inline |
Performs the Broken Line fit in the curved track case (that is, the fit parameters are the interceptions u and the curvature correction ).
hits | hits coordinates. |
hits_cov | hits covariance matrix. |
fast_fit | pre-fit result in the form (X0,Y0,R,tan(theta)). |
bField | magnetic field in Gev/cm/c. |
data | PreparedBrokenLineData. |
circle_results | struct to be filled with the results in this form: -par parameter of the line in this form: (phi, d, k); -cov covariance matrix of the fitted parameter; -chi2 value of the cost function in the minimum. |
The function implements the steps 2 and 3 of the Broken Line fit with the curvature correction.
The step 2 is the least square fit, done by imposing the minimum constraint on the cost function and solving the consequent linear system. It determines the fitted parameters u and and their covariance matrix. The step 3 is the correction of the fast pre-fitted parameters for the innermost part of the track. It is first done in a comfortable coordinate system (the one in which the first hit is the origin) and then the parameters and their covariance matrix are transformed to the original coordinate system.
Definition at line 314 of file BrokenLine.h.
References Calorimetry_cff::bField, riemannFit::CircleFit::chi2, gather_cfg::cout, riemannFit::CircleFit::cov, data, hfClusterShapes_cfi::hits, mps_fire::i, l1tstage2_dqm_sourceclient-live_cfg::invert, matrixC_u(), multScatt(), dqmiodumpmetadata::n, riemannFit::CircleFit::par, riemannFit::CircleFit::qCharge, rotationMatrix(), slope, riemannFit::sqr(), mathSSE::sqrt(), and translateKarimaki().
Referenced by __attribute__(), and helixFit().
|
inline |
A very fast helix fit.
hits | the measured hits. |
Definition at line 258 of file BrokenLine.h.
References a, funct::abs(), b, c, riemannFit::cross2D(), ztail::d, d1, MillePedeFileConverter_cfg::e, hfClusterShapes_cfi::hits, dqmiodumpmetadata::n, mps_fire::result, mathSSE::sqrt(), and createJobs::tmp.
Referenced by for(), and helixFit().
|
inline |
Helix fit by three step: -fast pre-fit (see Fast_fit() for further info);
-circle fit of the hits projected in the transverse plane by Broken Line algorithm (see BL_Circle_fit() for further info);
-line fit of the hits projected on the (pre-fitted) cilinder surface by Broken Line algorithm (see BL_Line_fit() for further info);
Points must be passed ordered (from inner to outer layer).
hits | Matrix3xNd hits coordinates in this form: |x1|x2|x3|...|xn| |y1|y2|y3|...|yn| |z1|z2|z3|...|zn| |
hits_cov | Matrix3Nd covariance matrix in this form (()->cov()): |(x1,x1)|(x2,x1)|(x3,x1)|(x4,x1)|.|(y1,x1)|(y2,x1)|(y3,x1)|(y4,x1)|.|(z1,x1)|(z2,x1)|(z3,x1)|(z4,x1)| |(x1,x2)|(x2,x2)|(x3,x2)|(x4,x2)|.|(y1,x2)|(y2,x2)|(y3,x2)|(y4,x2)|.|(z1,x2)|(z2,x2)|(z3,x2)|(z4,x2)| |(x1,x3)|(x2,x3)|(x3,x3)|(x4,x3)|.|(y1,x3)|(y2,x3)|(y3,x3)|(y4,x3)|.|(z1,x3)|(z2,x3)|(z3,x3)|(z4,x3)| |(x1,x4)|(x2,x4)|(x3,x4)|(x4,x4)|.|(y1,x4)|(y2,x4)|(y3,x4)|(y4,x4)|.|(z1,x4)|(z2,x4)|(z3,x4)|(z4,x4)| . . . . . . . . . . . . . . . |(x1,y1)|(x2,y1)|(x3,y1)|(x4,y1)|.|(y1,y1)|(y2,y1)|(y3,x1)|(y4,y1)|.|(z1,y1)|(z2,y1)|(z3,y1)|(z4,y1)| |(x1,y2)|(x2,y2)|(x3,y2)|(x4,y2)|.|(y1,y2)|(y2,y2)|(y3,x2)|(y4,y2)|.|(z1,y2)|(z2,y2)|(z3,y2)|(z4,y2)| |(x1,y3)|(x2,y3)|(x3,y3)|(x4,y3)|.|(y1,y3)|(y2,y3)|(y3,x3)|(y4,y3)|.|(z1,y3)|(z2,y3)|(z3,y3)|(z4,y3)| |(x1,y4)|(x2,y4)|(x3,y4)|(x4,y4)|.|(y1,y4)|(y2,y4)|(y3,x4)|(y4,y4)|.|(z1,y4)|(z2,y4)|(z3,y4)|(z4,y4)| . . . . . . . . . . . . . . . |(x1,z1)|(x2,z1)|(x3,z1)|(x4,z1)|.|(y1,z1)|(y2,z1)|(y3,z1)|(y4,z1)|.|(z1,z1)|(z2,z1)|(z3,z1)|(z4,z1)| |(x1,z2)|(x2,z2)|(x3,z2)|(x4,z2)|.|(y1,z2)|(y2,z2)|(y3,z2)|(y4,z2)|.|(z1,z2)|(z2,z2)|(z3,z2)|(z4,z2)| |(x1,z3)|(x2,z3)|(x3,z3)|(x4,z3)|.|(y1,z3)|(y2,z3)|(y3,z3)|(y4,z3)|.|(z1,z3)|(z2,z3)|(z3,z3)|(z4,z3)| |(x1,z4)|(x2,z4)|(x3,z4)|(x4,z4)|.|(y1,z4)|(y2,z4)|(y3,z4)|(y4,z4)|.|(z1,z4)|(z2,z4)|(z3,z4)|(z4,z4)| |
bField | magnetic field in the center of the detector in Gev/cm/c, in order to perform the p_t calculation. |
Definition at line 584 of file BrokenLine.h.
References funct::abs(), Calorimetry_cff::bField, riemannFit::CircleFit::chi2, riemannFit::HelixFit::chi2_circle, riemannFit::HelixFit::chi2_line, circleFit(), riemannFit::CircleFit::cov, riemannFit::HelixFit::cov, data, fastFit(), hfClusterShapes_cfi::hits, mps_splice::line, lineFit(), riemannFit::CircleFit::par, riemannFit::HelixFit::par, prepareBrokenLineData(), riemannFit::CircleFit::qCharge, riemannFit::HelixFit::qCharge, and riemannFit::sqr().
Referenced by PixelNtupletsFitter::run().
|
inline |
Performs the Broken Line fit in the straight track case (that is, the fit parameters are only the interceptions u).
hits | hits coordinates. |
fast_fit | pre-fit result in the form (X0,Y0,R,tan(theta)). |
bField | magnetic field in Gev/cm/c. |
data | PreparedBrokenLineData. |
line_results | struct to be filled with the results in this form: -par parameter of the line in this form: (cot(theta), Zip); -cov covariance matrix of the fitted parameter; -chi2 value of the cost function in the minimum. |
The function implements the steps 2 and 3 of the Broken Line fit without the curvature correction.
The step 2 is the least square fit, done by imposing the minimum constraint on the cost function and solving the consequent linear system. It determines the fitted parameters u and their covariance matrix. The step 3 is the correction of the fast pre-fitted parameters for the innermost part of the track. It is first done in a comfortable coordinate system (the one in which the first hit is the origin) and then the parameters and their covariance matrix are transformed to the original coordinate system.
Definition at line 463 of file BrokenLine.h.
References Calorimetry_cff::bField, riemannFit::LineFit::chi2, gather_cfg::cout, riemannFit::LineFit::cov, data, mps_fire::i, l1tstage2_dqm_sourceclient-live_cfg::invert, matrixC_u(), multScatt(), dqmiodumpmetadata::n, riemannFit::LineFit::par, rotationMatrix(), slope, riemannFit::sqr(), createJobs::tmp, w(), and HLT_2022v12_cff::weights.
Referenced by __attribute__(), and helixFit().
|
inline |
Computes the n-by-n band matrix obtained minimizing the Broken Line's cost function w.r.t u. This is the whole matrix in the case of the line fit and the main n-by-n block in the case of the circle fit.
weights | weights of the first part of the cost function, the one with the measurements and not the angles ({i=1}^n w*(y_i-u_i)^2). |
sTotal | total distance traveled by the particle from the pre-fitted closest approach. |
varBeta | kink angles' variance. |
Definition at line 215 of file BrokenLine.h.
References mps_fire::i, dqmiodumpmetadata::n, riemannFit::sqr(), and HLT_2022v12_cff::weights.
Referenced by circleFit(), and lineFit().
|
inline |
Computes the Coulomb multiple scattering variance of the planar angle.
length | length of the track in the material. |
bField | magnetic field in Gev/cm/c. |
radius | radius of curvature (needed to evaluate p). |
layer | denotes which of the four layers of the detector is the endpoint of the multiple scattered track. For example, if Layer=3, then the particle has just gone through the material between the second and the third layer. |
< inverse of radiation length of the material in cm
number between 1/3 (uniform material) and 1 (thin scatterer) to be manually tuned
Definition at line 53 of file BrokenLine.h.
References funct::abs(), Calorimetry_cff::bField, fact, dqm-mbProfile::log, SiStripPI::min, HLT_2022v12_cff::pt2, CosmicsPD_Skims::radius, slope, and riemannFit::sqr().
Referenced by circleFit(), lineFit(), and prepareBrokenLineData().
|
inline |
Computes the data needed for the Broken Line fit procedure that are mainly common for the circle and the line fit.
hits | hits coordinates. |
fast_fit | pre-fit result in the form (X0,Y0,R,tan(theta)). |
bField | magnetic field in Gev/cm/c. |
results | PreparedBrokenLineData to be filled (see description of PreparedBrokenLineData). |
Definition at line 150 of file BrokenLine.h.
References Calorimetry_cff::bField, riemannFit::cross2D(), d1, hfClusterShapes_cfi::hits, mps_fire::i, multScatt(), dqmiodumpmetadata::n, bookConverter::results, rotationMatrix(), and slope.
Referenced by __attribute__(), and helixFit().
|
inline |
Computes the 2D rotation matrix that transforms the line y=slope*x into the line y=0.
slope | tangent of the angle of rotation. |
Definition at line 77 of file BrokenLine.h.
References makeMuonMisalignmentScenario::rot, slope, riemannFit::sqr(), and mathSSE::sqrt().
Referenced by circleFit(), lineFit(), prepareBrokenLineData(), and reco::BeamSpot::rotatedCovariance3D().
|
inline |
Changes the Karimäki parameters (and consequently their covariance matrix) under a translation of the coordinate system, such that the old origin has coordinates (x0,y0) in the new coordinate system. The formulas are taken from Karimäki V., 1990, Effective circle fitting for particle trajectories, Nucl. Instr. and Meth. A305 (1991) 187.
circle | circle fit in the old coordinate system. circle.par(0) is phi, circle.par(1) is d and circle.par(2) is rho. |
x0 | x coordinate of the translation vector. |
y0 | y coordinate of the translation vector. |
jacobian | passed by reference in order to save stack. |
Definition at line 97 of file BrokenLine.h.
References funct::cos(), l1tSlwPFPuppiJets_cfi::cosPhi, riemannFit::CircleFit::cov, amptDefaultParameters_cff::mu, riemannFit::CircleFit::par, hitfit::scalar(), funct::sin(), l1tSlwPFPuppiJets_cfi::sinPhi, riemannFit::sqr(), mathSSE::sqrt(), and protons_cff::xi.
Referenced by circleFit().