1 #ifndef RecoLocalTracker_SiPixelClusterizer_plugins_gpuClusterChargeCut_h
2 #define RecoLocalTracker_SiPixelClusterizer_plugins_gpuClusterChargeCut_h
15 namespace gpuClustering {
17 template <
bool isPhase2>
21 uint16_t* __restrict__
id,
22 uint16_t
const* __restrict__
adc,
25 uint32_t
const* __restrict__
moduleId,
36 assert(startBPIX2 < nMaxModules);
41 auto firstPixel = moduleStart[1 +
module];
42 auto thisModuleId =
id[firstPixel];
43 assert(thisModuleId < nMaxModules);
46 auto nclus = nClustersInModule[thisModuleId];
51 printf(
"Warning too many clusters in module %d in block %d: %d > %d\n",
64 if (
id[
i] != thisModuleId)
75 if (thisModuleId % 100 == 1)
77 printf(
"start cluster charge cut for module %d in block %d\n", thisModuleId,
blockIdx.x);
89 if (
id[
i] != thisModuleId)
99 newclusId[
i] = ok[
i] = charge[
i] >= chargeCut ? 1 : 0;
109 __shared__ uint16_t
ws[32];
110 cms::cuda::blockPrefixScan(newclusId, nclus, ws);
112 assert(nclus > newclusId[nclus - 1]);
114 nClustersInModule[thisModuleId] = newclusId[nclus - 1];
120 if (
id[
i] != thisModuleId)
122 if (0 == ok[clusterId[
i]])
125 clusterId[
i] = newclusId[clusterId[
i]] - 1;
135 #endif // RecoLocalTracker_SiPixelClusterizer_plugins_gpuClusterChargeCut_h
__shared__ uint8_t ok[maxNumClustersPerModules]
constexpr int nMaxModules
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ int32_t *__restrict__ clusterId
constexpr uint32_t layerStart[numberOfLayers+1]
float clusterChargeCut(const edm::ParameterSet &conf, const char *name="clusterChargeCut")
constexpr uint32_t numberOfModules
constexpr int32_t getThresholdForLayerOnCondition(bool isLayer1) const noexcept
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ nClustersInModule
assert(nMaxModules< maxNumModules)
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ moduleStart
constexpr int32_t maxNumClustersPerModules
constexpr uint16_t maxNumModules
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ int32_t *__restrict__ uint32_t numElements
constexpr uint16_t invalidModuleId
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ moduleId
constexpr uint32_t numberOfModules
auto const good
min quality of good
__shared__ uint16_t newclusId[maxNumClustersPerModules]
constexpr uint32_t layerStart[numberOfLayers+1]
bool __syncthreads_and(bool x)
T1 atomicAdd(T1 *a, T2 b)
uint16_t *__restrict__ uint16_t const *__restrict__ adc