#include "hgeomvertexfit3.h"
#include <iostream>
HGeomVertexFit3::HGeomVertexFit3(void) {
}
HGeomVertexFit3::~HGeomVertexFit3(void) {
}
void HGeomVertexFit3::addLine(const HGeomVector &r, const HGeomVector &alpha,
const Double_t w) {
Float_t sx = alpha.getX() / alpha.getZ();
Float_t sy = alpha.getY() / alpha.getZ();
Float_t x0 = r.getX() - r.getZ()*sx;
Float_t y0 = r.getY() - r.getZ()*sy;
fM(0,0) = w * 1 ;
fM(0,1) = w * 0;
fM(0,2) = w * -sx;
fM(1,1) = w * 1;
fM(1,2) = w * -sy;
fM(2,2) = w * sx*sx + w * sy*sy;
fSys(0,0)+=fM(0,0);
fSys(0,1)+=fM(0,1);
fSys(0,2)+=fM(0,2);
fSys(1,1)+=fM(1,1);
fSys(1,2)+=fM(1,2);
fSys(2,2)+=fM(2,2);
fB.X() += w * x0;
fB.Y() += w * y0;
fB.Z() += - w * x0*sx - w * y0*sy;
}
void HGeomVertexFit3::getVertex(HGeomVector &out) {
Double_t det=0;
det=fSys(0,0)*fSys(1,1)*fSys(2,2) + fSys(0,1)*fSys(1,2)*fSys(0,2)
+ fSys(0,1)*fSys(1,2)*fSys(0,2) - fSys(0,2)*fSys(1,1)*fSys(0,2)
- fSys(0,1)*fSys(0,1)*fSys(2,2) - fSys(1,2)*fSys(1,2)*fSys(0,0);
fM(0,0)=fSys(1,1) * fSys(2,2) - fSys(1,2) * fSys(1,2);
fM(0,1)=fSys(1,2) * fSys(0,2) - fSys(0,1) * fSys(2,2);
fM(0,2)=fSys(0,1) * fSys(1,2) - fSys(1,1) * fSys(0,2);
fM(1,1)=fSys(0,0) * fSys(2,2) - fSys(0,2) * fSys(0,2);
fM(1,2)=fSys(0,1) * fSys(0,2) - fSys(0,0) * fSys(1,2);
fM(2,2)=fSys(0,0) * fSys(1,1) - fSys(0,1) * fSys(0,1);
fM(1,0)=fM(0,1);
fM(2,0)=fM(0,2);
fM(2,1)=fM(1,2);
fM/=(det);
#if DEBUG_LEVEL>1
cout << "Det= " << det << endl;
cout << "Equation system: \n";
for (Int_t i=0;i<3;i++) {
for (Int_t j=0;j<3;j++) cout << fSys(i,j) << "\t";
cout << fB(i) << endl;
}
cout << "Inverse system matrix: \n";
for (Int_t i=0;i<3;i++) {
for (Int_t j=0;j<i;j++) cout << "\t";
for (Int_t j=i;j<3;j++) cout << fM(i,j) << "\t";
cout << endl;
}
#endif
out=fM*fB;
}
void HGeomVertexFit3::reset(void) {
for (Int_t i=0;i<3;i++) {
for (Int_t j=0;j<3;j++) fM(i,j)=fSys(i,j)=0.0;
}
fB.setXYZ(0.0,0.0,0.0);
}
ClassImp(HGeomVertexFit3)
Last change: Sat May 22 12:56:53 2010
Last generated: 2010-05-22 12:56
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.