48 ,
int nloc,
double startfact,
int nstd
49 ,
double res_cut,
double res_cut_init)
53 cout <<
" * o o o " << endl;
54 cout <<
" o o o " << endl;
55 cout <<
" o ooooo o o o oo ooo oo ooo oo " << endl;
56 cout <<
" o o o o o o o o o o o o o o o o " << endl;
57 cout <<
" o o o o o o oooo o o oooo o o oooo " << endl;
58 cout <<
" o o o o o o o ooo o o o o " << endl;
59 cout <<
" o o o o o o oo o oo ooo oo ++ starts" << endl;
62 if (debug_mode) cout <<
"" << endl;
63 if (debug_mode) cout <<
"----------------------------------------------------" << endl;
64 if (debug_mode) cout <<
"" << endl;
65 if (debug_mode) cout <<
" Entering InitMille" << endl;
66 if (debug_mode) cout <<
"" << endl;
67 if (debug_mode) cout <<
"-----------------------------------------------------" << endl;
68 if (debug_mode) cout <<
"" << endl;
82 m_residual_cut = res_cut;
83 m_residual_cut_init = res_cut_init;
84 nglolay = nglo_on_lay;
85 nagb = nglo_on_lay*nlay;
89 if (debug_mode) cout <<
"Number of global parameters : " << nagb << endl;
90 if (debug_mode) cout <<
"Number of local parameters : " << nalc << endl;
91 if (debug_mode) cout <<
"Number of standard deviations : " << nstdev << endl;
93 if (nagb>mglobl || nalc>mlocal)
95 if (debug_mode) cout <<
"Two many parameters !!!!!" << endl;
101 for (
int i=0; i<nagb; i++)
111 for (
int j=0; j<nagb;j++)
119 for (
int i=0; i<nalc; i++)
123 for (
int j=0; j<nalc;j++)
136 for (
int i=0; i<nglo_on_lay; i++)
138 if (verbose_mode) cout <<
"GetDOF(" << i <<
")= " << DOF[i] << endl;
142 for (
int j=i*nlay; j<(i+1)*nlay; j++)
156 cout<<
"initial cfactr = "<<cfactr<<endl;
157 if (m_iteration) Millepede::InitUn(startfact);
169 if (debug_mode) cout <<
"" << endl;
170 if (debug_mode) cout <<
"----------------------------------------------------" << endl;
171 if (debug_mode) cout <<
"" << endl;
172 if (debug_mode) cout <<
" InitMille has been successfully called!" << endl;
173 if (debug_mode) cout <<
"" << endl;
174 if (debug_mode) cout <<
"-----------------------------------------------------" << endl;
175 if (debug_mode) cout <<
"" << endl;
196 if (index<0 || index>=nagb)
199 {pparm[index] = param;}
226 {psigm[index] = sigma;}
253bool Millepede::InitUn(
double cutfac)
255 cfactr = std::max(1.0, cutfac);
257 cout <<
"Initial cut factor is " << cfactr << endl;
279 cout <<
"Too many constraints !!!" << endl;
283 for (
int i=0; i<nagb; i++) {adercs[ncs][i] = dercs[i];}
287 cout <<
"Number of constraints increased to " << ncs << endl;
305bool Millepede::EquLoc(
double dergb[],
double derlc[],
double dernl[],
double rmeas,
double sigma)
311 for (
int i=0; i<nalc; i++)
315 for (
int i=0; i<nagb; i++)
324 double wght = 1.0/(sigma*sigma);
331 if (verbose_mode) cout<<
"meas "<<rmeas<<endl;
332 for (
int i=0; i<nalc; i++)
334 if (verbose_mode) cout<<
"i = "<<i<<
", derlc = "<<derlc[i]<<endl;
338 if (ialc == -1) ialc=i;
343 if (verbose_mode) cout << ialc <<
" / " << iblc << endl;
345 if (verbose_mode) cout<<
"weight "<<wght<<endl;
346 for (
int i=0; i<nagb; i++)
348 if (verbose_mode) cout<<
"i = "<<i<<
", dergb = "<<dergb[i]<<endl;
352 if (iagb == -1) iagb=i;
357 if (verbose_mode) cout << iagb <<
" / " << ibgb << endl;
360 arest.push_back(rmeas);
363 for (
int i=ialc; i<=iblc; i++)
368 arest.push_back(derlc[i]);
369 arenl.push_back(0.0);
375 arest.push_back(wght);
376 arenl.push_back(0.0);
378 for (
int i=iagb; i<=ibgb; i++)
383 arest.push_back(dergb[i]);
384 arenl.push_back(dernl[i]);
389 if (verbose_mode) cout <<
"Out Equloc -- NST = " << arest.size() << endl;
407 for(
int i=0; i<nalc; i++) {derlc[i] = 0.0;}
408 for(
int i=0; i<nagb; i++) {dergb[i] = 0.0;}
409 for(
int i=0; i<nagb; i++) {dernl[i] = 0.0;}
439 int i, j, k, ik, ij, ist, nderlc, ndergl, ndf;
444 double rmeas, wght, rms, cutval;
450 if(debug_mode) cout<<
"Start FitLoc, nst = "<<nst<<endl;
455 if (itert < 2 && single_fit != 1)
457 if (debug_mode) cout <<
"Store equation no: " <<
n << endl;
459 for (i=0; i<nst; i++)
461 storeind.push_back(indst[i]);
462 storeare.push_back(arest[i]);
463 storenl.push_back(arenl[i]);
465 if (arenl[i] != 0.) arest[i] = 0.0;
470 storeplace.push_back(storeind.size());
472 if (verbose_mode) cout <<
"StorePlace size = " << storeplace[
n] << endl;
473 if (verbose_mode) cout <<
"StoreInd size = " << storeind.size() << endl;
477 for (i=0; i<nalc; i++)
481 for (j=0; j<nalc; j++) {clmat[i][j] = 0.0;}
484 for (i=0; i<nagb; i++) {indnz[i] = -1;}
520 if (indst[ist] == -1)
522 if (ja == -1) {ja = ist;}
523 else if (jb == 0) {jb = ist;}
528 if (verbose_mode) cout <<
"rmeas = " << rmeas << endl ;
529 if (verbose_mode) cout <<
"wght = " << wght << endl ;
531 for (i=(jb+1); i<ist; i++)
535 if (verbose_mode) cout <<
"dparm[" << j <<
"] = " << dparm[j] << endl;
536 if (verbose_mode) cout <<
"Starting misalignment = " << pparm[j] << endl;
537 rmeas -= arest[i]*(pparm[j]+dparm[j]);
540 if (verbose_mode) cout <<
"rmeas after global stuff removal = " << rmeas << endl ;
542 for (i=(ja+1); i<jb; i++)
546 blvec[j] += wght*rmeas*arest[i];
548 if (verbose_mode) cout <<
"blvec[" << j <<
"] = " << blvec[j] << endl ;
550 for (k=(ja+1); k<=i ; k++)
554 clmat[j][ik] += wght*arest[i]*arest[k];
556 if (verbose_mode) cout <<
"clmat[" << j <<
"][" << ik <<
"] = " << clmat[j][ik] << endl;
573 nrank = Millepede::SpmInv(clmat, blvec, nalc, scdiag, scflag);
575 if (debug_mode) cout <<
"" << endl;
576 if (debug_mode) cout <<
" __________________________________________________" << endl;
577 if (debug_mode) cout <<
" Printout of local fit (FITLOC) with rank= "<< nrank << endl;
578 if (debug_mode) cout <<
" Result of local fit : (index/parameter/error)" << endl;
580 for (i=0; i<nalc; i++)
582 if (debug_mode) cout << std::setprecision(4) << std::fixed;
583 if (debug_mode) cout << std::setw(20) << i <<
" / " << std::setw(10)
584 << blvec[i] <<
" / " << sqrt(clmat[i][i]) << endl;
590 for (i=0; i<nalc; i++)
592 track_params[2*i] = blvec[i];
593 track_params[2*i+1] = sqrt(fabs(clmat[i][i]));
607 if (verbose_mode) cout<<
"ist , nst = "<<ist<<
", "<<nst<<endl;
608 if (indst[ist] == -1)
610 if (ja == -1) {ja = ist;}
611 else if (jb == 0) {jb = ist;}
622 if (verbose_mode) cout <<
"" << endl;
623 if (verbose_mode) cout << std::setprecision(4) << std::fixed;
624 if (verbose_mode) cout <<
". equation: measured value " << std::setw(13)
625 << rmeas <<
" +/- " << std::setw(13) << 1.0/sqrt(wght) << endl;
626 if (verbose_mode) cout <<
"Number of derivatives (global, local): "
627 << ndergl <<
", " << nderlc << endl;
628 if (verbose_mode) cout <<
"Global derivatives are: (index/derivative/parvalue) " << endl;
630 for (i=(jb+1); i<ist; i++)
631 {
if (verbose_mode) cout << indst[i] <<
" / " << arest[i]
632 <<
" / " << pparm[indst[i]] << endl;}
634 if (verbose_mode) cout <<
"Local derivatives are: (index/derivative) " << endl;
636 for (i=(ja+1); i<jb; i++) {
if (verbose_mode) cout << indst[i] <<
" / " << arest[i] << endl;}
640 for (i=(ja+1); i<jb; i++)
643 rmeas -= arest[i]*blvec[j];
646 for (i=(jb+1); i<ist; i++)
649 rmeas -= arest[i]*(pparm[j]+dparm[j]);
654 if (verbose_reject) cout <<
"Residual value : "<< rmeas << endl;
655 if (verbose_reject) cout <<
"Residual cut init value : "<< m_residual_cut_init << endl;
656 if (verbose_reject) cout <<
"Residual cut value : "<< m_residual_cut << endl;
659 if (fabs(rmeas) >= m_residual_cut_init && itert <= 1)
662 if (verbose_reject) cout <<
"Rejected track !!!!!" << endl;
669 if (fabs(rmeas) >= m_residual_cut && itert > 1)
672 if (verbose_reject) cout <<
"Rejected track !!!!!" << endl;
679 if(debug_mode) cout<<
"chisq , wght, rmeas = "<<summ<<
", "<<wght<<
", "<<rmeas<<endl;
680 summ += wght*rmeas*rmeas ;
691 if (debug_mode) cout<<
"nsum, nrank = "<<nsum<<
", "<<nrank<<endl;
694 if (debug_mode) cout <<
"Final chi square / degrees of freedom "<< summ <<
" / " << ndf << endl;
700 if (ndf > 0) rms = summ/float(ndf);
702 if (single_fit == 0) loctot++;
704 if (nstdev != 0 && ndf > 0 && single_fit != 1)
706 cutval = Millepede::chindl(nstdev, ndf)*cfactr;
707 if (debug_mode) cout<<
"nstdev, ndf, cfactr, cutval = "<<nstdev<<
", "<<ndf<<
", "<<cfactr<<
", "<<cutval<<endl;
709 if (debug_mode) cout <<
"Reject if Chisq/Ndf = " << rms <<
" > " << cutval << endl;
713 if (verbose_mode) cout <<
"Rejected track !!!!!" << endl;
714 if (single_fit == 0) locrej++;
734 ofstream fmill(
"mill.csv",ios::app);
736 fmill<<itert<<
", "<<
n <<
", "<< summ <<
", " << ndf <<
", "<<nsum<<
", "<<cutval<<
", "<< blvec[0]<<
", "<<blvec[1]<<
", "<<blvec[3]<<
", "<<blvec[4]<<
", "<<dparm[0]<<
", "<<dparm[3]<<
", "<<dparm[6]<<
", "<<dparm[9]<< endl;
746 if (indst[ist] == -1)
748 if (ja == -1) {ja = ist;}
749 else if (jb == 0) {jb = ist;}
755 for (i=(jb+1); i<ist; i++)
758 rmeas -= arest[i]*(pparm[j]+dparm[j]);
763 for (i=(jb+1); i<ist; i++)
767 bgvec[j] += wght*rmeas*arest[i];
768 if (verbose_mode) cout <<
"bgvec[" << j <<
"] = " << bgvec[j] << endl ;
770 for (k=(jb+1); k<ist ; k++)
773 cgmat[j][ik] += wght*arest[i]*arest[k];
774 if (verbose_mode) cout <<
"cgmat[" << j <<
"][" << ik <<
"] = " << cgmat[j][ik] << endl;
780 for (i=(jb+1); i<ist; i++)
787 for (k=0; k<nalc; k++) {clcmat[nagbn][k] = 0.0;}
795 for (k=(ja+1); k<jb ; k++)
798 clcmat[ik][ij] += wght*arest[i]*arest[k];
799 if (verbose_mode) cout <<
"clcmat[" << ik <<
"][" << ij <<
"] = " << clcmat[ik][ij] << endl;
812 Millepede::SpAVAt(clmat, clcmat, corrm, nalc, nagbn);
813 Millepede::SpAX(clcmat, blvec, corrv, nalc, nagbn);
815 for (i=0; i<nagbn; i++)
818 bgvec[j] -= corrv[i];
820 for (k=0; k<nagbn; k++)
823 cgmat[j][ik] -= corrm[i][k];
862 double trackpars[2*mlocal];
864 int ntotal_start, ntotal;
866 cout <<
"..... Making global fit ....." << endl;
870 std::vector<double> track_slopes;
872 track_slopes.resize(2*ntotal_start);
874 for (i=0; i<2*ntotal_start; i++) track_slopes[i] = 0.;
876 if (itert <= 1) itelim=10;
878 cout<<
"itert, itelim = "<<itert<<
", "<<itelim<<endl;
880 while (itert < itelim)
882 if (debug_mode) cout <<
"ITERATION --> " << itert << endl;
885 cout <<
"...using " << ntotal <<
" tracks..." << endl;
889 for (i=0; i<nagb; i++) {diag[i] = cgmat[i][i];}
895 for (i=0; i<nagb; i++)
901 for (j=0; j<nagb; j++)
907 else if (psigm[i] > 0.0)
909 cgmat[i][i] += 1.0/(psigm[i]*psigm[i]);
914 if (debug_mode) cout <<
"Number of constraint equations : " << ncs << endl;
918 for (i=0; i<ncs; i++)
921 for (j=0; j<nagb; j++)
923 cgmat[nvar][j] = float(ntotal)*adercs[i][j];
924 cgmat[j][nvar] = float(ntotal)*adercs[i][j];
925 sum -= adercs[i][j]*(pparm[j]+dparm[j]);
929 cgmat[nvar][nvar] = 0.0;
930 bgvec[nvar] = float(ntotal)*sum;
938 double final_cor = 0.0;
942 for (j=0; j<nagb; j++)
944 for (i=0; i<nagb; i++)
948 final_cor += step[j]*cgmat[j][i]*step[i];
949 if (i == j) final_cor -= step[i]*step[i]/(psigm[i]*psigm[i]);
955 cout <<
" Final coeff is " << final_cor << endl;
956 cout <<
" Final NDOFs = " << nagb << endl;
960 nrank = Millepede::SpmInv(cgmat, bgvec, nvar, scdiag, scflag);
962 for (i=0; i<nagb; i++)
964 dparm[i] += bgvec[i];
965 if (verbose_mode) cout <<
"dparm[" << i <<
"] = " << dparm[i] << endl;
966 if (verbose_mode) cout <<
"cgmat[" << i <<
"][" << i <<
"] = " << cgmat[i][i] << endl;
967 if (verbose_mode) cout <<
"err = " << sqrt(fabs(cgmat[i][i])) << endl;
971 if (itert == 1) error[i] = cgmat[i][i];
975 cout <<
"The rank defect of the symmetric " << nvar <<
" by " << nvar
976 <<
" matrix is " << nvar-nf-nrank <<
" (bad if non 0)" << endl;
978 if (itert == 0)
break;
982 cout <<
"Total : " << loctot <<
" local fits, "
983 << locrej <<
" rejected." << endl;
990 if (cfactr != cfactref && sqrt(cfactr) > 1.2*cfactref)
992 cfactr = sqrt(cfactr);
1000 if (itert == itelim)
break;
1002 cout <<
"Iteration " << itert <<
" with cut factor " << cfactr << endl;
1006 for (i=0; i<nvar; i++)
1009 for (j=0; j<nvar; j++)
1023 for (i=0; i<ntotal_start; i++)
1028 (i>0) ? rank_i =
abs(storeplace[i-1]) : rank_i = 0;
1029 rank_f = storeplace[i];
1031 if (verbose_mode) cout <<
"Track " << i <<
" : " << endl;
1032 if (verbose_mode) cout <<
"Starts at " << rank_i << endl;
1033 if (verbose_mode) cout <<
"Ends at " << rank_f << endl;
1043 for (j=rank_i; j<rank_f; j++)
1045 indst.push_back(storeind[j]);
1047 if (storenl[j] == 0) arest.push_back(storeare[j]);
1048 if (storenl[j] == 1) arest.push_back(track_slopes[2*i]*storeare[j]);
1049 if (storenl[j] == 2) arest.push_back(track_slopes[2*i+1]*storeare[j]);
1052 for (j=0; j<2*nalc; j++) {trackpars[j] = 0.;}
1056 track_slopes[2*i] = trackpars[2];
1057 track_slopes[2*i+1] = trackpars[6];
1060 if (verbose_mode) cout <<
"after inters>3 " << endl;
1066 if (verbose_mode) cout <<
"rank_f is "<< rank_f << endl;
1067 for (j=rank_i; j<rank_f; j++)
1069 if (verbose_mode) cout <<
"storeind "<<j<<
" is "<<storeind[j] << endl;
1070 if (verbose_mode) cout <<
"storearea "<<j<<
" is "<<storeare[j] << endl;
1071 if (verbose_mode) cout <<
"storenl "<<j<<
" is "<<storenl[j] << endl;
1073 indst.push_back(storeind[j]);
1074 if (verbose_mode) cout <<
"after 1st push_back " << endl;
1075 if (storenl[j] == 0) arest.push_back(storeare[j]);
1076 if (verbose_mode) cout <<
"after 2nd push_back " << endl;
1077 if (storenl[j] == 1) arest.push_back(track_slopes[2*i]*storeare[j]);
1078 if (verbose_mode) cout <<
"after 3rd push_back " << endl;
1079 if (storenl[j] == 2) arest.push_back(track_slopes[2*i+1]*storeare[j]);
1082 if (verbose_mode) cout <<
"after push_back arest " << endl;
1084 for (j=0; j<2*nalc; j++) {trackpars[j] = 0.;}
1088 if (verbose_mode) cout <<
"after invork FitLoc " << endl;
1092 : storeplace[i] = -rank_f;
1102 Millepede::PrtGlo();
1104 for (j=0; j<nagb; j++)
1108 pull[j] = par[j]/sqrt(psigm[j]*psigm[j]-cgmat[j][j]);
1109 error[j] = sqrt(fabs(cgmat[j][j]));
1114 ofstream ferr(
"merr.csv",ios::app);
1115 ferr<<ntotal<<
", "<< par[0]<<
", "<< error[0]<<
", "<<par[1]<<
", "<< error[1]<<
", "<<par[2]<<
", "<< error[2]<<
", "<<par[3]<<
", "<< error[3]<<
", "<<par[4]<<
", "<< error[4]<<
", "<<par[5]<<
", "<< error[5]<<
", "<<par[6]<<
", "<< error[6]<<
", "<<par[7] <<
", "<< error[7]<<
", "<<par[8]<<
", "<< error[8]<<
", "<<par[9]<<
", "<< error[9]<<
", "<<par[10]<<
", "<< error[10]<<
", "<<par[11]<<
", "<< error[11]<< endl;
1119 cout << std::setw(10) <<
" " << endl;
1120 cout << std::setw(10) <<
" * o o o " << endl;
1121 cout << std::setw(10) <<
" o o o " << endl;
1122 cout << std::setw(10) <<
" o ooooo o o o oo ooo oo ooo oo " << endl;
1123 cout << std::setw(10) <<
" o o o o o o o o o o o o o o o o " << endl;
1124 cout << std::setw(10) <<
" o o o o o o oooo o o oooo o o oooo " << endl;
1125 cout << std::setw(10) <<
" o o o o o o o ooo o o o o " << endl;
1126 cout << std::setw(10) <<
" o o o o o o oo o oo ooo oo ++ ends." << endl;
1127 cout << std::setw(10) <<
" o " << endl;
1147int Millepede::SpmInv(
double v[][mgl],
double b[],
int n,
double diag[],
bool flag[])
1152 double eps = 0.00000000000001;
1157 temp =
new double[
n];
1165 for (j=0; j<=i; j++) {
if (
v[j][i] == 0) {
v[j][i] =
v[i][j];}}
1174 if (fabs(
v[i][j]) >= r[i]) r[i] = fabs(
v[i][j]);
1175 if (fabs(
v[j][i]) >= c[i]) c[i] = fabs(
v[j][i]);
1181 if (0.0 != r[i]) r[i] = 1./r[i];
1182 if (0.0 != c[i]) c[i] = 1./c[i];
1190 for (j=0; j<
n; j++) {
v[i][j] = sqrt(r[i])*
v[i][j]*sqrt(c[j]);}
1196 for (i=0; i<
n; i++) {diag[i] = fabs(
v[i][i]);}
1205 if (flag[j] && (fabs(
v[j][j])>std::max(fabs(vkk),
eps*diag[j])))
1214 if (verbose_mode) cout <<
"Pivot value :" << vkk << endl;
1222 for (jj=0; jj<
n; jj++)
1224 if (j != k && jj != k)
1226 v[j][jj] =
v[j][jj] - vkk*
v[j][k]*
v[k][jj];
1235 v[j][k] = (
v[j][k])*vkk;
1236 v[k][j] = (
v[k][j])*vkk;
1262 for (j=0; j<
n; j++) {
v[i][j] = sqrt(c[i])*
v[i][j]*sqrt(r[j]);}
1269 for (jj=0; jj<
n; jj++)
1271 v[j][jj] = -
v[j][jj];
1272 temp[j] +=
v[j][jj]*b[jj];
1276 for (j=0; j<
n; j++) {b[j] = temp[j];}
1290int Millepede::SpmInv(
double v[][mlocal],
double b[],
int n,
double diag[],
bool flag[])
1294 double eps = 0.0000000000001;
1296 temp =
new double[
n];
1301 diag[i] = fabs(
v[i][i]);
1303 for (j=0; j<=i; j++)
1318 if (flag[j] && (fabs(
v[j][j])>std::max(fabs(vkk),
eps*diag[j])))
1334 for (jj=0; jj<
n; jj++)
1336 if (j != k && jj != k)
1338 v[j][jj] =
v[j][jj] - vkk*
v[j][k]*
v[k][jj];
1347 v[j][k] = (
v[j][k])*vkk;
1348 v[k][j] = (
v[k][j])*vkk;
1375 for (jj=0; jj<
n; jj++)
1377 v[j][jj] = -
v[j][jj];
1378 temp[j] +=
v[j][jj]*b[jj];
1413bool Millepede::SpAVAt(
double v[][mlocal],
double a[][mlocal],
double w[][mglobl],
int n,
int m)
1427 w[i][j] += a[i][k]*
v[k][l]*a[j][l];
1453bool Millepede::SpAX(
double a[][mlocal],
double x[],
double y[],
int n,
int m)
1463 y[i] += a[i][j]*
x[j];
1482bool Millepede::PrtGlo()
1487 cout <<
" Result of fit for global parameters" << endl;
1488 cout <<
" ===================================" << endl;
1489 cout <<
"-------------------------------------------------------"
1490 <<
"-------------------------------------------------------" << endl;
1491 cout <<
"I ParName initial final differ "
1492 <<
" lastcor Error gcor" << endl;
1495 string Pname[36] = {
1496 "Dx1",
"Dx2",
"Dx3",
"Dx4",
"Dx5",
"Dx6",
1497 "Dy1",
"Dy2",
"Dy3",
"Dy4",
"Dy5",
"Dy6",
1498 "Dz1",
"Dz2",
"Dz3",
"Dz4",
"Dz5",
"Dz6",
1499 "Rx1",
"Rx2",
"Rx3",
"Rx4",
"Rx5",
"Rx6",
1500 "Ry1",
"Ry2",
"Ry3",
"Ry4",
"Ry5",
"Ry6",
1501 "Rz1",
"Rz2",
"Rz3",
"Rz4",
"Rz5",
"Rz6"
1506 for (
int i=0; i<nagb; i++)
1508 err = sqrt(fabs(cgmat[i][i]));
1509 if (cgmat[i][i] < 0.0) err = -err;
1513 if (i%(nagb/nglolay) == 0)
1515 cout <<
"-------------------------------------------------------"
1516 <<
"-------------------------------------------------------" << endl;
1519 if (fabs(cgmat[i][i]*diag[i]) > 1E-7)
1521 cout << std::setprecision(4) << std::fixed;
1522 gcor = sqrt(fabs(1.0-1.0/(cgmat[i][i]*diag[i])));
1523 cout << std::setw(4) << i << std::setw(10)<<Pname[i]<<
" / " << std::setw(10) << pparm[i]
1524 <<
" / " << std::setw(10) << pparm[i]+ dparm[i]
1525 <<
" / " << std::setw(10) << dparm[i]
1526 <<
" / " << std::setw(10) << bgvec[i] <<
" / " << std::setw(10)
1527 << std::setprecision(5) << err <<
" / " << std::setw(10) << gcor << endl;
1531 cout << std::setw(4) << i << std::setw(10)<<Pname[i]<<
" / " << std::setw(10) <<
"OFF"
1532 <<
" / " << std::setw(10) <<
"OFF"
1533 <<
" / " << std::setw(10) <<
"OFF"
1534 <<
" / " << std::setw(10) <<
"OFF"
1535 <<
" / " << std::setw(10) <<
"OFF"
1536 <<
" / " << std::setw(10) <<
"OFF" << endl;
1539 cout <<
"-------------------------------------------------------"
1540 <<
"-------------------------------------------------------" << endl;
1554double Millepede::chindl(
int n,
int nd)
1557 double sn[3] = {0.47523, 1.690140, 2.782170};
1558 double table[3][30] = {{1.0000, 1.1479, 1.1753, 1.1798, 1.1775, 1.1730, 1.1680, 1.1630,
1559 1.1581, 1.1536, 1.1493, 1.1454, 1.1417, 1.1383, 1.1351, 1.1321,
1560 1.1293, 1.1266, 1.1242, 1.1218, 1.1196, 1.1175, 1.1155, 1.1136,
1561 1.1119, 1.1101, 1.1085, 1.1070, 1.1055, 1.1040},
1562 {4.0000, 3.0900, 2.6750, 2.4290, 2.2628, 2.1415, 2.0481, 1.9736,
1563 1.9124, 1.8610, 1.8171, 1.7791, 1.7457, 1.7161, 1.6897, 1.6658,
1564 1.6442, 1.6246, 1.6065, 1.5899, 1.5745, 1.5603, 1.5470, 1.5346,
1565 1.5230, 1.5120, 1.5017, 1.4920, 1.4829, 1.4742},
1566 {9.0000, 5.9146, 4.7184, 4.0628, 3.6410, 3.3436, 3.1209, 2.9468,
1567 2.8063, 2.6902, 2.5922, 2.5082, 2.4352, 2.3711, 2.3143, 2.2635,
1568 2.2178, 2.1764, 2.1386, 2.1040, 2.0722, 2.0428, 2.0155, 1.9901,
1569 1.9665, 1.9443, 1.9235, 1.9040, 1.8855, 1.8681}};
1577 m = std::max(1,std::min(
n,3));
1581 return table[m-1][nd-1];
1585 return ((sn[m-1]+sqrt(
float(2*nd-3)))*(sn[m-1]+sqrt(
float(2*nd-3))))/float(2*nd-2);
double abs(const EvtComplex &c)
EvtTensor3C eps(const EvtVector3R &v)
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
bool InitMille(bool DOF[], double Sigm[], int nlay, int nglo_on_lay, int nloc, double startfact, int nstd, double res_cut, double res_cut_init)
void SetTrackNumber(int value)
bool ZerLoc(double dergb[], double derlc[], double dernl[])
bool EquLoc(double dergb[], double derlc[], double dernl[], double rmeas, double sigma)
bool MakeGlobalFit(double par[], double error[], double pull[])
bool ParGlo(int index, double param)
bool FitLoc(int n, double track_params[], int single_fit)
bool ParSig(int index, double sigma)
Millepede()
Standard constructor.
bool ConstF(double dercs[], double rhs)