69 std::unique_ptr<SiPixelFedCablingTree>
cabling_;
72 std::unique_ptr<PixelUnpackingRegions>
regions_;
92 isRun2_(iConfig.getParameter<
bool>(
"isRun2")),
93 includeErrors_(iConfig.getParameter<
bool>(
"IncludeErrors")),
94 useQuality_(iConfig.getParameter<
bool>(
"UseQualityInfo")),
95 clusterThresholds_{iConfig.
getParameter<int32_t>(
"clusterThreshold_layer1"),
96 iConfig.
getParameter<int32_t>(
"clusterThreshold_otherLayers")} {
98 digiErrorPutToken_ = produces<cms::cuda::Product<SiPixelDigiErrorsCUDA>>();
103 regions_ = std::make_unique<PixelUnpackingRegions>(iConfig, consumesCollector());
109 desc.add<
bool>(
"isRun2",
true);
110 desc.add<
bool>(
"IncludeErrors",
true);
111 desc.add<
bool>(
"UseQualityInfo",
false);
115 ->setComment(
"This parameter is obsolete and will be ignored.");
121 psd0.
addOptional<std::vector<edm::InputTag>>(
"inputs");
126 ->setComment(
"## Empty Regions PSet means complete unpacking");
128 desc.add<
std::string>(
"CablingMapLabel",
"")->setComment(
"CablingMap label");
141 <<
") differs the one from SiPixelROCsStatusAndMappingWrapper. Please fix your configuration.";
144 const auto* gpuMap = hgpuMap->getGPUProductAsync(ctx.stream());
148 const auto* gpuGains = hgains->getGPUProductAsync(ctx.stream());
151 const unsigned char* gpuModulesToUnpack;
155 LogDebug(
"SiPixelRawToCluster") <<
"region2unpack #feds: " <<
regions_->nFEDs();
156 LogDebug(
"SiPixelRawToCluster") <<
"region2unpack #modules (BPIX,EPIX,total): " <<
regions_->nBarrelModules() <<
" " 158 modulesToUnpackRegional = hgpuMap->getModToUnpRegionalAsync(*(
regions_->modulesToUnpack()), ctx.stream());
159 gpuModulesToUnpack = modulesToUnpackRegional.get();
161 gpuModulesToUnpack = hgpuMap->getModToUnpAllAsync(ctx.stream());
169 fedIds_ = cablingMap->fedIds();
170 cabling_ = cablingMap->cablingTree();
179 unsigned int wordCounter = 0;
180 unsigned int fedCounter = 0;
181 bool errorsInEvent =
false;
184 std::vector<cms_uint32_t const*>
start(
fedIds_.size(),
nullptr);
185 std::vector<ptrdiff_t> words(
fedIds_.size(), 0);
189 for (uint32_t
i = 0;
i <
fedIds_.size(); ++
i) {
211 if (not errorcheck.checkCRC(errorsInEvent,
fedId, trailer,
errors_)) {
218 bool moreHeaders =
true;
219 while (moreHeaders) {
222 moreHeaders = headerStatus;
226 bool moreTrailers =
true;
228 while (moreTrailers) {
230 bool trailerStatus = errorcheck.checkTrailer(errorsInEvent,
fedId, nWords, trailer,
errors_);
231 moreTrailers = trailerStatus;
237 assert(0 == (ew - bw) % 2);
240 words[
i] = (ew - bw);
241 wordCounter += (ew - bw);
252 for (uint32_t
i = 0;
i <
fedIds_.size(); ++
i) {
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
std::unique_ptr< SiPixelFedCablingTree > cabling_
T getParameter(std::string const &) const
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
edm::ESWatcher< SiPixelFedCablingMapRcd > recordWatcher_
cms::cuda::ContextState ctxState_
void initializeWordFed(int fedId, unsigned int index, cms_uint32_t const *src, unsigned int length)
edm::EDPutTokenT< cms::cuda::Product< SiPixelDigiErrorsCUDA > > digiErrorPutToken_
#define DEFINE_FWK_MODULE(type)
const int32_t otherLayers
std::pair< SiPixelDigisCUDA, SiPixelClustersCUDA > getResults()
edm::ESGetToken< SiPixelGainCalibrationForHLTGPU, SiPixelGainCalibrationForHLTGPURcd > gainsToken_
static MessageDrop * instance()
edm::EDPutTokenT< cms::cuda::Product< SiPixelClustersCUDA > > clusterPutToken_
const SiPixelFedCablingMap * cablingMap_
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
edm::EDPutTokenT< cms::cuda::Product< SiPixelDigisCUDA > > digiPutToken_
const bool includeErrors_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
unsigned int cms_uint32_t
Namespace of DDCMS conversion namespace.
std::vector< unsigned int > fedIds_
constexpr SiPixelClusterThresholds kSiPixelClusterThresholdsDefaultPhase1
bool check(const edm::EventSetup &iSetup)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
void acquire(const edm::Event &iEvent, const edm::EventSetup &iSetup, edm::WaitingTaskWithArenaHolder waitingTaskHolder) override
const SiPixelClusterThresholds clusterThresholds_
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
SiPixelDigiErrorsCUDA && getErrors()
pixelgpudetails::SiPixelRawToClusterGPUKernel gpuAlgo_
SiPixelRawToClusterCUDA(const edm::ParameterSet &iConfig)
void makeClustersAsync(bool isRun2, const SiPixelClusterThresholds clusterThresholds, const SiPixelROCsStatusAndMapping *cablingMap, const unsigned char *modToUnp, const SiPixelGainForHLTonGPU *gains, const WordFedAppender &wordFed, SiPixelFormatterErrors &&errors, const uint32_t wordCounter, const uint32_t fedCounter, bool useQualityInfo, bool includeErrors, bool debug, cudaStream_t stream)
unsigned long long cms_uint64_t
~SiPixelRawToClusterCUDA() override=default
std::unique_ptr< PixelUnpackingRegions > regions_
edm::ESGetToken< SiPixelROCsStatusAndMappingWrapper, CkfComponentsRecord > gpuMapToken_
PixelDataFormatter::Errors errors_
edm::EDGetTokenT< FEDRawDataCollection > rawGetToken_
std::vector< std::string > getParameterNames() const
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > cablingMapToken_