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

bug fix for GsfEleEcalDrivenCut #17118

Merged
merged 2 commits into from Jan 7, 2017

Conversation

Sam-Harper
Copy link
Contributor

Thanks to @lgray, a bug was found where the GsfEleEcalDrivenCut accidentally stores the cut value in a bool rather than an int. This meant that the "ignore" code (-1) would be configured to "require ecal driven" (1).

This has no impact in any official E/g ID as its never set to ignore (only the case when you want it ignored in the barrel and not the endcap or vice versa would have this). Still it should be fixed. No need for any backports.

At the same time, I made the whole thing more robust against user config errors, to the point it will now throw an exception and a clear message if the config file passes in something other -1,0,1 for the cut value.

Out of ~7000 DY events, no changes in the number of electrons passing the HEEP V60 ID (which uses this cut) is observed.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 5, 2017

A new Pull Request was created by @Sam-Harper for CMSSW_9_0_X.

It involves the following packages:

RecoEgamma/ElectronIdentification

@cmsbuild, @cvuosalo, @slava77, @davidlange6 can you please review it and eventually sign? Thanks.
@rafaellopesdesa, @lgray this is something you requested to watch as well.
@davidlange6, @smuzaffar you are the release manager for this.

cms-bot commands are listed here #13028


bool GsfEleEcalDrivenCut::isValidCutVal(int val)
{
if(val==IGNORE) return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

@Sam-Harper use a switch statement here!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

isnt that personal style choice? I personally never really like switch statements.

Copy link
Contributor

Choose a reason for hiding this comment

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

The compiler might optimize it out but otherwise they should make very different code (switch statement being much more efficient). I suppose it doesn't matter so much since it isn't called every event.

switch(val) {
case IGNORE:
case PASS:
case FAIL:
    return true;
    break;
default:
    break;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well it'll be done twice per object it should be fine. I have an irrational aversion to switch statements :)

errMsg<<"error in constructing GsfEleEcalDrivenCut"<<std::endl;
errMsg<<"values of ecalDrivenEB: "<<ecalDrivenEB_<<" and/or ecalDrivenEE: "<<ecalDrivenEE_<<" are invalid "<<std::endl;
errMsg<<"allowed values are IGNORE:"<<IGNORE<<" FAIL:"<<FAIL<<" PASS:"<<PASS;
throw edm::Exception(edm::errors::Configuration,errMsg.str());
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC, you can just edm::Exception(category)<<"blah" << xyz;
to avoid creation of ostringstream

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ta, I didnt know that. Done.

@slava77
Copy link
Contributor

slava77 commented Jan 5, 2017

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 5, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/17192/console Started: 2017/01/06 00:24

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 6, 2017

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 6, 2017

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 6, 2017

@slava77
Copy link
Contributor

slava77 commented Jan 6, 2017

+1

for #17118 956c613

  • changes are as described; possibly affects only HEEP ID; git grep confirms that existing configurations are not affected
  • jenkins tests pass and comparisons show no diffs

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 6, 2017

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

@davidlange6
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit fab1895 into cms-sw:CMSSW_9_0_X Jan 7, 2017
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