Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/assets/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/geometry/blank_project.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/geometry/boolean_zone_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/geometry/collimator_air_zone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/geometry/collimator_zone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/geometry/custom_opacity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/geometry/cylinders.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/geometry/duplicate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/geometry/duplicated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/geometry/edit_project_info.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/geometry/examples.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/geometry/figures_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/geometry/geometry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/assets/geometry/geometry_example1.png
Binary file not shown.
Binary file removed docs/assets/geometry/image-1.png
Binary file not shown.
Binary file removed docs/assets/geometry/image-10.png
Binary file not shown.
Binary file removed docs/assets/geometry/image-11.png
Binary file not shown.
Binary file removed docs/assets/geometry/image-12.png
Binary file not shown.
Binary file removed docs/assets/geometry/image-13.png
Binary file not shown.
Binary file removed docs/assets/geometry/image-14.png
Binary file not shown.
Binary file removed docs/assets/geometry/image-15.png
Binary file not shown.
Binary file removed docs/assets/geometry/image-16.png
Binary file not shown.
Binary file removed docs/assets/geometry/image-17.png
Binary file not shown.
Binary file removed docs/assets/geometry/image-18.png
Binary file not shown.
Binary file removed docs/assets/geometry/image-19.png
Binary file not shown.
Binary file removed docs/assets/geometry/image-2.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-20.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-21.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-22.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-23.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-24.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-3.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-4.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-5.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-6.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-7.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-8.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-9.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-desc1.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-desc2.png
Diff not rendered.
Binary file removed docs/assets/geometry/image-title1.png
Diff not rendered.
Binary file removed docs/assets/geometry/image.png
Diff not rendered.
Binary file added docs/assets/geometry/load_project_alert.png
Binary file added docs/assets/geometry/menu_boolean_zone_add.png
Binary file added docs/assets/geometry/menu_object_add.png
Binary file added docs/assets/geometry/new_project_alert.png
Binary file added docs/assets/geometry/object_details.png
Binary file added docs/assets/geometry/phantom_box.png
Binary file added docs/assets/geometry/phantom_zone.png
Binary file added docs/assets/geometry/project_info.png
Binary file added docs/assets/geometry/select_simulator.gif
Binary file added docs/assets/geometry/zone_operations.gif
Binary file added docs/assets/geometry/zone_vis.png
Binary file removed docs/assets/image.png
Diff not rendered.
71 changes: 71 additions & 0 deletions docs/assets/logo.svg
Binary file added docs/assets/running/batch_run.png
Binary file added docs/assets/running/batch_run_queue.png
Binary file added docs/assets/running/collimator_results.png
Binary file added docs/assets/running/direct_run.png
Binary file added docs/assets/running/direct_run_pending.png
Binary file added docs/assets/running/direct_run_queue.png
Binary file added docs/assets/running/direct_run_running.png
Binary file added docs/assets/running/export_csv.png
Binary file added docs/assets/running/finished_results.png
Binary file removed docs/assets/running/image-1.png
Diff not rendered.
Binary file removed docs/assets/running/image-10.png
Diff not rendered.
Binary file removed docs/assets/running/image-11.png
Diff not rendered.
Binary file removed docs/assets/running/image-12.png
Diff not rendered.
Binary file removed docs/assets/running/image-13.png
Diff not rendered.
Binary file removed docs/assets/running/image-14.png
Diff not rendered.
Binary file removed docs/assets/running/image-15.png
Diff not rendered.
Binary file removed docs/assets/running/image-16.png
Diff not rendered.
Binary file removed docs/assets/running/image-17.png
Diff not rendered.
Binary file removed docs/assets/running/image-18.png
Diff not rendered.
Binary file removed docs/assets/running/image-19.png
Diff not rendered.
Binary file removed docs/assets/running/image-2.png
Diff not rendered.
Binary file removed docs/assets/running/image-20.png
Diff not rendered.
Binary file removed docs/assets/running/image-22.png
Diff not rendered.
Binary file removed docs/assets/running/image-23.png
Diff not rendered.
Binary file removed docs/assets/running/image-3.png
Diff not rendered.
Binary file removed docs/assets/running/image-4.png
Diff not rendered.
Binary file removed docs/assets/running/image-5.png
Diff not rendered.
Binary file removed docs/assets/running/image-6.png
Diff not rendered.
Binary file removed docs/assets/running/image-7.png
Diff not rendered.
Binary file removed docs/assets/running/image-8.png
Diff not rendered.
Binary file removed docs/assets/running/image-9.png
Diff not rendered.
Binary file removed docs/assets/running/image.png
Diff not rendered.
Binary file added docs/assets/running/plot_settings.gif
Binary file added docs/assets/running/profiles.gif
Binary file added docs/assets/running/simulation_set_up.png
Binary file added docs/assets/running/simulations_page.png
Binary file added docs/assets/running/zoom_selected.png
Binary file added docs/assets/running/zoomed.png
Binary file added docs/assets/scoring/apply_filter.png
Binary file added docs/assets/scoring/default_quantity.png
Binary file added docs/assets/scoring/detector_add.png
Binary file added docs/assets/scoring/detector_details.png
Binary file added docs/assets/scoring/detector_details_slabyz.png
Binary file removed docs/assets/scoring/image-1.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-10.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-11.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-12.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-13.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-14.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-15.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-16.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-2.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-3.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-4.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-5.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-6.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-7.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-8.png
Diff not rendered.
Binary file removed docs/assets/scoring/image-9.png
Diff not rendered.
Binary file removed docs/assets/scoring/image.png
Diff not rendered.
Binary file added docs/assets/scoring/menu_detector_add.png
Binary file added docs/assets/scoring/output_added.png
Binary file added docs/assets/scoring/output_details.png
Binary file added docs/assets/scoring/output_details_yzslab.png
Binary file added docs/assets/scoring/protons_rule_a_eq_1.png
Binary file added docs/assets/scoring/protons_rule_z_eq_1.png
Binary file added docs/assets/scoring/quantity_fluence.png
Binary file added docs/assets/scoring/scoring_tab.png
Binary file added docs/assets/settings/beam_adjustments.png
Binary file added docs/assets/settings/beam_settings.png
Binary file removed docs/assets/settings/image-1.png
Diff not rendered.
Binary file removed docs/assets/settings/image-2.png
Diff not rendered.
Binary file removed docs/assets/settings/image.png
Diff not rendered.
Binary file added docs/assets/settings/physics_settings.png
Binary file added docs/assets/simulations.png
208 changes: 98 additions & 110 deletions docs/geometry.md
Original file line number Diff line number Diff line change
@@ -1,192 +1,180 @@
# Geometry
# Defining detector geometry

