asalzburger / sms2023-flag

0 stars 1 forks source link

The final steps: closing the loop #10

Open asalzburger opened 1 year ago

asalzburger commented 1 year ago

It's time to close the loop now:

    # Restrict
    elementRange = [ 13.5 , 14.]
    materialMap = "material-map-Z14"

This should be given through argumetns

Validation:

Conclusion:

H4m5t3r commented 1 year ago

A few questions about the JSON output from flag_material_mapping.py:

H4m5t3r commented 1 year ago

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

...
asalzburger commented 1 year ago

That's interesting- doesn't happen to me, can you make sure you run with one thread?

asalzburger commented 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?

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?

H4m5t3r commented 1 year ago

Sorry, I think the output was from a different run. The filtering is working correctly.

H4m5t3r commented 1 year ago

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?

H4m5t3r commented 1 year ago

And yes, the crashes in flag_material_mapping.py were because I forgot to recompile.

asalzburger commented 1 year ago

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.

H4m5t3r commented 1 year ago

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
H4m5t3r commented 1 year ago

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.

IMG_20230815_103239

H4m5t3r commented 1 year ago

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"
                                }
                            ]
                        },
asalzburger commented 1 year ago

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.

asalzburger commented 1 year ago

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.

IMG_20230815_103239

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?

asalzburger commented 1 year ago

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"

                                }

                            ]

                        },

This is layer no 2 - our only layer within this geometry.