detectors Module

Module contains each detector type which inherits from the base detector class. detectors detect photon packets colliding with the detectors.



Interfaces

public interface annulus_dect

  • private function init_annulus_dect(pos, dir, layer, r1, r2, nbins, maxval, trackHistory) result(out)

    Initalise Annular detector

    Arguments

    Type IntentOptional Attributes Name
    type(vector), intent(in) :: pos

    Centre of detector

    type(vector), intent(in) :: dir

    Normal of the detector

    integer, intent(in) :: layer

    Layer ID

    real(kind=wp), intent(in) :: r1

    Inner radius

    real(kind=wp), intent(in) :: r2

    Outer radius

    integer, intent(in) :: nbins

    Number of bins in the detector

    real(kind=wp), intent(in) :: maxval

    Maximum value to store in bins

    logical, intent(in) :: trackHistory

    Boolean on if to store photon's history prior to hitting the detector.

    Return Value type(annulus_dect)

public interface camera

  • private function init_camera(p1, p2, p3, layer, nbins, maxval, trackHistory) result(out)

    Initalise Camera detector

    Arguments

    Type IntentOptional Attributes Name
    type(vector), intent(in) :: p1

    Position of the 1st corner of the detector

    type(vector), intent(in) :: p2

    Distance from p1 to the 2nd corner

    type(vector), intent(in) :: p3

    Distance from p1 to the 3rd corner

    integer, intent(in) :: layer

    Layer ID

    integer, intent(in) :: nbins

    Number of bins in the detector

    real(kind=wp), intent(in) :: maxval

    Maximum value to store in bins

    logical, intent(in) :: trackHistory

    Boolean on if to store photon's history prior to hitting the detector.

    Return Value type(camera)

public interface circle_dect

  • private function init_circle_dect(pos, dir, layer, radius, nbins, maxval, trackHistory) result(out)

    Initalise Circle detector

    Arguments

    Type IntentOptional Attributes Name
    type(vector), intent(in) :: pos

    Centre of detector

    type(vector), intent(in) :: dir

    Normal of the detector

    integer, intent(in) :: layer

    Layer ID

    real(kind=wp), intent(in) :: radius

    Radius of the detector

    integer, intent(in) :: nbins

    Number of bins in the detector

    real(kind=wp), intent(in) :: maxval

    Maximum value to store in bins

    logical, intent(in) :: trackHistory

    Boolean on if to store photon's history prior to hitting the detector.

    Return Value type(circle_dect)


Derived Types

type, public, extends(detector1D) ::  annulus_dect

Annuluar detector

Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: bin_wid

Bin width

real(kind=wp), public, allocatable :: data(:)

Bins

type(vector), public :: dir

Surface normal of the detector

integer, public :: layer

Layer ID of the detector

integer, public :: nbins

Number of bins

type(vector), public :: pos

position of the detector

real(kind=wp), public :: r1

Inner radius

real(kind=wp), public :: r2

Outer radius

logical, public :: trackHistory

Boolean, if true store the history of the photon prior to detection.

Constructor

private function init_annulus_dect (pos, dir, layer, r1, r2, nbins, maxval, trackHistory)

Initalise Annular detector

Type-Bound Procedures

procedure, public :: check_hit => check_hit_annulus
procedure, public :: record_hit => record_hit_1D_sub

type, public, extends(detector2D) ::  camera

Rectangular or "camera" detector

Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: bin_wid_x

Bin width in the x dimension

real(kind=wp), public :: bin_wid_y

Bin width in the y dimension

real(kind=wp), public, allocatable :: data(:,:)

Bins

type(vector), public :: dir

Surface normal of the detector

type(vector), public :: e1

Edge vector of detector

type(vector), public :: e2

Edge vector of detector

real(kind=wp), public :: height

Height of the detector

integer, public :: layer

Layer ID of the detector

type(vector), public :: n

Normal of the detector

integer, public :: nbinsX

Number of bins in x dimension (detector space)

integer, public :: nbinsY

Number of bins in y dimension (detector space)

type(vector), public :: p2

Vector from pos (1st corner) to the 2nd corner of the detector

type(vector), public :: p3

Vector from pos (1st corner) to the 3rd corner of the detector

type(vector), public :: pos

position of the detector