The geometry is composed of the following elements:
![Geometry Page](assets/geometry/geometry.png)

* list of abstract figures (boxes, cylinders, spheres, etc.). The figures are defined by their position and size and has no material assigned to them.
* list of zones. The zones are defined by the boolean operations on the abstract figures and have assigned material.
Geometry definition varies between different types of simulation software. For simulators using Constructive Solid Geometry (CSG) - FLUKA and SHIELDHIT-12A,
shapes are defined by set of primitive Figures (boxes, cylinders, spheres) joined together by boolean operators. The order of operators to apply is defined
within a Zone.

An example geometry is shown below:
For simulators using nested geometry, like Geant4, primitive shapes are defined in a tree-like structure, and all properties are set directly on the Figures.

![Alt text](assets/geometry/geometry_example1.png)
## Starting a new project

In following sections we will go through generation of simple geometry. It will consist of:
### Blank Project

* water phantom box
* lead collimator with 2cm radius hole and 1cm thickness
* world filled with air
To start assembling the simulation geometry, you can either create a blank project or use an existing one as a base.

To create a new blank project, click Project > New.

## Creating new project
![Blank project](assets/geometry/blank_project.png)

Let us go through the process of defining simple simulation geometry.
The starting point would be a modification of existing project or creation of a new one.
Let us start with a new project as this will be good opportunity to introduce most of the Yaptide features.
It can be done using "New" button in the upper left part of the Editor window (select Editor in left menu).
You will be prompted that this operation will overwrite the current project. Save your previous work if you want to keep it.

