9 #include <cuda_runtime.h> 32 double *__restrict__
phits,
38 constexpr uint32_t hitsInFit =
N;
54 #ifdef BROKENLINE_DEBUG 57 printf(
"%d Ntuple of size %d/%d for %d hits to fit\n",
totTK,
nHitsL,
nHitsH, hitsInFit);
63 int tuple_idx = local_idx +
offset;
64 if (tuple_idx >=
totTK) {
70 assert(tkid < foundNtuplets->nOnes());
96 auto dx =
hhp->xGlobal(hitId[hitsInFit - 1]) -
hhp->xGlobal(hitId[0]);
97 auto dy =
hhp->yGlobal(hitId[hitsInFit - 1]) -
hhp->yGlobal(hitId[0]);
98 auto dz =
hhp->zGlobal(hitId[hitsInFit - 1]) -
hhp->zGlobal(hitId[0]);
104 for (uint32_t
i = 0;
i < hitsInFit; ++
i) {
106 if (hitsInFit - 1 ==
i)
114 auto const &
dp =
hhp->cpeParams().detParams(
hhp->detectorIndex(
hit));
117 assert(qbin >= 0 && qbin < 5);
120 dp.frame.rotation().multiply(
dx,
dy,
dz, ux, uy, uz);
127 bin = std::clamp(
bin, low_value, high_value);
128 float yerr =
dp.sigmay[
bin] * 1.e-4
f;
129 yerr *=
dp.yfact[qbin];
132 yerr = nok ?
hhp->yerrLocal(
hit) : yerr;
133 dp.frame.toGlobal(
hhp->xerrLocal(
hit), 0, yerr, ge);
136 .detParams(
hhp->detectorIndex(
hit))
143 printf(
"Track id %d %d Hit %d on %d\nGlobal: hits.col(%d) << %f,%f,%f\n",
152 printf(
"Error: hits_ge.col(%d) << %e,%e,%e,%e,%e,%e\n",
i, ge[0], ge[1], ge[2], ge[3], ge[4], ge[5]);
157 hits_ge.col(
i) << ge[0], ge[1], ge[2], ge[3], ge[4], ge[5];
162 assert(fast_fit(0) == fast_fit(0));
163 assert(fast_fit(1) == fast_fit(1));
164 assert(fast_fit(2) == fast_fit(2));
165 assert(fast_fit(3) == fast_fit(3));
174 double *__restrict__
phits,
189 auto tkid =
ptkids[local_idx];
211 #ifdef BROKENLINE_DEBUG 212 if (!(circle.
chi2 >= 0) || !(
line.chi2 >= 0))
213 printf(
"kernelBLFit failed! %f/%f\n", circle.
chi2,
line.chi2);
214 printf(
"kernelBLFit size %d for %d hits circle.par(0,1,2): %d %f,%f,%f\n",
221 printf(
"kernelBLHits line.par(0,1): %d %f,%f\n", tkid,
line.par(0),
line.par(1));
222 printf(
"kernelBLHits chi2 cov %f/%f %e,%e,%e,%e,%e\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 int...
caConstants::tindex_type tindex_type
caConstants::TupleMultiplicity const *__restrict__ tupleMultiplicity
constexpr uint16_t pixelPitchY
caConstants::TupleMultiplicity const *__restrict__ HitsOnGPU const *__restrict__ tindex_type *__restrict__ ptkids
caConstants::TupleMultiplicity const *__restrict__ HitsOnGPU const *__restrict__ tindex_type *__restrict__ double *__restrict__ float *__restrict__ phits_ge
constexpr uint32_t maxTuples
caConstants::TupleMultiplicity const *__restrict__ HitsOnGPU const *__restrict__ tindex_type *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t uint32_t int32_t offset
constexpr int kGenErrorQBins
Vector3d par
parameter: (X0,Y0,R)
caConstants::TupleMultiplicity const *__restrict__ HitsOnGPU const *__restrict__ tindex_type *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t nHitsL
__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 ...
Eigen::Map< Matrix3xNd< N >, 0, Eigen::Stride< 3 *stride, stride > > Map3xNd
__host__ __device__ void fastFit(const M3xN &hits, V4 &result)
A very fast helix fit.
Abs< T >::type abs(const T &t)
TrackSoA::HitContainer HitContainer
TrackSoAHeterogeneousT< maxNumber()> TrackSoA
Eigen::Map< Matrix6xNf< N >, 0, Eigen::Stride< 6 *stride, stride > > Map6xNf
caConstants::TupleMultiplicity const *__restrict__ HitsOnGPU const *__restrict__ tindex_type *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ pfast_fit
assert(hitsInFit<=nHitsL)
constexpr auto invalidTkId
caConstants::TupleMultiplicity const *__restrict__ HitsOnGPU const *__restrict__ hhp
Eigen::Map< Vector4d, 0, Eigen::InnerStride< stride > > Map4d
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
char data[epos_bytes_allocation]
caConstants::TupleMultiplicity const *__restrict__ HitsOnGPU const *__restrict__ tindex_type *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t uint32_t nHitsH
__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 intercepti...
data needed for the Broken Line fit procedure.
auto const & foundNtuplets
T1 atomicAdd(T1 *a, T2 b)
constexpr int kNumErrorBins
caConstants::TupleMultiplicity const *__restrict__ HitsOnGPU const *__restrict__ tindex_type *__restrict__ double *__restrict__ phits
constexpr uint32_t maxNumberOfConcurrentFits