-
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
Better TrajectorySeed interface to recHits #29971
Conversation
The code-checks are being triggered in jenkins. |
A new Pull Request was created by @guitargeek (Jonas Rembser) for master. It involves the following packages: DPGAnalysis/SiStripTools @perrotta, @Martin-Grunewald, @ssekmen, @Dr15Jones, @lveldere, @alja, @makortel, @civanch, @sbein, @schneiml, @andrius-k, @mdhildreth, @cmsbuild, @kmaeshima, @jfernan2, @fioriNTU, @slava77, @fwyzard, @santocch can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
Does the current code already guarantee that the rechits are always stored in a vector ? |
Pardon, I should have said that they are stored in an |
@cmsbuild please test |
The tests are being triggered in jenkins. |
+1 |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+1 |
+1 |
Any objections? |
+1 |
+1 |
+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 (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
The current interface of the TrajectorySeed class to its recHits bothered me for quite some time, especially since the ElectronSeed inherits it. I'm speaking about this member function [1]:
which I think should better just return a const reference to theoriginal idea that got discarded in reviewedm::OwnVector<TrackingRecHit>
of seeds (proposed in this PR):which should better return a
edm::Range<RecHitContainer::const_iterator>
that implementsbegin()
andend()
such thatrecHits()
can be used in range-based loops:this also avoids the very misleading expression
recHits().second
: one might think that it points to the second rechit, but actually it is thehits_.end()
iterator. This caused possible bugs here [2] and here [3], I think. No attempt is made in this PR to fix these potential bugs, it only adapts the code to the newly proposed range-loop friendly interface without changing any functionality (hopefully).[1] https://github.com/cms-sw/cmssw/blob/master/DataFormats/TrajectorySeed/interface/TrajectorySeed.h#L52
[2] https://github.com/cms-sw/cmssw/blob/master/RecoTracker/MeasurementDet/src/StartingLayerFinder.cc#L79
[3] https://github.com/cms-sw/cmssw/blob/master/Validation/RecoMuon/src/MuonSeedTrack.cc#L208
PR validation:
CMSSW compiles and local matrix tests pass.
if this PR is a backport please specify the original PR and why you need to backport that PR:
No backport intended.