Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14_0_X]fix skipping qBin when reading template info #44816

Merged
merged 1 commit into from
May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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