Belle II Software  release-08-01-10
GblData.h
Go to the documentation of this file.
1 /*
2  * GblData.h
3  *
4  * Created on: Aug 18, 2011
5  * Author: kleinwrt
6  */
7 
30 #ifndef GBLDATA_H_
31 #define GBLDATA_H_
32 
33 #include<iostream>
34 #include<vector>
35 #include<math.h>
36 #include "VMatrix.h"
37 #include "TVectorD.h"
38 #include "TMatrixD.h"
39 #include "TMatrixDSym.h"
40 
41 #include "Math/SMatrix.h"
42 #include "Math/SVector.h"
43 typedef ROOT::Math::SMatrix<double, 2, 5> SMatrix25;
44 typedef ROOT::Math::SMatrix<double, 2, 7> SMatrix27;
45 typedef ROOT::Math::SMatrix<double, 5, 5> SMatrix55;
46 
48 namespace gbl {
49 
51 
55 class GblData {
56 public:
57  GblData() : theLabel(0), theValue(0.), thePrecision(-1.), theDownWeight(0.), thePrediction(0.) {};
58  GblData(unsigned int aLabel, double aMeas, double aPrec);
59  virtual ~GblData();
60  void addDerivatives(unsigned int iRow,
61  const std::vector<unsigned int> &labDer, const SMatrix55 &matDer,
62  unsigned int iOff, const TMatrixD &derLocal,
63  const std::vector<int> &labGlobal, const TMatrixD &derGlobal,
64  unsigned int nLocal, const TMatrixD &derTrans);
65  void addDerivatives(unsigned int iRow,
66  const std::vector<unsigned int> &labDer, const SMatrix27 &matDer,
67  unsigned int nLocal, const TMatrixD &derTrans);
68  void addDerivatives(const std::vector<unsigned int> &index,
69  const std::vector<double> &derivatives);
70 
71  void setPrediction(const VVector &aVector);
72  double setDownWeighting(unsigned int aMethod);
73  double getChi2() const;
74  void printData() const;
75  void getLocalData(double &aValue, double &aWeight,
76  std::vector<unsigned int>* &indLocal,
77  std::vector<double>* &derLocal);
78  void getAllData(double &aValue, double &aErr,
79  std::vector<unsigned int>* &indLocal,
80  std::vector<double>* &derLocal, std::vector<int>* &labGlobal,
81  std::vector<double>* &derGlobal);
82  void getResidual(double &aResidual, double &aVariance, double &aDownWeight,
83  std::vector<unsigned int>* &indLocal,
84  std::vector<double>* &derLocal);
85 
86 private:
87  unsigned int theLabel;
88  double theValue;
89  double thePrecision;
90  double theDownWeight;
91  double thePrediction;
92  std::vector<unsigned int> theParameters;
93  std::vector<double> theDerivatives;
94  std::vector<int> globalLabels;
95  std::vector<double> globalDerivatives;
96 
97  ClassDef(GblData, 1)
98 };
99 }
100 #endif /* GBLDATA_H_ */
VMatrix definition.
Data (block) for independent scalar measurement.
Definition: GblData.h:55
double theDownWeight
Down-weighting factor (0-1)
Definition: GblData.h:90
double setDownWeighting(unsigned int aMethod)
Outlier down weighting with M-estimators (by GblTrajectory::fit).
Definition: GblData.cc:166
double getChi2() const
Calculate Chi2 contribution.
Definition: GblData.cc:195
unsigned int theLabel
Label (of measurements point)
Definition: GblData.h:87
void getAllData(double &aValue, double &aErr, std::vector< unsigned int > *&indLocal, std::vector< double > *&derLocal, std::vector< int > *&labGlobal, std::vector< double > *&derGlobal)
Get all Data for MP-II binary record.
Definition: GblData.cc:242
std::vector< int > globalLabels
Labels for global derivatives.
Definition: GblData.h:94
double theValue
Value (residual)
Definition: GblData.h:88
std::vector< double > globalDerivatives
Global derivatives.
Definition: GblData.h:95
std::vector< unsigned int > theParameters
List of fit parameters (with non zero derivatives)
Definition: GblData.h:92
void addDerivatives(unsigned int iRow, const std::vector< unsigned int > &labDer, const SMatrix55 &matDer, unsigned int iOff, const TMatrixD &derLocal, const std::vector< int > &labGlobal, const TMatrixD &derGlobal, unsigned int nLocal, const TMatrixD &derTrans)
Add derivatives from measurement.
Definition: GblData.cc:63
void setPrediction(const VVector &aVector)
Calculate prediction for data from fit (by GblTrajectory::fit).
Definition: GblData.cc:154
double thePrecision
Precision (1/sigma**2)
Definition: GblData.h:89
void getResidual(double &aResidual, double &aVariance, double &aDownWeight, std::vector< unsigned int > *&indLocal, std::vector< double > *&derLocal)
Get data for residual (and errors).
Definition: GblData.cc:261
std::vector< double > theDerivatives
List of derivatives for fit.
Definition: GblData.h:93
void printData() const
Print data block.
Definition: GblData.cc:201
void getLocalData(double &aValue, double &aWeight, std::vector< unsigned int > *&indLocal, std::vector< double > *&derLocal)
Get Data for local fit.
Definition: GblData.cc:224
double thePrediction
Prediction from fit.
Definition: GblData.h:91
Simple Vector based on std::vector<double>
Definition: VMatrix.h:43
Namespace for the general broken lines package.