-
Notifications
You must be signed in to change notification settings - Fork 59
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
Configurability for material plots #392
base: main
Are you sure you want to change the base?
Conversation
0c8bf66
to
f2cd8da
Compare
b0f3ac7
to
62be7fa
Compare
Now can we have those changes on top of the original style 🤪 |
I am afraid that is not something I can do in 5 minutes ;) Should we format all python sources and make a PR that we can then ignore in blames? |
But something that reduces the amount of changes. Because #396 is going to be painful enough to merge. |
932d5b4
to
80d9cc4
Compare
00a42c8
to
b33bcda
Compare
Rebased this after #398 has been merged. Please check again that I didn't mess up in the process.
|
Thanks for checking. |
…angleDef option added to material_plots_2D.py
Co-authored-by: Thomas Madlener <[email protected]>
320b6ad
to
7104691
Compare
help="Compact detector file to use", | ||
type=str, | ||
default=fspath( | ||
Path(environ["k4geo_DIR"]) / "ILD" / "compact" / "ILD_sl5_v02" / "ILD_l5_v02.xml" |
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.
This technically changes the default geometry from IDEA_o1_v02.xml
to an ILD geometry. However, it also looks like the previous version didn't work without editing the file?
Technically this should be a positional (required) argument, since the script can't do anything useful without it. However, at this point --compactFile
is also pretty much a convention for several scripts.
For me these changes are OK.
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 don't care which detector is the default as long as the path is absolute or relative to $K4GEO
or $k4geo_DIR
. Originally the path was relative and Daniel and I had trouble getting it to work. I think this should work out of the box without assuming a current working dir
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.
Originally which path was relative?
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.
The path to the IDEA_o1_v02.xml
compact file.
edit: I.e. the script only work if called in the directory where that file was, IIUC.
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.
Ahh, ok, the detector file was just hard coded. I guess the compactFile will accept relative or absolute paths.
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.
Yes, exactly. And yes, absolute and relative paths will work. It is directly passed to the GeoSvc.detectors
.
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 am OK with this. Anything else from your side @andresailer?
Thank you for the work @Victor-Schwan, it works fine for me! I think it would be nice to apply the same improvements to the 1D mat. budget scripts (in the same place) and update the scripts/check_material_budget.sh script accordingly. What do you think @andresailer @tmadlener ? |
In the long run, I think harmonizing all of these scripts would be a good idea. Whether we do it in this PR or in follow up PRs depends a bit on the availability of @Victor-Schwan. I the bash script does not work any longer at the moment, we should fix it. @armin-ilg do you have some estimates how long this runs, and whether we could put this into a CI workflow (maybe in a slightly slimmed down version)? |
I agree that it is a good idea to harmonize as much as possible. I'd prefer to do the harmonization in another PR. In principle, one could also turn the scripts in the scripts folder into python scripts to have the same |
On lxplus the plots take O(5) minutes (running all angle defs), so that could definitely go into a CI workflow |
BEGINRELEASENOTES
material_plots_2D.py
:angleDef
is a choice parameter +thetaRad
choice addedoutputDir
option addedmaterial_scan_2d.py
:compactFile
,outputFileBase
,angleDef
)outputDir
option addedENDRELEASENOTES