Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 3213)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 3214)
@@ -4,4 +4,14 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2004/01/17: Raquel de los Reyes
+
+   * mcamera/MCameraHV.h
+     - Now it derives from a MCamEvent class and implemented the
+       GetPixContent() and DrawPixelContent() functions. Added the 
+       GetMean function to get the mean HV settings of the camera.
+
+   * macros/CCDataCheck.C
+     - Added the HV settings plots.
 
  2004/02/11: Hendrik Bartko
Index: /trunk/MagicSoft/Mars/macros/CCDataCheck.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/CCDataCheck.C	(revision 3213)
+++ /trunk/MagicSoft/Mars/macros/CCDataCheck.C	(revision 3214)
@@ -16,5 +16,5 @@
 !
 !
-!   Author(s): Raquel de los Reyes, 01/2004 <mailto:reyes@gae.ucm.es>
+!   Author(s): Raquel de los Reyes, 02/2004 <mailto:reyes@gae.ucm.es>
 !
 !   Copyright: MAGIC Software Development, 2000-2004
@@ -24,8 +24,8 @@
 //
 // This macro made the check of the central control files (.rep files).
-// It displays 8 tabs:
+// It displays 9 tabs:
 //   - Drive system
-//   - Camera status
-//   - HV power supplies
+//   - HV of power supplies and HV settings
+//   - DC of power supplies and several camera related status plots
 //   - LV power supplies
 //   - Cooling system
@@ -36,12 +36,13 @@
 ////////////////////////////////////////////////////////////////////////////
 
-void CCDataCheck(const TString filename="CC_2003_11_30_20_29_20.root", const TString directory="../rootfiles/2003_12_01/")
+void CCDataCheck(const TString filename="CC_2004_02_11.root", const TString directory="../")
 {
+
   //
   // Check of the raw files
   //
-  MStatusDisplay *d = new MStatusDisplay;
-  d->SetTitle(Form("- %s -",filename));
-  d->SetLogStream(&gLog, kTRUE);            // Disables output to stdout
+//    MStatusDisplay *d = new MStatusDisplay;
+//    d->SetTitle(filename);
+//    d->SetLogStream(&gLog, kTRUE);            // Disables output to stdout
 
   //
@@ -127,4 +128,6 @@
   MHVsTime hCoolStatus("MCameraCooling.fStatus");
   hCoolStatus.SetName("CoolingStatus");
+  MHVsTime hCamMean("MCameraHV.fMean");
+  hCamMean.SetName("CameraMean");
 
   // Reads the trees of the root file and the analysed branches
@@ -148,7 +151,7 @@
 
   // Set of MHCamEvents classes
-//    MHCamEvent HVdisplay("CamHV","Camera HV supplies");
-//    HVdisplay.SetBit(MHCamera::kVariance);
-//    plist.AddToList(&HVdisplay);
+  MHCamEvent HVdisplay("CamHV","Camera mean HV settings");
+  HVdisplay.SetBit(MHCamera::kVariance);
+  plist.AddToList(&HVdisplay);
 
   // Set of MHPixVsTime classes (Trigger macroscells)
@@ -294,5 +297,6 @@
   MFillH filltrigmc18("TrigMacrocell18","MReportTrigger");
   MFillH filltrigmc19("TrigMacrocell19","MReportTrigger");
-//    MFillH fillHVD("CamHV","MCameraHV");
+  MFillH fillcammean(&hCamMean,"MTimeCamera");
+  MFillH fillHVD(&HVdisplay,"MCameraHV");
 
   // Do not display the result given by the default draw function
@@ -350,5 +354,63 @@
   filltrigmc18.SetBit(MFillH::kDoNotDisplay);
   filltrigmc19.SetBit(MFillH::kDoNotDisplay);
-//    fillHVD.SetBit(MFillH::kDoNotDisplay);
+  fillcammean.SetBit(MFillH::kDoNotDisplay);
+  fillHVD.SetBit(MFillH::kDoNotDisplay);
+
+  // Skip the fill function is there is no tree entries
+  fillZd.SetBit(MFillH::kCanSkip);
+  fillAz.SetBit(MFillH::kCanSkip);
+  fillError.SetBit(MFillH::kCanSkip);
+  fillDState.SetBit(MFillH::kCanSkip);
+  fillError2.SetBit(MFillH::kCanSkip);
+  fillHVA.SetBit(MFillH::kCanSkip);
+  fillHVB.SetBit(MFillH::kCanSkip);
+  fillCA.SetBit(MFillH::kCanSkip);
+  fillCB.SetBit(MFillH::kCanSkip);
+  fillLVTemp.SetBit(MFillH::kCanSkip);
+  fillLVHum.SetBit(MFillH::kCanSkip);
+  fillLVStatus.SetBit(MFillH::kCanSkip);
+  fillLVRPS.SetBit(MFillH::kCanSkip);
+  fillTCenter.SetBit(MFillH::kCanSkip);
+  fillTWall.SetBit(MFillH::kCanSkip);
+  fillTWater.SetBit(MFillH::kCanSkip);
+  fillTOptLink.SetBit(MFillH::kCanSkip);
+  fillTempOptLink.SetBit(MFillH::kCanSkip);
+  fillHWall.SetBit(MFillH::kCanSkip);
+  fillHCenter.SetBit(MFillH::kCanSkip);
+  fillCCHum.SetBit(MFillH::kCanSkip);
+  fillCCTemp.SetBit(MFillH::kCanSkip);
+  fillCCWS.SetBit(MFillH::kCanSkip);
+  fillCCSR.SetBit(MFillH::kCanSkip);
+  fillTrigBL2.SetBit(MFillH::kCanSkip);
+  fillTrigAL2.SetBit(MFillH::kCanSkip);
+  fillTrigStatus.SetBit(MFillH::kCanSkip);
+  fillTrigZd.SetBit(MFillH::kCanSkip);
+  fillCamStatus.SetBit(MFillH::kCanSkip);
+  fillCamSentStatus.SetBit(MFillH::kCanSkip);
+  fillCamStatusDC.SetBit(MFillH::kCanSkip);
+  fillHVStatus.SetBit(MFillH::kCanSkip);
+  fillLidsStatus.SetBit(MFillH::kCanSkip);
+  fillCoolStatus.SetBit(MFillH::kCanSkip);
+  filltrigmc1.SetBit(MFillH::kCanSkip);
+  filltrigmc2.SetBit(MFillH::kCanSkip);
+  filltrigmc3.SetBit(MFillH::kCanSkip);
+  filltrigmc4.SetBit(MFillH::kCanSkip);
+  filltrigmc5.SetBit(MFillH::kCanSkip);
+  filltrigmc6.SetBit(MFillH::kCanSkip);
+  filltrigmc7.SetBit(MFillH::kCanSkip);
+  filltrigmc8.SetBit(MFillH::kCanSkip);
+  filltrigmc9.SetBit(MFillH::kCanSkip);
+  filltrigmc10.SetBit(MFillH::kCanSkip);
+  filltrigmc11.SetBit(MFillH::kCanSkip);
+  filltrigmc12.SetBit(MFillH::kCanSkip);
+  filltrigmc13.SetBit(MFillH::kCanSkip);
+  filltrigmc14.SetBit(MFillH::kCanSkip);
+  filltrigmc15.SetBit(MFillH::kCanSkip);
+  filltrigmc16.SetBit(MFillH::kCanSkip);
+  filltrigmc17.SetBit(MFillH::kCanSkip);
+  filltrigmc18.SetBit(MFillH::kCanSkip);
+  filltrigmc19.SetBit(MFillH::kCanSkip);
+  fillcammean.SetBit(MFillH::kCanSkip);
+  fillHVD.SetBit(MFillH::kCanSkip);
 
   // Add all the task to the task list
@@ -407,5 +469,6 @@
   tlist.AddToList(&filltrigmc18, "Trigger");
   tlist.AddToList(&filltrigmc19, "Trigger");
-//    tlist.AddToList(&fillHVD);
+  tlist.AddToList(&fillcammean, "Camera");
+  tlist.AddToList(&fillHVD);
 
   //
@@ -414,5 +477,5 @@
   MEvtLoop evtloop;
   evtloop.SetParList(&plist);
-  evtloop.SetDisplay(d);
+//    evtloop.SetDisplay(d);
     
   //
@@ -426,9 +489,20 @@
   gStyle->SetPadGridX(kTRUE);
   gStyle->SetPadGridY(kTRUE);
-
+  gStyle->SetCanvasColor(kWhite);
+  MHVsTime *clone1;
+  TGraph *g;
+  TH1 *hist;
+  TAxis *axey;
+  TAxis *axex;
+  MH3 *mh3;
+  MHPixVsTime *pixclone1;
+  MHCamera *Sum;
   //
   // Drive report (pointing.C from T. Bretz)
   //
-  TCanvas &c1 = d.AddTab("DRIVE SYSTEM");
+  if ((d = evtloop.GetDisplay()))
+    TCanvas &c1 = d.AddTab("DRIVE SYSTEM");
+  else
+    TCanvas *c1 = new TCanvas();
   // ************* Plot the telescope tracking positions on the sky ***********
   TGraph *g1 = hZd.GetGraph();
@@ -474,5 +548,5 @@
     }
   // ---------------------- Control deviation of the motors -------------------
