-
Notifications
You must be signed in to change notification settings - Fork 8
Matter Element and MaterialP #79
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
base: main
Are you sure you want to change the base?
Changes from all commits
48fa10f
5c5112a
1e320d8
8ee25a9
549b360
112e061
1591fca
a0e1a05
1e31822
b59c43a
b2fbdb2
434cc16
c96aff8
ca877c4
1ee917e
65afa38
c21ae4f
a69ff45
ba4c56a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -214,26 +214,6 @@ Element parameter groups associated with this element kind are: | |||
| - [**MetaP**](#s:meta.params): Meta parameters. | ||||
| - [**ReferenceP**](#s:ref.params): Reference parameters. | ||||
|
|
||||
| %--------------------------------------------------------------------------------------------------- | ||||
| (s:foil)= | ||||
| ## Foil Element | ||||
|
|
||||
| Material that can strip electrons from a particle. | ||||
| Will also cause energy loss and diffusion. | ||||
|
|
||||
| Under Construction... | ||||
|
|
||||
| Element parameter groups associated with this element kind are: | ||||
| - [**ApertureP**](#s:aperture.params): Aperture parameters. | ||||
| - [**BodyShiftP**](#s:bodyshift.params): Orientation of element with respect to its nominal position. | ||||
| - [**FloorP**](#s:floor.params): Floor position and orientation. | ||||
| - [**MetaP**](#s:meta.params): Meta parameters. | ||||
| - [**ReferenceP**](#s:ref.params): Reference parameters. | ||||
| - [**ReferenceChangeP**](#s:ref.change.params): Reference energy change and/or reference time correction. | ||||
| - [**TrackingP**](#s:tracking.params): Tracking parameters. | ||||
|
|
||||
| The length of this element is considered to be zero so if `length` is specified, it must be zero. | ||||
|
|
||||
| %--------------------------------------------------------------------------------------------------- | ||||
| (s:fork)= | ||||
| ## Fork Element | ||||
|
|
@@ -358,6 +338,23 @@ Element parameter groups associated with this element kind are: | |||
|
|
||||
| The length of this element is considered to be zero so if `length` is specified, it must be zero. | ||||
|
|
||||
| %--------------------------------------------------------------------------------------------------- | ||||
| (s:matter)= | ||||
| ## Matter Element | ||||
|
|
||||
| Materials which fully occupy the beamline, like targets, (stripper-)foils, vacuum windows, gas cells or degraders. | ||||
| This element can cause energy-loss, angualar and energy straggling, as well as change of charge state or particle type. | ||||
|
|
||||
| Element parameter groups associated with this element kind are: | ||||
| - [**ApertureP**](#s:aperture.params): Aperture parameters of the outer (blocking) aperture. | ||||
| - [**BodyShiftP**](#s:bodyshift.params): Orientation of element with respect to its nominal position. | ||||
| - [**FloorP**](#s:floor.params): Floor position and orientation. | ||||
| - [**MetaP**](#s:meta.params): Meta parameters. | ||||
| - [**ReferenceP**](#s:ref.params): Reference parameters. | ||||
| - [**ReferenceChangeP**](#s:refchange.params): Reference energy change and/or reference time correction. | ||||
| - [**TrackingP**](#s:tracking.params): Tracking parameters. | ||||
| - [**MaterialP**](#s:material.params): Matter parameters. | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah here it is. Then just alphabetic ordering :)
Suggested change
I think you mean |
||||
|
|
||||
| %--------------------------------------------------------------------------------------------------- | ||||
| (s:multipole)= | ||||
| ## Multipole Element | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,7 @@ ApertureP: | |||||
| shape: "" # [string] Aperture shape switch | ||||||
| location: ENTRANCE_END # [enum] Aperture location switch | ||||||
| vertices: [] # [array] Array of vertex points. See below. | ||||||
| material: "" # [string] Material of the Aperture | ||||||
| material: "" # [MaterialP] Material of the Aperture | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since it is not a string anymore:
Suggested change
|
||||||
| thickness: 0 # [m] Real number | ||||||
| aperture_shifts_with_body: false # [Boolean] See below. | ||||||
| aperture_active: true # [Boolean] false implies aperture is not operating. | ||||||
|
|
@@ -106,7 +106,6 @@ The difference between the two lists is simply that lines 2 and 3 are switched a | |||||
| ### material | ||||||
|
|
||||||
| The `material` parameter sets the material of the aperture. | ||||||
| Using chemical formulas like `Cu` and `Fe` is the most portable. | ||||||
|
|
||||||
| ### vertices component | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,65 @@ | ||||||
| (s:material.params)= | ||||||
| ## MaterialP: Definition of materials | ||||||
ax3l marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| ```{code} yaml | ||||||
| MaterialP: | ||||||
| - state: # ["solid", "liquid", "gas"] | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's have all four states of matter for completeness? :)
Suggested change
|
||||||
| - material: # [CompoundP,ElementP] definiton of the material in terms of compounds or elements. | ||||||
| ``` | ||||||
|
|
||||||
| The definition of materials is inspired by Geant4's material handling. One can either use the name, which is the symbol of an element (`"Cu"`, `"H"`, ...) or compound (`"G4_STAINLESS-STEEL"`). | ||||||
| In the future all elements and materials in the [G4 Manual](https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Appendix/materialNames.html) will be supported, without the `G4_`-prefix for elements. | ||||||
|
|
||||||
| Alternatively custom elements can be defined by | ||||||
|
|
||||||
| ```{code} yaml | ||||||
| ElementP: | ||||||
| - name: # [string] The name of the material | ||||||
| - density: # [kg/m^3] The density of the material | ||||||
| - Z: # [int] The atomic number | ||||||
| - A: # [int] The mass number (equals Z+N) | ||||||
| - N: # [int] The neutron number | ||||||
| - m: # [u] The atomic mass | ||||||
|
Comment on lines
+18
to
+22
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not only use the name? Something like
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like using the (Material here describes more than what I linked)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will there be conflicts with # as begin-comment marker?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. We should be ok if we define it as a quoted string.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The non-# version is definitely easier to machine read, just more verbose to human write.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DavidSagan I have a very general question: Is the API which the translator exposes to the interface layer different from what is defined in the PALS standard? Is the PALS standard which we describe here only for the file?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. First there is the PALS schema which is language agnostic and defines things like parameter names and how to structure the information tree. Then there will be (in development) PALS standards for each language (YAML, etc.) that PALS lattice files can be written in that mirrors the schema. For the translators, what is exposed to the interface layer will be 1) the information in the lattice file and 2) what could be termed "lattice expansion" information which would be things like expression evaluation, floor coordinate evaluation, expanded beam lines, etc. And yes, what the schema describes is only for the file. The individual translators will document their API. We could talk about trying to have some uniformity between translators but remember the translators will be in different languages so it will not be possible to have a completely uniform API.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. It is sensible to try to mirror the PALS schema also in APIs, as much as possible/sensible, e.g., when defining properties/function/class names. Does not prevent to add on top additional helper functions, e.g., to transform, query, convert values between each other, etc. |
||||||
| ``` | ||||||
|
|
||||||
| and compounds by | ||||||
|
|
||||||
| ```{code} yaml | ||||||
| CompoundP: | ||||||
| - name: # [string] The name of the material | ||||||
| - density: # [kg/m^3] The density of the material | ||||||
| - elements: # List of MaterialP or CompoundP of which the compound consists | ||||||
| - ratio: # List of ratios of the elements | ||||||
| - mass_ratio: # List of mass-ratios of the elements | ||||||
| ``` | ||||||
|
|
||||||
| `ratio` describes the ratio in terms of atom/molecule count, while `mass_ratio` describes it int terms of mass fractions. | ||||||
| If density is not given it will be inferred form the densities and mass fractions of the elements. | ||||||
|
|
||||||
|
|
||||||
| ### Examples | ||||||
| `material: "Cu"` or `material: "G4_STAINLESS-STEEL"` or define a new material. | ||||||
|
|
||||||
| Liquid deuterium can be defined with the `ElementP` parameters: | ||||||
| ```{code} yaml | ||||||
| ElementP: | ||||||
| - name: "Deuterium(l)" | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "liquid" |
||||||
| - density: 160 | ||||||
| - Z: 1 | ||||||
| - A: 1 | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deuterium has A = 2.
Suggested change
|
||||||
| - m: 2.01 | ||||||
| ``` | ||||||
| and deuterated polyethylene (C2H4) can be defined based on the previous definition | ||||||
| ```{code} yaml | ||||||
| CompoundP: | ||||||
| - name: "deutPE" | ||||||
| - density: 1050 | ||||||
| - elements: | ||||||
| - "C" | ||||||
| - "Deuterium(l)" | ||||||
| - ratio: | ||||||
| - 2 | ||||||
| - 4 | ||||||
| ``` | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,10 @@ | ||||||||||
| (s:matter.params)= | ||||||||||
| ## MatterP: Definition of materials | ||||||||||
ax3l marked this conversation as resolved.
Show resolved
Hide resolved
ax3l marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| ```{code} yaml | ||||||||||
| MatterP: | ||||||||||
| - thickness: # [m] Thickness in meter | ||||||||||
| - area_density: # [kg/m^2] Density times thickness | ||||||||||
| - MaterialP: # [MatterP or name] the material | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Formatting:
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you mean:
Suggested change
Note that I also removed |
||||||||||
| ``` | ||||||||||
| Only one of the parameters `thickness` or `area_density` is required. | ||||||||||
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 assume adding the
MatterPparamter group is the whole idea of this element: