File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
RecoLocalTracker/SiPixelRecHits/src Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -220,11 +220,20 @@ void PixelCPEFastParamsHost<TrackerTraits>::fillParamsForDevice() {
220220 // sample x by charge
221221 int qbin = pixelCPEforDevice::kGenErrorQBins ; // low charge
222222 int k = 0 ;
223- for (int qclus = 1000 ; qclus < 200000 ; qclus += 1000 ) {
223+ int qClusIncrement = 100 ;
224+ for (int qclus = 1000 ; k < pixelCPEforDevice::kGenErrorQBins ;
225+ qclus += qClusIncrement) { // increase charge until we cover all qBin categories
224226 errorFromTemplates (p, cp, qclus);
225227 if (cp.qBin_ == qbin)
226228 continue ;
227229 qbin = cp.qBin_ ;
230+ // There are two qBin categories with low charge. Their qBins are 5 and 4 (pixelCPEforDevice::kGenErrorQBins, pixelCPEforDevice::kGenErrorQBins-1)
231+ // We increment charge until qBin gets switched from 5 and then we start writing detParams as we are not interested in cases with qBin=5
232+ // The problem is that with a too large qClusIncrement, we may go directly from 5 to 3, breaking the logic of the for loop
233+ // Therefore, we start with lower increment (100) until we get to qBin=4
234+ if (qbin < pixelCPEforDevice::kGenErrorQBins ) {
235+ qClusIncrement = 1000 ;
236+ }
228237 g.xfact [k] = cp.sigmax ;
229238 g.yfact [k] = cp.sigmay ;
230239 g.minCh [k++] = qclus;
You can’t perform that action at this time.
0 commit comments