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

Definition of styles and color schemes. More...

#include <PlottingEngineRoot.hh>

+ Inheritance diagram for Garfield::PlottingEngineRoot:

Public Member Functions

 PlottingEngineRoot ()
 
virtual ~PlottingEngineRoot ()
 
void SetDefaultStyle ()
 
int GetRootColorLine1 ()
 
int GetRootColorLine2 ()
 
int GetRootColorElectron ()
 
int GetRootColorHole ()
 
int GetRootColorIon ()
 
int GetRootColorPhoton ()
 
int GetRootColorChargedParticle ()
 
bool GetRootColor (std::string color, int &rootcol)
 
- Public Member Functions inherited from Garfield::PlottingEngine
 PlottingEngine ()
 Constructor.
 
virtual ~PlottingEngine ()
 Destructor.
 
void SetLineColor1 (const std::string &col)
 
void SetLineColor2 (const std::string &col)
 
void SetElectronColor (const std::string &col)
 
void SetHoleColor (const std::string &col)
 
void SetIonColor (const std::string &col)
 
void SetPhotonColor (const std::string &col)
 
void SetChargedParticleColor (const std::string &col)
 
std::string GetLineColor1 () const
 
std::string GetLineColor2 () const
 
std::string GetElectronColor () const
 
std::string GetHoleColor () const
 
std::string GetIonColor () const
 
std::string GetPhotonColor () const
 
std::string GetChargedParticleColor () const
 
void EnableDebugging ()
 
void DisableDebugging ()
 

Additional Inherited Members

- Protected Attributes inherited from Garfield::PlottingEngine
std::string m_className
 
std::string m_colorLine1
 
std::string m_colorLine2
 
std::string m_colorElectron
 
std::string m_colorHole
 
std::string m_colorIon
 
std::string m_colorPhoton
 
std::string m_colorChargedParticle
 
bool m_debug
 

Detailed Description

Definition of styles and color schemes.

Definition at line 14 of file PlottingEngineRoot.hh.

Constructor & Destructor Documentation

◆ PlottingEngineRoot()

Garfield::PlottingEngineRoot::PlottingEngineRoot ( )

Definition at line 13 of file PlottingEngineRoot.cc.

14 : PlottingEngine(),
15 m_garfieldStyle("Garfield", "Garfield Style") {
16
17 m_colorElectronDefault = "orange";
18 m_colorHoleDefault = "red";
19 m_colorIonDefault = "dark-red";
20 m_colorPhotonDefault = "blue";
21 m_colorChargedParticleDefault = "dark-green";
22 m_colorLine1Default = "dark-blue";
23 m_colorLine2Default = "olive";
24}
PlottingEngine()
Constructor.

◆ ~PlottingEngineRoot()

Garfield::PlottingEngineRoot::~PlottingEngineRoot ( )
virtual

Definition at line 26 of file PlottingEngineRoot.cc.

26{}

Member Function Documentation

◆ GetRootColor()

bool Garfield::PlottingEngineRoot::GetRootColor ( std::string  color,
int &  rootcol 
)

Definition at line 181 of file PlottingEngineRoot.cc.

181 {
182
183 rootcol = kBlack;
184
185 // Convert to upper-case.
186 for (unsigned int i = 0; i < color.length(); ++i) {
187 color[i] = toupper(color[i]);
188 }
189
190 if (color == "BLACK") {
191 rootcol = kBlack;
192 return true;
193 }
194 if (color == "RED") {
195 rootcol = kRed + 1;
196 return true;
197 } else if (color == "GREEN") {
198 rootcol = kGreen + 2;
199 return true;
200 } else if (color == "BLUE") {
201 rootcol = kBlue + 2;
202 return true;
203 } else if (color == "DARK-RED") {
204 rootcol = kRed + 3;
205 return true;
206 } else if (color == "DARK-GREEN") {
207 rootcol = kGreen + 3;
208 return true;
209 } else if (color == "DARK-BLUE") {
210 rootcol = kBlue + 3;
211 return true;
212 } else if (color == "ORANGE") {
213 rootcol = kOrange - 3;
214 return true;
215 } else if (color == "PURPLE") {
216 rootcol = kViolet - 7;
217 return true;
218 } else if (color == "CYAN") {
219 rootcol = kCyan + 3;
220 return true;
221 } else if (color == "OLIVE") {
222 rootcol = kSpring + 4;
223 return true;
224 }
225 if (m_debug) {
226 std::cerr << m_className << "::GetRootColor:\n";
227 std::cerr << " Unknown color (" << color << ").\n";
228 }
229 return false;
230}

