1 #include <cuda_runtime.h> 3 #include <fmt/printf.h> 74 auto const& inputData = ctx.get(inputDataWrapped);
76 nHits_ = inputData.nHits();
78 LogDebug(
"SiPixelRecHitFromCUDA") <<
"converting " <<
nHits_ <<
" Hits";
82 store32_ = inputData.localCoordToHostAsync(ctx.stream());
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;
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)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
#define DEFINE_FWK_MODULE(type)
~SiPixelRecHitFromCUDA() override=default
constexpr uint32_t maxHitsInModule()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static std::string const input
cms::cuda::host::unique_ptr< float[]> store32_
SiPixelRecHitFromCUDA(const edm::ParameterSet &iConfig)
bool getData(T &iHolder) const
void acquire(edm::Event const &iEvent, edm::EventSetup const &iSetup, edm::WaitingTaskWithArenaHolder waitingTaskHolder) override
void produce(edm::Event &iEvent, edm::EventSetup const &iSetup) override
Namespace of DDCMS conversion namespace.
const edm::EDGetTokenT< cms::cuda::Product< TrackingRecHit2DGPU > > hitsToken_
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_
void emplace_back(Args &&... args)
std::unique_ptr< T, impl::HostDeleter > unique_ptr
const edm::EDPutTokenT< HMSstorage > hostPutToken_
Log< level::Warning, false > LogWarning
const edm::EDPutTokenT< SiPixelRecHitCollection > rechitsPutToken_