GeneralBrokenLines V03-00-00
gblpy
Public Member Functions | Private Member Functions | Private Attributes | List of all members
gblpy.gblfit.GblTrajectory Class Reference

General Broken Lines Trajectory. More...

Inheritance diagram for gblpy.gblfit.GblTrajectory:

Public Member Functions

def __init__ (self, hasCurv=True, aDim=[0, 1])
 Create new trajectory. More...
 
def addPoint (self, point)
 Add point to trajectory. More...
 
def getNumPoints (self)
 Get number of points on trajectory. More...
 
def addExternalSeed (self, aLabel, aSeed)
 Add external seed to trajectory. More...
 
def printPoints (self)
 Print points of trajectory. More...
 
def printData (self)
 Print data of trajectory. More...
 
def getData (self)
 Get data of trajectory. More...
 
def milleOut (self, aFile, doublePrec=False)
 Write (data blocks of) trajectory to MP (binary) file (as float or double values). More...
 
def milleIn (self, aFile)
 Read (data blocks of) trajectory from MP (binary) file. More...
 
def getResults (self, aLabel)
 Get results (corrections, covarinace matrix) at point in forward or backward direction. More...
 
def getMeasResults (self, aLabel)
 Get residuals at point from measurement. More...
 
def getScatResults (self, aLabel)
 Get residuals at point from scatterer. More...
 
def getResidual (self, iData)
 Get residuals from data of trajectory. More...
 
def fit (self, optionList="", aLabel=0)
 Perform fit of trajectory. More...
 

Private Member Functions

def __getJacobian (self, aLabel)
 Get jacobian for transformation from fit to track parameters at point. More...
 
def __getFitToLocalJacobian (self, aPoint, measDim, nJacobian=1)
 
def __getFitToKinkJacobian (self, aPoint)
 Get jacobian for transformation from (trajectory) fit to kink parameters at point. More...
 
def __getFitToStepJacobian (self, aPoint)
 Get jacobian for transformation from (trajectory) fit to step parameters at point. More...
 
def __getFitToKinkAndStepJacobian (self, aPoint)
 Get jacobian for transformation from (trajectory) fit to kink and step parameters at point. More...
 
def __getResAndErr (self, aData, used=True)
 

