Jpp  17.3.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JStyle.hh
Go to the documentation of this file.
1 #ifndef __JROOT__JSTYLE__
2 #define __JROOT__JSTYLE__
3 
4 #include "TStyle.h"
5 #include "TCanvas.h"
6 
7 
8 /**
9  * \author mdejong
10  */
11 
12 namespace JROOT {}
13 namespace JPP { using namespace JROOT; }
14 
15 namespace JROOT {
16 
17  /**
18  * Wrapper class around ROOT TStyle.
19  */
20  class JStyle :
21  public TStyle
22  {
23  public:
24  /**
25  * Constructor.
26  *
27  * \param title title
28  * \param x number of pixels in X
29  * \param y number of pixels in Y
30  */
31  JStyle(const char* title, const UInt_t x, const UInt_t y) :
32  TStyle(title, NULL)
33  {
34  const Double_t font_size = (Double_t) y * 0.8e-4;
35 
36  SetCanvasColor(0);
37  SetCanvasBorderMode(0);
38  SetCanvasBorderSize(0);
39 
40  SetPadColor(0);
41  SetPadBorderMode(0);
42  SetPadBorderSize(0);
43  SetPadTopMargin (0.10);
44  SetPadBottomMargin(0.15);
45  SetPadLeftMargin (0.15);
46  SetPadRightMargin (0.10);
47 
48  SetTickLength(3.0e-5 * (x < y ? x : y), "X");
49  SetTickLength(3.0e-5 * (x < y ? x : y), "Y");
50  SetTickLength(3.0e-5 * (x < y ? x : y), "Z");
51 
52  SetLabelSize(font_size, "X");
53  SetLabelSize(font_size, "Y");
54  SetLabelSize(font_size, "Z");
55  SetLabelOffset(0.005, "X");
56  SetLabelOffset(0.005, "Y");
57  SetLabelOffset(0.005, "Z");
58 
59  SetTitleX(0.05);
60  SetTitleY(0.99);
61  SetTitleOffset(1.5, "X");
62  SetTitleOffset(1.5, "Y");
63  SetTitleOffset(1.5, "Z");
64  SetTitleSize(font_size, "X");
65  SetTitleSize(font_size, "Y");
66  SetTitleSize(font_size, "Z");
67 
68  SetStatColor(0);
69  SetStatBorderSize(1);
70  SetStatFontSize(font_size);
71  SetOptStat(111111);
72  SetOptFit(1111);
73 
74  SetPaintTextFormat("3.0f");
75  SetPalette(1);
76 
77  SetTitleFillColor(0);
78  SetTitleAlign(23);
79  SetTitleX(0.5);
80  SetTitleBorderSize(0);
81  }
82  };
83 }
84 
85 #endif
JStyle(const char *title, const UInt_t x, const UInt_t y)
Constructor.
Definition: JStyle.hh:31
Wrapper class around ROOT TStyle.
Definition: JStyle.hh:20