-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Modernize code and simplify GeometricSearchTrackerBuilder #33420
Modernize code and simplify GeometricSearchTrackerBuilder #33420
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33420/22072
|
A new Pull Request was created by @perrotta for master. It involves the following packages: RecoTracker/TkDetLayers @perrotta, @jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
it2++) { | ||
thePxlBarLayers.push_back(aPixelBarrelLayerBuilder.build(*it2, theGeomDetGeometry)); | ||
if (theGeomDetLayer->type() == GeometricDet::PixelPhase1Barrel) { | ||
vector<const GeometricDet *> thePxlBarGeometricDetLayers = theGeomDetLayer->components(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto const &
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd personally prefer to keep the original explicit declaration as it was before (here and in the other similar cases that you pointed out before): do you have any issue with it? You are the code expert, and I'll follow your prescription in that case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to add const &
anyhow. Should help the compiler not to copy the vector!
Btw modenrize (in my opinion) is also use auto
when is not confusing
thePxlBarLayers.push_back(aPixelBarrelLayerBuilder.build(*it2, theGeomDetGeometry)); | ||
if (theGeomDetLayer->type() == GeometricDet::PixelPhase1Barrel) { | ||
vector<const GeometricDet *> thePxlBarGeometricDetLayers = theGeomDetLayer->components(); | ||
for (const GeometricDet *thisGeomDet : thePxlBarGeometricDetLayers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto const
?
for (const GeometricDet *thisGeomDet : thePxlFwdGeometricDetLayers) { | ||
if ((thisGeomDet)->positionBounds().z() < 0) | ||
theNegPxlFwdLayers.push_back(aPhase1PixelForwardLayerBuilder.build(thisGeomDet, theGeomDetGeometry)); | ||
else if ((thisGeomDet)->positionBounds().z() > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else without the test for z>0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else without the test for z>0?
Thank you for your comments, Vincenzo
I don't understand this one though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can be either z<0 or z>0 (z==0 is not possible)
so if is not z<0 MUST BE z>0 no need to test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are many other occurrencies below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are many other occurrencies below
Thank you @VinInn
I think I fixed all them, but this one:
https://github.com/cms-sw/cmssw/pull/33420/files#diff-0b80efba96a5198928106c0248e4976130ec9316fde648c6738d77951bf2f0b3R119
because it explicitly admitted a further else
statement already in the original code, which triggers a LogError
in its turn
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-85f43d/14211/summary.html Comparison SummarySummary:
|
a745b40
to
1ff8e1f
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33420/22085
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33420/22120
|
The differences visible in the tests are only in the converted photons, and apparently not in any other tracker/tracking related quantity. |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-85f43d/14254/summary.html Comparison SummarySummary:
|
Differences in the converted photons have disappeared... |
+1
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
The possible simplifications and cleanings that were proposed during the review of PR 33272 are tentatively implemented here:
No changes are expected in output
@parbol @fabiocos
@mtosi @JanFSchulte @vmariani @ebrondol
PR validation:
Short matrix runs without errors