-
Notifications
You must be signed in to change notification settings - Fork 102
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
g4GraphicalScan.py: produce 2d scan of models, using g4 material description #1397
Conversation
Test Results 16 files 16 suites 5h 52m 14s ⏱️ Results for commit 850fb9a. ♻️ This comment has been updated with latest results. |
I think this tool can be useful for users: I'd be happy to have it included. |
Hi @danieljeans Thanks for this! Can you add an example figure of the output for further advertising and showing what the tool does? |
this produces a series of 2-d histograms in a requested slice of the detector (perpendicular to either the x, y, or z axis). the "top" plot is of the material density (in units of 1/x0): for each material it encounters, it also produces a histogram of its distribution: an estimate of the fraction of each bin that is occupied by the material: |
I find it useful for pretty plots for presentations, understanding what is in a model at both large and small scales, and debugging models. |
It looks very useful! Can you add the line to install the tool, like Lines 185 to 186 in 0aafe1c
|
If you change it all, please also add the header with the licence. CERN's legal office likes this.....
|
@andresailer thanks |
I am sorry, I am trying to use this tool but I can't manage to make it run, and also g4MaterialScan is now failing. |
The default executable of python changed to
|
nope, this is not working for me.
None of the three calls seem to be working. If instead I use the version installed on afs it works (but Daniel's tool is not there yet... that's why I wanted a local install!) |
thanks for the report. @aciarma there seems to be a problem with this IDEA model?
|
this error is not at all visible if you run g4GraphicalScan. ddsim just hangs, as does g4GraphicalScan. |
#1398 improves the robustness, and should not just hang if passed bad input. |
Hello, this keeps not working correctly for me, both g4MaterialScan and g4GraphicalScan either crash or produce empty histograms for different geometries.
|
hello @danieljeans , thank you very much for the reply! I am using nightlies 2025-02-13 (which should have the #1401 fix) but I still see something weird. It looks like the air from world volume is being averaged with the materials of the volumes inside it. This is clearly visible with the "beam" volume, where the material budget is 50% that of the air
Am I misinterpreting the plots? |
@aciarma I think this unexpected behaviour is arising because you're slicing at exactly z=0 to illustrate:
we see only air, no beampipe, coolant, gold, vacuum, ..., while shifting z by 1 micron
gives the expected structure
I guess there is somehow a very thin boundary at z=0 which gives rise to unexpected behaviour. Can you try slicing with a tiny offset in z? |
scanning horizontally at z=0 is weird in a different way
adding a tiny offset in z again fixes it. I cannot explain why the behaviour at z=0 is different when scanning in different directions... The plots show an average of the scans in X and Y. At z=0, the scans in y see only air, while the scans in x see somewhat more reasonable materials: hence the 50% air. |
Indeed, adding a small offset removes this behavior. I think this was also happening when using the non-CAD geometries because they are defined by symmetry from z=0. Thank you for the explanation and for the tool! |
BEGINRELEASENOTES
ENDRELEASENOTES