CMS 3D CMS Logo

Classes | Typedefs | Functions | Variables
pixelCPEforGPU Namespace Reference

Classes

struct  ClusParamsT
 
struct  CommonParams
 
struct  DetParams
 
struct  LayerGeometry
 
struct  ParamsOnGPU
 

Typedefs

using ClusParams = ClusParamsT< MaxHitsInIter >
 
using Frame = SOAFrame< float >
 
using Rotation = SOARotation< float >
 
using Status = SiPixelHitStatus
 

Functions

constexpr void computeAnglesFromDet (DetParams const &__restrict__ detParams, float const x, float const y, float &cotalpha, float &cotbeta)
 
constexpr float correction (int sizeM1, int q_f, int q_l, uint16_t upper_edge_first_pix, uint16_t lower_edge_last_pix, float lorentz_shift, float theThickness, float cot_angle, float pitch, bool first_is_big, bool last_is_big)
 
constexpr void errorFromDB (CommonParams const &__restrict__ comParams, DetParams const &__restrict__ detParams, ClusParams &cp, uint32_t ic)
 
constexpr void errorFromSize (CommonParams const &__restrict__ comParams, DetParams const &__restrict__ detParams, ClusParams &cp, uint32_t ic)
 
constexpr void position (CommonParams const &__restrict__ comParams, DetParams const &__restrict__ detParams, ClusParams &cp, uint32_t ic)
 

Variables

constexpr int32_t MaxHitsInIter = gpuClustering::maxHitsInIter()
 

Typedef Documentation

◆ ClusParams

Definition at line 110 of file pixelCPEforGPU.h.

◆ Frame

using pixelCPEforGPU::Frame = typedef SOAFrame<float>

Definition at line 18 of file pixelCPEforGPU.h.

◆ Rotation

using pixelCPEforGPU::Rotation = typedef SOARotation<float>

Definition at line 19 of file pixelCPEforGPU.h.

◆ Status

Definition at line 17 of file pixelCPEforGPU.h.

Function Documentation

◆ computeAnglesFromDet()

constexpr void pixelCPEforGPU::computeAnglesFromDet ( DetParams const &__restrict__  detParams,
float const  x,
float const  y,
float &  cotalpha,
float &  cotbeta 
)
inlineconstexpr

Definition at line 112 of file pixelCPEforGPU.h.

113  {
114  // x,y local position on det
115  auto gvx = x - detParams.x0;
116  auto gvy = y - detParams.y0;
117  auto gvz = -1.f / detParams.z0;
118  // normalization not required as only ratio used...
119  // calculate angles
120  cotalpha = gvx * gvz;
121  cotbeta = gvy * gvz;
122  }

Referenced by position().

◆ correction()

constexpr float pixelCPEforGPU::correction ( int  sizeM1,
int  q_f,
int  q_l,
uint16_t  upper_edge_first_pix,
uint16_t  lower_edge_last_pix,
float  lorentz_shift,
float  theThickness,
float  cot_angle,
float  pitch,
bool  first_is_big,
bool  last_is_big 
)
inlineconstexpr
Parameters
q_fCharge in the first pixel.
q_lCharge in the last pixel.
upper_edge_first_pixAs the name says.
lower_edge_last_pixAs the name says.
lorentz_shiftL-shift at half thickness
cot_anglecot of alpha_ or beta_
pitchthePitchX or thePitchY
first_is_bigtrue if the first is big
last_is_bigtrue if the last is big

Definition at line 124 of file pixelCPEforGPU.h.

