13 #include <TGTextEntry.h> 22 #include <TPolyLine.h> 29 #include <TGraphErrors.h> 35 TPointGui::TPointGui(
const string fname,
const string mod) : TGMainFrame(gClient->GetRoot(), 650, 435, kHorizontalFrame), fExitLoopOnClose(kFALSE),
36 fAzMin(0), fAzMax(360), fZdMin(0), fZdMax(90), fMagMax(10), fLimit(0.05)
44 gROOT->GetListOfCleanups()->Add(
fList);
45 fList->SetBit(kMustCleanup);
47 fFont = gVirtualX->LoadQueryFont(
"7x13bold");
49 TGLayoutHints *hints0 =
new TGLayoutHints(kLHintsExpandY, 7, 5, 5, 0);
50 TGLayoutHints *hints1 =
new TGLayoutHints(kLHintsExpandX|kLHintsExpandY, 5, 7, 5, 6);
54 TGGroupFrame *grp1 =
new TGGroupFrame(
this,
"Control", kVerticalFrame);
55 AddFrame(grp1, hints0);
58 TGGroupFrame *grp2 =
new TGGroupFrame(
this,
"Parameters", kHorizontalFrame);
59 AddFrame(grp2, hints1);
63 TGLayoutHints *hints4 =
new TGLayoutHints(kLHintsExpandX, 5, 5, 3);
64 TGLayoutHints *hints5 =
new TGLayoutHints(kLHintsExpandX, 5, 5, 10);
81 TGHorizontalFrame *comp =
new TGHorizontalFrame(grp2, 1, 1);
85 TGLayoutHints *hints3 =
new TGLayoutHints(kLHintsLeft|kLHintsTop, 0, 10, 5, 0);
88 TGVerticalFrame *vframe =
new TGVerticalFrame(comp, 1, 1);
95 comp->AddFrame(vframe, hints3);
98 vframe =
new TGVerticalFrame(comp, 1, 1);
99 comp->AddFrame(vframe, hints3);
102 hints3 =
new TGLayoutHints(kLHintsLeft|kLHintsTop, 0, 10, 5, 0);
105 TGLabel *l =
new TGLabel(vframe,
"+000.0000");
106 l->SetTextJustify(kTextRight);
110 TGLayoutHints *h =
new TGLayoutHints(kLHintsCenterY, 0, 0, but->GetHeight()-l->GetHeight());
113 vframe->AddFrame(l,h);
116 AddLabel(vframe,
"+000.0000", h)->SetTextJustify(kTextRight);
118 vframe =
new TGVerticalFrame(comp, 1, 1);
119 comp->AddFrame(vframe, hints3);
123 AddLabel(vframe,
"\xb1 00.0000\xb0", h)->SetTextJustify(kTextRight);
125 hints3 =
new TGLayoutHints(kLHintsLeft|kLHintsTop, 0, 20, 5, 0);
128 TGLayoutHints *hreset =
new TGLayoutHints(kLHintsLeft|kLHintsTop, 0, 0, 3, 1);
131 TGVerticalFrame *vframe2 =
new TGVerticalFrame(comp, 1, 1);
132 comp->AddFrame(vframe2, hints3);
138 vframe =
new TGVerticalFrame(comp, 1, 1);
139 comp->AddFrame(vframe, hints3);
145 TGLayoutHints *hints6 =
new TGLayoutHints(kLHintsExpandX, 5, 5, 4, 6);
148 l =
new TGLabel(grp1,
"0000000 Data Sets loaded.");
149 grp1->AddFrame(l, hints6);
153 l =
new TGLabel(grp1,
"");
154 l->SetTextJustify(kTextLeft);
155 grp1->AddFrame(l, hints6);
159 l =
new TGLabel(grp1,
"");
160 l->SetTextJustify(kTextLeft);
161 grp1->AddFrame(l, hints6);
165 l =
new TGLabel(grp1,
"");
166 l->SetTextJustify(kTextLeft);
167 grp1->AddFrame(l, hints6);
173 TGLayoutHints *hintse1 =
new TGLayoutHints(kLHintsExpandX|kLHintsBottom);
174 TGLayoutHints *hintse2 =
new TGLayoutHints(kLHintsExpandX, 2, 2);
175 TGLayoutHints *hintse3 =
new TGLayoutHints(kLHintsExpandX);
176 TGLayoutHints *hintsl =
new TGLayoutHints(kLHintsExpandX, 1, 0, 5);
181 TGHorizontalFrame *entries =
new TGHorizontalFrame(grp1, 1, 1);
182 grp1->AddFrame(entries, hintse1);
185 TGVerticalFrame *v1 =
new TGVerticalFrame(entries);
186 TGVerticalFrame *v2 =
new TGVerticalFrame(entries);
187 TGVerticalFrame *v3 =
new TGVerticalFrame(entries);
188 entries->AddFrame(v1, hintse2);
189 entries->AddFrame(v2, hintse2);
190 entries->AddFrame(v3, hintse2);
195 TGLabel *label1 =
new TGLabel(v1,
"Az min/°");
196 TGLabel *label2 =
new TGLabel(v2,
"Az max/°");
197 TGLabel *label3 =
new TGLabel(v3,
"Mag min");
198 TGLabel *label4 =
new TGLabel(v1,
"Zd min/°");
199 TGLabel *label5 =
new TGLabel(v2,
"Zd max/°");
200 TGLabel *label6 =
new TGLabel(v3,
"Limit/°");
201 label1->SetTextJustify(kTextLeft);
202 label2->SetTextJustify(kTextLeft);
203 label3->SetTextJustify(kTextLeft);
204 label4->SetTextJustify(kTextLeft);
205 label5->SetTextJustify(kTextLeft);
206 label6->SetTextJustify(kTextLeft);
220 entry1->SetToolTipText(
"TPoints with a real star located at Az<Az min are ignored in the fit.");
221 entry2->SetToolTipText(
"TPoints with a real star located at Az>Az max are ignored in the fit.");
222 entry2->SetToolTipText(
"TPoints with a artifiical magnitude Mag<Mag min are ignored in the fit.");
223 entry4->SetToolTipText(
"TPoints with a real star located at Zd<Zd min are ignored in the fit.");
224 entry5->SetToolTipText(
"TPoints with a real star located at Zd>Zd max are ignored in the fit.");
225 entry6->SetToolTipText(
"TPoints with an residual after the fit > Limit are output.");
226 entry1->Associate(
this);
227 entry2->Associate(
this);
228 entry3->Associate(
this);
229 entry4->Associate(
this);
230 entry5->Associate(
this);
231 entry6->Associate(
this);
232 v1->AddFrame(label1, hintsl);
233 v1->AddFrame(entry1, hintse3);
234 v1->AddFrame(label4, hintsl);
235 v1->AddFrame(entry4, hintse3);
236 v2->AddFrame(label2, hintsl);
237 v2->AddFrame(entry2, hintse3);
238 v2->AddFrame(label5, hintsl);
239 v2->AddFrame(entry5, hintse3);
240 v3->AddFrame(label3, hintsl);
241 v3->AddFrame(entry3, hintse3);
242 v3->AddFrame(label6, hintsl);
243 v3->AddFrame(entry6, hintse3);
254 ((TGCheckButton*)
FindWidget(0))->SetState(kButtonDown);
255 ((TGCheckButton*)
FindWidget(1))->SetState(kButtonDown);
256 ((TGCheckButton*)
FindWidget(3))->SetState(kButtonDown);
257 ((TGCheckButton*)
FindWidget(4))->SetState(kButtonDown);
258 ((TGCheckButton*)
FindWidget(5))->SetState(kButtonDown);
259 ((TGCheckButton*)
FindWidget(6))->SetState(kButtonDown);
260 ((TGCheckButton*)
FindWidget(7))->SetState(kButtonDown);
261 ((TGCheckButton*)
FindWidget(8))->SetState(kButtonDown);
262 ((TGCheckButton*)
FindWidget(11))->SetState(kButtonDown);
263 ((TGCheckButton*)
FindWidget(12))->SetState(kButtonDown);
264 ((TGCheckButton*)
FindWidget(13))->SetState(kButtonDown);
265 ((TGCheckButton*)
FindWidget(14))->SetState(kButtonDown);
277 SetWindowName(
"Telesto");
278 SetIconName(
"Telesto");
297 gVirtualX->DeleteFont(
fFont);
324 Double_t err = 0.0043;
325 Double_t res =
set.GetResidual();
335 void TPointGui::fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
337 ((
TPointGui*)gMinuit->GetObjectFit())->
Fcn(npar, gin, f, par, iflag);
342 TGButton *but =
new TGTextButton(f, txt,
id);
343 but->Associate(
this);
351 TGButton *but =
new TGCheckButton(f, txt,
id);
352 but->Associate(
this);
359 TGPictureButton *but =
new TGPictureButton(f,
"drive/skull.xpm",
id);
360 but->SetHeight(height);
361 but->SetWidth(height);
362 but->Associate(
this);
369 TGLabel *l =
new TGLabel(f, txt);
387 l->SetText(
Form(
"%.4f\xb0", par[
i]));
389 l = (TGLabel*)
fLabel.At(MPointing::GetNumPar()+i);
390 l->SetText(
Form(
"\xb1 %8.4f\xb0", err[i]>0?err[i]:0));
397 l->SetText(
Form(
"%d data sets loaded.",
fOriginal.GetSize()));
403 l1->SetText(
Form(
"Before: %.1f arcsec", before*360*3600/16384));
406 l2->SetText(
Form(
"After: %.1f arcsec", after*360*3600/16384));
409 l3->SetText(
Form(
"Backw: %.1f arcsec", backw*360*3600/16384));
414 TView *view = pad->GetView();
418 cout <<
"No View!" << endl;
423 mark0.SetMarkerStyle(kFullDotLarge);
424 mark0.SetMarkerColor(
kBlue);
427 phi0 *= TMath::DegToRad();
429 Double_t x[6] = { r0*cos(phi0), r0*sin(phi0), 0, 0, 0, 0};
431 view->WCtoNDC(x, x+3);
433 mark0.DrawMarker(-x[3], x[4]);
438 TView *view = pad->GetView();
442 cout <<
"No View!" << endl;
464 line.SetLineWidth(2);
465 line.SetLineColor(
kBlue);
467 Double_t p0 = phi0<phi1?phi0:phi1;
468 Double_t p1 = phi0<phi1?phi1:phi0;
483 Double_t x0[3] = { r0*cos(p0*TMath::DegToRad()), r0*sin(p0*TMath::DegToRad()), 0};
485 for (
double i=p0+10;
i<p1+10;
i+=10)
490 Double_t r = dr/dp*(
i-p0)+r0;
491 Double_t p = TMath::DegToRad()*
i;
493 Double_t x1[3] = { r*cos(p), r*sin(p), 0};
495 Double_t y0[3], y1[3];
497 view->WCtoNDC(x0, y0);
498 view->WCtoNDC(x1, y1);
500 line.DrawLine(y0[0], y0[1], y1[0], y1[1]);
509 Double_t r0 =
set.GetRawZd();
510 Double_t phi0 =
set.GetRawAz()-angle;
511 Double_t r1 =
set.GetStarZd();
512 Double_t phi1 =
set.GetStarAz()-angle;
525 phi0 = fmod(phi0+360, 360);
526 phi1 = fmod(phi1+360, 360);
531 if (scale<0 || scale>1000)
552 TView *view = pad->GetView();
556 cout <<
"No View!" << endl;
563 cout <<
"ERROR - " << fname <<
" not found." << endl;
568 poly.SetLineWidth(2);
569 poly.SetLineColor(12);
570 poly.SetLineStyle(8);
580 sscanf(line.Data(),
"%f %f", &az, &alt);
584 az *= TMath::DegToRad();
587 Double_t x[6] = { zd*cos(az), zd*sin(az), 0, 0, 0, 0};
588 view->WCtoNDC(x, x+3);
589 poly.SetNextPoint(-x[3], x[4]);
592 poly.DrawClone()->SetBit(kCanDelete);
598 static const char *gOpenTypes[] =
600 "TPoint files",
"*.txt",
601 "Collection files",
"*.col",
602 "Model files",
"*.mod",
611 fi.fFileTypes = (
const char**)gOpenTypes;
612 fi.fIniDir = StrDup(dir);
614 new TGFileDialog(fClient->GetRoot(),
this,
mode, &fi);
629 cout <<
"Collection '" << fname <<
"' not found!" << endl;
640 line = line.Strip(TString::kBoth);
643 if (line.Length()==0)
658 if (fname.EndsWith(
".col"))
670 while (fin && fin.get()!=
'\n');
671 while (fin && fin.get()!=
'\n');
672 while (fin && fin.get()!=
'\n');
675 cout <<
"File '" << fname <<
"' not found!" << endl;
694 cout <<
" sets of coordinates in " << fname;
695 cout <<
" (Total=" <<
fOriginal.GetSize() <<
")" << endl;
703 return atof(static_cast<TGTextEntry*>(
FindWidget(
id))->GetText());
711 static TString dirmod(
"tpoint/");
712 static TString dircol(
"tpoint/");
714 switch (GET_MSG(msg))
717 switch (GET_SUBMSG(msg))
727 Fit(before, after, backw);
766 switch (GET_SUBMSG(msg))
768 case kTE_TEXTCHANGED:
803 cout <<
"Sorry, no input data loaded..." << endl;
811 cout <<
"-----------------------------------------------------------------------" << endl;
813 gStyle->SetOptStat(
"emro");
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);
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);
823 hres1.SetXTitle(
"\\Delta [\\circ]");
824 hres1.SetYTitle(
"Counts");
826 hres2.SetXTitle(
"\\Delta [\\circ]");
827 hres2.SetYTitle(
"Counts");
829 hres3.SetXTitle(
"\\Delta [\\circ]");
830 hres3.SetYTitle(
"Counts");
842 gdaz.SetTitle(
" \\Delta Az vs. Zd ");
843 gdzd.SetTitle(
" \\Delta Zd vs. Az ");
845 gaz.SetTitle(
" \\Delta Az vs. Az ");
846 gzd.SetTitle(
" \\Delta Zd vs. Zd ");
848 gmaz.SetTitle(
" \\Delta Az vs. Mag ");
849 gmzd.SetTitle(
" \\Delta Zd vs. Mag ");
851 graz.SetTitle(
" \\Delta vs. Az ");
852 grzd.SetTitle(
" \\Delta vs. Zd ");
853 grmag.SetTitle(
" \\Delta vs. Mag ");
856 minuit.SetObjectFit(
this);
857 minuit.SetPrintLevel(-1);
865 minuit.FixParameter(
i);
866 if (l->GetState()==kButtonDown)
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;
880 ierflg = minuit.Migrad();
881 cout <<
"Migrad returns " << ierflg << endl;
883 ierflg = minuit.Migrad();
884 cout <<
"Migrad returns " << ierflg << endl << endl;
914 cout << endl <<
"Sets with Residual exceeding " <<
fLimit <<
"deg:" << endl;
915 cout <<
" StarAz StarEl RawAz RawEl Mag Residual Filename" << endl;
940 Double_t dz = fmod(set0.
GetDAz()+720, 360);
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);
955 cout <<
" " << orig <<
" <" <<
Form(
"%5.3f", resi) <<
"> " << orig.GetName() << endl;
961 gaz.SetPoint(
i, za.Az(), dz);
962 gzd.SetPoint(
i, za.Zd(), set0.
GetDZd());
966 grmag.SetPointError(
i, 0, err);
967 gmaz.SetPoint(
i, set0.
GetMag(), dz);
972 cout <<
"done." << endl << endl;
977 const Stat_t ov = hres2.GetBinContent(hres2.GetNbinsX()+1);
979 cout <<
"WARNING: " << ov <<
" overflows in residuals." << 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()-minuit.GetNumFreePars())*100 <<
"%" << endl;
987 cout <<
" Chi^2/NDF: " << minuit.fAmin/(
fOriginal.GetSize()-minuit.GetNumFreePars()) << endl;
998 cout <<
"Checking backward correction (raw-->star):" << endl;
1007 const Double_t res0 = set0.GetResidual();
1008 const Double_t res1 = set1.GetResidual();
1009 const Double_t diff = TMath::Abs(res0-res1);
1013 if (diff<hres2.GetMean()*0.66)
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;
1019 cout <<
"OK." << endl;
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());
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());
1030 const Double_t absmax1 = 0.05;
1031 const Double_t absmax2 = 0.05;
1032 const Double_t absmax3 = 0.05;
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);
1051 grmag.SetMinimum(0);
1055 if (gROOT->FindObject(
"CanvGraphs"))
1056 c1 = dynamic_cast<TCanvas*>(gROOT->FindObject(
"CanvGraphs"));
1058 c1=
new TCanvas(
"CanvGraphs",
"Graphs");
1060 gROOT->SetSelectedPad(0);
1061 c1->SetSelectedPad(0);
1062 c1->SetBorderMode(0);
1063 c1->SetFrameBorderMode(0);
1066 c1->SetFillColor(
kWhite);
1067 #ifndef PRESENTATION 1068 c1->Divide(3,3,1e-10,1e-10);
1070 c1->Divide(2,2,1e-10,1e-10);
1072 c1->SetFillColor(
kWhite);
1077 line.SetLineColor(
kGreen);
1078 line.SetLineWidth(2);
1079 #ifndef PRESENTATION 1081 gPad->SetBorderMode(0);
1082 gPad->SetFrameBorderMode(0);
1085 g=(TGraph*)gaz.DrawClone(
"A*");
1086 g->SetBit(kCanDelete);
1087 g->GetHistogram()->SetXTitle(
"Az [\\circ]");
1088 g->GetHistogram()->SetYTitle(
"\\Delta Az [\\circ]");
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);
1094 gPad->SetBorderMode(0);
1095 gPad->SetFrameBorderMode(0);
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;
1107 gPad->SetBorderMode(0);
1108 gPad->SetFrameBorderMode(0);
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);
1122 #ifndef PRESENTATION 1127 gPad->SetBorderMode(0);
1128 gPad->SetFrameBorderMode(0);
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;
1140 #ifndef PRESENTATION 1145 gPad->SetBorderMode(0);
1146 gPad->SetFrameBorderMode(0);
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 1157 gPad->SetBorderMode(0);
1158 gPad->SetFrameBorderMode(0);
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);
1172 #ifndef PRESENTATION 1177 gPad->SetBorderMode(0);
1178 gPad->SetFrameBorderMode(0);
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);
1187 proaz.SetLineWidth(2);
1188 proaz.SetLineColor(
kBlue);
1189 proaz.SetMarkerColor(
kBlue);
1190 proaz.DrawCopy(
"pc hist same");
1192 #ifndef PRESENTATION 1197 gPad->SetBorderMode(0);
1198 gPad->SetFrameBorderMode(0);
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);
1207 prozd.SetLineWidth(2);
1208 prozd.SetLineColor(
kBlue);
1209 prozd.SetMarkerColor(
kBlue);
1210 prozd.DrawCopy(
"pc hist same");
1212 #ifndef PRESENTATION 1214 gPad->SetBorderMode(0);
1215 gPad->SetFrameBorderMode(0);
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);
1226 promag.SetLineWidth(2);
1227 promag.SetLineColor(
kBlue);
1228 promag.SetMarkerColor(
kBlue);
1229 promag.DrawCopy(
"pc hist same");
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;
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;
1256 before = hres1.GetMean()*16384/360;
1257 after = hres2.GetMean()*16384/360;
1258 backw = hres3.GetMean()*16384/360;
1261 gStyle->SetOptStat(1110);
1262 gStyle->SetStatFormat(
"6.2g");
1264 if (gROOT->FindObject(
"CanvResiduals"))
1265 c1 = dynamic_cast<TCanvas*>(gROOT->FindObject(
"CanvResiduals"));
1267 c1=
new TCanvas(
"CanvResiduals",
"Residuals", 800, 800);
1269 gROOT->SetSelectedPad(0);
1270 c1->SetSelectedPad(0);
1272 c1->SetFillColor(
kWhite);
1274 c1->Divide(2, 2, 1e-10, 1e-10);
1277 gPad->SetBorderMode(0);
1278 gPad->SetFrameBorderMode(0);
1279 hres1.SetLineColor(
kRed);
1284 line.DrawLine(360./16384, gPad->GetUymin(), 360./16384, gPad->GetUymax());
1287 gPad->SetBorderMode(0);
1288 gPad->SetFrameBorderMode(0);
1289 hres2.SetLineColor(
kBlue);
1290 TH1 *h=hres2.DrawCopy();
1291 TF1 f(
"mygaus",
"(gaus)", 0, 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;
1305 line.DrawLine(360./16384, gPad->GetUymin(), 360./16384, gPad->GetUymax());
1308 gPad->SetBorderMode(0);
1309 gPad->SetFrameBorderMode(0);
1312 TH2F h2res1(
"Res2D1",
" Dataset positions on the sky ", 36, 0, 360, 8, 0, 90);
1313 h2res1.SetBit(TH1::kNoStats);
1314 h2res1.DrawCopy(
"surf1pol");
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");
1329 gPad->SetBorderMode(0);
1330 gPad->SetFrameBorderMode(0);
1333 h2res1.SetTitle(
" Arb. Residuals after correction (scaled) ");
1334 h2res1.DrawCopy(
"surf1pol");
1350 while ((obj=Next()))
1352 const TGWidget *wid = (TGWidget*)obj->IsA()->DynamicCast(TGWidget::Class(), obj);
1356 if (
id == wid->WidgetId())
void GetParameters(Double_t *par, Int_t n=kNumPar) const
void DrawHorizon(TVirtualPad *pad, const char *fname="drive/horizon.dat") const
const TString & GetDescription(int i) const
void AddCheckButton(TGCompositeFrame *f, TString txt, Int_t id=-1, TGLayoutHints *h=0)
void LoadStars(TString fname="tpoint.txt")
void Fcn(Int_t &, Double_t *, Double_t &f, Double_t *par, Int_t)
static const Int_t GetNumPar()
Double_t GetResidual(Double_t *err=0) const
TPointGui(const std::string fname, const std::string mod)
Bool_t Save(const char *name)
TString OpenDialog(TString &dir, EFileDialogMode mode=kFDOpen)
void DisplayResult(Double_t before, Double_t after, Double_t backw)
TObject * FindWidget(Int_t id) const
void LoadCollection(TString fname)
Bool_t Load(const char *name)
void SetParameters(const Double_t *par, Int_t n=kNumPar)
void DrawPolLine(TVirtualPad *pad, Double_t r0, Double_t phi0, Double_t r1, Double_t phi1)
void GetMinuitParameters(TMinuit &m, Int_t n=-1)
void DrawMarker(TVirtualPad *pad, Double_t r0, Double_t phi0)
void Fit(Double_t &before, Double_t &after, Double_t &backw)
Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t)
Float_t GetFloat(Int_t id) const
void GetError(TArrayD &par) const
void SetMinuitParameters(TMinuit &m, Int_t n=-1) const
void Adjust(const MPointing &bend)
const TString & GetVarName(int i) const
void AddTextButton(TGCompositeFrame *f, TString txt, Int_t id=-1, TGLayoutHints *h=0)
void AddResetButton(TGCompositeFrame *f, Int_t id, TGLayoutHints *h, Int_t height)
static void fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
void DrawSet(TVirtualPad *pad, TPointStar &set, Float_t scale=-1, Float_t angle=0)
void PrintMinuitParameters(TMinuit &m, Int_t n=-1) const
void AdjustBack(const MPointing &bend)
TGLabel * AddLabel(TGCompositeFrame *f, TString txt, TGLayoutHints *h=0)