12 #include <cuda_runtime.h> 34 template <
typename TrackerTraits>
37 template <
typename TrackerTraits>
40 template <
typename TrackerTraits>
43 template <
typename TrackerTraits>
46 template <
typename TrackerTraits>
51 template <
typename TrackerTraits>
54 template <
typename TrackerTraits>
57 template <
typename TrackerTraits>
60 template <
typename TrackerTraits>
63 template <
typename TrackerTraits>
68 template <
typename TrackerTraits>
74 uint32_t
const *__restrict__
nCells,
95 printf(
"number of found cells %d \n found tuples %d with total hits %d out of %d %d\n",
101 if (
apc->
get().m < TrackerTraits::maxNumberOfQuadruplets) {
108 if (
tracks_view.hitIndices().size(
idx) > TrackerTraits::maxHitsOnTrack)
117 if (
apc->
get().m >= TrackerTraits::maxNumberOfQuadruplets)
118 printf(
"Tuples overflow\n");
120 printf(
"Cells overflow\n");
124 printf(
"cellTracks overflow\n");
126 printf(
"ERROR hitToTuple overflow %d %d\n",
hitToTuple->nOnes(),
nHits);
128 printf(
"size of cellNeighbors %d \n cellTracks %d \n hitToTuple %d \n",
138 if (thisCell.hasFishbone() && !thisCell.isKilled())
140 if (thisCell.outerNeighbors().full())
141 printf(
"OuterNeighbors overflow %d in %d\n",
idx, thisCell.layerPairId());
142 if (thisCell.tracks().full())
143 printf(
"Tracks overflow %d in %d\n",
idx, thisCell.layerPairId());
144 if (thisCell.isKilled())
146 if (!thisCell.unused())
148 if ((0 ==
hitToTuple->size(thisCell.inner_hit_id())) && (0 ==
hitToTuple->size(thisCell.outer_hit_id())))
154 printf(
"OuterHitOfCell overflow %d\n",
idx);
158 template <
typename TrackerTraits>
160 uint32_t
const *__restrict__
nCells,
167 if (!thisCell.isKilled())
170 for (
auto it : thisCell.tracks())
177 template <
typename TrackerTraits>
179 uint32_t
const *__restrict__
nCells,
190 if (thisCell.tracks().size() < 2)
196 for (
auto it : thisCell.tracks()) {
205 for (
auto it : thisCell.tracks()) {
213 template <
typename TrackerTraits>
215 uint32_t
const *__restrict__
nCells,
227 if (thisCell.tracks().size() < 2)
237 int ntr = thisCell.tracks().size();
238 for (
int i = 0;
i < ntr - 1; ++
i) {
239 auto it = thisCell.tracks()[
i];
247 for (
auto j =
i + 1;
j < ntr; ++
j) {
248 auto jt = thisCell.tracks()[
j];
255 if ((cti - ctj) * (cti - ctj) > dct)
258 if ((opi - opj) * (opi - opj) > dop)
271 for (
auto it : thisCell.tracks()) {
276 if (maxQual <=
loose)
280 for (
auto it : thisCell.tracks()) {
291 for (
auto it : thisCell.tracks()) {
298 template <
typename TrackerTraits>
303 uint32_t
const *__restrict__
nCells,
313 if (0 == (firstCellIndex +
first)) {
318 constexpr uint32_t last_bpix1_detIndex = TrackerTraits::last_bpix1_detIndex;
319 constexpr uint32_t last_barrel_detIndex = TrackerTraits::last_barrel_detIndex;
321 auto cellIndex =
idx;
323 auto innerHitId = thisCell.inner_hit_id();
329 auto ri = thisCell.inner_r(
hh);
330 auto zi = thisCell.inner_z(
hh);
332 auto ro = thisCell.outer_r(
hh);
333 auto zo = thisCell.outer_z(
hh);
334 auto isBarrel = thisCell.inner_detIndex(
hh) < last_barrel_detIndex;
337 auto otherCell =
__ldg(vi +
j);
338 auto &oc =
cells[otherCell];
339 auto r1 = oc.inner_r(
hh);
340 auto z1 = oc.inner_z(
hh);
341 bool aligned = Cell::areAlignedRZ(
350 if (aligned && thisCell.dcaCut(
hh,
352 oc.inner_detIndex(
hh) < last_bpix1_detIndex ?
params.dcaCutInnerTriplet_
353 :
params.dcaCutOuterTriplet_,
363 template <
typename TrackerTraits>
364 __global__ void kernel_find_ntuplets(HitsConstView<TrackerTraits>
hh,
379 printf(
"starting producing ntuplets from %d cells \n", *
nCells);
384 if (thisCell.isKilled())
388 if (thisCell.outerNeighbors().empty())
391 auto pid = thisCell.layerPairId();
392 bool doit =
params.startingLayerPair(pid);
399 bool bpix1Start =
params.startAt0(pid);
401 thisCell.template find_ntuplets<maxDepth>(
hh,
408 params.minHitsPerNtuplet_,
415 template <
typename TrackerTraits>
421 if (!thisCell.tracks().empty())
426 template <
typename TrackerTraits>
437 if (
nhits > TrackerTraits::maxHitsOnTrack)
438 printf(
"wrong mult %d %d\n",
it,
nhits);
444 template <
typename TrackerTraits>
455 if (
nhits > TrackerTraits::maxHitsOnTrack)
456 printf(
"wrong mult %d %d\n",
it,
nhits);
463 template <
typename TrackerTraits>
484 for (
int i = 0;
i < 5; ++
i) {
506 template <
typename TrackerTraits>
521 template <
typename TrackerTraits>
532 template <
typename TrackerTraits>
543 template <
typename TrackerTraits>
559 template <
typename TrackerTraits>
573 template <
typename TrackerTraits>
574 __global__ void kernel_doStatsForHitInTracks(HitToTuple<TrackerTraits>
const *__restrict__
hitToTuple,
587 template <
typename TrackerTraits>
588 __global__ void kernel_countSharedHit(
int *__restrict__ nshared,
624 template <
typename TrackerTraits>
625 __global__ void kernel_markSharedHit(
int const *__restrict__ nshared,
643 if (nshared[
idx] > 2)
649 template <
typename TrackerTraits>
685 if ((cti - ctj) * (cti - ctj) > dct)
688 if ((opi - opj) * (opi - opj) > dop)
691 if (nlj < nli || (nlj == nli && (qj < qi || (qj == qi &&
score(
it, nli) <
score(jt, nlj)))))
702 template <
typename TrackerTraits>
703 __global__ void kernel_sharedHitCleaner(HitsConstView<TrackerTraits>
hh,
707 HitToTuple<TrackerTraits>
const *__restrict__
phitToTuple) {
744 if (idx < l1end and nl >
nmin)
753 template <
typename TrackerTraits>
757 HitToTuple<TrackerTraits>
const *__restrict__
phitToTuple) {
772 bool onlyTriplets =
true;
809 template <
typename TrackerTraits>
813 HitToTuple<TrackerTraits>
const *__restrict__
phitToTuple) {
852 template <
typename TrackerTraits>
853 __global__ void kernel_print_found_ntuplets(HitsConstView<TrackerTraits>
hh,
869 printf(
"TK: %d %d %d %d %f %f %f %f %f %f %f %.3f %.3f %.3f %.3f %.3f %.3f %.3f\n",
894 "||Counters | nEvents | nHits | nCells | nTuples | nFitTacks | nLooseTracks | nGoodTracks | nUsedHits | " 898 "nUsedCells | nZeroTrackCells ||\n");
899 printf(
"Counters Raw %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld\n",
914 "Counters Norm %lld || %.1f| %.1f| %.1f| %.1f| %.1f| %.1f| %.1f| %.1f| %.3f| %.3f| %.3f| %.3f||\n",
916 c.nHits /
double(
c.nEvents),
917 c.nCells /
double(
c.nEvents),
918 c.nTuples /
double(
c.nEvents),
919 c.nFitTracks /
double(
c.nEvents),
920 c.nLooseTracks /
double(
c.nEvents),
921 c.nGoodTracks /
double(
c.nEvents),
922 c.nUsedHits /
double(
c.nEvents),
923 c.nDupHits /
double(
c.nEvents),
924 c.nFishCells /
double(
c.nCells),
925 c.nKilledCells /
double(
c.nCells),
926 c.nEmptyCells /
double(
c.nCells),
927 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
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