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

Check for nans earlier in the template reco #38881

Merged
merged 1 commit into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions CondFormats/SiPixelTransient/src/SiPixelTemplate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,12 @@ void SiPixelTemplate::postInit(std::vector<SiPixelTemplateStore>& thePixelTemp_)
bool SiPixelTemplate::interpolate(int id, float cotalpha, float cotbeta, float locBz, float locBx) {
// Interpolate for a new set of track angles

//check for nan's
if (!edm::isFinite(cotalpha) || !edm::isFinite(cotbeta)) {
tvami marked this conversation as resolved.
Show resolved Hide resolved
success_ = false;
return success_;
}

// Local variables
int i, j;
int ilow, ihigh, iylow, iyhigh, Ny, Nxx, Nyx, imidy, imaxx;
Expand Down Expand Up @@ -1393,12 +1399,6 @@ bool SiPixelTemplate::interpolate(int id, float cotalpha, float cotbeta, float l
throw cms::Exception("DataCorrupt")
<< "SiPixelTemplate::interpolate can't find needed template ID = " << id << std::endl;
}

//check for nan's
if (!edm::isFinite(cotalpha) || !edm::isFinite(cotbeta)) {
success_ = false;
return success_;
}
#else
assert(index_id_ >= 0 && index_id_ < (int)thePixelTemp_.size());
#endif
Expand Down
12 changes: 6 additions & 6 deletions CondFormats/SiPixelTransient/src/SiPixelTemplate2D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,12 @@ bool SiPixelTemplate2D::getid(int id) {
bool SiPixelTemplate2D::interpolate(int id, float cotalpha, float cotbeta, float locBz, float locBx) {
// Interpolate for a new set of track angles

//check for nan's
if (!edm::isFinite(cotalpha) || !edm::isFinite(cotbeta)) {
tvami marked this conversation as resolved.
Show resolved Hide resolved
success_ = false;
return success_;
}

// Local variables

float acotb, dcota, dcotb;
Expand Down Expand Up @@ -680,12 +686,6 @@ bool SiPixelTemplate2D::interpolate(int id, float cotalpha, float cotbeta, float
#ifndef SI_PIXEL_TEMPLATE_STANDALONE
throw cms::Exception("DataCorrupt")
<< "SiPixelTemplate2D::illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl;

//check for nan's
if (!edm::isFinite(cotalpha) || !edm::isFinite(cotbeta)) {
success_ = false;
return success_;
}
#else
std::cout << "SiPixelTemplate:2D:illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl;
#endif
Expand Down