-  c1.cd();
+  c1->cd();
   p = new TPad("", "", 0.6, 0, 1, 0.29);
   p->Draw();
@@ -480,5 +554,5 @@
   gStyle->SetOptStat(1110);
   gStyle->SetStatFormat(".2g");
-  MH3 *mh3 = (MH3*)hError.DrawClone("nonew");
+  mh3 = (MH3*)hError.DrawClone("nonew");
   mh3->GetHist()->SetXTitle("\\Delta [arcmin]");
   mh3->GetHist()->SetYTitle("");
@@ -493,30 +567,33 @@
   ln.DrawLine(2.0*360*60/16384., 0, 2.0*360*60/16384., hError.GetHist()->GetMaximum());
   // ---------------------- Plot the drive status vs time ---------------------
-  c1.cd();
+  c1->cd();
   p = new TPad("", "", 0.6, 0.29, 1, 0.42);
   p->Draw();
   p->cd();
-  hvt = (MHVsTime*)hDState.DrawClone("nonew");
+  MHVsTime *hvt = (MHVsTime*)hDState.DrawClone("nonew");
   hvt->GetGraph()->SetMarkerStyle(kFullDotSmall);
-  TH1 *hist = hvt->GetGraph()->GetHistogram();
-  TAxis *axey = hist->GetYaxis();
-  TAxis *axex = hist->GetXaxis();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("");
-  hist->SetTitle("");
-  hist->SetStats(0);
-  hist->SetMinimum(-0.5);
-  hist->SetMaximum(4.5);
-  axey->Set(5, -0.5, 4.5);
-  axey->SetBinLabel(axey->FindFixBin(0), "Error");
-  axey->SetBinLabel(axey->FindFixBin(1), "Stopped");
-  axey->SetBinLabel(axey->FindFixBin(3), "Moving");
-  axey->SetBinLabel(axey->FindFixBin(4), "Tracking");
-  axey->SetLabelSize(0.15);
-  axex->SetLabelSize(0.08);
-  axex->SetTitleSize(0.09);
-  axex->SetTitleOffset(0.45);
+  if (hvt->GetGraph()->GetN())
+    {
+      hist = hvt->GetGraph()->GetHistogram();
+      TAxis *axey = hist->GetYaxis();
+      TAxis *axex = hist->GetXaxis();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("");
+      hist->SetTitle("");
+      hist->SetStats(0);
+      hist->SetMinimum(-0.5);
+      hist->SetMaximum(4.5);
+      axey->Set(5, -0.5, 4.5);
+      axey->SetBinLabel(axey->FindFixBin(0), "Error");
+      axey->SetBinLabel(axey->FindFixBin(1), "Stopped");
+      axey->SetBinLabel(axey->FindFixBin(3), "Moving");
+      axey->SetBinLabel(axey->FindFixBin(4), "Tracking");
+      axey->SetLabelSize(0.15);
+      axex->SetLabelSize(0.08);
+      axex->SetTitleSize(0.09);
+      axex->SetTitleOffset(0.45);
+    }  
   // --------------- Control deviation of the motors vs zenith angle ----------
-  c1.cd();
+  c1->cd();
   p = new TPad("", "", 0.6, 0.71, 1, 1);
   p->Draw();
@@ -531,5 +608,5 @@
   mh3->GetHist()->Draw("box");
   // -------------------------- Zenith angle vs time --------------------------
-  c1.cd();
+  c1->cd();
   p = new TPad("", "", 0.6, 0.42, 1, 0.71);
   p->Draw();
@@ -550,300 +627,355 @@
   // Camera report 
   // 
-  // *********************** Camera status ************************************
-  TCanvas &c2 = d.AddTab("CAMERA STATUS");
-  c2->Divide(2,3);
+  // ************************* HV of power supplies ***************************
+  if ((d = evtloop.GetDisplay()))
+    TCanvas &c2 = d.AddTab("CAMERA HV");
+  else
+    TCanvas *c2 = new TCanvas();
+  c2->Divide(2,2);
   c2->cd(1);
