32 for(
unsigned int i = 0;
i <
n;
i++)
42 if(z != z || x != x || sigx != sigx)
49 fwx[
i] = 1.0/(sigx*sigx);
58 if(Z != Z || sigSJ != sigSJ)
64 fwSJ[
j] = 1.0/(sigSJ*sigSJ);
72 for (i=0; i<
fn; ++
i) {
73 for (j=0; j<
fN; ++
j) {
87 for (i=0; i<
fn; ++
i) {
90 for (j=0; j<
fN; ++
j) {
102 unsigned int i,
J,
K;
108 for (i=0; i<
fn; ++
i) {
112 sum11 += fwxfz*fz[
i];
122 for (J=0; J<
fN; ++
J) {
125 for (i=0; i<
fn; ++
i) {
128 sum1J2 +=
fz[
i]*fwxZeta;
130 fAinv[0][J+2] = sum0J2;
131 fAinv[J+2][0] = sum0J2;
132 fAinv[1][J+2] = sum1J2;
133 fAinv[J+2][1] = sum1J2;
137 for (J=0; J<
fN; ++
J) {
138 for (K=J; K<
fN; ++
K) {
141 if (J==K) sum +=
fwSJ[
J];
153 fAinv.InvertFast(&det);
157 <<
" Matrix inversion failed" <<
std::endl;
163 <<
" Matrix inversion failed" <<
std::endl;
197 for (i=0; i<
fn; ++
i) {
199 for (j=0; j<
fN; ++
j) {
212 for (j=0; j<
fN; ++
j) {
214 if (zeta>0.0) x +=
fAlpha[
j]*zeta;
242 for (j=0; j<
fN; ++
j) alpha[j] =
fAlpha[j];
302 for (i=0; i<
fn; ++
i)
fx[i] = 0.0;
TMatrixTSym< double > fAinv
System of equations, Eqn. 29.
std::vector< double > fz
Measurement plane longitudinal locations.
const unsigned int kSIGX
non-positive value of sigx
double Chi2XIi(unsigned int i) const
After fit, contribution to chi^2 of the ith measurement.
double J(double q0, double q3, double Enu, double ml)
void SetScatteringPlane(unsigned int j, double Z, double sigSJ)
Set Z location of a scattering plane j.
void SetMeasurement(unsigned int i, double z, double x, double sigx)
Add measurements.
Lutz(unsigned int n, unsigned int N)
Construct a fitter for n measurements and N scattering planes.
const unsigned int kNAN
nan encountered
std::vector< double > fZ
Location of scattering planes.
"Break-point" track fitter
unsigned int fn
Number of measurements.
double fa
Fitted intercept.
double X(double z) const
After fit, best-fit x location of track at location z.
const unsigned int kNn
number of scat surf >= number of measurements
void Fit(double *a, double *b, double *alpha, double *chi2)
Do the fit.
TMatrixT< double > fD
Eqn. 31.
TVectorT< double > fXI
Measurements in transverse location.
std::vector< double > fwx
Measurement weight (1/sigx^2)
std::vector< double > fwSJ
Scattering angle weight (1/sigSJ^2)
double Chi2BetaJ(unsigned int j) const
After fit, contribution to chi^2 of the jth scattering plane.
const unsigned int kINDEX
index problem
std::vector< double > fAlpha
Fitted scatters.
const unsigned int kSIGSJ
non-positive value of sigSJ
std::vector< std::vector< double > > fZeta
measurement-scattering plane distances
unsigned int fN
Number of scattering planes.
std::vector< double > fx
Fitted track locations.