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

Correct MTDGeomDet type problems #28590

Merged
merged 3 commits into from Jan 7, 2020

Conversation

dan131riley
Copy link

@dan131riley dan131riley commented Dec 9, 2019

PR description:

The BaseTrackerRecHit constructor implicitly assumes that the GeomDet passed to it is a TrackerGeomDet by doing a static_cast to that type:

LocalError lape = static_cast<TrackerGeomDet const*>(det())->localAlignmentError();

Changing the static_cast to dynamic_cast revealed that this assumption is violated by the MTDTrackingRecHitProducer, which passes an MTDGeomDet here:

MTDTrackingRecHit hit(lp, le, *genericDet, cluster);

MTDGeomDet does not inherit from TrackerGeomDet, but is instead a copy&paste copy of TrackerGeomDet that inherits directly from GeomDet:

class MTDGeomDet : public GeomDet {

This doesn't crash and isn't caught by the address sanitizer because the class layout is the same, but it is still a bug that could eventually lead to failures if the different classes evolve separately. Since MTDGeomDet currently has functionality identical to TrackerGeomDet, this PR makes MTDGeomDet a typedef for TrackerGeomDet. If in the future additional functionality is needed in MTDGeomDet it can be made a class that inherits from TrackerGeomDet. This resolves issue #28571.

In addition, this PR also removes some casts that are unnecessary since GeomDet and GeomDetUnit are now the same type, and makes a small change to AlignmentPositionError in GeomDet and TrackerGeomDet to improve encapsulation and reduce code replication.

PR validation:

A limited matrix was run with no new failures observed. This is strictly a technical fix that should have no effect on physics results.

Dan Riley added 2 commits December 6, 2019 14:21
… of the static pointer casts in TrackerRecHit2D into dynamic reference casts
@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 9, 2019

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 9, 2019

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28590/13086

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 9, 2019

A new Pull Request was created by @dan131riley (Dan Riley) for master.

It involves the following packages:

DataFormats/TrackerRecHit2D
Geometry/CommonTopologies
Geometry/MTDGeometryBuilder
RecoLocalFastTime/FTLRecProducers

@perrotta, @civanch, @Dr15Jones, @cvuosalo, @ianna, @mdhildreth, @cmsbuild, @kpedro88, @slava77 can you please review it and eventually sign? Thanks.
@makortel, @gpetruc, @ebrondol, @rovere, @VinInn this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@kpedro88
Copy link
Contributor

please test

@kpedro88
Copy link
Contributor

Do the additional dynamic_casts have a noticeable impact on CPU performance?

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 10, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/3892/console Started: 2019/12/10 01:27

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1f990a/3892/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 34
  • DQMHistoTests: Total histograms compared: 2800084
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2799742
  • DQMHistoTests: Total skipped: 341
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 33 files compared)
  • Checked 147 log files, 16 edm output root files, 34 DQM output files

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 11, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/3928/console Started: 2019/12/11 18:56

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1f990a/3928/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 34
  • DQMHistoTests: Total histograms compared: 2800084
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2799742
  • DQMHistoTests: Total skipped: 341
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 33 files compared)
  • Checked 147 log files, 16 edm output root files, 34 DQM output files

@cvuosalo
Copy link
Contributor

+1

@kpedro88
Copy link
Contributor

+upgrade

@perrotta
Copy link
Contributor

+1

  • The bug described in the PR description is fixed by assigning
using MTDGeomDet = TrackerGeomDet;

in Geometry/CommonTopologies/interface/MTDGeomDet.h

  • Other reco related updates in this PR are mostly cleanings
  • Jenkins tests pass and show no differences

@cmsbuild
Copy link
Contributor

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. @davidlange6, @slava77, @smuzaffar, @fabiocos, @silviodonato (and backports should be raised in the release meeting by the corresponding L2)

@perrotta
Copy link
Contributor

@dan131riley please remove the mention to the move from static_cast's to dynamic_cast's which is still written in the PR description, for a correct reference

@dan131riley
Copy link
Author

@perrotta i updated the PR description and resolved the remaining conversation

@silviodonato
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 2dd52eb into cms-sw:master Jan 7, 2020
@dan131riley dan131riley deleted the GeomDet-type-fixes branch January 7, 2020 20:52
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

7 participants