GeneralBrokenLines V03-01-02
gblpy
|
General Broken Lines Trajectory. More...
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 | getNumbers (self) |
Get (parameter) number of 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) |
Get (part of) jacobian for transformation from (trajectory) fit to track parameters at point. More... | |
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 | |
def gblpy.gblfit.GblTrajectory.__init__ | ( | self, | |
hasCurv = True , |
|||
aDim = [0, 1] |
|||
) |
|
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.
aPoint | point to use; GblPoint |
Definition at line 1112 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__dimensions, gblpy.gblfit.GblTrajectory.__numCurvature, and gblpy.gblfit.GblTrajectory.__numLocals.
Referenced by gblpy.gblfit.GblTrajectory.fit().
|
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.
aPoint | point to use; GblPoint |
Definition at line 1042 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__dimensions, gblpy.gblfit.GblTrajectory.__numCurvature, and gblpy.gblfit.GblTrajectory.__numLocals.
Referenced by gblpy.gblfit.GblTrajectory.fit().
|
private |
Get (part of) jacobian for transformation from (trajectory) fit to track parameters at point.
Jacobian broken lines (q/p,..,u_i,u_i+1..) to local (q/p,u',u) parameters.
aPoint | point to use; GblPoint |
measDim | dimension of 'measurement' (2, 4 or 5); int |
nJacobian | direction (0: to previous offset, 1: to next offset); int |
Definition at line 952 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__dimensions, gblpy.gblfit.GblTrajectory.__numCurvature, and gblpy.gblfit.GblTrajectory.__numLocals.
Referenced by gblpy.gblfit.GblTrajectory.__getJacobian(), and gblpy.gblfit.GblTrajectory.fit().
|
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.
aPoint | point to use; GblPoint |
Definition at line 1081 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__dimensions, gblpy.gblfit.GblTrajectory.__numCurvature, and gblpy.gblfit.GblTrajectory.__numLocals.
Referenced by gblpy.gblfit.GblTrajectory.fit().
|
private |
Get jacobian for transformation from fit to track parameters at point.
aLabel | (signed) label of point; int |
Definition at line 901 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().
|
private |
Definition at line 1145 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__data, gblpy.gblfit.GblTrajectory.__matrix, and gblpy.gblfit.GblTrajectory.getResidual().
Referenced by gblpy.gblfit.GblTrajectory.getMeasResults(), gblpy.gblfit.GblTrajectory.getResidual(), and gblpy.gblfit.GblTrajectory.getScatResults().
def gblpy.gblfit.GblTrajectory.addExternalSeed | ( | self, | |
aLabel, | |||
aSeed | |||
) |
Add external seed to trajectory.
aLabel | label of point with external seed; int |
aSeed | seed (precision matrix of track parameters at point); matrix(float) |
Definition at line 836 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__externalPoint, and gblpy.gblfit.GblTrajectory.__externalSeed.
def gblpy.gblfit.GblTrajectory.addPoint | ( | self, | |
point | |||
) |
Add point to trajectory.
Points have to be ordered in arc length.
point | point to be added; GblPoint |
Definition at line 808 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__numLocals, gblpy.gblfit.GblTrajectory.__numPoints, and gblpy.gblfit.GblTrajectory.__points.
def gblpy.gblfit.GblTrajectory.fit | ( | self, | |
optionList = "" , |
|||
aLabel = 0 |
|||
) |
Perform fit of trajectory.
optionList | M-estimators to be used (one iteration per character); string |
aLabel | label of point where to skip measurements (for unbiased residuals) |
Definition at line 1233 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__data, gblpy.gblfit.GblTrajectory.__dimensions, gblpy.gblfit.GblTrajectory.__externalPoint, gblpy.gblfit.GblTrajectory.__externalSeed, gblpy.gblfit.GblTrajectory.__getFitToKinkAndStepJacobian(), gblpy.gblfit.GblTrajectory.__getFitToKinkJacobian(), gblpy.gblfit.GblTrajectory.__getFitToLocalJacobian(), gblpy.gblfit.GblTrajectory.__getFitToStepJacobian(), gblpy.gblfit.GblTrajectory.__getJacobian(), gblpy.gblfit.GblTrajectory.__measDataIndex, gblpy.gblfit.GblTrajectory.__numCurvature, gblpy.gblfit.GblTrajectory.__numLocals, gblpy.gblfit.GblTrajectory.__numOffsets, gblpy.gblfit.GblTrajectory.__numParameters, gblpy.gblfit.GblTrajectory.__numPoints, gblpy.gblfit.GblTrajectory.__points, and gblpy.gblfit.GblTrajectory.__scatDataIndex.
def gblpy.gblfit.GblTrajectory.getData | ( | self | ) |
Get data of trajectory.
Definition at line 856 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__data.
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
aLabel | label of point; int |
Definition at line 1185 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__getResAndErr(), gblpy.gblfit.GblTrajectory.__measDataIndex, and gblpy.gblfit.GblTrajectory.__skippedMeasLabel.
def gblpy.gblfit.GblTrajectory.getNumbers | ( | self | ) |
Get (parameter) number of trajectory.
Definition at line 828 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__numCurvature, gblpy.gblfit.GblTrajectory.__numLocals, and gblpy.gblfit.GblTrajectory.__numParameters.
def gblpy.gblfit.GblTrajectory.getNumPoints | ( | self | ) |
Get number of points on trajectory.
Definition at line 821 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__numPoints.
def gblpy.gblfit.GblTrajectory.getResidual | ( | self, | |
iData | |||
) |
Get residuals from data of trajectory.
iData | index of data block; int |
Definition at line 1224 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__getResAndErr().
Referenced by gblpy.gblfit.GblTrajectory.__getResAndErr().
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.
aLabel | signed label of point (<0 backward, >0 forward); int |
Definition at line 1167 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__getJacobian(), gblpy.gblfit.GblTrajectory.__matrix, and gblpy.gblfit.GblTrajectory.__vector.
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
aLabel | label of point; int |
Definition at line 1206 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__getResAndErr(), and gblpy.gblfit.GblTrajectory.__scatDataIndex.
def gblpy.gblfit.GblTrajectory.milleIn | ( | self, | |
aFile | |||
) |
Read (data blocks of) trajectory from MP (binary) file.
aFile | MP file |
Definition at line 876 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__data, gblpy.gblfit.GblTrajectory.__dimensions, gblpy.gblfit.GblTrajectory.__numCurvature, gblpy.gblfit.GblTrajectory.__numLocals, and gblpy.gblfit.GblTrajectory.__numParameters.
def gblpy.gblfit.GblTrajectory.milleOut | ( | self, | |
aFile, | |||
doublePrec = False |
|||
) |
Write (data blocks of) trajectory to MP (binary) file (as float or double values).
aFile | MP file |
doublePrec | flag for storage in as double values |
Definition at line 864 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__data.
def gblpy.gblfit.GblTrajectory.printData | ( | self | ) |
Print data of trajectory.
Definition at line 847 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__data.
def gblpy.gblfit.GblTrajectory.printPoints | ( | self | ) |
Print points of trajectory.
Definition at line 841 of file gblfit.py.
References gblpy.gblfit.GblTrajectory.__points.
|
private |
data (blocks) of trajectory; list(GblData)
Down weight (data) outliers.
aMethod | M-estimator; int |
Calculate predictions.
Definition at line 793 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().
|
private |
active components of offsets (both ([0,1]) or single ([0] or [1]); list(int)
Definition at line 789 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.__getFitToKinkAndStepJacobian(), gblpy.gblfit.GblTrajectory.__getFitToKinkJacobian(), gblpy.gblfit.GblTrajectory.__getFitToLocalJacobian(), gblpy.gblfit.GblTrajectory.__getFitToStepJacobian(), gblpy.gblfit.GblTrajectory.__getJacobian(), gblpy.gblfit.GblTrajectory.fit(), and gblpy.gblfit.GblTrajectory.milleIn().
|
private |
label of point with external seed; int
Definition at line 787 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.addExternalSeed(), and gblpy.gblfit.GblTrajectory.fit().
|
private |
external seed (for local, fit parameters); matrix(float)
Definition at line 795 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.addExternalSeed(), and gblpy.gblfit.GblTrajectory.fit().
|
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 1375 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.__getResAndErr(), and gblpy.gblfit.GblTrajectory.getResults().
|
private |
mapping points to data blocks from measurements; list(int)
Definition at line 797 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.fit(), and gblpy.gblfit.GblTrajectory.getMeasResults().
|
private |
'curvature' is fit parameter (=1); int
Definition at line 781 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.__getFitToKinkAndStepJacobian(), gblpy.gblfit.GblTrajectory.__getFitToKinkJacobian(), gblpy.gblfit.GblTrajectory.__getFitToLocalJacobian(), gblpy.gblfit.GblTrajectory.__getFitToStepJacobian(), gblpy.gblfit.GblTrajectory.__getJacobian(), gblpy.gblfit.GblTrajectory.fit(), gblpy.gblfit.GblTrajectory.getNumbers(), and gblpy.gblfit.GblTrajectory.milleIn().
|
private |
number of local parameters; int
Definition at line 785 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.__getFitToKinkAndStepJacobian(), gblpy.gblfit.GblTrajectory.__getFitToKinkJacobian(), gblpy.gblfit.GblTrajectory.__getFitToLocalJacobian(), gblpy.gblfit.GblTrajectory.__getFitToStepJacobian(), gblpy.gblfit.GblTrajectory.__getJacobian(), gblpy.gblfit.GblTrajectory.addPoint(), gblpy.gblfit.GblTrajectory.fit(), gblpy.gblfit.GblTrajectory.getNumbers(), and gblpy.gblfit.GblTrajectory.milleIn().
|
private |
number of (points with) offsets on trajectory; int
Define offsets from list of points.
Definition at line 779 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.fit().
|
private |
number fit parameters; int
Definition at line 783 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.fit(), gblpy.gblfit.GblTrajectory.getNumbers(), and gblpy.gblfit.GblTrajectory.milleIn().
|
private |
number of points on trajectory; int
Definition at line 777 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.__getJacobian(), gblpy.gblfit.GblTrajectory.addPoint(), gblpy.gblfit.GblTrajectory.fit(), and gblpy.gblfit.GblTrajectory.getNumPoints().
|
private |
points on trajectory; list(GblPoint)
Definition at line 791 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.__getJacobian(), gblpy.gblfit.GblTrajectory.addPoint(), gblpy.gblfit.GblTrajectory.fit(), and gblpy.gblfit.GblTrajectory.printPoints().
|
private |
mapping points to data blocks from scatterers; list(int)
Definition at line 799 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.fit(), and gblpy.gblfit.GblTrajectory.getScatResults().
|
private |
label of point with measurements skipped in fit (for unbiased residuals)
Definition at line 801 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.getMeasResults().
|
private |
Definition at line 1376 of file gblfit.py.
Referenced by gblpy.gblfit.GblTrajectory.getResults().