Ignore:
Timestamp:
02/17/04 17:03:46 (21 years ago)
Author:
reyes
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/CCDataCheck.C

    r3093 r3214  
    1616!
    1717!
    18 !   Author(s): Raquel de los Reyes, 01/2004 <mailto:reyes@gae.ucm.es>
     18!   Author(s): Raquel de los Reyes, 02/2004 <mailto:reyes@gae.ucm.es>
    1919!
    2020!   Copyright: MAGIC Software Development, 2000-2004
     
    2424//
    2525// This macro made the check of the central control files (.rep files).
    26 // It displays 8 tabs:
     26// It displays 9 tabs:
    2727//   - Drive system
    28 //   - Camera status
    29 //   - HV power supplies
     28//   - HV of power supplies and HV settings
     29//   - DC of power supplies and several camera related status plots
    3030//   - LV power supplies
    3131//   - Cooling system
     
    3636////////////////////////////////////////////////////////////////////////////
    3737
    38 void CCDataCheck(const TString filename="CC_2003_11_30_20_29_20.root", const TString directory="../rootfiles/2003_12_01/")
     38void CCDataCheck(const TString filename="CC_2004_02_11.root", const TString directory="../")
    3939{
     40
    4041  //
    4142  // Check of the raw files
    4243  //
    43   MStatusDisplay *d = new MStatusDisplay;
    44   d->SetTitle(Form("- %s -",filename));
    45   d->SetLogStream(&gLog, kTRUE);            // Disables output to stdout
     44//    MStatusDisplay *d = new MStatusDisplay;
     45//    d->SetTitle(filename);
     46//    d->SetLogStream(&gLog, kTRUE);            // Disables output to stdout
    4647
    4748  //
     
    127128  MHVsTime hCoolStatus("MCameraCooling.fStatus");
    128129  hCoolStatus.SetName("CoolingStatus");
     130  MHVsTime hCamMean("MCameraHV.fMean");
     131  hCamMean.SetName("CameraMean");
    129132
    130133  // Reads the trees of the root file and the analysed branches
     
    148151
    149152  // Set of MHCamEvents classes
    150 //    MHCamEvent HVdisplay("CamHV","Camera HV supplies");
    151 //    HVdisplay.SetBit(MHCamera::kVariance);
    152 //    plist.AddToList(&HVdisplay);
     153  MHCamEvent HVdisplay("CamHV","Camera mean HV settings");
     154  HVdisplay.SetBit(MHCamera::kVariance);
     155  plist.AddToList(&HVdisplay);
    153156
    154157  // Set of MHPixVsTime classes (Trigger macroscells)
     
    294297  MFillH filltrigmc18("TrigMacrocell18","MReportTrigger");
    295298  MFillH filltrigmc19("TrigMacrocell19","MReportTrigger");
    296 //    MFillH fillHVD("CamHV","MCameraHV");
     299  MFillH fillcammean(&hCamMean,"MTimeCamera");
     300  MFillH fillHVD(&HVdisplay,"MCameraHV");
    297301
    298302  // Do not display the result given by the default draw function
     
    350354  filltrigmc18.SetBit(MFillH::kDoNotDisplay);
    351355  filltrigmc19.SetBit(MFillH::kDoNotDisplay);
    352 //    fillHVD.SetBit(MFillH::kDoNotDisplay);
     356  fillcammean.SetBit(MFillH::kDoNotDisplay);
     357  fillHVD.SetBit(MFillH::kDoNotDisplay);
     358
     359  // Skip the fill function is there is no tree entries
     360  fillZd.SetBit(MFillH::kCanSkip);
     361  fillAz.SetBit(MFillH::kCanSkip);
     362  fillError.SetBit(MFillH::kCanSkip);
     363  fillDState.SetBit(MFillH::kCanSkip);
     364  fillError2.SetBit(MFillH::kCanSkip);
     365  fillHVA.SetBit(MFillH::kCanSkip);
     366  fillHVB.SetBit(MFillH::kCanSkip);
     367  fillCA.SetBit(MFillH::kCanSkip);
     368  fillCB.SetBit(MFillH::kCanSkip);
     369  fillLVTemp.SetBit(MFillH::kCanSkip);
     370  fillLVHum.SetBit(MFillH::kCanSkip);
     371  fillLVStatus.SetBit(MFillH::kCanSkip);
     372  fillLVRPS.SetBit(MFillH::kCanSkip);
     373  fillTCenter.SetBit(MFillH::kCanSkip);
     374  fillTWall.SetBit(MFillH::kCanSkip);
     375  fillTWater.SetBit(MFillH::kCanSkip);
     376  fillTOptLink.SetBit(MFillH::kCanSkip);
     377  fillTempOptLink.SetBit(MFillH::kCanSkip);
     378  fillHWall.SetBit(MFillH::kCanSkip);
     379  fillHCenter.SetBit(MFillH::kCanSkip);
     380  fillCCHum.SetBit(MFillH::kCanSkip);
     381  fillCCTemp.SetBit(MFillH::kCanSkip);
     382  fillCCWS.SetBit(MFillH::kCanSkip);
     383  fillCCSR.SetBit(MFillH::kCanSkip);
     384  fillTrigBL2.SetBit(MFillH::kCanSkip);
     385  fillTrigAL2.SetBit(MFillH::kCanSkip);
     386  fillTrigStatus.SetBit(MFillH::kCanSkip);
     387  fillTrigZd.SetBit(MFillH::kCanSkip);
     388  fillCamStatus.SetBit(MFillH::kCanSkip);
     389  fillCamSentStatus.SetBit(MFillH::kCanSkip);
     390  fillCamStatusDC.SetBit(MFillH::kCanSkip);
     391  fillHVStatus.SetBit(MFillH::kCanSkip);
     392  fillLidsStatus.SetBit(MFillH::kCanSkip);
     393  fillCoolStatus.SetBit(MFillH::kCanSkip);
     394  filltrigmc1.SetBit(MFillH::kCanSkip);
     395  filltrigmc2.SetBit(MFillH::kCanSkip);
     396  filltrigmc3.SetBit(MFillH::kCanSkip);
     397  filltrigmc4.SetBit(MFillH::kCanSkip);
     398  filltrigmc5.SetBit(MFillH::kCanSkip);
     399  filltrigmc6.SetBit(MFillH::kCanSkip);
     400  filltrigmc7.SetBit(MFillH::kCanSkip);
     401  filltrigmc8.SetBit(MFillH::kCanSkip);
     402  filltrigmc9.SetBit(MFillH::kCanSkip);
     403  filltrigmc10.SetBit(MFillH::kCanSkip);
     404  filltrigmc11.SetBit(MFillH::kCanSkip);
     405  filltrigmc12.SetBit(MFillH::kCanSkip);
     406  filltrigmc13.SetBit(MFillH::kCanSkip);
     407  filltrigmc14.SetBit(MFillH::kCanSkip);
     408  filltrigmc15.SetBit(MFillH::kCanSkip);
     409  filltrigmc16.SetBit(MFillH::kCanSkip);
     410  filltrigmc17.SetBit(MFillH::kCanSkip);
     411  filltrigmc18.SetBit(MFillH::kCanSkip);
     412  filltrigmc19.SetBit(MFillH::kCanSkip);
     413  fillcammean.SetBit(MFillH::kCanSkip);
     414  fillHVD.SetBit(MFillH::kCanSkip);
    353415
    354416  // Add all the task to the task list
     
    407469  tlist.AddToList(&filltrigmc18, "Trigger");
    408470  tlist.AddToList(&filltrigmc19, "Trigger");
    409 //    tlist.AddToList(&fillHVD);
     471  tlist.AddToList(&fillcammean, "Camera");
     472  tlist.AddToList(&fillHVD);
    410473
    411474  //
     
    414477  MEvtLoop evtloop;
    415478  evtloop.SetParList(&plist);
    416   evtloop.SetDisplay(d);
     479//    evtloop.SetDisplay(d);
    417480   
    418481  //
     
    426489  gStyle->SetPadGridX(kTRUE);
    427490  gStyle->SetPadGridY(kTRUE);
    428 
     491  gStyle->SetCanvasColor(kWhite);
     492  MHVsTime *clone1;
     493  TGraph *g;
     494  TH1 *hist;
     495  TAxis *axey;
     496  TAxis *axex;
     497  MH3 *mh3;
     498  MHPixVsTime *pixclone1;
     499  MHCamera *Sum;
    429500  //
    430501  // Drive report (pointing.C from T. Bretz)
    431502  //
    432   TCanvas &c1 = d.AddTab("DRIVE SYSTEM");
     503  if ((d = evtloop.GetDisplay()))
     504    TCanvas &c1 = d.AddTab("DRIVE SYSTEM");
     505  else
     506    TCanvas *c1 = new TCanvas();
    433507  // ************* Plot the telescope tracking positions on the sky ***********
    434508  TGraph *g1 = hZd.GetGraph();
     
    474548    }
    475549  // ---------------------- Control deviation of the motors -------------------
    476   c1.cd();
     550  c1->cd();
    477551  p = new TPad("", "", 0.6, 0, 1, 0.29);
    478552  p->Draw();
     
    480554  gStyle->SetOptStat(1110);
    481555  gStyle->SetStatFormat(".2g");
    482   MH3 *mh3 = (MH3*)hError.DrawClone("nonew");
     556  mh3 = (MH3*)hError.DrawClone("nonew");
    483557  mh3->GetHist()->SetXTitle("\\Delta [arcmin]");
    484558  mh3->GetHist()->SetYTitle("");
     
    493567  ln.DrawLine(2.0*360*60/16384., 0, 2.0*360*60/16384., hError.GetHist()->GetMaximum());
    494568  // ---------------------- Plot the drive status vs time ---------------------
    495   c1.cd();
     569  c1->cd();
    496570  p = new TPad("", "", 0.6, 0.29, 1, 0.42);
    497571  p->Draw();
    498572  p->cd();
    499   hvt = (MHVsTime*)hDState.DrawClone("nonew");
     573  MHVsTime *hvt = (MHVsTime*)hDState.DrawClone("nonew");
    500574  hvt->GetGraph()->SetMarkerStyle(kFullDotSmall);
    501   TH1 *hist = hvt->GetGraph()->GetHistogram();
    502   TAxis *axey = hist->GetYaxis();
    503   TAxis *axex = hist->GetXaxis();
    504   hist->SetXTitle("Time");
    505   hist->SetYTitle("");
    506   hist->SetTitle("");
    507   hist->SetStats(0);
    508   hist->SetMinimum(-0.5);
    509   hist->SetMaximum(4.5);
    510   axey->Set(5, -0.5, 4.5);
    511   axey->SetBinLabel(axey->FindFixBin(0), "Error");
    512   axey->SetBinLabel(axey->FindFixBin(1), "Stopped");
    513   axey->SetBinLabel(axey->FindFixBin(3), "Moving");
    514   axey->SetBinLabel(axey->FindFixBin(4), "Tracking");
    515   axey->SetLabelSize(0.15);
    516   axex->SetLabelSize(0.08);
    517   axex->SetTitleSize(0.09);
    518   axex->SetTitleOffset(0.45);
     575  if (hvt->GetGraph()->GetN())
     576    {
     577      hist = hvt->GetGraph()->GetHistogram();
     578      TAxis *axey = hist->GetYaxis();
     579      TAxis *axex = hist->GetXaxis();
     580      hist->SetXTitle("Time");
     581      hist->SetYTitle("");
     582      hist->SetTitle("");
     583      hist->SetStats(0);
     584      hist->SetMinimum(-0.5);
     585      hist->SetMaximum(4.5);
     586      axey->Set(5, -0.5, 4.5);
     587      axey->SetBinLabel(axey->FindFixBin(0), "Error");
     588      axey->SetBinLabel(axey->FindFixBin(1), "Stopped");
     589      axey->SetBinLabel(axey->FindFixBin(3), "Moving");
     590      axey->SetBinLabel(axey->FindFixBin(4), "Tracking");
     591      axey->SetLabelSize(0.15);
     592      axex->SetLabelSize(0.08);
     593      axex->SetTitleSize(0.09);
     594      axex->SetTitleOffset(0.45);
     595    } 
    519596  // --------------- Control deviation of the motors vs zenith angle ----------
    520   c1.cd();
     597  c1->cd();
    521598  p = new TPad("", "", 0.6, 0.71, 1, 1);
    522599  p->Draw();
     
    531608  mh3->GetHist()->Draw("box");
    532609  // -------------------------- Zenith angle vs time --------------------------
    533   c1.cd();
     610  c1->cd();
    534611  p = new TPad("", "", 0.6, 0.42, 1, 0.71);
    535612  p->Draw();
     
    550627  // Camera report
    551628  //
    552   // *********************** Camera status ************************************
    553   TCanvas &c2 = d.AddTab("CAMERA STATUS");
    554   c2->Divide(2,3);
     629  // ************************* HV of power supplies ***************************
     630  if ((d = evtloop.GetDisplay()))
     631    TCanvas &c2 = d.AddTab("CAMERA HV");
     632  else
     633    TCanvas *c2 = new TCanvas();
     634  c2->Divide(2,2);
    555635  c2->cd(1);
    556   TGraph *g = hCamStatus.GetGraph();
    557   g->SetMarkerStyle(kFullDotSmall);
    558   g->SetTitle("Camera status");
    559   MHVsTime *clone1 = (MHVsTime*)hCamStatus.DrawClone("nonew");
    560   TH1 *hist = clone1->GetGraph()->GetHistogram();
    561   axey = hist->GetYaxis();
    562   hist->SetMinimum(-0.5);
    563   hist->SetMaximum(9.5);
    564   axey->Set(10,-0.5,9.5);
    565   axey->SetBinLabel(axey->FindFixBin(0),"EROR");
    566   axey->SetBinLabel(axey->FindFixBin(1),"ALARM");
    567   axey->SetBinLabel(axey->FindFixBin(2),"BLOCKED!");
    568   axey->SetBinLabel(axey->FindFixBin(3),"WARM!");
    569   axey->SetBinLabel(axey->FindFixBin(4),"HOT");
    570   axey->SetBinLabel(axey->FindFixBin(5),"HVRAMPING");
    571   axey->SetBinLabel(axey->FindFixBin(6),"OK");
    572   axey->SetBinLabel(axey->FindFixBin(7),"INIT");
    573   axey->SetBinLabel(axey->FindFixBin(8),"SHUTD");
    574   axey->SetBinLabel(axey->FindFixBin(9),"N/A");
    575   axey->SetLabelSize(0.07);
    576   hist->SetXTitle("Time");
    577   hist->SetYTitle("");
    578   c2->cd(2);
    579   TGraph *g = hCamStatusDC.GetGraph();
    580   g->SetMarkerStyle(kFullDotSmall);
    581   g->SetTitle("Camera DC status");
    582   MHVsTime *clone1 = (MHVsTime*)hCamStatusDC.DrawClone("nonew");
    583   TH1 *hist = clone1->GetGraph()->GetHistogram();
    584   axey = hist->GetYaxis();
    585   hist->SetMinimum(-0.5);
    586   hist->SetMaximum(9.5);
    587   axey->Set(10,-0.5,9.5);
    588   axey->SetBinLabel(axey->FindFixBin(0),"Error");
    589   axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
    590   axey->SetBinLabel(axey->FindFixBin(3),"Hot");
    591   axey->SetBinLabel(axey->FindFixBin(5),"Ok");
    592   axey->SetBinLabel(axey->FindFixBin(6),"Warm");
    593   axey->SetBinLabel(axey->FindFixBin(9),"n/a");
    594   axey->SetLabelSize(0.07);
    595   hist->SetXTitle("Time");
    596   hist->SetYTitle("");
    597   c2->cd(3);
    598   TGraph *g = hHVStatus.GetGraph();
    599   g->SetMarkerStyle(kFullDotSmall);
    600   g->SetTitle("Camera HV status");
    601   MHVsTime *clone1 = (MHVsTime*)hHVStatus.DrawClone("nonew");
    602   TH1 *hist = clone1->GetGraph()->GetHistogram();
    603   axey = hist->GetYaxis();
    604   hist->SetMinimum(-0.5);
    605   hist->SetMaximum(9.5);
    606   axey->Set(10,-0.5,9.5);
    607   axey->SetBinLabel(axey->FindFixBin(0),"Error");
    608   axey->SetBinLabel(axey->FindFixBin(1),"Mismatch");
    609   axey->SetBinLabel(axey->FindFixBin(2),"Trip");
    610   axey->SetBinLabel(axey->FindFixBin(3),"Ramping");
    611   axey->SetBinLabel(axey->FindFixBin(4),"Off");
    612   axey->SetBinLabel(axey->FindFixBin(5),"Nominal");
    613   axey->SetBinLabel(axey->FindFixBin(6),"LimCurrentWarning");
    614   axey->SetBinLabel(axey->FindFixBin(9),"n/a");
    615   axey->SetLabelSize(0.07);
    616   hist->SetXTitle("Time");
    617   hist->SetYTitle("");
    618   c2->cd(4);
    619   TGraph *g = hLidsStatus.GetGraph();
    620   g->SetMarkerStyle(kFullDotSmall);
    621   g->SetTitle("Camera Lids status");
    622   MHVsTime *clone1 = (MHVsTime*)hLidsStatus.DrawClone("nonew");
    623   TH1 *hist = clone1->GetGraph()->GetHistogram();
    624   axey = hist->GetYaxis();
    625   hist->SetMinimum(-0.5);
    626   hist->SetMaximum(9.5);
    627   axey->Set(10,-0.5,9.5);
    628   axey->SetBinLabel(axey->FindFixBin(0),"Error");
    629   axey->SetBinLabel(axey->FindFixBin(1),"SafetyLimit");
    630   axey->SetBinLabel(axey->FindFixBin(4),"Closed");
    631   axey->SetBinLabel(axey->FindFixBin(5),"Opened");
    632   axey->SetBinLabel(axey->FindFixBin(6),"Moving");
    633   axey->SetBinLabel(axey->FindFixBin(7),"Stopped");
    634   axey->SetBinLabel(axey->FindFixBin(9),"n/a");
    635   axey->SetLabelSize(0.07);
    636   hist->SetXTitle("Time");
    637   hist->SetYTitle("");
    638   c2->cd(5);
    639   TGraph *g = hCoolStatus.GetGraph();
    640   g->SetMarkerStyle(kFullDotSmall);
    641   g->SetTitle("Camera cooling status");
    642   MHVsTime *clone1 = (MHVsTime*)hCoolStatus.DrawClone("nonew");
    643   TH1 *hist = clone1->GetGraph()->GetHistogram();
    644   axey = hist->GetYaxis();
    645   hist->SetMinimum(-0.5);
    646   hist->SetMaximum(9.5);
    647   axey->Set(10,-0.5,9.5);
    648   axey->SetBinLabel(axey->FindFixBin(0),"Error");
    649   axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
    650   axey->SetBinLabel(axey->FindFixBin(4),"Off");
    651   axey->SetBinLabel(axey->FindFixBin(5),"Ok");
    652   axey->SetBinLabel(axey->FindFixBin(6),"Temp.Warning");
    653   axey->SetBinLabel(axey->FindFixBin(7),"Cond.Warning");
    654   axey->SetBinLabel(axey->FindFixBin(9),"n/a");
    655   axey->SetLabelSize(0.07);
    656   hist->SetXTitle("Time");
    657   hist->SetYTitle("");
    658   c2->cd(6);
    659   TGraph *g = hCamSentStatus.GetGraph();
    660   g->SetMarkerStyle(kFullDotSmall);
    661   g->SetTitle("Camera sentinel status");
    662   MHVsTime *clone1 = (MHVsTime*)hCamSentStatus.DrawClone("nonew");
    663   TH1 *hist = clone1->GetGraph()->GetHistogram();
    664   axey = hist->GetYaxis();
    665   hist->SetMinimum(-0.5);
    666   hist->SetMaximum(9.5);
    667   axey->Set(10,-0.5,9.5);
    668   axey->SetBinLabel(axey->FindFixBin(0),"ERROR");
    669   axey->SetBinLabel(axey->FindFixBin(1),"ALL IS OK");
    670   axey->SetBinLabel(axey->FindFixBin(2),"SUN IS PRESENT");
    671   axey->SetBinLabel(axey->FindFixBin(3),"BAD ATM. COND.");
    672   axey->SetBinLabel(axey->FindFixBin(4),"BAD T/RH CAMERA");
    673   axey->SetBinLabel(axey->FindFixBin(5),"HOT CAMERA");
    674   axey->SetBinLabel(axey->FindFixBin(6),"FADC FANS PROB.");
    675   axey->SetBinLabel(axey->FindFixBin(7),"CECO TIMEOUT");
    676   axey->SetBinLabel(axey->FindFixBin(9),"N/A");
    677   axey->SetLabelSize(0.07);
    678   hist->SetXTitle("Time");
    679   hist->SetYTitle("");
    680 
    681   // ******************** HV and currents of power supplies *******************
    682   TCanvas &c3 = d.AddTab("CAMERA HV");
    683   c3->Divide(1,2);
    684   c3->cd(1);
    685   // ---------------------------- High voltages -------------------------------
     636  // ---------------------------- Power supplies ------------------------------
    686637  TLegend *legHV = new TLegend(0.85,0.75,0.99,0.99);
    687   TGraph *g = hHVA.GetGraph();
     638  g = hHVA.GetGraph();
    688639  g->SetMarkerColor(2);
    689640  g->SetLineColor(2);
    690641  g->SetTitle("Voltages of power supplies");
    691   legHV->AddEntry(g,"Power supply A (hvps1)","l");
     642  legHV->AddEntry(g,"PS A (hvps1)","l");
     643  clone1 = (MHVsTime*)hHVA.DrawClone("nonew");
     644  if(clone1->GetGraph()->GetN())
     645    {
     646      hist = clone1->GetGraph()->GetHistogram();
     647      hist->SetXTitle("Time");
     648      hist->SetYTitle("High voltage [V]");
     649      hist->SetMinimum(0);
     650    }
    692651  g = hHVB.GetGraph();
    693652  g->SetMarkerColor(3);
    694653  g->SetLineColor(3);
    695   legHV->AddEntry(g,"Power supply B (hvps2)","l");
    696   MHVsTime *clone1 = (MHVsTime*)hHVA.DrawClone("nonew");
    697   MHVsTime *clone2 = (MHVsTime*)hHVB.DrawClone("nonewsame");
    698   TH1 *hist = clone1->GetGraph()->GetHistogram();
    699   hist->SetXTitle("Time");
    700   hist->SetYTitle("High voltage [V]");
    701   hist->SetMinimum(0);
     654  legHV->AddEntry(g,"PS B (hvps2)","l");
     655  clone1 = (MHVsTime*)hHVB.DrawClone("nonewsame");
    702656  legHV->DrawClone();
    703   c3->cd(2);
    704   // ----------------------------- Currents ----------------------------------
     657  // ---------------------------- HV settings ---------------------------------
     658  c2->cd(2);
     659  g = hCamMean.GetGraph();
     660  g->SetMarkerColor(2);
     661  g->SetLineColor(2);
     662  g->SetTitle("Camera mean HV settings");
     663  clone1 = (MHVsTime*)hCamMean.DrawClone("nonew");
     664  if(clone1->GetGraph()->GetN())
     665    {
     666      hist = clone1->GetGraph()->GetHistogram();
     667      hist->SetXTitle("Time");
     668      hist->SetYTitle("HV [V]");
     669      hist->SetMinimum(0);
     670    }
     671  c2->cd(3);
     672  Sum = (MHCamera*)HVdisplay.GetHistByName("sum");
     673  TVirtualPad *c = gPad;
     674  c->cd(1);
     675  gPad->SetBorderMode(0);
     676  Sum->SetYTitle("Mean");
     677  Sum->DrawClone("pixelindex");
     678  c2->cd(4);
     679  gPad->SetBorderMode(0);
     680  Sum->SetYTitle("Mean HV settings");
     681  Sum->DrawClone("EPhist");
     682
     683  // ******************** Currents of power supplies *******************
     684  if ((d = evtloop.GetDisplay()))
     685    TCanvas &c3 = d.AddTab("CAMERA DC");
     686  else
     687    TCanvas *c3 = new TCanvas();
     688 // ----------------------------- Power supplies ------------------------------
     689  c3->Divide(1,2);
     690  c3->cd(1);
    705691  TLegend *legC = new TLegend(0.85,0.75,0.99,0.99);
    706   TGraph *g = hCA.GetGraph();
     692  g = hCA.GetGraph();
    707693  g->SetMarkerColor(2);
    708694  g->SetLineColor(2);
    709695  g->SetTitle("Currents of power supplies");
    710696  legC->AddEntry(g,"Power supply A (curr1)","l");
     697  clone1 = (MHVsTime*)hCA.DrawClone("nonew");
     698  if(clone1->GetGraph()->GetN())
     699    {
     700      hist = clone1->GetGraph()->GetHistogram();
     701      hist->SetXTitle("Time");
     702      hist->SetYTitle("Current [mA]");
     703      hist->SetMinimum(0);
     704    }
    711705  g = hCB.GetGraph();
    712706  g->SetMarkerColor(3);
    713707  g->SetLineColor(3);
    714708  legC->AddEntry(g,"Power supply B (curr2)","l");
    715   MHVsTime *clone1 = (MHVsTime*)hCA.DrawClone("nonew");
    716   MHVsTime *clone2 = (MHVsTime*)hCB.DrawClone("nonewsame");
    717   TH1 *hist = clone1->GetGraph()->GetHistogram();
    718   hist->SetXTitle("Time");
    719   hist->SetYTitle("Current [mA]");
    720   hist->SetMinimum(0);
     709  clone1 = (MHVsTime*)hCB.DrawClone("nonewsame");
    721710  legC->DrawClone();
    722 
     711  c3->cd(2);
     712  gPad->SetBorderMode(0);
     713  gPad->Divide(2,2);
     714  TVirtualPad *c = gPad;
     715  c->cd(1);
     716  g = hCamStatus.GetGraph();
     717  g->SetMarkerStyle(kFullDotSmall);
     718  g->SetTitle("Camera status");
     719  clone1 = (MHVsTime*)hCamStatus.DrawClone("nonew");
     720  if(clone1->GetGraph()->GetN())
     721    {
     722      hist = clone1->GetGraph()->GetHistogram();
     723      axey = hist->GetYaxis();
     724      hist->SetMinimum(-0.5);
     725      hist->SetMaximum(9.5);
     726      axey->Set(10,-0.5,9.5);
     727      axey->SetBinLabel(axey->FindFixBin(0),"EROR");
     728      axey->SetBinLabel(axey->FindFixBin(1),"ALARM");
     729      axey->SetBinLabel(axey->FindFixBin(2),"BLOCKED!");
     730      axey->SetBinLabel(axey->FindFixBin(3),"WARM!");
     731      axey->SetBinLabel(axey->FindFixBin(4),"HOT");
     732      axey->SetBinLabel(axey->FindFixBin(5),"HVRAMPING");
     733      axey->SetBinLabel(axey->FindFixBin(6),"OK");
     734      axey->SetBinLabel(axey->FindFixBin(7),"INIT");
     735      axey->SetBinLabel(axey->FindFixBin(8),"SHUTD");
     736      axey->SetBinLabel(axey->FindFixBin(9),"N/A");
     737      axey->SetLabelSize(0.07);
     738      hist->SetXTitle("Time");
     739      hist->SetYTitle("");
     740    }
     741  c->cd(2);
     742  g = hCamStatusDC.GetGraph();
     743  g->SetMarkerStyle(kFullDotSmall);
     744  g->SetTitle("Camera DC status");
     745  clone1 = (MHVsTime*)hCamStatusDC.DrawClone("nonew");
     746  if(clone1->GetGraph()->GetN())
     747    {
     748      hist = clone1->GetGraph()->GetHistogram();
     749      axey = hist->GetYaxis();
     750      hist->SetMinimum(-0.5);
     751      hist->SetMaximum(9.5);
     752      axey->Set(10,-0.5,9.5);
     753      axey->SetBinLabel(axey->FindFixBin(0),"Error");
     754      axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
     755      axey->SetBinLabel(axey->FindFixBin(3),"Hot");
     756      axey->SetBinLabel(axey->FindFixBin(5),"Ok");
     757      axey->SetBinLabel(axey->FindFixBin(6),"Warm");
     758      axey->SetBinLabel(axey->FindFixBin(9),"n/a");
     759      axey->SetLabelSize(0.07);
     760      hist->SetXTitle("Time");
     761      hist->SetYTitle("");
     762    }
     763  c->cd(3);
     764  g = hHVStatus.GetGraph();
     765  g->SetMarkerStyle(kFullDotSmall);
     766  g->SetTitle("Camera HV status");
     767  clone1 = (MHVsTime*)hHVStatus.DrawClone("nonew");
     768  if(clone1->GetGraph()->GetN())
     769    {
     770      hist = clone1->GetGraph()->GetHistogram();
     771      axey = hist->GetYaxis();
     772      hist->SetMinimum(-0.5);
     773      hist->SetMaximum(9.5);
     774      axey->Set(10,-0.5,9.5);
     775      axey->SetBinLabel(axey->FindFixBin(0),"Error");
     776      axey->SetBinLabel(axey->FindFixBin(1),"Mismatch");
     777      axey->SetBinLabel(axey->FindFixBin(2),"Trip");
     778      axey->SetBinLabel(axey->FindFixBin(3),"Ramping");
     779      axey->SetBinLabel(axey->FindFixBin(4),"Off");
     780      axey->SetBinLabel(axey->FindFixBin(5),"Nominal");
     781      axey->SetBinLabel(axey->FindFixBin(6),"LimCurrentWarning");
     782      axey->SetBinLabel(axey->FindFixBin(9),"n/a");
     783      axey->SetLabelSize(0.07);
     784      hist->SetXTitle("Time");
     785      hist->SetYTitle("");
     786    }
     787  c->cd(4);
     788  g = hLidsStatus.GetGraph();
     789  g->SetMarkerStyle(kFullDotSmall);
     790  g->SetTitle("Camera Lids status");
     791  clone1 = (MHVsTime*)hLidsStatus.DrawClone("nonew");
     792  if(clone1->GetGraph()->GetN())
     793    {
     794      hist = clone1->GetGraph()->GetHistogram();
     795      axey = hist->GetYaxis();
     796      hist->SetMinimum(-0.5);
     797      hist->SetMaximum(9.5);
     798      axey->Set(10,-0.5,9.5);
     799      axey->SetBinLabel(axey->FindFixBin(0),"Error");
     800      axey->SetBinLabel(axey->FindFixBin(1),"SafetyLimit");
     801      axey->SetBinLabel(axey->FindFixBin(4),"Closed");
     802      axey->SetBinLabel(axey->FindFixBin(5),"Opened");
     803      axey->SetBinLabel(axey->FindFixBin(6),"Moving");
     804      axey->SetBinLabel(axey->FindFixBin(7),"Stopped");
     805      axey->SetBinLabel(axey->FindFixBin(9),"n/a");
     806      axey->SetLabelSize(0.07);
     807      hist->SetXTitle("Time");
     808      hist->SetYTitle("");
     809    }
    723810  // ***************************** LV power supplies **************************
    724   TCanvas &c4 = d.AddTab("CAMERA LV");
     811  if ((d = evtloop.GetDisplay()))
     812    TCanvas &c4 = d.AddTab("CAMERA LV");
     813  else
     814    TCanvas *c4 = new TCanvas();
    725815  c4->Divide(2,2);
    726816  c4->cd(1);
    727   TGraph *g = hLVTemp.GetGraph();
     817  g = hLVTemp.GetGraph();
    728818  g->SetMarkerColor(2);
    729819  g->SetLineColor(2);
    730820  g->SetTitle("LV temperature");
    731   MHVsTime *clone1 = (MHVsTime*)hLVTemp.DrawClone("nonew");
    732   TH1 *hist = clone1->GetGraph()->GetHistogram();
    733   hist->SetXTitle("Time");
    734   hist->SetYTitle("Temperature [\\circ]");
     821  clone1 = (MHVsTime*)hLVTemp.DrawClone("nonew");
     822  if(clone1->GetGraph()->GetN())
     823    {
     824      hist = clone1->GetGraph()->GetHistogram();
     825      hist->SetXTitle("Time");
     826      hist->SetYTitle("Temperature [\\circ]");
     827    }
    735828  c4->cd(2);
    736   TGraph *g = hLVHum.GetGraph();
     829  g = hLVHum.GetGraph();
    737830  g->SetMarkerColor(4);
    738831  g->SetLineColor(4);
    739832  g->SetTitle("LV humidity");
    740   MHVsTime *clone1 = (MHVsTime*)hLVHum.DrawClone("nonew");
    741   TH1 *hist = clone1->GetGraph()->GetHistogram();
    742   hist->SetXTitle("Time");
    743   hist->SetYTitle("Humidity [%]");
     833  clone1 = (MHVsTime*)hLVHum.DrawClone("nonew");
     834  if(clone1->GetGraph()->GetN())
     835    {
     836      hist = clone1->GetGraph()->GetHistogram();
     837      hist->SetXTitle("Time");
     838      hist->SetYTitle("Humidity [%]");
     839    }
    744840  c4->cd(3);
    745   TGraph *g = hLVStatus.GetGraph();
     841  g = hLVStatus.GetGraph();
    746842  g->SetMarkerStyle(kFullDotSmall);
    747843  g->SetTitle("LV status");
    748   MHVsTime *clone1 = (MHVsTime*)hLVStatus.DrawClone("nonew");
    749   TH1 *hist = clone1->GetGraph()->GetHistogram();
    750   axey = hist->GetYaxis();
    751   hist->SetMinimum(-0.5);
    752   hist->SetMaximum(9.5);
    753   axey->Set(10,-0.5,9.5);
    754   axey->SetBinLabel(axey->FindFixBin(0),"Error");
    755   axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
    756   axey->SetBinLabel(axey->FindFixBin(2),"Trip");
    757   axey->SetBinLabel(axey->FindFixBin(4),"Off");
    758   axey->SetBinLabel(axey->FindFixBin(5),"On");
    759   axey->SetBinLabel(axey->FindFixBin(9),"n/a");
    760   hist->SetXTitle("Time");
    761   hist->SetYTitle("");
     844  clone1 = (MHVsTime*)hLVStatus.DrawClone("nonew");
     845  if(clone1->GetGraph()->GetN())
     846    {
     847      hist = clone1->GetGraph()->GetHistogram();
     848      axey = hist->GetYaxis();
     849      hist->SetMinimum(-0.5);
     850      hist->SetMaximum(9.5);
     851      axey->Set(10,-0.5,9.5);
     852      axey->SetBinLabel(axey->FindFixBin(0),"Error");
     853      axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
     854      axey->SetBinLabel(axey->FindFixBin(2),"Trip");
     855      axey->SetBinLabel(axey->FindFixBin(4),"Off");
     856      axey->SetBinLabel(axey->FindFixBin(5),"On");
     857      axey->SetBinLabel(axey->FindFixBin(9),"n/a");
     858      hist->SetXTitle("Time");
     859      hist->SetYTitle("");
     860    }
    762861  c4->cd(4);
    763   TGraph *g = hLVRPS.GetGraph();
     862  g = hLVRPS.GetGraph();
    764863  g->SetMarkerStyle(kFullDotSmall);
    765864  g->SetTitle("LV request power supply");
    766   MHVsTime *clone1 = (MHVsTime*)hLVRPS.DrawClone("nonew");
    767   TH1 *hist = clone1->GetGraph()->GetHistogram();
    768   hist->SetXTitle("Time");
    769   hist->SetYTitle("");
    770   axey = hist->GetYaxis();
    771   hist->SetMinimum(-0.5);
    772   hist->SetMaximum(1.5);
    773   axey->Set(2, -0.5, 1.5);
    774   axey->SetBinLabel(axey->FindFixBin(0), "OFF");
    775   axey->SetBinLabel(axey->FindFixBin(1), "ON");
     865  clone1 = (MHVsTime*)hLVRPS.DrawClone("nonew");
     866  if(clone1->GetGraph()->GetN())
     867    {
     868      hist = clone1->GetGraph()->GetHistogram();
     869      hist->SetXTitle("Time");
     870      hist->SetYTitle("");
     871      axey = hist->GetYaxis();
     872      hist->SetMinimum(-0.5);
     873      hist->SetMaximum(1.5);
     874      axey->Set(2, -0.5, 1.5);
     875      axey->SetBinLabel(axey->FindFixBin(0), "OFF");
     876      axey->SetBinLabel(axey->FindFixBin(1), "ON");
     877    }
    776878  // ****************************** Cooling ***********************************
    777   TCanvas &c5 = d.AddTab("COOLING SYSTEM");
     879  if ((d = evtloop.GetDisplay()))
     880    TCanvas &c5 = d.AddTab("COOLING SYSTEM");
     881  else
     882    TCanvas *c5 = new TCanvas();
    778883  gStyle->SetPadGridX(kTRUE);
    779884  gStyle->SetPadGridY(kTRUE);
    780   c5->Divide(1,2);
     885  c5->Divide(2,2);
    781886  c5->cd(1);
    782887  // -------------------------- Camera temperatures ---------------------------
    783888  TLegend *legtemp = new TLegend(0.85,0.75,0.99,0.99);
    784   TGraph *g = hTCenter.GetGraph();
     889  g = hTCenter.GetGraph();
    785890  g->SetMarkerColor(8);
    786891  g->SetLineColor(8);
    787892  g->SetTitle("Camera temperature");
    788893  legtemp->AddEntry(g,"T at camera center","l");
     894  clone1 = (MHVsTime*)hTCenter.DrawClone("nonew");
     895  if(clone1->GetGraph()->GetN())
     896    {
     897      hist = clone1->GetGraph()->GetHistogram();
     898      hist->SetXTitle("Time");
     899      hist->SetYTitle("Temperature [\\circ C]");
     900      hist->SetMinimum(0);
     901    }
    789902  g = hTWall.GetGraph();
    790903  g->SetMarkerColor(12);
    791904  g->SetLineColor(12);
    792905  legtemp->AddEntry(g,"T at camera wall","l");
     906  clone1 = (MHVsTime*)hTWall.DrawClone("nonewsame");
    793907  g = hTWater.GetGraph();
    794908  g->SetMarkerColor(4);
    795909  g->SetLineColor(4);
    796910  legtemp->AddEntry(g,"T at water deposit","l");
     911  clone1 = (MHVsTime*)hTWater.DrawClone("nonewsame");
    797912  g = hTOptLink.GetGraph();
    798913  g->SetMarkerColor(2);
    799914  g->SetLineColor(2);
    800915  legtemp->AddEntry(g,"T at optical links","l");
    801   MHVsTime *clone1 = (MHVsTime*)hTCenter.DrawClone("nonew");
    802   MHVsTime *clone2 = (MHVsTime*)hTWall.DrawClone("nonewsame");
    803   MHVsTime *clone3 = (MHVsTime*)hTWater.DrawClone("nonewsame");
    804   MHVsTime *clone4 = (MHVsTime*)hTOptLink.DrawClone("nonewsame");
    805   TH1 *hist = clone1->GetGraph()->GetHistogram();
    806   hist->SetXTitle("Time");
    807   hist->SetYTitle("Temperature [\\circ C]");
    808   hist->SetMinimum(0);
     916  clone1 = (MHVsTime*)hTOptLink.DrawClone("nonewsame");
    809917  legtemp->DrawClone();
     918  c5->cd(2);
     919  g = hCoolStatus.GetGraph();
     920  g->SetMarkerStyle(kFullDotSmall);
     921  g->SetTitle("Camera cooling status");
     922  clone1 = (MHVsTime*)hCoolStatus.DrawClone("nonew");
     923  if(clone1->GetGraph()->GetN())
     924    {
     925      hist = clone1->GetGraph()->GetHistogram();
     926      axey = hist->GetYaxis();
     927      hist->SetMinimum(-0.5);
     928      hist->SetMaximum(9.5);
     929      axey->Set(10,-0.5,9.5);
     930      axey->SetBinLabel(axey->FindFixBin(0),"Error");
     931      axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
     932      axey->SetBinLabel(axey->FindFixBin(4),"Off");
     933      axey->SetBinLabel(axey->FindFixBin(5),"Ok");
     934      axey->SetBinLabel(axey->FindFixBin(6),"Temp.Warning");
     935      axey->SetBinLabel(axey->FindFixBin(7),"Cond.Warning");
     936      axey->SetBinLabel(axey->FindFixBin(9),"n/a");
     937      axey->SetLabelSize(0.05);
     938      hist->SetXTitle("Time");
     939      hist->SetYTitle("");
     940    }
    810941  // ------------------------- Camera relative humidity -----------------------
    811   c5->cd(2);
    812   gPad->SetBorderMode(0);
    813   gPad->Divide(2, 1);
    814   TVirtualPad *c = gPad;
    815   c->cd(1);
     942  c5->cd(3);
    816943  TLegend *leghum = new TLegend(0.75,0.75,0.99,0.99);
    817   TGraph *g = hHCenter.GetGraph();
     944  g = hHCenter.GetGraph();
    818945  g->SetMarkerColor(8);
    819946  g->SetLineColor(8);
    820947  g->SetTitle("Camera relative humidity");
    821948  leghum->AddEntry(g,"RH at camera center","l");
     949  clone1 = (MHVsTime*)hHCenter.DrawClone("nonew");
     950  if(clone1->GetGraph()->GetN())
     951    {
     952      hist = clone1->GetGraph()->GetHistogram();
     953      hist->SetXTitle("Time");
     954      hist->SetYTitle("Relative humidity [%]");
     955      hist->SetMaximum(50);
     956      hist->SetMinimum(0);
     957    }
    822958  g = hHWall.GetGraph();
    823959  g->SetMarkerColor(12);
    824960  g->SetLineColor(12);
    825961  leghum->AddEntry(g,"RH at camera wall","l");
    826   clone1 = (MHVsTime*)hHCenter.DrawClone("nonew");
    827   clone2 = (MHVsTime*)hHWall.DrawClone("nonewsame");
    828   hist = clone1->GetGraph()->GetHistogram();
    829   hist->SetXTitle("Time");
    830   hist->SetYTitle("Relative humidity [%]");
    831   hist->SetMaximum(50);
    832   hist->SetMinimum(0);
     962  clone1 = (MHVsTime*)hHWall.DrawClone("nonewsame");
    833963  leghum->DrawClone();
    834964  // ---------------------- Temperature distribution --------------------------
    835   c->cd(2);
    836   TH1F *h3 = hTempOptLink.GetHistByName("TOptLink");
    837   h3->SetXTitle("Temperature [\\circ C]");
    838   h3->SetYTitle("");
    839   h3->SetLineColor(2);
    840   h3->SetTitle("Distribution of opt. links temperature");
    841   h3->SetStats(0);
    842   MH3 *mh3 = (MH3*)hTempOptLink.DrawClone("nonew");
    843 
     965  c5->cd(4);
     966  hist = hTempOptLink.GetHistByName("TOptLink");
     967  hist->SetXTitle("Temperature [\\circ C]");
     968  hist->SetYTitle("");
     969  hist->SetLineColor(2);
     970  hist->SetTitle("Distribution of opt. links temperature");
     971  hist->SetStats(0);
     972  mh3 = (MH3*)hTempOptLink.DrawClone("nonew");
    844973  //
    845974  // **************************** Trigger report ******************************
    846975  //
    847   TCanvas &c6 = d.AddTab("TRIGGER SYSTEM");
     976  if ((d = evtloop.GetDisplay()))
     977    TCanvas &c6 = d.AddTab("TRIGGER SYSTEM");
     978  else
     979    TCanvas *c6 = new TCanvas();
    848980  c6->Divide(1,3);
    849981  c6->cd(1);
     
    851983  gStyle->SetPadGridY(kTRUE);
    852984  TLegend *legtrig = new TLegend(0.85,0.85,0.99,0.99);
    853   TGraph *g = hTrigBL2.GetGraph();
     985  g = hTrigBL2.GetGraph();
    854986  g->SetMarkerStyle(kFullDotSmall);
    855987  g->SetMarkerColor(2);
     
    857989  g->SetTitle("L2 trigger rate");
    858990  legtrig->AddEntry(g,"Before prescaler","l");
     991  clone1 = (MHVsTime*)hTrigBL2.DrawClone("nonew");
     992  if(clone1->GetGraph()->GetN())
     993    {
     994      hist = clone1->GetGraph()->GetHistogram();
     995      hist->SetXTitle("Time");
     996      hist->SetYTitle("L2 trigger rate [Hz]");
     997    }
    859998  g = hTrigAL2.GetGraph();
    860999  g->SetMarkerColor(4);
    8611000  g->SetLineColor(4);
    8621001  legtrig->AddEntry(g,"After prescaler","l");
    863   MHVsTime *clone1 = (MHVsTime*)hTrigBL2.DrawClone("nonew");
    864   MHVsTime *clone2 = (MHVsTime*)hTrigAL2.DrawClone("nonewsame");
    865   TH1 *hist = clone1->GetGraph()->GetHistogram();
    866   hist->SetXTitle("Time");
    867   hist->SetYTitle("L2 trigger rate [Hz]");
     1002  clone1 = (MHVsTime*)hTrigAL2.DrawClone("nonewsame");
    8681003  legtrig->DrawClone();
    8691004   c6->cd(2);
    870    TH1 *h4 = hTrigZd.GetHistByName("TrigZd");
    871    h4->SetXTitle("Zenith angle[\\circ]");
    872    h4->SetYTitle("Trigger rate [Hz]");
    873    h4->SetMarkerColor(4);
    874    h4->SetTitle("L2 trigger rate after prescaler");
    875    h4->SetStats(0);
     1005   hist = hTrigZd.GetHistByName("TrigZd");
     1006   hist->SetXTitle("Zenith angle[\\circ]");
     1007   hist->SetYTitle("Trigger rate [Hz]");
     1008   hist->SetMarkerColor(4);
     1009   hist->SetTitle("L2 trigger rate after prescaler");
     1010   hist->SetStats(0);
    8761011   mh3 = (MH3*)hTrigZd.DrawClone("nonew");
    8771012   c6->cd(3);
    878   TGraph *g = hTrigStatus.GetGraph();
    879   g->SetMarkerStyle(kFullDotSmall);
    880   g->SetTitle("Trigger status");
    881   MHVsTime *clone1 = (MHVsTime*)hTrigStatus.DrawClone("nonew");
    882   TH1 *hist = clone1->GetGraph()->GetHistogram();
    883   axey = hist->GetYaxis();
    884   hist->SetMinimum(-0.5);
    885   hist->SetMaximum(5.5);
    886   axey->Set(6,-0.5,5.5);
    887   axey->SetBinLabel(axey->FindFixBin(0),"Error");
    888   axey->SetBinLabel(axey->FindFixBin(1),"Idle");
    889   axey->SetBinLabel(axey->FindFixBin(2),"Loading");
    890   axey->SetBinLabel(axey->FindFixBin(3),"Ready");
    891   axey->SetBinLabel(axey->FindFixBin(4),"Active");
    892   axey->SetBinLabel(axey->FindFixBin(5),"Stopped");
    893   axey->SetLabelSize(0.07);
    894   hist->SetXTitle("Time");
    895   hist->SetYTitle("");
     1013   g = hTrigStatus.GetGraph();
     1014   g->SetMarkerStyle(kFullDotSmall);
     1015   g->SetTitle("Trigger status");
     1016   clone1 = (MHVsTime*)hTrigStatus.DrawClone("nonew");
     1017   if(clone1->GetGraph()->GetN())
     1018     {
     1019       hist = clone1->GetGraph()->GetHistogram();
     1020       axey = hist->GetYaxis();
     1021       hist->SetMinimum(-0.5);
     1022       hist->SetMaximum(5.5);
     1023       axey->Set(6,-0.5,5.5);
     1024       axey->SetBinLabel(axey->FindFixBin(0),"Error");
     1025       axey->SetBinLabel(axey->FindFixBin(1),"Idle");
     1026       axey->SetBinLabel(axey->FindFixBin(2),"Loading");
     1027       axey->SetBinLabel(axey->FindFixBin(3),"Ready");
     1028       axey->SetBinLabel(axey->FindFixBin(4),"Active");
     1029       axey->SetBinLabel(axey->FindFixBin(5),"Stopped");
     1030       axey->SetLabelSize(0.07);
     1031       hist->SetXTitle("Time");
     1032       hist->SetYTitle("");
     1033     }
    8961034  // ***************************** Trigger of macrocells **********************
    897   TCanvas &c7 = d.AddTab("TRIG. MACROCELLs");
     1035  if ((d = evtloop.GetDisplay()))
     1036    TCanvas &c7 = d.AddTab("TRIG. MACROCELLs");
     1037  else
     1038    TCanvas *c7 = new TCanvas();
    8981039  c7->Divide(2,2);
    8991040  c7->cd(1);
    9001041  TLegend *legtrig = new TLegend(0.80,0.70,0.99,0.99);
    901   TGraph *g = htrigmc1.GetGraph();
     1042  g = htrigmc1.GetGraph();
    9021043  g->SetMarkerStyle(kFullDotSmall);
    9031044  g->SetMarkerColor(2);
    9041045  legtrig->AddEntry(g,Form("Macrocell 1: %3.0f",g->GetHistogram()->GetMaximum()),"p");
    9051046  g->SetTitle("Trigger rate of mc 1 : (maximum)");
    906   MHPixVsTime *pixclone1 = (MHPixVsTime*)htrigmc1.DrawClone("nonew");
    907   TH1 *hist = pixclone1->GetGraph()->GetHistogram();
    908   if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
    909     hist->SetMaximum(g->GetHistogram()->GetMaximum());
    910   hist->SetXTitle("Time");
    911   hist->SetYTitle("Trigger [Hz]");
     1047  pixclone1 = (MHPixVsTime*)htrigmc1.DrawClone("nonew");
     1048  if(clone1->GetGraph()->GetN())
     1049    {
     1050      hist = pixclone1->GetGraph()->GetHistogram();
     1051      if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
     1052        hist->SetMaximum(g->GetHistogram()->GetMaximum());
     1053      hist->SetXTitle("Time");
     1054      hist->SetYTitle("Trigger [Hz]");
     1055    }
    9121056  legtrig->DrawClone();
    9131057  c7->cd(2);
    9141058  TLegend *legtrig = new TLegend(0.80,0.70,0.99,0.99);
    915   TGraph *g = htrigmc2.GetGraph();
     1059  g = htrigmc2.GetGraph();
    9161060  g->SetMarkerStyle(kFullDotSmall);
    9171061  g->SetMarkerColor(2);
    9181062  legtrig->AddEntry(g,Form("Macrocell 2: %3.0f",g->GetHistogram()->GetMaximum()),"p");
    9191063  g->SetTitle("Trigger rate of mc 2-7 : (maximum)");
    920   MHPixVsTime *pixclone1 = (MHPixVsTime*)htrigmc2.DrawClone("nonew");
    921   TH1 *hist = pixclone1->GetGraph()->GetHistogram();
    922   if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
    923     hist->SetMaximum(g->GetHistogram()->GetMaximum());
    924   hist->SetXTitle("Time");
    925   hist->SetYTitle("Trigger [Hz]");
     1064  pixclone1 = (MHPixVsTime*)htrigmc2.DrawClone("nonew");
     1065  if(clone1->GetGraph()->GetN())
     1066    {
     1067      hist = pixclone1->GetGraph()->GetHistogram();
     1068      if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
     1069        hist->SetMaximum(g->GetHistogram()->GetMaximum());
     1070      hist->SetXTitle("Time");
     1071      hist->SetYTitle("Trigger [Hz]");
     1072    }
    9261073  g=htrigmc3.GetGraph();
    9271074  g->SetMarkerStyle(kFullDotSmall);
     
    9621109  c7->cd(3);
    9631110  TLegend *legtrig = new TLegend(0.80,0.70,0.99,0.99);
    964   TGraph *g = htrigmc8.GetGraph();
     1111  g = htrigmc8.GetGraph();
    9651112  g->SetMarkerStyle(kFullDotSmall);
    9661113  g->SetMarkerColor(2);
     
    9691116  if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
    9701117    hist->SetMaximum(g->GetHistogram()->GetMaximum());
    971   MHPixVsTime *pixclone1 = (MHPixVsTime*)htrigmc8.DrawClone("nonew");
    972   TH1 *hist = pixclone1->GetGraph()->GetHistogram();
    973   hist->SetXTitle("Time");
    974   hist->SetYTitle("Trigger [Hz]");
     1118  pixclone1 = (MHPixVsTime*)htrigmc8.DrawClone("nonew");
     1119  if(clone1->GetGraph()->GetN())
     1120    {
     1121      hist = pixclone1->GetGraph()->GetHistogram();
     1122      hist->SetXTitle("Time");
     1123      hist->SetYTitle("Trigger [Hz]");
     1124    }
    9751125  g=htrigmc9.GetGraph();
    9761126  g->SetMarkerStyle(kFullDotSmall);
     
    10141164  legtrig->AddEntry(g,Form("Macrocell 14: %3.0f",g->GetHistogram()->GetMaximum()),"p");
    10151165  g->SetTitle("Trigger rate of mc 14-19 : (maximum)");
    1016   MHPixVsTime *pixclone1 = (MHPixVsTime*)htrigmc14.DrawClone("nonew");
    1017   TH1 *hist = pixclone1->GetGraph()->GetHistogram();
    1018   if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
    1019     hist->SetMaximum(g->GetHistogram()->GetMaximum());
    1020   hist->SetXTitle("Time");
    1021   hist->SetYTitle("Trigger [Hz]");
     1166  pixclone1 = (MHPixVsTime*)htrigmc14.DrawClone("nonew");
     1167  if(clone1->GetGraph()->GetN())
     1168    {
     1169      hist = pixclone1->GetGraph()->GetHistogram();
     1170      if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
     1171        hist->SetMaximum(g->GetHistogram()->GetMaximum());
     1172      hist->SetXTitle("Time");
     1173      hist->SetYTitle("Trigger [Hz]");
     1174    }
    10221175  g=htrigmc15.GetGraph();
    10231176  g->SetMarkerStyle(kFullDotSmall);
     
    10601213  // *************************** Weather station ******************************
    10611214  //
    1062   TCanvas &c8 = d.AddTab("WEATHER STATION");
     1215  if ((d = evtloop.GetDisplay()))
     1216    TCanvas &c8 = d.AddTab("WEATHER STATION");
     1217  else
     1218    TCanvas *c8 = new TCanvas();
    10631219  c8->Divide(2,2);
    10641220  // ----------------------- Relative humidity --------------------------------
    10651221  c8->cd(1);
    1066   TGraph *g = hCCHum.GetGraph();
     1222  g = hCCHum.GetGraph();
    10671223  g->SetMarkerStyle(kFullDotSmall);
    10681224  g->SetMarkerColor(4);
    10691225  g->SetLineColor(4);
    10701226  g->SetTitle("Relative humidity");
    1071   MHVsTime *clone1 = (MHVsTime*)hCCHum.DrawClone("nonew");
    1072   TH1 *hist = clone1->GetGraph()->GetHistogram();
    1073   hist->SetXTitle("Time");
    1074   hist->SetYTitle("Humidity [%]");
     1227  clone1 = (MHVsTime*)hCCHum.DrawClone("nonew");
     1228  if(clone1->GetGraph()->GetN())
     1229    {
     1230      hist = clone1->GetGraph()->GetHistogram();
     1231      hist->SetXTitle("Time");
     1232      hist->SetYTitle("Humidity [%]");
     1233    }
    10751234  // -------------------------- Temperature -----------------------------------
    10761235  c8->cd(2);
    1077   TGraph *g = hCCTemp.GetGraph();
     1236  g = hCCTemp.GetGraph();
    10781237  g->SetMarkerStyle(kFullDotSmall);
    10791238  g->SetMarkerColor(2);
    10801239  g->SetLineColor(2);
    10811240  g->SetTitle("Temperature");
    1082   MHVsTime *clone2 = (MHVsTime*)hCCTemp.DrawClone("nonew");
    1083   TH1 *hist = clone2->GetGraph()->GetHistogram();
    1084   hist->SetXTitle("Time");
    1085   hist->SetYTitle("Temperature [\\circ C]");
     1241  clone1 = (MHVsTime*)hCCTemp.DrawClone("nonew");
     1242  if(clone1->GetGraph()->GetN())
     1243    {
     1244      hist = clone1->GetGraph()->GetHistogram();
     1245      hist->SetXTitle("Time");
     1246      hist->SetYTitle("Temperature [\\circ C]");
     1247    }
    10861248  // --------------------------- Wind speed -----------------------------------
    10871249  c8->cd(3);
    1088   TGraph *g = hCCWS.GetGraph();
     1250  g = hCCWS.GetGraph();
    10891251  g->SetMarkerStyle(kFullDotSmall);
    10901252  g->SetMarkerColor(3);
    10911253  g->SetLineColor(3);
    10921254  g->SetTitle("Wind speed");
    1093   MHVsTime *clone3 = (MHVsTime*)hCCWS.DrawClone("nonew");
    1094   TH1 *hist = clone3->GetGraph()->GetHistogram();
    1095   hist->SetXTitle("Time");
    1096   hist->SetYTitle("Wind speed [km/h]");
     1255  clone1 = (MHVsTime*)hCCWS.DrawClone("nonew");
     1256  if(clone1->GetGraph()->GetN())
     1257    {
     1258      hist = clone1->GetGraph()->GetHistogram();
     1259      hist->SetXTitle("Time");
     1260      hist->SetYTitle("Wind speed [km/h]");
     1261    }
    10971262  // -------------------------- Solar radiation -------------------------------
    10981263  c8->cd(4);
    1099   TGraph *g = hCCSR.GetGraph();
     1264  g = hCCSR.GetGraph();
    11001265  g->SetMarkerStyle(kFullDotSmall);
    11011266  g->SetMarkerColor(9);
    11021267  g->SetLineColor(9);
    11031268  g->SetTitle("Solar radiation");
    1104   MHVsTime *clone4 = (MHVsTime*)hCCSR.DrawClone("nonew");
    1105   TH1 *hist = clone4->GetGraph()->GetHistogram();
    1106   hist->SetXTitle("Time");
    1107   hist->SetYTitle("Solar radiation [W/m^2]");
    1108 
    1109   //
     1269  clone1 = (MHVsTime*)hCCSR.DrawClone("nonew");
     1270  if(clone1->GetGraph()->GetN())
     1271    {
     1272      hist = clone1->GetGraph()->GetHistogram();
     1273      hist->SetXTitle("Time");
     1274      hist->SetYTitle("Solar radiation [W/m^2]");
     1275    }
     1276
     1277  // Save data in a postscriptfile (filename.ps)
     1278  TString file;
     1279  if (filename.Last('.')>0)
     1280    file = filename(0, filename.Last('.'));
     1281
    11101282  // Make sure the display hasn't been deleted by the user while the
    11111283  // eventloop was running.
    1112   //
    11131284  if ((d = evtloop.GetDisplay()))
    1114     {
    1115       TString file;
    1116       if (filename.Last('.')>0)
    1117         file = filename(0, filename.Last('.'));
    1118 
    1119       // Save data in a postscriptfile (status.ps)
    1120       d->SaveAsPS(-1,Form("%s.ps",file));
     1285      d->SaveAsPS(directory+file+".ps");
     1286  else
     1287    {
     1288      c1->Print(directory+file+".ps(");
     1289      c2->Print(directory+file+".ps");
     1290      c3->Print(directory+file+".ps");
     1291      c4->Print(directory+file+".ps");
     1292      c5->Print(directory+file+".ps");
     1293      c6->Print(directory+file+".ps");
     1294      c7->Print(directory+file+".ps");
     1295      c8->Print(directory+file+".ps)");
    11211296    }
    11221297}
Note: See TracChangeset for help on using the changeset viewer.