CMS 3D CMS Logo

List of all members | Public Member Functions
calibPixel::CalibDigisPhase2 Struct Reference

#include <CalibPixel.h>

Public Member Functions

template<typename TAcc >
ALPAKA_FN_ACC void operator() (const TAcc &acc, SiPixelClusterThresholds clusterThresholds, SiPixelDigisSoAView view, SiPixelClustersSoAView clus_view, int numElements) const
 

Detailed Description

Definition at line 92 of file CalibPixel.h.

Member Function Documentation

◆ operator()()

template<typename TAcc >
ALPAKA_FN_ACC void calibPixel::CalibDigisPhase2::operator() ( const TAcc &  acc,
SiPixelClusterThresholds  clusterThresholds,
SiPixelDigisSoAView  view,
SiPixelClustersSoAView  clus_view,
int  numElements 
) const
inline

Definition at line 94 of file CalibPixel.h.

References SiPixelClusterThresholds::electronPerADCGain, HLT_2024v14_cff::ElectronPerADCGain, mps_fire::i, createfilelist::int, pixelClustering::invalidModuleId, SiStripPI::max, SiStripPI::min, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, phase2PixelTopology::numberOfModules, gpuClustering::numElements, cms::alpakatools::once_per_grid(), SiPixelClusterThresholds::phase2DigiBaseline, HLT_2024v14_cff::Phase2DigiBaseline, SiPixelClusterThresholds::phase2KinkADC, HLT_2024v14_cff::Phase2KinkADC, SiPixelClusterThresholds::phase2ReadoutMode, HLT_2024v14_cff::Phase2ReadoutMode, and cms::alpakatools::uniform_elements().

98  {
99  const float ElectronPerADCGain = clusterThresholds.electronPerADCGain;
100  const int8_t Phase2ReadoutMode = clusterThresholds.phase2ReadoutMode;
101  const uint16_t Phase2DigiBaseline = clusterThresholds.phase2DigiBaseline;
102  const uint8_t Phase2KinkADC = clusterThresholds.phase2KinkADC;
103 
104  // zero for next kernels...
106  clus_view[0].clusModuleStart() = clus_view[0].moduleStart() = 0;
107  }
108 
110  clus_view[i].clusInModule() = 0;
111  }
112 
113  for (uint32_t i : cms::alpakatools::uniform_elements(acc, numElements)) {
114  auto dvgi = view[i];
115  if (pixelClustering::invalidModuleId != dvgi.moduleId()) {
116  const int mode = (Phase2ReadoutMode < -1 ? -1 : Phase2ReadoutMode);
117  int adc_int = dvgi.adc();
118  if (mode < 0)
119  adc_int = int(adc_int * ElectronPerADCGain);
120  else {
121  if (adc_int < Phase2KinkADC)
122  adc_int = int((adc_int + 0.5) * ElectronPerADCGain);
123  else {
124  const int8_t dspp = (Phase2ReadoutMode < 10 ? Phase2ReadoutMode : 10);
125  const int8_t ds = int8_t(dspp <= 1 ? 1 : (dspp - 1) * (dspp - 1));
126  adc_int -= Phase2KinkADC;
127  adc_int *= ds;
128  adc_int += Phase2KinkADC;
129  adc_int = ((adc_int + 0.5 * ds) * ElectronPerADCGain);
130  }
131  adc_int += int(Phase2DigiBaseline);
132  }
133  dvgi.adc() = std::min(adc_int, int(std::numeric_limits<uint16_t>::max()));
134  }
135  }
136  }
ALPAKA_FN_ACC auto uniform_elements(TAcc const &acc, TArgs... args)
Definition: workdivision.h:311
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ int32_t *__restrict__ uint32_t numElements
ALPAKA_FN_ACC constexpr bool once_per_grid(TAcc const &acc)
constexpr uint16_t numberOfModules
constexpr uint16_t invalidModuleId