Private Attributes

 __numPoints
 number of points on trajectory; int More...
 
 __numOffsets
 number of (points with) offsets on trajectory; int More...
 
 __numCurvature
 'curvature' is fit parameter (=1); int More...
 
 __numParameters
 number fit parameters; int More...
 
 __numLocals
 number of local parameters; int More...
 
 __externalPoint
 label of point with external seed; int More...
 
 __dimensions
 active components of offsets (both ([0,1]) or single ([0] or [1]); list(int) More...
 
 __points
 points on trajectory; list(GblPoint) More...
 
 __data
 data (blocks) of trajectory; list(GblData) More...
 
 __externalSeed
 external seed (for local, fit parameters); matrix(float) More...
 
 __measDataIndex
 mapping points to data blocks from measurements; list(int) More...
 
 __scatDataIndex
 mapping points to data blocks from scatterers; list(int) More...
 
 __skippedMeasLabel
 label of point with measurements skipped in fit (for unbiased residuals) More...
 
 __matrix
 Calculate Jacobians to previous/next scatterer from point to point ones. More...
 
 __vector
 

Detailed Description

General Broken Lines Trajectory.


Definition at line 762 of file gblfit.py.

Constructor & Destructor Documentation

◆ __init__()

def gblpy.gblfit.GblTrajectory.__init__ (   self,
  hasCurv = True,
  aDim = [0, 1] 
)

Create new trajectory.

Parameters
hasCurvflag for curvature; bool
aDimactive offset components (0:u_1, 1:u_2); list(int)

Definition at line 769 of file gblfit.py.

Member Function Documentation

◆ __getFitToKinkAndStepJacobian()

def gblpy.gblfit.GblTrajectory.__getFitToKinkAndStepJacobian (   self,
  aPoint 
)
private

Get jacobian for transformation from (trajectory) fit to kink and step parameters at point.

Jacobian broken lines (q/p,..,u_i-1,u_i,u_i+1..) to kink (du') and step (du) parameters.

Thick sactterers only.

Parameters
aPointpoint to use; GblPoint
Returns
labels for fit parameters with non zero derivatives, corresponding transformation matrix; list(vector(int), matrix(float))

Definition at line 1099 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__dimensions, gblpy.gblfit.GblTrajectory.__numCurvature, and gblpy.gblfit.GblTrajectory.__numLocals.

Referenced by gblpy.gblfit.GblTrajectory.fit().

◆ __getFitToKinkJacobian()

def gblpy.gblfit.GblTrajectory.__getFitToKinkJacobian (   self,
  aPoint 
)
private

Get jacobian for transformation from (trajectory) fit to kink parameters at point.

Jacobian broken lines (q/p,..,u_i-1,u_i,u_i+1..) to kink (du') parameters.

Parameters
aPointpoint to use; GblPoint
Returns
labels for fit parameters with non zero derivatives, corresponding transformation matrix; list(vector(int), matrix(float))

Definition at line 1029 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__dimensions, gblpy.gblfit.GblTrajectory.__numCurvature, and gblpy.gblfit.GblTrajectory.__numLocals.

Referenced by gblpy.gblfit.GblTrajectory.fit().

◆ __getFitToLocalJacobian()

def gblpy.gblfit.GblTrajectory.__getFitToLocalJacobian (   self,
  aPoint,
  measDim,
  nJacobian = 1 
)
private

◆ __getFitToStepJacobian()

def gblpy.gblfit.GblTrajectory.__getFitToStepJacobian (   self,
  aPoint 
)
private

Get jacobian for transformation from (trajectory) fit to step parameters at point.

Jacobian broken lines (q/p,..,u_i-1,u_i,u_i+1..) to kink (du') and step (du) parameters.

Thick sactterers only.

Parameters
aPointpoint to use; GblPoint
Returns
labels for fit parameters with non zero derivatives, corresponding transformation matrix; list(vector(int), matrix(float))

Definition at line 1068 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__dimensions, gblpy.gblfit.GblTrajectory.__numCurvature, and gblpy.gblfit.GblTrajectory.__numLocals.

Referenced by gblpy.gblfit.GblTrajectory.fit().

◆ __getJacobian()

def gblpy.gblfit.GblTrajectory.__getJacobian (   self,
  aLabel 
)
private

Get jacobian for transformation from fit to track parameters at point.

Parameters
aLabel(signed) label of point; int
Returns
labels of required fit parameters and jacobian; list

Definition at line 888 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__dimensions, gblpy.gblfit.GblTrajectory.__getFitToLocalJacobian(), gblpy.gblfit.GblTrajectory.__numCurvature, gblpy.gblfit.GblTrajectory.__numLocals, gblpy.gblfit.GblTrajectory.__numPoints, and gblpy.gblfit.GblTrajectory.__points.

Referenced by gblpy.gblfit.GblTrajectory.fit(), and gblpy.gblfit.GblTrajectory.getResults().

◆ __getResAndErr()

def gblpy.gblfit.GblTrajectory.__getResAndErr (   self,
  aData,
  used = True 
)
private

◆ addExternalSeed()

def gblpy.gblfit.GblTrajectory.addExternalSeed (   self,
  aLabel,
  aSeed 
)

Add external seed to trajectory.

Parameters
aLabellabel of point with external seed; int
aSeedseed (precision matrix of track parameters at point); matrix(float)

Definition at line 823 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__externalPoint, and gblpy.gblfit.GblTrajectory.__externalSeed.

◆ addPoint()

def gblpy.gblfit.GblTrajectory.addPoint (   self,
  point 
)

Add point to trajectory.

Points have to be ordered in arc length.

Parameters
pointpoint to be added; GblPoint
Returns
label of added point (1..number(points)); int

Definition at line 802 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__numLocals, gblpy.gblfit.GblTrajectory.__numPoints, and gblpy.gblfit.GblTrajectory.__points.

◆ fit()

def gblpy.gblfit.GblTrajectory.fit (   self,
  optionList = "",
  aLabel = 0 
)

◆ getData()

def gblpy.gblfit.GblTrajectory.getData (   self)

Get data of trajectory.

Returns
data blocks; list

Definition at line 843 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__data.

◆ getMeasResults()

def gblpy.gblfit.GblTrajectory.getMeasResults (   self,
  aLabel 
)

Get residuals at point from measurement.

Get (diagonalized) residual, error of measurement and residual and down-weighting factor for measurement at point

Parameters
aLabellabel of point; int
Returns
vectors with residuals, errors of maeansurements and residuals, down-weighting factors; list

Definition at line 1172 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__getResAndErr(), gblpy.gblfit.GblTrajectory.__measDataIndex, and gblpy.gblfit.GblTrajectory.__skippedMeasLabel.

◆ getNumPoints()

def gblpy.gblfit.GblTrajectory.getNumPoints (   self)

Get number of points on trajectory.

Returns
number of points; int

Definition at line 815 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__numPoints.

◆ getResidual()

def gblpy.gblfit.GblTrajectory.getResidual (   self,
  iData 
)

Get residuals from data of trajectory.

Parameters
iDataindex of data block; int

Definition at line 1211 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__getResAndErr().

Referenced by gblpy.gblfit.GblTrajectory.__getResAndErr().

◆ getResults()

def gblpy.gblfit.GblTrajectory.getResults (   self,
  aLabel 
)

Get results (corrections, covarinace matrix) at point in forward or backward direction.

The point is identified by its label (1..number(points)), the sign distinguishes the backward (facing previous point) and forward 'side' (facing next point). For scatterers the track direction may change in between.

Parameters
aLabelsigned label of point (<0 backward, >0 forward); int
Returns
correction vector, covarinace matrix for track parameters; list

Definition at line 1154 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__getJacobian(), gblpy.gblfit.GblTrajectory.__matrix, and gblpy.gblfit.GblTrajectory.__vector.

◆ getScatResults()

def gblpy.gblfit.GblTrajectory.getScatResults (   self,
  aLabel 
)

Get residuals at point from scatterer.

Get (diagonalized) residual, error of measurement and residual and down-weighting factor for scatterering kinks at point

Parameters
aLabellabel of point; int
Returns
vectors with residuals, errors of maeansurements and residuals, down-weighting factors; list

Definition at line 1193 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__getResAndErr(), and gblpy.gblfit.GblTrajectory.__scatDataIndex.

◆ milleIn()

def gblpy.gblfit.GblTrajectory.milleIn (   self,
  aFile 
)

◆ milleOut()

def gblpy.gblfit.GblTrajectory.milleOut (   self,
  aFile,
  doublePrec = False 
)

Write (data blocks of) trajectory to MP (binary) file (as float or double values).

Parameters
aFileMP file
doublePrecflag for storage in as double values

Definition at line 851 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__data.

◆ printData()

def gblpy.gblfit.GblTrajectory.printData (   self)

Print data of trajectory.


Definition at line 834 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__data.

◆ printPoints()

def gblpy.gblfit.GblTrajectory.printPoints (   self)

Print points of trajectory.

Definition at line 828 of file gblfit.py.

References gblpy.gblfit.GblTrajectory.__points.

Member Data Documentation

◆ __data

gblpy.gblfit.GblTrajectory.__data
private

data (blocks) of trajectory; list(GblData)

Down weight (data) outliers.

Parameters
aMethodM-estimator; int
Returns
loss of weight (sum(1-down_weighting)); float

Calculate predictions.

Definition at line 787 of file gblfit.py.

Referenced by gblpy.gblfit.GblTrajectory.__getResAndErr(), gblpy.gblfit.GblTrajectory.fit(), gblpy.gblfit.GblTrajectory.getData(), gblpy.gblfit.GblTrajectory.milleIn(), gblpy.gblfit.GblTrajectory.milleOut(), and gblpy.gblfit.GblTrajectory.printData().

◆ __dimensions

gblpy.gblfit.GblTrajectory.__dimensions
private

◆ __externalPoint

gblpy.gblfit.GblTrajectory.__externalPoint
private

label of point with external seed; int

Definition at line 781 of file gblfit.py.

Referenced by gblpy.gblfit.GblTrajectory.addExternalSeed(), and gblpy.gblfit.GblTrajectory.fit().

◆ __externalSeed

gblpy.gblfit.GblTrajectory.__externalSeed
private

external seed (for local, fit parameters); matrix(float)

Definition at line 789 of file gblfit.py.

Referenced by gblpy.gblfit.GblTrajectory.addExternalSeed(), and gblpy.gblfit.GblTrajectory.fit().

◆ __matrix

gblpy.gblfit.GblTrajectory.__matrix
private

Calculate Jacobians to previous/next scatterer from point to point ones.

Prepare fit; generate data from points.

Build linear equation system from data.

Definition at line 1362 of file gblfit.py.

Referenced by gblpy.gblfit.GblTrajectory.__getResAndErr(), and gblpy.gblfit.GblTrajectory.getResults().

◆ __measDataIndex

gblpy.gblfit.GblTrajectory.__measDataIndex
private

mapping points to data blocks from measurements; list(int)

Definition at line 791 of file gblfit.py.

Referenced by gblpy.gblfit.GblTrajectory.fit(), and gblpy.gblfit.GblTrajectory.getMeasResults().

◆ __numCurvature

gblpy.gblfit.GblTrajectory.__numCurvature
private

◆ __numLocals

gblpy.gblfit.GblTrajectory.__numLocals
private

◆ __numOffsets

gblpy.gblfit.GblTrajectory.__numOffsets
private

number of (points with) offsets on trajectory; int

Define offsets from list of points.

Definition at line 773 of file gblfit.py.

Referenced by gblpy.gblfit.GblTrajectory.fit().

◆ __numParameters

gblpy.gblfit.GblTrajectory.__numParameters
private

number fit parameters; int

Definition at line 777 of file gblfit.py.

Referenced by gblpy.gblfit.GblTrajectory.fit(), and gblpy.gblfit.GblTrajectory.milleIn().

◆ __numPoints

gblpy.gblfit.GblTrajectory.__numPoints
private

◆ __points

gblpy.gblfit.GblTrajectory.__points
private

◆ __scatDataIndex

gblpy.gblfit.GblTrajectory.__scatDataIndex
private

mapping points to data blocks from scatterers; list(int)

Definition at line 793 of file gblfit.py.

Referenced by gblpy.gblfit.GblTrajectory.fit(), and gblpy.gblfit.GblTrajectory.getScatResults().

◆ __skippedMeasLabel

gblpy.gblfit.GblTrajectory.__skippedMeasLabel
private

label of point with measurements skipped in fit (for unbiased residuals)

Definition at line 795 of file gblfit.py.

Referenced by gblpy.gblfit.GblTrajectory.getMeasResults().

◆ __vector

gblpy.gblfit.GblTrajectory.__vector
private

Definition at line 1363 of file gblfit.py.

Referenced by gblpy.gblfit.GblTrajectory.getResults().


The documentation for this class was generated from the following file: