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

Remove redundant product validity check from ConversionTrackProducer and modernize it #30082

Merged
merged 6 commits into from Jun 6, 2020

Conversation

makortel
Copy link
Contributor

@makortel makortel commented Jun 2, 2020

PR description:

This PR is part of #30074 even though it itself does not fix any workflow. The bare "throw" will lead to abort (*) because there is no exception to be thrown. On the other hand, the beamSpotHandle->position() will throw an exception if the product is missing (with much clearer message), so this PR proposes just remove the check.

(*) https://cmssdt.cern.ch/SDT/cgi-bin/buildlogs/raw/slc7_amd64_gcc820/CMSSW_11_2_X_2020-06-01-2300/pyRelValMatrixLogs/run/135.9_ZMM_13+ZMMFS_13+HARVESTUP15FS+MINIAODMCUP15FS/step1_ZMM_13+ZMMFS_13+HARVESTUP15FS+MINIAODMCUP15FS.log

In addition this PR modernizes ConversionTrackProducer by

  • Constructing BeamSpot position as math::XYZVector once
  • Using edm::Event::get() instead of going via edm::Handle
  • Consuming trajectory maps only if useTrajectory == True
  • Using edm::ESGetToken
  • Removing unnecessary member variables

PR validation:

Workflow 135.9 does not abort anymore (but it won't succeed either, the real fix is different but independent of this PR). Limited matrix runs.

The bare "throw" will lead to abort because there is no exception to
be thrown. On the other hand, the beamSpotHandle->position() will
throw an exception if the product is missing (with much clearer
message), so easiest fix is to just remove the check.
@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 2, 2020

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 2, 2020

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-30082/15817

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 2, 2020

A new Pull Request was created by @makortel (Matti Kortelainen) for master.

It involves the following packages:

RecoEgamma/EgammaPhotonProducers

@perrotta, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@Sam-Harper, @jainshilpi, @rovere, @lgray, @sobhatta, @lecriste, @afiqaize, @varuns23 this is something you requested to watch as well.
@silviodonato, @dpiparo you are the release manager for this.

cms-bot commands are listed here

@makortel
Copy link
Contributor Author

makortel commented Jun 2, 2020

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 2, 2020

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/6748/console Started: 2020/06/02 20:52

if (filterOnConvTrackHyp && !beamSpotHandle.isValid()) {
edm::LogError("Invalid Collection") << "invalid collection for the BeamSpot";
throw;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The beamspotHandle->position() on line 114/109 will throw an exception (with much clearer message) if the Handle is not valid.

(by the way, does

math::XYZVector beamSpot = math::XYZVector(beamSpotHandle->position());

really need to be repeated for each input track?)

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 2, 2020

+1
Tested at: 3919d03
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0aedd8/6748/summary.html
CMSSW: CMSSW_11_2_X_2020-06-02-1100
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 2, 2020

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 2, 2020

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0aedd8/6748/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 36
  • DQMHistoTests: Total histograms compared: 2783666
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2783615
  • DQMHistoTests: Total skipped: 50
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 35 files compared)
  • Checked 152 log files, 16 edm output root files, 36 DQM output files

@perrotta
Copy link
Contributor

perrotta commented Jun 3, 2020

May I suggest then to leave the LogError, without throwing? Perhaps, while adding to the report also the beamSpotInputTag, so that one can have a complete picture from the log about who's the caller, and which is the missing beamSpot? (By the way: what is the extra info conveyed by beamspotHandle->position()?)
Moreover, as you correctly pointed out, the beam spot doesn't need to be re-defined for every track: we can profit of this PR to take it out of the for loop, then.

@makortel
Copy link
Contributor Author

makortel commented Jun 3, 2020

May I suggest then to leave the LogError, without throwing? Perhaps, while adding to the report also the beamSpotInputTag, so that one can have a complete picture from the log about who's the caller, and which is the missing beamSpot? (By the way: what is the extra info conveyed by beamspotHandle->position()?)

Why? If beamSpotHandle is not valid, beamSpotHandle->position() will throw the standard ProductNotFound exception that shows who tried to access which product.

@perrotta
Copy link
Contributor

perrotta commented Jun 5, 2020

@makortel : Ok about removing the LogError as a whole from the ConversionTrackProducer
Please let me know if you intend to profit of this PR to also move out of the for loop the access to the beamSpot, as you already suggested in #30082 (comment)

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 5, 2020

The code-checks are being triggered in jenkins.

@makortel makortel changed the title Remove redundant product validity check from ConversionTrackProducer Remove redundant product validity check from ConversionTrackProducer and modernize it Jun 5, 2020
@makortel
Copy link
Contributor Author

makortel commented Jun 5, 2020

@perrotta Done, I could not resists on doing a bit more modernization on the same go. I hope it is fine.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 5, 2020

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-30082/15900

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 5, 2020

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

@makortel
Copy link
Contributor Author

makortel commented Jun 5, 2020

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 5, 2020

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/6844/console Started: 2020/06/05 20:54

@perrotta
Copy link
Contributor

perrotta commented Jun 5, 2020

@perrotta Done, I could not resists on doing a bit more modernization on the same go. I hope it is fine.

Great! Thank you @makortel

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 5, 2020

+1
Tested at: b1c35dd
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0aedd8/6844/summary.html
CMSSW: CMSSW_11_2_X_2020-06-05-1100
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 5, 2020

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 5, 2020

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0aedd8/6844/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 36
  • DQMHistoTests: Total histograms compared: 2780497
  • DQMHistoTests: Total failures: 48
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2780399
  • DQMHistoTests: Total skipped: 50
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 35 files compared)
  • Checked 152 log files, 16 edm output root files, 36 DQM output files

@perrotta
Copy link
Contributor

perrotta commented Jun 6, 2020

+1

  • Technical
  • Jenkins tests pass

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 6, 2020

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)

@silviodonato
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 4461193 into cms-sw:master Jun 6, 2020
@makortel makortel deleted the throwConversionTrackProducer branch June 6, 2020 23:47
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

4 participants