camera Derived Type

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

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)


Type-Bound Procedures

procedure, public :: check_hit => check_hit_camera

  • 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

procedure, public :: record_hit => record_hit_2D_sub

  • private subroutine record_hit_2D_sub(this, hitpoint, history)

    check if a hit is on the detector and record it if so

    Arguments

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

    Interaction information

    type(history_stack_t), intent(inout) :: history

    Photon packet history

Source Code

    type, extends(detector2D) :: camera
        !> Normal of the detector
        type(vector)  :: n
        !> Vector from pos (1st corner) to the 2nd corner of the detector
        type(vector)  :: p2
        !> Vector from pos (1st corner) to the 3rd corner of the detector
        type(vector)  :: p3
        !> Edge vector of detector
        type(vector)  :: e1
        !> Edge vector of detector
        type(vector)  :: e2
        !> Width of the detector
        real(kind=wp) :: width
        !> Height of the detector
        real(kind=wp) :: height
        contains
        procedure :: check_hit => check_hit_camera
    end type camera