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

Modernize HGCalTriggerGeometryESProducer #27242

Merged
merged 4 commits into from Jun 27, 2019

Conversation

makortel
Copy link
Contributor

@makortel makortel commented Jun 18, 2019

PR description:

In addition of using ESGetToken in HGCalTriggerGeometryESProducer (as part of #26748), this PR suggests to use raw pointers instead of ESHandle for the contained products in HGCalTriggerGeometryBase and derived classes.

This change does alter the behavior, as now the existence of the input products is always checked in the ESProducer (earlier it was checked at the first time when the HGCalTriggerGeometryBase or -derived class accessed the input products).

There is one caveat though. Currently the ESProducer tries to read CaloGeometry, and if either CaloGeometry is not available or does not have the expected content, the ESProducer reads 3 HGCalGeometry products. With the solution in this PR, all 4 objects would get produced in the (eventual) prefetching, which is not necessarily what we want. On the other hand, (based on my understanding of the code) memory-wise this issue would only affect HGCal < V9 geometries, but I don't know how relevant those workflows still are. In addition, in principle the phase2_hgcalV9 modifier could be used to control the behavior of this ESProducer. In addition, the ESProducer is modified to use the phase2_hgcalV9 modifier to control whether to read the CaloGeometry (for V7/V8 geometries) or 3 HGCalGeometry objects (V9 and beyond).

PR validation:

Code compiles.

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-27242/10436

  • This PR adds an extra 40KB to repository

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

L1Trigger/L1THGCal

@cmsbuild, @rekovic, @benkrikler, @kpedro88 can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @amarini, @jbsauvan, @lgray 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

const CaloGeometry* calo_geometry_ = nullptr;
const HGCalGeometry* hgc_ee_geometry_ = nullptr;
const HGCalGeometry* hgc_hsi_geometry_ = nullptr;
const HGCalGeometry* hgc_hsc_geometry_ = nullptr;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(repeating from the description) There is a slight change in behavior. Earlier, the existence of these products was checked by the isValid() or product() calls in above. This PR suggests to move those checks to the ESProducer. Is that ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks fine to me (actually, probably slightly better than the previous approach)

iRecord.getRecord<IdealGeometryRecord>().get("HGCalHEScintillatorSensitive", hsc_geometry);
geometry->initialize(ee_geometry, hsi_geometry, hsc_geometry);
geometry->initialize(
&iRecord.get(ee_geometry_token_), &iRecord.get(hsi_geometry_token_), &iRecord.get(hsc_geometry_token_));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(repeating from the description) With the eventual (naive) ES-product prefetching, this implementation would always load/produce the CaloGeometry and the 3 HGCalGeometry objects. In practice (based on the comments above) the HGCalGeometry objects would be "extra" only in case of V7/V8 HGCal geometries. Are the V7/V8 geometries still relevant?

I presume the configurations for HGCalGeometryESProducer instances are always in the configuration (since that is the recommended pattern). Is it ok to run them for V7/V8 geometries? (just thinking if the price is only some CPU time and memory, or if something weird could happen as well)

There is a phase2_hgcalV9 modifier. Would it be acceptable to use that to control the behavior of this ESProducer?

Copy link
Contributor

Choose a reason for hiding this comment

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

I plan to get rid of the workflows with the old geometries to address #26938 (hopefully this week), and then the code support for them will be gradually removed (#27095). In general, using the modifier is good practice to make it clear when the relevant access method should be employed.

Copy link
Contributor

Choose a reason for hiding this comment

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

this implementation would always load/produce the CaloGeometry and the 3 HGCalGeometry objects

Does it mean that the method

bool isV9Geometry() const { return !calo_geometry_; }

would always return false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this implementation would always load/produce the CaloGeometry and the 3 HGCalGeometry objects

Does it mean that the method

bool isV9Geometry() const { return !calo_geometry_; }

would always return false?

No, because in case of V7/V8 geometry only the calo_geometry_ member is set and thus the current behavior of HGCalTriggerGeometryBase is preserved. What I discussed in above was about how the production of the input ESProducts would change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kpedro88

In general, using the modifier is good practice to make it clear when the relevant access method should be employed.

I take this as a green light for using the modifier here. Do I interpret the modifier/era structure correctly that it is sufficient to use only phase2_hgcalV9, or should it be phase2_hgcalV9 | phase2_hgcalV10?

Copy link
Contributor

Choose a reason for hiding this comment

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

The workflows with HGCal V10 also include the V9 modifier to reduce duplication, so it's fine to use just the V9 one.

@makortel
Copy link
Contributor Author

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 18, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/1013/console Started: 2019/06/18 20:33

@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-e734f3/1013/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 33
  • DQMHistoTests: Total histograms compared: 3254096
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3253760
  • DQMHistoTests: Total skipped: 334
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 32 files compared)
  • Checked 137 log files, 14 edm output root files, 33 DQM output files

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@makortel
Copy link
Contributor Author

Following #27242 (comment) I modified the ESProducer to use the phase2_hgcalV9 modifier to dictate the behavior. I also removed an unnecessary call to HGCalTriggerGeometryBase::reset() right after the construction.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-27242/10479

  • This PR adds an extra 40KB to repository

@makortel
Copy link
Contributor Author

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 19, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/1061/console Started: 2019/06/19 17:53

@cmsbuild
Copy link
Contributor

Pull request #27242 was updated. @cmsbuild, @rekovic, @benkrikler, @kpedro88 can you please check and sign again.

@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-e734f3/1061/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 33
  • DQMHistoTests: Total histograms compared: 3254096
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3253760
  • DQMHistoTests: Total skipped: 334
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 32 files compared)
  • Checked 137 log files, 14 edm output root files, 33 DQM output files

@kpedro88
Copy link
Contributor

+upgrade

@fabiocos
Copy link
Contributor

@rekovic this PR is waiting since one week. Do you have any comment? Otherwise I will integrate it in one of the next IBs

@fabiocos
Copy link
Contributor

+1

@fabiocos
Copy link
Contributor

merge

@cmsbuild cmsbuild merged commit 6dfed1f into cms-sw:master Jun 27, 2019
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

5 participants