logical, public :: trackHistory

Boolean, if true store the history of the photon prior to detection.

real(kind=wp), public :: width

Width of the detector

Constructor

private function init_camera (p1, p2, p3, layer, nbins, maxval, trackHistory)

Initalise Camera detector

Type-Bound Procedures

procedure, public :: check_hit => check_hit_camera
procedure, public :: record_hit => record_hit_2D_sub

type, public, extends(detector1D) ::  circle_dect

Circle detector

Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: bin_wid

Bin width

real(kind=wp), public, allocatable :: data(:)

Bins

type(vector), public :: dir

Surface normal of the detector

integer, public :: layer

Layer ID of the detector

integer, public :: nbins

Number of bins

type(vector), public :: pos

position of the detector

real(kind=wp), public :: radius

Radius of detector

logical, public :: trackHistory

Boolean, if true store the history of the photon prior to detection.

Constructor

private function init_circle_dect (pos, dir, layer, radius, nbins, maxval, trackHistory)

Initalise Circle detector

Type-Bound Procedures

procedure, public :: check_hit => check_hit_circle
procedure, public :: record_hit => record_hit_1D_sub

type, public ::  dect_array

Detector array

Components

Type Visibility Attributes Name Initial
class(detector), public, pointer :: p => null()

Functions

private function check_hit_annulus(this, hitpoint)

Check if a hitpoint is in the annulus

Arguments

Type IntentOptional Attributes Name
class(annulus_dect), intent(inout) :: this
type(hit_t), intent(in) :: hitpoint

Hitpoint to check

Return Value logical

private function check_hit_camera(this, hitpoint)

Check if a hitpoint is in the camera detector ref

Arguments

Type IntentOptional Attributes Name
class(camera), intent(inout) :: this
type(hit_t), intent(in) :: hitpoint

Hitpoint to check

Return Value logical

private function check_hit_circle(this, hitpoint)

Check if a hitpoint is in the circle

Arguments

Type IntentOptional Attributes Name
class(circle_dect), intent(inout) :: this
type(hit_t), intent(in) :: hitpoint

Hitpoint to check

Return Value logical

private function init_annulus_dect(pos, dir, layer, r1, r2, nbins, maxval, trackHistory) result(out)

Initalise Annular detector

Arguments

Type IntentOptional Attributes Name
type(vector), intent(in) :: pos

Centre of detector

type(vector), intent(in) :: dir

Normal of the detector

integer, intent(in) :: layer

Layer ID

real(kind=wp), intent(in) :: r1

Inner radius

real(kind=wp), intent(in) :: r2

Outer radius

integer, intent(in) :: nbins

Number of bins in the detector

real(kind=wp), intent(in) :: maxval

Maximum value to store in bins

logical, intent(in) :: trackHistory

Boolean on if to store photon's history prior to hitting the detector.

Return Value type(annulus_dect)

private function init_camera(p1, p2, p3, layer, nbins, maxval, trackHistory) result(out)

Initalise Camera detector

Arguments

Type IntentOptional Attributes Name
type(vector), intent(in) :: p1

Position of the 1st corner of the detector

type(vector), intent(in) :: p2

Distance from p1 to the 2nd corner

type(vector), intent(in) :: p3

Distance from p1 to the 3rd corner

integer, intent(in) :: layer

Layer ID

integer, intent(in) :: nbins

Number of bins in the detector

real(kind=wp), intent(in) :: maxval

Maximum value to store in bins

logical, intent(in) :: trackHistory

Boolean on if to store photon's history prior to hitting the detector.

Return Value type(camera)

private function init_circle_dect(pos, dir, layer, radius, nbins, maxval, trackHistory) result(out)

Initalise Circle detector

Arguments

Type IntentOptional Attributes Name
type(vector), intent(in) :: pos

Centre of detector

type(vector), intent(in) :: dir

Normal of the detector

integer, intent(in) :: layer

Layer ID

real(kind=wp), intent(in) :: radius

Radius of the detector

integer, intent(in) :: nbins

Number of bins in the detector

real(kind=wp), intent(in) :: maxval

Maximum value to store in bins

logical, intent(in) :: trackHistory

Boolean on if to store photon's history prior to hitting the detector.

Return Value type(circle_dect)