Referenced by GetRootColorChargedParticle(), GetRootColorElectron(), GetRootColorHole(), GetRootColorIon(), GetRootColorLine1(), GetRootColorLine2(), and GetRootColorPhoton().

◆ GetRootColorChargedParticle()

int Garfield::PlottingEngineRoot::GetRootColorChargedParticle ( )

Definition at line 171 of file PlottingEngineRoot.cc.

171 {
172
173 int rootcol = 0;
174 if (!GetRootColor(m_colorChargedParticle, rootcol)) {
175 m_colorChargedParticle = m_colorChargedParticleDefault;
177 }
178 return rootcol;
179}
bool GetRootColor(std::string color, int &rootcol)
std::string m_colorChargedParticle

◆ GetRootColorElectron()

int Garfield::PlottingEngineRoot::GetRootColorElectron ( )

Definition at line 131 of file PlottingEngineRoot.cc.

131 {
132
133 int rootcol = 0;
134 if (!GetRootColor(m_colorElectron, rootcol)) {
135 m_colorElectron = m_colorElectronDefault;
137 }
138 return rootcol;
139}

Referenced by Garfield::ViewDrift::NewElectronDriftLine(), and Garfield::ViewSignal::PlotSignal().

◆ GetRootColorHole()

int Garfield::PlottingEngineRoot::GetRootColorHole ( )

Definition at line 141 of file PlottingEngineRoot.cc.

141 {
142
143 int rootcol = 0;
144 if (!GetRootColor(m_colorHole, rootcol)) {
145 m_colorHole = m_colorHoleDefault;
146 GetRootColor(m_colorHole, rootcol);
147 }
148 return rootcol;
149}

Referenced by Garfield::ViewDrift::NewHoleDriftLine().

◆ GetRootColorIon()

int Garfield::PlottingEngineRoot::GetRootColorIon ( )

Definition at line 151 of file PlottingEngineRoot.cc.

151 {
152
153 int rootcol = 0;
154 if (!GetRootColor(m_colorIon, rootcol)) {
155 m_colorIon = m_colorIonDefault;
156 GetRootColor(m_colorIon, rootcol);
157 }
158 return rootcol;
159}

Referenced by Garfield::ViewSignal::PlotSignal().

◆ GetRootColorLine1()

int Garfield::PlottingEngineRoot::GetRootColorLine1 ( )

Definition at line 111 of file PlottingEngineRoot.cc.

111 {
112
113 int rootcol = 0;
114 if (!GetRootColor(m_colorLine1, rootcol)) {
115 m_colorLine1 = m_colorLine1Default;
116 GetRootColor(m_colorLine1, rootcol);
117 }
118 return rootcol;
119}

Referenced by Garfield::ViewSignal::PlotSignal().

◆ GetRootColorLine2()

int Garfield::PlottingEngineRoot::GetRootColorLine2 ( )

Definition at line 121 of file PlottingEngineRoot.cc.

121 {
122
123 int rootcol = 0;
124 if (!GetRootColor(m_colorLine2, rootcol)) {
125 m_colorLine2 = m_colorLine2Default;
126 GetRootColor(m_colorLine2, rootcol);
127 }
128 return rootcol;
129}

◆ GetRootColorPhoton()

int Garfield::PlottingEngineRoot::GetRootColorPhoton ( )

Definition at line 161 of file PlottingEngineRoot.cc.

161 {
162
163 int rootcol = 0;
164 if (!GetRootColor(m_colorPhoton, rootcol)) {
165 m_colorPhoton = m_colorPhotonDefault;
166 GetRootColor(m_colorPhoton, rootcol);
167 }
168 return rootcol;
169}

Referenced by Garfield::ViewDrift::NewPhotonTrack().

◆ SetDefaultStyle()

void Garfield::PlottingEngineRoot::SetDefaultStyle ( )

Definition at line 28 of file PlottingEngineRoot.cc.

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

Referenced by Garfield::ViewCell::ViewCell(), Garfield::ViewFEMesh::ViewFEMesh(), Garfield::ViewField::ViewField(), Garfield::ViewGeometry::ViewGeometry(), Garfield::ViewMedium::ViewMedium(), and Garfield::ViewSignal::ViewSignal().


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