-  TGraph *g = hCamStatus.GetGraph();
-  g->SetMarkerStyle(kFullDotSmall);
-  g->SetTitle("Camera status");
-  MHVsTime *clone1 = (MHVsTime*)hCamStatus.DrawClone("nonew");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  axey = hist->GetYaxis();
-  hist->SetMinimum(-0.5);
-  hist->SetMaximum(9.5);
-  axey->Set(10,-0.5,9.5);
-  axey->SetBinLabel(axey->FindFixBin(0),"EROR");
-  axey->SetBinLabel(axey->FindFixBin(1),"ALARM");
-  axey->SetBinLabel(axey->FindFixBin(2),"BLOCKED!");
-  axey->SetBinLabel(axey->FindFixBin(3),"WARM!");
-  axey->SetBinLabel(axey->FindFixBin(4),"HOT");
-  axey->SetBinLabel(axey->FindFixBin(5),"HVRAMPING");
-  axey->SetBinLabel(axey->FindFixBin(6),"OK");
-  axey->SetBinLabel(axey->FindFixBin(7),"INIT");
-  axey->SetBinLabel(axey->FindFixBin(8),"SHUTD");
-  axey->SetBinLabel(axey->FindFixBin(9),"N/A");
-  axey->SetLabelSize(0.07);
-  hist->SetXTitle("Time");
-  hist->SetYTitle("");
-  c2->cd(2);
-  TGraph *g = hCamStatusDC.GetGraph();
-  g->SetMarkerStyle(kFullDotSmall);
-  g->SetTitle("Camera DC status");
-  MHVsTime *clone1 = (MHVsTime*)hCamStatusDC.DrawClone("nonew");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  axey = hist->GetYaxis();
-  hist->SetMinimum(-0.5);
-  hist->SetMaximum(9.5);
-  axey->Set(10,-0.5,9.5);
-  axey->SetBinLabel(axey->FindFixBin(0),"Error");
-  axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
-  axey->SetBinLabel(axey->FindFixBin(3),"Hot");
-  axey->SetBinLabel(axey->FindFixBin(5),"Ok");
-  axey->SetBinLabel(axey->FindFixBin(6),"Warm");
-  axey->SetBinLabel(axey->FindFixBin(9),"n/a");
-  axey->SetLabelSize(0.07);
-  hist->SetXTitle("Time");
-  hist->SetYTitle("");
-  c2->cd(3);
-  TGraph *g = hHVStatus.GetGraph();
-  g->SetMarkerStyle(kFullDotSmall);
-  g->SetTitle("Camera HV status");
-  MHVsTime *clone1 = (MHVsTime*)hHVStatus.DrawClone("nonew");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  axey = hist->GetYaxis();
-  hist->SetMinimum(-0.5);
-  hist->SetMaximum(9.5);
-  axey->Set(10,-0.5,9.5);
-  axey->SetBinLabel(axey->FindFixBin(0),"Error");
-  axey->SetBinLabel(axey->FindFixBin(1),"Mismatch");
-  axey->SetBinLabel(axey->FindFixBin(2),"Trip");
-  axey->SetBinLabel(axey->FindFixBin(3),"Ramping");
-  axey->SetBinLabel(axey->FindFixBin(4),"Off");
-  axey->SetBinLabel(axey->FindFixBin(5),"Nominal");
-  axey->SetBinLabel(axey->FindFixBin(6),"LimCurrentWarning");
-  axey->SetBinLabel(axey->FindFixBin(9),"n/a");
-  axey->SetLabelSize(0.07);
-  hist->SetXTitle("Time");
-  hist->SetYTitle("");
-  c2->cd(4);
-  TGraph *g = hLidsStatus.GetGraph();
-  g->SetMarkerStyle(kFullDotSmall);
-  g->SetTitle("Camera Lids status");
-  MHVsTime *clone1 = (MHVsTime*)hLidsStatus.DrawClone("nonew");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  axey = hist->GetYaxis();
-  hist->SetMinimum(-0.5);
-  hist->SetMaximum(9.5);
-  axey->Set(10,-0.5,9.5);
-  axey->SetBinLabel(axey->FindFixBin(0),"Error");
-  axey->SetBinLabel(axey->FindFixBin(1),"SafetyLimit");
-  axey->SetBinLabel(axey->FindFixBin(4),"Closed");
-  axey->SetBinLabel(axey->FindFixBin(5),"Opened");
-  axey->SetBinLabel(axey->FindFixBin(6),"Moving");
-  axey->SetBinLabel(axey->FindFixBin(7),"Stopped");
-  axey->SetBinLabel(axey->FindFixBin(9),"n/a");
-  axey->SetLabelSize(0.07);
-  hist->SetXTitle("Time");
-  hist->SetYTitle("");
-  c2->cd(5);
-  TGraph *g = hCoolStatus.GetGraph();
-  g->SetMarkerStyle(kFullDotSmall);
-  g->SetTitle("Camera cooling status");
-  MHVsTime *clone1 = (MHVsTime*)hCoolStatus.DrawClone("nonew");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  axey = hist->GetYaxis();
-  hist->SetMinimum(-0.5);
-  hist->SetMaximum(9.5);
-  axey->Set(10,-0.5,9.5);
-  axey->SetBinLabel(axey->FindFixBin(0),"Error");
-  axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
-  axey->SetBinLabel(axey->FindFixBin(4),"Off");
-  axey->SetBinLabel(axey->FindFixBin(5),"Ok");
-  axey->SetBinLabel(axey->FindFixBin(6),"Temp.Warning");
-  axey->SetBinLabel(axey->FindFixBin(7),"Cond.Warning");
-  axey->SetBinLabel(axey->FindFixBin(9),"n/a");
-  axey->SetLabelSize(0.07);
-  hist->SetXTitle("Time");
-  hist->SetYTitle("");
-  c2->cd(6);
-  TGraph *g = hCamSentStatus.GetGraph();
-  g->SetMarkerStyle(kFullDotSmall);
-  g->SetTitle("Camera sentinel status");
-  MHVsTime *clone1 = (MHVsTime*)hCamSentStatus.DrawClone("nonew");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  axey = hist->GetYaxis();
-  hist->SetMinimum(-0.5);
-  hist->SetMaximum(9.5);
-  axey->Set(10,-0.5,9.5);
-  axey->SetBinLabel(axey->FindFixBin(0),"ERROR");
-  axey->SetBinLabel(axey->FindFixBin(1),"ALL IS OK");
-  axey->SetBinLabel(axey->FindFixBin(2),"SUN IS PRESENT");
-  axey->SetBinLabel(axey->FindFixBin(3),"BAD ATM. COND.");
-  axey->SetBinLabel(axey->FindFixBin(4),"BAD T/RH CAMERA");
-  axey->SetBinLabel(axey->FindFixBin(5),"HOT CAMERA");
-  axey->SetBinLabel(axey->FindFixBin(6),"FADC FANS PROB.");
-  axey->SetBinLabel(axey->FindFixBin(7),"CECO TIMEOUT");
-  axey->SetBinLabel(axey->FindFixBin(9),"N/A");
-  axey->SetLabelSize(0.07);
-  hist->SetXTitle("Time");
-  hist->SetYTitle("");
-
-  // ******************** HV and currents of power supplies *******************
-  TCanvas &c3 = d.AddTab("CAMERA HV");
-  c3->Divide(1,2);
-  c3->cd(1);
-  // ---------------------------- High voltages -------------------------------
+  // ---------------------------- Power supplies ------------------------------
   TLegend *legHV = new TLegend(0.85,0.75,0.99,0.99);
