Index: trunk/Mars/fact/plots/plotratescan.C
===================================================================
--- trunk/Mars/fact/plots/plotratescan.C	(revision 18865)
+++ trunk/Mars/fact/plots/plotratescan.C	(revision 19266)
@@ -172,5 +172,5 @@
     leg.SetFillColor(kWhite);
     leg.SetTextAlign(12);
-    leg.AddText(Form("Ratescan %d ", search_id));
+    leg.AddText(Form("Ratescan %lld ", search_id));
     //leg.AddText("");
     leg.AddText(Form("Begin       %s", time_beg));
@@ -230,7 +230,9 @@
     //c->SaveAs(name+".eps");
     //c->SaveAs("/loc_data/analysis/"+name+".png");
-    c->SaveAs(Form("/data1/analysis/ratescans/%04d/%02d/%02d/%06d_%d.png", atoi(night)/10000, (atoi(night)/100)%100, atoi(night)%100, atoi(night), search_id));
+    c->SaveAs(Form("/data1/analysis/ratescans/%04d/%02d/%02d/%06d_%lld.png", atoi(night)/10000, (atoi(night)/100)%100, atoi(night)%100, atoi(night), search_id));
 
     delete c;
+
+    return kTRUE;
 }
 
@@ -245,10 +247,10 @@
     bool old = file.HasColumn("Data0");
 
-    Double_t  *ptime   = file.SetPtrAddress("Time");
-    UInt_t    *pid     = file.SetPtrAddress(old ? "Data0" : "Id");
-    Float_t   *rates   = file.SetPtrAddress(old ? "Data5" : "BoardRate");
-    UInt_t    *pth     = file.SetPtrAddress(old ? "Data1" : "Threshold");
-    Float_t   *ptrig   = file.SetPtrAddress(old ? "Data4" : "TriggerRate");
-    Float_t   *pontime = file.SetPtrAddress(old ? "Data3" : "RelOnTime");
+    Double_t  *ptime   = (Double_t*)file.SetPtrAddress("Time");
+    UInt_t    *pid     = (UInt_t*)  file.SetPtrAddress(old ? "Data0" : "Id");
+    Float_t   *rates   = (Float_t*) file.SetPtrAddress(old ? "Data5" : "BoardRate");
+    UInt_t    *pth     = (UInt_t*)  file.SetPtrAddress(old ? "Data1" : "Threshold");
+    Float_t   *ptrig   = (Float_t*) file.SetPtrAddress(old ? "Data4" : "TriggerRate");
+    Float_t   *pontime = (Float_t*) file.SetPtrAddress(old ? "Data3" : "RelOnTime");
 
     if (!ptime || !pid || !rates || !pth || !ptrig || !pontime)
@@ -283,5 +285,5 @@
     Long64_t night = atol(_night);
 
-    TString fname = Form("/fact/aux/%04d/%02d/%02d/%06d.RATE_SCAN_DATA.fits",
+    TString fname = Form("/fact/aux/%04lld/%02lld/%02lld/%06lld.RATE_SCAN_DATA.fits",
                          night/10000, (night/100)%100, night%100, night);
 
@@ -316,5 +318,5 @@
     }
 
-    TString oname = Form("%06d-ratescan.root", night);
+    TString oname = Form("%06lld-ratescan.root", night);
     //cout << "   " << oname << '\n' << endl;
     TFile rootfile(oname.Data(), "recreate");
Index: trunk/Mars/fact/plots/quality.C
===================================================================
--- trunk/Mars/fact/plots/quality.C	(revision 18865)
+++ trunk/Mars/fact/plots/quality.C	(revision 19266)
@@ -1,4 +1,8 @@
+#ifndef __CLING__
 #include <algorithm>
 #include <functional>
+#include <vector>
+#include <pair>
+#endif
 
 Bool_t Contains(TArrayD **vec, Double_t t0, Double_t range=0)
@@ -71,7 +75,4 @@
     return 0;
 }
-
-#include <vector>
-#include <pair>
 
 vector<pair<double, Nova::EquPosn>> vecp;
@@ -948,10 +949,13 @@
     TCanvas *c = NULL;
     TString datestring = Form("%04d%02d%02d", y, m, d);
-    if( datestring.Atoi() > 20140723 ) {
-      TCanvas *c = new TCanvas("quality", Form("Quality %04d/%02d/%02d", y, m, d), 1280, 1280);
-      c->Divide(1, 8, 1e-5, 1e-5);
-    }else{
-      TCanvas *c = new TCanvas("quality", Form("Quality %04d/%02d/%02d", y, m, d), 1280, 1120);
-      c->Divide(1, 7, 1e-5, 1e-5);
+    if (datestring.Atoi() > 20140723)
+    {
+        c = new TCanvas("quality", Form("Quality %04d/%02d/%02d", y, m, d), 1280, 1280);
+        c->Divide(1, 8, 1e-5, 1e-5);
+    }
+    else
+    {
+        c = new TCanvas("quality", Form("Quality %04d/%02d/%02d", y, m, d), 1280, 1120);
+        c->Divide(1, 7, 1e-5, 1e-5);
     }
 
@@ -983,5 +987,5 @@
     gPad->SetLeftMargin(0.04);
     cout << PlotRate(runs, fname) << endl;
-    cout << PlotRateQC(night, serv) << endl;
+    PlotRateQC(night, serv);
 
     gROOT->SetSelectedPad(0);
