CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Public Attributes
Styles Class Reference

#include <NicePlot.h>

Public Member Functions

 Styles ()
 

Static Public Member Functions

static void FormatHisto (TH1 *h, const Style *s)
 
static void FormatPad (TPad *pad, bool grid=true, bool logx=false, bool logy=false)
 
static void SavePlot (const char *name, const char *dir)
 

Public Attributes

Styles1
 
Styles2
 
Stylesback
 
Stylesg1
 
Stylesgr1
 
Stylesgr2
 
Stylespblue
 
Stylespred
 

Detailed Description

Definition at line 9 of file NicePlot.h.

Constructor & Destructor Documentation

Styles::Styles ( )

Definition at line 9 of file NicePlot.cc.

References indexGen::s2.

9  {
10  gROOT->SetStyle("Plain");
11  gStyle->SetPalette(1);
12  gStyle->SetHistMinimumZero(kTRUE);
13 
14  s1 = new Style();
15 
16  s1->SetLineWidth(2);
17  s1->SetLineColor(1);
18 
19  s2 = new Style();
20 
21  s2->SetLineWidth(2);
22  s2->SetLineColor(4);
23 
24  sg1 = new Style();
25 
26  sg1->SetMarkerColor(4);
27  sg1->SetLineColor(4);
28  sg1->SetLineWidth(2);
29  sg1->SetMarkerStyle(21);
30 
31  sback = new Style();
32  sback->SetFillStyle(1001);
33  sback->SetFillColor(5);
34 
35  spred = new Style();
36  spred->SetLineColor(2);
37  spred->SetLineWidth(2);
38  spred->SetFillStyle(1001);
39  spred->SetFillColor(kRed - 8);
40 
41  spblue = new Style();
42  spblue->SetLineColor(4);
43  spblue->SetLineWidth(2);
44 
45  sgr1 = new Style();
46  sgr1->SetLineWidth(1);
47  sgr1->SetLineColor(1);
48 
49  sgr2 = new Style();
50  sgr2->SetLineWidth(1);
51  sgr2->SetLineColor(1);
52 }
Style * sgr1
Definition: NicePlot.h:17
Style * s2
Definition: NicePlot.h:12
Style * spred
Definition: NicePlot.h:15
Style * sback
Definition: NicePlot.h:14
Style * s1
Definition: NicePlot.h:11
Style * sgr2
Definition: NicePlot.h:18
Definition: Style.py:1
Style * sg1
Definition: NicePlot.h:13
Style * spblue
Definition: NicePlot.h:16

Member Function Documentation

void Styles::FormatHisto ( TH1 *  h,
const Style s 
)
static

Definition at line 54 of file NicePlot.cc.

Referenced by Comparator::Draw().

54  {
55  // h->SetStats(0);
56  h->SetTitle("CMS Preliminary");
57 
58  h->GetYaxis()->SetTitleSize(0.06);
59  h->GetYaxis()->SetTitleOffset(1.2);
60  h->GetXaxis()->SetTitleSize(0.06);
61  h->GetYaxis()->SetLabelSize(0.045);
62  h->GetXaxis()->SetLabelSize(0.045);
63 
64  h->SetLineWidth(s->GetLineWidth());
65  h->SetLineColor(s->GetLineColor());
66  h->SetFillStyle(s->GetFillStyle());
67  h->SetFillColor(s->GetFillColor());
68 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void Styles::FormatPad ( TPad *  pad,
bool  grid = true,
bool  logx = false,
bool  logy = false 
)
static

Definition at line 70 of file NicePlot.cc.

70  {
71  pad->SetGridx(grid);
72  pad->SetGridy(grid);
73 
74  if (logx)
75  pad->SetLogx();
76  if (logy)
77  pad->SetLogy();
78 
79  pad->SetBottomMargin(0.14);
80  pad->SetLeftMargin(0.15);
81  pad->SetRightMargin(0.05);
82  pad->Modified();
83  pad->Update();
84 }
void Styles::SavePlot ( const char *  name,
const char *  dir 
)
static

Definition at line 86 of file NicePlot.cc.

References dir, and dataset::name.

86  {
87  string eps = dir;
88  eps += "/";
89  eps += name;
90  eps += ".eps";
91  gPad->SaveAs(eps.c_str());
92 
93  string png = dir;
94  png += "/";
95  png += name;
96  png += ".png";
97  gPad->SaveAs(png.c_str());
98 }
dbl *** dir
Definition: mlp_gen.cc:35

Member Data Documentation

Style* Styles::s1

Definition at line 11 of file NicePlot.h.

Style* Styles::s2

Definition at line 12 of file NicePlot.h.

Style* Styles::sback

Definition at line 14 of file NicePlot.h.

Style* Styles::sg1

Definition at line 13 of file NicePlot.h.

Style* Styles::sgr1

Definition at line 17 of file NicePlot.h.

Style* Styles::sgr2

Definition at line 18 of file NicePlot.h.

Style* Styles::spblue

Definition at line 16 of file NicePlot.h.

Style* Styles::spred

Definition at line 15 of file NicePlot.h.