29 #include "Alignment/CocoaVisMgr/interface/ALIVRMLMgr.h" 30 #include "Alignment/IgCocoaFileWriter/interface/IgCocoaFileMgr.h" 123 std::cout <<
"@@@ Fit::startFit ended n events = " <<
nEvent << std::endl;
149 std::vector<OpticalObject*>::iterator voite;
151 (*voite)->resetOriginalOriginalCoordinates();
155 std::vector<Entry*>::iterator veite;
157 (*veite)->resetValueDisplacementByFitting();
177 std::cout << std::endl <<
"@@@@@@@@@@@@@@@@@@ Starting data set fit : " <<
nEvent << std::endl;
184 fileout << std::endl <<
"@@@@@@@ NEW MEASUREMENT SET " <<
nEvent << std::endl;
196 double daFactor = 1.;
219 std::cout << std::endl <<
"@@@@ Fit quality: distance SMALLER than mininum " << std::endl;
232 std::cout << std::endl <<
"@@@@ Fit quality: distance BIGGER than mininum " << std::endl;
249 fileout <<
"!!!! WARNING: Too many iterations " <<
theNoFitIterations <<
" and fit DOES NOT CONVERGE " 259 std::cerr <<
"!! WARNING: fit quality has worsened, Recalculate fit quality with decreasing values of Da " 269 fileout <<
" Redoing iteration with Da factor " << daFactor << std::endl;
273 std::cerr <<
" !!!ERROR: not possible to get good fit quality even multiplying Da by " << daFactor
277 fileout <<
" !!!ERROR: not possible to get good fit quality even multiplying Da by " << daFactor
317 std::cout << std::endl <<
"@@@@@@@@@@@@@@@@@@ Fit has ended : only one measurement " <<
nEvent << std::endl;
325 std::cout << std::endl <<
"@@@@@@@@@@@@@@@@@@ Fit has ended : 'Measurement::only1' is set" << std::endl;
334 <<
"@@@@@@@@@@@@@@@@@@ Fit has ended : 'Number of events exhausted " <<
nEvent << std::endl;
343 std::cout << std::endl <<
"@@@@@@@@@@@@@@@@@@ Fit has ended : ??no more data sets' " <<
nEvent << std::endl;
348 std::cout << std::endl <<
"@@@@@@@@@@@@@@@@@@ Fit has ended : " <<
nEvent << std::endl;
356 if (gomgr->GlobalOptions()[
"VisOnly"] == 1) {
363 ALIVRMLMgr::getInstance().writeFile();
367 IgCocoaFileMgr::getInstance().writeFile();
372 std::cout <<
" Visualiation file(s) succesfully written. Ending.... " << std::endl;
383 std::vector<Entry*>::const_iterator vecite;
390 int No_entry_to_fit = 0;
394 (*vecite)->setFitPos(No_entry_to_fit);
396 std::cout <<
" Entry To Fit= " << No_entry_to_fit <<
" " << (*vecite)->OptOCurrent()->name() <<
" " 397 << (*vecite)->name() <<
" with quality= " << (*vecite)->quality() << std::endl;
409 std::cout <<
"@@@ Fit::fitParameters: Fit quality daFactor " << daFactor << std::endl;
419 std::cout <<
"@!! STOPPED by user after 1st iteration " << std::endl;
444 std::cout <<
"@@@ Fit::redoMatrices" << std::endl;
459 std::cout <<
"@@@ Fit::PropagateErrors" << std::endl;
514 std::cout <<
"ENDING after derivatives are calculated ('onlyDeriv' option set)" << std::endl;
539 std::cout <<
"@@@ Fit::calculateSimulatedMeasurementsWithOriginalValues" << std::endl;
541 std::vector<Measurement*>::const_iterator vmcite;
544 (*vmcite)->calculateOriginalSimulatedValue();
573 std::vector<Measurement*>::const_iterator vmcite;
575 NoMeas += (*vmcite)->dim();
578 std::cout <<
"NOMEAS" << NoMeas << std::endl;
588 std::cout <<
" Count number of 'cal'ibrated parameters " << std::endl;
589 std::vector<Entry*>::iterator veite;
591 if ((*veite)->quality() == 1)
595 std::cout << (*veite)->quality() <<
" " << (*veite)->OptOCurrent()->name() <<
" " << (*veite)->name()
596 <<
" # ENT CAL " << nEnt_cal <<
" # ENT " << noent << std::endl;
603 std::vector<Entry*>::const_iterator vecite;
608 std::cout << (*vecite)->quality() << (*vecite)->OptOCurrent()->name() << (*vecite)->name() <<
"NoParamFit" 609 << NoParamFit << std::endl;
615 ALIint NoLinesA = NoMeas + nEnt_cal;
616 ALIint NoColumnsA = NoParamFit;
619 ALIint NoLinesW = NoLinesA;
620 ALIint NoColumnsW = NoLinesA;
623 ALIint NoLinesY = NoLinesA;
630 std::cout <<
"CreateMatrices: NoLinesA = " << NoLinesA <<
" NoColumnsA = " << NoColumnsA << std::endl;
640 std::cout <<
"@@@ Fit::FillMatricesWithMeasurements" << std::endl;
645 std::vector<Measurement*>::const_iterator vmcite;
646 std::vector<Entry*>::const_iterator vecite;
649 std::cout <<
"FillMatricesWithMeasurements: measurement " << (*vmcite)->name() <<
" # entries affecting " 650 << (*vmcite)->affectingEntryList().size() << std::endl;
653 ALIint measdim = (*vmcite)->dim();
654 std::vector<ALIdouble> derivRE;
660 for (vecite = (*vmcite)->affectingEntryList().begin(); vecite != (*vmcite)->affectingEntryList().end(); ++vecite) {
665 std::cout <<
"entry affecting: " << (*vecite)->OptOCurrent()->name() <<
" " << (*vecite)->name() << std::endl;
667 derivRE = (*vmcite)->DerivativeRespectEntry(*vecite);
672 std::cout <<
"FillMatricesWithMeasurements: AMATRIX (" << Aline +
jj <<
"," << (*vecite)->fitPos() <<
" = " 673 << derivRE[
jj] << std::endl;
675 (*vmcite)->setValueSimulated(
jj, (*vmcite)->valueSimulated_orig(
jj));
704 std::cout <<
"change line" << Aline << std::endl;
707 std::cout <<
"change line" << Aline << std::endl;
726 std::cout <<
"@@@ Fit::FillMatricesWithCalibratedParameters" << std::endl;
730 std::vector<Measurement*>::const_iterator vmcite;
732 NolinMes += (*vmcite)->dim();
735 std::cout <<
"@@FillMatricesWithCalibratedParameters" << std::endl;
737 std::vector<Entry*>::const_iterator vecite;
744 if ((*vecite)->quality() == 1) {
746 ALIint lineNo = NolinMes + nEntcal;
747 ALIint columnNo = (*vecite)->fitPos();
750 std::cout <<
"Fit::FillMatricesWithCalibratedParameters: AMatrix ( " << lineNo <<
" , " << columnNo
751 <<
") = " << 1. << std::endl;
756 std::cout <<
"Fit::FillMatricesWithCalibratedParameters: WMatrix ( " << lineNo <<
" , " << columnNo
757 <<
") = " << entsig * entsig << std::endl;
767 yfMatrix->
AddData(lineNo, 0, -(*vecite)->valueDisplacementByFitting());
788 std::cout <<
"@@@ Fit::setCorrelationsInWMatrix" << std::endl;
812 std::cout <<
"CHECKsetCorrelatiFPF " << fit_pos1 <<
" " << fit_pos2 << std::endl;
814 if (fit_pos1 >= 0 && fit_pos1 < pmsize && fit_pos2 >= 0 && fit_pos2 < pmsize) {
824 std::cout <<
"setCorrelatiFPF " << fit_pos1 <<
" " << fit_pos2 <<
" " << correl << std::endl;
832 std::cout <<
"@@@ Fit::multiplyMatrices " << std::endl;
878 std::vector<Entry*>::const_iterator vecite;
882 <<
" Optical Object " 886 <<
" Orig.Error" << std::endl;
895 std::cout << nEnt <<
"PARAM" << std::setw(26) << (*vecite)->OptOCurrent()->name().c_str() << std::setw(8) <<
" " 896 << (*vecite)->name().c_str() <<
" " << std::setw(8) <<
" " << (*vecite)->value() <<
" " 897 << std::setw(8) <<
sqrt(
AtWAMatrix->
Mat()->me[nEnt][nEnt]) / (*vecite)->OutputSigmaDimensionFactor()
898 <<
" " << (*vecite)->sigma() / (*vecite)->OutputSigmaDimensionFactor() <<
" Q" << (*vecite)->quality()
914 std::cout <<
"@@@ Fit::getFitQuality" << std::endl;
916 double fit_quality =
GetSChi2(
true);
923 DatMatrix->
Dump(
"DatMatrix");
928 DSMattemp->
Dump(
"DSMattempMatrix=Dat*At*W");
930 DSMattemp2->
Dump(
"DSMattempMatrix2=At*W*yf");
932 DSMattemp3->
Dump(
"DSMattempMatrix3=At*W");
944 (*yfMatrix).Dump(
"yfMatrix");
946 DSMat->
Dump(
"DSMatrix final");
949 ALIdouble fit_quality_cut = (*DSMat)(0, 0);
954 <<
" Fit quality predicted improvement in distance to minimum is = " << fit_quality_cut << std::endl;
958 <<
" Fit quality predicted improvement in distance to minimum is = " << fit_quality_cut << std::endl;
976 if (fit_quality_cut < 0.) {
979 std::cerr <<
"!!WARNING: Fit quality has worsened: Fit Quality now = " << fit_quality <<
" before " 994 fileout <<
"STOP: SMALL IMPROVEMENT IN ITERATION " <<
theNoFitIterations <<
" = " << fit_quality_cut <<
" < " 1015 fileout <<
"CONTINUE: BIG IMPROVEMENT IN ITERATION " <<
theNoFitIterations <<
" = " << fit_quality_cut
1033 std::cout <<
"@@@ Fit::GetSChi2 useDa= " << useDa << std::endl;
1060 tmpM->
Dump(
"A*Da + f - y Matrix ");
1065 tmptM->
Dump(
"tmptM after transpose");
1074 SMat1->
Dump(
"(A*Da + f - y)^T * W Matrix");
1080 SMat->
Dump(
"SMatrix with Da");
1087 SMat->
Dump(
"SMatrix no Da");
1092 std::cout <<
" GetSChi2 = " << fit_quality << std::endl;
1104 std::cout <<
"@@ Adding correction (DaMatrix) to Entries " << std::endl;
1116 std::vector<Entry*>::const_iterator vecite;
1124 <<
" @@@ PENTRY change " << (*vecite)->OptOCurrent()->name() <<
" " << (*vecite)->name() <<
" " 1125 <<
" change= " << (*DaMatrix)(nEnt, 0) <<
" value= " << (*vecite)->valueDisplacementByFitting()
1139 std::cout <<
" old valueDisplacementByFitting " << (*vecite)->name() <<
" " 1140 << (*vecite)->valueDisplacementByFitting() <<
" original value " << (*vecite)->value() << std::endl;
1142 (*vecite)->addFittedDisplacementToValue((*
DaMatrix)(nEnt, 0));
1145 std::cout << nEnt <<
" new valueDisplacementByFitting " << (*vecite)->OptOCurrent()->name() <<
" " 1146 << (*vecite)->name() <<
" = " << (*vecite)->valueDisplacementByFitting() <<
" " 1147 << (*DaMatrix)(nEnt, 0) << std::endl;
1158 std::cout <<
"@@ Fit::substractToHalfDaMatrixToEntries " << std::endl;
1161 std::vector<Entry*>::const_iterator vecite;
1166 ALIdouble lastadd = (*vecite)->lastAdditionToValueDisplacementByFitting() *
factor;
1168 (*vecite)->addFittedDisplacementToValue(-lastadd);
1169 (*vecite)->setLastAdditionToValueDisplacementByFitting(-(*vecite)->lastAdditionToValueDisplacementByFitting());
1173 std::cout <<
" new valueDisplacementByFitting " << (*vecite)->OptOCurrent()->name() <<
" " << (*vecite)->name()
1174 <<
" = " << (*vecite)->valueDisplacementByFitting() <<
" " << std::endl;
1186 <<
" Optical Object " 1189 <<
" Orig.Value" << std::endl;
1193 std::cout << std::endl <<
"FITTED VALUES " << std::endl;
1194 fileout << std::endl
1195 <<
"FITTED VALUES " << std::endl
1197 <<
" Optical Object" 1200 fileout <<
" value (+-error)" 1201 <<
" orig.val (+-error)";
1203 fileout <<
" value " 1206 fileout <<
" quality" << std::endl;
1209 std::vector<Entry*> entries;
1212 std::vector<OpticalObject*>::const_iterator vocite;
1214 if ((*vocite)->type() ==
ALIstring(
"system"))
1217 fileout <<
" %%%% Optical Object: " << (*vocite)->longName() << std::endl;
1219 entries = (*vocite)->CoordinateEntryList();
1220 siz = entries.size();
1222 std::cerr <<
"!!! FATAL ERROR: strange number of coordinates = " << siz << std::endl;
1235 entries = (*vocite)->ExtraEntryList();
1236 siz = entries.size();
1237 for (
ii = 0;
ii < siz;
ii++) {
1250 fileout << std::endl
1251 <<
"@@@@ FITTED VALUES IN ALL ANCESTORS " << std::endl
1253 <<
" Optical Object" 1256 fileout <<
" value (+-error)";
1258 fileout <<
" orig.val (+-error)";
1261 fileout <<
" value ";
1263 fileout <<
" orig.val ";
1266 fileout <<
" quality" << std::endl;
1269 std::vector<Entry*> entries;
1270 std::vector<OpticalObject*>::const_iterator vocite;
1272 if ((*vocite)->type() ==
ALIstring(
"system"))
1275 fileout <<
" %%%% Optical Object: " << (*vocite)->longName() << std::endl;
1277 entries = (*vocite)->CoordinateEntryList();
1283 fileout <<
" %% IN FRAME : " << optoParent->
longName() << std::endl;
1288 optoParent = optoParent->
parent();
1289 }
while (optoParent);
1299 CLHEP::Hep3Vector centreLocal;
1300 if (optoAncestor->
type() ==
"system") {
1304 CLHEP::HepRotation parentRmGlobInv = inverseOf(optoAncestor->
rmGlob());
1305 centreLocal = parentRmGlobInv * centreLocal;
1309 <<
" parent GLOB " << optoAncestor->
centreGlob() << std::endl;
1324 fileout, entries[
ii], centreLocal[
ii] / entries[
ii]->OutputValueDimensionFactor(), printErrors, printOrig);
1339 fileout, entries[
ii], entryvalues[
ii - 3] / entries[
ii]->OutputValueDimensionFactor(), printErrors, printOrig);
1346 if (
entry->type() ==
"angles") {
1348 std::cout <<
"WARNING valueDisplacementByFitting has no sense for angles " << std::endl;
1357 entryvalue = (
entry->value() +
entry->valueDisplacementByFitting()) /
entry->OutputValueDimensionFactor();
1369 std::cout <<
"ENTRY: " << std::setw(30) <<
entry->OptOCurrent()->name() << std::setw(8) <<
" " <<
entry->name()
1370 <<
" " << std::setw(8) << (
entry->value() +
entry->valueDisplacementByFitting()) <<
" " <<
entry->value()
1371 <<
" Q" <<
entry->quality() << std::endl;
1374 if (
entry->quality() == 2) {
1375 fileout <<
"UNK: " <<
entry->fitPos() <<
" ";
1376 }
else if (
entry->quality() == 1) {
1377 fileout <<
"CAL: " <<
entry->fitPos() <<
" ";
1380 fileout <<
"FIX: -1 ";
1383 fileout << std::setw(30) <<
entry->OptOCurrent()->name() << std::setw(8) <<
" " <<
entry->name() <<
" " 1384 << std::setw(8) << std::setprecision(8) << entryvalue;
1390 fileout <<
" +- " << std::setw(8) << 0.;
1393 fileout << std::setw(8) <<
" " <<
entry->value() / dimv;
1395 fileout <<
" +- " << std::setw(8) <<
entry->sigma() / dims <<
" Q" <<
entry->quality();
1398 float dif = (
entry->value() +
entry->valueDisplacementByFitting()) / dimv -
entry->value() / dimv;
1401 fileout <<
" DIFF= " << dif;
1408 fileout << std::endl;
1416 fileout << std::endl
1417 <<
"CORRELATION BETWEEN 'unk' ENTRIES: (>= " << minCorrel <<
" )" << std::endl
1418 <<
"No_1 No_2 correlation " << std::endl;
1421 std::vector<Entry*>::iterator veite1, veite2;
1424 if ((*veite1)->quality() == 0) {
1426 }
else if ((*veite1)->quality() == 1) {
1428 }
else if ((*veite1)->quality() == 2) {
1431 i1 = (*veite1)->fitPos();
1434 i2 = (*veite2)->fitPos();
1435 if ((*veite2)->quality() == 0) {
1437 }
else if ((*veite2)->quality() == 1) {
1439 }
else if ((*veite2)->quality() == 2) {
1444 if (
std::abs(corrf) >= minCorrel) {
1446 std::cout <<
"CORR:" << E1 <<
"" << E2 <<
" (" <<
i1 <<
")" 1447 <<
" (" <<
i2 <<
")" 1448 <<
" " << corrf << std::endl;
1450 fileout <<
"CORR:" << E1 <<
"" << E2 <<
" (" <<
i1 <<
")" 1451 <<
" (" <<
i2 <<
")" 1452 <<
" " << corrf << std::endl;
1468 matout << std::endl <<
" @@@@@@@@@@@@@@@ Iteration No : " <<
theNoFitIterations << std::endl;
1489 std::vector<Entry*>::const_iterator vecite;
1492 if ((*vecite)->name() == entry_name) {
1494 fitposi = (*vecite)->fitPos();
1499 if ((*vecite)->name() == entry_name) {
1501 fitposi = (*vecite)->fitPos();
1505 if (fitposi == -99) {
1506 std::cerr <<
"!!EXITING: entry name not found: " << entry_name << std::endl;
1515 double chi2meas = 0;
1517 ALIint nMeas = 0, nUnk = 0;
1520 std::vector<Measurement*>::const_iterator vmcite;
1525 double c2 = ((*vmcite)->value(
ii) - (*vmcite)->valueSimulated(
ii)) / (*vmcite)->sigma(
ii);
1526 chi2meas += c2 * c2;
1528 std::cout << c2 <<
" adding chi2meas " << chi2meas <<
" " << (*vmcite)->name() <<
": " <<
ii 1529 <<
" (mm)R: " << (*vmcite)->value(
ii) * 1000. <<
" S: " << (*vmcite)->valueSimulated(
ii) * 1000.
1530 <<
" Diff= " << ((*vmcite)->value(
ii) - (*vmcite)->valueSimulated(
ii)) * 1000. << std::endl;
1536 std::vector<Entry*>::iterator veite;
1538 if ((*veite)->quality() == 2)
1540 if ((*veite)->quality() == 1) {
1541 double c2 = (*veite)->valueDisplacementByFitting() / (*veite)->sigma();
1545 std::cout << c2 <<
" adding chi2cal " << chi2cal <<
" " << (*veite)->OptOCurrent()->name() <<
" " 1546 << (*veite)->name() << std::endl;
1553 fileout <<
" Chi2= " << chi2meas + chi2cal <<
" / " << nMeas - nUnk <<
" dof " 1554 <<
" From measurements= " << chi2meas <<
" from calibrated parameters= " << chi2cal << std::endl;
1557 std::cout <<
" quality Chi2 (no correlations) " << chi2meas + chi2cal <<
" " << chi2meas <<
" " << chi2cal
1569 fileout << std::endl <<
"Fit iteration " <<
theNoFitIterations <<
" ..." << std::endl;
1580 fileout <<
theNoFitIterations <<
" Chi2 after iteration = " << fit_quality << std::endl;
1587 std::cout <<
"@@@ Fit::CheckIfFitPossible" << std::endl;
1591 std::vector<Measurement*>::const_iterator vmcite;
1593 NolinMes += (*vmcite)->dim();
1596 std::vector<Entry*>::const_iterator vecite;
1599 std::cout <<
"Fit::CheckIfFitPossible looping for entry " << (*vecite)->longName() << std::endl;
1600 if ((*vecite)->quality() == 2) {
1601 ALIint nCol = (*vecite)->fitPos();
1605 std::cout <<
"Fit::CheckIfFitPossible looping for entry " << nCol << std::endl;
1608 std::cout <<
" Derivative= (" <<
ii <<
"," << nCol <<
") = " << (*AMatrix)(
ii, nCol) << std::endl;
1612 std::cout <<
"Fit::CheckIfFitIsPossible " << nCol <<
" " <<
ii <<
" = " << (*AMatrix)(
ii, nCol)
1620 <<
"!!!FATAL ERROR: Fit::CheckIfFitPossible() no measurement depends on unknown entry " 1621 << (*vecite)->OptOCurrent()->name() <<
"/" << (*vecite)->name() << std::endl
1622 <<
"!!! Fit will not be possible! " << std::endl;
1629 std::vector<Entry*>::const_iterator vecite1, vecite2;
1634 if ((*vecite1)->quality() == 2) {
1638 if ((*vecite2)->quality() == 2) {
1639 ALIint fitpos1 = (*vecite1)->fitPos();
1640 ALIint fitpos2 = (*vecite2)->fitPos();
1642 std::cout <<
"Fit::CheckIfFitIsPossible checking " << (*vecite1)->longName() <<
" ( " << fitpos1 <<
" ) & " 1643 << (*vecite2)->longName() <<
" ( " << fitpos2 <<
" ) " << std::endl;
1648 std::cout <<
"Fit::CheckIfFitIsPossible " <<
ii <<
" : " << (*AMatrix)(
ii, fitpos1)
1649 <<
" ?= " << (*
AMatrix)(
ii, fitpos2) << std::endl;
1657 if (prop != DBL_MAX && prop != propn) {
1665 std::cerr <<
"!!!FATAL ERROR: Fit::CheckIfFitPossible() two entries for which the measurements have the " 1666 "same dependency (or 100% proportional) " 1667 << (*vecite1)->longName() <<
" & " << (*vecite2)->longName() << std::endl
1668 <<
"!!! Fit will not be possible! " << std::endl;
1681 std::set<ALIuint> columnsEqual;
1682 std::set<ALIuint> columnsEqualSave;
1690 columnsEqualSave.insert(
ii);
1696 if (
jj ==
int(measNo))
1698 columnsEqual = columnsEqualSave;
1701 div = (*AMatrix)(measNo,
ii) / (*
AMatrix)(measNo, biggestColumn);
1705 std::cout <<
"CheckIfMeasIsProportionalToAnother 2 columns = " <<
ii <<
" in " << measNo <<
" & " <<
jj 1709 std::cout <<
"CheckIfMeasIsProportionalToAnother 2 columns != " <<
ii <<
" in " << measNo <<
" & " <<
jj 1712 std::set<ALIuint>::iterator ite = columnsEqual.find(
ii);
1713 if (ite != columnsEqual.end()) {
1714 columnsEqual.erase(ite);
1719 if (!columnsEqual.empty()) {
1721 std::cout <<
"CheckIfMeasIsProportionalToAnother " << measNo <<
" = " <<
jj << std::endl;
1734 std::cout <<
" imeas " << imeas << std::endl;
1736 std::vector<Measurement*>::const_iterator vmcite;
1739 if (Aline == imeas) {
1742 return ((*vmcite)->name()) +
":" +
std::string(ctmp);
1748 std::cout <<
" return measname " << measname << std::endl;
static void set_time_now(time_t now)
static void multiplyMatrices()
static ALIdouble theMinDaFactor
const CLHEP::Hep3Vector & centreGlob() const
void AddFittedEntriesSet(FittedEntriesSet *fents)
static ALIMatrix * AMatrix
static void setCorrelationFromParamFitted(const pss &entry1, const pss &entry2, ALIdouble correl)
static CocoaDaqReader * GetDaqReader()
static void setCorrelationsInWMatrix()
std::pair< ALIstring, ALIstring > pss
static cocoaStatus getCocoaStatus()
static void setCocoaStatus(const cocoaStatus cs)
static void printCentreInOptOFrame(const OpticalObject *opto, const OpticalObject *optoAncestor, ALIFileOut &fileout, ALIbool printErrors=true, ALIbool printOrig=true)
std::vector< double > getRotationAnglesInOptOFrame(const OpticalObject *optoAncestor, const std::vector< Entry *> &entries) const
ErrorCorrelation * getCorrelation(ALIint ii)
static ALIint theMinimumEntryQuality
static std::vector< OpticalObject * > & OptOList()
static void dumpEntryAfterFit(ALIFileOut &fileout, const Entry *entry, double entryvalue, ALIbool printErrors=true, ALIbool printOrig=true)
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
MatrixMeschach * MatrixByMatrix(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
static ALIdouble getMaximumDeviationDerivative()
static OpticalObject * getOptOByName(const ALIstring &opto_name)
--— Find an OptO name in theOptOList and return a pointer to it
static ALIMatrix * AtMatrix
ALIbool readFittedEntriesFromFile()
static ALIstring & ReportFName()
the name of the report File
static void setMaximumDeviationDerivative(ALIdouble val)
static ErrorCorrelationMgr * getInstance()
const ALIstring & name() const
static Fit & getInstance()
static GlobalOptionMgr * getInstance()
static void setFittableEntries()
MAT * MatNonConst() const
void dumpOptOs(std::ostream &out=std::cout) const
static Entry * getEntryByName(const ALIstring &opto_name, const ALIstring &entry_name)
--— Search an Entry name in the Entry* list and return a pointer to it
static double getEntryValue(const Entry *entry)
static FittedEntriesReader * getFittedEntriesReader()
const ALIstring longName() const
static OpticalObjectMgr * getInstance()
Get the only instance.
const std::vector< Entry * > & ExtraEntryList() const
static ALIMatrix * AtWAMatrix
static ALIdouble theFitQualityCut
int getGlobalOptionValue(const ALIstring &sstr, ALIdouble &val)
--— Search a string in theGlobalOptions and return 1 if found
static void dumpFittedValuesInAllAncestorFrames(ALIFileOut &fileout, ALIbool printErrors=true, ALIbool printOrig=true)
static FitQuality getFitQuality(const ALIbool canBeGood=TRUE)
static void substractLastDisplacementToEntries(const ALIdouble factor)
static ALIint MaxNoFitIterations
static ALIint findEntryFitPosition(const ALIstring &opto_name, const ALIstring &entry_name)
static ALIMatrix * WMatrix
static std::string GetMeasurementName(int meas)
static void setFirstTime(ALIbool val)
static ALIdouble thePreviousIterationFitQuality
Abs< T >::type abs(const T &t)
static ALIMatrix * DaMatrix
static void PropagateErrors()
virtual bool ReadNextEvent()=0
static ALIbool fitNextEvent(ALIuint &nEvent)
static ALIMatrix * yfMatrix
static FittedEntriesManager * getInstance()
void SetCorrelation(ALIint i1, ALIint i2, ALIdouble corr)
const std::vector< Entry * > & CoordinateEntryList() const
static void WriteVisualisationFiles()
static ALIint _NoColumnsA
static void setApply(ALIbool val)
static void FillMatricesWithMeasurements()
void ostrDump(std::ostream &fout, const ALIstring &mtext)
static void CreateMatrices()
static void redoMatrices()
static NtupleManager * getInstance()
static void dumpMatrices()
static void dumpFittedValues(ALIFileOut &fileout, ALIbool printErrors=true, ALIbool printOrig=true)
static void dumpEntryCorrelations(ALIFileOut &file)
const CLHEP::HepRotation & rmGlob() const
static CocoaDBMgr * getInstance()
void AddData(ALIuint col, ALIuint lin, ALIdouble data)
static ALIdouble cameraScaleFactor
static ALIbool getFirstTime()
static void deleteMatrices()
static void CheckIfFitPossible()
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
static void printRotationAnglesInOptOFrame(const OpticalObject *opto, const OpticalObject *optoAncestor, ALIFileOut &fileout, ALIbool printErrors=true, ALIbool printOrig=true)
void FillOptObjects(MatrixMeschach *AtWAMatrix)
static int CheckIfMeasIsProportionalToAnother(ALIuint measNo)
void FillFitParameters(MatrixMeschach *AtWAMatrix)
static ALIdouble theRelativeFitQualityCut
const OpticalObject * parent() const
static void calculateSimulatedMeasurementsWithOriginalValues()
static ALIstring & MatricesFName()
the name of the File for storing the matrices
static void PrintChi2(ALIdouble fit_quality, ALIbool isFirst)
static FitQuality fitParameters(const double daFactor)
static std::vector< Measurement * > & MeasurementList()
static ALIFileOut & getInstance(const ALIstring &filename)
static std::vector< Entry * > & EntryList()
void Dump(const ALIstring &mtext)
static void addDaMatrixToEntries()
static ALIdouble GetSChi2(ALIbool useDa)
static ALIint theNoFitIterations
static void dumpDimensions(std::ofstream &fout)
const ALIstring & type() const
ALIint getNumberOfCorrelations()
static void FillMatricesWithCalibratedParameters()