|
|
Go to the documentation of this file. 1 #include <cuda_runtime.h>
3 #include <fmt/printf.h>
73 auto const& inputData = ctx.get(inputDataWrapped);
75 nHits_ = inputData.nHits();
77 LogDebug(
"SiPixelRecHitFromCUDA") <<
"converting " <<
nHits_ <<
" Hits";
81 store32_ = inputData.localCoordToHostAsync(ctx.stream());
106 auto const&
input = *hclusters;
110 int numberOfDetUnits = 0;
111 int numberOfClusters = 0;
112 for (
auto const& dsv :
input) {
114 unsigned int detid = dsv.detId();
115 DetId detIdObject(detid);
117 auto gind = genericDet->
index();
118 const PixelGeomDetUnit* pixDet = dynamic_cast<const PixelGeomDetUnit*>(genericDet);
126 LogDebug(
"SiPixelRecHitFromCUDA") <<
"in det " << gind <<
": conv " <<
nhits <<
" hits from " << dsv.size()
127 <<
" legacy clusters" <<
' ' <<
fc <<
',' << lc;
130 "Too many clusters %d in module %d. Only the first %d hits will be converted",
nhits, gind,
maxHitsInModule);
133 LogDebug(
"SiPixelRecHitFromCUDA") <<
"in det " << gind <<
"conv " <<
nhits <<
" hits from " << dsv.size()
134 <<
" legacy clusters" <<
' ' << lc <<
',' <<
fc;
138 auto jnd = [&](
int k) {
return fc +
k; };
140 if (
nhits != dsv.size()) {
143 for (
auto const& clust : dsv) {
144 assert(clust.originalId() >= 0);
145 assert(clust.originalId() < dsv.size());
146 if (clust.originalId() >=
nhits)
148 auto ij = jnd(clust.originalId());
173 LogDebug(
"SiPixelRecHitFromCUDA") <<
"cluster " << numberOfClusters <<
" at " << lp <<
' ' << le;
178 LogDebug(
"SiPixelRecHitFromCUDA") <<
"found " << recHitsOnDetUnit.
size() <<
" RecHits on " << detid;
182 LogDebug(
"SiPixelRecHitFromCUDA") <<
"found " << numberOfDetUnits <<
" dets, " << numberOfClusters <<
" clusters";
const edm::EDPutTokenT< HMSstorage > hostPutToken_
const edm::EDGetTokenT< cms::cuda::Product< TrackingRecHit2DCUDA > > hitsToken_
constexpr uint32_t maxHitsInModule()
static const std::string input
cms::cuda::host::unique_ptr< float[]> store32_
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)
SiPixelRecHitFromCUDA(const edm::ParameterSet &iConfig)
Pixel cluster – collection of neighboring pixels above threshold.
void acquire(edm::Event const &iEvent, edm::EventSetup const &iSetup, edm::WaitingTaskWithArenaHolder waitingTaskHolder) override
void push_back(data_type const &d)
Log< level::Warning, false > LogWarning
#define DEFINE_FWK_MODULE(type)
cms::cuda::host::unique_ptr< uint32_t[]> hitsModuleStart_
unsigned int QualWordType
static constexpr uint32_t maxHits()
constexpr uint16_t maxNumModules
~SiPixelRecHitFromCUDA() override=default
void produce(edm::Event &iEvent, edm::EventSetup const &iSetup) override
const edm::EDPutTokenT< SiPixelRecHitCollection > rechitsPutToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
const edm::EDGetTokenT< SiPixelClusterCollectionNew > clusterToken_
bool getData(T &iHolder) const
std::unique_ptr< T, impl::HostDeleter > unique_ptr
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Namespace of DDCMS conversion namespace.