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 >
 

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 102 of file pixelCPEforGPU.h.

◆ Frame

using pixelCPEforGPU::Frame = typedef SOAFrame<float>

Definition at line 16 of file pixelCPEforGPU.h.

◆ Rotation

using pixelCPEforGPU::Rotation = typedef SOARotation<float>

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 104 of file pixelCPEforGPU.h.

105  {
106  // x,y local position on det
107  auto gvx = x - detParams.x0;
108  auto gvy = y - detParams.y0;
109  auto gvz = -1.f / detParams.z0;
110  // normalization not required as only ratio used...
111  // calculate angles
112  cotalpha = gvx * gvz;
113  cotbeta = gvy * gvz;
114  }

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 116 of file pixelCPEforGPU.h.

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

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 315 of file pixelCPEforGPU.h.

318  {
319  // Edge cluster errors
320  cp.xerr[ic] = 0.0050f;
321  cp.yerr[ic] = 0.0085f;
322 
323  auto sx = cp.maxRow[ic] - cp.minRow[ic];
324  auto sy = cp.maxCol[ic] - cp.minCol[ic];
325 
326  // is edgy ?
327  bool isEdgeX = cp.minRow[ic] == 0 or cp.maxRow[ic] == phase1PixelTopology::lastRowInModule;
328  bool isEdgeY = cp.minCol[ic] == 0 or cp.maxCol[ic] == phase1PixelTopology::lastColInModule;
329  // is one and big?
330  uint32_t ix = (0 == sx);
331  uint32_t iy = (0 == sy);
332  ix += (0 == sx) && phase1PixelTopology::isBigPixX(cp.minRow[ic]);
333  iy += (0 == sy) && phase1PixelTopology::isBigPixY(cp.minCol[ic]);
334 
335  if (not isEdgeX)
336  cp.xerr[ic] = detParams.sx[ix];
337  if (not isEdgeY)
338  cp.yerr[ic] = detParams.sy[iy];
339  }

References phase1PixelTopology::isBigPixX(), phase1PixelTopology::isBigPixY(), phase1PixelTopology::isEdgeX(), phase1PixelTopology::isEdgeY(), phase1PixelTopology::lastColInModule, phase1PixelTopology::lastRowInModule, or, fftjetcommon_cfi::sx, and fftjetcommon_cfi::sy.

Referenced by gpuPixelRecHits::__attribute__().

◆ errorFromSize()

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

Definition at line 260 of file pixelCPEforGPU.h.

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

References phase1PixelTopology::isBigPixX(), phase1PixelTopology::isBigPixY(), phase1PixelTopology::isEdgeX(), phase1PixelTopology::isEdgeY(), phase1PixelTopology::lastColInModule, phase1PixelTopology::lastRowInModule, or, findQualityFiles::size, fftjetcommon_cfi::sx, and fftjetcommon_cfi::sy.

◆ position()

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

Definition at line 175 of file pixelCPEforGPU.h.

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

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 101 of file pixelCPEforGPU.h.

Referenced by gpuPixelRecHits::__attribute__().

dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
phase1PixelTopology::localY
constexpr uint16_t localY(uint16_t py)
Definition: phase1PixelTopology.h:151
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:116
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
xsize
const Int_t xsize
Definition: trackSplitPlot.h:42
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:115
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:104
createfilelist.int
int
Definition: createfilelist.py:10
phase1PixelTopology::xOffset
constexpr int16_t xOffset
Definition: phase1PixelTopology.h:19
fftjetcommon_cfi.sy
sy
Definition: fftjetcommon_cfi.py:203
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:12
phase1PixelTopology::yOffset
constexpr int16_t yOffset
Definition: phase1PixelTopology.h:20
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
phase1PixelTopology::isBigPixX
constexpr bool isBigPixX(uint16_t px)
Definition: phase1PixelTopology.h:135
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