Module helixfit_hits_mod
module helixfit_hits_mod
! Uses
use precision_mod
use namelist_mod
use helixfit_common_mod
! Types
public type hit_type
public type hits_type
! Variables
integer, public, PARAMETER :: kMaxPlanes = 50
integer, public, PARAMETER :: kMaxHitsPerPlane = 20
! Subroutines and functions
private subroutine setHitsGeometry (hits, idir)
public subroutine getCellSizeZ (iplane, zmin, zmax)
private subroutine adjustPlaneMate (hits)
public subroutine findFGHits (fg, istream, idir, hits)
public subroutine findWinHits (iwindow, istream, idir, hits)
public subroutine clearHits (hits)
private subroutine addHit (hits, iplane, iwire, ifghit, idchit)
private subroutine point3toV3 (point, v3)
public subroutine printHits (hits)
private function V3mag (a)
end module helixfit_hits_mod
Description of Types
hit_type
public type hit_type
integer :: fgindex
index into FGresult%DChit() array
integer :: dctdcindex
index into DCTDC array
integer :: dcplane
DC plane number
integer :: dcwire
DC wire number
real (kind=R8) :: tdc
tdc data
real (kind=R8), dimension (3) :: wireCenter
uvz coordinates of wire center
real (kind=R8), dimension (3) :: wireDir
uvz wire direction unit vector
end type hit_type
data structure to store a single hit
hits_type
public type hits_type
real (kind=R8), dimension (kMaxPlanes) :: planeZ
geometry data
plane z coordinate
real (kind=R8), dimension (kMaxPlanes) :: foil1Z
entrance foil z coordinate
real (kind=R8), dimension (kMaxPlanes) :: foil2Z
exit foil z coordinate
real (kind=R8), dimension (kMaxPlanes,3) :: planeDir
plane measurement vector
real (kind=R8), dimension (kMaxPlanes,3) :: planeNorm
plane normal vector
integer, dimension (kMaxPlanes) :: planeMate
plane number of other plane in the same pair
integer :: numhits
hits data
total number of hits
integer, dimension (kMaxPlanes) :: nhits
number of hits per plane
type (hit_type), dimension (kMaxPlanes,kMaxHitsPerPlane) :: chits
cached hit data
integer, dimension (kMaxPlanes) :: mintdc
index of hit with the smallest tdc time
integer :: firstplane
first plane with hits
integer :: lastplane
last plane with hits
integer :: istep
if (lastplane>firstplane) = +1 else = -1
end type hits_type
data structure to store geometry and hits data
Description of Variables
kMaxPlanes
integer, public, PARAMETER :: kMaxPlanes = 50
maximum number of planes
kMaxHitsPerPlane
integer, public, PARAMETER :: kMaxHitsPerPlane = 20
maximum number of hits per plane
Description of Subroutines and Functions
setHitsGeometry
private subroutine setHitsGeometry (hits, idir)
type (hits_type), INTENT(inout) :: hits
integer, INTENT(in) :: idir
end subroutine setHitsGeometry
getCellSizeZ
public subroutine getCellSizeZ (iplane, zmin, zmax)
integer, INTENT(in) :: iplane
real (kind=R8), INTENT(out) :: zmin
real (kind=R8), INTENT(out) :: zmax
end subroutine getCellSizeZ
return cell limits in Z
adjustPlaneMate
private subroutine adjustPlaneMate (hits)
type (hits_type), INTENT(inout) :: hits
! Calls: die
end subroutine adjustPlaneMate
findFGHits
public subroutine findFGHits (fg, istream, idir, hits)
type (FGresult_type), INTENT(in) :: fg
first guess data
integer, INTENT(in) :: istream
use hits: -1 US only, +1 DS only, 0 all hits
integer, INTENT(in) :: idir
direction of fit: +1: US->DS, -1: DS->US
type (hits_type), INTENT(out) :: hits
! Calls: addHit, adjustPlaneMate, clearHits, setHitsGeometry
end subroutine findFGHits
findWinHits
public subroutine findWinHits (iwindow, istream, idir, hits)
integer, INTENT(in) :: iwindow
take hits from this window
integer, INTENT(in) :: istream
only use: -1: US hits, +1: DS hits, 0: all hits
integer, INTENT(in) :: idir
fit direction: -1: DS->US, +1: US->DS
type (hits_type), INTENT(out) :: hits
! Calls: addHit, adjustPlaneMate, clearHits, kerror2, setHitsGeometry
end subroutine findWinHits
clearHits
public subroutine clearHits (hits)
type (hits_type), INTENT(out) :: hits
end subroutine clearHits
addHit
private subroutine addHit (hits, iplane, iwire, ifghit, idchit)
type (hits_type), INTENT(inout) :: hits
integer, INTENT(in) :: iplane
integer, INTENT(in) :: iwire
integer, INTENT(in) :: ifghit
integer, INTENT(in) :: idchit
! Calls: point3tov3
end subroutine addHit
point3toV3
private subroutine point3toV3 (point, v3)
type (point3_type), INTENT(in) :: point
real (kind=R8), INTENT(out), dimension (3) :: v3
end subroutine point3toV3
printHits
public subroutine printHits (hits)
type (hits_type), INTENT(in) :: hits
end subroutine printHits
V3mag
private function V3mag (a)
real (kind=R8), INTENT(in), dimension (3) :: a
Description: compute vector length
real (kind=R8) :: v3mag
end function V3mag