#ifndef __JROOT__JSTYLE__ #define __JROOT__JSTYLE__ #include "TStyle.h" #include "TCanvas.h" /** * \author mdejong */ namespace JROOT {} namespace JPP { using namespace JROOT; } namespace JROOT { /** * Wrapper class around ROOT TStyle. */ class JStyle : public TStyle { public: /** * Constructor. * * \param title title * \param x number of pixels in X * \param y number of pixels in Y */ JStyle(const char* title, const UInt_t x, const UInt_t y) : TStyle(title, NULL) { const Double_t font_size = (Double_t) y * 0.7e-4; SetCanvasColor(0); SetCanvasBorderMode(0); SetCanvasBorderSize(0); SetPadColor(0); SetPadBorderMode(0); SetPadBorderSize(0); SetPadTopMargin (0.10); SetPadBottomMargin(0.15); SetPadLeftMargin (0.15); SetPadRightMargin (0.10); SetTickLength(3.0e-5 * (x < y ? x : y), "X"); SetTickLength(3.0e-5 * (x < y ? x : y), "Y"); SetTickLength(3.0e-5 * (x < y ? x : y), "Z"); SetLabelSize(font_size, "X"); SetLabelSize(font_size, "Y"); SetLabelSize(font_size, "Z"); SetLabelOffset(0.005, "X"); SetLabelOffset(0.005, "Y"); SetLabelOffset(0.005, "Z"); SetTitleX(0.05); SetTitleY(0.99); SetTitleOffset(1.5, "X"); SetTitleOffset(1.5, "Y"); SetTitleOffset(1.5, "Z"); SetTitleSize(font_size, "X"); SetTitleSize(font_size, "Y"); SetTitleSize(font_size, "Z"); SetStatColor(0); SetStatBorderSize(1); SetStatFontSize(font_size); SetOptStat(111111); SetOptFit(1111); SetPaintTextFormat("3.0f"); SetPalette(1); SetTitleFillColor(0); SetTitleAlign(23); SetTitleX(0.5); SetTitleBorderSize(0); } }; } #endif