![Alt text](assets/geometry/image.png){: style="height:150px"}
![New project alert](assets/geometry/new_project_alert.png)

You will be prompted that this operation will overwrite the current project. Save your previous work if you want to keep it.
Next, you will be asked to provide a project title, and, optionally, project description. Click `SAVE` to close the modal and enter the editor.

![Title and description](assets/geometry/project_info.png)

For blank project, you can select which simulator you want to use by clicking the dropdown in the header bar.

![Alt text](assets/geometry/image-1.png)
![Simulator Dropdown](assets/geometry/select_simulator.gif)

New project can get a name and description. The name can be adjusted by double click the title panel in the Editor window.
> [!NOTE]
> The COMMON option represents the set of features supported by both FLUKA and SHIELDHIT-12A. You can switch from COMMON
> to either of these simulators.

![Alt text](assets/geometry/image-title1.png)
> [!NOTE]
> You can modify the title and description by clicking the title in the header bar.
>
> ![Edit project info](assets/geometry/edit_project_info.gif)

another way is the right click on the project name in the title menu and choosing "Rename" option.
### Example project

![Alt text](assets/geometry/image-desc1.png)
Navigate to Examples page. The available examples are grouped by the simulation software they were created with.
With the exception of COMMON, they will only work with that simulator.

This way the description can be adjusted as well:
![Select example](assets/geometry/examples.png)

![Alt text](assets/geometry/image-desc2.png)
Next, you will get similar Alert as when creating blank project. After confirmation, you are presented with editor page.

![Load project alert](assets/geometry/load_project_alert.png)

The title and description come from the example, you can modify them by clicking the title in header bar.

## Adding figures

### Main box
In the following sections we will go through generation of simple geometry. It will consist of:

- water phantom box
- lead collimator with 2cm radius hole and 1cm thickness
- world filled with air

### World filled with air

Lets start with adding a box filled with air with dimensions large enough to fit the other object we would like to simulate.
There are two ways to add a box, either from upper left menu in the Editor tab or by going to Geometry tab in right menu and expanding "Figures" block. Both entries are in the "Editor" window.
There are two ways to add a box, either selecting `Object > Box` in Menu Bar, or clicking `+ BOX` in FIGURES section in GEOMETRY tab.

![Add Figure from Object Menu](assets/geometry/menu_object_add.png)

![Alt text](assets/geometry/image-2.png)
![Alt text](assets/geometry/image-3.png)
![Add Figure from FIGURES section](assets/geometry/figures_add.png)

Lets create a box spanning from -2 to 10 in z direction and from -5 to 5 in x and y direction.
In the yaptide we need to provide box center (named "Position") and its dimensions (named "X/Y/Z side").
We do this by providing box center (named "Position") and its dimensions (named "X/Y/Z side").
In our case the position will be (4,0,0) and dimensions 12cm x 10cm x 10cm.
Note that basic dimensions units in yaptide are centimeters.
Leta also assign a meaningful name to the created figure.
Note that basic dimensions units in YAPTIDE are centimeters.
Let's also assign a meaningful name to the created figure.

![Alt text](assets/geometry/image-4.png)
![Object details](assets/geometry/object_details.png)

The figure is created and its cross-sections in YX, XZ and ZY planes visible in the 3 windows in the center of the screen.
The 3-D projection is visible as well.

### Large phantom

Then lets proceed with adding a box which will represend a water phantom in which the simulated beam will stop.
Let's now add a box which will represent a water phantom in which the simulated beam will stop.
This box will be placed inside the world box and will be 8cm x 8cm x 8cm in size.
We are going to place it at (4,0,0) position as well.
The dimensions are given in such way that the water phantom is fully contained in the world box.

This time we will use a different technique of adding a figure: we will duplicate the WorldBox and modify the dimensions.
Such action can be achieved by right click on the WorldBox entry visible in the "Figures" section of the Geometry tab in right menu.
This time we're going to demonstrate how to duplicate existing figure, and then modify its dimensions.
Right-click on the WorldBox entry visible in the FIGURES section and click Duplicate.

![Alt text](assets/geometry/image-5.png)
![Duplicate WorldBox](assets/geometry/duplicate.png)

The newly created figure will inherit the name from the duplicated object. An `_1` suffix will be added to the name to keep all the names unique.
All other properties (like position and dimensions) will be copied as well.

![Alt text](assets/geometry/image-6.png)
![Duplicated WorldBox](assets/geometry/duplicated.png)

Now lets adjust the dimensions of the newly created figure to 8cm x 8cm x 8cm, as the position can stay the same.
Also the name needs an update to `PhantomBox`.
Note that the two figures are visible in the 3-D projection window, while only current one is visible in the cross-sections.

![Alt text](assets/geometry/image-7.png)
![PhantomBox](assets/geometry/phantom_box.png)

### Collimator

Finally lets add two cylinders represending outer envelope and inner hole inside the collimator.
The cylinders have thickness of 1cm and are radius of 4 and 2 cm appropriately.
Finally lets add two cylinders representing outer envelope and inner hole inside the collimator.
The cylinders have thickness of 1cm and are radius of 4 and 2 cm respectively.
Both are centered around (0,0,0) point.
You can use drag operation by clicking and dragging on the 3-D projection view. This would help to adjust the view, so the collimator is visible.

![Alt text](assets/geometry/image-8.png)
![Cylinders](assets/geometry/cylinders.png)

## Adding new zone

With all the basic figures defined we can use then to construct the zones which will be used in the simulation.
With the figures defined above, we can construct the zones which will be used in the simulation.
Here we follow the naming of SHIELD-HIT12A, as Fluka calls the zones "regions".

Lets start with adding the zone which will represent the large box willed with air.
This can be done in a similar way as adding the figures, either from upper left menu in the Editor tab or by going to Geometry tab in right menu and expanding "Zones" block. Both entries are in the "Editor" window.
Note that by defaul an automatically created "World Zone" is visible.

![Alt text](assets/geometry/image-9.png)
![Alt text](assets/geometry/image-10.png)
Lets start with adding a zone which will represent the large box filled with air.
This can be done in a similar way as adding the figures, either from upper left menu in the Editor tab
or by going to Geometry tab in right menu and expanding ZONES section in GEOMETRY tab.

### Main zone

We start by defining first zone from the main box, assigning it the material: Air.
![Add Boolean Zone from Object Menu](assets/geometry/menu_boolean_zone_add.png)
![Add Boolean Zone from ZONES section](assets/geometry/boolean_zone_add.png)

After creating new Zone we should see a following entry in the right-menu.
New entry appears as well in the list of Zones.
The newly created zone named "Boolean Zone" has liquid water attached as a meterial by default.
Note that in "Zone Operations" we see "Not selected" message. This means that the zone has no figures attached.
> [!NOTE]
> A special "World Zone" which represents the whole simulation environment is defined by default, and can't be removed.

![Alt text](assets/geometry/image-11.png)
### Air zones

Lets attach the correct figure to the zone by clicking on the "Not selected" message and choosing the "WorldBox" figure.
Zones describe a volume of space by combining multiple figures using boolean operations to define shape,
and define physical material that the volume is made of.

![Alt text](assets/geometry/image-12.png)
> [!IMPORTANT]
> Defining zone operations requires special considerations. Each point in space should belong to exactly
> one Zone so that it is clear for the simulator which material the particle is going through.
> This means that the volume enclosing another volume with different material needs to have a cutout that will fit the inner volume.

