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
EgammaAnalysis/ElectronTools: potential bug fix, add parens to set implied order of + and ? #17014
EgammaAnalysis/ElectronTools: potential bug fix, add parens to set implied order of + and ? #17014
Conversation
…e implied order of + and ?
A new Pull Request was created by @gartung (Patrick Gartung) for CMSSW_9_0_X. It involves the following packages: EgammaAnalysis/ElectronTools @cmsbuild, @monttj, @davidlange6 can you please review it and eventually sign? Thanks. cms-bot commands are listed here #13028 |
@Dr15Jones please test |
How about adding |
Pull request #17014 was updated. @cmsbuild, @monttj, @davidlange6 can you please check and sign again. |
@Dr15Jones I added the override keyword as needed. |
@cmsbuild please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
+1 |
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. @slava77, @davidlange6, @smuzaffar |
Hi @slava77 -can this bug affect the reco? |
@davidlange6 @rafaellopesdesa @fcouderc |
Hi Slava, No, it does not affect the calibration in the RECO sequence. We used the SimpleElectron class for the EGMSmearer (data-MC residuals in EGM calibration) in 2015/2016 but the bug does not seem to alter the output since this variable is not used (the input variable for the Ep combination after data-MC residual application is SimpleElectron::newEnergy_, which is copied from GsfElectron::correctedEcalEnergy). I am not aware of any current use of the SimplePhoton class in RECO or in any EGM-maintained user application. Maybe someone is using privately, but then I have no way to know. I hope this clarify, cheers. |
it would be great to just delete SimplePhoton if its not used. Thanks |
+1 |
These clang warnings imply a possible bug because + is evaluated before ?. Also clean up of test class functions.
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/ba81249bb4729771235b98cb83b6e8d8/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-13-1100/src/EgammaAnalysis/ElectronTools/src/SimplePhoton.cc:8:56: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]
scEnergy_(in.superCluster()->rawEnergy() + in.isEB() ? 0 : in.superCluster()->preshowerEnergy()),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/ba81249bb4729771235b98cb83b6e8d8/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-13-1100/src/EgammaAnalysis/ElectronTools/src/SimplePhoton.cc:8:56: note: place parentheses around the '+' expression to silence this warning
scEnergy_(in.superCluster()->rawEnergy() + in.isEB() ? 0 : in.superCluster()->preshowerEnergy()),
^
( )
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/ba81249bb4729771235b98cb83b6e8d8/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-13-1100/src/EgammaAnalysis/ElectronTools/src/SimplePhoton.cc:8:56: note: place parentheses around the '?:' expression to evaluate it first
scEnergy_(in.superCluster()->rawEnergy() + in.isEB() ? 0 : in.superCluster()->preshowerEnergy()),
^
( )
1 warning generated.
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/ba81249bb4729771235b98cb83b6e8d8/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-13-1100/src/EgammaAnalysis/ElectronTools/src/SimpleElectron.cc:7:62: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]
scEnergy_(in.superCluster()->rawEnergy() + in.isEB() ? 0 : in.superCluster()->preshowerEnergy()),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/ba81249bb4729771235b98cb83b6e8d8/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-13-1100/src/EgammaAnalysis/ElectronTools/src/SimpleElectron.cc:7:62: note: place parentheses around the '+' expression to silence this warning
scEnergy_(in.superCluster()->rawEnergy() + in.isEB() ? 0 : in.superCluster()->preshowerEnergy()),
^
( )
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/ba81249bb4729771235b98cb83b6e8d8/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-13-1100/src/EgammaAnalysis/ElectronTools/src/SimpleElectron.cc:7:62: note: place parentheses around the '?:' expression to evaluate it first
scEnergy_(in.superCluster()->rawEnergy() + in.isEB() ? 0 : in.superCluster()->preshowerEnergy()),
^
( )