-  TGraph *g = hHVA.GetGraph();
+  g = hHVA.GetGraph();
   g->SetMarkerColor(2);
   g->SetLineColor(2);
   g->SetTitle("Voltages of power supplies");
-  legHV->AddEntry(g,"Power supply A (hvps1)","l");
+  legHV->AddEntry(g,"PS A (hvps1)","l");
+  clone1 = (MHVsTime*)hHVA.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("High voltage [V]");
+      hist->SetMinimum(0);
+    }
   g = hHVB.GetGraph();
   g->SetMarkerColor(3);
   g->SetLineColor(3);
-  legHV->AddEntry(g,"Power supply B (hvps2)","l");
-  MHVsTime *clone1 = (MHVsTime*)hHVA.DrawClone("nonew");
-  MHVsTime *clone2 = (MHVsTime*)hHVB.DrawClone("nonewsame");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("High voltage [V]");
-  hist->SetMinimum(0);
+  legHV->AddEntry(g,"PS B (hvps2)","l");
+  clone1 = (MHVsTime*)hHVB.DrawClone("nonewsame");
   legHV->DrawClone();
-  c3->cd(2);
-  // ----------------------------- Currents ----------------------------------
+  // ---------------------------- HV settings ---------------------------------
+  c2->cd(2);
+  g = hCamMean.GetGraph();
+  g->SetMarkerColor(2);
+  g->SetLineColor(2);
+  g->SetTitle("Camera mean HV settings");
+  clone1 = (MHVsTime*)hCamMean.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("HV [V]");
+      hist->SetMinimum(0);
+    }
+  c2->cd(3);
+  Sum = (MHCamera*)HVdisplay.GetHistByName("sum");
+  TVirtualPad *c = gPad;
+  c->cd(1);
+  gPad->SetBorderMode(0);
+  Sum->SetYTitle("Mean");
+  Sum->DrawClone("pixelindex"); 
+  c2->cd(4);
+  gPad->SetBorderMode(0);
+  Sum->SetYTitle("Mean HV settings");
+  Sum->DrawClone("EPhist");
+
+  // ******************** Currents of power supplies *******************
+  if ((d = evtloop.GetDisplay()))
+    TCanvas &c3 = d.AddTab("CAMERA DC");
+  else
+    TCanvas *c3 = new TCanvas();
+ // ----------------------------- Power supplies ------------------------------
+  c3->Divide(1,2);
+  c3->cd(1);
   TLegend *legC = new TLegend(0.85,0.75,0.99,0.99);
-  TGraph *g = hCA.GetGraph();
+  g = hCA.GetGraph();
   g->SetMarkerColor(2);
   g->SetLineColor(2);
   g->SetTitle("Currents of power supplies");
   legC->AddEntry(g,"Power supply A (curr1)","l");
+  clone1 = (MHVsTime*)hCA.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("Current [mA]");
+      hist->SetMinimum(0);
+    }
   g = hCB.GetGraph();
   g->SetMarkerColor(3);
   g->SetLineColor(3);
   legC->AddEntry(g,"Power supply B (curr2)","l");
-  MHVsTime *clone1 = (MHVsTime*)hCA.DrawClone("nonew");
-  MHVsTime *clone2 = (MHVsTime*)hCB.DrawClone("nonewsame");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("Current [mA]");
-  hist->SetMinimum(0);
+  clone1 = (MHVsTime*)hCB.DrawClone("nonewsame");
   legC->DrawClone();
-
+  c3->cd(2);
+  gPad->SetBorderMode(0);
+  gPad->Divide(2,2);
+  TVirtualPad *c = gPad;
+  c->cd(1);
+  g = hCamStatus.GetGraph();
+  g->SetMarkerStyle(kFullDotSmall);
+  g->SetTitle("Camera status");
+  clone1 = (MHVsTime*)hCamStatus.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      axey = hist->GetYaxis();
+      hist->SetMinimum(-0.5);
+      hist->SetMaximum(9.5);
+      axey->Set(10,-0.5,9.5);
+      axey->SetBinLabel(axey->FindFixBin(0),"EROR");
+      axey->SetBinLabel(axey->FindFixBin(1),"ALARM");
+      axey->SetBinLabel(axey->FindFixBin(2),"BLOCKED!");
+      axey->SetBinLabel(axey->FindFixBin(3),"WARM!");
+      axey->SetBinLabel(axey->FindFixBin(4),"HOT");
+      axey->SetBinLabel(axey->FindFixBin(5),"HVRAMPING");
+      axey->SetBinLabel(axey->FindFixBin(6),"OK");
+      axey->SetBinLabel(axey->FindFixBin(7),"INIT");
+      axey->SetBinLabel(axey->FindFixBin(8),"SHUTD");
+      axey->SetBinLabel(axey->FindFixBin(9),"N/A");
+      axey->SetLabelSize(0.07);
+      hist->SetXTitle("Time");
+      hist->SetYTitle("");
+    }
+  c->cd(2);
+  g = hCamStatusDC.GetGraph();
+  g->SetMarkerStyle(kFullDotSmall);
+  g->SetTitle("Camera DC status");
+  clone1 = (MHVsTime*)hCamStatusDC.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      axey = hist->GetYaxis();
+      hist->SetMinimum(-0.5);
+      hist->SetMaximum(9.5);
+      axey->Set(10,-0.5,9.5);
+      axey->SetBinLabel(axey->FindFixBin(0),"Error");
+      axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
+      axey->SetBinLabel(axey->FindFixBin(3),"Hot");
+      axey->SetBinLabel(axey->FindFixBin(5),"Ok");
+      axey->SetBinLabel(axey->FindFixBin(6),"Warm");
+      axey->SetBinLabel(axey->FindFixBin(9),"n/a");
+      axey->SetLabelSize(0.07);
+      hist->SetXTitle("Time");
+      hist->SetYTitle("");
+    }
+  c->cd(3);
+  g = hHVStatus.GetGraph();
+  g->SetMarkerStyle(kFullDotSmall);
+  g->SetTitle("Camera HV status");
+  clone1 = (MHVsTime*)hHVStatus.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      axey = hist->GetYaxis();
+      hist->SetMinimum(-0.5);
+      hist->SetMaximum(9.5);
+      axey->Set(10,-0.5,9.5);
+      axey->SetBinLabel(axey->FindFixBin(0),"Error");
+      axey->SetBinLabel(axey->FindFixBin(1),"Mismatch");
+      axey->SetBinLabel(axey->FindFixBin(2),"Trip");
+      axey->SetBinLabel(axey->FindFixBin(3),"Ramping");
+      axey->SetBinLabel(axey->FindFixBin(4),"Off");
+      axey->SetBinLabel(axey->FindFixBin(5),"Nominal");
+      axey->SetBinLabel(axey->FindFixBin(6),"LimCurrentWarning");
+      axey->SetBinLabel(axey->FindFixBin(9),"n/a");
+      axey->SetLabelSize(0.07);
+      hist->SetXTitle("Time");
+      hist->SetYTitle("");
+    }
+  c->cd(4);
+  g = hLidsStatus.GetGraph();
+  g->SetMarkerStyle(kFullDotSmall);
+  g->SetTitle("Camera Lids status");
+  clone1 = (MHVsTime*)hLidsStatus.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      axey = hist->GetYaxis();
+      hist->SetMinimum(-0.5);
+      hist->SetMaximum(9.5);
+      axey->Set(10,-0.5,9.5);
+      axey->SetBinLabel(axey->FindFixBin(0),"Error");
+      axey->SetBinLabel(axey->FindFixBin(1),"SafetyLimit");
+      axey->SetBinLabel(axey->FindFixBin(4),"Closed");
+      axey->SetBinLabel(axey->FindFixBin(5),"Opened");
+      axey->SetBinLabel(axey->FindFixBin(6),"Moving");
+      axey->SetBinLabel(axey->FindFixBin(7),"Stopped");
+      axey->SetBinLabel(axey->FindFixBin(9),"n/a");
+      axey->SetLabelSize(0.07);
+      hist->SetXTitle("Time");
+      hist->SetYTitle("");
+    }
   // ***************************** LV power supplies **************************
