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

Pixel local reco: reduce code duplication between PixelCPEGeneric and PixelCPEFast #33706

Merged
merged 17 commits into from May 20, 2021

Conversation

czangela
Copy link
Contributor

PR description:

This PR aims to reduce some code duplication in the classes PixelCPEFast and PixelCPEGeneric (under RecoLocalTracker/SiPixelRecHits/).

Main changes are:

  1. factor collect_edge_charges()
  2. make ClusterParamGeneric common (PixelCPEFast is planned to have irradiation bias corrections, but I might have misunderstood this)
  3. factor createClusterParam()
  4. make the "fallback" rechit errors configurable (const std::vector<float> xerr_barrel_l1_, yerr_barrel_l1_, xerr_barrel_ln_, etc.)
  5. factor common code between {PixelCPEGeneric|PixelCPEFast}::localError()

This should solve the issues listed in #32483 related to "factor common code between PixelCPEGeneric and PixelCPEFast".

It introduces a new base class for the two, named PixelCPEGenericBase, this is where most of the common code went.

PR validation:

compilation, runtests, unittests, addOnTests.py --tests=hlt_data_GRun

if this PR is a backport please specify the original PR and why you need to backport that PR:

kindly ping @mmusich @tsusa

- common base class for pixel CPE generic classes: PixelCPEGeneric, PixelCPEFast
…asses:

 - PixelCPEGeneric and PixelCPEFast -> PixelCPEGenericBase
 - edgeClusterErrorX_, edgeClusterErrorY_, useErrorsFromTemplates_, truncatePixelCharge_
 - reduce duplication in PixelCPEFast and PixelCPEGeneric localError() function
 - from PixelCPEGeneric + PixelCPEFast -> PixelCPEGenericBase
 - use RectangularPixelTopology instead of phase1PixelTopology for edge pixel determination
   -> in the long term it supports phase 2 integration ?
   -> this whole commit can be dropped if this is problematic
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33706/22619

  • This PR adds an extra 84KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @czangela for master.

It involves the following packages:

RecoLocalTracker/SiPixelRecHits

@perrotta, @jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@mtosi, @makortel, @felicepantaleo, @GiacomoSguazzoni, @JanFSchulte, @rovere, @VinInn, @OzAmram, @ferencek, @dkotlins, @gpetruc, @threus, @tvami this is something you requested to watch as well.
@silviodonato, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@mmusich
Copy link
Contributor

mmusich commented May 12, 2021

enable gpu

@mmusich
Copy link
Contributor

mmusich commented May 12, 2021

@cmsbuild, please test

@VinInn
Copy link
Contributor

VinInn commented May 12, 2021

irradiation corrections could be factored out as they do not depend on cluster details. They can actually applied to hit
see this code for instance
https://github.com/cms-patatrack/cmssw/pull/541/files#diff-4807da1689132487b2b97dad5d71d3c1753a44c0fc1769c0df675b59e0026ea7R635

I am not proposing this: it is just to slow that the CPE can be factorized in two parts: one that computes the position (and the size) and another that computes error and irradiation correction (both may depends on track angle)

This can be exploited in patatrack to correct the hit just before the fit see
https://github.com/cms-patatrack/cmssw/pull/528/files#diff-758835a025c83b8981f93fbfe6a0c921f7d7f57d6196efe8b97b65da65188698R89
where only the error is recomputed when of course the irradiation correction can be added as well.
A similar approach could also be used offline (see PR above) but that requires extensive modification to the tracking code that in my opinion do not fit Run3 schedule.

I take the opportunity to ask "stake holder' if they have any plan to move in the direction of this very last PR that is by know pretty obsolete (at least in terms of code) and would require essentially a full re-writing. The last comment from DPG was that indeed improved single hit resolution (at least in terms of pulls).
The angle dependent correction prior to fit may become critical at later times as well.

int pixmx;

// These are errors predicted by PIXELAV
float sigmay; // CPE Generic y-error for multi-pixel cluster
Copy link
Contributor

Choose a reason for hiding this comment

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

btw: you may have by now realized that there is no need of all these variable as they are mutual exclusive.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33706/22716

  • This PR adds an extra 84KB to repository

@cmsbuild
Copy link
Contributor

Pull request #33706 was updated. @perrotta, @jpata, @cmsbuild, @slava77 can you please check and sign again.

@czangela
Copy link
Contributor Author

@cmsbuild please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-87155f/15163/summary.html
COMMIT: 617be05
CMSSW: CMSSW_12_0_X_2021-05-18-1100/slc7_amd64_gcc900
Additional Tests: GPU
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/33706/15163/install.sh to create a dev area with all the needed externals and cmssw changes.

GPU Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 4
  • DQMHistoTests: Total histograms compared: 9533
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 9533
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 3 files compared)
  • Checked 12 log files, 9 edm output root files, 4 DQM output files
  • TriggerResults: no differences found

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 37
  • DQMHistoTests: Total histograms compared: 2648242
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2648219
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 36 files compared)
  • Checked 155 log files, 37 edm output root files, 37 DQM output files
  • TriggerResults: no differences found

@slava77
Copy link
Contributor

slava77 commented May 20, 2021

+reconstruction

for #33706 617be05

  • code changes are technical, refactoring of repeated code; they are in line with the PR description and the follow up review
  • jenkins tests pass and comparisons with the baseline 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. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@mmusich
Copy link
Contributor

mmusich commented May 20, 2021

@cms-sw/trk-dpg-l2
please confirm that the changes here are OK for you.

This PR has been done in close consultation of the long term maintainers of this package (@OzAmram @pmaksim1), therefore we are OK with it.
Thanks

@qliphy
Copy link
Contributor

qliphy commented May 20, 2021

+1

@cmsbuild cmsbuild merged commit 5c85b26 into cms-sw:master May 20, 2021
@slava77
Copy link
Contributor

slava77 commented May 20, 2021 via email

@mmusich
Copy link
Contributor

mmusich commented May 20, 2021

@slava77 sorry if there was a misunderstanding.
You can consider all PRs coming from @czangela as good from the DPG side (we're discussing changes extensively upfront internally).

BTW, can we formally confirm @OzAmram as a pixel reco contact now

Yes, please.

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

6 participants