Beispiel #1
0
        public override MIPEmulsionTrackInfo ProjectVolumeTrack(Track t, ProjectionDirection direct, int layernumber)
        {
            double[] tvec;
            double[,] prop;
            MIPEmulsionTrackInfo mipt = new MIPEmulsionTrackInfo();

            m_Track = t;
            SetKalmanFilter();

            if (layernumber < 1)
            {
                throw new Exception("Layer Number must be greater than 0");
            }
            if (direct == ProjectionDirection.DownStream)
            {
                kf.FilterBackward();
                prop = new double[4, 4] {
                    { 1, layernumber *m_ProjectionZ, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, layernumber *m_ProjectionZ }, { 0, 0, 0, 1 }
                };
                tvec             = Matrices.Product(prop, kf[0].StateVec);
                mipt.BottomZ     = layernumber * m_ProjectionZ + m_Track[0].Info.BottomZ;
                mipt.TopZ        = layernumber * m_ProjectionZ + m_Track[0].Info.TopZ;
                mipt.Intercept.Z = layernumber * m_ProjectionZ + m_Track[0].Info.Intercept.Z;
                mipt.AreaSum     = m_Track[0].Info.AreaSum;
                mipt.Sigma       = m_Track[0].Info.Sigma;
                mipt.Count       = m_Track[0].Info.Count;
                mipt.Field       = m_Track[0].Info.Field;
            }
            else
            {
                int n = kf.Length;
                kf.FilterForward();
                prop = new double[4, 4] {
                    { 1, -layernumber * m_ProjectionZ, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, -layernumber * m_ProjectionZ }, { 0, 0, 0, 1 }
                };
                tvec             = Matrices.Product(prop, kf[n - 1].StateVec);
                mipt.BottomZ     = -layernumber * m_ProjectionZ + m_Track[n - 1].Info.BottomZ;
                mipt.TopZ        = -layernumber * m_ProjectionZ + m_Track[n - 1].Info.TopZ;
                mipt.Intercept.Z = -layernumber * m_ProjectionZ + m_Track[n - 1].Info.Intercept.Z;
                mipt.AreaSum     = m_Track[n - 1].Info.AreaSum;
                mipt.Sigma       = m_Track[n - 1].Info.Sigma;
                mipt.Count       = m_Track[n - 1].Info.Count;
                mipt.Field       = m_Track[n - 1].Info.Field;
            }
            mipt.Intercept.X = tvec[0];
            mipt.Slope.X     = tvec[1];
            mipt.Intercept.Y = tvec[2];
            mipt.Slope.Y     = tvec[3];
            mipt.Slope.Z     = 1;

            return(mipt);
        }
