1 #ifndef RecoPixelVertexing_PixelTriplets_alpaka_CAPixelDoubletsAlgos_h 2 #define RecoPixelVertexing_PixelTriplets_alpaka_CAPixelDoubletsAlgos_h 10 #include <alpaka/alpaka.hpp> 26 namespace caPixelDoublets {
29 template <
typename TrackerTraits>
31 template <
typename TrackerTraits>
33 template <
typename TrackerTraits>
35 template <
typename TrackerTraits>
37 template <
typename TrackerTraits>
39 template <
typename TrackerTraits>
42 template <
typename TrackerTraits>
45 using T = TrackerTraits;
55 const std::vector<int>& phiCutsV)
76 template <
typename TAcc>
77 ALPAKA_FN_ACC ALPAKA_FN_INLINE
bool __attribute__((always_inline))
79 const uint32_t mi =
hh[
i].detectorIndex();
81 bool innerB1 = mi < T::last_bpix1_detIndex;
82 bool isOuterLadder = idealConditions_ ?
true : 0 == (mi / 8) % 2;
83 auto mes = (!innerB1) || isOuterLadder ?
hh[
i].clusterSizeY() : -1;
88 const uint32_t mo =
hh[
o].detectorIndex();
89 auto so =
hh[
o].clusterSizeY();
92 auto dr =
hh[
i].rGlobal() -
hh[
o].rGlobal();
94 auto innerBarrel = mi < T::last_barrel_detIndex;
95 auto onlyBarrel = mo < T::last_barrel_detIndex;
97 if (not innerBarrel and not onlyBarrel)
99 auto dy = innerB1 ? T::maxDYsize12 : T::maxDYsize;
101 return onlyBarrel ? so > 0 &&
std::abs(so - mes) >
dy 102 : innerBarrel &&
std::abs(mes -
int(
std::abs(
dz / dr) * T::dzdrFact + 0.5
f)) > T::maxDYPred;
105 template <
typename TAcc>
106 ALPAKA_FN_ACC ALPAKA_FN_INLINE
bool __attribute__((always_inline))
108 const uint32_t mi =
hh[
i].detectorIndex();
109 bool innerB1orB2 = mi < T::last_bpix2_detIndex;
114 bool innerB1 = mi < T::last_bpix1_detIndex;
115 bool isOuterLadder = idealConditions_ ?
true : 0 == (mi / 8) % 2;
116 auto mes = (!innerB1) || isOuterLadder ?
hh[
i].clusterSizeY() : -1;
119 if (mes > 0 && mes < T::minYsizeB1)
121 bool innerB2 = (mi >= T::last_bpix1_detIndex) && (mi < T::last_bpix2_detIndex);
123 if (mes > 0 && mes < T::minYsizeB2)
130 template <
typename TrackerTraits,
typename TAcc>
131 ALPAKA_FN_ACC ALPAKA_FN_INLINE
void __attribute__((always_inline))
132 doubletsFromHisto(
const TAcc& acc,
157 uint32_t
const* __restrict__
offsets =
hh.hitsLayerStart().data();
166 auto&
ntot = alpaka::declareSharedVar<uint32_t, __COUNTER__>(acc);
180 alpaka::syncBlockThreads(acc);
184 const auto& [firstElementIdxNoStrideX, endElementIdxNoStrideX] =
191 const auto& [firstElementIdxNoStrideY, endElementIdxNoStrideY] =
214 auto hoff = PhiBinner::histOff(
outer);
231 auto mez =
hh[
i].zGlobal();
239 auto mep =
hh[
i].iphi();
240 auto mer =
hh[
i].rGlobal();
243 auto ptcut = [&](
int j, int16_t idphi) {
246 auto ro =
hh[
j].rGlobal();
248 return dphi * dphi * (r2t4 - ri * ro) > (ro - ri) * (ro - ri);
250 auto z0cutoff = [&](
int j) {
251 auto zo =
hh[
j].zGlobal();
252 auto ro =
hh[
j].rGlobal();
271 for (
auto kk = kl;
kk != khh; incr(
kk)) {
273 if (
kk != kl &&
kk != kh)
276 auto const* __restrict__
p =
phiBinner.begin(
kk + hoff);
278 auto const maxpIndex =
e -
p;
281 uint32_t firstElementIdxX = firstElementIdxNoStrideX;
282 uint32_t endElementIdxX = endElementIdxNoStrideX;
284 for (uint32_t pIndex = firstElementIdxX; pIndex < maxpIndex; ++pIndex) {
291 auto mo =
hh[oi].detectorIndex();
299 auto mop =
hh[oi].iphi();
327 if (tooMany > 0
or tot > 0)
328 printf(
"OuterHitOfCell for %d in layer %d/%d, %d,%d %d, %d %.3f %.3f %s\n",
338 tooMany > 0 ?
"FULL!!" :
"not full.");
344 #endif // RecoPixelVertexing_PixelTriplets_CAPixelDoubletsAlgos_h auto const &__restrict__ phiBinner
typename TrackingRecHitSoA< TrackerTraits >::PhiBinner PhiBinner
auto & innerLayerCumulativeSize
uint32_t const *__restrict__ offsets
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > uint32_t CellNeighborsVector< TrackerTraits > * cellNeighbors
T1 atomicSub(T1 *a, T2 b)
caStructures::CellNeighborsT< TrackerTraits > CellNeighbors
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > * cells
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > uint32_t CellNeighborsVector< TrackerTraits > CellTracksVector< TrackerTraits > HitsConstView< TrackerTraits > OuterHitOfCell< TrackerTraits > CellCutsT< TrackerTraits > const & cuts
CellCutsT(const bool doClusterCut, const bool doZ0Cut, const bool doPtCut, const bool idealConditions, const float z0Cut, const float ptCut, const std::vector< int > &phiCutsV)
ALPAKA_ASSERT_OFFLOAD(offsets)
HitsConstView< TrackerTraits > H
const uint32_t threadIdxLocalY(alpaka::getIdx< alpaka::Block, alpaka::Threads >(acc)[dimIndexY])
constexpr uint16_t last_barrel_layer
const auto &uint32_t pairLayerId
const uint32_t threadIdxLocalX(alpaka::getIdx< alpaka::Block, alpaka::Threads >(acc)[dimIndexX])
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::vector< Block > Blocks
Abs< T >::type abs(const T &t)
ALPAKA_FN_ACC ALPAKA_FN_INLINE void __attribute__((always_inline)) doubletsFromHisto(const TAcc &acc
constexpr uint32_t dimIndexX
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > uint32_t CellNeighborsVector< TrackerTraits > CellTracksVector< TrackerTraits > HitsConstView< TrackerTraits > hh
caStructures::CellTracksVectorT< TrackerTraits > CellTracksVector
const uint32_t gridDimensionY(alpaka::getWorkDiv< alpaka::Grid, alpaka::Elems >(acc)[dimIndexY])
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t nPairs
typename CACellT< TrackerTraits >::HitsConstView HitsConstView
caStructures::CellNeighborsVectorT< TrackerTraits > CellNeighborsVector
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t maxNumOfDoublets
const uint32_t blockDimensionX(alpaka::getWorkDiv< alpaka::Block, alpaka::Elems >(acc)[dimIndexX])
constexpr float short2phi(short x)
constexpr float minz[nPairs]
caStructures::OuterHitOfCellT< TrackerTraits > OuterHitOfCell
caStructures::CellTracksT< TrackerTraits > CellTracks
const auto &uint32_t firstElementIdxY
constexpr uint32_t dimIndexY
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > uint32_t * nCells
constexpr uint16_t maxNumModules
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > uint32_t CellNeighborsVector< TrackerTraits > CellTracksVector< TrackerTraits > * cellTracks
constexpr float maxz[nPairs]
TrackingRecHitSoAConstView< TrackerTraits > HitsConstView
T1 atomicAdd(T1 *a, T2 b)
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > uint32_t CellNeighborsVector< TrackerTraits > CellTracksVector< TrackerTraits > HitsConstView< TrackerTraits > OuterHitOfCell< TrackerTraits > isOuterHitOfCell
constexpr float maxr[nPairs]