CMS 3D CMS Logo

Chi2.cc
Go to the documentation of this file.
2 
3 Chi2::Chi2(TMatrixD &m, TMatrixD &ym, TMatrixD &merrors) {
4  TMatrixD mt = m;
5  mt.T();
6  TMatrixD yt = ym;
7  yt.T();
8  TMatrixD m_leftMatrix(mt * merrors * m);
9  TMatrixD m_rightMatrix(mt * merrors * ym);
10  leftMatrix.ResizeTo(m_leftMatrix.GetNrows(), m_leftMatrix.GetNcols());
11  rightMatrix.ResizeTo(m_rightMatrix.GetNrows(), m_rightMatrix.GetNcols());
12  covariance.ResizeTo(m_leftMatrix.GetNrows(), m_leftMatrix.GetNrows());
13  rightMatrix = m_rightMatrix;
14  leftMatrix = m_leftMatrix;
15  covariance = m_leftMatrix.Invert();
16  TMatrixD m_solution(covariance * m_rightMatrix);
17  solution.ResizeTo(m_solution.GetNrows(), m_solution.GetNcols());
18  solution = m_solution;
19  TMatrixD m_Chi2((yt - m_solution.T() * mt) * merrors * (ym - m * solution));
20  myChi2 = m_Chi2(0, 0);
21  dof = ym.GetNrows() - solution.GetNrows();
22 }
23 
25 
26 TMatrixD &Chi2::getCovariance() { return covariance; }
27 TMatrixD &Chi2::getSolution() { return solution; }
28 double Chi2::getChi2() { return myChi2; }
29 int Chi2::getDOF() { return dof; }
Chi2::~Chi2
~Chi2()
Definition: Chi2.cc:24
Chi2::getSolution
TMatrixD & getSolution()
Definition: Chi2.cc:27
Chi2::leftMatrix
TMatrixD leftMatrix
Definition: Chi2.h:29
Chi2.h
Chi2::dof
int dof
Definition: Chi2.h:27
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
Chi2::covariance
TMatrixD covariance
Definition: Chi2.h:28
Chi2::getDOF
int getDOF()
Definition: Chi2.cc:29
Chi2::myChi2
double myChi2
Definition: Chi2.h:26
Chi2::getChi2
double getChi2()
Definition: Chi2.cc:28
Chi2::solution
TMatrixD solution
Definition: Chi2.h:31
Chi2::rightMatrix
TMatrixD rightMatrix
Definition: Chi2.h:30
Chi2::getCovariance
TMatrixD & getCovariance()
Definition: Chi2.cc:26
TtSemiLepEvtBuilder_cfi.mt
mt
Definition: TtSemiLepEvtBuilder_cfi.py:47
Chi2::Chi2
Chi2(TMatrixD &, TMatrixD &, TMatrixD &)
Definition: Chi2.cc:3