CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
Chi2 Class Reference

#include <Chi2.h>

Public Member Functions

 Chi2 (TMatrixD &, TMatrixD &, TMatrixD &)
 
double getChi2 ()
 
TMatrixD & getCovariance ()
 
int getDOF ()
 
TMatrixD & getSolution ()
 
 ~Chi2 ()
 

Private Attributes

TMatrixD covariance
 
int dof
 
TMatrixD leftMatrix
 
double myChi2
 
TMatrixD rightMatrix
 
TMatrixD solution
 

Detailed Description

Chi2 calculation in survey data for drift tube chambers

Date
2007/04/13 18:05:35
Revision
1.1
Author
Pablo Martinez Ruiz del Arbol

Definition at line 15 of file Chi2.h.

Constructor & Destructor Documentation

Chi2::Chi2 ( TMatrixD &  m,
TMatrixD &  ym,
TMatrixD &  merrors 
)

Definition at line 3 of file Chi2.cc.

References covariance, dof, leftMatrix, funct::m, TtSemiLepEvtBuilder_cfi::mt, myChi2, rightMatrix, and solution.

3  {
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 }
TMatrixD covariance
Definition: Chi2.h:28
TMatrixD rightMatrix
Definition: Chi2.h:30
TMatrixD solution
Definition: Chi2.h:31
double myChi2
Definition: Chi2.h:26
TMatrixD leftMatrix
Definition: Chi2.h:29
int dof
Definition: Chi2.h:27
Chi2::~Chi2 ( )

Definition at line 24 of file Chi2.cc.

24 {}

Member Function Documentation

double Chi2::getChi2 ( )

Definition at line 28 of file Chi2.cc.

References myChi2.

28 { return myChi2; }
double myChi2
Definition: Chi2.h:26
TMatrixD & Chi2::getCovariance ( )

Definition at line 26 of file Chi2.cc.

References covariance.

Referenced by DTSurveyChamber::compute().

26 { return covariance; }
TMatrixD covariance
Definition: Chi2.h:28
int Chi2::getDOF ( )

Definition at line 29 of file Chi2.cc.

References dof.

29 { return dof; }
int dof
Definition: Chi2.h:27
TMatrixD & Chi2::getSolution ( )

Definition at line 27 of file Chi2.cc.

References solution.

Referenced by DTSurveyChamber::compute().

27 { return solution; }
TMatrixD solution
Definition: Chi2.h:31

Member Data Documentation

TMatrixD Chi2::covariance
private

Definition at line 28 of file Chi2.h.

Referenced by Chi2(), and getCovariance().

int Chi2::dof
private

Definition at line 27 of file Chi2.h.

Referenced by Chi2(), and getDOF().

TMatrixD Chi2::leftMatrix
private

Definition at line 29 of file Chi2.h.

Referenced by Chi2().

double Chi2::myChi2
private

Definition at line 26 of file Chi2.h.

Referenced by Chi2(), and getChi2().

TMatrixD Chi2::rightMatrix
private

Definition at line 30 of file Chi2.h.

Referenced by Chi2().

TMatrixD Chi2::solution
private

Definition at line 31 of file Chi2.h.

Referenced by Chi2(), and getSolution().