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

Make units dd4hep-dependent in PPS #32538

Merged
merged 4 commits into from Jan 6, 2021

Conversation

ghugo83
Copy link
Contributor

@ghugo83 ghugo83 commented Dec 18, 2020

Make units of values from XMLs dd4hep-dependent.
This will allow the values to change automatically, when DD4hep changes its reference unit.

@ianna @cvuosalo @civanch

…values to change automatically when DD4hep changes its reference unit.
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-32538/20490

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

Geometry/VeryForwardGeometryBuilder

@civanch, @Dr15Jones, @makortel, @cvuosalo, @ianna, @mdhildreth, @cmsbuild can you please review it and eventually sign? Thanks.
@forthommel, @jan-kaspar, @fabiocos 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

@civanch
Copy link
Contributor

civanch commented Dec 18, 2020

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-16034c/11790/summary.html
CMSSW: CMSSW_11_3_X_2020-12-17-2300/slc7_amd64_gcc900

DAS Queries failed

Comparison Summary

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: 2716967
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2716944
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 35 files compared)
  • Checked 153 log files, 37 edm output root files, 36 DQM output files

@@ -152,9 +152,7 @@ DiamondDimensions DetGeomDesc::computeDiamondDimensions(const bool isABox,
boxShapeParameters = {params.at(0), params.at(1), params.at(2)};
} else {
// convert cm (DD4hep) to mm (legacy expected by PPS reco software)
Copy link
Contributor

Choose a reason for hiding this comment

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

Comments on lines 50, 57, and 154 need to be updated. DD4hep units are not necessarily cm anymore.

 // Convert DD4hep units to mm (legacy expected by PPS reco software)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cvuosalo Same, sorry will quickly address the comment tonight when I am back to a computer

@@ -47,14 +47,14 @@ DetGeomDesc::DetGeomDesc(const cms::DDFilteredView& fv, const bool isRun2)
: m_name(computeNameWithNoNamespace(fv.name())),
m_copy(fv.copyNum()),
m_isDD4hep(true),
m_trans(geant_units::operators::convertCmToMm(fv.translation())), // converted from cm (DD4hep) to mm
m_trans(fv.translation() / dd4hep::mm), // converted from cm (DD4hep) to mm
m_rot(fv.rotation()),
m_params(computeParameters(fv)), // default unit from DD4hep (cm)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would convert m_params to mm right here (actually in computeParameters). Then all members of DetGeomDesc would be in Geant4 units. computeDiamondDimensions could then be simplified because the input units would be always mm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When old DD is removed, that case will disappear anyway.
In the meantime, I would not make old DD case depend on the DD4hep units, while the DD4hep case needs the /dd4hep::mm to have the certainty of getting mm regardless of the DD4hep internals.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ghugo83 I am saying the opposite. Make the interface consistent. For DetGeomDesc members and methods, all units should be mm. Right now, the params method (which is never used, as far as I can tell) and m_params store DD4hep units, while all the other members and methods use mm.
If m_params in the DD4hep version were converted to mm at initialization, then computeDiamondDimensions would expect mm only, and it could be simplified by the removal of the if.

Copy link
Contributor Author

@ghugo83 ghugo83 Jan 4, 2021

Choose a reason for hiding this comment

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

@cvuosalo Ha yes, I looked at it more properly, sorry I see what you mean now.
params() is used (from legacy) in CondTools/Geometry/plugins/PGeometricDetBuilder.cc to store PGeometricDet info to DB.
It is true that it would be easier to just convert all shape parameters to mm in a computeParameters function. The computeDiamondDimensions would just be a particular case of this, in the event that the shape is a box.

It is actually the version which I had at first.
But the thing is that it was implying a specific treatment for each possible shape, because we want to convert only the parameters which are lengths, and not all the parameters of the shape.
This was making the computeParameters() function quite heavy.
And in practice, as you noticed, only the box shape parameters are used anyway in the PPS legacy code.

Hence, after discussion with the PPS team, it was decided that the shape parameters are only treated in the case of a box, with the computeDiamondDimensions and getDiamondDimensions functions.
The params() function instead, which provides info to DB, is kept untouched, and just provides the shape parameters in their native format (units, but also orders of parameters).

Shall we want to simplify this, we could just remove params() function - but that would imply removing (useless) info stored in DB in legacy, hence changing the CondFormats objects, hence PPS team preferred keeping that params() function as-is, and just having a special treatment for boxes.

Does this make more sense? :)

@ghugo83
Copy link
Contributor Author

ghugo83 commented Dec 21, 2020

Pushed the comments :)

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 4, 2021

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-32538/20632

  • This PR adds an extra 20KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 4, 2021

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-32538/20633

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 4, 2021

Pull request #32538 was updated. @civanch, @Dr15Jones, @makortel, @cvuosalo, @ianna, @mdhildreth, @cmsbuild can you please check and sign again.

@civanch
Copy link
Contributor

civanch commented Jan 4, 2021

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 4, 2021

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-16034c/11950/summary.html
CMSSW: CMSSW_11_3_X_2021-01-04-1100/slc7_amd64_gcc900

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: 2716967
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2716944
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 36 files compared)
  • Checked 156 log files, 37 edm output root files, 37 DQM output files

@civanch
Copy link
Contributor

civanch commented Jan 5, 2021

+1

Carl's comments are addressed

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 5, 2021

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)

@qliphy
Copy link
Contributor

qliphy commented Jan 6, 2021

+1

@cmsbuild cmsbuild merged commit 40a52b9 into cms-sw:master Jan 6, 2021
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