Example #1
0
void SetOKStyle()
{
  TStyle* OKStyle = new TStyle("OKStyle", "OK Default Style");

  // Colors

  //set the background color to white
  OKStyle->SetFillColor(10);
  OKStyle->SetFrameFillColor(kWhite);
  OKStyle->SetFrameFillStyle(0);
  OKStyle->SetFillStyle(0);
  OKStyle->SetCanvasColor(kWhite);
  OKStyle->SetPadColor(kWhite);
  OKStyle->SetTitleFillColor(0);
  OKStyle->SetStatColor(kWhite);

  // Get rid of drop shadow on legends
  // This doesn't seem to work.  Call SetBorderSize(1) directly on your TLegends
  OKStyle->SetLegendBorderSize(1);

  //don't put a colored frame around the plots
  OKStyle->SetFrameBorderMode(0);
  OKStyle->SetCanvasBorderMode(0);
  OKStyle->SetPadBorderMode(0);

  //use the primary color palette
  OKStyle->SetPalette(1, 0);

  //set the default line color for a histogram to be black
  OKStyle->SetHistLineColor(kBlack);

  //set the default line color for a fit function to be red
  OKStyle->SetFuncColor(kBlue);

  //make the axis labels black
  OKStyle->SetLabelColor(kBlack, "xyz");

  //set the default title color to be black
  OKStyle->SetTitleColor(kBlack);

  //set the margins
  OKStyle->SetPadBottomMargin(0.15);
  OKStyle->SetPadLeftMargin(0.1);
  OKStyle->SetPadTopMargin(0.075);
  OKStyle->SetPadRightMargin(0.1);

  //set axis label and title text sizes
  OKStyle->SetLabelSize(0.035, "xyz");
  OKStyle->SetTitleSize(0.05, "xyz");
  OKStyle->SetTitleOffset(0.9, "xyz");
  OKStyle->SetStatFontSize(0.035);
  OKStyle->SetTextSize(0.05);
  OKStyle->SetTitleBorderSize(0);
  OKStyle->SetTitleStyle(0);

  OKStyle->SetLegendBorderSize(0);

  //set line widths
  OKStyle->SetHistLineWidth(1);
  OKStyle->SetFrameLineWidth(2);
  OKStyle->SetFuncWidth(2);

  // Misc

  //align the titles to be centered
  //OKStyle->SetTextAlign(22);

  //turn off xy grids
  OKStyle->SetPadGridX(1);
  OKStyle->SetPadGridY(1);

  //set the tick mark style
  OKStyle->SetPadTickX(1);
  OKStyle->SetPadTickY(1);

  //don't show the fit parameters in a box
  OKStyle->SetOptFit(0);

  //set the default stats shown
  OKStyle->SetOptStat(1);

  //marker settings
  // 	OKStyle->SetMarkerStyle(8);
  // 	OKStyle->SetMarkerSize(0.7);

  // Fonts
  OKStyle->SetStatFont(42);
  OKStyle->SetLabelFont(42, "xyz");
  OKStyle->SetTitleFont(42, "xyz");
  OKStyle->SetTextFont(42);

  // Set the paper size for output
  OKStyle->SetPaperSize(TStyle::kUSLetter);

  //done
  OKStyle->cd();

  cout << "Using Jin's Style" << endl;
}
void SinglePionEfficiencyNewVSpT::setTDRStyle(Int_t xlog, Int_t ylog) {

    TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");

// For the canvas:
    tdrStyle->SetCanvasBorderMode(0);
    tdrStyle->SetCanvasColor(kWhite);
    tdrStyle->SetCanvasDefH(600); //Height of canvas
    tdrStyle->SetCanvasDefW(600); //Width of canvas
    tdrStyle->SetCanvasDefX(0);   //POsition on screen
    tdrStyle->SetCanvasDefY(0);

// For the Pad:
    tdrStyle->SetPadBorderMode(0);
    // tdrStyle->SetPadBorderSize(Width_t size = 1);
    tdrStyle->SetPadColor(kWhite);
    tdrStyle->SetPadGridX(false);
    tdrStyle->SetPadGridY(false);
    tdrStyle->SetGridColor(0);
    tdrStyle->SetGridStyle(3);
    tdrStyle->SetGridWidth(1);

// For the frame:
    tdrStyle->SetFrameBorderMode(0);
    tdrStyle->SetFrameBorderSize(1);
    tdrStyle->SetFrameFillColor(0);
    tdrStyle->SetFrameFillStyle(0);
    tdrStyle->SetFrameLineColor(1);
    tdrStyle->SetFrameLineStyle(1);
    tdrStyle->SetFrameLineWidth(1);

// For the histo:
    // tdrStyle->SetHistFillColor(1);
    // tdrStyle->SetHistFillStyle(0);
    tdrStyle->SetHistLineColor(1);
    tdrStyle->SetHistLineStyle(0);
    tdrStyle->SetHistLineWidth(2);
    // tdrStyle->SetLegoInnerR(Float_t rad = 0.5);
    // tdrStyle->SetNumberContours(Int_t number = 20);

    tdrStyle->SetEndErrorSize(4);
    //  tdrStyle->SetErrorMarker(20);
    //  tdrStyle->SetErrorX(0.);

    tdrStyle->SetMarkerStyle(20);

//For the fit/function:
    tdrStyle->SetOptFit(1);
    tdrStyle->SetFitFormat("5.4g");
    tdrStyle->SetFuncColor(1);
    tdrStyle->SetFuncStyle(1);
    tdrStyle->SetFuncWidth(1);

//For the date:
    tdrStyle->SetOptDate(0);
    // tdrStyle->SetDateX(Float_t x = 0.01);
    // tdrStyle->SetDateY(Float_t y = 0.01);

// For the statistics box:
    tdrStyle->SetOptFile(0);
    tdrStyle->SetOptStat(0); // To display the mean and RMS:   SetOptStat("mr");
    tdrStyle->SetStatColor(kWhite);
    tdrStyle->SetStatFont(42);
    tdrStyle->SetStatFontSize(0.025);
    tdrStyle->SetStatTextColor(1);
    tdrStyle->SetStatFormat("6.4g");
    tdrStyle->SetStatBorderSize(1);
    tdrStyle->SetStatH(0.1);
    tdrStyle->SetStatW(0.15);
    // tdrStyle->SetStatStyle(Style_t style = 1001);
    // tdrStyle->SetStatX(Float_t x = 0);
    // tdrStyle->SetStatY(Float_t y = 0);

// Margins:
    tdrStyle->SetPadTopMargin(0.05);
    tdrStyle->SetPadBottomMargin(0.13);
    tdrStyle->SetPadLeftMargin(0.13);
    tdrStyle->SetPadRightMargin(0.05);

// For the Global title:

    tdrStyle->SetOptTitle(0);
    tdrStyle->SetTitleFont(42);
    tdrStyle->SetTitleColor(1);
    tdrStyle->SetTitleTextColor(1);
    tdrStyle->SetTitleFillColor(10);
    tdrStyle->SetTitleFontSize(0.05);
    // tdrStyle->SetTitleH(0); // Set the height of the title box
    // tdrStyle->SetTitleW(0); // Set the width of the title box
    // tdrStyle->SetTitleX(0); // Set the position of the title box
    // tdrStyle->SetTitleY(0.985); // Set the position of the title box
    // tdrStyle->SetTitleStyle(Style_t style = 1001);
    // tdrStyle->SetTitleBorderSize(2);

// For the axis titles:

    tdrStyle->SetTitleColor(1, "XYZ");
    tdrStyle->SetTitleFont(42, "XYZ");
    tdrStyle->SetTitleSize(0.06, "XYZ");
    // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
    // tdrStyle->SetTitleYSize(Float_t size = 0.02);
    tdrStyle->SetTitleXOffset(0.9);
    tdrStyle->SetTitleYOffset(1.1);
    // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset

// For the axis labels:

    tdrStyle->SetLabelColor(1, "XYZ");
    tdrStyle->SetLabelFont(42, "XYZ");
    tdrStyle->SetLabelOffset(0.007, "XYZ");
    tdrStyle->SetLabelSize(0.05, "XYZ");

// For the axis:

    tdrStyle->SetAxisColor(1, "XYZ");
    tdrStyle->SetStripDecimals(kTRUE);
    tdrStyle->SetTickLength(0.03, "XYZ");
    tdrStyle->SetNdivisions(510, "XYZ");
    tdrStyle->SetPadTickX(1);  // To get tick marks on the opposite side of the frame
    tdrStyle->SetPadTickY(1);

// Change for log plots:
    tdrStyle->SetOptLogx(xlog);
    tdrStyle->SetOptLogy(ylog);
    tdrStyle->SetOptLogz(0);

// Postscript options:

//  tdrStyle->SetPaperSize(7.5,7.5);

    tdrStyle->SetPaperSize(15.,15.);

//  tdrStyle->SetPaperSize(20.,20.);

    // tdrStyle->SetLineScalePS(Float_t scale = 3);
    // tdrStyle->SetLineStyleString(Int_t i, const char* text);
    // tdrStyle->SetHeaderPS(const char* header);
    // tdrStyle->SetTitlePS(const char* pstitle);

    // tdrStyle->SetBarOffset(Float_t baroff = 0.5);
    // tdrStyle->SetBarWidth(Float_t barwidth = 0.5);
    // tdrStyle->SetPaintTextFormat(const char* format = "g");
    // tdrStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0);
    // tdrStyle->SetTimeOffset(Double_t toffset);
    // tdrStyle->SetHistMinimumZero(kTRUE);

    tdrStyle->cd();
}
Example #3
0
TStyle* createMyStyle() {
  TStyle *myStyle = new TStyle("myStyle", "myStyle");

  // For the canvas:
  myStyle->SetCanvasBorderMode(0);
  myStyle->SetCanvasColor(kWhite);
  myStyle->SetCanvasDefH(800); //Height of canvas
  myStyle->SetCanvasDefW(800); //Width of canvas
  myStyle->SetCanvasDefX(0);   //POsition on screen
  myStyle->SetCanvasDefY(0);

  // For the Pad:
  myStyle->SetPadBorderMode(0);
  myStyle->SetPadColor(kWhite);
  myStyle->SetPadGridX(false);
  myStyle->SetPadGridY(false);
  myStyle->SetGridColor(0);
  myStyle->SetGridStyle(3);
  myStyle->SetGridWidth(1);

  // For the frame:
  myStyle->SetFrameBorderMode(0);
  myStyle->SetFrameBorderSize(1);
  myStyle->SetFrameFillColor(0);
  myStyle->SetFrameFillStyle(0);
  myStyle->SetFrameLineColor(1);
  myStyle->SetFrameLineStyle(1);
  myStyle->SetFrameLineWidth(1);

  // For the histo:
  myStyle->SetHistLineStyle(1);
  myStyle->SetHistLineWidth(2);
  myStyle->SetEndErrorSize(2);

  //For the fit/function:
  myStyle->SetFitFormat("5.4g");
  myStyle->SetFuncColor(2);
  myStyle->SetFuncStyle(1);
  myStyle->SetFuncWidth(1);

  // For the statistics box:
  myStyle->SetOptFile(0);
  myStyle->SetStatColor(kWhite);
  //myStyle->SetStatFont(43);
  //myStyle->SetStatFontSize(0.025);
  myStyle->SetStatTextColor(1);
  myStyle->SetStatFormat("6.4g");
  myStyle->SetStatBorderSize(1);
  myStyle->SetStatH(0.12);
  myStyle->SetStatW(0.3);
  myStyle->SetStatY(0.92);
  myStyle->SetStatX(0.94);

  //For the date:
  myStyle->SetOptDate(0);

  // Margins:
  myStyle->SetPadTopMargin(TOP_MARGIN);
  myStyle->SetPadBottomMargin(BOTTOM_MARGIN);
  myStyle->SetPadLeftMargin(LEFT_MARGIN);
  myStyle->SetPadRightMargin(RIGHT_MARGIN);

  // For the Global title:
  myStyle->SetOptTitle(0);
  myStyle->SetTitleFont(63);
  myStyle->SetTitleColor(1);
  myStyle->SetTitleTextColor(1);
  myStyle->SetTitleFillColor(10);
  myStyle->SetTitleBorderSize(0);
  myStyle->SetTitleAlign(33); 
  myStyle->SetTitleX(1);
  myStyle->SetTitleFontSize(TITLE_FONTSIZE);

  // For the axis titles:

  myStyle->SetTitleColor(1, "XYZ");
  myStyle->SetTitleFont(43, "XYZ");
  myStyle->SetTitleSize(TITLE_FONTSIZE, "XYZ");
  myStyle->SetTitleYOffset(2.); 
  myStyle->SetTitleXOffset(1.25);

  myStyle->SetLabelColor(1, "XYZ");
  myStyle->SetLabelFont(43, "XYZ");
  myStyle->SetLabelOffset(0.01, "YZ");
  myStyle->SetLabelOffset(0.015, "X");
  myStyle->SetLabelSize(LABEL_FONTSIZE, "XYZ");

  myStyle->SetAxisColor(1, "XYZ");
  myStyle->SetStripDecimals(kTRUE);
  myStyle->SetTickLength(0.03, "XYZ");
  myStyle->SetNdivisions(510, "XYZ");
  myStyle->SetPadTickX(1);  // To get tick marks on the opposite side of the frame
  myStyle->SetPadTickY(1);

  myStyle->SetOptLogx(0);
  myStyle->SetOptLogy(0);
  myStyle->SetOptLogz(0);

  myStyle->SetHatchesSpacing(1.3);
  myStyle->SetHatchesLineWidth(1);

  myStyle->cd();

  return myStyle;
}
Example #4
0
   void SetTMVAStyle() {
      
      TStyle *TMVAStyle = gROOT->GetStyle("TMVA");
      if(TMVAStyle!=0) {
         gROOT->SetStyle("TMVA");
         return;
      }
			
      TMVAStyle = new TStyle(*gROOT->GetStyle("Plain")); // our style is based on Plain
      TMVAStyle->SetName("TMVA");
      TMVAStyle->SetTitle("TMVA style based on \"Plain\" with modifications defined in tmvaglob.C");
      gROOT->GetListOfStyles()->Add(TMVAStyle);
      gROOT->SetStyle("TMVA");
			
      TMVAStyle->SetLineStyleString( 5, "[52 12]" );
      TMVAStyle->SetLineStyleString( 6, "[22 12]" );
      TMVAStyle->SetLineStyleString( 7, "[22 10 7 10]" );

      // the pretty color palette of old
      TMVAStyle->SetPalette((UsePaperStyle ? 18 : 1),0);

      // use plain black on white colors
      TMVAStyle->SetFrameBorderMode(0);
      TMVAStyle->SetCanvasBorderMode(0);
      TMVAStyle->SetPadBorderMode(0);
      TMVAStyle->SetPadColor(0);
      TMVAStyle->SetFillStyle(0);

      TMVAStyle->SetLegendBorderSize(0);

      // title properties
      // TMVAStyle->SetTitleW(.4);
      // TMVAStyle->SetTitleH(.10);
      // MVAStyle->SetTitleX(.5);
      // TMVAStyle->SetTitleY(.9);
      TMVAStyle->SetTitleFillColor( c_TitleBox );
      TMVAStyle->SetTitleTextColor( c_TitleText );
      TMVAStyle->SetTitleBorderSize( 1 );
      TMVAStyle->SetLineColor( c_TitleBorder );
      if (!UsePaperStyle) {
         TMVAStyle->SetFrameFillColor( c_FrameFill );
         TMVAStyle->SetCanvasColor( c_Canvas );
      }

      // set the paper & margin sizes
      TMVAStyle->SetPaperSize(20,26);
      TMVAStyle->SetPadTopMargin(0.10);
      TMVAStyle->SetPadRightMargin(0.05);
      TMVAStyle->SetPadBottomMargin(0.11);
      TMVAStyle->SetPadLeftMargin(0.12);

      // use bold lines and markers
      TMVAStyle->SetMarkerStyle(21);
      TMVAStyle->SetMarkerSize(0.3);
      TMVAStyle->SetHistLineWidth(2);
      TMVAStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes

      // do not display any of the standard histogram decorations
      TMVAStyle->SetOptTitle(1);
      TMVAStyle->SetTitleH(0.052);

      TMVAStyle->SetOptStat(0);
      TMVAStyle->SetOptFit(0);

      // put tick marks on top and RHS of plots
      TMVAStyle->SetPadTickX(1);
      TMVAStyle->SetPadTickY(1);

   }
