Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3908)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3909)
@@ -18,4 +18,13 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2004/04/30: Daniela Dorner
+  
+   * macros/pointing.C
+     - implemented plot: Control Deviation vs Time
+     - rearranged plots
+
+
+
  2004/04/30: Markus Gaug
   
@@ -34,4 +43,5 @@
        number of photons instead of number of photons, otherwise 
        NaN's are obtained
+
 
 
Index: trunk/MagicSoft/Mars/macros/pointing.C
===================================================================
--- trunk/MagicSoft/Mars/macros/pointing.C	(revision 3908)
+++ trunk/MagicSoft/Mars/macros/pointing.C	(revision 3909)
@@ -83,5 +83,5 @@
     MReadReports read;
     read.AddTree("Drive");
-    read.AddFile("ccdata.root");
+    read.AddFile("data/2004_01_26_report.root");
     read.AddToBranchList("MReportDrive.*");
 
@@ -89,12 +89,14 @@
 
     // Create a task which fills one histogram with the data
-    MHVsTime h0("MReportDrive.fMjd");
+    //MHVsTime h0("MReportDrive.fMjd");
     MHVsTime h1("MReportDrive.fNominalZd");
     MHVsTime h2("MReportDrive.fNominalAz");
     MHVsTime h3("MReportDrive.fState");
-    h0.SetName("Mjd");
+    MHVsTime h7("MReportDrive.GetAbsError*60");
+    //h0.SetName("Mjd");
     h1.SetName("Zd");
     h2.SetName("Az");
     h3.SetName("State");
+    h7.SetName("ControlDeviation");
 
     MH3 h4("MReportDrive.GetAbsError*60");
@@ -116,12 +118,13 @@
     plist.AddToList(&bins3);
 
-    MFillH fill0(&h0, "MTimeDrive");
+    //MFillH fill0(&h0, "MTimeDrive");
     MFillH fill1(&h1, "MTimeDrive");
     MFillH fill2(&h2, "MTimeDrive");
     MFillH fill3(&h3, "MTimeDrive");
+    MFillH fill7(&h7, "MTimeDrive");
     MFillH fill4(&h4);
     MFillH fill5(&h5);
 
-    fill0.SetBit(MFillH::kDoNotDisplay);
+    //fill0.SetBit(MFillH::kDoNotDisplay);
     fill1.SetBit(MFillH::kDoNotDisplay);
     fill2.SetBit(MFillH::kDoNotDisplay);
@@ -129,4 +132,5 @@
     fill4.SetBit(MFillH::kDoNotDisplay);
     fill5.SetBit(MFillH::kDoNotDisplay);
+    fill7.SetBit(MFillH::kDoNotDisplay);
 
     // -----------------------------------------------
@@ -138,9 +142,10 @@
     tlist.AddToList(&fill3);
     tlist.AddToList(&tracking);
-    tlist.AddToList(&fill0);
+    //tlist.AddToList(&fill0);
     tlist.AddToList(&fill1);
     tlist.AddToList(&fill2);
     tlist.AddToList(&fill4);
     tlist.AddToList(&fill5);
+    tlist.AddToList(&fill7);
 
     gStyle->SetOptStat(0);
@@ -161,12 +166,13 @@
     tlist.PrintStatistics();
 
+
     TGraph *g1 = h1.GetGraph();
     TGraph *g2 = h2.GetGraph();
 
     TCanvas &c = d->AddTab("Sky");
-
-    c->cd();
-
-    TPad *p = new TPad("", "",0,0.05,0.6,0.95);
+    c.cd();
+
+    //Skyplot
+    TPad *p = new TPad("", "",0,0.32,0.5,1);
     p->Draw();
     p->cd();
@@ -190,6 +196,4 @@
     }
 
-    //TGraph gr;
-
     Double_t *zd=g1->GetY();
     Double_t *az=g2->GetY();
@@ -223,5 +227,8 @@
 
     c.cd();
+
+
 /*
+    //MJD
     p = new TPad("", "", 0.6, 0.66, 1, 1);
     p->Draw();
@@ -237,12 +244,24 @@
     c.cd();
 */
