{
  // To be executed after ".x Load.cpp"

  gROOT->ProcessLine(".L MSPLscan903-920.C+");
  gROOT->ProcessLine(".L MSPLscanPmacro.C+");
  
  Int_t ARCO2size = 10;
  Int_t ARCO2CF4size = 9;

  TVectorD ARCO2 (ARCO2size);
  TVectorD ARCO2CF4 (ARCO2CF4size);
  TVectorD ARCO2ey (ARCO2size);
  TVectorD ARCO2CF4ey (ARCO2CF4size);
  TVectorD ARCO2ex (ARCO2size);
  TVectorD ARCO2CF4ex (ARCO2CF4size);
  TVectorD ARCO2lat (ARCO2size);
  TVectorD ARCO2CF4lat (ARCO2CF4size);

  for (Int_t i = 0; i < ARCO2size; i++)
    {
      ARCO2ex[i] = 0;
      ARCO2lat[i] = i + 10;
    }
  for (Int_t i = 0; i < ARCO2CF4size; i++)
    {
      ARCO2CF4ex[i] = 0;
      ARCO2CF4lat[i] = i + 11;
    }

  ARCO2 = MSPLscanPmacro();
  ARCO2CF4 = MSPLscan903920();
  ARCO2ey = MSPLscanPmacroey();
  ARCO2CF4ey = MSPLscan903920ey();

  TCanvas *c1 = new TCanvas ("c1", "Timing");

  TGraphErrors *firstgas = new TGraphErrors (ARCO2lat,ARCO2,ARCO2ex,ARCO2ey);
  firstgas->SetTitle("#splitline{Ar-CO2 70/30}{I = 859 #muA}");
  firstgas->SetLineColor(kBlue);
  firstgas->SetMarkerColor(kBlue);
  firstgas->SetLineWidth(2);

  TGraphErrors *secondgas = new TGraphErrors (ARCO2CF4lat,ARCO2CF4,ARCO2CF4ex,ARCO2CF4ey);
  secondgas->SetTitle("#splitline{Ar-CO2-CF4 60/20/20}{I = 892 #muA}");
  secondgas->SetLineColor(kRed);
  secondgas->SetMarkerColor(kRed);
  secondgas->SetLineWidth(2);

  TMultiGraph *plot = new TMultiGraph ();
  plot->Add(firstgas);
  plot->Add(secondgas);

  plot->Draw("ALP");
  plot->GetXaxis()->SetRangeUser(10,19);
  plot->GetYaxis()->SetRangeUser(0,1);
  plot->GetYaxis()->SetDecimals();
  plot->SetTitle("Signal timing");
  plot->GetXaxis()->SetTitle("Latency [clock cycles = 25ns steps]");
  plot->GetYaxis()->SetTitle("LG efficiency");

  c1->Update();
  c1->SetGridx();
  c1->SetGridy();
  c1->SetTickx();
  c1->SetTicky();
  c1->Update();

  TLegend *legend = new TLegend (0.1,0.4,0.4,0.9);
  legend->SetHeader("#splitline{Latency scan}{[MSPL 2clk, th -60steps]}");
  legend->AddEntry(firstgas,firstgas->GetTitle(),"lp");
  legend->AddEntry(secondgas,secondgas->GetTitle(),"lp");
  legend->Draw();

  c1->Update();

  c1->Update();

}

