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)
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",
139 if (thisCell.hasFishbone() && !thisCell.isKilled())
141 if (thisCell.outerNeighbors().full())
142 printf(
"OuterNeighbors overflow %d in %d\n",
idx, thisCell.layerPairId());
143 if (thisCell.tracks().full())
144 printf(
"Tracks overflow %d in %d\n",
idx, thisCell.layerPairId());
145 if (thisCell.isKilled())
147 if (!thisCell.unused())
149 if ((0 ==
hitToTuple->size(thisCell.inner_hit_id())) && (0 ==
hitToTuple->size(thisCell.outer_hit_id())))
155 printf(
"OuterHitOfCell overflow %d\n",
idx);
159 template <
typename TrackerTraits>
161 uint32_t
const *__restrict__
nCells,
168 if (!thisCell.isKilled())
171 for (
auto it : thisCell.tracks())
178 template <
typename TrackerTraits>
180 uint32_t
const *__restrict__
nCells,
191 if (thisCell.tracks().size() < 2)
197 for (
auto it : thisCell.tracks()) {
206 for (
auto it : thisCell.tracks()) {
214 template <
typename TrackerTraits>
216 uint32_t
const *__restrict__
nCells,
228 if (thisCell.tracks().size() < 2)
238 int ntr = thisCell.tracks().size();
239 for (
int i = 0;
i < ntr - 1; ++
i) {
240 auto it = thisCell.tracks()[
i];
248 for (
auto j =
i + 1;
j < ntr; ++
j) {
249 auto jt = thisCell.tracks()[
j];
256 if ((cti - ctj) * (cti - ctj) > dct)
259 if ((opi - opj) * (opi - opj) > dop)
261 if ((qj < qi) || (qj == qi &&
score(it) <
score(jt)))
272 for (
auto it : thisCell.tracks()) {
277 if (maxQual <=
loose)
281 for (
auto it : thisCell.tracks()) {
292 for (
auto it : thisCell.tracks()) {
299 template <
typename TrackerTraits>
304 uint32_t
const *__restrict__
nCells,
314 if (0 == (firstCellIndex +
first)) {
319 constexpr uint32_t last_bpix1_detIndex = TrackerTraits::last_bpix1_detIndex;
320 constexpr uint32_t last_barrel_detIndex = TrackerTraits::last_barrel_detIndex;
322 auto cellIndex =
idx;
324 auto innerHitId = thisCell.inner_hit_id();
330 auto ri = thisCell.inner_r(
hh);
331 auto zi = thisCell.inner_z(
hh);
333 auto ro = thisCell.outer_r(
hh);
334 auto zo = thisCell.outer_z(
hh);
335 auto isBarrel = thisCell.inner_detIndex(
hh) < last_barrel_detIndex;
338 auto otherCell =
__ldg(vi +
j);
339 auto &oc =
cells[otherCell];
340 auto r1 = oc.inner_r(
hh);
341 auto z1 = oc.inner_z(
hh);
342 bool aligned = Cell::areAlignedRZ(
351 if (aligned && thisCell.dcaCut(
hh,
353 oc.inner_detIndex(
hh) < last_bpix1_detIndex ?
params.dcaCutInnerTriplet_
354 :
params.dcaCutOuterTriplet_,
364 template <
typename TrackerTraits>
365 __global__ void kernel_find_ntuplets(HitsConstView<TrackerTraits>
hh,
380 printf(
"starting producing ntuplets from %d cells \n", *
nCells);
385 if (thisCell.isKilled())
389 if (thisCell.outerNeighbors().empty())
392 auto pid = thisCell.layerPairId();
393 bool doit =
params.startingLayerPair(pid);
400 bool bpix1Start =
params.startAt0(pid);
402 thisCell.template find_ntuplets<maxDepth>(
hh,
409 params.minHitsPerNtuplet_,
416 template <
typename TrackerTraits>
422 if (!thisCell.tracks().empty())
427 template <
typename TrackerTraits>
438 if (
nhits > TrackerTraits::maxHitsOnTrack)
439 printf(
"wrong mult %d %d\n", it,
nhits);
445 template <
typename TrackerTraits>
456 if (
nhits > TrackerTraits::maxHitsOnTrack)
457 printf(
"wrong mult %d %d\n", it,
nhits);
464 template <
typename TrackerTraits>
485 for (
int i = 0;
i < 5; ++
i) {
507 template <
typename TrackerTraits>
522 template <
typename TrackerTraits>
533 template <
typename TrackerTraits>
544 template <
typename TrackerTraits>
560 template <
typename TrackerTraits>
574 template <
typename TrackerTraits>
575 __global__ void kernel_doStatsForHitInTracks(HitToTuple<TrackerTraits>
const *__restrict__
hitToTuple,
588 template <
typename TrackerTraits>
589 __global__ void kernel_countSharedHit(
int *__restrict__ nshared,
625 template <
typename TrackerTraits>
626 __global__ void kernel_markSharedHit(
int const *__restrict__ nshared,
644 if (nshared[
idx] > 2)
650 template <
typename TrackerTraits>
686 if ((cti - ctj) * (cti - ctj) > dct)
689 if ((opi - opj) * (opi - opj) > dop)
692 if (nlj < nli || (nlj == nli && (qj < qi || (qj == qi &&
score(it, nli) <
score(jt, nlj)))))
703 template <
typename TrackerTraits>
704 __global__ void kernel_sharedHitCleaner(HitsConstView<TrackerTraits>
hh,
708 HitToTuple<TrackerTraits>
const *__restrict__
phitToTuple) {
745 if (idx < l1end and nl >
nmin)
754 template <
typename TrackerTraits>
758 HitToTuple<TrackerTraits>
const *__restrict__
phitToTuple) {
773 bool onlyTriplets =
true;
810 template <
typename TrackerTraits>
814 HitToTuple<TrackerTraits>
const *__restrict__
phitToTuple) {
853 template <
typename TrackerTraits>
854 __global__ void kernel_print_found_ntuplets(HitsConstView<TrackerTraits>
hh,
870 printf(
"TK: %d %d %d %d %f %f %f %f %f %f %f %.3f %.3f %.3f %.3f %.3f %.3f %.3f\n",
895 "||Counters | nEvents | nHits | nCells | nTuples | nFitTacks | nLooseTracks | nGoodTracks | nUsedHits | " 899 "nUsedCells | nZeroTrackCells ||\n");
900 printf(
"Counters Raw %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld\n",
915 "Counters Norm %lld || %.1f| %.1f| %.1f| %.1f| %.1f| %.1f| %.1f| %.1f| %.3f| %.3f| %.3f| %.3f||\n",
917 c.nHits /
double(
c.nEvents),
918 c.nCells /
double(
c.nEvents),
919 c.nTuples /
double(
c.nEvents),
920 c.nFitTracks /
double(
c.nEvents),
921 c.nLooseTracks /
double(
c.nEvents),
922 c.nGoodTracks /
double(
c.nEvents),
923 c.nUsedHits /
double(
c.nEvents),
924 c.nDupHits /
double(
c.nEvents),
925 c.nFishCells /
double(
c.nCells),
926 c.nKilledCells /
double(
c.nCells),
927 c.nEmptyCells /
double(
c.nCells),
928 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