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 11 of file NicePlot.h.

Constructor & Destructor Documentation

Styles::Styles ( )

Definition at line 11 of file NicePlot.cc.

References indexGen::s2.

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

Member Function Documentation

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

Definition at line 58 of file NicePlot.cc.

Referenced by Comparator::Draw().

58  {
59  // h->SetStats(0);
60  h->SetTitle("CMS Preliminary");
61 
62  h->GetYaxis()->SetTitleSize(0.06);
63  h->GetYaxis()->SetTitleOffset(1.2);
64  h->GetXaxis()->SetTitleSize(0.06);
65  h->GetYaxis()->SetLabelSize(0.045);
66  h->GetXaxis()->SetLabelSize(0.045);
67 
68  h->SetLineWidth( s->GetLineWidth() );
69  h->SetLineColor( s->GetLineColor() );
70  h->SetFillStyle( s->GetFillStyle() );
71  h->SetFillColor( s->GetFillColor() );
72 }
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 74 of file NicePlot.cc.

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

Definition at line 91 of file NicePlot.cc.

References dir, and dataset::name.

91  {
92  string eps = dir;
93  eps += "/";
94  eps += name;
95  eps += ".eps";
96  gPad->SaveAs( eps.c_str() );
97 
98  string png = dir;
99  png += "/";
100  png += name;
101  png += ".png";
102  gPad->SaveAs( png.c_str() );
103 
104 }
dbl *** dir
Definition: mlp_gen.cc:35

Member Data Documentation

Style* Styles::s1

Definition at line 13 of file NicePlot.h.

Style* Styles::s2

Definition at line 14 of file NicePlot.h.

Style* Styles::sback

Definition at line 16 of file NicePlot.h.

Style* Styles::sg1

Definition at line 15 of file NicePlot.h.

Style* Styles::sgr1

Definition at line 19 of file NicePlot.h.

Style* Styles::sgr2

Definition at line 20 of file NicePlot.h.

Style* Styles::spblue

Definition at line 18 of file NicePlot.h.

Style* Styles::spred

Definition at line 17 of file NicePlot.h.