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
Conversation
…values to change automatically when DD4hep changes its reference unit.
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-32538/20490
|
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. cms-bot commands are listed here |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-16034c/11790/summary.html DAS Queries failed Comparison SummarySummary:
|
@@ -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) |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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? :)
Pushed the comments :) |
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-32538/20632
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-32538/20633
|
Pull request #32538 was updated. @civanch, @Dr15Jones, @makortel, @cvuosalo, @ianna, @mdhildreth, @cmsbuild can you please check and sign again. |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-16034c/11950/summary.html Comparison SummarySummary:
|
+1 Carl's comments are addressed |
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) |
+1 |
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