1 #ifndef RecoTracker_PixelSeeding_plugins_GPUCACell_h 2 #define RecoTracker_PixelSeeding_plugins_GPUCACell_h 10 #include <cuda_runtime.h> 21 template <
typename TrackerTraits>
75 if (outerNeighbors().
empty()) {
92 return outerNeighbors().push_back(
t);
133 return hh[theInnerHitId].detectorIndex();
143 printf(
"printing cell: on layerPair: %d, innerHitId: %d, outerHitId: %d \n",
153 const float caThetaCutBarrel,
154 const float caThetaCutForward,
160 auto ri = inner_r(
hh);
161 auto zi = inner_z(
hh);
163 auto ro = outer_r(
hh);
164 auto zo = outer_z(
hh);
166 auto r1 = otherCell.inner_r(
hh);
167 auto z1 = otherCell.inner_z(
hh);
168 auto isBarrel = otherCell.outer_detIndex(
hh) < TrackerTraits::last_barrel_detIndex;
169 bool aligned = areAlignedRZ(
r1,
176 isBarrel ? caThetaCutBarrel : caThetaCutForward);
198 const float region_origin_radius_plus_tolerance,
199 const float maxCurv)
const {
200 auto x1 = otherCell.inner_x(
hh);
201 auto y1 = otherCell.inner_y(
hh);
203 auto x2 = inner_x(
hh);
204 auto y2 = inner_y(
hh);
206 auto x3 = outer_x(
hh);
207 auto y3 = outer_y(
hh);
211 if (eq.curvature() > maxCurv)
214 return std::abs(eq.dca0()) < region_origin_radius_plus_tolerance *
std::abs(eq.curvature());
223 const float region_origin_radius_plus_tolerance,
224 const float maxCurv) {
227 if (eq.curvature() > maxCurv)
230 return std::abs(eq.dca0()) < region_origin_radius_plus_tolerance *
std::abs(eq.curvature());
236 int p = innerCell.inner_iphi(
hh);
242 auto r0 =
hh.averageGeometry().ladderR[il];
243 auto ri = innerCell.inner_r(
hh);
244 auto zi = innerCell.inner_z(
hh);
245 auto ro = outer_r(
hh);
246 auto zo = outer_z(
hh);
248 auto z_in_ladder =
std::abs(
z0 -
hh.averageGeometry().ladderZ[il]);
257 int p = outer_iphi(
hh);
263 auto r4 =
hh.averageGeometry().ladderR[il];
264 auto ri = innerCell.inner_r(
hh);
265 auto zi = innerCell.inner_z(
hh);
266 auto ro = outer_r(
hh);
267 auto zo = outer_z(
hh);
269 auto z_in_ladder =
std::abs(z4 -
hh.averageGeometry().ladderZ[il]);
272 auto holeP = z4 >
hh.averageGeometry().ladderMaxZ[il] && z4 <
hh.averageGeometry().endCapZ[0];
273 auto holeN = z4 <
hh.averageGeometry().ladderMinZ[il] && z4 >
hh.averageGeometry().endCapZ[1];
274 return gap || holeP || holeN;
289 bool startAt0)
const {
296 if constexpr (DEPTH <= 0) {
297 printf(
"ERROR: GPUCACellT::find_ntuplets reached full depth!\n");
304 auto doubletId =
this -
cells;
305 tmpNtuplet.push_back_unsafe(doubletId);
306 assert(tmpNtuplet.size() <=
307 int(TrackerTraits::maxHitsOnTrack -
311 for (
unsigned int otherCell : outerNeighbors()) {
312 if (
cells[otherCell].isKilled())
315 cells[otherCell].template find_ntuplets<DEPTH - 1>(
321 #ifdef ONLY_TRIPLETS_IN_HOLE 323 if (tmpNtuplet.size() >= 3 || (startAt0 && hole4(
hh,
cells[tmpNtuplet[0]])) ||
324 ((!startAt0) && hole0(
hh,
cells[tmpNtuplet[0]])))
329 constexpr
int maxFB = 2;
331 for (
auto c : tmpNtuplet) {
333 if (nfb < maxFB &&
cells[
c].hasFishbone()) {
338 assert(
nh < TrackerTraits::maxHitsOnTrack);
342 for (
auto c : tmpNtuplet)
349 tmpNtuplet.pop_back();
350 assert(tmpNtuplet.size() <
int(TrackerTraits::maxHitsOnTrack - 1));
390 #endif // RecoTracker_PixelSeeding_plugins_GPUCACell_h
typename TrackSoA< TrackerTraits >::HitContainer HitContainer
caStructures::CellTracksVectorT< TrackerTraits > CellTracksVector
__device__ float float ri
__device__ CellTracksVector const HitsConstView int layerPairId
TrackingRecHitSoAConstView< TrackerTraits > HitsConstView
static constexpr auto maxCellsPerHit
T1 atomicCAS(T1 *address, T1 compare, T2 val)
TupleMultiplicity< TrackerTraits > const HitToTuple< TrackerTraits > const cms::cuda::AtomicPairCounter GPUCACellT< TrackerTraits > const *__restrict__ uint32_t const *__restrict__ CellNeighborsVector< TrackerTraits > const * cellNeighbors
constexpr float module_length_bpx0
__device__ bool check_alignment(const HitsConstView &hh, GPUCACellT const &otherCell, const float ptmin, const float hardCurvCut, const float caThetaCutBarrel, const float caThetaCutForward, const float dcaCutInnerTriplet, const float dcaCutOuterTriplet) const
__device__ float float float float float const float const float thetaCut
pixelTrack::Quality Quality
__device__ float float float float float zo
cms::cuda::VecArray< uint32_t, TrackerTraits::maxDepth > TmpTuple
constexpr float module_length_bpx4
__device__ void print_cell() const
typename TrackerTraits::hindex_type hindex_type
typename TrackerTraits::tindex_type tindex_type
constexpr uint32_t first_ladder_bpx4
constexpr float module_tolerance_bpx0
assert(outerNeighbors().empty())
caStructures::CellTracksT< TrackerTraits > CellTracks
__device__ float float float zi
float distance_13_squared
__device__ CellTracksVector const HitsConstView & hh
__device__ int extend(int size=1)
constexpr uint32_t max_ladder_bpx4
Abs< T >::type abs(const T &t)
caStructures::CellNeighborsT< TrackerTraits > CellNeighbors
constexpr unsigned int outer_hit_id() const
__device__ float float float float float const float ptmin
constexpr unsigned int inner_hit_id() const
constexpr uint32_t max_ladder_bpx0
caStructures::CellNeighborsVectorT< TrackerTraits > CellNeighborsVector
__device__ CellTracksVector const HitsConstView int hindex_type innerHitId
typename TrackingRecHitSoA< TrackerTraits >::template TrackingRecHitSoALayout<>::ConstView TrackingRecHitSoAConstView
return tracks().push_back(t)
auto const & foundNtuplets
__device__ CellTracksVector const HitsConstView int hindex_type hindex_type outerHitId
static constexpr auto invalidHitId
float tan_12_13_half_mul_distance_13_squared
static constexpr auto bad
TupleMultiplicity< TrackerTraits > const HitToTuple< TrackerTraits > const cms::cuda::AtomicPairCounter * apc
constexpr float module_tolerance_bpx4
unsigned long long PtrAsInt
constexpr uint32_t first_ladder_bpx0
__device__ float float float float ro
__device__ CellTracksVector & cellTracks