-  TCanvas &c4 = d.AddTab("CAMERA LV");
+  if ((d = evtloop.GetDisplay()))
+    TCanvas &c4 = d.AddTab("CAMERA LV");
+  else
+    TCanvas *c4 = new TCanvas();
   c4->Divide(2,2);
   c4->cd(1);
-  TGraph *g = hLVTemp.GetGraph();
+  g = hLVTemp.GetGraph();
   g->SetMarkerColor(2);
   g->SetLineColor(2);
   g->SetTitle("LV temperature");
-  MHVsTime *clone1 = (MHVsTime*)hLVTemp.DrawClone("nonew");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("Temperature [\\circ]");
+  clone1 = (MHVsTime*)hLVTemp.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("Temperature [\\circ]");
+    }
   c4->cd(2);
-  TGraph *g = hLVHum.GetGraph();
+  g = hLVHum.GetGraph();
   g->SetMarkerColor(4);
   g->SetLineColor(4);
   g->SetTitle("LV humidity");
-  MHVsTime *clone1 = (MHVsTime*)hLVHum.DrawClone("nonew");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("Humidity [%]");
+  clone1 = (MHVsTime*)hLVHum.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("Humidity [%]");
+    }
   c4->cd(3);
-  TGraph *g = hLVStatus.GetGraph();
+  g = hLVStatus.GetGraph();
   g->SetMarkerStyle(kFullDotSmall);
   g->SetTitle("LV status");
-  MHVsTime *clone1 = (MHVsTime*)hLVStatus.DrawClone("nonew");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  axey = hist->GetYaxis();
-  hist->SetMinimum(-0.5);
-  hist->SetMaximum(9.5);
-  axey->Set(10,-0.5,9.5);
-  axey->SetBinLabel(axey->FindFixBin(0),"Error");
-  axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
-  axey->SetBinLabel(axey->FindFixBin(2),"Trip");
-  axey->SetBinLabel(axey->FindFixBin(4),"Off");
-  axey->SetBinLabel(axey->FindFixBin(5),"On");
-  axey->SetBinLabel(axey->FindFixBin(9),"n/a");
-  hist->SetXTitle("Time");
-  hist->SetYTitle("");
+  clone1 = (MHVsTime*)hLVStatus.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      axey = hist->GetYaxis();
+      hist->SetMinimum(-0.5);
+      hist->SetMaximum(9.5);
+      axey->Set(10,-0.5,9.5);
+      axey->SetBinLabel(axey->FindFixBin(0),"Error");
+      axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
+      axey->SetBinLabel(axey->FindFixBin(2),"Trip");
+      axey->SetBinLabel(axey->FindFixBin(4),"Off");
+      axey->SetBinLabel(axey->FindFixBin(5),"On");
+      axey->SetBinLabel(axey->FindFixBin(9),"n/a");
+      hist->SetXTitle("Time");
+      hist->SetYTitle("");
+    }
   c4->cd(4);
-  TGraph *g = hLVRPS.GetGraph();
+  g = hLVRPS.GetGraph();
   g->SetMarkerStyle(kFullDotSmall);
   g->SetTitle("LV request power supply");
-  MHVsTime *clone1 = (MHVsTime*)hLVRPS.DrawClone("nonew");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("");
-  axey = hist->GetYaxis();
-  hist->SetMinimum(-0.5);
-  hist->SetMaximum(1.5);
-  axey->Set(2, -0.5, 1.5);
-  axey->SetBinLabel(axey->FindFixBin(0), "OFF");
-  axey->SetBinLabel(axey->FindFixBin(1), "ON");
+  clone1 = (MHVsTime*)hLVRPS.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("");
+      axey = hist->GetYaxis();
+      hist->SetMinimum(-0.5);
+      hist->SetMaximum(1.5);
+      axey->Set(2, -0.5, 1.5);
+      axey->SetBinLabel(axey->FindFixBin(0), "OFF");
+      axey->SetBinLabel(axey->FindFixBin(1), "ON");
+    }
   // ****************************** Cooling ***********************************
-  TCanvas &c5 = d.AddTab("COOLING SYSTEM");
+  if ((d = evtloop.GetDisplay()))
+    TCanvas &c5 = d.AddTab("COOLING SYSTEM");
+  else
+    TCanvas *c5 = new TCanvas();
   gStyle->SetPadGridX(kTRUE);
   gStyle->SetPadGridY(kTRUE);
