Index: trunk/Mars/fact/plots/quality.C
===================================================================
--- trunk/Mars/fact/plots/quality.C	(revision 18194)
+++ trunk/Mars/fact/plots/quality.C	(revision 18195)
@@ -340,4 +340,147 @@
 }
 
+Int_t PlotHumidity(TArrayD **vec, TString fname)
+{
+    fname += ".FSC_CONTROL_HUMIDITY.fits";
+
+    fits file(fname.Data());
+    if (!file)
+    {
+        cerr << fname << ": " << gSystem->GetError() << endl;
+        return -2;
+    }
+
+    //cout << fname << endl;
+
+    Double_t time;
+    Float_t H[4];
+
+    if (!file.SetPtrAddress("Time",  &time))
+        return -1;
+    if (!file.SetPtrAddress("H",  H))
+        return -1;
+
+    //const int marker_style = kFullDotMedium;
+    const int marker_style = kDot;
+
+    TGraph g1;
+    TGraph g2;
+    TGraph g3;
+    TGraph g4;
+    //TGraph g5;
+    g1.SetName("H0");
+    g2.SetName("H1");
+    g3.SetName("H2");
+    g4.SetName("H3");
+    //g5.SetName("PFmini");
+
+
+    Double_t first_time, last_time;
+    bool found_first_time = false;
+    while (file.GetNextRow())
+        if (Contains(vec, time))
+        {
+            if (!found_first_time){
+              first_time = time*24*3600;
+              found_first_time = true;
+            }            
+            g1.SetPoint(g1.GetN(), time*24*3600, H[0]);
+            g2.SetPoint(g2.GetN(), time*24*3600, H[1]);
+            g3.SetPoint(g3.GetN(), time*24*3600, H[2]);
+            g4.SetPoint(g4.GetN(), time*24*3600, H[3]);
+            //g5.SetPoint(g5.GetN(), time*24*3600, I[319]);
+            last_time = time*24*3600;
+        }
+
+
+    g1.SetMinimum(0);
+    g1.SetMaximum(100);
+    g1.SetMarkerColor(kAzure);
+    g1.SetMarkerStyle(marker_style);
+    g1.GetXaxis()->SetTimeDisplay(true);
+    g1.GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00 GMT");
+    g1.GetXaxis()->SetLabelSize(0.12);
+    g1.GetYaxis()->SetLabelSize(0.1);
+    g1.GetYaxis()->SetTitle("HUMITIDY");
+    g1.GetYaxis()->SetTitleOffset(0.2);
+    g1.GetYaxis()->SetTitleSize(0.1);
+    g1.DrawClone("AP");
+
+    g2.SetMarkerColor(kAzure+1);
+    g2.SetMarkerStyle(marker_style);
+    g2.DrawClone("P");
+    
+    g3.SetMarkerColor(kAzure+3);
+    g3.SetMarkerStyle(marker_style);
+    g3.DrawClone("P");
+    
+    g4.SetMarkerColor(kAzure+6);
+    g4.SetMarkerStyle(marker_style);
+    g4.DrawClone("P");
+    
+    //g5.SetMarkerColor(kAzure+1);
+    //g5.SetMarkerStyle(kFullDotMedium);
+    //g5.DrawClone("P");
+    
+    g1.DrawClone("P");
+
+    TLine l1(first_time-600, 40, last_time+600, 40);
+    l1.SetLineColor(kOrange);
+    l1.DrawClone();
+    TText t1(first_time-600, 41, "Note in logbook");
+    t1.SetTextSize(0.1);
+    t1.DrawClone();
+
+    
+    TLine l2(first_time-600, 55, last_time+600, 55);
+    l2.SetLineColor(kRed);
+    l2.DrawClone();
+    TText t2(first_time-600, 56, "Mail to fact-online.");
+    t2.SetTextSize(0.1);
+    t2.DrawClone();
+
+
+    return 0;
+}
+
+Int_t PlotHumidity2(TArrayD **vec, TString fname)
+{
+    fname += ".PFMINI_CONTROL_DATA.fits";
+
+    fits file(fname.Data());
+    if (!file)
+    {
+        cerr << fname << ": " << gSystem->GetError() << endl;
+        return -2;
+    }
+
+    //cout << fname << endl;
+
+    Double_t time;
+    Float_t H;
+
+    if (!file.SetPtrAddress("Time",  &time))
+        return -1;
+    if (!file.SetPtrAddress("Humidity", &H))
+        return -1;
+
+    const int marker_style = kFullDotMedium;
+    //const int marker_style = kDot;
+
+    TGraph g1;
+    g1.SetName("PFmini");
+
+
+    while (file.GetNextRow())
+        if (Contains(vec, time))
+        {
+            g1.SetPoint(g1.GetN(), time*24*3600, H);
+        }
+    
+    g1.SetMarkerStyle(marker_style);
+    g1.SetMarkerColor(kGreen);
+    g1.DrawClone("P");
+    return 0;
+}
 
 Int_t PlotPointing(TArrayD **vec, TString fname)
@@ -420,5 +563,5 @@
     g.GetXaxis()->SetLabelSize(0.1);
     g.GetYaxis()->SetLabelSize(0.1);
-    g.GetYaxis()->SetTitle("TEMP");
+    g.GetYaxis()->SetTitle("TEMPERATURE");
     g.GetYaxis()->SetTitleOffset(0.2);
     g.GetYaxis()->SetTitleSize(0.1);
@@ -542,6 +685,7 @@
     if (!file.SetPtrAddress("Time",  &time))
         return -1;
-    if (!file.SetPtrAddress("Data1", temp) &&
-        !file.SetPtrAddress("temp", temp))
+//    if (!file.SetPtrAddress("Data1", temp) &&
+//        !file.SetPtrAddress("temp", temp))
+    if (!file.SetPtrAddress("temp", temp))
         return -1;
 
@@ -669,6 +813,6 @@
     }
 
-    TCanvas *c = new TCanvas("quality", Form("Quality %04d/%02d/%02d", y, m, d), 1280, 960);
-    c->Divide(1, 6, 1e-5, 1e-5);
+    TCanvas *c = new TCanvas("quality", Form("Quality %04d/%02d/%02d", y, m, d), 1280, 1120);
+    c->Divide(1, 7, 1e-5, 1e-5);
 
     gROOT->SetSelectedPad(0);
@@ -721,4 +865,13 @@
     cout << PlotTemperature4(runs, fname) << endl;
 
+    gROOT->SetSelectedPad(0);
+    c->cd(7);
+    gPad->SetGrid();
+    gPad->SetTopMargin(0);
+    gPad->SetRightMargin(0.001);
+    gPad->SetLeftMargin(0.04);
+    cout << PlotHumidity(runs, fname) << endl;
+    cout << PlotHumidity2(runs, fname) << endl;
+
     c->SaveAs(Form("%s/%04d%02d%02d.png", outpath, y, m, d));
 
