Open asalzburger opened 1 year ago
A few questions about the JSON output from flag_material_mapping.py
:
Is the file name only supposed to be a "prefix" to the atomic number so that the input could look like this?
python3 flag_material_mapping.py 5 30 "material-map-Z"
So then the program would create a continuation with the number for each material?
Is the tool just set up like a house of cards so that it just reads one material even if the range is changed? I'm wondering which parts of the program actually need to be changed.
What do the fields for each material in the JSON output represent and why are there multiple even though we seem to be fildering it to the interval [13.5, 14.] now?
"material": [
117.33113098144531,
546.8297119140625,
19.528640747070313,
7.202982425689697,
9.09579757717438e-05
],
"thickness": 4.2792558670043945
Also, when I run flag_material_mapping.py
I get an error messgage in the end. The JSON file is still produced, but is this unusual?
15:58:12 Sequencer INFO Processed 1000 events in 2.439059 s (wall clock)
15:58:12 Sequencer INFO Average time per event: 2.341397 ms/event
15:58:12 JsonMaterial VERBOSE Writing to file: /home/taleiko/builds/acts/Examples/Scripts/Python/material-map-Z14.json
*** Break *** segmentation violation
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0 0x00007f33fd8ea45a in __GI___wait4 (pid=23277, stat_loc=stat_loc
entry=0x7ffdd1ae0b78, options=options
entry=0, usage=usage
entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
#1 0x00007f33fd8ea41b in __GI___waitpid (pid=<optimised out>, stat_loc=stat_loc
entry=0x7ffdd1ae0b78, options=options
entry=0) at ./posix/waitpid.c:38
...
That's interesting- doesn't happen to me, can you make sure you run with one thread?
A few questions about the JSON output from
flag_material_mapping.py
:
- Is the file name only supposed to be a "prefix" to the atomic number so that the input could look like this?
That is correct, that's for bookkeeping.
python3 flag_material_mapping.py 5 30 "material-map-Z"
So then the program would create a continuation with the number for each material?
You need to find out first which materials you want to filter.
- Is the tool just set up like a house of cards so that it just reads one material even if the range is changed? I'm wondering which parts of the program actually need to be changed.
It reads all materials, but skips to record them if the do not follow the selection.
- What do the fields for each material in the JSON output represent and why are there multiple even though we seem to be fildering it to the interval [13.5, 14.] now?
"material": [ 117.33113098144531, 546.8297119140625, 19.528640747070313, 7.202982425689697, 9.09579757717438e-05 ], "thickness": 4.2792558670043945
The numbers are X0, L0, A, Z, rho - it seems though it didn't filter correctly, z should he within the range ... you recompiled, right?
Sorry, I think the output was from a different run. The filtering is working correctly.
Can you remind me of how I read the position of each bin? In the beginning of the JSON output it is said how many bins in each direction there are, but how do I read the position? In the material sections X0 is the amount of material, A and Z are related to the atoms and rho is resistivity, right? What is L0 again?
And yes, the crashes in flag_material_mapping.py
were because I forgot to recompile.
Can you remind me of how I read the position of each bin? In the beginning of the JSON output it is said how many bins in each direction there are, but how do I read the position? In the material sections X0 is the amount of material, A and Z are related to the atoms and rho is resistivity, right? What is L0 again?
Oh, the geometry information we need to provide in an extra way, the material files are compressed & hence do not store this information.
L0 is (different to X0 which is the radiation length) the nuclear interaction length, it's the same concept but for different type of reaction.
How is the thickness defined in the JSON files? I'm asking because as the radius increases, the total size of the segment pieces will increase and the pieces in the outer layers will be bigger than if the same pieces would be placed in another layer closer to the cylinder's center, Is there some kind of logic to this?
"material": [ 117.33113098144531, 546.8297119140625, 19.528640747070313, 7.202982425689697, 9.09579757717438e-05 ], "thickness": 4.2792558670043945
What is the starting inner radius for the layers of the cylinder?
Mika was also wondering how the angles change with layers when the layers. He asked about if the segment the angle points to changes with the layers. See the picture below that he drew. The question is related to what position a specific angle points to, since the same ray can point to a different position in another layer.
Also, what does "layer" refer to here? The way I set up flag_material_mapping.py
, each range is given to the function runMaterialMapping()
, but did I do something wrong there? All the files have the layer number 2 in the JSON files.
{
"Surfaces": {
"acts-geometry-hierarchy-map": {
"format-version": 0,
"value-identifier": "Material Surface Map"
},
"entries": [
{
"layer": 2,
"value": {
"material": {
"binUtility": {
"binningdata": [
{
"bins": 100,
"max": 400.0,
"min": -400.0,
"option": "open",
"type": "equidistant",
"value": "binZ"
},
{
"bins": 36,
"max": 3.1415927410125732,
"min": -3.1415927410125732,
"option": "closed",
"type": "equidistant",
"value": "binPhi"
}
]
},
How is the thickness defined in the JSON files? I'm asking because as the radius increases, the total size of the segment pieces will increase and the pieces in the outer layers will be bigger than if the same pieces would be placed in another layer closer to the cylinder's center, Is there some kind of logic to this?
"material": [ 117.33113098144531, 546.8297119140625, 19.528640747070313, 7.202982425689697, 9.09579757717438e-05 ], "thickness": 4.2792558670043945
That's a good point, I suppose we should scale the thickness in the outer layers such that the area (where the material was collected) stays constant.
What is the starting inner radius for the layers of the cylinder?
Mika was also wondering how the angles change with layers when the layers. He asked about if the segment the angle points to changes with the layers. See the picture below that he drew. The question is related to what position a specific angle points to, since the same ray can point to a different position in another layer.
See my comment before, I would start at the record radius and scale - there will be another projection effect, but probably we should just put the thicknest layers first?
Also, what does "layer" refer to here? The way I set up
flag_material_mapping.py
, each range is given to the functionrunMaterialMapping()
, but did I do something wrong there? All the files have the layer number 2 in the JSON files.{ "Surfaces": { "acts-geometry-hierarchy-map": { "format-version": 0, "value-identifier": "Material Surface Map" }, "entries": [ { "layer": 2, "value": { "material": { "binUtility": { "binningdata": [ { "bins": 100, "max": 400.0, "min": -400.0, "option": "open", "type": "equidistant", "value": "binZ" }, { "bins": 36, "max": 3.1415927410125732, "min": -3.1415927410125732, "option": "closed", "type": "equidistant", "value": "binPhi" } ] },
This is layer no 2 - our only layer within this geometry.
It's time to close the loop now:
[x] Write a script that runs
flag_material_recording.py
, inspects the outputroot
file and records how many different materials we have (by inspecting thematZ
output from theGeant4
recording, this should give you some predefined ranges in Z (to avoid numerical instabilities and isotopes, it's best to use a small range around the actualZ
values[x] Update to the newest version of the branch to get the new functionality to restrict the mapping to certain
Z
ranges[x] Update the code in
flag_material_mapping.py
such that you can give theZ
range and the output file names as run arguments:This should be given through argumetns
[x] Write a script that runs the
flag_material_mapping.py
for each material once, and produce a dedicated file, i.e. you will get:material-map-Z14
,material-map-Z28
, whatever yourflag_material_recording.py
output provided you.[x] Try to relate the materials recorded in the different steps above to
G4_**
materials or ad hoc created ones inpy4geometry
, probably we need to build up a database of materials?[ ] Adapt your
pyg4ometry
such that it reads the produced.json
files, each of them representing one cylinder layer (equally segmented) and constructs a newGeant4
geometry with these segments.Validation:
flag_material_validation.py
on the individual material files, and stack the output histograms, they should add up to the histogram recorded without material restrictionmaterial_recording.py
from #8 and compare how much we are off to the original ODD Geant4 recordsConclusion: