Garfield++ v1r0
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

#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 ()
 
virtual ~PlottingEngine ()
 
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 at line 12 of file PlottingEngineRoot.hh.

Constructor & Destructor Documentation

◆ PlottingEngineRoot()

Garfield::PlottingEngineRoot::PlottingEngineRoot ( )

Definition at line 13 of file PlottingEngineRoot.cc.

14 : PlottingEngine(),
15 m_garfieldStyle(NULL) {
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}

◆ ~PlottingEngineRoot()

Garfield::PlottingEngineRoot::~PlottingEngineRoot ( )
virtual

Definition at line 26 of file PlottingEngineRoot.cc.

26 {
27
28 if (m_garfieldStyle != NULL) {
29 delete m_garfieldStyle;
30 m_garfieldStyle = NULL;
31 }
32}

Member Function Documentation

◆ GetRootColor()

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

Definition at line 184 of file PlottingEngineRoot.cc.

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

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

◆ GetRootColorChargedParticle()

int Garfield::PlottingEngineRoot::GetRootColorChargedParticle ( )

Definition at line 174 of file PlottingEngineRoot.cc.

174 {
175
176 int rootcol = 0;
177 if (!GetRootColor(m_colorChargedParticle, rootcol)) {
178 m_colorChargedParticle = m_colorChargedParticleDefault;
180 }
181 return rootcol;
182}
bool GetRootColor(std::string color, int &rootcol)
std::string m_colorChargedParticle

◆ GetRootColorElectron()

int Garfield::PlottingEngineRoot::GetRootColorElectron ( )

Definition at line 134 of file PlottingEngineRoot.cc.

134 {
135
136 int rootcol = 0;
137 if (!GetRootColor(m_colorElectron, rootcol)) {
138 m_colorElectron = m_colorElectronDefault;
140 }
141 return rootcol;
142}

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

◆ GetRootColorHole()

int Garfield::PlottingEngineRoot::GetRootColorHole ( )

Definition at line 144 of file PlottingEngineRoot.cc.

144 {
145
146 int rootcol = 0;
147 if (!GetRootColor(m_colorHole, rootcol)) {
148 m_colorHole = m_colorHoleDefault;
149 GetRootColor(m_colorHole, rootcol);
150 }
151 return rootcol;
152}

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

◆ GetRootColorIon()

int Garfield::PlottingEngineRoot::GetRootColorIon ( )

Definition at line 154 of file PlottingEngineRoot.cc.

154 {
155
156 int rootcol = 0;
157 if (!GetRootColor(m_colorIon, rootcol)) {
158 m_colorIon = m_colorIonDefault;
159 GetRootColor(m_colorIon, rootcol);
160 }
161 return rootcol;
162}

◆ GetRootColorLine1()

int Garfield::PlottingEngineRoot::GetRootColorLine1 ( )

Definition at line 114 of file PlottingEngineRoot.cc.

114 {
115
116 int rootcol = 0;
117 if (!GetRootColor(m_colorLine1, rootcol)) {
118 m_colorLine1 = m_colorLine1Default;
119 GetRootColor(m_colorLine1, rootcol);
120 }
121 return rootcol;
122}

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

◆ GetRootColorLine2()

int Garfield::PlottingEngineRoot::GetRootColorLine2 ( )

Definition at line 124 of file PlottingEngineRoot.cc.

124 {
125
126 int rootcol = 0;
127 if (!GetRootColor(m_colorLine2, rootcol)) {
128 m_colorLine2 = m_colorLine2Default;
129 GetRootColor(m_colorLine2, rootcol);
130 }
131 return rootcol;
132}

◆ GetRootColorPhoton()

int Garfield::PlottingEngineRoot::GetRootColorPhoton ( )

Definition at line 164 of file PlottingEngineRoot.cc.

164 {
165
166 int rootcol = 0;
167 if (!GetRootColor(m_colorPhoton, rootcol)) {
168 m_colorPhoton = m_colorPhotonDefault;
169 GetRootColor(m_colorPhoton, rootcol);
170 }
171 return rootcol;
172}

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

◆ SetDefaultStyle()

void Garfield::PlottingEngineRoot::SetDefaultStyle ( )

Definition at line 34 of file PlottingEngineRoot.cc.

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

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: