69 std::unique_ptr<SiPixelFedCablingTree>
cabling_;
72 std::unique_ptr<PixelUnpackingRegions>
regions_;
75 std::unique_ptr<pixelgpudetails::SiPixelRawToClusterGPUKernel::WordFedAppender>
wordFedAppender_;
94 isRun2_(iConfig.getParameter<bool>(
"isRun2")),
95 includeErrors_(iConfig.getParameter<bool>(
"IncludeErrors")),
96 useQuality_(iConfig.getParameter<bool>(
"UseQualityInfo")),
97 maxFedWords_(iConfig.getParameter<uint32_t>(
"MaxFEDWords")),
98 clusterThresholds_{iConfig.
getParameter<int32_t>(
"clusterThreshold_layer1"),
99 iConfig.
getParameter<int32_t>(
"clusterThreshold_otherLayers")} {
100 if (includeErrors_) {
101 digiErrorPutToken_ = produces<cms::cuda::Product<SiPixelDigiErrorsCUDA>>();
106 regions_ = std::make_unique<PixelUnpackingRegions>(
iConfig, consumesCollector());
111 wordFedAppender_ = std::make_unique<pixelgpudetails::SiPixelRawToClusterGPUKernel::WordFedAppender>(maxFedWords_);
117 desc.
add<
bool>(
"isRun2",
true);
118 desc.
add<
bool>(
"IncludeErrors",
true);
119 desc.
add<
bool>(
"UseQualityInfo",
false);
126 psd0.
addOptional<std::vector<edm::InputTag>>(
"inputs");
131 ->setComment(
"## Empty Regions PSet means complete unpacking");
133 desc.
add<
std::string>(
"CablingMapLabel",
"")->setComment(
"CablingMap label");
146 <<
") differs the one from SiPixelROCsStatusAndMappingWrapper. Please fix your configuration.";
149 const auto* gpuMap = hgpuMap->getGPUProductAsync(ctx.stream());
153 const auto* gpuGains = hgains->getGPUProductAsync(ctx.stream());
156 const unsigned char* gpuModulesToUnpack;
160 LogDebug(
"SiPixelRawToCluster") <<
"region2unpack #feds: " <<
regions_->nFEDs();
161 LogDebug(
"SiPixelRawToCluster") <<
"region2unpack #modules (BPIX,EPIX,total): " <<
regions_->nBarrelModules() <<
" "
163 modulesToUnpackRegional = hgpuMap->getModToUnpRegionalAsync(*(
regions_->modulesToUnpack()), ctx.stream());
164 gpuModulesToUnpack = modulesToUnpackRegional.get();
166 gpuModulesToUnpack = hgpuMap->getModToUnpAllAsync(ctx.stream());
174 fedIds_ = cablingMap->fedIds();
175 cabling_ = cablingMap->cablingTree();
184 unsigned int wordCounterGPU = 0;
185 unsigned int fedCounter = 0;
186 bool errorsInEvent =
false;
218 bool moreHeaders =
true;
219 while (moreHeaders) {
222 moreHeaders = headerStatus;
226 bool moreTrailers =
true;
228 while (moreTrailers) {
231 moreTrailers = trailerStatus;
237 assert(0 == (ew - bw) % 2);
239 wordCounterGPU += (ew - bw);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
std::unique_ptr< SiPixelFedCablingTree > cabling_
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
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, const uint32_t maxFedWords, bool useQualityInfo, bool includeErrors, bool debug, cudaStream_t stream)
edm::ESWatcher< SiPixelFedCablingMapRcd > recordWatcher_
cms::cuda::ContextState ctxState_
edm::EDPutTokenT< cms::cuda::Product< SiPixelDigiErrorsCUDA > > digiErrorPutToken_
#define DEFINE_FWK_MODULE(type)
unique_ptr< ClusterSequence > cs
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
std::unique_ptr< pixelgpudetails::SiPixelRawToClusterGPUKernel::WordFedAppender > wordFedAppender_
size_t size() const
Lenght of the data buffer in bytes.
edm::EDPutTokenT< cms::cuda::Product< SiPixelDigisCUDA > > digiPutToken_
bool checkHeader(bool &errorsInEvent, int fedId, const Word64 *header, SiPixelFormatterErrors &errors) const
const bool includeErrors_
bool get(ProductID const &oid, Handle< PROD > &result) const
std::vector< std::string > getParameterNames() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
unsigned int cms_uint32_t
std::vector< unsigned int > fedIds_
const uint32_t maxFedWords_
constexpr unsigned int MAX_FED
bool checkCRC(bool &errorsInEvent, int fedId, const Word64 *trailer, SiPixelFormatterErrors &errors) const
T getParameter(std::string const &) const
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
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
const SiPixelClusterThresholds clusterThresholds_
StreamID streamID() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
SiPixelDigiErrorsCUDA && getErrors()
pixelgpudetails::SiPixelRawToClusterGPUKernel gpuAlgo_
SiPixelRawToClusterCUDA(const edm::ParameterSet &iConfig)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
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_
bool checkTrailer(bool &errorsInEvent, int fedId, unsigned int nWords, const Word64 *trailer, SiPixelFormatterErrors &errors) const
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > cablingMapToken_