-    p = new TPad("", "", 0.6, 0, 1, 0.29);
-    p->Draw();
-    p->cd();
-
-    gStyle->SetOptStat(1110);
-    gStyle->SetStatFormat(".2g");
+
+
+    //Histogram of Control Deviation
+    p = new TPad("", "", 0, 0, 0.5, 0.32);
+    p->Draw();
+    p->cd();
+
+    gPad->SetBorderMode(0);
+    //number of entries, mean, rms and number of overflows in the statusbox
+    gStyle->SetOptStat("emro"); 
+    //gStyle->SetStatFormat(".2g");
 
     MH3 *mh3 = (MH3*)h4.DrawClone("nonew");
+
+    TAxis *axey = mh3->GetHist()->GetYaxis();
+    TAxis *axex = mh3->GetHist()->GetXaxis();
+    axey->SetLabelSize(0.05);
+    axex->SetLabelSize(0.05);
+    axex->SetTitleSize(0.05);
+    axex->SetTitleOffset(0.85);
 
     mh3->GetHist()->SetXTitle("\\Delta [arcmin]");
@@ -251,4 +270,5 @@
     mh3->GetHist()->SetStats(1);
 
+    //insert lines for 0.5, 1 and 2 SE
     TLine ln;
     ln.SetLineColor(kGreen);
@@ -261,7 +281,11 @@
     c.cd();
 
-    p = new TPad("", "", 0.6, 0.29, 1, 0.42);
-    p->Draw();
-    p->cd();
+
+    //Status of the Drive System vs Time
+    p = new TPad("", "", 0.5, 0.86, 1, 1);
+    p->Draw();
+    p->cd();
+    gPad->SetBorderMode(0);
+    p->SetGridx();
 
     hvt = (MHVsTime*)h3.DrawClone("nonew");
@@ -290,8 +314,77 @@
     c.cd();
 
-    p = new TPad("", "", 0.6, 0.71, 1, 1);
-    p->Draw();
-    p->cd();
-
+
+    //Zd vs Time
+    p = new TPad("", "", 0.5, 0.59, 1, 0.86);
+    p->Draw();
+    p->cd();
+    gPad->SetBorderMode(0);
+    p->SetGridx();
+
+    hvt = (MHVsTime*)h1.DrawClone("nonew");
+    hvt->GetGraph()->SetMarkerStyle(kFullDotSmall);
+
+    TH1 *hist = hvt->GetGraph()->GetHistogram();
+    if (hvt->GetGraph()->GetN())
+    {
+        hist->SetXTitle("Time");
+        hist->SetYTitle("Zd [\\circ]");
+        hist->SetTitle("Zd vs. Time");
+        hist->SetStats(0);
+    }
+
+    TAxis *axey = hist->GetYaxis();
+    TAxis *axex = hist->GetXaxis();
+    axey->SetLabelSize(0.05);
+    axey->SetTitleSize(0.06);
+    axey->SetTitleOffset(0.6);
+    axex->SetLabelSize(0.05);
+    axex->SetTitleSize(0.06);
+    axex->SetTitleOffset(0.85);
+
+    c.cd();
+
+
+    //Controll Deviation vs Time
+    p = new TPad("", "", 0.5, 0.32, 1, 0.59);
+    p->Draw();
+    p->cd();
+    gPad->SetBorderMode(0);
+    p->SetGridx();
+
+    hvt = (MHVsTime*)h7.DrawClone("nonew L");
+    TH1 *hist = hvt->GetGraph()->GetHistogram();
+    hist->SetAxisRange(-0.5, 10.5, "Y");
+    hist->SetXTitle("Time");
+    hist->SetYTitle("\\Delta [arcmin]");
+    hist->SetTitle("Control Deviation vs. Time");
+
+    TAxis *axey = hist->GetYaxis();
+    TAxis *axex = hist->GetXaxis();
+    axey->SetLabelSize(0.05);
+    axey->SetTitleSize(0.06);
+    axey->SetTitleOffset(0.5);
+    axex->SetLabelSize(0.05);
+    axex->SetTitleSize(0.06);
+    axex->SetTitleOffset(0.8);
+
+    //insert lines for 0.5, 1 and 2 SE
+    TLine ln;
+    ln.SetLineColor(kGreen);
+    ln.DrawLine(hist->GetXaxis()->GetXmin(), 0.5*360*60/16384., hist->GetXaxis()->GetXmax(), 0.5*360*60/16384.);
+    ln.SetLineColor(kYellow);
+    ln.DrawLine(hist->GetXaxis()->GetXmin(), 1.0*360*60/16384., hist->GetXaxis()->GetXmax(), 1.0*360*60/16384.);
+    ln.SetLineColor(kRed);
+    ln.DrawLine(hist->GetXaxis()->GetXmin(), 2.0*360*60/16384., hist->GetXaxis()->GetXmax(), 2.0*360*60/16384.);
+
+    c.cd();
+
+
+    //Controll Deviation vs Zd
+    p = new TPad("", "", 0.5, 0, 1, 0.32);
+    p->Draw();
+    p->cd();
+
+    gPad->SetBorderMode(0);
     gStyle->SetOptStat(1110);
     gStyle->SetStatFormat(".2g");
