7 #include <cuda_runtime.h> 26 double *__restrict__
phits,
30 constexpr uint32_t hitsInFit =
N;
48 auto tuple_idx = local_idx +
offset;
54 assert(tkid < foundNtuplets->nOnes());
64 for (
unsigned int i = 0;
i < hitsInFit; ++
i) {
69 .detParams(
hhp->detectorIndex(
hit))
74 hits_ge.col(
i) << ge[0], ge[1], ge[2], ge[3], ge[4], ge[5];
79 assert(fast_fit(0) == fast_fit(0));
80 assert(fast_fit(1) == fast_fit(1));
81 assert(fast_fit(2) == fast_fit(2));
82 assert(fast_fit(3) == fast_fit(3));
90 double *__restrict__
phits,
92 double *__restrict__ pfast_fit_input,
104 auto tuple_idx = local_idx +
offset;
132 double *__restrict__
phits,
134 double *__restrict__ pfast_fit_input,
147 auto tuple_idx = local_idx +
offset;
162 results->stateAtBS.copyFromCircle(
163 circle_fit[local_idx].par, circle_fit[local_idx].cov, line_fit.par, line_fit.cov, 1.f /
float(
bField), tkid);
165 results->eta(tkid) = asinhf(line_fit.par(0));
166 results->chi2(tkid) = (circle_fit[local_idx].chi2 + line_fit.chi2) / (2 *
N - 5);
169 printf(
"kernelLineFit size %d for %d hits circle.par(0,1,2): %d %f,%f,%f\n",
173 circle_fit[local_idx].par(0),
174 circle_fit[local_idx].par(1),
175 circle_fit[local_idx].par(2));
176 printf(
"kernelLineFit line.par(0,1): %d %f,%f\n", tkid, line_fit.par(0), line_fit.par(1));
177 printf(
"kernelLineFit chi2 cov %f/%f %e,%e,%e,%e,%e\n",
178 circle_fit[local_idx].
chi2,
180 circle_fit[local_idx].cov(0, 0),
181 circle_fit[local_idx].cov(1, 1),
182 circle_fit[local_idx].cov(2, 2),
caConstants::TupleMultiplicity const *__restrict__ uint32_t nHits
caConstants::TupleMultiplicity const *__restrict__ uint32_t HitsOnGPU const *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ pfast_fit
caConstants::TupleMultiplicity const *__restrict__ uint32_t HitsOnGPU const *__restrict__ hhp
caConstants::TupleMultiplicity const *__restrict__ uint32_t HitsOnGPU const *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t offset
__host__ __device__ LineFit lineFit(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...
__host__ __device__ CircleFit circleFit(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...
Eigen::Matrix< double, N, 1 > VectorNd
Eigen::Map< Matrix3xNd< N >, 0, Eigen::Stride< 3 *stride, stride > > Map3xNd
Abs< T >::type abs(const T &t)
TrackSoA::HitContainer HitContainer
caConstants::TupleMultiplicity const *__restrict__ tupleMultiplicity
TrackSoAHeterogeneousT< maxNumber()> TrackSoA
Eigen::Map< Matrix6xNf< N >, 0, Eigen::Stride< 6 *stride, stride > > Map6xNf
Eigen::Matrix< double, 2 *N, 2 *N > Matrix2Nd
caConstants::TupleMultiplicity const *__restrict__ uint32_t HitsOnGPU const *__restrict__ double *__restrict__ phits
Eigen::Map< Vector4d, 0, Eigen::InnerStride< stride > > Map4d
__host__ __device__ void fromCircleToPerigee(CircleFit &circle)
Transform circle parameter from (X0,Y0,R) to (phi,Tip,q/R) and consequently covariance matrix...
__host__ __device__ void loadCovariance2D(M6xNf const &ge, M2Nd &hits_cov)
auto const & foundNtuplets
caConstants::TupleMultiplicity const *__restrict__ uint32_t HitsOnGPU const *__restrict__ double *__restrict__ float *__restrict__ phits_ge
__host__ __device__ void fastFit(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 ...
constexpr uint32_t maxNumberOfConcurrentFits