rat-pac / ratpac-two

Open source edition of RAT-PAC
Other
11 stars 23 forks source link

Add nested tube array geometry (optical fibers) #139

Open WilfS opened 2 months ago

WilfS commented 2 months ago

Optical fibers (such as wavelength shifting fibers) are not explicitly defined in ratpac, despite their prevalence in physics experiments. One could create such a fiber in ratpac by constructing several concentric tubes with relevant materials, but when simulating experiments with thousands of fibers this can lead to undesirably large geometry files.

To address this issue, this update will add the nested tube array geometry, that allows construction of an array of three concentric tubes (a core, an inner tube and an outer tube). The length, position, and direction of each nested tube can be set individually. Materials and radii are set for the whole array.

Validation has been performed to ensure the nested tube arrays are correctly placed in the geometry and have the same optical properties as concentric tubes manually placed in the geometry. A validation macro and geometry file have been added that demonstrate how the nested tube arrays are placed.

The rat DS has been updated to include nested tube array info such as direction, length and material. This is similar to the PMTInfo class.

No extra materials have been added that would be useful when using nested tube arrays as optical fibers. We hope to add this later when we have more accurate properties.

The documentation has been updated to include the nested tube array geometry.

JamesJieranShen commented 2 months ago

Argh.. please fix the formatting as well.

WilfS commented 2 months ago

Just pushed changes that are clang-formatted. Sorry, I missed that requirement.

WilfS commented 2 months ago

I've just added some commits relating to adding the ability to make the core of the nested tubes a sensitive detector. This is particularly useful when using the nested tubes as optical fibers. The hit information from the sensitive detector gets saved to the rat DS every event and can be accessed by processors.