12 #include <cuda_runtime.h> 35 template <
typename TrackerTraits>
38 template <
typename TrackerTraits>
41 template <
typename TrackerTraits>
44 template <
typename TrackerTraits>
47 template <
typename TrackerTraits>
52 template <
typename TrackerTraits>
55 template <
typename TrackerTraits>
58 template <
typename TrackerTraits>
61 template <
typename TrackerTraits>
64 template <
typename TrackerTraits>
69 template <
typename TrackerTraits>
75 uint32_t
const *__restrict__
nCells,
96 printf(
"number of found cells %d \n found tuples %d with total hits %d out of %d %d\n",
102 if (
apc->
get().m < TrackerTraits::maxNumberOfQuadruplets) {
109 if (
tracks_view.hitIndices().size(
idx) > TrackerTraits::maxHitsOnTrack)
111 assert(ftracks_view.hitIndices().size(
idx) <= TrackerTraits::maxHitsOnTrack);
118 if (
apc->
get().m >= TrackerTraits::maxNumberOfQuadruplets)
119 printf(
"Tuples overflow\n");
121 printf(
"Cells overflow\n");
125 printf(
"cellTracks overflow\n");
127 printf(
"ERROR hitToTuple overflow %d %d\n",
hitToTuple->nOnes(),
nHits);
129 printf(
"size of cellNeighbors %d \n cellTracks %d \n hitToTuple %d \n",
149 if (thisCell.hasFishbone() && !thisCell.isKilled())
151 if (thisCell.outerNeighbors().full())
152 printf(
"OuterNeighbors overflow %d in %d\n",
idx, thisCell.layerPairId());
153 if (thisCell.tracks().full())
154 printf(
"Tracks overflow %d in %d\n",
idx, thisCell.layerPairId());
155 if (thisCell.isKilled())
157 if (!thisCell.unused())
159 if ((0 ==
hitToTuple->size(thisCell.inner_hit_id())) && (0 ==
hitToTuple->size(thisCell.outer_hit_id())))
165 printf(
"OuterHitOfCell overflow %d\n",
idx);
169 template <
typename TrackerTraits>
171 uint32_t
const *__restrict__
nCells,
178 if (!thisCell.isKilled())
181 for (
auto it : thisCell.tracks())
188 template <
typename TrackerTraits>
190 uint32_t
const *__restrict__
nCells,
201 if (thisCell.tracks().size() < 2)
207 for (
auto it : thisCell.tracks()) {
216 for (
auto it : thisCell.tracks()) {
224 template <
typename TrackerTraits>
226 uint32_t
const *__restrict__
nCells,
238 if (thisCell.tracks().size() < 2)
248 int ntr = thisCell.tracks().size();
249 for (
int i = 0;
i < ntr - 1; ++
i) {
250 auto it = thisCell.tracks()[
i];
258 for (
auto j =
i + 1;
j < ntr; ++
j) {
259 auto jt = thisCell.tracks()[
j];
266 if ((cti - ctj) * (cti - ctj) > dct)
269 if ((opi - opj) * (opi - opj) > dop)
271 if ((qj < qi) || (qj == qi &&
score(it) <
score(jt)))
282 for (
auto it : thisCell.tracks()) {
287 if (maxQual <=
loose)
291 for (
auto it : thisCell.tracks()) {
302 for (
auto it : thisCell.tracks()) {
309 template <
typename TrackerTraits>
314 uint32_t
const *__restrict__
nCells,
324 if (0 == (firstCellIndex +
first)) {
329 constexpr uint32_t last_bpix1_detIndex = TrackerTraits::last_bpix1_detIndex;
330 constexpr uint32_t last_barrel_detIndex = TrackerTraits::last_barrel_detIndex;
332 auto cellIndex =
idx;
334 auto innerHitId = thisCell.inner_hit_id();
340 auto ri = thisCell.inner_r(
hh);
341 auto zi = thisCell.inner_z(
hh);
343 auto ro = thisCell.outer_r(
hh);
344 auto zo = thisCell.outer_z(
hh);
345 auto isBarrel = thisCell.inner_detIndex(
hh) < last_barrel_detIndex;
348 auto otherCell =
__ldg(vi +
j);
349 auto &oc =
cells[otherCell];
350 auto r1 = oc.inner_r(
hh);
351 auto z1 = oc.inner_z(
hh);
352 bool aligned = Cell::areAlignedRZ(
361 if (aligned && thisCell.dcaCut(
hh,
363 oc.inner_detIndex(
hh) < last_bpix1_detIndex ?
params.dcaCutInnerTriplet_
364 :
params.dcaCutOuterTriplet_,
374 template <
typename TrackerTraits>
375 __global__ void kernel_find_ntuplets(HitsConstView<TrackerTraits>
hh,
390 printf(
"starting producing ntuplets from %d cells \n", *
nCells);
395 if (thisCell.isKilled())
399 if (thisCell.outerNeighbors().empty())
402 auto pid = thisCell.layerPairId();
403 bool doit =
params.startingLayerPair(pid);
410 bool bpix1Start =
params.startAt0(pid);
412 thisCell.template find_ntuplets<maxDepth>(
hh,
419 params.minHitsPerNtuplet_,
426 template <
typename TrackerTraits>
432 if (!thisCell.tracks().empty())
437 template <
typename TrackerTraits>
448 if (
nhits > TrackerTraits::maxHitsOnTrack)
449 printf(
"wrong mult %d %d\n", it,
nhits);
455 template <
typename TrackerTraits>
466 if (
nhits > TrackerTraits::maxHitsOnTrack)
467 printf(
"wrong mult %d %d\n", it,
nhits);
474 template <
typename TrackerTraits>
495 for (
int i = 0;
i < 5; ++
i) {
517 template <
typename TrackerTraits>
532 template <
typename TrackerTraits>
543 template <
typename TrackerTraits>
554 template <
typename TrackerTraits>
570 template <
typename TrackerTraits>
584 template <
typename TrackerTraits>
585 __global__ void kernel_doStatsForHitInTracks(HitToTuple<TrackerTraits>
const *__restrict__
hitToTuple,
598 template <
typename TrackerTraits>
599 __global__ void kernel_countSharedHit(
int *__restrict__ nshared,
635 template <
typename TrackerTraits>
636 __global__ void kernel_markSharedHit(
int const *__restrict__ nshared,
654 if (nshared[
idx] > 2)
660 template <
typename TrackerTraits>
696 if ((cti - ctj) * (cti - ctj) > dct)
699 if ((opi - opj) * (opi - opj) > dop)
702 if (nlj < nli || (nlj == nli && (qj < qi || (qj == qi &&
score(it, nli) <
score(jt, nlj)))))
713 template <
typename TrackerTraits>
714 __global__ void kernel_sharedHitCleaner(HitsConstView<TrackerTraits>
hh,
718 HitToTuple<TrackerTraits>
const *__restrict__
phitToTuple) {
755 if (idx < l1end and nl >
nmin)
764 template <
typename TrackerTraits>
768 HitToTuple<TrackerTraits>
const *__restrict__
phitToTuple) {
783 bool onlyTriplets =
true;
820 template <
typename TrackerTraits>
824 HitToTuple<TrackerTraits>
const *__restrict__
phitToTuple) {
863 template <
typename TrackerTraits>
864 __global__ void kernel_print_found_ntuplets(HitsConstView<TrackerTraits>
hh,
880 printf(
"TK: %d %d %d %d %f %f %f %f %f %f %f %.3f %.3f %.3f %.3f %.3f %.3f %.3f\n",
905 "||Counters | nEvents | nHits | nCells | nTuples | nFitTacks | nLooseTracks | nGoodTracks | nUsedHits | " 909 "nUsedCells | nZeroTrackCells ||\n");
910 printf(
"Counters Raw %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld\n",
925 "Counters Norm %lld || %.1f| %.1f| %.1f| %.1f| %.1f| %.1f| %.1f| %.1f| %.3f| %.3f| %.3f| %.3f||\n",
927 c.nHits /
double(
c.nEvents),
928 c.nCells /
double(
c.nEvents),
929 c.nTuples /
double(
c.nEvents),
930 c.nFitTracks /
double(
c.nEvents),
931 c.nLooseTracks /
double(
c.nEvents),
932 c.nGoodTracks /
double(
c.nEvents),
933 c.nUsedHits /
double(
c.nEvents),
934 c.nDupHits /
double(
c.nEvents),
935 c.nFishCells /
double(
c.nCells),
936 c.nKilledCells /
double(
c.nCells),
937 c.nEmptyCells /
double(
c.nCells),
938 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
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
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