GeneralBrokenLines  trunk_rev46
 All Classes Files Functions Variables Typedefs Pages
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 
8 #ifndef GBLTRAJECTORY_H_
9 #define GBLTRAJECTORY_H_
10 
11 #include "GblPoint.h"
12 #include "GblData.h"
13 #include "GblPoint.h"
14 #include "BorderedBandMatrix.h"
15 #include "MilleBinary.h"
16 #include "TMatrixDSymEigen.h"
17 
19 
24 public:
25  GblTrajectory(const std::vector<GblPoint> &aPointList, bool flagCurv = true,
26  bool flagU1dir = true, bool flagU2dir = true);
27  GblTrajectory(const std::vector<GblPoint> &aPointList, unsigned int aLabel,
28  const TMatrixDSym &aSeed, bool flagCurv = true, bool flagU1dir =
29  true, bool flagU2dir = true);
31  const std::vector<std::pair<std::vector<GblPoint>, TMatrixD> > &aPointaAndTransList);
33  const std::vector<std::pair<std::vector<GblPoint>, TMatrixD> > &aPointaAndTransList,
34  const TMatrixD &extDerivatives, const TVectorD &extMeasurements,
35  const TVectorD &extPrecisions);
36  virtual ~GblTrajectory();
37  unsigned int getNumPoints() const;
38  unsigned int getResults(int aSignedLabel, TVectorD &localPar,
39  TMatrixDSym &localCov) const;
40  unsigned int getMeasResults(unsigned int aLabel, unsigned int &numRes,
41  TVectorD &aResiduals, TVectorD &aMeasErrors, TVectorD &aResErrors,
42  TVectorD &aDownWeights);
43  unsigned int getScatResults(unsigned int aLabel, unsigned int &numRes,
44  TVectorD &aResiduals, TVectorD &aMeasErrors, TVectorD &aResErrors,
45  TVectorD &aDownWeights);
46  unsigned int fit(double &Chi2, int &Ndf, double &lostWeight,
47  std::string optionList = "");
48  void milleOut(MilleBinary &aMille);
49 
50 private:
51  unsigned int numAllPoints;
52  std::vector<unsigned int> numPoints;
53  unsigned int numTrajectories;
54  unsigned int numOffsets;
55  unsigned int numInnerTrans;
56  unsigned int numCurvature;
57  unsigned int numParameters;
58  unsigned int numLocals;
59  unsigned int numMeasurements;
60  unsigned int externalPoint;
61  bool fitOK;
62  std::vector<unsigned int> theDimension;
63  std::vector<std::vector<GblPoint> > thePoints;
64  std::vector<GblData> theData;
65  std::vector<unsigned int> measDataIndex;
66  std::vector<unsigned int> scatDataIndex;
67  std::vector<unsigned int> externalIndex;
68  TMatrixDSym externalSeed;
69  std::vector<TMatrixD> innerTransformations;
70  // composed trajectory (from common external parameters)
71  TMatrixD externalDerivatives; // Derivatives for external measurements of composed trajectory
72  TVectorD externalMeasurements; // Residuals for external measurements of composed trajectory
73  TVectorD externalPrecisions; // Precisions for external measurements of composed trajectory
76 
77  std::pair<std::vector<unsigned int>, TMatrixD> getJacobian(
78  int aSignedLabel) const;
79  void getFitToLocalJacobian(std::vector<unsigned int> &anIndex,
80  SMatrix55 &aJacobian, const GblPoint &aPoint, unsigned int measDim,
81  unsigned int nJacobian = 1) const;
82  void getFitToKinkJacobian(std::vector<unsigned int> &anIndex,
83  SMatrix27 &aJacobian, const GblPoint &aPoint) const;
84  void construct();
85  void defineOffsets();
86  void calcJacobians();
87  void prepare();
89  void predict();
90  double downWeight(unsigned int aMethod);
91  void getResAndErr(unsigned int aData, double &aResidual,
92  double &aMeadsError, double &aResError, double &aDownWeight);
93 };
94 
95 #endif /* GBLTRAJECTORY_H_ */