Module residuals_mod

module residuals_mod

        ! Uses
    use precision_mod
    use det_geom_mod
    use chambers_mod
    use filters_mod
    use tdc_mod
    use unpmc_mod
    use hists_mod
    use namelist_mod
    use hitpos_struct_mod
    use hitpos_mod
    use pattern_mod
    use matrix_mod
    use kalman_mod
    use calibrations_mod
    use leftright_mod

        ! Types
    private type KalSubtract_type
    public type Resid_type

        ! Variables
    integer (kind=i4), public, PARAMETER :: LengthBinMax = 5
    real (kind=r4), public :: LengthBinWidth
    type (Resid_type), public, DIMENSION(0:MAX_PLANES_D) :: ResidPlane
    type (Resid_type), public, DIMENSION(0:MAX_PLANES_D,0:LengthBinMax) :: ResidPlaneLength
    type (Resid_type), public, DIMENSION(0:MAX_PLANES_D,MAX_WIRES_D) :: ResidWire
    type (window_type), private, POINTER :: windowP

        ! Subroutines and functions
    public subroutine Residuals (iWindow)
    private subroutine ResidInit ()
    private subroutine ResidCalc (iWindow)

end module residuals_mod

Description of Types

KalSubtract_type

private type KalSubtract_type
    real (kind=r4), DIMENSION(5,1) :: Xs
    real (kind=r4), DIMENSION(5,5) :: Cs
end type KalSubtract_type

Resid_type

public type Resid_type
    real (kind=r4), DIMENSION(DCDriftBinMax) :: SquaredSum
    real (kind=r4), DIMENSION(DCDriftBinMax) :: sigma
    real (kind=r4) :: sum
    integer (kind=i4), DIMENSION(DCDriftBinMax) :: count
end type Resid_type

Description of Variables

LengthBinMax

integer (kind=i4), public, PARAMETER :: LengthBinMax = 5

LengthBinWidth

real (kind=r4), public :: LengthBinWidth

ResidPlane

type (Resid_type), public, DIMENSION(0:MAX_PLANES_D) :: ResidPlane

ResidPlaneLength

type (Resid_type), public, DIMENSION(0:MAX_PLANES_D,0:LengthBinMax) :: ResidPlaneLength

ResidWire

type (Resid_type), public, DIMENSION(0:MAX_PLANES_D,MAX_WIRES_D) :: ResidWire

windowP

type (window_type), private, POINTER :: windowP

Description of Subroutines and Functions

Residuals

public subroutine Residuals (iWindow)
    integer (kind=i4) :: iWindow
    ! Calls: ResidCalc, ResidInit
end subroutine Residuals

ResidInit

private subroutine ResidInit ()
end subroutine ResidInit

ResidCalc

private subroutine ResidCalc (iWindow)
    integer (kind=i4) :: iWindow
    ! Calls: HF1, HF2
end subroutine ResidCalc