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

Removing clang warning in EgammaHLTPixelMatchVarProducer #46488

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,24 @@ namespace {
int layerOffset = 3;
if (seed.subDet(hitNr) == PixelSubdetector::PixelEndcap)
layerOffset += 4;
int layerBit = 0x1 << layerOffset << seed.layerOrDiskNr(hitNr);

int layerOrDiskNr = seed.layerOrDiskNr(hitNr);
if (layerOrDiskNr == 0 || layerOrDiskNr > 4) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for my education what happens in the phase-2 case? You don't foresee to make use of the full FPix ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah thanks, I had understood from our brief conversation that we were still 4 layers in phase-II and of course we dont, sorry my bad.

Right now we dont take advantage of the full fpx only 1-4 and we should review this as it'll be important at high eta. But this requires a reworking of this code and more reason to have the warning in there to cause problems.

Thanks for pointing it out

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah thanks, I had understood from our brief conversation that we were still 4 layers in phase-II and of course we dont, sorry my bad.

In phase-2 we'll still have 4 layers in BPix, but 12 disks in the endcaps:

image

sorry it was probably me not being clear during our conversation.
So, IIUC, you don't think this 4 should be a 12 for the time being until there's more code rework, right?

if (layerOrDiskNr == std::numeric_limits<int>::max()) {
throw cms::Exception("LogicError")
<< "The layerOrDiskNr of hitnr " << hitNr << " is " << layerOrDiskNr
<< " which is equal to numeric_limits::max which implies it was not filled correctly.\nWhile this is "
"valid for the matching variables as it can signal the failure to find a postive or negative seed "
"trajectory,\nit is not valid for the layer number as that is always known.\nThus there is a logic "
"error in the code or possible corrupt data";
} else {
throw cms::Exception("InvalidData") << "The layerOrDiskNr of hitnr " << hitNr << " is " << layerOrDiskNr
<< " and is not in the range of 1<=x<=4 which implies a new pixel "
"detector\nthis code does not support as the current one has only 4 "
"layers numbered 1-4 or corrupt data\n";
}
}
int layerBit = 0x1 << layerOffset << layerOrDiskNr;
info |= layerBit;

int nrLayersAlongTrajShifted = seed.nrLayersAlongTraj() << 12;
Expand Down