Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:32:12

0001 #ifndef ROOTLOGON_H
0002 #define ROOTLOGON_H
0003 
0004 #include "TROOT.h"
0005 #include "TColor.h"
0006 #include "TStyle.h"
0007 
0008 void setColors()
0009 {
0010     TColor::InitializeColors(); 
0011     TColor *color = (TColor*)(gROOT->GetListOfColors()->At(40));
0012     color->SetRGB(0.87, 0.73, 0.53); // light brown    
0013     color = (TColor*)(gROOT->GetListOfColors()->At(41));
0014     color->SetRGB(1.0, 0.1, 0.5); // deep roze    
0015     color = (TColor*)(gROOT->GetListOfColors()->At(42));
0016     color->SetRGB(0.5, 0.8, 0.1); // light green  
0017     color = (TColor*)(gROOT->GetListOfColors()->At(43));
0018     color->SetRGB(0.1, 0.5, 0.3); // dark  green  
0019     color = (TColor*)(gROOT->GetListOfColors()->At(44));
0020     color->SetRGB(0.5, 0.2, 0.8); // blue-violet  
0021     color = (TColor*)(gROOT->GetListOfColors()->At(45));
0022     color->SetRGB(0.2, 0.6, 0.9); // grey-blue    
0023     color = (TColor*)(gROOT->GetListOfColors()->At(46));
0024     color->SetRGB(1.0, 0.5, 0.0); // orange-brick 
0025     color = (TColor*)(gROOT->GetListOfColors()->At(47));
0026     color->SetRGB(0.8, 0.0, 0.0); // brick 
0027 //
0028     color = (TColor*)(gROOT->GetListOfColors()->At(51));
0029     color->SetRGB(1.0 , 1.0 , 0.8 ); // lightest yellow 
0030     color = (TColor*)(gROOT->GetListOfColors()->At(52));
0031     color->SetRGB(0.8 , 1.00, 1.00); // lightest blue-cyan       
0032     color = (TColor*)(gROOT->GetListOfColors()->At(53));
0033     color->SetRGB(1.0 , 0.95, 0.95); // lightest rose
0034     color = (TColor*)(gROOT->GetListOfColors()->At(54));
0035     color->SetRGB(0.8 , 1.0 , 0.8 ); // lightest green
0036     color = (TColor*)(gROOT->GetListOfColors()->At(55));
0037     color->SetRGB(1.00, 1.00, 1.00); // white
0038 
0039 // gStyle->SetOptStat(0);   
0040 
0041     gStyle->SetCanvasBorderMode(0);
0042     gStyle->SetCanvasColor(432-10);//kCyan-10  //formerly 52
0043     gStyle->SetTitleSize(0.06, "XYZ");
0044     gStyle->SetTitleXOffset(0.9);
0045     gStyle->SetTitleYOffset(1.25);
0046 
0047     gStyle->SetLabelOffset(0.007, "XYZ");
0048     gStyle->SetLabelSize(0.05, "XYZ");
0049 
0050  
0051     gStyle->SetTitle("");
0052     gStyle->SetOptTitle(0);
0053  
0054     gStyle->SetHistLineColor(0);//45
0055     gStyle->SetHistLineStyle(1);
0056     gStyle->SetHistLineWidth(2);
0057 
0058     gStyle->SetPadColor(0);//52  
0059     gStyle->SetPadBorderSize(1); 
0060     gStyle->SetPadBottomMargin(0.15);
0061     gStyle->SetPadTopMargin(0.1);
0062     gStyle->SetPadLeftMargin(0.15);
0063     gStyle->SetPadRightMargin(0.15);
0064     gStyle->SetFrameBorderMode(0);
0065     gStyle->SetFrameFillColor(10);//55
0066 
0067     Float_t r, g, b;
0068     Float_t saturation = 1;
0069     Float_t lightness = 0.5;
0070     Float_t maxHue = 280;
0071     Float_t minHue = 0;
0072     const Int_t maxPretty = 50;
0073     Float_t hue;
0074     int colors[maxPretty];
0075 
0076     for (int j = 0; j < maxPretty; j++) 
0077     {
0078         hue = maxHue - (j + 1)*((maxHue - minHue) / maxPretty);
0079         TColor::HLStoRGB(hue, lightness, saturation, r, g, b);
0080     colors[j] = TColor::GetColor(r, g, b);
0081     }
0082     gStyle->SetPalette(maxPretty, colors);
0083 }
0084 
0085 #endif