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

Fixed Logic Errors in CalibrationXML.cc, SiStripElectronAlgo.cc & InOutConversionSeedFinder.cc #15575

Merged
merged 3 commits into from Aug 29, 2016

Conversation

uhussain
Copy link
Contributor

No description provided.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @uhussain (Usama Hussain) for CMSSW_8_1_X.

It involves the following packages:

RecoBTag/XMLCalibration
RecoEgamma/EgammaElectronAlgos
RecoEgamma/EgammaPhotonAlgos

@cmsbuild, @cvuosalo, @slava77, @davidlange6 can you please review it and eventually sign? Thanks.
@Sam-Harper, @imarches, @acaudron, @rafaellopesdesa, @lgray, @JyothsnaKomaragiri, @mverzett, @ferencek, @pvmulder this is something you requested to watch as well.
@slava77, @smuzaffar you are the release manager for this.

cms-bot commands are list here #13028

@cvuosalo
Copy link
Contributor

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 23, 2016

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/14692/console

@cmsbuild
Copy link
Contributor

@lgray
Copy link
Contributor

lgray commented Aug 24, 2016

Hi, most of these asserts or logic statement modifications should be changed to exceptions.

Generally they are in functions where the result of a null pointer at that given point is a major code error in packages upstream of the client code.

@cmsbuild
Copy link
Contributor

@@ -1149,7 +1149,7 @@ bool SiStripElectronAlgo::projectPhiBand(float chargeHypothesis, const reco::Sup
double reducedChi2 = (totalNumberOfHits > 2 ? chi2 / (totalNumberOfHits - 2) : 1e10);

// Select this candidate if it passes minHits_ and maxReducedChi2_ cuts
if (totalNumberOfHits >= minHits_ && reducedChi2 <= maxReducedChi2_) {
if (innerhit != nullptr && totalNumberOfHits >= minHits_ && reducedChi2 <= maxReducedChi2_) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@lgray: Do we really want an exception here? I wouldn't want to stop all processing just because some inner hit is null, unless that is absolutely necessary.

@cvuosalo
Copy link
Contributor

I think CalibrationXML.cc is fine with the null pointer check and assert. I don't think this file is worth the trouble of an exception.

@@ -205,6 +205,7 @@ void InOutConversionSeedFinder::fillClusterSeeds() const {
}

//PropagatorWithMaterial reversePropagator(oppositeToMomentum, 0.000511, &(*theMF_) );
assert(myPointer);
Copy link
Contributor

Choose a reason for hiding this comment

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

This assert could replaced with an exception like:

throw cms::Exception("Null measurement") << "Missing track trajectory measurement";

Copy link
Contributor

Choose a reason for hiding this comment

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

We decided that, since this condition is so unlikely, a simple assert is good enough.

@cvuosalo
Copy link
Contributor

+1

For #15575 08003f6

Fixing static analyzer warnings about null pointers. There should be no change in monitored quantities.

The code changes are satisfactory, and Jenkins tests against baseline CMSSW_8_1_X_2016-08-23-1100 show no significant differences, as expected.

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_8_1_X IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @slava77, @davidlange6, @smuzaffar

@davidlange6
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit cf9b5b1 into cms-sw:CMSSW_8_1_X Aug 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants