npac_detector.detector ====================== .. py:module:: npac_detector.detector Classes ------- .. autoapisummary:: npac_detector.detector.Surface npac_detector.detector.Detector Functions --------- .. autoapisummary:: npac_detector.detector.to_json npac_detector.detector.from_json npac_detector.detector.uncertainty_hits Module Contents --------------- .. py:class:: Surface(position_z, thickness, material_slab, active_surface=True) Encapsulates the information on a surface of a detector. .. attribute:: position_z Surface positon in mm :type: float .. attribute:: thickness Thickness of the slab :type: float .. attribute:: material_slab slab of the surface :type: MaterialSlab .. attribute:: active_surface True if the surface is active, False if it's not :type: bool .. py:attribute:: position_z .. py:attribute:: material_slab .. py:attribute:: thickness .. py:attribute:: active_surface :value: True .. py:class:: Detector(surfaces: list[Surface]) Describes a detector .. attribute:: surfaces list of the surfaces within the detector :type: list[Surface] .. py:attribute:: surfaces .. py:method:: visualize() Allows to vizualize the detector sufraces with a plot .. py:function:: to_json(detector: Detector) -> str Converts a detector in json. :param detector: The detector you want to convert in json :type detector: Detector :return: json string of the detector .. py:function:: from_json(json_thing: str) -> Detector Converts a detector's json in the detector. :param json_thing: detector's json :type json_thing: str :return: The detector .. py:function:: uncertainty_hits(surface_a: Surface, surface_b: Surface, theta: float) -> float Computes the uncertainty induced by the scattering angle symmetry between two surfaces :param surface_a: Surface from which the particle is coming :param surface_b: Surface to which the particle is going :param angle: Incoming angle in rad :return: Uncertainty on x and y in mm