Fix computation of the radiation length and nuclear interaction lengt…#11060
Conversation
…h when ROOT uses G4 units
|
Can one of the admins verify this patch? |
|
Small AClick test to verify that radiation length and nuclear interaction length are computed correctly when ROOT uses in G4 units. To invoke: |
…h when ROOT uses G4 units
agheata
left a comment
There was a problem hiding this comment.
@MarkusFrankATcernch it looks like this fixes several inconsistencies from the previous implementation. I trust that you have thoroughly checked the ROOT/G4 cases. However, we should prevent future bugs in material calculations and backward incompatibilities. Can you please provide a test macro validating the properties for some materials/mixtures when changing units?
|
Would something like this be sufficient ? Whenever it would say "TEST FAILED" an error condition occurred. |
|
@MarkusFrankATcernch this looks quite good, but ideally, we need the macro to call both the "G4" and "ROOT" in the same session versions and compare them between each other, not only versus the PDG reference. Is it easy to do that? When this works properly, we merge this PR and add the macro as a separate PR, to be integrated with the CI/nightlies. We can do this next Monday when I'm back at work. |
|
@agheata Concerning the comparison: Clearly both tests must succeed. |
We can use 2 different TGeoManager, deleting in between, and caching the results in a struct.
AFAICT you only compare to PDG with some tolerance, but it is essential that the equality above is strict between TROOTMaterial == TGeant4Material |
|
Here you go!
|
|
OK @MarkusFrankATcernch looks good, LGTM and we can commit separately your macro in the test suite, but let's do this Monday to check how to integrate it properly. |
root-project#11060) * Fix computation of the radiation length and nuclear interaction length when ROOT uses G4 units * Fix computation of the radiation length and nuclear interaction length when ROOT uses G4 units (cherry picked from commit 103bb7e)
root-project#11060) * Fix computation of the radiation length and nuclear interaction length when ROOT uses G4 units * Fix computation of the radiation length and nuclear interaction length when ROOT uses G4 units (cherry picked from commit 103bb7e)
#11060) (#11103) * Fix computation of the radiation length and nuclear interaction length when ROOT uses G4 units * Fix computation of the radiation length and nuclear interaction length when ROOT uses G4 units (cherry picked from commit 103bb7e) Co-authored-by: MarkusFrankATcernch <[email protected]>
#11060) (#11104) * Fix computation of the radiation length and nuclear interaction length when ROOT uses G4 units * Fix computation of the radiation length and nuclear interaction length when ROOT uses G4 units (cherry picked from commit 103bb7e) Co-authored-by: MarkusFrankATcernch <[email protected]>
…h when ROOT uses G4 units
This Pull request:
The PR fixes the computation of the radiation length and nuclear interaction length
which are computed wrongly when ROOT uses in G4 units.
Changes or fixes:
All in TGeoMaterial.cpp
The fix is based on an initial pull request from Ivana:
#9401
which did miss the necessary changes for mixtures.
Output from constructing Iron from:
PDG (https://pdg.lbl.gov/2020/AtomicNuclearProperties/HTML/iron_Fe.html):
Checklist:
This PR fixes #