#include void DrawMarker(TVirtualPad *pad, Double_t r0, Double_t phi0, Double_t r1, Double_t phi1) { TView *view = pad->GetView(); if (!view) { cout << "No View!" << endl; return; } TMarker mark0; TMarker mark1; mark0.SetMarkerStyle(kStar); mark1.SetMarkerStyle(kStar); mark1.SetMarkerColor(kRed); r0 /= 90; r1 /= 90; phi0 *= TMath::DegToRad(); phi1 *= TMath::DegToRad(); Double_t x0[3] = { r0*cos(phi0), r0*sin(phi0), 0}; Double_t x1[3] = { r1*cos(phi1), r1*sin(phi1), 0}; mark0.DrawMarker(x0[0], x0[1]); mark1.DrawMarker(x1[0], x1[1]); return; Double_t y0[3], y1[3]; view->WCtoNDC(x0, y0); view->WCtoNDC(x1, y1); mark0.DrawMarker(y0[0], y0[1]); mark1.DrawMarker(y1[0], y1[1]); } int fill(const char *fname, TGraph *g, TH1 *h) { /* TH2F h2res1("Res2D1", " Dataset positions on the sky ", 32, 0, 360, 10, 0, 90); h2res1.SetBit(TH1::kNoStats); h2res1.DrawCopy("surf1pol"); gPad->Modified(); gPad->Update(); gPad->SetTheta(90); gPad->SetPhi(-90); DrawMarker(gPad, 45, 0, 0, 0); gPad->Modified(); gPad->Update(); return; */ ifstream fin(fname); cout << "Reading " << setw(23) << fname << "..." << flush; while (1) { TString str; str.ReadLine(fin); if (!fin) break; if (str.Contains("#")) continue; Float_t alt, az, dalt, daz, mjd; sscanf(str.Data(), "%f %f %*f %*f %*f %*f %f %f %f", &az, &alt, &dalt, &daz, &mjd); if (dalt==0/* || GetResidual(alt, az, alt+dalt, az+daz)>0.1*/) continue; mjd -= 53140.097505; Double_t res = MAstro::GetDevAbs(90-(alt-dalt), -dalt, -daz); g[0].SetPoint(g[0].GetN(), g[0].GetN(), fabs(dalt)); g[1].SetPoint(g[1].GetN(), g[1].GetN(), fabs(daz)); g[2].SetPoint(g[2].GetN(), g[2].GetN(), res); h->Fill(res); } cout << "done (" << setw(3) << (Int_t)h->GetEntries() << "/"; cout << setw(4) << g[0].GetN() << ") " << flush; return g[0].GetN(); } struct Description_t { const char *fName; const char *fTitle; const char *fFile; }; const Int_t counts = 27; Description_t desc[counts] = { {"090401", "TPoints Residuals 8/2004-2" , "tpoint/m2/first/tpoints_m2_1.txt"}, {"+090401", "TPoints Residuals 9/2004" , "tpoint/m2/first/tpoints_m2_2.txt"}, {"+090401", "TPoints Residuals 11/2004" , "tpoint/m2/first/tpoint_20090403_025841.txt"}, {"+090401", "TPoints Residuals 11/2004" , "tpoint/m2/first/tpoint_20090403_214619.txt"}, {"+090401", "TPoints Residuals 11/2004" , "tpoint/m2/first/tpoint_20090404_235955.txt"}, {"+090401", "TPoints Residuals 11/2004" , "tpoint/m2/first/tpoint_20090405_015920.txt"}, // New pointing model {"090402", "TPoints Residuals 11/2004" , "tpoint/m2/first/tpoint_20090411_231731.txt"}, {"+090402", "TPoints Residuals 11/2004" , "tpoint/m2/first/tpoint_20090412_232919.txt"}, {"+090402", "TPoints Residuals 11/2004" , "tpoint/m2/first/tpoint_20090414_001746.txt"}, {"+090402", "TPoints Residuals 11/2004" , "tpoint/m2/first/tpoint_20090418_012742.txt"}, {"+090402", "TPoints Residuals 11/2004" , "tpoint/m2/first/tpoint_20090418_024412.txt"}, // New pointing model {"090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_05_12/tpoint_20090512_011933.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_05_12/tpoint_20090512_013112.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_05_13/tpoint_20090512_210644.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_05_13/tpoint_20090513_002758.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_05_13/tpoint_20090513_025123.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_05_13/tpoint_20090513_033504.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_05_14/tpoint_20090514_013332.txt"}, // Just start of a new observation period {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_06_01/tpoint_20090531_215139.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_06_01/tpoint_20090531_222548.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_06_02/tpoint_20090601_223001.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_06_03/tpoint_20090602_213508.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_06_03/tpoint_20090602_230944.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_06_03/tpoint_20090603_000616.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_06_03/tpoint_20090603_011935.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_06_04/tpoint_20090603_215841.txt"}, {"+090512", "TPoints Residuals 11/2004" , "tpoint/m2/2009_06_05/tpoint_20090604_215941.txt"}, }; void plot_m2() { TGraph g[3]; MBinning bins(100, 0, 0.2); TArrayI n(counts); TH1F hx[counts]; Int_t num = -1; for (int i=0; iSetBit(kCanDelete); obj[i]->Draw(i==0?"AP":"P"); } TLegend leg(0.905, 0.86, 0.99, 0.99); leg.AddEntry(obj[0], " \\Delta\\theta"); leg.AddEntry(obj[1], " \\Delta\\phi"); leg.AddEntry(obj[2], " \\Delta"); leg.DrawClone()->SetBit(kCanDelete); TLine l; l.SetLineColor(kBlue); for (int i=0; iSetBorderMode(0); gPad->SetFrameBorderMode(0); gPad->SetFillColor(kWhite); gPad->SetRightMargin(0.01); gPad->SetTopMargin(0.01); gPad->SetLeftMargin(0.06); gPad->SetGridy(); //Int_t col[] = { 12, 15, 17, 19 }; //Int_t col[] = { 12, 16, 18, 0 }; Int_t col[] = { 13, 16, 19, 0 }; TH1 *h = &histres[2];//result[3].GetHistogram(); h->SetXTitle(""); h->SetYTitle("Residual / arcmin"); h->SetBit(TH1::kNoStats); h->GetXaxis()->CenterTitle(); h->GetYaxis()->CenterTitle(); h->GetYaxis()->SetTitleOffset(0.75); // h->GetXaxis()->SetTimeFormat("%m/%y %F1995-01-01 00:00:00 GMT"); // h->GetXaxis()->SetTimeDisplay(1); h->GetXaxis()->SetLabelColor(kWhite); TLine line; for (int j=2; j>=0; j--) { histres[j].SetMinimum(0); histres[j].SetFillColor(col[j]);//12+2*j); histres[j].DrawCopy(j==2?"":"same"); /* //result[j].SetLineColor(kBlue); //result[j].SetLineWidth(2); //result[j].SetMarkerColor(kBlue); result[j].SetMinimum(0); //result2.SetMarkerStyle(kFullDotMedium); //result[j].SetMarkerStyle(23); result[j].SetFillColor(col[j]);//12+2*j); result[j].DrawClone(j==3 ? "ABX" : "B"); // E3 B */ } resultm.SetMarkerStyle(20); resultm.SetMarkerSize(0.8); resultm.DrawClone("P"); line.DrawLine(time[0], 0, time[0], histres[2].GetMaximum()); for (int i=0; i