Example #5
0
void setNCUStyle(bool gridOn=false) {
  TStyle* ncuStyle = new TStyle("ncuStyle","Style for P-NCU");

// For the canvas:
  ncuStyle->SetCanvasBorderMode(0);
  ncuStyle->SetCanvasColor(kWhite);
  ncuStyle->SetCanvasDefH(600); //Height of canvas
  ncuStyle->SetCanvasDefW(600); //Width of canvas
  ncuStyle->SetCanvasDefX(0);   //POsition on screen
  ncuStyle->SetCanvasDefY(0);

// For the Pad:
  ncuStyle->SetPadBorderMode(0);
  // ncuStyle->SetPadBorderSize(Width_t size = 1);
  ncuStyle->SetPadColor(kWhite);
  ncuStyle->SetPadGridX(gridOn);
  ncuStyle->SetPadGridY(gridOn);
  ncuStyle->SetGridColor(0);
  ncuStyle->SetGridStyle(3);
  ncuStyle->SetGridWidth(1);

// For the frame:
  ncuStyle->SetFrameBorderMode(0);
  ncuStyle->SetFrameBorderSize(1);
  ncuStyle->SetFrameFillColor(0);
  ncuStyle->SetFrameFillStyle(0);
  ncuStyle->SetFrameLineColor(1);
  ncuStyle->SetFrameLineStyle(1);
  ncuStyle->SetFrameLineWidth(3);

// For the Legend:
  ncuStyle->SetLegendBorderSize(0);
  ncuStyle->SetLegendFillColor(0);
  ncuStyle->SetLegendFont(42);
  //ncuStyle->SetLegendFont(62);
  
// For the histo:
  // ncuStyle->SetHistFillColor(1);
  // ncuStyle->SetHistFillStyle(0);
  ncuStyle->SetHistLineColor(1);
  ncuStyle->SetHistLineStyle(0);
  ncuStyle->SetHistLineWidth(3);
  // ncuStyle->SetLegoInnerR(Float_t rad = 0.5);
  // ncuStyle->SetNumberContours(Int_t number = 20);

  ncuStyle->SetEndErrorSize(2);
  // ncuStyle->SetErrorMarker(20);
  //ncuStyle->SetErrorX(0.);
  
  ncuStyle->SetMarkerStyle(20);
  
//For the fit/function:
  ncuStyle->SetOptFit(1);
  ncuStyle->SetFitFormat("5.4g");
  ncuStyle->SetFuncColor(2);
  ncuStyle->SetFuncStyle(1);
  ncuStyle->SetFuncWidth(1);

//For the date:
  ncuStyle->SetOptDate(0);
  // ncuStyle->SetDateX(Float_t x = 0.01);
  // ncuStyle->SetDateY(Float_t y = 0.01);

// For the statistics box:
  ncuStyle->SetOptFile(0);
  ncuStyle->SetOptStat(0); // To display the mean and RMS:   SetOptStat("mr");
  ncuStyle->SetStatColor(kWhite);
  ncuStyle->SetStatFont(42);
  ncuStyle->SetStatFontSize(0.025);
  ncuStyle->SetStatTextColor(1);
  ncuStyle->SetStatFormat("6.4g");
  ncuStyle->SetStatBorderSize(1);
  ncuStyle->SetStatH(0.1);
  ncuStyle->SetStatW(0.15);
  // ncuStyle->SetStatStyle(Style_t style = 1001);
  // ncuStyle->SetStatX(Float_t x = 0);
  // ncuStyle->SetStatY(Float_t y = 0);

// Margins:
  ncuStyle->SetPadTopMargin(0.08);
  ncuStyle->SetPadBottomMargin(0.13);
  ncuStyle->SetPadLeftMargin(0.13);
  ncuStyle->SetPadRightMargin(0.04);

// For the Global title:

  ncuStyle->SetOptTitle(0);
  ncuStyle->SetTitleFont(62);
  ncuStyle->SetTitleColor(1);
  ncuStyle->SetTitleTextColor(1);
  ncuStyle->SetTitleFillColor(10);
  ncuStyle->SetTitleFontSize(0.05);
  // ncuStyle->SetTitleH(0); // Set the height of the title box
  // ncuStyle->SetTitleW(0); // Set the width of the title box
  // ncuStyle->SetTitleX(0); // Set the position of the title box
  // ncuStyle->SetTitleY(0.985); // Set the position of the title box
  // ncuStyle->SetTitleStyle(Style_t style = 1001);
  // ncuStyle->SetTitleBorderSize(2);

// For the axis titles:

  ncuStyle->SetTitleColor(1, "XYZ");
  ncuStyle->SetTitleSize(0.06, "XYZ");
  // ncuStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
  // ncuStyle->SetTitleYSize(Float_t size = 0.02);
  // the following commands are not doing any thing
  // ncuStyle->SetTitleOffset(1.5, "X"); // Another way to set the Offset
  // ncuStyle->SetTitleOffset(1.5, "Y"); // Another way to set the Offset
  // ncuStyle->SetTitleFont(42, "XYZ");

// For the axis labels:
  ncuStyle->SetLabelColor(1, "XYZ");
  // the following command is not doing any thing
  // ncuStyle->SetLabelFont(42, "XYZ");
  ncuStyle->SetLabelOffset(0.007, "XYZ");
  ncuStyle->SetLabelSize(0.05, "XYZ");

// For the axis:

  ncuStyle->SetAxisColor(1, "XYZ");
  ncuStyle->SetStripDecimals(kFALSE);
  ncuStyle->SetTickLength(0.03, "XYZ");
  ncuStyle->SetNdivisions(510, "XYZ");
  ncuStyle->SetPadTickX(1);  // To get tick marks on the opposite side of the frame
  ncuStyle->SetPadTickY(1);

// Change for log plots:
  ncuStyle->SetOptLogx(0);
  ncuStyle->SetOptLogy(0);
  ncuStyle->SetOptLogz(0);

// Postscript options:
  ncuStyle->SetPaperSize(20.,20.);
  // ncuStyle->SetLineScalePS(Float_t scale = 3);
  // ncuStyle->SetLineStyleString(Int_t i, const char* text);
  // ncuStyle->SetHeaderPS(const char* header);
  // ncuStyle->SetTitlePS(const char* pstitle);

  // ncuStyle->SetBarOffset(Float_t baroff = 0.5);
  // ncuStyle->SetBarWidth(Float_t barwidth = 0.5);
  // ncuStyle->SetPaintTextFormat(const char* format = "g");
  // ncuStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0);
  // ncuStyle->SetTimeOffset(Double_t toffset);
  // ncuStyle->SetHistMinimumZero(kTRUE);

  ncuStyle->SetHatchesLineWidth(5);
  ncuStyle->SetHatchesSpacing(0.05);

  ncuStyle->cd();

}
Example #6
0
void SetStyle()
{
  TStyle *MITStyle = new TStyle("MIT-Style","The Perfect Style for Plots ;-)");
  gStyle = MITStyle;

  // Canvas
  MITStyle->SetCanvasColor     (0);
  MITStyle->SetCanvasBorderSize(10);
  MITStyle->SetCanvasBorderMode(0);
  MITStyle->SetCanvasDefH      (700);
  MITStyle->SetCanvasDefW      (700);
  MITStyle->SetCanvasDefX      (100);
  MITStyle->SetCanvasDefY      (100);

  // Pads
  MITStyle->SetPadColor       (0);
  MITStyle->SetPadBorderSize  (10);
  MITStyle->SetPadBorderMode  (0);
  MITStyle->SetPadBottomMargin(0.13);
  MITStyle->SetPadTopMargin   (0.08);
  MITStyle->SetPadLeftMargin  (0.15);
  MITStyle->SetPadRightMargin (0.05);
  MITStyle->SetPadGridX       (0);
  MITStyle->SetPadGridY       (0);
  MITStyle->SetPadTickX       (0);
  MITStyle->SetPadTickY       (0);

  // Frames
  MITStyle->SetFrameFillStyle ( 0);
  MITStyle->SetFrameFillColor ( 0);
  MITStyle->SetFrameLineColor ( 1);
  MITStyle->SetFrameLineStyle ( 0);
  MITStyle->SetFrameLineWidth ( 1);
  MITStyle->SetFrameBorderSize(10);
  MITStyle->SetFrameBorderMode( 0);

  // Histograms
  MITStyle->SetHistFillColor(2);
  MITStyle->SetHistFillStyle(0);
  MITStyle->SetHistLineColor(1);
  MITStyle->SetHistLineStyle(0);
  MITStyle->SetHistLineWidth(2);
  MITStyle->SetNdivisions(505);

  // Functions
  MITStyle->SetFuncColor(1);
  MITStyle->SetFuncStyle(0);
  MITStyle->SetFuncWidth(2);

  // Various
  MITStyle->SetMarkerStyle(20);
  MITStyle->SetMarkerColor(kBlack);
  MITStyle->SetMarkerSize (1.2);

  MITStyle->SetTitleSize  (0.055,"X");
  MITStyle->SetTitleOffset(1.200,"X");
  MITStyle->SetLabelOffset(0.005,"X");
  MITStyle->SetLabelSize  (0.050,"X");
  MITStyle->SetLabelFont  (42   ,"X");

  MITStyle->SetStripDecimals(kFALSE);

  MITStyle->SetTitleSize  (0.055,"Y");
  MITStyle->SetTitleOffset(1.800,"Y");
  MITStyle->SetLabelOffset(0.010,"Y");
  MITStyle->SetLabelSize  (0.050,"Y");
  MITStyle->SetLabelFont  (42   ,"Y");

  MITStyle->SetTextSize   (0.055);
  MITStyle->SetTextFont   (42);

  MITStyle->SetStatFont   (42);
  MITStyle->SetTitleFont  (42);
  MITStyle->SetTitleFont  (42,"X");
  MITStyle->SetTitleFont  (42,"Y");

  MITStyle->SetOptStat    (0);
  return;
}
Example #7
0
//-------------------------------------------------------------------------------
void setIStyle() {
  
  TStyle* IStyle = new TStyle("IStyle","Ignazio Style");   
  
  gROOT->Reset();
  gROOT->SetStyle("Plain");

   // For the Global title:
  IStyle->SetOptTitle(1); // In general I want global title!
  IStyle->SetTitleFont(42);
  IStyle->SetTitleColor(1);
  IStyle->SetTitleTextColor(1);
  IStyle->SetTitleFillColor(10);
  IStyle->SetTitleFontSize(0.05);

  IStyle->SetCanvasBorderMode(0);
  IStyle->SetCanvasColor(kWhite);
  IStyle->SetCanvasDefH(400);     //Height of canvas
  IStyle->SetCanvasDefW(600);     //Width of canvas
  IStyle->SetPadBorderMode(0);
  IStyle->SetPadColor(kWhite);
  /*
  // Pad Margins:
  //-----------------------------
  IStyle->SetPadTopMargin(0.05);
  IStyle->SetPadBottomMargin(0.13);
  IStyle->SetPadLeftMargin(0.16);
  IStyle->SetPadRightMargin(0.02);
  */

  // For the frame:
  //-----------------------------
  IStyle->SetFrameBorderMode(0);
  IStyle->SetFrameBorderSize(1);
  IStyle->SetFrameFillColor(kWhite);
  IStyle->SetFrameFillStyle(0);
  IStyle->SetFrameLineColor(1);
  IStyle->SetFrameLineStyle(1);
  IStyle->SetFrameLineWidth(1);

  // For the histo:
  //-----------------------------
  IStyle->SetHistLineWidth(1);
  IStyle->SetHistLineColor(kBlack);
  IStyle->SetEndErrorSize(2);
  IStyle->SetErrorX(0.);
  // IStyle->SetMarkerStyle(kFullDotSmall); 
  // IStyle->SetMarkerStyle(kFullDotMedium); 
  IStyle->SetMarkerStyle(kFullDotLarge);
  // IStyle->SetMarkerStyle(kFullCircle);


  // For the statistics box:
  //-----------------------------
  /*
    gStyle->SetOptStat("option-string");

    Where option string can contain:-
    n ;  name of histogram is printed
    e ;  number of entries printed
    m ;  mean value printed
    r ;  rms printed
    u ;  number of underflows printed
    o ;  number of overflows printed
    i ;  integral of bins printed
    Example: gStyle->SetOptStat("ne");
    print only name of histogram and number of entries.

    To remove it altogther:-

  gStyle->SetOptStat("");
  */
  // IStyle->SetOptStat("emr");        
  /*
  The parameter mode can be = ksiourmen  (default = 000001111)
    k = 1;  kurtosis printed
    k = 2;  kurtosis and kurtosis error printed
    s = 1;  skewness printed
    s = 2;  skewness and skewness error printed
    i = 1;  integral of bins printed
    o = 1;  number of overflows printed
    u = 1;  number of underflows printed
    r = 1;  rms printed
    r = 2;  rms and rms error printed
    m = 1;  mean value printed
    m = 2;  mean and mean error values printed
    e = 1;  number of entries printed
    n = 1;  name of histogram is printed
  Example: gStyle->SetOptStat(11);
           print only name of histogram and number of entries.
           gStyle->SetOptStat(1101);  displays the name of histogram, mean value and RMS.
  WARNING: never call SetOptStat(000111); but SetOptStat(1111), 0001111 will
          be taken as an octal number !!
  WARNING: SetOptStat(1) is taken as SetOptStat(1111) (for back compatibility
           with older versions. If you want to print only the name of the histogram
           call SetOptStat(1000000001).
  NOTE that in case of 2-D histograms, when selecting just underflow (10000)
        or overflow (100000), the stats box will show all combinations
        of underflow/overflows and not just one single number!
  */

  //  IStyle->SetOptStat(1110);  
  IStyle->SetOptStat(0); 

  IStyle->SetStatColor(kWhite);
  IStyle->SetStatFont(42);
 
  // For fitting:
  //-----------------------------
  IStyle->SetFuncWidth(1);         // for the fit function 
  IStyle->SetFuncColor(kBlack);    // for the fit function 
  IStyle->SetOptFit(111);          // IStyle->SetOptFit(0) to get rid of
  IStyle->SetStatW(0.18);          // set width of stat box
  IStyle->SetStatFontSize(0.04);   // set the font size for stat box

  /*
  // Change for log plots:
  IStyle->SetOptLogx(0);
  IStyle->SetOptLogy(0);
  IStyle->SetOptLogz(0)
  */

  // IStyle->SetPalette(1);
  palette();
  IStyle->cd(); // this becomes now the current style gStyle

}