コード例 #1
0
    def MultipleScatteringMatrix(self, index0, index1):
        This = self.Track.GetNode(index0)
        Other = self.Track.GetNode(index1)

        dx, dy, tx, ty, e = This.Pstate.State

        z0 = This.running
        z02 = z0**2
        z1 = Other.running
        dz = z1 - z0
        ds = abs(dz) * (tx**2 + ty**2 + 1)**0.5
        L = ds / self.gas.x0
        theta02 = thetaMS(K2P(This.ParticleEnergy), L)**2

        factor = theta02 * (1 + tx**2 + ty**2)
        p33 = factor * (1 + tx**2)
        p44 = factor * (1 + ty**2)
        p34 = factor * tx * ty

        state = This.Pstate.State if This.status < 2 else This.Fstate.State
        self.Eres2 = self.Eresolution**2 / state[-1]

        return Array.Matrix(
            [z02 * p33 / 3, z02 * p34 / 3, -z0 * p33 / 2, -z0 * p34 / 2, 0.],
            [z02 * p34 / 3, z02 * p44 / 3, -z0 * p34 / 2, -z0 * p44 / 2, 0.],
            [-z0 * p33 / 2, -z0 * p34 / 2, p33, p34, 0.],
            [-z0 * p34 / 2, -z0 * p44 / 2, p34, p44, 0.],
            [0., 0., 0., 0., self.Eres2])  # * 10.
コード例 #2
0
    def MultipleScatteringMatrix(self, index0, index1):
        This = self.Track.GetNode(index0)
        Other = self.Track.GetNode(index1)
        z0 = This.running
        z02 = z0**2
        z1 = Other.running
        L = abs(z1 - z0) / self.gas.x0 * 0.1

        dx, dy, tx, ty, e = This.Pstate.State
        theta02 = thetaMS(K2P(e), L)**2

        factor = theta02 * (1 + tx**2 + ty**2)
        p33 = factor * (1 + tx**2)
        p44 = factor * (1 + ty**2)
        p34 = factor * tx * ty

        return Array.Matrix([z02 * p33, z02 * p34, -z0 * p33, -z0 * p34, 0.],
                            [z02 * p34, z02 * p44, -z0 * p34, -z0 * p44, 0.],
                            [-z0 * p33, -z0 * p34, p33, p34, 0.],
                            [-z0 * p34, -z0 * p44, p34, p44, 0.],
                            [0., 0., 0., 0., self.Eres2])
コード例 #3
0
ファイル: KalmanFMWK.py プロジェクト: next-exp/pykalman
 def __init__(self, state=Array.Vector(), CovarianceMatrix=Array.Matrix()):
     self.state = state
     self.CovarianceMatrix = CovarianceMatrix
コード例 #4
0
 def MeasurementMatrix(self, index0, index1):
     dz = self.Track.GetNode(index1).running - self.Track.GetNode(
         index0).running
     return Array.Matrix([1., 0., dz, 0., 0.], [0., 1., 0., dz, 0.],
                         [0., 0., 0., 0., 1.])
コード例 #5
0
 def MeasurementMatrix(self, index):
     return Array.Matrix([1., 0., 0., 0.], [0., 1., 0., 0.])
コード例 #6
0
 def TransportMatrix(self, index):
     z = self.Track.GetNode(index).running
     return Array.Matrix([1., 0., z, 0.], [0., 1., z, 0.], [0., 0., 1., 0.],
                         [0., 0., 0., 1.])