12 #include <cuda_runtime.h> 36 template <
typename TrackerTraits>
39 template <
typename TrackerTraits>
42 template <
typename TrackerTraits>
45 template <
typename TrackerTraits>
48 template <
typename TrackerTraits>
53 template <
typename TrackerTraits>
56 template <
typename TrackerTraits>
59 template <
typename TrackerTraits>
62 template <
typename TrackerTraits>
65 template <
typename TrackerTraits>
70 template <
typename TrackerTraits>
76 uint32_t
const *__restrict__
nCells,
97 printf(
"number of found cells %d \n found tuples %d with total hits %d out of %d %d\n",
103 if (
apc->
get().m < TrackerTraits::maxNumberOfQuadruplets) {
110 if (
tracks_view.hitIndices().size(
idx) > TrackerTraits::maxHitsOnTrack)
119 if (
apc->
get().m >= TrackerTraits::maxNumberOfQuadruplets)
120 printf(
"Tuples overflow\n");
122 printf(
"Cells overflow\n");
126 printf(
"cellTracks overflow\n");
128 printf(
"ERROR hitToTuple overflow %d %d\n",
hitToTuple->nOnes(),
nHits);
130 printf(
"size of cellNeighbors %d \n cellTracks %d \n hitToTuple %d \n",
140 if (thisCell.hasFishbone() && !thisCell.isKilled())
142 if (thisCell.outerNeighbors().full())
143 printf(
"OuterNeighbors overflow %d in %d\n",
idx, thisCell.layerPairId());
144 if (thisCell.tracks().full())
145 printf(
"Tracks overflow %d in %d\n",
idx, thisCell.layerPairId());
146 if (thisCell.isKilled())
148 if (!thisCell.unused())
150 if ((0 ==
hitToTuple->size(thisCell.inner_hit_id())) && (0 ==
hitToTuple->size(thisCell.outer_hit_id())))
156 printf(
"OuterHitOfCell overflow %d\n",
idx);
160 template <
typename TrackerTraits>
162 uint32_t
const *__restrict__
nCells,
169 if (!thisCell.isKilled())
172 for (
auto it : thisCell.tracks())
179 template <
typename TrackerTraits>
181 uint32_t
const *__restrict__
nCells,
192 if (thisCell.tracks().size() < 2)
198 for (
auto it : thisCell.tracks()) {
207 for (
auto it : thisCell.tracks()) {
215 template <
typename TrackerTraits>
217 uint32_t
const *__restrict__
nCells,
229 if (thisCell.tracks().size() < 2)
239 int ntr = thisCell.tracks().size();
240 for (
int i = 0;
i < ntr - 1; ++
i) {
241 auto it = thisCell.tracks()[
i];
249 for (
auto j =
i + 1;
j < ntr; ++
j) {
250 auto jt = thisCell.tracks()[
j];
257 if ((cti - ctj) * (cti - ctj) > dct)
260 if ((opi - opj) * (opi - opj) > dop)
273 for (
auto it : thisCell.tracks()) {
278 if (maxQual <=
loose)
282 for (
auto it : thisCell.tracks()) {
293 for (
auto it : thisCell.tracks()) {
300 template <
typename TrackerTraits>
305 uint32_t
const *__restrict__
nCells,
315 if (0 == (firstCellIndex +
first)) {
320 constexpr uint32_t last_bpix1_detIndex = TrackerTraits::last_bpix1_detIndex;
321 constexpr uint32_t last_barrel_detIndex = TrackerTraits::last_barrel_detIndex;
323 auto cellIndex =
idx;
325 auto innerHitId = thisCell.inner_hit_id();
331 auto ri = thisCell.inner_r(
hh);
332 auto zi = thisCell.inner_z(
hh);
334 auto ro = thisCell.outer_r(
hh);
335 auto zo = thisCell.outer_z(
hh);
336 auto isBarrel = thisCell.inner_detIndex(
hh) < last_barrel_detIndex;
339 auto otherCell =
__ldg(vi +
j);
340 auto &oc =
cells[otherCell];
341 auto r1 = oc.inner_r(
hh);
342 auto z1 = oc.inner_z(
hh);
343 bool aligned = Cell::areAlignedRZ(
352 if (aligned && thisCell.dcaCut(
hh,
354 oc.inner_detIndex(
hh) < last_bpix1_detIndex ?
params.dcaCutInnerTriplet_
355 :
params.dcaCutOuterTriplet_,
365 template <
typename TrackerTraits>
366 __global__ void kernel_find_ntuplets(HitsConstView<TrackerTraits>
hh,
381 printf(
"starting producing ntuplets from %d cells \n", *
nCells);
386 if (thisCell.isKilled())
390 if (thisCell.outerNeighbors().empty())
393 auto pid = thisCell.layerPairId();
394 bool doit =
params.startingLayerPair(pid);
401 bool bpix1Start =
params.startAt0(pid);
403 thisCell.template find_ntuplets<maxDepth>(
hh,
410 params.minHitsPerNtuplet_,
417 template <
typename TrackerTraits>
423 if (!thisCell.tracks().empty())
428 template <
typename TrackerTraits>
439 if (
nhits > TrackerTraits::maxHitsOnTrack)
440 printf(
"wrong mult %d %d\n",
it,
nhits);
446 template <
typename TrackerTraits>
457 if (
nhits > TrackerTraits::maxHitsOnTrack)
458 printf(
"wrong mult %d %d\n",
it,
nhits);
465 template <
typename TrackerTraits>
486 for (
int i = 0;
i < 5; ++
i) {
508 template <
typename TrackerTraits>
523 template <
typename TrackerTraits>
534 template <
typename TrackerTraits>
545 template <
typename TrackerTraits>
561 template <
typename TrackerTraits>
575 template <
typename TrackerTraits>
576 __global__ void kernel_doStatsForHitInTracks(HitToTuple<TrackerTraits>
const *__restrict__
hitToTuple,
589 template <
typename TrackerTraits>
590 __global__ void kernel_countSharedHit(
int *__restrict__ nshared,
626 template <
typename TrackerTraits>
627 __global__ void kernel_markSharedHit(
int const *__restrict__ nshared,
645 if (nshared[
idx] > 2)
651 template <
typename TrackerTraits>
687 if ((cti - ctj) * (cti - ctj) > dct)
690 if ((opi - opj) * (opi - opj) > dop)
693 if (nlj < nli || (nlj == nli && (qj < qi || (qj == qi &&
score(
it, nli) <
score(jt, nlj)))))
704 template <
typename TrackerTraits>
705 __global__ void kernel_sharedHitCleaner(HitsConstView<TrackerTraits>
hh,
709 HitToTuple<TrackerTraits>
const *__restrict__
phitToTuple) {
746 if (idx < l1end and nl >
nmin)
755 template <
typename TrackerTraits>
759 HitToTuple<TrackerTraits>
const *__restrict__
phitToTuple) {
774 bool onlyTriplets =
true;
811 template <
typename TrackerTraits>
815 HitToTuple<TrackerTraits>
const *__restrict__
phitToTuple) {
854 template <
typename TrackerTraits>
855 __global__ void kernel_print_found_ntuplets(HitsConstView<TrackerTraits>
hh,
871 printf(
"TK: %d %d %d %d %f %f %f %f %f %f %f %.3f %.3f %.3f %.3f %.3f %.3f %.3f\n",
896 "||Counters | nEvents | nHits | nCells | nTuples | nFitTacks | nLooseTracks | nGoodTracks | nUsedHits | " 900 "nUsedCells | nZeroTrackCells ||\n");
901 printf(
"Counters Raw %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld\n",
916 "Counters Norm %lld || %.1f| %.1f| %.1f| %.1f| %.1f| %.1f| %.1f| %.1f| %.3f| %.3f| %.3f| %.3f||\n",
918 c.nHits /
double(
c.nEvents),
919 c.nCells /
double(
c.nEvents),
920 c.nTuples /
double(
c.nEvents),
921 c.nFitTracks /
double(
c.nEvents),
922 c.nLooseTracks /
double(
c.nEvents),
923 c.nGoodTracks /
double(
c.nEvents),
924 c.nUsedHits /
double(
c.nEvents),
925 c.nDupHits /
double(
c.nEvents),
926 c.nFishCells /
double(
c.nCells),
927 c.nKilledCells /
double(
c.nCells),
928 c.nEmptyCells /
double(
c.nCells),
929 c.nZeroTrackCells /
double(
c.nCells));
HitContainer< TrackerTraits > const *__restrict__ tuples
TupleMultiplicity< TrackerTraits > const HitToTuple< TrackerTraits > const cms::cuda::AtomicPairCounter GPUCACellT< TrackerTraits > const *__restrict__ uint32_t const *__restrict__ CellNeighborsVector< TrackerTraits > const CellTracksVector< TrackerTraits > const OuterHitOfCell< TrackerTraits > const isOuterHitOfCell
auto const good
min quality of good
HitContainer< TrackerTraits > const *__restrict__ Quality const *__restrict__ quality
TrackingRecHitSoAConstView< TrackerTraits > HitsConstView
TupleMultiplicity< TrackerTraits > const HitToTuple< TrackerTraits > const cms::cuda::AtomicPairCounter GPUCACellT< TrackerTraits > const *__restrict__ uint32_t const *__restrict__ CellNeighborsVector< TrackerTraits > const * cellNeighbors
TupleMultiplicity< TrackerTraits > const HitToTuple< TrackerTraits > const cms::cuda::AtomicPairCounter GPUCACellT< TrackerTraits > const *__restrict__ uint32_t const *__restrict__ CellNeighborsVector< TrackerTraits > const CellTracksVector< TrackerTraits > const * cellTracks
uint32_t const *__restrict__ TkSoAView< TrackerTraits > tracks_view
constexpr bool isNotFinite(T x)
caHitNtupletGenerator::Counters Counters
TkSoAView< TrackerTraits > HitToTuple< TrackerTraits > const *__restrict__ int32_t int32_t int iev
TupleMultiplicity< TrackerTraits > const HitToTuple< TrackerTraits > const cms::cuda::AtomicPairCounter GPUCACellT< TrackerTraits > const *__restrict__ cells
TupleMultiplicity< TrackerTraits > const * tupleMultiplicity
typename GPUCACellT< TrackerTraits >::HitsConstView HitsConstView
uint32_t const *__restrict__ TkSoAView< TrackerTraits > bool dupPassThrough
TupleMultiplicity< TrackerTraits > const HitToTuple< TrackerTraits > const cms::cuda::AtomicPairCounter GPUCACellT< TrackerTraits > const *__restrict__ uint32_t const *__restrict__ CellNeighborsVector< TrackerTraits > const CellTracksVector< TrackerTraits > const OuterHitOfCell< TrackerTraits > const int32_t uint32_t maxNumberOfDoublets
TkSoAView< TrackerTraits > GPUCACellT< TrackerTraits > *__restrict__ uint32_t const CellTracksVector< TrackerTraits > cms::cuda::AtomicPairCounter CAParams< TrackerTraits > params
constexpr uint32_t stride
HitsConstView< TrackerTraits > hh
TupleMultiplicity< TrackerTraits > const HitToTuple< TrackerTraits > const cms::cuda::AtomicPairCounter GPUCACellT< TrackerTraits > const *__restrict__ uint32_t const *__restrict__ CellNeighborsVector< TrackerTraits > const CellTracksVector< TrackerTraits > const OuterHitOfCell< TrackerTraits > const int32_t uint32_t Counters * counters
static constexpr __host__ __device__ int computeNumberOfLayers(const TrackSoAConstView &tracks, int32_t i)
TupleMultiplicity< TrackerTraits > const HitToTuple< TrackerTraits > const cms::cuda::AtomicPairCounter GPUCACellT< TrackerTraits > const *__restrict__ uint32_t const *__restrict__ CellNeighborsVector< TrackerTraits > const CellTracksVector< TrackerTraits > const OuterHitOfCell< TrackerTraits > const int32_t nHits
typename TrackSoA< TrackerTraits >::HitContainer HitContainer
TkSoAView< TrackerTraits > HitToTuple< TrackerTraits > const *__restrict__ int32_t firstPrint
__device__ __host__ Counters get() const
QualityCuts< TrackerTraits > cuts
Abs< T >::type abs(const T &t)
TupleMultiplicity< TrackerTraits > const HitToTuple< TrackerTraits > const * hitToTuple
TrackSoAView< TrackerTraits > TkSoAView
assert(nCells)
cannot be loose
TupleMultiplicity< TrackerTraits > const HitToTuple< TrackerTraits > const cms::cuda::AtomicPairCounter GPUCACellT< TrackerTraits > const *__restrict__ uint32_t const *__restrict__ nCells
static constexpr __host__ __device__ int nHits(const TrackSoAConstView &tracks, int i)
auto const & foundNtuplets
static constexpr __host__ __device__ bool isTriplet(const TrackSoAConstView &tracks, int i)
typename TrackSoA< TrackerTraits >::template TrackSoALayout<>::View TrackSoAView
TupleMultiplicity< TrackerTraits > const HitToTuple< TrackerTraits > const cms::cuda::AtomicPairCounter * apc
TkSoAView< TrackerTraits > HitToTuple< TrackerTraits > const *__restrict__ int32_t int32_t lastPrint
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
constexpr uint32_t tkNotFound
HitContainer< TrackerTraits > const *__restrict__ Quality const *__restrict__ HitToTuple< TrackerTraits > const *__restrict__ phitToTuple
T1 atomicAdd(T1 *a, T2 b)
HitContainer< TrackerTraits > const *__restrict__ ptuples