From c3c493e59dee3f4b4ef05a952d69128fe39a1201 Mon Sep 17 00:00:00 2001
From: Carlos Yero <hallconline@gmail.com>
Date: Thu, 25 Jan 2018 19:47:35 -0500
Subject: [PATCH] modified online gui source code to take logxy argument so we
 are now able to plot a 2D histos with simultaneous lo x and y

---
 onlineGUI/onlineGUI_v1.2.1/online.C | 36 ++++++++++++++++++++++-------
 onlineGUI/onlineGUI_v1.2.1/online.h |  1 +
 2 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/onlineGUI/onlineGUI_v1.2.1/online.C b/onlineGUI/onlineGUI_v1.2.1/online.C
index 99341a0a..4c21c0ef 100755
--- a/onlineGUI/onlineGUI_v1.2.1/online.C
+++ b/onlineGUI/onlineGUI_v1.2.1/online.C
@@ -446,6 +446,18 @@ vector <TString> OnlineConfig::GetCutIdent() {
     return out;
 }
 
+Bool_t OnlineConfig::IsLogxy(UInt_t page) {
+    // Check if last word on line is "logxy"
+
+    UInt_t page_index = pageInfo[page].first;
+    Int_t word_index = sConfFile[page_index].size()-1;
+    if (word_index <= 0) return kFALSE;
+    TString option = sConfFile[page_index][word_index];
+    if(option == "logxy") return kTRUE;
+    return kFALSE;
+
+}
+
 Bool_t OnlineConfig::IsLogx(UInt_t page) {
     // Check if last word on line is "logx"
 
@@ -496,9 +508,10 @@ pair <UInt_t, UInt_t> OnlineConfig::GetPageDim(UInt_t page)
 
     UInt_t size1 = 2;
 
-    if (IsLogx(page)) size1 = 3;  // last word is "logy"
+    if (IsLogx(page)) size1 = 3;  // last word is "logx"
     if (IsLogy(page)) size1 = 3;  // last word is "logy"
-    if (IsLogz(page)) size1 = 3;  // last word is "logy"
+    if (IsLogz(page)) size1 = 3;  // last word is "logz"
+    if (IsLogxy(page)) size1 = 3;  // last word is "logxy"
 
     // If the dimensions are defined, return them.
     if(sConfFile[page_index].size()>size1-1) {
@@ -987,16 +1000,23 @@ void OnlineGUI::DoDraw()
     gStyle->SetOptStat(1110);
     gStyle->SetStatFontSize(0.1);
 #endif
-    if (fConfig->IsLogx(current_page)) {
+    if (fConfig->IsLogxy(current_page)) {
         gStyle->SetOptLogx(1);
-    } else {
-        gStyle->SetOptLogx(0);
-    }
-    if (fConfig->IsLogy(current_page)) {
         gStyle->SetOptLogy(1);
     } else {
-        gStyle->SetOptLogy(0);
+        if (fConfig->IsLogx(current_page)) {
+            gStyle->SetOptLogx(1);
+        } else {
+            gStyle->SetOptLogx(0);
+        }
+
+        if (fConfig->IsLogy(current_page)) {
+            gStyle->SetOptLogy(1);
+        } else {
+            gStyle->SetOptLogy(0);
+        }
     }
+
     if (fConfig->IsLogz(current_page)) {
         gStyle->SetOptLogz(1);
     } else {
diff --git a/onlineGUI/onlineGUI_v1.2.1/online.h b/onlineGUI/onlineGUI_v1.2.1/online.h
index 6e6e10e2..44ea36d8 100755
--- a/onlineGUI/onlineGUI_v1.2.1/online.h
+++ b/onlineGUI/onlineGUI_v1.2.1/online.h
@@ -101,6 +101,7 @@ public:
   // Page utilites
   UInt_t  GetPageCount() { return pageInfo.size(); };
   pair <UInt_t,UInt_t> GetPageDim(UInt_t);
+  Bool_t IsLogxy(UInt_t page);
   Bool_t IsLogx(UInt_t page);
   Bool_t IsLogy(UInt_t page);
   Bool_t IsLogz(UInt_t page);
-- 
GitLab