Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::PlottingEngine Class Reference

Plotting style. More...

#include <PlottingEngine.hh>

Public Member Functions

 PlottingEngine ()
 Default constructor.
 
 ~PlottingEngine ()=default
 Destructor.
 
void SetSerif ()
 Use serif font.
 
void SetSansSerif ()
 Use sans-serif font.
 
void SetPalette (int ncol)
 Set the colour palette.
 
void SetDefaultStyle ()
 Apply the default Garfield ROOT style.
 

Detailed Description

Plotting style.

Definition at line 10 of file PlottingEngine.hh.

Constructor & Destructor Documentation

◆ PlottingEngine()

Garfield::PlottingEngine::PlottingEngine ( )

Default constructor.

Definition at line 15 of file PlottingEngine.cc.

16 : m_garfieldStyle("Garfield", "Garfield Style") {}

◆ ~PlottingEngine()

Garfield::PlottingEngine::~PlottingEngine ( )
default

Destructor.

Member Function Documentation

◆ SetDefaultStyle()

void Garfield::PlottingEngine::SetDefaultStyle ( )

Apply the default Garfield ROOT style.

Definition at line 18 of file PlottingEngine.cc.

18 {
19 m_garfieldStyle.Reset();
20 m_garfieldStyle.SetFillColor(1);
21 m_garfieldStyle.SetFillStyle(1001);
22 m_garfieldStyle.SetCanvasBorderMode(0);
23 m_garfieldStyle.SetCanvasColor(0);
24 m_garfieldStyle.SetCanvasDefH(600);
25 m_garfieldStyle.SetCanvasDefW(600);
26 m_garfieldStyle.SetPadBorderMode(0);
27 m_garfieldStyle.SetPadColor(0);
28 m_garfieldStyle.SetPadLeftMargin(0.15);
29 m_garfieldStyle.SetPadBottomMargin(0.1);
30 m_garfieldStyle.SetPadRightMargin(0.05);
31 m_garfieldStyle.SetPadTopMargin(0.05);
32 m_garfieldStyle.SetPadTickX(1);
33 m_garfieldStyle.SetPadTickY(1);
34 m_garfieldStyle.SetFrameFillColor(0);
35 m_garfieldStyle.SetFrameBorderMode(0);
36 m_garfieldStyle.SetDrawBorder(0);
37 m_garfieldStyle.SetLegendBorderSize(0);
38
39 m_garfieldStyle.SetGridColor(kGray);
40 m_garfieldStyle.SetGridStyle(3);
41 m_garfieldStyle.SetGridWidth(1);
42 m_garfieldStyle.SetPadGridX(kTRUE);
43 m_garfieldStyle.SetPadGridY(kTRUE);
44
45 const short font = m_serif ? 132 : 42;
46 const double tsize = 0.04;
47 m_garfieldStyle.SetTextFont(font);
48 m_garfieldStyle.SetTextSize(tsize);
49 m_garfieldStyle.SetTitleStyle(0);
50 m_garfieldStyle.SetTitleBorderSize(0);
51 m_garfieldStyle.SetTitleColor(1, "xyz");
52 m_garfieldStyle.SetTitleColor(1, "t");
53 m_garfieldStyle.SetTitleFillColor(0);
54 m_garfieldStyle.SetTitleFont(font, "xyz");
55 m_garfieldStyle.SetTitleFont(font, "t");
56 m_garfieldStyle.SetTitleOffset(1.2, "x");
57 m_garfieldStyle.SetTitleOffset(0, "y");
58 m_garfieldStyle.SetTitleSize(tsize, "xyz");
59 m_garfieldStyle.SetTitleSize(tsize, "t");
60
61 m_garfieldStyle.SetLegendFont(font);
62 m_garfieldStyle.SetStatStyle(0);
63 m_garfieldStyle.SetStatBorderSize(0);
64 m_garfieldStyle.SetStatColor(0);
65 m_garfieldStyle.SetStatFont(font);
66 m_garfieldStyle.SetStatFontSize(tsize);
67 m_garfieldStyle.SetStatX(0.88);
68 m_garfieldStyle.SetStatY(0.88);
69 m_garfieldStyle.SetStatW(0.25);
70 m_garfieldStyle.SetStatH(0.1);
71 m_garfieldStyle.SetOptStat(111110);
72 m_garfieldStyle.SetStatFormat("6.3g");
73 m_garfieldStyle.SetLabelFont(font, "xyz");
74 m_garfieldStyle.SetLabelSize(tsize, "xyz");
75 m_garfieldStyle.SetLabelOffset(0.01, "xyz");
76 m_garfieldStyle.SetOptTitle(0);
77 m_garfieldStyle.SetPaperSize(TStyle::kA4);
78 m_garfieldStyle.SetFuncWidth(2);
79 m_garfieldStyle.SetHistLineColor(kOrange - 3);
80 if (m_palette > 0) m_garfieldStyle.SetPalette(m_palette);
81 m_garfieldStyle.SetAxisColor(kBlack, "X");
82 m_garfieldStyle.SetAxisColor(kBlack, "Y");
83 m_garfieldStyle.SetAxisColor(kBlack, "Z");
84 m_garfieldStyle.SetNdivisions(505, "x");
85 m_garfieldStyle.SetNdivisions(510, "y");
86 m_garfieldStyle.SetMarkerStyle(20);
87 m_garfieldStyle.SetMarkerSize(1.2);
88 const short lw = 2;
89 m_garfieldStyle.SetLineWidth(lw);
90 m_garfieldStyle.SetLineStyleString(2, "[12 12]");
91 m_garfieldStyle.SetFrameLineWidth(lw);
92 m_garfieldStyle.SetHistLineWidth(lw);
93 m_garfieldStyle.SetFuncWidth(lw);
94 m_garfieldStyle.SetGridWidth(lw);
95 m_garfieldStyle.cd();
96}

Referenced by main(), Garfield::SetDefaultStyle(), and Garfield::ViewBase::ViewBase().

◆ SetPalette()

void Garfield::PlottingEngine::SetPalette ( int  ncol)
inline

Set the colour palette.

Definition at line 23 of file PlottingEngine.hh.

23{ m_palette = ncol; }

◆ SetSansSerif()

void Garfield::PlottingEngine::SetSansSerif ( )
inline

Use sans-serif font.

Definition at line 20 of file PlottingEngine.hh.

20{ m_serif = false; }

◆ SetSerif()

void Garfield::PlottingEngine::SetSerif ( )
inline

Use serif font.

Definition at line 18 of file PlottingEngine.hh.

18{ m_serif = true; }

The documentation for this class was generated from the following files: