npac_detector.detector

Classes

Surface

Encapsulates the information on a surface of a detector.

Detector

Describes a detector

Functions

to_json(→ str)

Converts a detector in json.

from_json(→ Detector)

Converts a detector's json in the detector.

uncertainty_hits(→ float)

Computes the uncertainty induced by the scattering angle symmetry between two surfaces

Module Contents

class npac_detector.detector.Surface(position_z, thickness, material_slab, active_surface=True)

Encapsulates the information on a surface of a detector.

position_z

Surface positon in mm

Type:

float

thickness

Thickness of the slab

Type:

float

material_slab

slab of the surface

Type:

MaterialSlab

active_surface

True if the surface is active, False if it’s not

Type:

bool

position_z
material_slab
thickness
active_surface = True
class npac_detector.detector.Detector(surfaces: list[Surface])

Describes a detector

surfaces

list of the surfaces within the detector

Type:

list[Surface]

surfaces
visualize()

Allows to vizualize the detector sufraces with a plot

npac_detector.detector.to_json(detector: Detector) str

Converts a detector in json.

Parameters:

detector (Detector) – The detector you want to convert in json

Returns:

json string of the detector

npac_detector.detector.from_json(json_thing: str) Detector

Converts a detector’s json in the detector.

Parameters:

json_thing (str) – detector’s json

Returns:

The detector

npac_detector.detector.uncertainty_hits(surface_a: Surface, surface_b: Surface, theta: float) float

Computes the uncertainty induced by the scattering angle symmetry between two surfaces

Parameters:
  • surface_a – Surface from which the particle is coming

  • surface_b – Surface to which the particle is going

  • angle – Incoming angle in rad

Returns:

Uncertainty on x and y in mm