16#include <TStopwatch.h>
61 fNLagrangeConstraints(0),
65 fGloSolveStatus(kFailed),
75 fRecChi2File(nullptr),
76 fRecChi2FName(
"chi2_records.root"),
77 fRecChi2TreeName(
"chi2Records"),
80 fIsChi2BelowLimit(true),
86 fUseRecordWeight(true),
92 fAccRunListWgh(nullptr),
94 fRecordWriter(nullptr),
95 fConstraintsRecWriter(nullptr),
96 fRecordReader(nullptr),
97 fConstraintsRecReader(nullptr)
100 LOGF(info,
"MillePede2 instantiated");
114 fNLagrangeConstraints(0),
116 fNLocFitsRejected(0),
118 fGloSolveStatus(kFailed),
127 fMatCGloLoc(nullptr),
128 fRecChi2File(nullptr),
129 fRecChi2FName(
"chi2_records.root"),
130 fRecChi2TreeName(
"chi2Records"),
133 fIsChi2BelowLimit(true),
139 fUseRecordWeight(true),
143 fRejRunList(nullptr),
144 fAccRunList(nullptr),
145 fAccRunListWgh(nullptr),
147 fRecordWriter(nullptr),
148 fConstraintsRecWriter(nullptr),
149 fRecordReader(nullptr),
150 fConstraintsRecReader(nullptr),
151 fDisableRecordWriter(false)
182 LOG(info) <<
"MillePede2 - Closed file "
186 LOGF(
debug,
"MillePede2 destroyed");
191 const int lNStdDev,
const double lResCut,
192 const double lResCutInit,
const std::vector<int>& regroup)
195 if (regroup.size()) {
199 for (
int i = 0;
i < nGlo;
i++) {
200 if (regroup[
i] >= 0) {
202 if (regroup[
i] > maxPID) {
209 "MillePede2 - Regrouping is requested: from %d raw to %d formal globals grouped to %d real globals",
219 if (lResCutInit > 0) {
273 LOG(warning) <<
"MillePede2::InitChi2Storage() - output tree already initialized";
281 "MillePede2::InitChi2Storage() - failed to initialise chi2 storage file %s!",
288 fTreeChi2->SetAutoSave(nEntriesAutoSave);
295 LOG(error) <<
"MillePede2::InitChi2Storage() - failed to initialise TTree !";
298 LOGF(info,
"MillePede2::InitChi2Storage() - chi2 storage file %s",
309 LOG(info) <<
"MillePede2::EndChi2Storage() - wrote tree "
316 const double lMeas,
const double lSigma)
320 LOG(fatal) <<
"MillePede2::SetLocalEquation() - aborted: null pointer to record writer";
324 LOG(fatal) <<
"MillePede2::SetLocalEquation() - aborted: unintialised record writer";
364 int ngb, std::vector<int>& indlc,
365 std::vector<double>& derlc,
const int nlc,
366 const double lMeas,
const double lSigma)
370 LOG(fatal) <<
"MillePede2::SetLocalEquation() - aborted: null pointer to record writer";
374 LOG(fatal) <<
"MillePede2::SetLocalEquation() - aborted: unintialised record writer";
380 for (
int i = nlc;
i--;) {
383 for (
int i = ngb;
i--;) {
392 for (
int i = 0;
i < nlc;
i++) {
403 for (
int i = 0;
i < ngb;
i++) {
414 const double val,
const double sigma,
418 LOG(fatal) <<
"MillePede2::SetGlobalConstraint() - aborted: null pointer to record writer";
422 LOG(fatal) <<
"MillePede2::SetGlobalConstraint() - aborted: unintialised record writer";
440 LOG(info) <<
"MillePede2::SetGlobalConstraint() - new constraints added";
447 const std::vector<double>& dergb,
448 const int ngb,
const double val,
449 const double sigma,
const bool doPrint)
452 LOG(fatal) <<
"MillePede2::SetGlobalConstraint() - aborted: null pointer to record writer";
456 LOG(fatal) <<
"MillePede2::SetGlobalConstraint() - aborted: unintialised record writer";
464 for (
int i = 0;
i < ngb;
i++) {
474 LOG(info) <<
"MillePede2::SetGlobalConstraint() - new constraints added";
483 LOG(error) <<
"MillePede2::ReadRecordData() - aborted, input record reader is a null pointer";
495 LOG(error) <<
"MillePede2::ReadRecordConstraint() - aborted, input record reader is a null pointer";
506 static int nrefSize = 0;
508 static int *refLoc =
nullptr, *refGlo =
nullptr, *nrefLoc =
nullptr, *nrefGlo =
nullptr;
522 while (cnt < recSz) {
524 if (nrefSize <= nPoints) {
526 nrefSize = 2 * (nPoints + 1);
528 refLoc =
new int[nrefSize];
530 memcpy(refLoc, tmpA, nPoints *
sizeof(
int));
533 refGlo =
new int[nrefSize];
535 memcpy(refGlo, tmpA, nPoints *
sizeof(
int));
538 nrefLoc =
new int[nrefSize];
540 memcpy(nrefLoc, tmpA, nPoints *
sizeof(
int));
543 nrefGlo =
new int[nrefSize];
545 memcpy(nrefGlo, tmpA, nPoints *
sizeof(
int));
549 refLoc[nPoints] = ++cnt;
555 nrefLoc[nPoints] = nLoc;
557 refGlo[nPoints] = ++cnt;
563 nrefGlo[nPoints] = nGlo;
579 for (
int ip = nPoints; ip--;) {
582 int odd = (ip & 0x1);
591 for (
int i = nrefGlo[ip];
i--;) {
615 for (
int i = nrefLoc[ip];
i--;) {
617 if (indLoc[
i] > maxLocUsed) {
618 maxLocUsed = indLoc[
i];
620 for (
int j =
i + 1;
j--;) {
621 matCLoc(indLoc[
i], indLoc[
j]) +=
weight * derLoc[
i] * derLoc[
j];
636 if (!matCLoc.
SolveChol(pVecBLoc,
true)) {
637 LOG(warning) <<
"MillePede2 - Failed to solve locals by Cholesky, trying Gaussian Elimination";
639 LOG(warning) <<
"MillePede2 - Failed to solve locals by Gaussian Elimination, skip...";
648 if (localParams.size()) {
649 for (
int i = maxLocUsed;
i--;) {
651 localParams[2 *
i + 1] = TMath::Sqrt(TMath::Abs(matCLoc.
QueryDiag(
i)));
657 for (
int ip = nPoints; ip--;) {
660 int odd = (ip & 0x1);
670 for (
int i = nrefLoc[ip];
i--;) {
674 for (
int i = nrefGlo[ip];
i--;) {
687 double absres = TMath::Abs(resid);
692 LOGF(info,
"MillePede2 - reject res %+e in record %5ld ", resid,
fCurrRecDataID);
696 lChi2 +=
weight * resid * resid;
701 int nDoF = nEq - maxLocUsed;
702 lChi2 = (nDoF > 0) ? lChi2 / nDoF : 0;
714 LOGF(
debug,
"MillePede2 - reject chi2 %+e record %5ld: (nDOF %d)", lChi2,
fCurrRecDataID, nDoF);
732 for (
int ip = nPoints; ip--;) {
735 int odd = (ip & 0x1);
744 for (
int i = nrefGlo[ip];
i--;) {
756 for (
int ig = nrefGlo[ip]; ig--;) {
757 int iIDg = indGlo[ig];
769 for (
int jg = ig + 1; jg--;) {
770 int jIDg = indGlo[jg];
786 double* rowGL = matCGloLoc(nGloInFit);
787 for (
int k = maxLocUsed; k--;) {
794 double* rowGLIDg = matCGloLoc(iCIDg);
795 for (
int il = nrefLoc[ip]; il--;) {
796 rowGLIDg[indLoc[il]] +=
weight * derGlo[ig] * derLoc[il];
814 for (
int iCIDg = 0; iCIDg < nGloInFit; iCIDg++) {
818 double* rowGLIDg = matCGloLoc(iCIDg);
819 for (
int kl = 0; kl < maxLocUsed; kl++) {
829 for (
int jCIDg = 0; jCIDg <= iCIDg; jCIDg++) {
833 double* rowGLJDg = matCGloLoc(jCIDg);
834 for (
int kl = 0; kl < maxLocUsed; kl++) {
836 if ((!
IsZero(vll = rowGLIDg[kl] * rowGLJDg[kl]))) {
841 for (
int ll = 0; ll < kl; ll++) {
842 if (!
IsZero(vll = rowGLIDg[kl] * rowGLJDg[ll])) {
843 vl += matCLoc(kl, ll) * vll;
845 if (!
IsZero(vll = rowGLIDg[ll] * rowGLJDg[kl])) {
846 vl += matCLoc(kl, ll) * vll;
867 for (
int i = nGloInFit;
i--;) {
881 std::vector<double>& error,
882 std::vector<double>& pull)
885 LOG(fatal) <<
"MillePede2::GlobalFit() - aborted, input record reader is a null pointer";
894 LOG(info) <<
"MillePede2 - Starting Global fit.";
913 LOGF(info,
"MillePede2 - Global fit %s, CPU time: %.1f",
res ?
"Converged" :
"Failed",
sw.CpuTime());
943 LOGF(info,
"MillePede2 - Global Fit Iteration#%2d (Local Fit Chi^2 cut factor: %.2f)",
fIter,
fChi2CutFactor);
946 LOG(info) <<
"MillePede2::GlobalFitIteration() - no record is accessible, stopping iteration";
950 LOG(info) <<
"MillePede2::GlobalFitIteration() - zero global parameter, stopping iteration";
997 LOGF(info,
"MillePede2 - Building the Global matrix from data records %ld : %ld",
first, last);
1005 for (
long i = 0;
i < ndr;
i++) {
1011 std::vector<double> emptyLocalParams = {};
1013 if ((
i %
int(0.2 * ndr)) == 0) {
1014 printf(
"%.1f%% of local fits done\n",
double(100. *
i) / ndr);
1018 LOGF(info,
"MillePede2 - %ld local fits done: ", ndr);
1030 LOGF(info,
"MillePede2 - Checking parameters with statistics < %d",
fMinPntValid);
1034 int fixArrSize = 10;
1035 int nFixedGroups = 0;
1036 TArrayI fixGroups(fixArrSize);
1040 double oldMin = 1.e20;
1041 double oldMax = -1.e20;
1049 if (grID != grIDold) {
1052 for (
int iold = oldStart; iold >
i; iold--) {
1056 for (
int j = nFixedGroups;
j--;) {
1057 if (fixGroups[
j] == grIDold) {
1063 if (nFixedGroups >= fixArrSize) {
1065 fixGroups.Set(fixArrSize);
1067 fixGroups[nFixedGroups++] = grIDold;
1085 for (
int iold = oldStart; iold--;) {
1089 for (
int j = nFixedGroups;
j--;) {
1090 if (fixGroups[
j] == grIDold) {
1096 if (nFixedGroups >= fixArrSize) {
1098 fixGroups.Set(fixArrSize);
1100 fixGroups[nFixedGroups++] = grIDold;
1107 for (
long i = 0;
i < ndr;
i++) {
1114 for (
int ifx = nFixedGroups; ifx--;) {
1120 std::vector<double> emptyLocalParams = {};
1127 LOGF(info,
"MillePede2 - Suppressed contributions of groups with NPoints < %d :",
fMinPntValid);
1128 for (
int i = 0;
i < nFixedGroups;
i++) {
1129 printf(
"%d ", fixGroups[
i]);
1171 for (
int jp = csize; jp--;) {
1174 LOGF(fatal,
"MillePede2 - Constain is requested for suppressed parameter #%d", indV[jp]);
1181 int nSuppressed = 0;
1183 for (
int j = csize;
j--;) {
1187 maxStat = TMath::Max(maxStat,
fProcPnt[indV[
j]]);
1191 if (nSuppressed == csize) {
1204 for (
int j = csize;
j--;) {
1210 double sig2i = (
fgWeightSigma ? TMath::Sqrt(maxStat) : 1.) / sig / sig;
1211 for (
int ir = 0;
ir < csize;
ir++) {
1213 for (
int ic = 0; ic <=
ir; ic++) {
1215 double vl = der[
ir] * der[ic] * sig2i;
1217 matCGlo(iID, jID) += vl;
1223 for (
int j = csize;
j--;) {
1239 LOGF(info,
"MillePede2 - Obtained %-7ld equations from %-7ld records (%-7ld rejected). Fixed %-4d globals",
1244#ifdef _DUMP_EQ_BEFORE_
1245 const char* faildumpB = Form(
"mp2eq_before%d.dat",
fIter);
1246 int defoutB = dup(1);
1248 LOG(fatal) <<
"Failed on dup";
1251 int slvDumpB = open(faildumpB, O_RDWR | O_CREAT, 0666);
1252 if (slvDumpB >= 0) {
1255 matCGlo.
Print(
"10");
1269#ifdef _DUMPEQ_BEFORE_
1270 const char* faildumpB = Form(
"mp2eq_before%d.dat",
fIter);
1271 int defoutB = dup(1);
1272 int slvDumpB = open(faildumpB, O_RDWR | O_CREAT, 0666);
1275 printf(
"#Equation before step %d\n",
fIter);
1288#ifdef _DUMPEQ_AFTER_
1289 const char* faildumpA = Form(
"mp2eq_after%d.dat",
fIter);
1290 int defoutA = dup(1);
1291 int slvDumpA = open(faildumpA, O_RDWR | O_CREAT, 0666);
1294 printf(
"#Matrix after step %d\n",
fIter);
1307 printf(
"Solve %d |",
fIter);
1320#ifdef _DUMP_EQ_AFTER_
1321 const char* faildumpA = Form(
"mp2eq_after%d.dat",
fIter);
1322 int defoutA = dup(1);
1324 LOG(fatal) <<
"Failed on dup";
1327 int slvDumpA = open(faildumpA, O_RDWR | O_CREAT, 0666);
1328 if (slvDumpA >= 0) {
1331 matCGlo.
Print(
"10");
1366 LOG(warning) <<
"MillePede2 - Solution of Global Dense System by Cholesky failed, trying Gaussian Elimiation";
1372 LOG(warning) <<
"MillePede2 - Solution of Global Dense System by Gaussian Elimination failed, trying iterative methods";
1394 const char* faildump =
"fgmr_failed.dat";
1395 int defout = dup(1);
1397 LOG(warning) <<
"Failed on dup";
1400 int slvDump = open(faildump, O_RDWR | O_CREAT, 0666);
1403 printf(
"#Failed to solve using solver %d with PreCond: %d MaxIter: %d Tol: %e NKrylov: %d\n",
1405 printf(
"#Dump of matrix:\n");
1407 printf(
"#Dump of RHS:\n");
1414 printf(
"#Dumped failed matrix and RHS to %s\n", faildump);
1416 LOG(warning) <<
"MillePede2 - Failed on file open for matrix dumping";
1432 float sn[3] = {0.47523, 1.690140, 2.782170};
1433 float table[3][30] = {{1.0000, 1.1479, 1.1753, 1.1798, 1.1775, 1.1730, 1.1680, 1.1630,
1434 1.1581, 1.1536, 1.1493, 1.1454, 1.1417, 1.1383, 1.1351, 1.1321,
1435 1.1293, 1.1266, 1.1242, 1.1218, 1.1196, 1.1175, 1.1155, 1.1136,
1436 1.1119, 1.1101, 1.1085, 1.1070, 1.1055, 1.1040},
1437 {4.0000, 3.0900, 2.6750, 2.4290, 2.2628, 2.1415, 2.0481, 1.9736,
1438 1.9124, 1.8610, 1.8171, 1.7791, 1.7457, 1.7161, 1.6897, 1.6658,
1439 1.6442, 1.6246, 1.6065, 1.5899, 1.5745, 1.5603, 1.5470, 1.5346,
1440 1.5230, 1.5120, 1.5017, 1.4920, 1.4829, 1.4742},
1441 {9.0000, 5.9146, 4.7184, 4.0628, 3.6410, 3.3436, 3.1209, 2.9468,
1442 2.8063, 2.6902, 2.5922, 2.5082, 2.4352, 2.3711, 2.3143, 2.2635,
1443 2.2178, 2.1764, 2.1386, 2.1040, 2.0722, 2.0428, 2.0155, 1.9901,
1444 1.9665, 1.9443, 1.9235, 1.9040, 1.8855, 1.8681}};
1449 lNSig = TMath::Max(1, TMath::Min(nSig, 3));
1452 return table[lNSig - 1][nDoF - 1];
1454 return ((sn[lNSig - 1] + TMath::Sqrt(
float(2 * nDoF - 3))) *
1455 (sn[lNSig - 1] + TMath::Sqrt(
float(2 * nDoF - 3)))) /
1456 float(2 * nDoF - 2);
1465 LOGF(info,
"MillePede2 - Initial cut factor is %f",
fChi2CutFactor);
1483 return TMath::Sqrt(
res);
1511 double lGlobalCor = 0.;
1513 printf(
"\nMillePede2 output\n");
1514 printf(
" Result of fit for global parameters\n");
1515 printf(
" ===================================\n");
1516 printf(
" I initial final differ lastcor error gcor Npnt\n");
1517 printf(
"----------------------------------------------------------------------------------------------\n");
1519 int lastPrintedId = -1;
1525 if (
i != i0 && lastPrintedId >= 0 &&
i <= lastPrintedId) {
1533 lGlobalCor = TMath::Sqrt(TMath::Abs(1.0 - 1.0 / (dg *
fDiagCGlo[
i])));
1534 printf(
"%4d(%4d)\t %+.6f\t %+.6f\t %+.6f\t %.6f\t %.6f\t %.6f\t %6d\n",
1547 static long prevRunID = kMaxInt;
1548 static bool prevAns =
true;
1550 if (runID != prevRunID) {
1557 for (
int i =
n;
i--;) {
1560 LOGF(info,
"MillePede2 - New Run to reject: %ld", runID);
1566 for (
int i =
n;
i--;) {
1572 LOGF(info,
"MillePede2 - New Run to accept explicitly: %ld, weight=%f", runID,
fRunWgh);
1577 LOGF(info,
"New Run is not in the list to accept: %ld", runID);
1592 if (nruns < 1 || !runs) {
1596 for (
int i = 0;
i < nruns;
i++) {
1597 (*fRejRunList)[
i] = runs[
i];
1611 if (nruns < 1 || !runs) {
1616 for (
int i = 0;
i < nruns;
i++) {
1617 (*fAccRunList)[
i] = runs[
i];
1618 (*fAccRunListWgh)[
i] = wghList ? wghList[
i] : 1.0;
General class for alignment with large number of degrees of freedom, adapted from AliROOT.
void Print(Option_t *option="") const override=0
virtual void AddToRow(Int_t r, Double_t *valc, Int_t *indc, Int_t n)=0
virtual Double_t QueryDiag(Int_t rc) const
virtual Double_t DiagElem(Int_t r) const =0
void SetSymmetric(Bool_t v=kTRUE)
std::vector< bool > fIsLinear
[fNGloPar] Flag for linear parameters
void ReadRecordConstraint(const long recID, const bool doPrint=false)
read constraint record (if any) at entry id recID
std::vector< int > fkReGroup
optional regrouping of parameters wrt ID's from the records
std::vector< int > fCGlo2Glo
[fNGloPar] compressed ID to global ID buffer
static int fgNKrylovV
size of Krylov vectors buffer in FGMRES
void SetGlobalConstraint(const std::vector< double > &dergb, const double val, const double sigma=0, const bool doPrint=false)
define a constraint equation
o2::fwdalign::MilleRecordWriter * fConstraintsRecWriter
constraints record writer
o2::fwdalign::MilleRecordReader * fConstraintsRecReader
constraints record reader
TArrayL * fAccRunList
list of runs to select (if any)
float fResCut
Cut in residual for other iterartiona.
int SolveGlobalMatEq()
solve global matrix equation MatCGlob*X=VecBGlo and store the result in the VecBGlo
int fNGloPar
number of global parameters
TString fRecChi2TreeName
Name of chi2 per record tree.
std::vector< int > fProcPnt
[fNGloPar] N of processed points per global variable
int fIter
Current iteration.
static int fgMinResCondType
Type of the preconditioner for MinRes method.
bool InitChi2Storage(const int nEntriesAutoSave=10000)
initialize the file and tree to store chi2 from LocalFit()
std::vector< int > fFillIndex
[fNGloPar] auxilary index array for fast matrix fill
std::vector< int > fParamGrID
[fNGloPar] group id for the every parameter
bool fLocFitAdd
Add contribution of carrent track (and not eliminate it)
int fNGloParIni
number of global parameters before grouping
static int fgMinResMaxIter
Max number of iterations for the MinRes method.
void SetRejRunList(const int *runs, const int nruns)
set the list of runs to be rejected
long fNLocFitsRejected
Number of local fits rejected.
int LocalFit(std::vector< double > &localParams)
Perform local parameters fit once all the local equations have been set.
std::vector< double > fVecBGlo
bool fDisableRecordWriter
disable record writer for DPL process
int GlobalFitIteration()
perform global parameters fit once all the local equations have been fitted
static int fgIterSol
type of iterative solution: MinRes or FGMRES
o2::fwdalign::RectMatrix * fMatCGloLoc
Rectangular matrix C g*l.
int fNLocPar
number of local parameters
std::vector< double > fVecBLoc
[fNLocPar] Vector B local (parameters)
const char * GetRecChi2FName() const
return file name where is stored chi2 from LocalFit()
long fCurrRecDataID
ID of the current data record.
int fGloSolveStatus
Status of global solver at current step.
o2::fwdalign::MilleRecordReader * fRecordReader
data record reader
std::vector< double > fDiagCGlo
[fNGloPar] Initial diagonal elements of C global matrix
long fNLocEquations
Number of local equations.
int fMinRecordLength
ignore shorter records
std::vector< double > fSigmaPar
[fNGloPar] Sigma of allowed variation of global parameter
int fNLagrangeConstraints
Number of constraint equations requiring Lagrange multiplier.
double fWghScl[2]
optional rescaling for odd/even residual weights (see its usage in LocalFit)
int fNStdDev
Number of standard deviations for chi2 cut.
int InitMille(int nGlo, const int nLoc, const int lNStdDev=-1, const double lResCut=-1., const double lResCutInit=-1., const std::vector< int > ®roup={})
init all
double GetFinalError(int i) const
std::vector< double > fDeltaPar
[fNGloPar] Variation of global parameters
static bool fgIsMatGloSparse
Type of the global matrix (sparse ...)
int fSelFirst
event selection start
int fNGloFix
Number of globals fixed by user.
float fResCutInit
Cut in residual for first iterartion.
std::vector< double > fFillValue
[fNGloPar] auxilary value array for fast matrix fill
void EndChi2Storage()
write tree and close file where are stored chi2 from LocalFit()
double GetParError(int iPar) const
return error for parameter iPar
o2::fwdalign::MilleRecordWriter * fRecordWriter
data record writer
std::vector< int > fGlo2CGlo
Flag for used constraints.
void SetLocalEquation(std::vector< double > &dergb, std::vector< double > &derlc, const double lMeas, const double lSigma)
assing derivs of loc.eq.
double GetPull(int i) const
return pull for parameter iPar
bool fUseRecordWeight
force or ignore the record weight
void ReadRecordData(const long recID, const bool doPrint=false)
read data record (if any) at entry recID
int SetIterations(const double lChi2CutFac)
Number of iterations is calculated from lChi2CutFac.
int fNGloSize
final size of the global matrix (NGloPar+NConstraints)
int fNGroupsSet
number of groups set
TArrayL * fRejRunList
list of runs to reject (if any)
void SetRecord(o2::fwdalign::MillePedeRecord *aRecord)
int PrintGlobalParameters() const
print the final results into the logfile
bool IsZero(const double v, const double eps=1e-16) const
int fMinPntValid
min number of points for global to vary
int GetCurrentIteration() const
std::vector< bool > fConstrUsed
int fNGloConstraints
Number of constraint equations.
float fChi2CutFactor
Cut factor for chi2 cut to accept local fit.
int fSelLast
event selection end
TArrayF * fAccRunListWgh
optional weights for data of accepted runs (if any)
int GlobalFit(std::vector< double > &par, std::vector< double > &error, std::vector< double > &pull)
performs a requested number of global iterations
void SetSigmaPars(const double *par)
initialize sigmas, account for eventual grouping
void SetSigmaPar(int i, double par)
initialize sigma, account for eventual grouping
o2::fwdalign::MillePedeRecord * fRecord
Buffer of measurements records.
void SetAccRunList(const int *runs, const int nruns, const float *wghList=nullptr)
set the list of runs to be selected
static bool fgInvChol
Invert global matrix in Cholesky solver.
void SetInitPars(const double *par)
initialize parameters, account for eventual grouping
double GetFinalParam(int i) const
o2::fwdalign::MatrixSq * fMatCGlo
Matrix C global.
static double fgMinResTol
Tolerance for MinRes solution.
o2::fwdalign::SymMatrix * fMatCLoc
Matrix C local.
std::vector< double > fInitPar
Vector B global (parameters)
long fCurrRecConstrID
ID of the current constraint record.
int fMaxIter
Maximum number of iterations.
float Chi2DoFLim(int nSig, int nDoF) const
return the limit in chi^2/nd for n sigmas stdev authorized
long fNLocFits
Number of local fits.
static bool fgWeightSigma
weight parameter constraint by statistics
bool IsRecordAcceptable()
validate record according run lists set by the user
float fChi2CutRef
Reference cut for chi2 cut to accept local fit.
void SetInitPar(int i, double par)
initialize param, account for eventual grouping
Double_t GetWeight() const
void AddIndexValue(Int_t ind, Double_t val)
add new pair of index/value
void AddResidual(Double_t val)
void AddWeight(Double_t val)
void MarkGroup(Int_t id)
mark the presence of the detector group
Double_t * GetValue() const
Bool_t IsGroupPresent(Int_t id) const
check if group is defined
Bool_t IsResidual(Int_t i) const
Bool_t IsWeight(Int_t i) const
bool isReadEntryOk() const
check if the last operation readNextEntry() was ok
Long64_t getNEntries() const
return the number of entries
void readEntry(const Long_t id, const bool doPrint=false)
read the entry # id in the tree
o2::fwdalign::MillePedeRecord * getRecord()
return the record
bool isInitOk() const
check if init went well
void fillRecordTree(const bool doPrint=false)
fill tree
o2::fwdalign::MillePedeRecord * getRecord()
return the record
for solving large system of linear equations
Bool_t SolveMinRes(Double_t *VecSol, Int_t precon=0, int itnlim=2000, double rtol=1e-12)
MINRES method (for symmetric matrices)
Bool_t SolveFGMRES(Double_t *VecSol, Int_t precon=0, int itnlim=2000, double rtol=1e-12, int nkrylov=60)
FGMRES method (for general symmetric matrices)
Class for rectangular matrix used for millepede2 operation.
Fast symmetric matrix with dynamically expandable size.
void Print(const Option_t *option="") const override
print itself
int SolveSpmInv(double *vecB, Bool_t stabilize=kTRUE)
Obtain solution of a system of linear equations with symmetric matrix and the inverse (using 'singula...
Bool_t SolveChol(Double_t *brhs, Bool_t invert=kFALSE)
Solves the set of n linear equations A x = b.
void SetSizeUsed(Int_t sz)
GLuint GLuint GLfloat weight
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
o2::InteractionRecord ir(0, 0)