detector_mod Module

Module contains photon detector abstract class and the derived types the inherit from it not fully implmented



Interfaces

public interface hit_t

  • private function hit_init(val)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in) :: val

    Return Value type(hit_t)


Abstract Interfaces

abstract interface

  • public function checkHitInterface(this, hitpoint)

    Arguments

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

    Return Value logical

abstract interface

  • public subroutine recordHitInterface(this, hitpoint, history)

    Arguments

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

Derived Types

type, public, abstract ::  detector

abstract detector

Components

Type Visibility Attributes Name Initial
type(vector), public :: dir

Surface normal of the detector

integer, public :: layer

Layer ID 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.

Type-Bound Procedures

procedure(checkHitInterface), public, deferred :: check_hit
procedure(recordHitInterface), public, deferred :: record_hit

type, public, abstract, extends(detector) ::  detector1D

1D detector type. Records linear information

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

logical, public :: trackHistory

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

Type-Bound Procedures

procedure(checkHitInterface), public, deferred :: check_hit
procedure, public :: record_hit => record_hit_1D_sub

type, public, abstract, extends(detector) ::  detector2D

2D detecctor type. Records spatial information

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

integer, public :: layer

Layer ID 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 :: pos

position of the detector

logical, public :: trackHistory

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

Type-Bound Procedures

procedure(checkHitInterface), public, deferred :: check_hit
procedure, public :: record_hit => record_hit_2D_sub

type, public ::  hit_t

Hit type, which records possible interaction information

Components

Type Visibility Attributes Name Initial
type(vector), public :: dir

Direction the photon came from

integer, public :: layer

Layer ID of interaction

type(vector), public :: pos

Poition of the interaction

real(kind=wp), public :: value

Value to deposit

Constructor

private function hit_init (val)

Functions

private function hit_init(val)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: val

Return Value type(hit_t)


Subroutines

private subroutine record_hit_1D_sub(this, hitpoint, history)

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

Arguments

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

Interaction information

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

Photon packet history

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