Beispiel #2
0
        public override MIPEmulsionTrackInfo ProjectVolumeTrackByGap(Track t, ProjectionDirection direct, double projection_gap)
        {
            double[] tvec;
            double[,] prop;
            MIPEmulsionTrackInfo mipt = new MIPEmulsionTrackInfo();

            m_Track = t;
            SetKalmanFilter();

            if (projection_gap < 0)
            {
                throw new Exception("Projection Gap must be greater than 0");
            }
            if (direct == ProjectionDirection.DownStream)
            {
                kf.FilterBackward();
                prop = new double[6, 6] {
                    { 1, projection_gap, 0, 0, 0, 0 }, { 0, 1, 0, 0, 0, 0 }, { 0, 0, 1, projection_gap, 0, 0 }, { 0, 0, 0, 1, 0, 0 }, { 0, 0, 0, 0, 1, projection_gap }, { 0, 0, 0, 0, 0, 1 }
                };
                tvec         = Matrices.Product(prop, kf[0].StateVec);
                mipt.BottomZ = projection_gap + m_Track[0].Info.BottomZ;
                mipt.TopZ    = projection_gap + m_Track[0].Info.TopZ;
                mipt.AreaSum = m_Track[0].Info.AreaSum;
                mipt.Sigma   = m_Track[0].Info.Sigma;
                mipt.Count   = m_Track[0].Info.Count;
                mipt.Field   = m_Track[0].Info.Field;
            }
            else
            {
                int n = kf.Length;
                kf.FilterForward();
                prop = new double[6, 6] {
                    { 1, -projection_gap, 0, 0, 0, 0 }, { 0, 1, 0, 0, 0, 0 }, { 0, 0, 1, -projection_gap, 0, 0 }, { 0, 0, 0, 1, 0, 0 }, { 0, 0, 0, 0, 1, -projection_gap }, { 0, 0, 0, 0, 0, 1 }
                };
                tvec         = Matrices.Product(prop, kf[n - 1].StateVec);
                mipt.BottomZ = -projection_gap + m_Track[n - 1].Info.BottomZ;
                mipt.TopZ    = -projection_gap + m_Track[n - 1].Info.TopZ;
                mipt.AreaSum = m_Track[n - 1].Info.AreaSum;
                mipt.Sigma   = m_Track[n - 1].Info.Sigma;
                mipt.Count   = m_Track[n - 1].Info.Count;
                mipt.Field   = m_Track[n - 1].Info.Field;
            }
            mipt.Intercept.X = tvec[0];
            mipt.Slope.X     = tvec[1];
            mipt.Intercept.Y = tvec[2];
            mipt.Slope.Y     = tvec[3];
            mipt.Intercept.Z = tvec[4];
            mipt.Slope.Z     = 1;

            return(mipt);
        }
Beispiel #3
0
        public override MIPEmulsionTrackInfo ProjectVolumeTrackAtZ(ProjectionDirection direct, double projection_Z)
        {
            double[] tvec;
            double[,] prop;
            double projection_gap;
            MIPEmulsionTrackInfo mipt = new MIPEmulsionTrackInfo();

            if (m_Track == null)
            {
                throw new Exception("Track not set!");
            }
            if (direct == ProjectionDirection.DownStream)
            {
                kf.FilterBackward();
                projection_gap = projection_Z - m_Track[0].Info.Intercept.Z;
                prop           = new double[6, 6] {
                    { 1, projection_gap, 0, 0, 0, 0 }, { 0, 1, 0, 0, 0, 0 }, { 0, 0, 1, projection_gap, 0, 0 }, { 0, 0, 0, 1, 0, 0 }, { 0, 0, 0, 0, 1, projection_gap }, { 0, 0, 0, 0, 0, 1 }
                };
                tvec         = Matrices.Product(prop, kf[0].StateVec);
                mipt.BottomZ = projection_gap + m_Track[0].Info.BottomZ;
                mipt.TopZ    = projection_gap + m_Track[0].Info.TopZ;
                mipt.AreaSum = m_Track[0].Info.AreaSum;
                mipt.Sigma   = m_Track[0].Info.Sigma;
            }
            else
            {
                int n = kf.Length;
                kf.FilterForward();
                projection_gap = m_Track[n - 1].Info.Intercept.Z - projection_Z;
                prop           = new double[6, 6] {
                    { 1, -projection_gap, 0, 0, 0, 0 }, { 0, 1, 0, 0, 0, 0 }, { 0, 0, 1, -projection_gap, 0, 0 }, { 0, 0, 0, 1, 0, 0 }, { 0, 0, 0, 0, 1, -projection_gap }, { 0, 0, 0, 0, 0, 1 }
                };
                tvec         = Matrices.Product(prop, kf[n - 1].StateVec);
                mipt.BottomZ = -projection_gap + m_Track[n - 1].Info.BottomZ;
                mipt.TopZ    = -projection_gap + m_Track[n - 1].Info.TopZ;
                mipt.AreaSum = m_Track[n - 1].Info.AreaSum;
                mipt.Sigma   = m_Track[n - 1].Info.Sigma;
            }
            mipt.Intercept.X = tvec[0];
            mipt.Slope.X     = tvec[1];
            mipt.Intercept.Y = tvec[2];
            mipt.Slope.Y     = tvec[3];
            mipt.Intercept.Z = tvec[4];
            mipt.Slope.Z     = 1;

            return(mipt);
        }