@@ -299,46 +392,28 @@
     mh3 = (MH3*)h5.DrawClone("nonew");
 
-    mh3->GetHist()->SetXTitle("Zd [\\circ]");
-    mh3->GetHist()->SetYTitle("\\Delta [arcmin]");
+    TAxis *axey = mh3->GetHist()->GetYaxis();
+    TAxis *axex = mh3->GetHist()->GetXaxis();
+    axey->SetLabelSize(0.05);
+    axey->SetTitleSize(0.05);
+    axey->SetTitleOffset(0.7);
+    axex->SetLabelSize(0.05);
+    axex->SetTitleSize(0.05);
+    axex->SetTitleOffset(0.85);
+
+    mh3->GetHist()->SetYTitle("Zd [\\circ]");
+    mh3->GetHist()->SetXTitle("\\Delta [arcmin]");
     mh3->GetHist()->SetTitle("Control deviation of the motors");
     mh3->GetHist()->SetStats(1);
     mh3->GetHist()->Draw("box");
 
-    c.cd();
-
-    p = new TPad("", "", 0.6, 0.42, 1, 0.71);
-    p->Draw();
-    p->cd();
-
-    gPad->SetBorderMode(0);
-
-    hvt = (MHVsTime*)h1.DrawClone("nonew");
-
-    hvt->GetGraph()->SetMarkerStyle(kFullDotSmall);
-    if (hvt->GetGraph()->GetN())
-    {
-        hvt->GetGraph()->GetHistogram()->SetXTitle("Time");
-        hvt->GetGraph()->GetHistogram()->SetYTitle("Zd [\\circ]");
-        hvt->GetGraph()->GetHistogram()->SetTitle("Zd vs. Time");
-        hvt->GetGraph()->GetHistogram()->SetStats(0);
-    }
-
-    /*
-    TCanvas &c = d->AddTab("Sky3");
-
-    c.cd();
-
-    p = new TPad("", "", 0, 0, 1, 1);
-    p->Draw();
-    p->cd();
-
-    hvt = (MHVsTime*)h1.DrawClone("nonew");
-    hvt->GetGraph()->SetMarkerStyle(kFullDotSmall);
-    hvt->GetGraph()->GetHistogram()->SetXTitle("Time");
-    hvt->GetGraph()->GetHistogram()->SetYTitle("Zd [\\circ]");
-    hvt->GetGraph()->GetHistogram()->SetTitle("Zd vs. Time");
-    hvt->GetGraph()->GetHistogram()->SetStats(0);
-
-    */
+    //insert lines for 0.5, 1 and 2 SE
+    TLine ln;
+    ln.SetLineColor(kGreen);
+    ln.DrawLine(0, 0.5*360*60/16384., 90, 0.5*360*60/16384.);
+    ln.SetLineColor(kYellow);
+    ln.DrawLine(0, 1.0*360*60/16384., 90, 1.0*360*60/16384.);
+    ln.SetLineColor(kRed);
+    ln.DrawLine(0, 2.0*360*60/16384., 90, 2.0*360*60/16384.);
+
 
     //d.SaveAsPS(2, "rep_files/CC_2003_11_27_22_31_59-new.ps");