135  {
136  if (0 == sizeM1) // size 1
137  return 0;
138 
139  float w_eff = 0;
140  bool simple = true;
141  if (1 == sizeM1) { // size 2
142  //--- Width of the clusters minus the edge (first and last) pixels.
143  //--- In the note, they are denoted x_F and x_L (and y_F and y_L)
144  // assert(lower_edge_last_pix >= upper_edge_first_pix);
145  auto w_inner = pitch * float(lower_edge_last_pix - upper_edge_first_pix); // in cm
146 
147  //--- Predicted charge width from geometry
148  auto w_pred = theThickness * cot_angle // geometric correction (in cm)
149  - lorentz_shift; // (in cm) &&& check fpix!
150 
151  w_eff = std::abs(w_pred) - w_inner;
152 
153  //--- If the observed charge width is inconsistent with the expectations
154  //--- based on the track, do *not* use w_pred-w_inner. Instead, replace
155  //--- it with an *average* effective charge width, which is the average
156  //--- length of the edge pixels.
157 
158  // this can produce "large" regressions for very small numeric differences
159  simple = (w_eff < 0.0f) | (w_eff > pitch);
160  }
161 
162  if (simple) {
163  //--- Total length of the two edge pixels (first+last)
164  float sum_of_edge = 2.0f;
165  if (first_is_big)
166  sum_of_edge += 1.0f;
167  if (last_is_big)
168  sum_of_edge += 1.0f;
169  w_eff = pitch * 0.5f * sum_of_edge; // ave. length of edge pixels (first+last) (cm)
170  }
171 
172  //--- Finally, compute the position in this projection
173  float qdiff = q_l - q_f;
174  float qsum = q_l + q_f;
175 
176  //--- Temporary fix for clusters with both first and last pixel with charge = 0
177  if (qsum == 0)
178  qsum = 1.0f;
179 
180  return 0.5f * (qdiff / qsum) * w_eff;
181  }

References funct::abs(), and dqmMemoryStats::float.

Referenced by position().

◆ errorFromDB()

constexpr void pixelCPEforGPU::errorFromDB ( CommonParams const &__restrict__  comParams,
DetParams const &__restrict__  detParams,
ClusParams cp,
uint32_t  ic 
)
inlineconstexpr

Definition at line 323 of file pixelCPEforGPU.h.

326  {
327  // Edge cluster errors
328  cp.xerr[ic] = 0.0050f;
329  cp.yerr[ic] = 0.0085f;
330 
331  auto sx = cp.maxRow[ic] - cp.minRow[ic];
332  auto sy = cp.maxCol[ic] - cp.minCol[ic];
333 
334  // is edgy ? (size is set negative: see above)
335  bool isEdgeX = cp.xsize[ic] < 1;
336  bool isEdgeY = cp.ysize[ic] < 1;
337  // is one and big?
338  bool isOneX = (0 == sx);
339  bool isOneY = (0 == sy);
340  bool isBigX = phase1PixelTopology::isBigPixX(cp.minRow[ic]);
341  bool isBigY = phase1PixelTopology::isBigPixY(cp.minCol[ic]);
342 
343  auto ch = cp.charge[ic];
344  auto bin = 0;
345  for (; bin < 4; ++bin)
346  if (ch < detParams.minCh[bin + 1])
347  break;
348  assert(bin < 5);
349 
350  cp.status[ic].qBin = 4 - bin;
351  cp.status[ic].isOneX = isOneX;
352  cp.status[ic].isBigX = (isOneX & isBigX) | isEdgeX;
353  cp.status[ic].isOneY = isOneY;
354  cp.status[ic].isBigY = (isOneY & isBigY) | isEdgeY;
355 
356  auto xoff = 81.f * comParams.thePitchX;
357  int jx = std::min(15, std::max(0, int(16.f * (cp.xpos[ic] + xoff) / (2 * xoff))));
358 
359  auto toCM = [](uint8_t x) { return float(x) * 1.e-4; };
360 
361  if (not isEdgeX) {
362  cp.xerr[ic] = isOneX ? toCM(isBigX ? detParams.sx2 : detParams.sigmax1[jx])
363  : detParams.xfact[bin] * toCM(detParams.sigmax[jx]);
364  }
365 
366  auto ey = cp.ysize[ic] > 8 ? detParams.sigmay[std::min(cp.ysize[ic] - 9, 15)] : detParams.sy1;
367  if (not isEdgeY) {
368  cp.yerr[ic] = isOneY ? toCM(isBigY ? detParams.sy2 : detParams.sy1) : detParams.yfact[bin] * toCM(ey);
369  }
370  }

References cms::cuda::assert(), newFWLiteAna::bin, f, dqmMemoryStats::float, phase1PixelTopology::isBigPixX(), phase1PixelTopology::isBigPixY(), phase1PixelTopology::isEdgeX(), phase1PixelTopology::isEdgeY(), SiStripPI::max, min(), fftjetcommon_cfi::sx, and fftjetcommon_cfi::sy.

Referenced by gpuPixelRecHits::__attribute__(), and PixelCPEFast::localPosition().

◆ errorFromSize()

