Check if a hitpoint is in the annulus
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(annulus_dect), | intent(inout) | :: | this | |||
type(hit_t), | intent(in) | :: | hitpoint |
Hitpoint to check |
logical function check_hit_annulus(this, hitpoint) !! Check if a hitpoint is in the annulus class(annulus_dect), intent(INOUT) :: this !> Hitpoint to check type(hit_t), intent(IN) :: hitpoint real(kind=wp) :: newpos check_hit_annulus = .false. if(this%layer /= hitpoint%layer)return newpos = sqrt((hitpoint%pos%x - this%pos%x)**2 + (hitpoint%pos%y - this%pos%y)**2 + (hitpoint%pos%z - this%pos%z)**2) if(newpos >= this%r1 .and. newpos <= this%r2)then check_hit_annulus = .true. end if end function check_hit_annulus