88 auto hmsp = std::make_unique<uint32_t[]>(
nMaxModules_ + 1);
112 auto const&
input = *hclusters;
116 int numberOfDetUnits = 0;
117 int numberOfClusters = 0;
118 for (
auto const& dsv :
input) {
120 unsigned int detid = dsv.detId();
121 DetId detIdObject(detid);
123 auto gind = genericDet->
index();
129 auto nhits = lc - fc;
132 LogDebug(
"SiPixelRecHitFromCUDA") <<
"in det " << gind <<
": conv " <<
nhits <<
" hits from " << dsv.size()
133 <<
" legacy clusters" <<
' ' << fc <<
',' << lc;
134 if (
nhits > maxHitsInModule)
136 "Too many clusters %d in module %d. Only the first %d hits will be converted",
nhits, gind, maxHitsInModule);
139 LogDebug(
"SiPixelRecHitFromCUDA") <<
"in det " << gind <<
"conv " <<
nhits <<
" hits from " << dsv.size()
140 <<
" legacy clusters" <<
' ' << lc <<
',' << fc;
144 auto jnd = [&](
int k) {
return fc +
k; };
146 if (
nhits != dsv.size()) {
149 for (
auto const& clust : dsv) {
150 assert(clust.originalId() >= 0);
151 assert(clust.originalId() < dsv.size());
152 if (clust.originalId() >=
nhits)
154 auto ij = jnd(clust.originalId());
171 recHitsOnDetUnit.emplace_back(lp, le, rqw, *genericDet, cluster);
174 LogDebug(
"SiPixelRecHitFromCUDA") <<
"cluster " << numberOfClusters <<
" at " << lp <<
' ' << le;
179 LogDebug(
"SiPixelRecHitFromCUDA") <<
"found " << recHitsOnDetUnit.size() <<
" RecHits on " << detid;
183 LogDebug(
"SiPixelRecHitFromCUDA") <<
"found " << numberOfDetUnits <<
" dets, " << numberOfClusters <<
" clusters";
const edm::EDGetTokenT< SiPixelClusterCollectionNew > clusterToken_
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
constexpr uint32_t maxHitsInModule()
static std::string const input
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
cms::cuda::host::unique_ptr< float[]> store32_
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
cms::cuda::host::unique_ptr< uint32_t[]> hitsModuleStart_
Pixel cluster – collection of neighboring pixels above threshold.
unsigned int QualWordType
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
const edm::EDPutTokenT< HMSstorage > hostPutToken_
Log< level::Warning, false > LogWarning
const edm::EDPutTokenT< SiPixelRecHitCollection > rechitsPutToken_