GENFIT Rev: NoNumberAvailable
Loading...
Searching...
No Matches
GblTrajectory.h
Go to the documentation of this file.
1/*
2 * GblTrajectory.h
3 *
4 * Created on: Aug 18, 2011
5 * Author: kleinwrt
6 */
7
29
30#ifndef GBLTRAJECTORY_H_
31#define GBLTRAJECTORY_H_
32
33#include "GblPoint.h"
34#include "GblData.h"
35#include "GblPoint.h"
36#include "BorderedBandMatrix.h"
37#include "MilleBinary.h"
38#include "TMatrixDSymEigen.h"
39
41namespace gbl {
42
44
49public:
50 explicit GblTrajectory(const std::vector<GblPoint> &aPointList, bool flagCurv = true,
51 bool flagU1dir = true, bool flagU2dir = true);
52 GblTrajectory(const std::vector<GblPoint> &aPointList, unsigned int aLabel,
53 const TMatrixDSym &aSeed, bool flagCurv = true, bool flagU1dir =
54 true, bool flagU2dir = true);
55 explicit GblTrajectory(
56 const std::vector<std::pair<std::vector<GblPoint>, TMatrixD> > &aPointaAndTransList);
58 const std::vector<std::pair<std::vector<GblPoint>, TMatrixD> > &aPointaAndTransList,
59 const TMatrixD &extDerivatives, const TVectorD &extMeasurements,
60 const TVectorD &extPrecisions);
62 const std::vector<std::pair<std::vector<GblPoint>, TMatrixD> > &aPointaAndTransList,
63 const TMatrixD &extDerivatives, const TVectorD &extMeasurements,
64 const TMatrixDSym &extPrecisions);
65 virtual ~GblTrajectory();
66 bool isValid() const;
67 unsigned int getNumPoints() const;
68 unsigned int getResults(int aSignedLabel, TVectorD &localPar,
69 TMatrixDSym &localCov) const;
70 unsigned int getMeasResults(unsigned int aLabel, unsigned int &numRes,
71 TVectorD &aResiduals, TVectorD &aMeasErrors, TVectorD &aResErrors,
72 TVectorD &aDownWeights);
73 unsigned int getScatResults(unsigned int aLabel, unsigned int &numRes,
74 TVectorD &aResiduals, TVectorD &aMeasErrors, TVectorD &aResErrors,
75 TVectorD &aDownWeights);
76 unsigned int getLabels(std::vector<unsigned int> &aLabelList);
77 unsigned int getLabels(std::vector<std::vector<unsigned int> > &aLabelList);
78 unsigned int fit(double &Chi2, int &Ndf, double &lostWeight,
79 std::string optionList = "");
80 void milleOut(MilleBinary &aMille);
81 void printTrajectory(unsigned int level = 0);
82 void printPoints(unsigned int level = 0);
83 void printData();
84 std::vector<GblData> getData() {return theData;}
85
86private:
87 unsigned int numAllPoints;
88 std::vector<unsigned int> numPoints;
89 unsigned int numTrajectories;
90 unsigned int numOffsets;
91 unsigned int numInnerTrans;
92 unsigned int numCurvature;
93 unsigned int numParameters;
94 unsigned int numLocals;
95 unsigned int numMeasurements;
96 unsigned int externalPoint;
98 bool fitOK;
99 std::vector<unsigned int> theDimension;
100 std::vector<std::vector<GblPoint> > thePoints;
101 std::vector<GblData> theData;
102 std::vector<unsigned int> measDataIndex;
103 std::vector<unsigned int> scatDataIndex;
104 TMatrixDSym externalSeed;
105 std::vector<TMatrixD> innerTransformations;
106 // composed trajectory (from common external parameters)
107 TMatrixD externalDerivatives; // Derivatives for external measurements of composed trajectory
108 TVectorD externalMeasurements; // Residuals for external measurements of composed trajectory
109 TVectorD externalPrecisions; // Precisions for external measurements of composed trajectory
112
113 std::pair<std::vector<unsigned int>, TMatrixD> getJacobian(
114 int aSignedLabel) const;
115 void getFitToLocalJacobian(std::vector<unsigned int> &anIndex,
116 SMatrix55 &aJacobian, const GblPoint &aPoint, unsigned int measDim,
117 unsigned int nJacobian = 1) const;
118 void getFitToKinkJacobian(std::vector<unsigned int> &anIndex,
119 SMatrix27 &aJacobian, const GblPoint &aPoint) const;
120 void construct();
121 void defineOffsets();
122 void calcJacobians();
123 void prepare();
125 void predict();
126 double downWeight(unsigned int aMethod);
127 void getResAndErr(unsigned int aData, double &aResidual,
128 double &aMeadsError, double &aResError, double &aDownWeight);
129};
130}
131#endif /* GBLTRAJECTORY_H_ */
ROOT::Math::SMatrix< double, 5, 5 > SMatrix55
Definition GblData.h:45
ROOT::Math::SMatrix< double, 2, 7 > SMatrix27
Definition GblData.h:44
(Symmetric) Bordered Band Matrix.
Point on trajectory.
Definition GblPoint.h:68
void printData()
Print GblData blocks for trajectory.
std::vector< unsigned int > numPoints
Number of points on (sub)trajectory.
std::vector< unsigned int > scatDataIndex
mapping points to data blocks from scatterers
BorderedBandMatrix theMatrix
(Bordered band) matrix of linear equation system
std::vector< std::vector< GblPoint > > thePoints
(list of) List of points on trajectory
void getFitToLocalJacobian(std::vector< unsigned int > &anIndex, SMatrix55 &aJacobian, const GblPoint &aPoint, unsigned int measDim, unsigned int nJacobian=1) const
Get (part of) jacobian for transformation from (trajectory) fit to track parameters at point.
unsigned int getLabels(std::vector< unsigned int > &aLabelList)
Get (list of) labels of points on (simple) valid trajectory.
unsigned int numTrajectories
Number of trajectories (in composed trajectory)
unsigned int fit(double &Chi2, int &Ndf, double &lostWeight, std::string optionList="")
Perform fit of (valid) trajectory.
void construct()
Construct trajectory from list of points.
unsigned int externalPoint
Label of external point (or 0)
unsigned int getMeasResults(unsigned int aLabel, unsigned int &numRes, TVectorD &aResiduals, TVectorD &aMeasErrors, TVectorD &aResErrors, TVectorD &aDownWeights)
Get residuals from fit at point for measurement.
unsigned int getResults(int aSignedLabel, TVectorD &localPar, TMatrixDSym &localCov) const
Get fit results at point.
unsigned int numAllPoints
Number of all points on trajectory.
double downWeight(unsigned int aMethod)
Down-weight all points.
VVector theVector
Vector of linear equation system.
void calcJacobians()
Calculate Jacobians to previous/next scatterer from point to point ones.
std::vector< TMatrixD > innerTransformations
Transformations at innermost points of.
std::pair< std::vector< unsigned int >, TMatrixD > getJacobian(int aSignedLabel) const
Get jacobian for transformation from fit to track parameters at point.
unsigned int numCurvature
Number of curvature parameters (0 or 1) or external parameters.
void predict()
Calculate predictions for all points.
void printPoints(unsigned int level=0)
Print GblPoints on trajectory.
void defineOffsets()
Define offsets from list of points.
unsigned int numInnerTrans
Number of inner transformations to external parameters.
unsigned int numLocals
Total number of (additional) local parameters.
void getFitToKinkJacobian(std::vector< unsigned int > &anIndex, SMatrix27 &aJacobian, const GblPoint &aPoint) const
Get jacobian for transformation from (trajectory) fit to kink parameters at point.
void milleOut(MilleBinary &aMille)
Write valid trajectory to Millepede-II binary file.
std::vector< GblData > getData()
bool isValid() const
Retrieve validity of trajectory.
GblTrajectory(const std::vector< GblPoint > &aPointList, bool flagCurv=true, bool flagU1dir=true, bool flagU2dir=true)
Create new (simple) trajectory from list of points.
void prepare()
Prepare fit for simple or composed trajectory.
std::vector< GblData > theData
List of data blocks.
bool constructOK
Trajectory has been successfully constructed (ready for fit/output)
TVectorD externalMeasurements
std::vector< unsigned int > measDataIndex
mapping points to data blocks from measurements
void buildLinearEquationSystem()
Build linear equation system from data (blocks).
unsigned int getScatResults(unsigned int aLabel, unsigned int &numRes, TVectorD &aResiduals, TVectorD &aMeasErrors, TVectorD &aResErrors, TVectorD &aDownWeights)
Get (kink) residuals from fit at point for scatterer.
unsigned int numParameters
Number of fit parameters.
unsigned int numMeasurements
Total number of measurements.
TMatrixDSym externalSeed
Precision (inverse covariance matrix) of external seed.
TMatrixD externalDerivatives
void printTrajectory(unsigned int level=0)
Print GblTrajectory.
bool fitOK
Trajectory has been successfully fitted (results are valid)
unsigned int numOffsets
Number of (points with) offsets on trajectory.
void getResAndErr(unsigned int aData, double &aResidual, double &aMeadsError, double &aResError, double &aDownWeight)
Get residual and errors from data block.
std::vector< unsigned int > theDimension
List of active dimensions (0=u1, 1=u2) in fit.
TVectorD externalPrecisions
unsigned int getNumPoints() const
Retrieve number of point from trajectory.
Millepede-II (binary) record.
Definition MilleBinary.h:68
Simple Vector based on std::vector<double>
Definition VMatrix.h:43
Namespace for the general broken lines package.