constexpr void pixelCPEforGPU::errorFromSize ( CommonParams const &__restrict__  comParams,
DetParams const &__restrict__  detParams,
ClusParams cp,
uint32_t  ic 
)
inlineconstexpr

Definition at line 268 of file pixelCPEforGPU.h.

271  {
272  // Edge cluster errors
273  cp.xerr[ic] = 0.0050;
274  cp.yerr[ic] = 0.0085;
275 
276  // FIXME these are errors form Run1
277  constexpr float xerr_barrel_l1[] = {0.00115, 0.00120, 0.00088};
278  constexpr float xerr_barrel_l1_def = 0.00200; // 0.01030;
279  constexpr float yerr_barrel_l1[] = {
280  0.00375, 0.00230, 0.00250, 0.00250, 0.00230, 0.00230, 0.00210, 0.00210, 0.00240};
281  constexpr float yerr_barrel_l1_def = 0.00210;
282  constexpr float xerr_barrel_ln[] = {0.00115, 0.00120, 0.00088};
283  constexpr float xerr_barrel_ln_def = 0.00200; // 0.01030;
284  constexpr float yerr_barrel_ln[] = {
285  0.00375, 0.00230, 0.00250, 0.00250, 0.00230, 0.00230, 0.00210, 0.00210, 0.00240};
286  constexpr float yerr_barrel_ln_def = 0.00210;
287  constexpr float xerr_endcap[] = {0.0020, 0.0020};
288  constexpr float xerr_endcap_def = 0.0020;
289  constexpr float yerr_endcap[] = {0.00210};
290  constexpr float yerr_endcap_def = 0.00210;
291 
292  auto sx = cp.maxRow[ic] - cp.minRow[ic];
293  auto sy = cp.maxCol[ic] - cp.minCol[ic];
294 
295  // is edgy ?
296  bool isEdgeX = cp.xsize[ic] < 1;
297  bool isEdgeY = cp.ysize[ic] < 1;
298  // is one and big?
299  bool isBig1X = (0 == sx) && phase1PixelTopology::isBigPixX(cp.minRow[ic]);
300  bool isBig1Y = (0 == sy) && phase1PixelTopology::isBigPixY(cp.minCol[ic]);
301 
302  if (!isEdgeX && !isBig1X) {
303  if (not detParams.isBarrel) {
305  } else if (detParams.layer == 1) {
307  } else {
309  }
310  }
311 
312  if (!isEdgeY && !isBig1Y) {
313  if (not detParams.isBarrel) {
315  } else if (detParams.layer == 1) {
317  } else {
319  }
320  }
321  }

References phase1PixelTopology::isBigPixX(), phase1PixelTopology::isBigPixY(), phase1PixelTopology::isEdgeX(), phase1PixelTopology::isEdgeY(), findQualityFiles::size, fftjetcommon_cfi::sx, fftjetcommon_cfi::sy, HLT_FULL_cff::xerr_barrel_l1, HLT_FULL_cff::xerr_barrel_l1_def, HLT_FULL_cff::xerr_barrel_ln, HLT_FULL_cff::xerr_barrel_ln_def, HLT_FULL_cff::xerr_endcap, HLT_FULL_cff::xerr_endcap_def, HLT_FULL_cff::yerr_barrel_l1, HLT_FULL_cff::yerr_barrel_l1_def, HLT_FULL_cff::yerr_barrel_ln, HLT_FULL_cff::yerr_barrel_ln_def, HLT_FULL_cff::yerr_endcap, and HLT_FULL_cff::yerr_endcap_def.

◆ position()

constexpr void pixelCPEforGPU::position ( CommonParams const &__restrict__  comParams,
DetParams const &__restrict__  detParams,
ClusParams cp,
uint32_t  ic 
)
inlineconstexpr

Definition at line 183 of file pixelCPEforGPU.h.

186  {
187  //--- Upper Right corner of Lower Left pixel -- in measurement frame
188  uint16_t llx = cp.minRow[ic] + 1;
189  uint16_t lly = cp.minCol[ic] + 1;
190 
191  //--- Lower Left corner of Upper Right pixel -- in measurement frame
192  uint16_t urx = cp.maxRow[ic];
193  uint16_t ury = cp.maxCol[ic];
194 
195  auto llxl = phase1PixelTopology::localX(llx);
196  auto llyl = phase1PixelTopology::localY(lly);
197  auto urxl = phase1PixelTopology::localX(urx);
198  auto uryl = phase1PixelTopology::localY(ury);
199 
200  auto mx = llxl + urxl;
201  auto my = llyl + uryl;
202 
203  auto xsize = int(urxl) + 2 - int(llxl);
204  auto ysize = int(uryl) + 2 - int(llyl);
205  assert(xsize >= 0); // 0 if bixpix...
206  assert(ysize >= 0);
207 
208  if (phase1PixelTopology::isBigPixX(cp.minRow[ic]))
209  ++xsize;
210  if (phase1PixelTopology::isBigPixX(cp.maxRow[ic]))
211  ++xsize;
212  if (phase1PixelTopology::isBigPixY(cp.minCol[ic]))
213  ++ysize;
214  if (phase1PixelTopology::isBigPixY(cp.maxCol[ic]))
215  ++ysize;
216 
217  int unbalanceX = 8.f * std::abs(float(cp.q_f_X[ic] - cp.q_l_X[ic])) / float(cp.q_f_X[ic] + cp.q_l_X[ic]);
218  int unbalanceY = 8.f * std::abs(float(cp.q_f_Y[ic] - cp.q_l_Y[ic])) / float(cp.q_f_Y[ic] + cp.q_l_Y[ic]);
219  xsize = 8 * xsize - unbalanceX;
220  ysize = 8 * ysize - unbalanceY;
221 
222  cp.xsize[ic] = std::min(xsize, 1023);
223  cp.ysize[ic] = std::min(ysize, 1023);
224 
225  if (cp.minRow[ic] == 0 || cp.maxRow[ic] == phase1PixelTopology::lastRowInModule)
226  cp.xsize[ic] = -cp.xsize[ic];
227  if (cp.minCol[ic] == 0 || cp.maxCol[ic] == phase1PixelTopology::lastColInModule)
228  cp.ysize[ic] = -cp.ysize[ic];
229 
230  // apply the lorentz offset correction
231  auto xPos = detParams.shiftX + comParams.thePitchX * (0.5f * float(mx) + float(phase1PixelTopology::xOffset));
232  auto yPos = detParams.shiftY + comParams.thePitchY * (0.5f * float(my) + float(phase1PixelTopology::yOffset));
233 
234  float cotalpha = 0, cotbeta = 0;
235 
236  computeAnglesFromDet(detParams, xPos, yPos, cotalpha, cotbeta);
237 
238  auto thickness = detParams.isBarrel ? comParams.theThicknessB : comParams.theThicknessE;
239 
240  auto xcorr = correction(cp.maxRow[ic] - cp.minRow[ic],
241  cp.q_f_X[ic],
242  cp.q_l_X[ic],
243  llxl,
244  urxl,
245  detParams.chargeWidthX, // lorentz shift in cm
246  thickness,
247  cotalpha,
248  comParams.thePitchX,
250  phase1PixelTopology::isBigPixX(cp.maxRow[ic]));
251 
252  auto ycorr = correction(cp.maxCol[ic] - cp.minCol[ic],
253  cp.q_f_Y[ic],
254  cp.q_l_Y[ic],
255  llyl,
256  uryl,
257  detParams.chargeWidthY, // lorentz shift in cm
258  thickness,
259  cotbeta,
260  comParams.thePitchY,
262  phase1PixelTopology::isBigPixY(cp.maxCol[ic]));
263 
264  cp.xpos[ic] = xPos + xcorr;
265  cp.ypos[ic] = yPos + ycorr;
266  }

References funct::abs(), cms::cuda::assert(), computeAnglesFromDet(), correction(), dqmMemoryStats::float, createfilelist::int, phase1PixelTopology::isBigPixX(), phase1PixelTopology::isBigPixY(), phase1PixelTopology::lastColInModule, phase1PixelTopology::lastRowInModule, phase1PixelTopology::localX(), phase1PixelTopology::localY(), min(), Calorimetry_cff::thickness, phase1PixelTopology::xOffset, xsize, phase1PixelTopology::yOffset, and ysize.

Referenced by gpuPixelRecHits::__attribute__(), and PixelCPEFast::localPosition().

Variable Documentation

◆ MaxHitsInIter

constexpr int32_t pixelCPEforGPU::MaxHitsInIter = gpuClustering::maxHitsInIter()
constexpr

Definition at line 109 of file pixelCPEforGPU.h.

Referenced by gpuPixelRecHits::__attribute__().

HLT_FULL_cff.xerr_endcap
xerr_endcap
Definition: HLT_FULL_cff.py:7593
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
HLT_FULL_cff.xerr_barrel_ln_def
xerr_barrel_ln_def
Definition: HLT_FULL_cff.py:7597
phase1PixelTopology::localY
constexpr uint16_t localY(uint16_t py)
Definition: phase1PixelTopology.h:151
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
phase1PixelTopology::lastColInModule
constexpr uint16_t lastColInModule
Definition: phase1PixelTopology.h:17
min
T min(T a, T b)
Definition: MathUtil.h:58
pixelCPEforGPU::correction
constexpr float correction(int sizeM1, int q_f, int q_l, uint16_t upper_edge_first_pix, uint16_t lower_edge_last_pix, float lorentz_shift, float theThickness, float cot_angle, float pitch, bool first_is_big, bool last_is_big)
Definition: pixelCPEforGPU.h:124
cms::cuda::assert
assert(be >=bs)
ysize
const Int_t ysize
Definition: trackSplitPlot.h:43
phase1PixelTopology::lastRowInModule
constexpr uint16_t lastRowInModule
Definition: phase1PixelTopology.h:16
hgcal_conditions::parameters
Definition: HGCConditions.h:86
HLT_FULL_cff.xerr_barrel_ln
xerr_barrel_ln
Definition: HLT_FULL_cff.py:7591
xsize
const Int_t xsize
Definition: trackSplitPlot.h:42
HLT_FULL_cff.yerr_barrel_ln_def
yerr_barrel_ln_def
Definition: HLT_FULL_cff.py:7598
HLT_FULL_cff.yerr_barrel_l1_def
yerr_barrel_l1_def
Definition: HLT_FULL_cff.py:7596
HLT_FULL_cff.yerr_barrel_ln
yerr_barrel_ln
Definition: HLT_FULL_cff.py:7592
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:115
HLT_FULL_cff.xerr_endcap_def
xerr_endcap_def
Definition: HLT_FULL_cff.py:7599
phase1PixelTopology::isEdgeY
constexpr bool isEdgeY(uint16_t py)
Definition: phase1PixelTopology.h:126
phase1PixelTopology::localX
constexpr uint16_t localX(uint16_t px)
Definition: phase1PixelTopology.h:142
pixelCPEforGPU::computeAnglesFromDet
constexpr void computeAnglesFromDet(DetParams const &__restrict__ detParams, float const x, float const y, float &cotalpha, float &cotbeta)
Definition: pixelCPEforGPU.h:112
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
createfilelist.int
int
Definition: createfilelist.py:10
HLT_FULL_cff.yerr_endcap_def
yerr_endcap_def
Definition: HLT_FULL_cff.py:7600
phase1PixelTopology::xOffset
constexpr int16_t xOffset
Definition: phase1PixelTopology.h:19
fftjetcommon_cfi.sy
sy
Definition: fftjetcommon_cfi.py:203
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
phase1PixelTopology::isBigPixY
constexpr bool isBigPixY(uint16_t py)
Definition: phase1PixelTopology.h:137
phase1PixelTopology::isEdgeX
constexpr bool isEdgeX(uint16_t px)
Definition: phase1PixelTopology.h:124
genVertex_cff.x
x
Definition: genVertex_cff.py:13
phase1PixelTopology::yOffset
constexpr int16_t yOffset
Definition: phase1PixelTopology.h:20
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
HLT_FULL_cff.xerr_barrel_l1
xerr_barrel_l1
Definition: HLT_FULL_cff.py:7589
HLT_FULL_cff.xerr_barrel_l1_def
xerr_barrel_l1_def
Definition: HLT_FULL_cff.py:7595
phase1PixelTopology::isBigPixX
constexpr bool isBigPixX(uint16_t px)
Definition: phase1PixelTopology.h:135
HLT_FULL_cff.yerr_endcap
yerr_endcap
Definition: HLT_FULL_cff.py:7594
HLT_FULL_cff.yerr_barrel_l1
yerr_barrel_l1
Definition: HLT_FULL_cff.py:7590
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
fftjetcommon_cfi.sx
sx
Definition: fftjetcommon_cfi.py:202