CMS 3D CMS Logo

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

#include <TkAlStyle.h>

Static Public Member Functions

static TPaveText * customRightTitle (const TString &txt)
 
static TPaveText * customTitle (const TString &txt)
 
static void drawStandardTitle ()
 
static void drawStandardTitle (const Era era)
 
static TPaveText * label (const int nEntries, const double relWidth=0.5)
 
static TPaveText * label (TString position, const int nEntries, const double relWidth=0.5)
 
static TPaveText * labelBL (const int nEntries, const double relWidth=0.5)
 
static TPaveText * labelBR (const int nEntries, const double relWidth=0.5)
 
static TPaveText * labelTL (const int nEntries, const double relWidth=0.5)
 
static TPaveText * labelTR (const int nEntries, const double relWidth=0.5)
 
static TLegend * legend (const int nEntries, const double relWidth=0.5)
 
static TLegend * legend (TString position, const int nEntries, const double relWidth=0.5)
 
static TLegend * legendBL (const int nEntries, const double relWidth=0.5)
 
static TLegend * legendBR (const int nEntries, const double relWidth=0.5)
 
static TLegend * legendTL (const int nEntries, const double relWidth=0.5)
 
static TLegend * legendTR (const int nEntries, const double relWidth=0.5)
 
static double lineHeight ()
 
static void set (const PublicationStatus status, const Era era=NONE, const TString customTitle="", const TString customRightTitle="")
 
static void set (const TString customTitle)
 
static TPaveText * standardRightTitle (const Era era)
 
static TPaveText * standardRightTitle ()
 
static TPaveText * standardTitle (PublicationStatus status)
 
static TPaveText * standardTitle ()
 
static PublicationStatus status ()
 
static PublicationStatus toStatus (std::string _status)
 

Static Public Attributes

static TString legendheader = ""
 
static TString legendoptions = "all"
 
static double textSize = 0.035
 

Static Private Member Functions

static TString applyCMS (const TString &txt)
 
static TString header (const PublicationStatus status)
 
static TPaveText * label (const int nEntries, const double relWidth, const bool leftt, const bool top)
 
static TLegend * legend (const int nEntries, const double relWidth, const bool left, const bool top)
 
static TString rightheader (const Era era)
 
static TPaveText * righttitle (const TString &txt)
 
static void setXCoordinatesL (const double relWidth, double &x0, double &x1)
 
static void setXCoordinatesR (const double relWidth, double &x0, double &x1)
 
static void setYCoordinatesB (const int nEntries, double &y0, double &y1)
 
static void setYCoordinatesT (const int nEntries, double &y0, double &y1)
 
static TPaveText * title (const TString &txt)
 

Static Private Attributes

static TString customRightTitle_ = ""
 
static TString customTitle_ = ""
 
static Era era_ = NONE
 
static double lineHeight_ = 0.042
 
static double margin_ = 0.04
 
static PublicationStatus publicationStatus_ = NO_STATUS
 

Detailed Description

Definition at line 45 of file TkAlStyle.h.

Member Function Documentation

◆ applyCMS()

TString TkAlStyle::applyCMS ( const TString &  txt)
staticprivate

Definition at line 156 of file TkAlStyle.cc.

Referenced by righttitle(), and title().

156  {
157  TString newtxt = txt;
158  newtxt.ReplaceAll("#CMS{", "#scale[1.4]{#font[61]{CMS}} #font[52]{");
159  newtxt.ReplaceAll("#noCMS{", "#font[52]{");
160  newtxt.ReplaceAll("#CMS", "#scale[1.4]{#font[61]{CMS}}");
161  return newtxt;
162 }

◆ customRightTitle()

static TPaveText* TkAlStyle::customRightTitle ( const TString &  txt)
inlinestatic

Definition at line 89 of file TkAlStyle.h.

References righttitle().

Referenced by set().

89 { return righttitle(txt); }
static TPaveText * righttitle(const TString &txt)
Definition: TkAlStyle.cc:186

◆ customTitle()

static TPaveText* TkAlStyle::customTitle ( const TString &  txt)
inlinestatic

