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

Add a script to generate material scan plots #757

Merged
merged 4 commits into from
Aug 8, 2024
Merged

Add a script to generate material scan plots #757

merged 4 commits into from
Aug 8, 2024

Conversation

Chao1009
Copy link
Contributor

Briefly, what does this PR introduce?

Add a script to plot the scan results from "bin/g4MaterialScan_to_csv"

What kind of change does this PR introduce?

  • Bug fix (issue #__)
  • New feature (issue #__)
  • Documentation update
  • Other: __

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No, it's a tool

Does this PR change default behavior?

No

@Chao1009 Chao1009 added the enhancement New feature or request label Jul 21, 2024
@Chao1009 Chao1009 requested a review from torrijeske July 21, 2024 00:58
@Chao1009 Chao1009 self-assigned this Jul 21, 2024
@github-actions github-actions bot added the topic: infrastructure Regarding build system, CI, CD label Jul 21, 2024
@Chao1009
Copy link
Contributor Author

Chao1009 commented Jul 21, 2024

Some use cases:
Generate material scan data:
>./bin/g4MaterialScan_to_csv -c $DETECTOR_PATH/epic_craterlake.xml --eta-values="-2.5,0.,2.5" --phi-values="0." --raw-output
By enabling the flag --raw-output, you will get multiple data tables with the file name "scan_raw_....csv".
Make the plots:
>./bin/g4MaterialScan_raw_plot scan_raw_eta\=0_phi\=0.csv --path-lengths="0, 80, 300"
>./bin/g4MaterialScan_raw_plot scan_raw_eta\=2.5_phi\=0.csv --path-lengths="0, 340, 600"
>./bin/g4MaterialScan_raw_plot scan_raw_eta\=-2.5_phi\=0.csv --path-lengths="0, 180, 600"
Here the number of path lengths defines the number of subplots (N-1), and the values will be used as the x ranges of the subplots. For example: "0, 80, 300" gives two subplots with path lengths within [0, 80] and [80, 300].

@Chao1009
Copy link
Contributor Author

Plot examples:
scan_raw_eta=0_phi=0
scan_raw_eta=2 5_phi=0
scan_raw_eta=-2 5_phi=0

@Chao1009
Copy link
Contributor Author

Chao1009 commented Jul 21, 2024

The next step would be adding annotations for detectors (path length ranges), and we will do it in a separate PR because it will be more complicated if we want to determine the ranges automatically and precisely. One can still manually add the annotations with the plots generated from the current scripts.
The PR is ready to be reviewed and then merged.

@Chao1009 Chao1009 changed the title Update scripts Add a script to generate material scan plots Jul 21, 2024
Copy link
Contributor

@torrijeske torrijeske left a comment

Choose a reason for hiding this comment

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

units on plot should be cm and not mm

@veprbl
Copy link
Member

veprbl commented Aug 7, 2024

Following discussion in VWG meeting today, let's merge.

@veprbl veprbl added this pull request to the merge queue Aug 7, 2024
Merged via the queue into main with commit 1677681 Aug 8, 2024
113 checks passed
@veprbl veprbl deleted the update_scripts branch August 8, 2024 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request topic: infrastructure Regarding build system, CI, CD
Projects
Development

Successfully merging this pull request may close these issues.

3 participants