CMS 3D CMS Logo

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 
8 #ifndef GBLDATA_H_
9 #define GBLDATA_H_
10 
11 #include<iostream>
12 #include<vector>
13 #include<math.h>
14 #include "VMatrix.h"
15 #include "TVectorD.h"
16 #include "TMatrixD.h"
17 #include "TMatrixDSym.h"
18 
19 #include "Math/SMatrix.h"
20 #include "Math/SVector.h"
21 typedef ROOT::Math::SMatrix<double, 2, 5> SMatrix25;
22 typedef ROOT::Math::SMatrix<double, 2, 7> SMatrix27;
23 typedef ROOT::Math::SMatrix<double, 5, 5> SMatrix55;
24 
26 namespace gbl {
27 
29 
33 class GblData {
34 public:
35  GblData(unsigned int aLabel, double aMeas, double aPrec);
36  virtual ~GblData();
37  void addDerivatives(unsigned int iRow,
38  const std::vector<unsigned int> &labDer, const SMatrix55 &matDer,
39  unsigned int iOff, const TMatrixD &derLocal,
40  const std::vector<int> &labGlobal, const TMatrixD &derGlobal,
41  unsigned int nLocal, const TMatrixD &derTrans);
42  void addDerivatives(unsigned int iRow,
43  const std::vector<unsigned int> &labDer, const SMatrix27 &matDer,
44  unsigned int nLocal, const TMatrixD &derTrans);
45  void addDerivatives(const std::vector<unsigned int> &index,
46  const std::vector<double> &derivatives);
47 
48  void setPrediction(const VVector &aVector);
49  double setDownWeighting(unsigned int aMethod);
50  double getChi2() const;
51  void printData() const;
52  void getLocalData(double &aValue, double &aWeight,
53  std::vector<unsigned int>* &indLocal,
54  std::vector<double>* &derLocal);
55  void getAllData(double &aValue, double &aErr,
56  std::vector<unsigned int>* &indLocal,
57  std::vector<double>* &derLocal, std::vector<int>* &labGlobal,
58  std::vector<double>* &derGlobal);
59  void getResidual(double &aResidual, double &aVariance, double &aDownWeight,
60  std::vector<unsigned int>* &indLocal,
61  std::vector<double>* &derLocal);
62 
63 private:
64  unsigned int theLabel;
65  double theValue;
66  double thePrecision;
67  double theDownWeight;
68  double thePrediction;
69  std::vector<unsigned int> theParameters;
70  std::vector<double> theDerivatives;
71  std::vector<int> globalLabels;
72  std::vector<double> globalDerivatives;
73 };
74 }
75 #endif /* GBLDATA_H_ */
std::vector< unsigned int > theParameters
List of fit parameters (with non zero derivatives)
Definition: GblData.h:69
Data (block) for independent scalar measurement.
Definition: GblData.h:33
std::vector< double > theDerivatives
List of derivatives for fit.
Definition: GblData.h:70
ROOT::Math::SMatrix< double, 2, 7 > SMatrix27
Definition: GblData.h:22
GblData(unsigned int aLabel, double aMeas, double aPrec)
Create data block.
Definition: GblData.cc:19
void getLocalData(double &aValue, double &aWeight, std::vector< unsigned int > *&indLocal, std::vector< double > *&derLocal)
Get Data for local fit.
Definition: GblData.cc:202
double getChi2() const
Calculate Chi2 contribution.
Definition: GblData.cc:173
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:239
unsigned int theLabel
Label (of measurements point)
Definition: GblData.h:64
ROOT::Math::SMatrix< double, 5, 5 > SMatrix55
Definition: GblData.h:23
Namespace for the general broken lines package.
double theDownWeight
Down-weighting factor (0-1)
Definition: GblData.h:67
void setPrediction(const VVector &aVector)
Calculate prediction for data from fit (by GblTrajectory::fit).
Definition: GblData.cc:132
double thePrediction
Prediction from fit.
Definition: GblData.h:68
std::vector< int > globalLabels
Labels for global derivatives.
Definition: GblData.h:71
std::vector< double > globalDerivatives
Global derivatives.
Definition: GblData.h:72
double thePrecision
Precision (1/sigma**2)
Definition: GblData.h:66
void printData() const
Print data block.
Definition: GblData.cc:179
double setDownWeighting(unsigned int aMethod)
Outlier down weighting with M-estimators (by GblTrajectory::fit).
Definition: GblData.cc:144
virtual ~GblData()
Definition: GblData.cc:25
Simple Vector based on std::vector<double>
Definition: VMatrix.h:21
double theValue
Value (residual)
Definition: GblData.h:65
ROOT::Math::SMatrix< double, 2, 5 > SMatrix25
Definition: GblData.h:21
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:41
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:220