Then lets rename the zone to "MainZone" and assign the material to it.
The material can be selected from the list of materials in the "Simulation" menu ("Material" area).
After selecting the list of materials you can type few letters ("ai" in our case) and list of materials containing the typed letters will be shown.
Let's expand ZONE OPERATIONS and define the MainAirZone and CollimatorAirZone.
Together they represent the air that fills the empty space around the phantom and the collimator.
To get precisely the air volume, we need to subtract both the phantom and the collimator.
- For the phantom, it only requires subtracting the phantom figure.
- For the collimator, we need to subtract the whole outer cylinder, and add back the inner cylinder. The "adding back"
is performed with second zone.

![Alt text](assets/geometry/image-13.png)

To improve visual properties we adjust the color and set opacity to 0.05:
![Alt text](assets/geometry/image-14.png)

### Water phantom zone
Defining the MainAirZone is shown below:

Then we proceed with adding the water phantom zone. Lets add new zone and assign the "PhantomBox" as the figure.
We rename the zone to "PhantomZone". There is no need to assign the material as we stay with defaul "Liquid Water" material.
![Defining zone operations for MainZone](assets/geometry/zone_operations.gif)

![Alt text](assets/geometry/image-15.png)
CollimatorAirZone is then simply:

We change the color and inspect the zone in the 3-D projection window.
![Collimator air zone](assets/geometry/collimator_air_zone.png)

![Alt text](assets/geometry/image-16.png)
Zones are visualized in the 3D view by solid colors. We can see the cutouts for the phantom and the collimator.

There is a caveat with defining the zones by boolean operations. Each point in the space needs to belong to exactly one zone.
This ensures that each point has exactly one material assigned to it.
Currently the interior of the phantom box belongs to both zones: "MainZone" and "PhantomZone". Its unclear which material should be assigned to it: air or water.
Therefore we modify the "MainZone" by subtracting the "PhantomBox" from it.
This is done by selecting "MainZone" on list of zones and choosing "Subtract" operations:
![Zone in 3D view](assets/geometry/zone_vis.png)

![Alt text](assets/geometry/image-17.png)
> [!NOTE]
> To better see what's inside the zone, you can set the Opacity under MATERIAL section.
> ![Custom opacity](assets/geometry/custom_opacity.png)

Then the "Not selected field" appears

![Alt text](assets/geometry/image-18.png)

We choose "PhantomBox" figure there:
### Water phantom zone

![Alt text](assets/geometry/image-19.png)
We repeat the same thing for water phantom zone. Let's add new zone and assign the "PhantomBox" as the figure.
There is no need to assign the material as we stay with default "Liquid Water" material.

Finally the zone operations for "MainZone" are updated:
Under the MATERIAL section, instead of Opacity, we change the color and inspect the zone in the 3D view.

![Alt text](assets/geometry/image-20.png)
![Phantom Zone](assets/geometry/phantom_zone.png)

### Collimator zone

We are going to define the collimator zone now.
The collimator is a large cylinder (represented by `OuterCylinder` figure with radius 4cm) with a hole inside (represented by `InnerCylinder` figure, radius 2cm)

The zone is created by attaching `OuterCylinder` figure and subtracting `InnerCylinder` from it.
We select `Lead` material for the zone.

![Alt text](assets/geometry/image-21.png)

This time again the `MainZone` needs to be updated as the collimator zone is inside it.
First we subtract the `OuterCylinder` from the `MainZone`:

![Alt text](assets/geometry/image-22.png)

Lets note that after this operation the `InnerCylinder` doesn't have a material assigned, it shoult be filled with air.
This can be done by adding a separate zone and assigning the `InnerCylinder` to it.

### Air inside collimator

We add a new zone and assign the `InnerCylinder` to it.

![Alt text](assets/geometry/image-23.png)

No other zones needs to be modified.
The collimator is a lead ring that is created by subtracting inner cylinder from outer cylinder.
We name the zone appropriately and set the material.

Finally our geometry is complete:
![Collimator Zone](assets/geometry/collimator_zone.png)

![Alt text](assets/geometry/image-24.png)
These are the basic steps for defining geometry for CSG-based simulators.
Loading