Skip to content

Commit

Permalink
Merge pull request #44813 from mroguljic/qbin_fix_master
Browse files Browse the repository at this point in the history
fix skipping qBin when reading template info
  • Loading branch information
cmsbuild committed Apr 24, 2024
2 parents 8ba8ffe + 84f6a43 commit 95766dd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion RecoLocalTracker/SiPixelRecHits/src/PixelCPEFastParamsHost.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,20 @@ void PixelCPEFastParamsHost<TrackerTraits>::fillParamsForDevice() {
// sample x by charge
int qbin = pixelCPEforDevice::kGenErrorQBins; // low charge
int k = 0;
for (int qclus = 1000; qclus < 200000; qclus += 1000) {
int qClusIncrement = 100;
for (int qclus = 1000; k < pixelCPEforDevice::kGenErrorQBins;
qclus += qClusIncrement) { //increase charge until we cover all qBin categories
errorFromTemplates(p, cp, qclus);
if (cp.qBin_ == qbin)
continue;
qbin = cp.qBin_;
//There are two qBin categories with low charge. Their qBins are 5 and 4 (pixelCPEforDevice::kGenErrorQBins, pixelCPEforDevice::kGenErrorQBins-1)
//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
//The problem is that with a too large qClusIncrement, we may go directly from 5 to 3, breaking the logic of the for loop
//Therefore, we start with lower increment (100) until we get to qBin=4
if (qbin < pixelCPEforDevice::kGenErrorQBins) {
qClusIncrement = 1000;
}
g.xfact[k] = cp.sigmax;
g.yfact[k] = cp.sigmay;
g.minCh[k++] = qclus;
Expand Down

0 comments on commit 95766dd

Please sign in to comment.