1 #ifndef RecoPixelVertexing_PixelTriplets_plugins_GPUCACell_h 2 #define RecoPixelVertexing_PixelTriplets_plugins_GPUCACell_h 10 #include <cuda_runtime.h> 71 if (outerNeighbors().
empty()) {
88 return outerNeighbors().push_back(
t);
135 printf(
"printing cell: on layerPair: %d, innerHitId: %d, outerHitId: %d \n",
145 const float caThetaCutBarrel,
146 const float caThetaCutForward,
152 auto ri = inner_r(
hh);
153 auto zi = inner_z(
hh);
155 auto ro = outer_r(
hh);
156 auto zo = outer_z(
hh);
158 auto r1 = otherCell.inner_r(
hh);
159 auto z1 = otherCell.inner_z(
hh);
161 bool aligned = areAlignedRZ(
r1,
168 isBarrel ? caThetaCutBarrel : caThetaCutForward);
190 const float region_origin_radius_plus_tolerance,
191 const float maxCurv)
const {
192 auto x1 = otherCell.inner_x(
hh);
193 auto y1 = otherCell.inner_y(
hh);
195 auto x2 = inner_x(
hh);
196 auto y2 = inner_y(
hh);
198 auto x3 = outer_x(
hh);
199 auto y3 = outer_y(
hh);
203 if (eq.curvature() > maxCurv)
206 return std::abs(eq.dca0()) < region_origin_radius_plus_tolerance *
std::abs(eq.curvature());
215 const float region_origin_radius_plus_tolerance,
216 const float maxCurv) {
219 if (eq.curvature() > maxCurv)
222 return std::abs(eq.dca0()) < region_origin_radius_plus_tolerance *
std::abs(eq.curvature());
230 int p = innerCell.inner_iphi(
hh);
236 auto r0 =
hh.averageGeometry().ladderR[il];
237 auto ri = innerCell.inner_r(
hh);
238 auto zi = innerCell.inner_z(
hh);
239 auto ro = outer_r(
hh);
240 auto zo = outer_z(
hh);
242 auto z_in_ladder =
std::abs(
z0 -
hh.averageGeometry().ladderZ[il]);
253 int p = outer_iphi(
hh);
259 auto r4 =
hh.averageGeometry().ladderR[il];
260 auto ri = innerCell.inner_r(
hh);
261 auto zi = innerCell.inner_z(
hh);
262 auto ro = outer_r(
hh);
263 auto zo = outer_z(
hh);
265 auto z_in_ladder =
std::abs(z4 -
hh.averageGeometry().ladderZ[il]);
268 auto holeP = z4 >
hh.averageGeometry().ladderMaxZ[il] && z4 <
hh.averageGeometry().endCapZ[0];
269 auto holeN = z4 <
hh.averageGeometry().ladderMinZ[il] && z4 >
hh.averageGeometry().endCapZ[1];
270 return gap || holeP || holeN;
284 bool startAt0)
const {
291 auto doubletId =
this -
cells;
292 tmpNtuplet.push_back_unsafe(doubletId);
293 assert(tmpNtuplet.size() <= 4);
296 for (
unsigned int otherCell : outerNeighbors()) {
297 if (
cells[otherCell].isKilled())
300 cells[otherCell].find_ntuplets<DEPTH - 1>(
305 #ifdef ONLY_TRIPLETS_IN_HOLE 307 if (tmpNtuplet.size() >= 3 || (startAt0 && hole4(
hh,
cells[tmpNtuplet[0]])) ||
308 ((!startAt0) && hole0(
hh,
cells[tmpNtuplet[0]])))
313 constexpr
int maxFB = 2;
315 for (
auto c : tmpNtuplet) {
317 if (nfb < maxFB &&
cells[
c].hasFishbone()) {
326 for (
auto c : tmpNtuplet)
333 tmpNtuplet.pop_back();
334 assert(tmpNtuplet.size() < 4);
374 __device__ inline void GPUCACell::find_ntuplets<0>(Hits
const&
hh,
380 TmpTuple& tmpNtuplet,
382 bool startAt0)
const {
383 printf(
"ERROR: GPUCACell::find_ntuplets reached full depth!\n");
391 #endif // RecoPixelVertexing_PixelTriplets_plugins_GPUCACell_h
unsigned long long PtrAsInt
constexpr int32_t maxHitsOnTrack
cms::cuda::VecArray< tindex_type, maxCellTracks > CellTracks
TrackingRecHit2DSOAView Hits
cms::cuda::VecArray< uint32_t, 6 > TmpTuple
constexpr uint32_t first_ladder_bpx4
float tan_12_13_half_mul_distance_13_squared
cms::cuda::SimpleVector< CellNeighbors > CellNeighborsVector
T1 atomicCAS(T1 *address, T1 compare, T2 val)
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const * cellNeighbors
__device__ float float float float ro
__device__ float float float float float const float const float thetaCut
Hits::hindex_type hindex_type
__device__ float float float float float zo
cms::cuda::VecArray< uint32_t, maxCellsPerHit > OuterHitOfCellContainer
constexpr uint32_t max_ladder_bpx4
__device__ float float float zi
float distance_13_squared
cms::cuda::SimpleVector< CellTracks > CellTracksVector
constexpr float module_length_bpx4
__device__ int extend(int size=1)
constexpr uint32_t max_ladder_bpx0
__device__ CellTracksVector Hits const int hindex_type innerHitId
Abs< T >::type abs(const T &t)
static constexpr auto bad
TrackSoA::HitContainer HitContainer
__device__ float float float float float const float ptmin
__device__ CellTracksVector Hits const int hindex_type hindex_type outerHitId
assert(outerNeighbors().empty())
constexpr float module_length_bpx0
caConstants::CellNeighbors CellNeighbors
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ cells
constexpr uint32_t first_ladder_bpx0
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter * apc
auto const & tracks
cannot be loose
caConstants::CellTracks CellTracks
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const * cellTracks
static constexpr auto invalidHitId
static constexpr auto maxCellsPerHit
caConstants::CellTracksVector CellTracksVector
constexpr unsigned int inner_hit_id() const
__device__ CellTracksVector & cellTracks
constexpr float module_tolerance_bpx0
constexpr uint32_t maxCellsPerHit
caConstants::CellNeighborsVector CellNeighborsVector
__device__ CellTracksVector Hits const & hh
constexpr uint32_t last_bpix1_detIndex
constexpr uint32_t last_barrel_detIndex
__device__ CellTracksVector Hits const int layerPairId
auto const & foundNtuplets
__device__ void print_cell() const
constexpr float module_tolerance_bpx4
__device__ float float ri
__device__ bool check_alignment(Hits const &hh, GPUCACell const &otherCell, const float ptmin, const float hardCurvCut, const float caThetaCutBarrel, const float caThetaCutForward, const float dcaCutInnerTriplet, const float dcaCutOuterTriplet) const
constexpr unsigned int outer_hit_id() const
cms::cuda::VecArray< uint32_t, maxCellNeighbors > CellNeighbors