From 804365a3d6876c7a1273a2a7e94c7b36fd4b770c Mon Sep 17 00:00:00 2001
From: matta adrien <matta@lpccaen.in2p3.fr>
Date: Fri, 7 Oct 2016 10:46:06 +0200
Subject: [PATCH] * Fixing nptool style for Linux

---
 Examples/Example2/ShowResults.C |   1 -
 NPLib/scripts/Style_nponline.C  | 110 ++++++++++++++--------------
 NPLib/scripts/Style_nptool.C    | 124 ++++++++++++++++----------------
 3 files changed, 119 insertions(+), 116 deletions(-)

diff --git a/Examples/Example2/ShowResults.C b/Examples/Example2/ShowResults.C
index 3da629ce3..2898696c6 100644
--- a/Examples/Example2/ShowResults.C
+++ b/Examples/Example2/ShowResults.C
@@ -15,7 +15,6 @@ TChain* chain = LoadChain();
 
 TCanvas* c1 = new TCanvas("Example2","Example2",0,0,800,800);
 c1->Divide(2,2);
-
 // Kinematic Line
 c1->cd(1);
 chain->Draw("ELab:ThetaLab>>hKine(180,0,180,400,0,20)","ELab>0","colz");
diff --git a/NPLib/scripts/Style_nponline.C b/NPLib/scripts/Style_nponline.C
index 56802af75..83c2018e5 100644
--- a/NPLib/scripts/Style_nponline.C
+++ b/NPLib/scripts/Style_nponline.C
@@ -6,79 +6,79 @@ void Style_nponline(){
   // produce minimalist publication ready
   // outlook with nptool color scheme
   //-----------------------------------
-  TStyle* style_nponline = new TStyle("nponline", "style_nponline");
+  TStyle* style = new TStyle("nponline", "style");
 
   //General 
-  style_nponline->SetFrameFillColor(kGray+3);	
-  style_nponline->SetFrameBorderMode(0);	
-  style_nponline->SetFrameLineColor(kGray+3);
-  style_nponline->SetStatColor(kGray+3);	
-  style_nponline->SetFillColor(kGray+3); 
-  style_nponline->SetTitleFillColor(kGray+3);  
-  style_nponline->SetTitleColor(kWhite,"pad");
-  style_nponline->SetTitleBorderSize(0);
-  style_nponline->SetTextColor(kWhite);
+  style->SetFrameFillColor(kGray+3);	
+  style->SetFrameBorderMode(0);	
+  style->SetFrameLineColor(kGray+3);
+  style->SetStatColor(kGray+3);	
+  style->SetFillColor(kGray+3); 
+  style->SetTitleFillColor(kGray+3);  
+  style->SetTitleColor(kWhite,"pad");
+  style->SetTitleBorderSize(0);
+  style->SetTextColor(kWhite);
 
 
   // Canvas
-  style_nponline->SetCanvasColor(kGray+3);	
-  style_nponline->SetCanvasDefH(800);
-  style_nponline->SetCanvasDefW(800);
-  style_nponline->SetCanvasBorderMode(0);	
+  style->SetCanvasColor(kGray+3);	
+  style->SetCanvasDefH(800);
+  style->SetCanvasDefW(800);
+  style->SetCanvasBorderMode(0);	
   
   // Pad
-  style_nponline->SetPadBottomMargin(0.10);
-  style_nponline->SetPadLeftMargin(0.15);
-  style_nponline->SetPadTopMargin(0.10);
-  style_nponline->SetPadRightMargin(0.15);
-  style_nponline->SetPadBorderMode(0);	
-  style_nponline->SetPadBorderSize(1);
-  style_nponline->SetPadColor(kGray+3);		
-  style_nponline->SetPadTickX(1);
-  style_nponline->SetPadTickY(1);
+  style->SetPadBottomMargin(0.10);
+  style->SetPadLeftMargin(0.15);
+  style->SetPadTopMargin(0.10);
+  style->SetPadRightMargin(0.15);
+  style->SetPadBorderMode(0);	
+  style->SetPadBorderSize(1);
+  style->SetPadColor(kGray+3);		
+  style->SetPadTickX(1);
+  style->SetPadTickY(1);
 
   // Desable stat title and fit  
-  style_nponline->SetOptStat(0);
-  style_nponline->SetOptTitle(1);
-  style_nponline->SetOptFit(1);		
+  style->SetOptStat(0);
+  style->SetOptTitle(1);
+  style->SetOptFit(1);		
 
   // x axis
-  style_nponline->SetAxisColor(kWhite,"X");
-  style_nponline->SetLabelColor(kWhite,"X");
-  style_nponline->SetTitleXSize(0.06);     
-  style_nponline->SetTitleXOffset(1.0);     
-  style_nponline->SetLabelOffset(0.1,"X");   
-  style_nponline->SetLabelSize(0.06,"X");
-  style_nponline->SetLabelOffset(0.006,"X");
+  style->SetAxisColor(kWhite,"X");
+  style->SetLabelColor(kWhite,"X");
+  style->SetTitleXSize(0.06);     
+  style->SetTitleXOffset(1.0);     
+  style->SetLabelOffset(0.1,"X");   
+  style->SetLabelSize(0.06,"X");
+  style->SetLabelOffset(0.006,"X");
 
   // y axis
-  style_nponline->SetTitleYSize(0.06);  
-  style_nponline->SetTitleYOffset(1.1);  
-  style_nponline->SetLabelOffset(0.1,"Y");
-  style_nponline->SetLabelSize(0.06,"Y");
-  style_nponline->SetLabelOffset(0.006,"Y");
-  style_nponline->SetAxisColor(kWhite,"Y");
-  style_nponline->SetLabelColor(kWhite,"Y");
+  style->SetTitleYSize(0.06);  
+  style->SetTitleYOffset(1.1);  
+  style->SetLabelOffset(0.1,"Y");
+  style->SetLabelSize(0.06,"Y");
+  style->SetLabelOffset(0.006,"Y");
+  style->SetAxisColor(kWhite,"Y");
+  style->SetLabelColor(kWhite,"Y");
 
   // z axis
-  style_nponline->SetAxisColor(kWhite,"Z");
-  style_nponline->SetLabelSize(0.06,"Z");
-  style_nponline->SetLabelOffset(0.006,"Z");
-  style_nponline->SetLabelColor(kWhite,"Z");
+  style->SetAxisColor(kWhite,"Z");
+  style->SetLabelSize(0.06,"Z");
+  style->SetLabelOffset(0.006,"Z");
+  style->SetLabelColor(kWhite,"Z");
 
 
   // Histogramm
-  style_nponline->SetHistLineColor(kAzure+7);
-  style_nponline->SetHistFillStyle(1001);
-  style_nponline->SetHistFillColor(kAzure+7);
-  style_nponline->SetMarkerColor(kOrange+7);
-  style_nponline->SetMarkerStyle(20);
-  style_nponline->SetLineColor(kOrange+7);
-  style_nponline->SetLineWidth(1);
-  style_nponline->SetFuncColor(kOrange+7);
-  style_nponline->SetFuncWidth(2);
+  style->SetHistLineColor(kAzure+7);
+  style->SetHistFillStyle(1001);
+  style->SetHistFillColor(kAzure+7);
+  style->SetMarkerColor(kOrange+7);
+  style->SetMarkerStyle(20);
+  style->SetLineColor(kOrange+7);
+  style->SetLineWidth(1);
+  style->SetFuncColor(kOrange+7);
+  style->SetFuncWidth(2);
 
-  style_nponline->SetTitlePS("nptool");
+  style->SetTitlePS("nptool");
 
   const UInt_t Number = 2;
   Double_t Red[Number]    = { 0,0   };
@@ -88,5 +88,5 @@ void Style_nponline(){
   Double_t Length[Number] = { 0,1.00 };
   Int_t nb=255;
   TColor::CreateGradientColorTable(Number,Length,Red,Green,Blue,nb);
-  style_nponline->SetNumberContours(99);
+  style->SetNumberContours(99);
 }
diff --git a/NPLib/scripts/Style_nptool.C b/NPLib/scripts/Style_nptool.C
index f5a6bb9c4..ccf35f6be 100644
--- a/NPLib/scripts/Style_nptool.C
+++ b/NPLib/scripts/Style_nptool.C
@@ -6,83 +6,87 @@ void Style_nptool(){
   // produce minimalist publication ready
   // outlook with nptool color scheme
   //-----------------------------------
-  TStyle* style_nptool = new TStyle("nptool", "style_nptool");
+  TStyle* style = new TStyle("nptool", "style");
+  style->SetTitlePS("nptool");
 
   //General 
-  style_nptool->SetFrameFillColor(kWhite);
-  style_nptool->SetFrameBorderMode(0);
-  style_nptool->SetFrameLineColor(kBlack);
-  style_nptool->SetStatColor(kWhite);	
-  style_nptool->SetFillColor(kWhite); 
-  style_nptool->SetTitleFillColor(kWhite);
-  style_nptool->SetPaperSize(20,24);
-  // Canvas
-  style_nptool->SetCanvasColor(kWhite);
-  style_nptool->SetCanvasDefH(800);
-  style_nptool->SetCanvasDefW(800);
-  style_nptool->SetCanvasBorderMode(0);
+  style->SetFrameFillColor(kWhite);	
+  style->SetFrameBorderMode(0);	
+  style->SetFrameLineColor(kWhite);
+  style->SetStatColor(kBlack);	
+  style->SetTitleFillColor(kWhite);  
+  style->SetTitleColor(kBlack,"pad");
+  style->SetTitleBorderSize(0);
+  style->SetTextColor(kBlack);
 
+  // Canvas
+  style->SetCanvasPreferGL(true);
+  style->SetCanvasColor(kWhite);	
+  style->SetCanvasDefH(800);
+  style->SetCanvasDefW(800);
+  style->SetCanvasBorderMode(0);	
+  
   // Pad
-  style_nptool->SetPadBottomMargin(0.15);
-  style_nptool->SetPadLeftMargin(0.15);
-  style_nptool->SetPadTopMargin(0.05);
-  style_nptool->SetPadRightMargin(0.10);
-  style_nptool->SetPadBorderMode(0);
-  style_nptool->SetPadBorderSize(1);
-  style_nptool->SetPadColor(kWhite);		
-  style_nptool->SetPadTickX(1);
-  style_nptool->SetPadTickY(1);
+  style->SetPadBottomMargin(0.10);
+  style->SetPadLeftMargin(0.10);
+  style->SetPadTopMargin(0.15);
+  style->SetPadRightMargin(0.15);
+  style->SetPadBorderMode(0);	
+  style->SetPadBorderSize(1);
+  // style->SetPadColor(kWhite);		
+  style->SetPadTickX(1);
+  style->SetPadTickY(1);
 
-  // Desable stat title and fit  
-  style_nptool->SetOptStat(0);
-  style_nptool->SetOptTitle(0);
-  //style_nptool->SetOptFit(0);
+  // Disable stat, title and fit  
+  style->SetOptStat(0);
+  style->SetOptTitle(0);
+  style->SetOptFit(0);		
 
   // x axis
-  style_nptool->SetTitleXSize(0.07);
-  style_nptool->SetTitleXOffset(1.0);     
-  style_nptool->SetLabelOffset(0.1,"X");   
-  style_nptool->SetLabelSize(0.04,"X");
-  style_nptool->SetLabelOffset(0.006,"X");
-    
-    /*style_nptool->SetTitleBorderSize(0);
-    style_nptool->SetTitleX(0.1f);
-    style_nptool->SetTitleW(0.8f);
-    style_nptool->SetTitleAlign(3);*/
+  style->SetAxisColor(kBlack,"X");
+  style->SetLabelColor(kBlack,"X");
+  style->SetTitleXSize(0.04);     
+  style->SetTitleXOffset(1.0);     
+  style->SetLabelOffset(0.1,"X");   
+  style->SetLabelSize(0.04,"X");
+  style->SetLabelOffset(0.004,"X");
 
   // y axis
-    //style_nptool->GetYaxis()->CenterTitle();
-  style_nptool->SetTitleYSize(0.07);
-  style_nptool->SetTitleYOffset(1.02);
-  style_nptool->SetLabelOffset(0.1,"Y");
-  style_nptool->SetLabelSize(0.04,"Y");
-  style_nptool->SetLabelOffset(0.006,"Y");
+  style->SetTitleYSize(0.04);  
+  style->SetTitleYOffset(1.1);  
+  style->SetLabelOffset(0.1,"Y");
+  style->SetLabelSize(0.04,"Y");
+  style->SetLabelOffset(0.004,"Y");
+  style->SetAxisColor(kBlack,"Y");
+  style->SetLabelColor(kBlack,"Y");
 
   // z axis
-  style_nptool->SetLabelSize(0.04,"Z");
-  style_nptool->SetLabelOffset(0.006,"Z");
-
+  style->SetAxisColor(kBlack,"Z");
+  style->SetLabelSize(0.04,"Z");
+  style->SetLabelOffset(0.004,"Z");
+  style->SetLabelColor(kBlack,"Z");
 
   // Histogramm
-  style_nptool->SetHistLineColor(kAzure+7);
-  style_nptool->SetHistFillStyle(1001);
-  style_nptool->SetHistFillColor(kAzure+7);
-  style_nptool->SetMarkerColor(kOrange+7);
-  style_nptool->SetMarkerStyle(20);
-  style_nptool->SetLineColor(kOrange+7);
-  style_nptool->SetLineWidth(2);
-  style_nptool->SetFuncColor(kOrange+7);
-  style_nptool->SetFuncWidth(2);
-
-  style_nptool->SetTitlePS("nptool");
+  style->SetHistLineColor(kAzure+7);
+ // style->SetHistFillStyle(1001);
+  style->SetHistFillColor(kAzure+7);
+    
+  // Graph, Line and Marker
+  style->SetMarkerStyle(20);
+  style->SetMarkerColor(kOrange+7);
+  style->SetLineColor(kOrange+7);
+  style->SetLineWidth(1);
+  style->SetFuncColor(kOrange+7);
+  style->SetFuncWidth(2);
 
+  // Create the color gradiant 
   const UInt_t Number = 2;
-  Double_t Red[Number]    = { 0,  0   };
-  Double_t Green[Number]  = { 0,  0.8 };
-  Double_t Blue[Number]   = { 0,  1.00 };
+  Double_t Red[Number]    = { 0,0   };
+  Double_t Green[Number]  = { 0,0.8 };
+  Double_t Blue[Number]   = { 0,1.00 };
 
   Double_t Length[Number] = { 0,1.00 };
   Int_t nb=255;
   TColor::CreateGradientColorTable(Number,Length,Red,Green,Blue,nb);
-  style_nptool->SetNumberContours(99);
+  style->SetNumberContours(99);
 }
-- 
GitLab