-  c5->Divide(1,2);
+  c5->Divide(2,2);
   c5->cd(1);
   // -------------------------- Camera temperatures ---------------------------
   TLegend *legtemp = new TLegend(0.85,0.75,0.99,0.99);
-  TGraph *g = hTCenter.GetGraph();
+  g = hTCenter.GetGraph();
   g->SetMarkerColor(8);
   g->SetLineColor(8);
   g->SetTitle("Camera temperature");
   legtemp->AddEntry(g,"T at camera center","l");
+  clone1 = (MHVsTime*)hTCenter.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("Temperature [\\circ C]");
+      hist->SetMinimum(0);
+    }
   g = hTWall.GetGraph();
   g->SetMarkerColor(12);
   g->SetLineColor(12);
   legtemp->AddEntry(g,"T at camera wall","l");
+  clone1 = (MHVsTime*)hTWall.DrawClone("nonewsame");
   g = hTWater.GetGraph();
   g->SetMarkerColor(4);
   g->SetLineColor(4);
   legtemp->AddEntry(g,"T at water deposit","l");
+  clone1 = (MHVsTime*)hTWater.DrawClone("nonewsame");
   g = hTOptLink.GetGraph();
   g->SetMarkerColor(2);
   g->SetLineColor(2);
   legtemp->AddEntry(g,"T at optical links","l");
-  MHVsTime *clone1 = (MHVsTime*)hTCenter.DrawClone("nonew");
-  MHVsTime *clone2 = (MHVsTime*)hTWall.DrawClone("nonewsame");
-  MHVsTime *clone3 = (MHVsTime*)hTWater.DrawClone("nonewsame");
-  MHVsTime *clone4 = (MHVsTime*)hTOptLink.DrawClone("nonewsame");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("Temperature [\\circ C]");
-  hist->SetMinimum(0);
+  clone1 = (MHVsTime*)hTOptLink.DrawClone("nonewsame");
   legtemp->DrawClone();
+  c5->cd(2);
+  g = hCoolStatus.GetGraph();
+  g->SetMarkerStyle(kFullDotSmall);
+  g->SetTitle("Camera cooling status");
+  clone1 = (MHVsTime*)hCoolStatus.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      axey = hist->GetYaxis();
+      hist->SetMinimum(-0.5);
+      hist->SetMaximum(9.5);
+      axey->Set(10,-0.5,9.5);
+      axey->SetBinLabel(axey->FindFixBin(0),"Error");
+      axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
+      axey->SetBinLabel(axey->FindFixBin(4),"Off");
+      axey->SetBinLabel(axey->FindFixBin(5),"Ok");
+      axey->SetBinLabel(axey->FindFixBin(6),"Temp.Warning");
+      axey->SetBinLabel(axey->FindFixBin(7),"Cond.Warning");
+      axey->SetBinLabel(axey->FindFixBin(9),"n/a");
+      axey->SetLabelSize(0.05);
+      hist->SetXTitle("Time");
+      hist->SetYTitle("");
+    }
   // ------------------------- Camera relative humidity -----------------------
-  c5->cd(2);
-  gPad->SetBorderMode(0);
-  gPad->Divide(2, 1);
-  TVirtualPad *c = gPad;
-  c->cd(1);
+  c5->cd(3);
   TLegend *leghum = new TLegend(0.75,0.75,0.99,0.99);
-  TGraph *g = hHCenter.GetGraph();
+  g = hHCenter.GetGraph();
   g->SetMarkerColor(8);
   g->SetLineColor(8);
   g->SetTitle("Camera relative humidity");
   leghum->AddEntry(g,"RH at camera center","l");
+  clone1 = (MHVsTime*)hHCenter.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("Relative humidity [%]");
+      hist->SetMaximum(50);
+      hist->SetMinimum(0);
+    }
   g = hHWall.GetGraph();
   g->SetMarkerColor(12);
   g->SetLineColor(12);
   leghum->AddEntry(g,"RH at camera wall","l");
-  clone1 = (MHVsTime*)hHCenter.DrawClone("nonew");
-  clone2 = (MHVsTime*)hHWall.DrawClone("nonewsame");
-  hist = clone1->GetGraph()->GetHistogram();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("Relative humidity [%]");
-  hist->SetMaximum(50);
-  hist->SetMinimum(0);
+  clone1 = (MHVsTime*)hHWall.DrawClone("nonewsame");
   leghum->DrawClone();
   // ---------------------- Temperature distribution --------------------------
-  c->cd(2);
-  TH1F *h3 = hTempOptLink.GetHistByName("TOptLink");
-  h3->SetXTitle("Temperature [\\circ C]");
-  h3->SetYTitle("");
-  h3->SetLineColor(2);
-  h3->SetTitle("Distribution of opt. links temperature");
-  h3->SetStats(0);
-  MH3 *mh3 = (MH3*)hTempOptLink.DrawClone("nonew");
-
+  c5->cd(4);
+  hist = hTempOptLink.GetHistByName("TOptLink");
+  hist->SetXTitle("Temperature [\\circ C]");
+  hist->SetYTitle("");
+  hist->SetLineColor(2);
+  hist->SetTitle("Distribution of opt. links temperature");
+  hist->SetStats(0);
+  mh3 = (MH3*)hTempOptLink.DrawClone("nonew");
   //
   // **************************** Trigger report ******************************
   //
-  TCanvas &c6 = d.AddTab("TRIGGER SYSTEM");
+  if ((d = evtloop.GetDisplay()))
+    TCanvas &c6 = d.AddTab("TRIGGER SYSTEM");
+  else
+    TCanvas *c6 = new TCanvas();
   c6->Divide(1,3);
   c6->cd(1);
@@ -851,5 +983,5 @@
   gStyle->SetPadGridY(kTRUE);
   TLegend *legtrig = new TLegend(0.85,0.85,0.99,0.99);
-  TGraph *g = hTrigBL2.GetGraph();
+  g = hTrigBL2.GetGraph();
   g->SetMarkerStyle(kFullDotSmall);
   g->SetMarkerColor(2);
@@ -857,71 +989,86 @@
   g->SetTitle("L2 trigger rate");
   legtrig->AddEntry(g,"Before prescaler","l");
+  clone1 = (MHVsTime*)hTrigBL2.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("L2 trigger rate [Hz]"); 
+    }
   g = hTrigAL2.GetGraph();
   g->SetMarkerColor(4);
   g->SetLineColor(4);
   legtrig->AddEntry(g,"After prescaler","l");
-  MHVsTime *clone1 = (MHVsTime*)hTrigBL2.DrawClone("nonew");
-  MHVsTime *clone2 = (MHVsTime*)hTrigAL2.DrawClone("nonewsame");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("L2 trigger rate [Hz]"); 
+  clone1 = (MHVsTime*)hTrigAL2.DrawClone("nonewsame");
   legtrig->DrawClone();
    c6->cd(2);
