FACT++  1.0
void TPointGui::Fit ( Double_t &  before,
Double_t &  after,
Double_t &  backw 
)
private

Definition at line 799 of file TPointGui.cc.

References TPointStar::Adjust(), TPointStar::AdjustBack(), DrawHorizon(), DrawSet(), fBending, fcn(), fCoordinates, FindWidget(), fLimit, fOriginal, Tools::Form(), TPointStar::GetDAz(), TPointStar::GetDZd(), TPointStar::GetMag(), MPointing::GetMinuitParameters(), MPointing::GetNumPar(), MPointing::GetParameters(), TPointStar::GetResidual(), TPointStar::GetStarZdAz(), i, kBlue, kCyan, kGreen, kMagenta, kRed, kWhite, MPointing::PrintMinuitParameters(), MPointing::SetMinuitParameters(), and MPointing::SetParameters().

Referenced by ProcessMessage().

800 {
801  if (fOriginal.GetSize()==0)
802  {
803  cout << "Sorry, no input data loaded..." << endl;
804  return;
805  }
806 
807  fCoordinates.Delete();
808  for (int i=0; i<fOriginal.GetSize(); i++)
809  fCoordinates.Add(new TPointStar(*(TPointStar*)fOriginal.At(i)));
810 
811  cout << "-----------------------------------------------------------------------" << endl;
812 
813  gStyle->SetOptStat("emro");
814 
815  TH1F hres1("Res1", " Residuals before correction ", fOriginal.GetSize()/3, 0, 0.3);
816  TH1F hres2("Res2", " Residuals after correction ", fOriginal.GetSize()/3, 0, 0.3);
817  TH1F hres3("Res3", " Residuals after backward correction ", fOriginal.GetSize()/3, 0, 0.3);
818 
819  TProfile proaz ("ProAz", " \\Delta profile vs. Az", 24, 0, 360);
820  TProfile prozd ("ProZd", " \\Delta profile vs. Zd", 30, 0, 90);
821  TProfile promag("ProMag", " \\Delta profile vs. Mag", 10, 1, 10);
822 
823  hres1.SetXTitle("\\Delta [\\circ]");
824  hres1.SetYTitle("Counts");
825 
826  hres2.SetXTitle("\\Delta [\\circ]");
827  hres2.SetYTitle("Counts");
828 
829  hres3.SetXTitle("\\Delta [\\circ]");
830  hres3.SetYTitle("Counts");
831 
832  TGraph gdaz;
833  TGraph gdzd;
834  TGraph gaz;
835  TGraph gzd;
836  TGraphErrors graz;
837  TGraphErrors grzd;
838  TGraphErrors grmag;
839  TGraph gmaz;
840  TGraph gmzd;
841 
842  gdaz.SetTitle(" \\Delta Az vs. Zd ");
843  gdzd.SetTitle(" \\Delta Zd vs. Az ");
844 
845  gaz.SetTitle(" \\Delta Az vs. Az ");
846  gzd.SetTitle(" \\Delta Zd vs. Zd ");
847 
848  gmaz.SetTitle(" \\Delta Az vs. Mag ");
849  gmzd.SetTitle(" \\Delta Zd vs. Mag ");
850 
851  graz.SetTitle(" \\Delta vs. Az ");
852  grzd.SetTitle(" \\Delta vs. Zd ");
853  grmag.SetTitle(" \\Delta vs. Mag ");
854 
855  TMinuit minuit(MPointing::GetNumPar()); //initialize TMinuit with a maximum of 5 params
856  minuit.SetObjectFit(this);
857  minuit.SetPrintLevel(-1);
858  minuit.SetFCN(fcn);
859 
860  fBending.SetMinuitParameters(minuit, MPointing::GetNumPar()); // Init Parameters [deg]
861 
862  for (int i=0; i<MPointing::GetNumPar(); i++)
863  {
864  TGButton *l = (TGButton*)FindWidget(i);
865  minuit.FixParameter(i);
866  if (l->GetState()==kButtonDown)
867  minuit.Release(i);
868  }
869 
870  //minuit.Command("SHOW PARAMETERS");
871  //minuit.Command("SHOW LIMITS");
872 
873  cout << endl;
874  cout << "Starting fit..." << endl;
875  cout << "For the fit an measurement error in the residual of ";
876  cout << "0.02deg (=1SE) is assumed." << endl;
877  cout << endl;
878 
879  Int_t ierflg = 0;
880  ierflg = minuit.Migrad();
881  cout << "Migrad returns " << ierflg << endl;
882  // minuit.Release(2);
883  ierflg = minuit.Migrad();
884  cout << "Migrad returns " << ierflg << endl << endl;
885 
886  //
887  // Get Fit Results
888  //
891  cout << endl;
892  //fBending.Save("bending_magic.txt");
893 
894 
895  //
896  // Make a copy of all list entries
897  //
898  TList list;
899  list.SetOwner();
900  for (int i=0; i<fCoordinates.GetSize(); i++)
901  list.Add(new TPointStar(*(TPointStar*)fCoordinates.At(i)));
902 
903  //
904  // Correct for Offsets only
905  //
906  TArrayD par;
907  fBending.GetParameters(par);
908  for (int i=2; i<MPointing::GetNumPar(); i++)
909  par[i]=0;
910 
911  MPointing b2;
912  b2.SetParameters(par);
913 
914  cout << endl << "Sets with Residual exceeding " << fLimit << "deg:" << endl;
915  cout << " StarAz StarEl RawAz RawEl Mag Residual Filename" << endl;
916 
917  //
918  // Calculate correction and residuals
919  //
920  for (int i=0; i<fCoordinates.GetSize(); i++)
921  {
922  TPointStar orig = *(TPointStar*)fCoordinates.At(i);
923 
924  TPointStar &set0 = *(TPointStar*)fCoordinates.At(i);
925 
926  ZdAz za(set0.GetStarZdAz());
927  za *= 180/M_PI;
928 
929  //
930  // Correct for offsets only
931  //
932  TPointStar set1(set0);
933  set1.Adjust(b2);
934 
935  hres1.Fill(set1.GetResidual());
936 
937  set0.Adjust(fBending);
938  hres2.Fill(set0.GetResidual());
939 
940  Double_t dz = fmod(set0.GetDAz()+720, 360);
941  if (dz>180)
942  dz -= 360;
943 
944  Double_t err;
945  Double_t resi = set0.GetResidual(&err);
946 
947  gdzd.SetPoint(i, za.Az(), set0.GetDZd());
948  gdaz.SetPoint(i, za.Zd(), dz);
949  graz.SetPoint(i, za.Az(), resi);
950  graz.SetPointError(i, 0, err);
951  grzd.SetPoint(i, za.Zd(), resi);
952  grzd.SetPointError(i, 0, err);
953 
954  if (resi>fLimit) // 0.13
955  cout << " " << orig << " <" << Form("%5.3f", resi) << "> " << orig.GetName() << endl;
956 
957  proaz.Fill(za.Az(), set0.GetResidual(&err));
958  prozd.Fill(za.Zd(), set0.GetResidual(&err));
959  promag.Fill(set0.GetMag(), set0.GetResidual(&err));
960 
961  gaz.SetPoint( i, za.Az(), dz);
962  gzd.SetPoint( i, za.Zd(), set0.GetDZd());
963  if (set0.GetMag()>=-20)
964  {
965  grmag.SetPoint(i, set0.GetMag(), set0.GetResidual(&err));
966  grmag.SetPointError(i, 0, err);
967  gmaz.SetPoint( i, set0.GetMag(), dz);
968  gmzd.SetPoint( i, set0.GetMag(), set0.GetDZd());
969  }
970  }
971 
972  cout << "done." << endl << endl;
973 
974  //
975  // Check for overflows
976  //
977  const Stat_t ov = hres2.GetBinContent(hres2.GetNbinsX()+1);
978  if (ov>0)
979  cout << "WARNING: " << ov << " overflows in residuals." << endl;
980 
981 
982 
983  cout << dec << endl;
984  cout << " Number of calls to FCN: " << minuit.fNfcn << endl;
985  cout << "Minimum value found for FCN (Chi^2): " << minuit.fAmin << endl;
986  cout << " Fit-Probability: " << TMath::Prob(minuit.fAmin/*fOriginal.GetSize()*/, fOriginal.GetSize()-minuit.GetNumFreePars())*100 << "%" << endl;
987  cout << " Chi^2/NDF: " << minuit.fAmin/(fOriginal.GetSize()-minuit.GetNumFreePars()) << endl;
988  //cout << "Prob(?): " << TMath::Prob(fChisquare,ndf);
989 
990 
991 
992  //
993  // Print all data sets for which the backward correction is
994  // twice times worse than the residual gotten from the
995  // bending correction itself
996  //
997  cout << endl;
998  cout << "Checking backward correction (raw-->star):" << endl;
999  for (int i=0; i<fCoordinates.GetSize(); i++)
1000  {
1001  TPointStar set0(*(TPointStar*)list.At(i));
1002  TPointStar &set1 = *(TPointStar*)list.At(i);
1003 
1004  set0.AdjustBack(fBending);
1005  set1.Adjust(fBending);
1006 
1007  const Double_t res0 = set0.GetResidual();
1008  const Double_t res1 = set1.GetResidual();
1009  const Double_t diff = TMath::Abs(res0-res1);
1010 
1011  hres3.Fill(res0);
1012 
1013  if (diff<hres2.GetMean()*0.66)
1014  continue;
1015 
1016  cout << "DBack: " << setw(6) << set0.GetStarZd() << " " << setw(7) << set0.GetStarAz() << ": ";
1017  cout << "ResB="<< setw(7) << res0*60 << " ResF=" << setw(7) << res1*60 << " |ResB-ResF|=" << setw(7) << diff*60 << " arcmin" << endl;
1018  }
1019  cout << "OK." << endl;
1020  cout << endl;
1021 
1022  const Double_t max1 = TMath::Max(gaz.GetHistogram()->GetMaximum(), gdaz.GetHistogram()->GetMaximum());
1023  const Double_t max2 = TMath::Max(gzd.GetHistogram()->GetMaximum(), gdzd.GetHistogram()->GetMaximum());
1024  const Double_t max3 = TMath::Max(grzd.GetHistogram()->GetMaximum(), graz.GetHistogram()->GetMaximum());
1025 
1026  const Double_t min1 = TMath::Min(gaz.GetHistogram()->GetMinimum(), gdaz.GetHistogram()->GetMinimum());
1027  const Double_t min2 = TMath::Min(gzd.GetHistogram()->GetMinimum(), gdzd.GetHistogram()->GetMinimum());
1028  const Double_t min3 = TMath::Min(grzd.GetHistogram()->GetMinimum(), graz.GetHistogram()->GetMinimum());
1029 
1030  const Double_t absmax1 = 0.05;//TMath::Max(max1, TMath::Abs(min1));
1031  const Double_t absmax2 = 0.05;//TMath::Max(max2, TMath::Abs(min2));
1032  const Double_t absmax3 = 0.05;//TMath::Max(max3, TMath::Abs(min3));
1033 
1034  gaz.SetMaximum(absmax1);
1035  gzd.SetMaximum(absmax2);
1036  gdaz.SetMaximum(absmax1);
1037  gdzd.SetMaximum(absmax2);
1038  gmaz.SetMaximum(absmax1);
1039  gmzd.SetMaximum(absmax2);
1040  graz.SetMaximum(absmax3);
1041  grzd.SetMaximum(absmax3);
1042  grmag.SetMaximum(absmax3);
1043  gaz.SetMinimum(-absmax1);
1044  gzd.SetMinimum(-absmax2);
1045  gdaz.SetMinimum(-absmax1);
1046  gdzd.SetMinimum(-absmax2);
1047  gmaz.SetMinimum(-absmax1);
1048  gmzd.SetMinimum(-absmax2);
1049  graz.SetMinimum(0);
1050  grzd.SetMinimum(0);
1051  grmag.SetMinimum(0);
1052 
1053  TCanvas *c1;
1054 
1055  if (gROOT->FindObject("CanvGraphs"))
1056  c1 = dynamic_cast<TCanvas*>(gROOT->FindObject("CanvGraphs"));
1057  else
1058  c1=new TCanvas("CanvGraphs", "Graphs");
1059 
1060  gROOT->SetSelectedPad(0);
1061  c1->SetSelectedPad(0);
1062  c1->SetBorderMode(0);
1063  c1->SetFrameBorderMode(0);
1064  c1->Clear();
1065 
1066  c1->SetFillColor(kWhite);
1067 #ifndef PRESENTATION
1068  c1->Divide(3,3,1e-10,1e-10);
1069 #else
1070  c1->Divide(2,2,1e-10,1e-10);
1071 #endif
1072  c1->SetFillColor(kWhite);
1073 
1074  TGraph *g=0;
1075 
1076  TLine line;
1077  line.SetLineColor(kGreen);
1078  line.SetLineWidth(2);
1079 #ifndef PRESENTATION
1080  c1->cd(1);
1081  gPad->SetBorderMode(0);
1082  gPad->SetFrameBorderMode(0);
1083  gPad->SetGridx();
1084  gPad->SetGridy();
1085  g=(TGraph*)gaz.DrawClone("A*");
1086  g->SetBit(kCanDelete);
1087  g->GetHistogram()->SetXTitle("Az [\\circ]");
1088  g->GetHistogram()->SetYTitle("\\Delta Az [\\circ]");
1089 
1090  line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384);
1091  line.DrawLine(g->GetXaxis()->GetXmin(), -360./16384, g->GetXaxis()->GetXmax(), -360./16384);
1092 
1093  c1->cd(2);
1094  gPad->SetBorderMode(0);
1095  gPad->SetFrameBorderMode(0);
1096  gPad->SetGridx();
1097  gPad->SetGridy();
1098  g=(TGraph*)gdaz.DrawClone("A*");
1099  g->SetBit(kCanDelete);
1100  g->GetHistogram()->SetXTitle("Zd [\\circ]");
1101  g->GetHistogram()->SetYTitle("\\Delta Az [\\circ]");
1102  line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384);
1103  line.DrawLine(g->GetXaxis()->GetXmin(), -360./16384, g->GetXaxis()->GetXmax(), -360./16384);
1104  cout << "Mean dAz: " << g->GetMean(2) << " \xb1 " << g->GetRMS(2) << endl;
1105 
1106  c1->cd(3);
1107  gPad->SetBorderMode(0);
1108  gPad->SetFrameBorderMode(0);
1109  gPad->SetGridx();
1110  gPad->SetGridy();
1111  if (gmaz.GetN()>0)
1112  {
1113  g=(TGraph*)gmaz.DrawClone("A*");
1114  g->SetBit(kCanDelete);
1115  g->GetHistogram()->SetXTitle("Mag");
1116  g->GetHistogram()->SetYTitle("\\Delta Az [\\circ]");
1117  line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384);
1118  line.DrawLine(g->GetXaxis()->GetXmin(), -360./16384, g->GetXaxis()->GetXmax(), -360./16384);
1119  }
1120 #endif
1121 
1122 #ifndef PRESENTATION
1123  c1->cd(4);
1124 #else
1125  c1->cd(1);
1126 #endif
1127  gPad->SetBorderMode(0);
1128  gPad->SetFrameBorderMode(0);
1129  gPad->SetGridx();
1130  gPad->SetGridy();
1131  g=(TGraph*)gdzd.DrawClone("A*");
1132  g->SetBit(kCanDelete);
1133  g->GetHistogram()->SetXTitle("Az [\\circ]");
1134  g->GetHistogram()->SetYTitle("\\Delta Zd [\\circ]");
1135  line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384);
1136  line.DrawLine(g->GetXaxis()->GetXmin(), -360./16384, g->GetXaxis()->GetXmax(), -360./16384);
1137  cout << "Mean dZd: " << g->GetMean(2) << " \xb1 " << g->GetRMS(2) << endl;
1138  cout << endl;
1139 
1140 #ifndef PRESENTATION
1141  c1->cd(5);
1142 #else
1143  c1->cd(2);
1144 #endif
1145  gPad->SetBorderMode(0);
1146  gPad->SetFrameBorderMode(0);
1147  gPad->SetGridx();
1148  gPad->SetGridy();
1149  g=(TGraph*)gzd.DrawClone("A*");
1150  g->SetBit(kCanDelete);
1151  g->GetHistogram()->SetXTitle("Zd [\\circ]");
1152  g->GetHistogram()->SetYTitle("\\Delta Zd [\\circ]");
1153  line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384);
1154  line.DrawLine(g->GetXaxis()->GetXmin(), -360./16384, g->GetXaxis()->GetXmax(), -360./16384);
1155 #ifndef PRESENTATION
1156  c1->cd(6);
1157  gPad->SetBorderMode(0);
1158  gPad->SetFrameBorderMode(0);
1159  gPad->SetGridx();
1160  gPad->SetGridy();
1161  if (gmzd.GetN()>0)
1162  {
1163  g=(TGraph*)gmzd.DrawClone("A*");
1164  g->SetBit(kCanDelete);
1165  g->GetHistogram()->SetXTitle("Mag");
1166  g->GetHistogram()->SetYTitle("\\Delta Zd [\\circ]");
1167  line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384);
1168  line.DrawLine(g->GetXaxis()->GetXmin(), -360./16384, g->GetXaxis()->GetXmax(), -360./16384);
1169  }
1170 #endif
1171 
1172 #ifndef PRESENTATION
1173  c1->cd(7);
1174 #else
1175  c1->cd(3);
1176 #endif
1177  gPad->SetBorderMode(0);
1178  gPad->SetFrameBorderMode(0);
1179  gPad->SetGridx();
1180  gPad->SetGridy();
1181  g=(TGraph*)graz.DrawClone("AP");
1182  g->SetBit(kCanDelete);
1183  g->GetHistogram()->SetXTitle("Az [\\circ]");
1184  g->GetHistogram()->SetYTitle("\\Delta [\\circ]");
1185  line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384);
1186 
1187  proaz.SetLineWidth(2);
1188  proaz.SetLineColor(kBlue);
1189  proaz.SetMarkerColor(kBlue);
1190  proaz.DrawCopy("pc hist same");
1191 
1192 #ifndef PRESENTATION
1193  c1->cd(8);
1194 #else
1195  c1->cd(4);
1196 #endif
1197  gPad->SetBorderMode(0);
1198  gPad->SetFrameBorderMode(0);
1199  gPad->SetGridx();
1200  gPad->SetGridy();
1201  g=(TGraph*)grzd.DrawClone("AP");
1202  g->SetBit(kCanDelete);
1203  g->GetHistogram()->SetXTitle("Zd [\\circ]");
1204  g->GetHistogram()->SetYTitle("\\Delta [\\circ]");
1205  line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384);
1206 
1207  prozd.SetLineWidth(2);
1208  prozd.SetLineColor(kBlue);
1209  prozd.SetMarkerColor(kBlue);
1210  prozd.DrawCopy("pc hist same");
1211 
1212 #ifndef PRESENTATION
1213  c1->cd(9);
1214  gPad->SetBorderMode(0);
1215  gPad->SetFrameBorderMode(0);
1216  gPad->SetGridx();
1217  gPad->SetGridy();
1218  if (grmag.GetN()>0)
1219  {
1220  g=(TGraph*)grmag.DrawClone("AP");
1221  g->SetBit(kCanDelete);
1222  g->GetHistogram()->SetXTitle("Mag");
1223  g->GetHistogram()->SetYTitle("\\Delta [\\circ]");
1224  line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384);
1225  }
1226  promag.SetLineWidth(2);
1227  promag.SetLineColor(kBlue);
1228  promag.SetMarkerColor(kBlue);
1229  promag.DrawCopy("pc hist same");
1230 #endif
1231 
1232  //
1233  // Print out the residual before and after correction in several
1234  // units
1235  //
1236  cout << fCoordinates.GetSize() << " data sets." << endl << endl;
1237  cout << "Total Spread of Residual:" << endl;
1238  cout << "-------------------------" << endl;
1239  cout << "before: " << Form("%6.4f", hres1.GetMean()) << " \xb1 " << Form("%6.4f", hres1.GetRMS()) << " deg \t";
1240  cout << "before: " << Form("%4.1f", hres1.GetMean()*3600) << " \xb1 " << Form("%.1f", hres1.GetRMS()*3600) << " arcsec" << endl;
1241  cout << "after: " << Form("%6.4f", hres2.GetMean()) << " \xb1 " << Form("%6.4f", hres2.GetRMS()) << " deg \t";
1242  cout << "after: " << Form("%4.1f", hres2.GetMean()*3600) << " \xb1 " << Form("%.1f", hres2.GetRMS()*3600) << " arcsec" << endl;
1243  cout << "backw: " << Form("%6.4f", hres3.GetMean()) << " \xb1 " << Form("%6.4f", hres3.GetRMS()) << " deg \t";
1244  cout << "backw: " << Form("%4.1f", hres3.GetMean()*3600) << " \xb1 " << Form("%.1f", hres3.GetRMS()*3600) << " arcsec" << endl;
1245  cout << endl;
1246  cout << "before: " << Form("%4.1f", hres1.GetMean()*16348/360) << " \xb1 " << Form("%.1f", hres1.GetRMS()*16384/360) << " SE \t\t";
1247  cout << "before: " << Form("%4.1f", hres1.GetMean()*60*60/23.4) << " \xb1 " << Form("%.1f", hres1.GetRMS()*60*60/23.4) << " pix" << endl;
1248  cout << "after: " << Form("%4.1f", hres2.GetMean()*16384/360) << " \xb1 " << Form("%.1f", hres2.GetRMS()*16384/360) << " SE \t\t";
1249  cout << "after: " << Form("%4.1f", hres2.GetMean()*60*60/23.4) << " \xb1 " << Form("%.1f", hres2.GetRMS()*60*60/23.4) << " pix" << endl;
1250  cout << "backw: " << Form("%4.1f", hres3.GetMean()*16384/360) << " \xb1 " << Form("%.1f", hres3.GetRMS()*16384/360) << " SE \t\t";
1251  cout << "backw: " << Form("%4.1f", hres3.GetMean()*60*60/23.4) << " \xb1 " << Form("%.1f", hres3.GetRMS()*60*60/23.4) << " pix" << endl;
1252  cout << endl;
1253  cout << endl; // ±
1254 
1255 
1256  before = hres1.GetMean()*16384/360;
1257  after = hres2.GetMean()*16384/360;
1258  backw = hres3.GetMean()*16384/360;
1259 
1260 
1261  gStyle->SetOptStat(1110);
1262  gStyle->SetStatFormat("6.2g");
1263 
1264  if (gROOT->FindObject("CanvResiduals"))
1265  c1 = dynamic_cast<TCanvas*>(gROOT->FindObject("CanvResiduals"));
1266  else
1267  c1=new TCanvas("CanvResiduals", "Residuals", 800, 800);
1268 
1269  gROOT->SetSelectedPad(0);
1270  c1->SetSelectedPad(0);
1271  c1->Clear();
1272  c1->SetFillColor(kWhite);
1273 
1274  c1->Divide(2, 2, 1e-10, 1e-10);
1275 
1276  c1->cd(2);
1277  gPad->SetBorderMode(0);
1278  gPad->SetFrameBorderMode(0);
1279  hres1.SetLineColor(kRed);
1280  hres1.DrawCopy();
1281 
1282  gPad->Update();
1283 
1284  line.DrawLine(360./16384, gPad->GetUymin(), 360./16384, gPad->GetUymax());
1285 
1286  c1->cd(4);
1287  gPad->SetBorderMode(0);
1288  gPad->SetFrameBorderMode(0);
1289  hres2.SetLineColor(kBlue);
1290  TH1 *h=hres2.DrawCopy();
1291  TF1 f("mygaus", "(gaus)", 0, 1);
1292  f.SetLineColor(kMagenta/*6*/);
1293  f.SetLineWidth(1);
1294  f.SetParameter(0, h->GetBinContent(1));
1295  f.FixParameter(1, 0);
1296  f.SetParameter(2, h->GetRMS());
1297  h->Fit("mygaus", "QR");
1298  hres3.SetLineColor(kCyan);
1299  hres3.SetLineStyle(kDashed);
1300  hres3.DrawCopy("same");
1301  cout << "Gaus-Fit Sigma: " << f.GetParameter(2) << "\xb0" << endl;
1302  cout << "Fit-Probability: " << f.GetProb()*100 << "%" << endl;
1303  cout << " Chi^2/NDF: " << f.GetChisquare() << "/" << f.GetNDF() << " = " << f.GetChisquare()/f.GetNDF() << endl;
1304  gPad->Update();
1305  line.DrawLine(360./16384, gPad->GetUymin(), 360./16384, gPad->GetUymax());
1306 
1307  c1->cd(1);
1308  gPad->SetBorderMode(0);
1309  gPad->SetFrameBorderMode(0);
1310  gPad->SetTheta(90);
1311  gPad->SetPhi(90);
1312  TH2F h2res1("Res2D1", " Dataset positions on the sky ", 36, 0, 360, 8, 0, 90);
1313  h2res1.SetBit(TH1::kNoStats);
1314  h2res1.DrawCopy("surf1pol");
1315  gPad->Modified();
1316  gPad->Update();
1317  DrawHorizon(gPad);
1318  for (int i=0; i<fOriginal.GetSize(); i++)
1319  DrawSet(gPad, *(TPointStar*)fOriginal.At(i));//, 10./hres1.GetMean());
1320 
1321  TText text;
1322  text.SetTextAlign(22);
1323  text.DrawText( 0.00, 0.66, "N");
1324  text.DrawText( 0.66, 0.00, "E");
1325  text.DrawText( 0.00, -0.66, "S");
1326  text.DrawText(-0.66, 0.00, "W");
1327 
1328  c1->cd(3);
1329  gPad->SetBorderMode(0);
1330  gPad->SetFrameBorderMode(0);
1331  gPad->SetTheta(90);
1332  gPad->SetPhi(90);
1333  h2res1.SetTitle(" Arb. Residuals after correction (scaled) ");
1334  h2res1.DrawCopy("surf1pol");
1335  gPad->Modified();
1336  gPad->Update();
1337 // for (int i=0; i<fCoordinates.GetSize(); i++)
1338 // DrawSet(gPad, *(Set*)fCoordinates.At(i), 10./hres2.GetMean(), par[0]);
1339 
1340  RaiseWindow();
1341 }
void GetParameters(Double_t *par, Int_t n=kNumPar) const
Definition: MPointing.cc:754
void DrawHorizon(TVirtualPad *pad, const char *fname="drive/horizon.dat") const
Definition: TPointGui.cc:550
Double_t GetStarZd() const
Definition: TPointStar.cc:29
Set color Cyan.
Definition: WindowLog.h:22
Double_t GetDAz() const
Definition: TPointStar.cc:27
Set color White.
Definition: WindowLog.h:23
int i
Definition: db_dim_client.c:21
Set color Green.
Definition: WindowLog.h:18
static const Int_t GetNumPar()
Definition: MPointing.h:308
Double_t GetDZd() const
Definition: TPointStar.cc:26
Set color Red.
Definition: WindowLog.h:17
Double_t GetResidual(Double_t *err=0) const
Definition: TPointStar.cc:55
TObject * FindWidget(Int_t id) const
Definition: TPointGui.cc:1343
TList fCoordinates
Definition: TPointGui.h:42
void SetParameters(const Double_t *par, Int_t n=kNumPar)
Definition: MPointing.cc:746
Double_t GetMag() const
Definition: TPointStar.h:39
void GetMinuitParameters(TMinuit &m, Int_t n=-1)
Definition: MPointing.cc:793
Set color Magenta.
Definition: WindowLog.h:21
Set color Blue.
Definition: WindowLog.h:20
TList fOriginal
Definition: TPointGui.h:41
void SetMinuitParameters(TMinuit &m, Int_t n=-1) const
Definition: MPointing.cc:782
std::string Form(const char *fmt,...)
Definition: tools.cc:45
void Adjust(const MPointing &bend)
Definition: TPointStar.cc:41
Definition: MPointing.h:64
static void fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
Definition: TPointGui.cc:335
Double_t GetStarAz() const
Definition: TPointStar.cc:30
void DrawSet(TVirtualPad *pad, TPointStar &set, Float_t scale=-1, Float_t angle=0)
Definition: TPointGui.cc:507
ZdAz GetStarZdAz() const
Definition: TPointStar.cc:35
MPointing fBending
Definition: TPointGui.h:45
Float_t fLimit
Definition: TPointGui.h:59
void PrintMinuitParameters(TMinuit &m, Int_t n=-1) const
Definition: MPointing.cc:825
void AdjustBack(const MPointing &bend)
Definition: TPointStar.cc:48

+ Here is the call graph for this function:

+ Here is the caller graph for this function: