24 template <
typename TrackerTraits>
49 template <
typename TrackerTraits>
52 hitsToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"pixelRecHitSrc"))),
53 clusterToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"src"))),
54 rechitsPutToken_(produces()),
55 hostPutToken_(produces()) {}
57 template <
typename TrackerTraits>
65 template <
typename TrackerTraits>
70 auto nHits =
hits.view().metadata().size();
71 LogDebug(
"SiPixelRecHitFromSoAAlpaka") <<
"converting " <<
nHits <<
" Hits";
89 for (
unsigned int idx = 0;
idx < hmsp.size(); ++
idx) {
90 hmsp[
idx] =
hits.view().hitsModuleStart()[
idx];
94 auto xl =
hits.view().xLocal();
95 auto yl =
hits.view().yLocal();
96 auto xe =
hits.view().xerrLocal();
97 auto ye =
hits.view().yerrLocal();
101 auto const hclusters =
iEvent.getHandle(clusterToken_);
105 int numberOfDetUnits = 0;
107 for (
auto const& dsv : *hclusters) {
109 unsigned int detid = dsv.detId();
110 DetId detIdObject(detid);
112 auto gind = genericDet->
index();
116 auto fc =
hits.view().hitsModuleStart()[gind];
117 auto lc =
hits.view().hitsModuleStart()[gind + 1];
118 auto nhits = lc - fc;
121 LogDebug(
"SiPixelRecHitFromSoAAlpaka") <<
"in det " << gind <<
": conv " <<
nhits <<
" hits from " << dsv.size()
122 <<
" legacy clusters" <<
' ' << fc <<
',' << lc <<
"\n";
125 .format(
"Too many clusters {} in module {}. Only the first {} hits will be converted",
132 LogDebug(
"SiPixelRecHitFromSoAAlpaka") <<
"in det " << gind <<
"conv " <<
nhits <<
" hits from " << dsv.size()
133 <<
" legacy clusters" <<
' ' << lc <<
',' << fc;
137 auto jnd = [&](
int k) {
return fc +
k; };
139 if (
nhits != dsv.size()) {
142 for (
auto const& clust : dsv) {
143 assert(clust.originalId() >= 0);
144 assert(clust.originalId() < dsv.size());
145 if (clust.originalId() >=
nhits)
147 auto ij = jnd(clust.originalId());
164 recHitsOnDetUnit.
emplace_back(lp, le, rqw, *genericDet, cluster);
172 LogDebug(
"SiPixelRecHitFromSoAAlpaka") <<
"found " << recHitsOnDetUnit.
size() <<
" RecHits on " << detid;
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)
constexpr int nMaxModules
void produce(edm::StreamID streamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
std::array< hindex_type, TrackerTraits::numberOfModules+1 > HitModuleStartArray
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const edm::EDGetTokenT< SiPixelClusterCollectionNew > clusterToken_
typename std::vector< hindex_type > HMSstorage
const edm::EDPutTokenT< HMSstorage > hostPutToken_
constexpr uint16_t numberOfModules
~SiPixelRecHitFromSoAAlpaka() override=default
const edm::EDPutTokenT< SiPixelRecHitCollection > rechitsPutToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
SiPixelRecHitFromSoAAlpaka(const edm::ParameterSet &iConfig)
typename TrackingRecHitSoA< TrackerTraits >::HitModuleStartArray HitModuleStartArray
typename TrackerTraits::hindex_type hindex_type
Pixel cluster – collection of neighboring pixels above threshold.
unsigned int QualWordType
void emplace_back(Args &&... args)
Log< level::Warning, false > LogWarning
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
const edm::EDGetTokenT< HitsOnHost > hitsToken_
constexpr uint32_t maxHitsInModule()