-   TH1 *h4 = hTrigZd.GetHistByName("TrigZd");
-   h4->SetXTitle("Zenith angle[\\circ]");
-   h4->SetYTitle("Trigger rate [Hz]");
-   h4->SetMarkerColor(4);
-   h4->SetTitle("L2 trigger rate after prescaler");
-   h4->SetStats(0);
+   hist = hTrigZd.GetHistByName("TrigZd");
+   hist->SetXTitle("Zenith angle[\\circ]");
+   hist->SetYTitle("Trigger rate [Hz]");
+   hist->SetMarkerColor(4);
+   hist->SetTitle("L2 trigger rate after prescaler");
+   hist->SetStats(0);
    mh3 = (MH3*)hTrigZd.DrawClone("nonew");
    c6->cd(3);
-  TGraph *g = hTrigStatus.GetGraph();
-  g->SetMarkerStyle(kFullDotSmall);
-  g->SetTitle("Trigger status");
-  MHVsTime *clone1 = (MHVsTime*)hTrigStatus.DrawClone("nonew");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  axey = hist->GetYaxis();
-  hist->SetMinimum(-0.5);
-  hist->SetMaximum(5.5);
-  axey->Set(6,-0.5,5.5);
-  axey->SetBinLabel(axey->FindFixBin(0),"Error");
-  axey->SetBinLabel(axey->FindFixBin(1),"Idle");
-  axey->SetBinLabel(axey->FindFixBin(2),"Loading");
-  axey->SetBinLabel(axey->FindFixBin(3),"Ready");
-  axey->SetBinLabel(axey->FindFixBin(4),"Active");
-  axey->SetBinLabel(axey->FindFixBin(5),"Stopped");
-  axey->SetLabelSize(0.07);
-  hist->SetXTitle("Time");
-  hist->SetYTitle("");
+   g = hTrigStatus.GetGraph();
+   g->SetMarkerStyle(kFullDotSmall);
+   g->SetTitle("Trigger status");
+   clone1 = (MHVsTime*)hTrigStatus.DrawClone("nonew");
+   if(clone1->GetGraph()->GetN())
+     {
+       hist = clone1->GetGraph()->GetHistogram();
+       axey = hist->GetYaxis();
+       hist->SetMinimum(-0.5);
+       hist->SetMaximum(5.5);
+       axey->Set(6,-0.5,5.5);
+       axey->SetBinLabel(axey->FindFixBin(0),"Error");
+       axey->SetBinLabel(axey->FindFixBin(1),"Idle");
+       axey->SetBinLabel(axey->FindFixBin(2),"Loading");
+       axey->SetBinLabel(axey->FindFixBin(3),"Ready");
+       axey->SetBinLabel(axey->FindFixBin(4),"Active");
+       axey->SetBinLabel(axey->FindFixBin(5),"Stopped");
+       axey->SetLabelSize(0.07);
+       hist->SetXTitle("Time");
+       hist->SetYTitle("");
+     }
   // ***************************** Trigger of macrocells **********************
-  TCanvas &c7 = d.AddTab("TRIG. MACROCELLs");
+  if ((d = evtloop.GetDisplay()))
+    TCanvas &c7 = d.AddTab("TRIG. MACROCELLs");
+  else
+    TCanvas *c7 = new TCanvas();
   c7->Divide(2,2);
   c7->cd(1);
   TLegend *legtrig = new TLegend(0.80,0.70,0.99,0.99);
-  TGraph *g = htrigmc1.GetGraph();
+  g = htrigmc1.GetGraph();
   g->SetMarkerStyle(kFullDotSmall);
   g->SetMarkerColor(2);
   legtrig->AddEntry(g,Form("Macrocell 1: %3.0f",g->GetHistogram()->GetMaximum()),"p");
   g->SetTitle("Trigger rate of mc 1 : (maximum)");
-  MHPixVsTime *pixclone1 = (MHPixVsTime*)htrigmc1.DrawClone("nonew");
-  TH1 *hist = pixclone1->GetGraph()->GetHistogram();
-  if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
-    hist->SetMaximum(g->GetHistogram()->GetMaximum());
-  hist->SetXTitle("Time");
-  hist->SetYTitle("Trigger [Hz]");
+  pixclone1 = (MHPixVsTime*)htrigmc1.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = pixclone1->GetGraph()->GetHistogram();
+      if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
+	hist->SetMaximum(g->GetHistogram()->GetMaximum());
+      hist->SetXTitle("Time");
+      hist->SetYTitle("Trigger [Hz]");
+    }
   legtrig->DrawClone();
   c7->cd(2);
   TLegend *legtrig = new TLegend(0.80,0.70,0.99,0.99);
-  TGraph *g = htrigmc2.GetGraph();
+  g = htrigmc2.GetGraph();
   g->SetMarkerStyle(kFullDotSmall);
   g->SetMarkerColor(2);
   legtrig->AddEntry(g,Form("Macrocell 2: %3.0f",g->GetHistogram()->GetMaximum()),"p");
   g->SetTitle("Trigger rate of mc 2-7 : (maximum)");
-  MHPixVsTime *pixclone1 = (MHPixVsTime*)htrigmc2.DrawClone("nonew");
-  TH1 *hist = pixclone1->GetGraph()->GetHistogram();
-  if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
-    hist->SetMaximum(g->GetHistogram()->GetMaximum());
-  hist->SetXTitle("Time");
-  hist->SetYTitle("Trigger [Hz]");
+  pixclone1 = (MHPixVsTime*)htrigmc2.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = pixclone1->GetGraph()->GetHistogram();
+      if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
+	hist->SetMaximum(g->GetHistogram()->GetMaximum());
+      hist->SetXTitle("Time");
+      hist->SetYTitle("Trigger [Hz]");
+    }
   g=htrigmc3.GetGraph();
   g->SetMarkerStyle(kFullDotSmall);
@@ -962,5 +1109,5 @@
   c7->cd(3);
   TLegend *legtrig = new TLegend(0.80,0.70,0.99,0.99);
-  TGraph *g = htrigmc8.GetGraph();
+  g = htrigmc8.GetGraph();
   g->SetMarkerStyle(kFullDotSmall);
   g->SetMarkerColor(2);
@@ -969,8 +1116,11 @@
   if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
     hist->SetMaximum(g->GetHistogram()->GetMaximum());
-  MHPixVsTime *pixclone1 = (MHPixVsTime*)htrigmc8.DrawClone("nonew");
-  TH1 *hist = pixclone1->GetGraph()->GetHistogram();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("Trigger [Hz]");
+  pixclone1 = (MHPixVsTime*)htrigmc8.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = pixclone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("Trigger [Hz]");
+    }
   g=htrigmc9.GetGraph();
   g->SetMarkerStyle(kFullDotSmall);