Definition at line 88 of file TkAlStyle.h.

References title().

Referenced by set().

88 { return title(txt); }
static TPaveText * title(const TString &txt)
Definition: TkAlStyle.cc:165

◆ drawStandardTitle() [1/2]

static void TkAlStyle::drawStandardTitle ( )
inlinestatic

Definition at line 65 of file TkAlStyle.h.

References standardRightTitle(), and standardTitle().

Referenced by CompareAlignments::MergeRootfile(), overlapValidationPlot::plot(), and PlotAlignmentValidation::setTitleStyle().

65  {
66  standardTitle()->Draw("same");
67  standardRightTitle()->Draw("same");
68  }
static TPaveText * standardRightTitle()
Definition: TkAlStyle.h:84
static TPaveText * standardTitle()
Definition: TkAlStyle.h:81

◆ drawStandardTitle() [2/2]

static void TkAlStyle::drawStandardTitle ( const Era  era)
inlinestatic

Definition at line 69 of file TkAlStyle.h.

References standardRightTitle(), and standardTitle().

69  {
70  standardTitle()->Draw("same");
71  standardRightTitle(era)->Draw("same");
72  }
static TPaveText * standardRightTitle()
Definition: TkAlStyle.h:84
static TPaveText * standardTitle()
Definition: TkAlStyle.h:81

◆ header()

TString TkAlStyle::header ( const PublicationStatus  status)
staticprivate

Definition at line 206 of file TkAlStyle.cc.

References gather_cfg::cout, CUSTOM, customTitle_, INTERNAL, INTERNAL_SIMULATION, NO_STATUS, PRELIMINARY, PUBLIC, SIMULATION, status(), and UNPUBLISHED.

Referenced by standardTitle().

206  {
207  TString txt;
208  if (status == NO_STATUS) {
209  std::cout << "Status not set yet! Can't draw the title!" << std::endl;
210  } else if (status == INTERNAL_SIMULATION) {
211  txt = "#noCMS{Simulation}";
212  } else if (status == INTERNAL) {
213  txt = "#CMS{Internal}";
214  } else if (status == PRELIMINARY) {
215  txt = "#CMS{Preliminary}";
216  } else if (status == PUBLIC) {
217  txt = "#CMS";
218  } else if (status == SIMULATION) {
219  txt = "#CMS{Simulation}";
220  } else if (status == UNPUBLISHED) {
221  txt = "#CMS{(unpublished)}";
222  } else if (status == CUSTOM) {
223  txt = customTitle_;
224  }
225 
226  return txt;
227 }
static TString customTitle_
Definition: TkAlStyle.h:181
static PublicationStatus status()
Definition: TkAlStyle.h:53

◆ label() [1/3]

static TPaveText* TkAlStyle::label ( const int  nEntries,
const double  relWidth = 0.5 
)
inlinestatic

Definition at line 138 of file TkAlStyle.h.

References labelTR().

Referenced by label(), labelBL(), labelBR(), labelTL(), and labelTR().

138 { return labelTR(nEntries, relWidth); }
static TPaveText * labelTR(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:166

◆ label() [2/3]

static TPaveText* TkAlStyle::label ( TString  position,
const int  nEntries,
const double  relWidth = 0.5 
)
inlinestatic

Definition at line 140 of file TkAlStyle.h.

References label(), labelBL(), labelBR(), labelTL(), labelTR(), and position.

140  {
141  position.ToLower();
142  if (!(position.Contains("top") || position.Contains("bottom")))
143  position += "top";
144  if (!(position.Contains("left") || position.Contains("right")))
145  position += "right";
146  TPaveText* label = nullptr;
147  if (position.Contains("top") && position.Contains("right")) {
148  label = labelTR(nEntries, relWidth);
149  } else if (position.Contains("top") && position.Contains("left")) {
150  label = labelTL(nEntries, relWidth);
151  } else if (position.Contains("bottom") && position.Contains("right")) {
152  label = labelBR(nEntries, relWidth);
153  } else if (position.Contains("bottom") && position.Contains("left")) {
154  label = labelBL(nEntries, relWidth);
155  } else {
156  label = labelTR(nEntries, relWidth);
157  }
158 
159  return label;
160  }
static TPaveText * labelBR(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:172
static TPaveText * labelBL(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:169
static TPaveText * labelTR(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:166
static TPaveText * label(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:138
static int position[264][3]
Definition: ReadPGInfo.cc:289
static TPaveText * labelTL(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:163

◆ label() [3/3]

TPaveText * TkAlStyle::label ( const int  nEntries,
const double  relWidth,
const bool  leftt,
const bool  top 
)
staticprivate

Definition at line 125 of file TkAlStyle.cc.

References label(), setXCoordinatesL(), setXCoordinatesR(), setYCoordinatesB(), setYCoordinatesT(), textSize, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::y1.

125  {
126  double x0 = 0.;
127  double x1 = 0.;
128  double y0 = 0.;
129  double y1 = 0.;
130  if (left)
131  setXCoordinatesL(relWidth, x0, x1);
132  else
133  setXCoordinatesR(relWidth, x0, x1);
134  if (top)
135  setYCoordinatesT(nEntries, y0, y1);
136  else
137  setYCoordinatesB(nEntries, y0, y1);
138 
139  TPaveText* label = new TPaveText(x0, y0, x1, y1, "NDC");
140  label->SetBorderSize(0);
141  label->SetFillColor(0);
142  label->SetFillStyle(0);
143  label->SetTextFont(42);
144  label->SetTextAlign(12); // left adjusted and vertically centered
145  label->SetTextSize(textSize);
146  label->SetMargin(0.);
147 
148  return label;
149 }
static void setYCoordinatesB(const int nEntries, double &y0, double &y1)
Definition: TkAlStyle.cc:91
static double textSize
Definition: TkAlStyle.h:93
static void setYCoordinatesT(const int nEntries, double &y0, double &y1)
Definition: TkAlStyle.cc:85
static void setXCoordinatesL(const double relWidth, double &x0, double &x1)
Definition: TkAlStyle.cc:72
static TPaveText * label(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:138
static void setXCoordinatesR(const double relWidth, double &x0, double &x1)
Definition: TkAlStyle.cc:78

◆ labelBL()

static TPaveText* TkAlStyle::labelBL ( const int  nEntries,
const double  relWidth = 0.5 
)
inlinestatic

Definition at line 169 of file TkAlStyle.h.

References label().

Referenced by label().

169  {
170  return label(nEntries, relWidth, true, false);
171  }
static TPaveText * label(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:138

◆ labelBR()

static TPaveText* TkAlStyle::labelBR ( const int  nEntries,
const double  relWidth = 0.5 
)
inlinestatic

Definition at line 172 of file TkAlStyle.h.

References label().

Referenced by label().

172  {
173  return label(nEntries, relWidth, false, false);
174  }
static TPaveText * label(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:138

◆ labelTL()

static TPaveText* TkAlStyle::labelTL ( const int  nEntries,
const double  relWidth = 0.5 
)
inlinestatic

Definition at line 163 of file TkAlStyle.h.

References label().

Referenced by label().

163  {
164  return label(nEntries, relWidth, true, true);
165  }
static TPaveText * label(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:138

◆ labelTR()

static TPaveText* TkAlStyle::labelTR ( const int  nEntries,
const double  relWidth = 0.5 
)
inlinestatic

Definition at line 166 of file TkAlStyle.h.

References label().

Referenced by label().

166  {
167  return label(nEntries, relWidth, false, true);
168  }
static TPaveText * label(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:138

◆ legend() [1/3]

static TLegend* TkAlStyle::legend ( const int  nEntries,
const double  relWidth = 0.5 
)
inlinestatic

Definition at line 98 of file TkAlStyle.h.

References legendTR().

Referenced by legendBL(), legendBR(), legendTL(), legendTR(), and overlapValidationPlot::plot().

98 { return legendTR(nEntries, relWidth); }
static TLegend * legendTR(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:124

◆ legend() [2/3]

static TLegend* TkAlStyle::legend ( TString  position,
const int  nEntries,
const double  relWidth = 0.5 
)
inlinestatic

Definition at line 99 of file TkAlStyle.h.

References legendBL(), legendBR(), legendTL(), legendTR(), and position.

99  {
100  position.ToLower();
101  if (!(position.Contains("top") || position.Contains("bottom")))
102  position += "top";
103  if (!(position.Contains("left") || position.Contains("right")))
104  position += "right";
105  TLegend* leg = nullptr;
106  if (position.Contains("top") && position.Contains("right")) {
107  leg = legendTR(nEntries, relWidth);
108  } else if (position.Contains("top") && position.Contains("left")) {
109  leg = legendTL(nEntries, relWidth);
110  } else if (position.Contains("bottom") && position.Contains("right")) {
111  leg = legendBR(nEntries, relWidth);
112  } else if (position.Contains("bottom") && position.Contains("left")) {
113  leg = legendBL(nEntries, relWidth);
114  } else {
115  leg = legendTR(nEntries, relWidth);
116  }
117 
118  return leg;
119  }
static TLegend * legendBR(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:130
static TLegend * legendBL(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:127
static TLegend * legendTR(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:124
static int position[264][3]
Definition: ReadPGInfo.cc:289
static TLegend * legendTL(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:121

◆ legend() [3/3]

TLegend * TkAlStyle::legend ( const int  nEntries,
const double  relWidth,
const bool  left,
const bool  top 
)
staticprivate

Definition at line 97 of file TkAlStyle.cc.

References legendheader, setXCoordinatesL(), setXCoordinatesR(), setYCoordinatesB(), setYCoordinatesT(), textSize, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::y1.

97  {
98  double x0 = 0.;
99  double x1 = 0.;
100  double y0 = 0.;
101  double y1 = 0.;
102  bool hasheader = (TkAlStyle::legendheader != "");
103  if (left)
104  setXCoordinatesL(relWidth, x0, x1);
105  else
106  setXCoordinatesR(relWidth, x0, x1);
107  if (top)
108  setYCoordinatesT(nEntries + hasheader, y0, y1);
109  else
110  setYCoordinatesB(nEntries + hasheader, y0, y1);
111 
112  TLegend* leg = new TLegend(x0, y0, x1, y1);
113  leg->SetBorderSize(0);
114  leg->SetFillColor(0);
115  leg->SetFillStyle(0);
116  leg->SetTextFont(42);
117  leg->SetTextSize(textSize);
118  if (hasheader)
119  leg->SetHeader(TkAlStyle::legendheader);
120 
121  return leg;
122 }
static void setYCoordinatesB(const int nEntries, double &y0, double &y1)
Definition: TkAlStyle.cc:91
static double textSize
Definition: TkAlStyle.h:93
static void setYCoordinatesT(const int nEntries, double &y0, double &y1)
Definition: TkAlStyle.cc:85
static TString legendheader
Definition: TkAlStyle.h:91
static void setXCoordinatesL(const double relWidth, double &x0, double &x1)
Definition: TkAlStyle.cc:72
static void setXCoordinatesR(const double relWidth, double &x0, double &x1)
Definition: TkAlStyle.cc:78

◆ legendBL()

static TLegend* TkAlStyle::legendBL ( const int  nEntries,
const double  relWidth = 0.5 
)
inlinestatic

Definition at line 127 of file TkAlStyle.h.

References legend().

Referenced by legend().

127  {
128  return legend(nEntries, relWidth, true, false);
129  }
static TLegend * legend(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:98

◆ legendBR()

static TLegend* TkAlStyle::legendBR ( const int  nEntries,
const double  relWidth = 0.5 
)
inlinestatic

Definition at line 130 of file TkAlStyle.h.

References legend().

Referenced by legend().

130  {
131  return legend(nEntries, relWidth, false, false);
132  }
static TLegend * legend(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:98

◆ legendTL()

static TLegend* TkAlStyle::legendTL ( const int  nEntries,
const double  relWidth = 0.5 
)
inlinestatic

Definition at line 121 of file TkAlStyle.h.

References legend().

Referenced by legend().

121  {
122  return legend(nEntries, relWidth, true, true);
123  }
static TLegend * legend(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:98

◆ legendTR()

static TLegend* TkAlStyle::legendTR ( const int  nEntries,
const double  relWidth = 0.5 
)
inlinestatic

Definition at line 124 of file TkAlStyle.h.

References legend().

Referenced by legend().

124  {
125  return legend(nEntries, relWidth, false, true);
126  }
static TLegend * legend(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:98

◆ lineHeight()

static double TkAlStyle::lineHeight ( )
inlinestatic

Definition at line 176 of file TkAlStyle.h.

References lineHeight_.

176 { return lineHeight_; }
static double lineHeight_
Definition: TkAlStyle.h:183

◆ rightheader()

TString TkAlStyle::rightheader ( const Era  era)
staticprivate

Definition at line 229 of file TkAlStyle.cc.

References customRightTitle_, NONE, and toTString().

Referenced by standardRightTitle().

229  {
230  TString txt = "";
231  if (era != NONE) {
232  txt = toTString(era);
233  } else {
234  txt = customRightTitle_;
235  }
236  return txt;
237 }
static TString customRightTitle_
Definition: TkAlStyle.h:182
TString toTString(const PublicationStatus status)
Definition: TkAlStyle.cc:3
Definition: TkAlStyle.h:43

◆ righttitle()

TPaveText * TkAlStyle::righttitle ( const TString &  txt)
staticprivate

Definition at line 186 of file TkAlStyle.cc.

References applyCMS(), testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::y1.

Referenced by customRightTitle(), and standardRightTitle().

186  {
187  TString newtxt = applyCMS(txt);
188  double x0 = gStyle->GetPadLeftMargin();
189  double x1 = 1. - gStyle->GetPadRightMargin();
190  double y0 = 1. - gStyle->GetPadTopMargin();
191  double y1 = 1.;
192  TPaveText* theTitle = new TPaveText(x0, y0, x1, y1, "NDC");
193  theTitle->SetBorderSize(0);
194  theTitle->SetFillColor(10);
195  theTitle->SetFillStyle(0);
196  theTitle->SetTextFont(42);
197  theTitle->SetTextAlign(33); // right bottom adjusted
198  theTitle->SetTextSize(0.038);
199  theTitle->SetMargin(0.);
200  theTitle->AddText(newtxt);
201 
202  return theTitle;
203 }
static TString applyCMS(const TString &txt)
Definition: TkAlStyle.cc:156

◆ set() [1/2]

void TkAlStyle::set ( const PublicationStatus  status,
const Era  era = NONE,
const TString  customTitle = "",
const TString  customRightTitle = "" 
)
static

Definition at line 240 of file TkAlStyle.cc.

References gather_cfg::cout, CUSTOM, customRightTitle(), customRightTitle_, customTitle(), customTitle_, era_, utils::gErrorIgnoreLevel, publicationStatus_, and status().

Referenced by CompareAlignments::doComparison(), betterConfigParser.BetterConfigParser::getGeneral(), and merge().

243  {
244  // Store the PublicationStatus for later usage, e.g. in the title
248  era_ = era;
249  if (publicationStatus_ == CUSTOM && customTitle_ == "")
250  std::cout << "Error: you are trying to use a custom title, but you don't provide it" << std::endl;
251  if (publicationStatus_ != CUSTOM && customTitle_ != "")
252  std::cout
253  << "Error: you provide a custom title, but you don't indicate CUSTOM status. Your title will not be used."
254  << std::endl;
255 
256  // Suppress message when canvas has been saved
257  gErrorIgnoreLevel = 1001;
258 
259  // Zero horizontal error bars
260  gStyle->SetErrorX(0);
261 
262  // For the canvas
263  gStyle->SetCanvasBorderMode(0);
264  gStyle->SetCanvasColor(kWhite);
265  gStyle->SetCanvasDefH(800); //Height of canvas
266  gStyle->SetCanvasDefW(800); //Width of canvas
267  gStyle->SetCanvasDefX(0); //Position on screen
268  gStyle->SetCanvasDefY(0);
269 
270  // For the frame
271  gStyle->SetFrameBorderMode(0);
272  gStyle->SetFrameBorderSize(10);
273  gStyle->SetFrameFillColor(kBlack);
274  gStyle->SetFrameFillStyle(0);
275  gStyle->SetFrameLineColor(kBlack);
276  gStyle->SetFrameLineStyle(0);
277  gStyle->SetFrameLineWidth(2);
278  gStyle->SetLineWidth(3);
279 
280  // For the Pad
281  gStyle->SetPadBorderMode(0);
282  gStyle->SetPadColor(kWhite);
283  gStyle->SetPadGridX(false);
284  gStyle->SetPadGridY(false);
285  gStyle->SetGridColor(0);
286  gStyle->SetGridStyle(3);
287  gStyle->SetGridWidth(1);
288 
289  // Margins
290  gStyle->SetPadTopMargin(0.08);
291  gStyle->SetPadBottomMargin(0.13);
292  gStyle->SetPadLeftMargin(0.16);
293  gStyle->SetPadRightMargin(0.05);
294 
295  // For the histo:
296  gStyle->SetHistLineColor(kBlack);
297  gStyle->SetHistLineStyle(0);
298  gStyle->SetHistLineWidth(3);
299  gStyle->SetMarkerSize(0.8);
300  gStyle->SetEndErrorSize(4);
301  gStyle->SetHatchesLineWidth(1);
302 
303  // For the statistics box:
304  gStyle->SetOptStat(0);
305 
306  // For the axis
307  gStyle->SetAxisColor(1, "XYZ");
308  gStyle->SetTickLength(0.03, "XYZ");
309  gStyle->SetNdivisions(510, "XYZ");
310  gStyle->SetPadTickX(1);
311  gStyle->SetPadTickY(1);
312  gStyle->SetStripDecimals(kFALSE);
313 
314  // For the axis labels and titles
315  gStyle->SetTitleColor(1, "XYZ");
316  gStyle->SetLabelColor(1, "XYZ");
317  gStyle->SetLabelFont(42, "XYZ");
318  gStyle->SetLabelOffset(0.007, "XYZ");
319  gStyle->SetLabelSize(0.04, "XYZ");
320  gStyle->SetTitleFont(42, "XYZ");
321  gStyle->SetTitleSize(0.047, "XYZ");
322  gStyle->SetTitleXOffset(1.2);
323  gStyle->SetTitleYOffset(1.5);
324 
325  // For the legend
326  gStyle->SetLegendBorderSize(0);
327 }
static TString customTitle_
Definition: TkAlStyle.h:181
static TPaveText * customTitle(const TString &txt)
Definition: TkAlStyle.h:88
static PublicationStatus status()
Definition: TkAlStyle.h:53
static Era era_
Definition: TkAlStyle.h:180
static TString customRightTitle_
Definition: TkAlStyle.h:182
static PublicationStatus publicationStatus_
Definition: TkAlStyle.h:179
static TPaveText * customRightTitle(const TString &txt)
Definition: TkAlStyle.h:89
gErrorIgnoreLevel
Definition: utils.py:27

◆ set() [2/2]

void TkAlStyle::set ( const TString  customTitle)
static

Definition at line 329 of file TkAlStyle.cc.

References CUSTOM, customTitle(), and NONE.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

329 { set(CUSTOM, NONE, customTitle); }
static TPaveText * customTitle(const TString &txt)
Definition: TkAlStyle.h:88
Definition: TkAlStyle.h:43

◆ setXCoordinatesL()

void TkAlStyle::setXCoordinatesL ( const double  relWidth,
double &  x0,
double &  x1 
)
staticprivate

Definition at line 72 of file TkAlStyle.cc.

References margin_, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by label(), and legend().

72  {
73  x0 = gStyle->GetPadLeftMargin() + margin_;
74  x1 = x0 + relWidth * (1. - gStyle->GetPadLeftMargin() - gStyle->GetPadRightMargin() - 2. * margin_);
75 }
static double margin_
Definition: TkAlStyle.h:184

◆ setXCoordinatesR()

void TkAlStyle::setXCoordinatesR ( const double  relWidth,
double &  x0,
double &  x1 
)
staticprivate

Definition at line 78 of file TkAlStyle.cc.

References margin_, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by label(), and legend().

78  {
79  x0 = 1. - gStyle->GetPadRightMargin() - margin_ -
80  relWidth * (1. - gStyle->GetPadLeftMargin() - gStyle->GetPadRightMargin() - 2. * margin_);
81  x1 = 1. - gStyle->GetPadRightMargin() - margin_;
82 }
static double margin_
Definition: TkAlStyle.h:184

◆ setYCoordinatesB()

void TkAlStyle::setYCoordinatesB ( const int  nEntries,
double &  y0,
double &  y1 
)
staticprivate

Definition at line 91 of file TkAlStyle.cc.

References lineHeight_, margin_, and testProducerWithPsetDescEmpty_cfi::y1.

Referenced by label(), and legend().

91  {
92  y1 = gStyle->GetPadBottomMargin() + margin_;
93  y0 = y1 + nEntries * lineHeight_;
94 }
static double lineHeight_
Definition: TkAlStyle.h:183
static double margin_
Definition: TkAlStyle.h:184

◆ setYCoordinatesT()

void TkAlStyle::setYCoordinatesT ( const int  nEntries,
double &  y0,
double &  y1 
)
staticprivate

Definition at line 85 of file TkAlStyle.cc.

References lineHeight_, margin_, and testProducerWithPsetDescEmpty_cfi::y1.

Referenced by label(), and legend().

85  {
86  y1 = 1. - gStyle->GetPadTopMargin() - margin_;
87  y0 = y1 - nEntries * lineHeight_;
88 }
static double lineHeight_
Definition: TkAlStyle.h:183
static double margin_
Definition: TkAlStyle.h:184

◆ standardRightTitle() [1/2]

static TPaveText* TkAlStyle::standardRightTitle ( const Era  era)
inlinestatic

Definition at line 83 of file TkAlStyle.h.

References rightheader(), and righttitle().

83 { return righttitle(rightheader(era)); }
static TPaveText * righttitle(const TString &txt)
Definition: TkAlStyle.cc:186
static TString rightheader(const Era era)
Definition: TkAlStyle.cc:229

◆ standardRightTitle() [2/2]

static TPaveText* TkAlStyle::standardRightTitle ( )
inlinestatic

Definition at line 84 of file TkAlStyle.h.

References era_, and standardRightTitle().

Referenced by drawStandardTitle(), and standardRightTitle().

84 { return standardRightTitle(era_); }
static Era era_
Definition: TkAlStyle.h:180
static TPaveText * standardRightTitle()
Definition: TkAlStyle.h:84

◆ standardTitle() [1/2]

static TPaveText* TkAlStyle::standardTitle ( PublicationStatus  status)
inlinestatic

Definition at line 80 of file TkAlStyle.h.

References header(), status(), and title().

80 { return title(header(status)); }
static PublicationStatus status()
Definition: TkAlStyle.h:53
static TPaveText * title(const TString &txt)
Definition: TkAlStyle.cc:165
static TString header(const PublicationStatus status)
Definition: TkAlStyle.cc:206

◆ standardTitle() [2/2]

static TPaveText* TkAlStyle::standardTitle ( )
inlinestatic

Definition at line 81 of file TkAlStyle.h.

References publicationStatus_, and standardTitle().

Referenced by drawStandardTitle(), and standardTitle().

static PublicationStatus publicationStatus_
Definition: TkAlStyle.h:179
static TPaveText * standardTitle()
Definition: TkAlStyle.h:81

◆ status()

static PublicationStatus TkAlStyle::status ( )
inlinestatic

Definition at line 53 of file TkAlStyle.h.

References publicationStatus_.

Referenced by header(), set(), standardTitle(), and toStatus().

53 { return publicationStatus_; }
static PublicationStatus publicationStatus_
Definition: TkAlStyle.h:179

◆ title()

TPaveText * TkAlStyle::title ( const TString &  txt)
staticprivate

Definition at line 165 of file TkAlStyle.cc.

References applyCMS(), testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::y1.

Referenced by customTitle(), and standardTitle().

165  {
166  double x0 = gStyle->GetPadLeftMargin();
167  double x1 = 1. - gStyle->GetPadRightMargin();
168  double y0 = 1. - gStyle->GetPadTopMargin();
169  double y1 = 1.;
170  if (txt.Contains("#CMS"))
171  y0 += .02;
172  TPaveText* theTitle = new TPaveText(x0, y0, x1, y1, "NDC");
173  theTitle->SetBorderSize(0);
174  theTitle->SetFillColor(10);
175  theTitle->SetFillStyle(0);
176  theTitle->SetTextFont(42);
177  theTitle->SetTextAlign(13); // left bottom adjusted
178  theTitle->SetTextSize(0.038);
179  theTitle->SetMargin(0.);
180  theTitle->AddText(applyCMS(txt));
181 
182  return theTitle;
183 }
static TString applyCMS(const TString &txt)
Definition: TkAlStyle.cc:156

◆ toStatus()

PublicationStatus TkAlStyle::toStatus ( std::string  _status)
static

Definition at line 48 of file TkAlStyle.cc.

References HltBtagPostValidation_cff::c, CUSTOM, INTERNAL, INTERNAL_SIMULATION, NO_STATUS, PRELIMINARY, PUBLIC, SIMULATION, status(), and UNPUBLISHED.

Referenced by merge().

48  {
50  std::for_each(status.begin(), status.end(), [](char& c) { c = ::toupper(c); });
51  if (status == "NO_STATUS")
52  st = NO_STATUS;
53  else if (status == "INTERNAL")
54  st = INTERNAL;
55  else if (status == "SIMULATION (INTERNAL)")
57  else if (status == "PRELIMINARY")
58  st = PRELIMINARY;
59  else if (status == "PUBLIC")
60  st = PUBLIC;
61  else if (status == "SIMULATION")
62  st = SIMULATION;
63  else if (status == "UNPUBLISHED")
64  st = UNPUBLISHED;
65  else
66  st = CUSTOM;
67 
68  return st;
69 }
static PublicationStatus status()
Definition: TkAlStyle.h:53
PublicationStatus
Definition: TkAlStyle.h:31

Member Data Documentation

◆ customRightTitle_

TString TkAlStyle::customRightTitle_ = ""
staticprivate

Definition at line 182 of file TkAlStyle.h.

Referenced by rightheader(), and set().

◆ customTitle_

TString TkAlStyle::customTitle_ = ""
staticprivate

Definition at line 181 of file TkAlStyle.h.

Referenced by header(), and set().

◆ era_

Era TkAlStyle::era_ = NONE
staticprivate

Definition at line 180 of file TkAlStyle.h.

Referenced by set(), and standardRightTitle().

◆ legendheader

TString TkAlStyle::legendheader = ""
static

◆ legendoptions

TString TkAlStyle::legendoptions = "all"
static

Definition at line 92 of file TkAlStyle.h.

Referenced by merge(), and PlotAlignmentValidation::PlotAlignmentValidation().

◆ lineHeight_

double TkAlStyle::lineHeight_ = 0.042
staticprivate

Definition at line 183 of file TkAlStyle.h.

Referenced by lineHeight(), setYCoordinatesB(), and setYCoordinatesT().

◆ margin_

double TkAlStyle::margin_ = 0.04
staticprivate

◆ publicationStatus_

PublicationStatus TkAlStyle::publicationStatus_ = NO_STATUS
staticprivate

Definition at line 179 of file TkAlStyle.h.

Referenced by set(), standardTitle(), and status().

◆ textSize

double TkAlStyle::textSize = 0.035
static