@@ -1014,10 +1164,13 @@
   legtrig->AddEntry(g,Form("Macrocell 14: %3.0f",g->GetHistogram()->GetMaximum()),"p");
   g->SetTitle("Trigger rate of mc 14-19 : (maximum)");
-  MHPixVsTime *pixclone1 = (MHPixVsTime*)htrigmc14.DrawClone("nonew");
-  TH1 *hist = pixclone1->GetGraph()->GetHistogram();
-  if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
-    hist->SetMaximum(g->GetHistogram()->GetMaximum());
-  hist->SetXTitle("Time");
-  hist->SetYTitle("Trigger [Hz]");
+  pixclone1 = (MHPixVsTime*)htrigmc14.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = pixclone1->GetGraph()->GetHistogram();
+      if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
+	hist->SetMaximum(g->GetHistogram()->GetMaximum());
+      hist->SetXTitle("Time");
+      hist->SetYTitle("Trigger [Hz]");
+    }
   g=htrigmc15.GetGraph();
   g->SetMarkerStyle(kFullDotSmall);
@@ -1060,63 +1213,85 @@
   // *************************** Weather station ******************************
   //
-  TCanvas &c8 = d.AddTab("WEATHER STATION");
+  if ((d = evtloop.GetDisplay()))
+    TCanvas &c8 = d.AddTab("WEATHER STATION");
+  else
+    TCanvas *c8 = new TCanvas();
   c8->Divide(2,2);
   // ----------------------- Relative humidity --------------------------------
   c8->cd(1);
-  TGraph *g = hCCHum.GetGraph();
+  g = hCCHum.GetGraph();
   g->SetMarkerStyle(kFullDotSmall);
   g->SetMarkerColor(4);
   g->SetLineColor(4);
   g->SetTitle("Relative humidity");
-  MHVsTime *clone1 = (MHVsTime*)hCCHum.DrawClone("nonew");
-  TH1 *hist = clone1->GetGraph()->GetHistogram();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("Humidity [%]"); 
+  clone1 = (MHVsTime*)hCCHum.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("Humidity [%]"); 
+    }
   // -------------------------- Temperature -----------------------------------
   c8->cd(2);
-  TGraph *g = hCCTemp.GetGraph();
+  g = hCCTemp.GetGraph();
   g->SetMarkerStyle(kFullDotSmall);
   g->SetMarkerColor(2);
   g->SetLineColor(2);
   g->SetTitle("Temperature");
-  MHVsTime *clone2 = (MHVsTime*)hCCTemp.DrawClone("nonew");
-  TH1 *hist = clone2->GetGraph()->GetHistogram();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("Temperature [\\circ C]"); 
+  clone1 = (MHVsTime*)hCCTemp.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("Temperature [\\circ C]"); 
+    }
   // --------------------------- Wind speed -----------------------------------
   c8->cd(3);
-  TGraph *g = hCCWS.GetGraph();
+  g = hCCWS.GetGraph();
   g->SetMarkerStyle(kFullDotSmall);
   g->SetMarkerColor(3);
   g->SetLineColor(3);
   g->SetTitle("Wind speed");
-  MHVsTime *clone3 = (MHVsTime*)hCCWS.DrawClone("nonew");
-  TH1 *hist = clone3->GetGraph()->GetHistogram();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("Wind speed [km/h]"); 
+  clone1 = (MHVsTime*)hCCWS.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("Wind speed [km/h]"); 
+    }
   // -------------------------- Solar radiation -------------------------------
   c8->cd(4);
-  TGraph *g = hCCSR.GetGraph();
+  g = hCCSR.GetGraph();
   g->SetMarkerStyle(kFullDotSmall);
   g->SetMarkerColor(9);
   g->SetLineColor(9);
   g->SetTitle("Solar radiation");
-  MHVsTime *clone4 = (MHVsTime*)hCCSR.DrawClone("nonew");
-  TH1 *hist = clone4->GetGraph()->GetHistogram();
-  hist->SetXTitle("Time");
-  hist->SetYTitle("Solar radiation [W/m^2]"); 
-
-  //
+  clone1 = (MHVsTime*)hCCSR.DrawClone("nonew");
+  if(clone1->GetGraph()->GetN())
+    {
+      hist = clone1->GetGraph()->GetHistogram();
+      hist->SetXTitle("Time");
+      hist->SetYTitle("Solar radiation [W/m^2]"); 
+    }
+
+  // Save data in a postscriptfile (filename.ps)
+  TString file;
+  if (filename.Last('.')>0)
+    file = filename(0, filename.Last('.')); 
+
   // Make sure the display hasn't been deleted by the user while the
   // eventloop was running.
-  //
   if ((d = evtloop.GetDisplay()))
-    {
-      TString file;
-      if (filename.Last('.')>0)
-	file = filename(0, filename.Last('.')); 
-
-      // Save data in a postscriptfile (status.ps)
-      d->SaveAsPS(-1,Form("%s.ps",file));
+      d->SaveAsPS(directory+file+".ps");
+  else
+    {
+      c1->Print(directory+file+".ps(");
+      c2->Print(directory+file+".ps");
+      c3->Print(directory+file+".ps");
+      c4->Print(directory+file+".ps");
+      c5->Print(directory+file+".ps");
+      c6->Print(directory+file+".ps");
+      c7->Print(directory+file+".ps");
+      c8->Print(directory+file+".ps)");
     }
 }
Index: /trunk/MagicSoft/Mars/mcamera/MCameraHV.h
===================================================================
--- /trunk/MagicSoft/Mars/mcamera/MCameraHV.h	(revision 3213)
+++ /trunk/MagicSoft/Mars/mcamera/MCameraHV.h	(revision 3214)
@@ -10,5 +10,5 @@
 #endif
 
-class MCameraHV : public MParContainer
+class MCameraHV : public MParContainer, public MCamEvent
 {
     friend class MReportCamera;
@@ -24,4 +24,7 @@
 
     TArrayS fHV;            // [V] Measured high Voltages for all PMTs
+
+    Float_t fMean;          // [V] Mean high voltage of the camera
+
 public:
     MCameraHV() : fHV(577)
@@ -38,4 +41,15 @@
     Byte_t GetCurrentB() const { return fCurrentB; }
 
+    Float_t GetMean() { fMean = fHV.GetSum()/fHV.GetSize(); return fMean; }
+
+    Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const
+      {
+	val = fHV[idx];
+	return val>0;
+      }
+    void DrawPixelContent(Int_t num) const
+      {
+      }
+
     ClassDef(MCameraHV, 1) // Container storing information about the Camera HV
 };
