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 int color (const AlignObj obj)
 
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 int style (const AlignObj obj)
 
static PublicationStatus toStatus (std::string _status)
 
static TString toTString (const PublicationStatus status)
 
static TString toTString (const Era era)
 
static TString toTString (const AlignObj obj)
 

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 48 of file TkAlStyle.h.

Member Function Documentation

◆ applyCMS()

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

Definition at line 191 of file TkAlStyle.cc.

Referenced by righttitle(), and title().

191  {
192  TString newtxt = txt;
193  newtxt.ReplaceAll("#CMS{", "#scale[1.4]{#font[61]{CMS}} #font[52]{");
194  newtxt.ReplaceAll("#noCMS{", "#font[52]{");
195  newtxt.ReplaceAll("#CMS", "#scale[1.4]{#font[61]{CMS}}");
196  return newtxt;
197 }

◆ color()

int TkAlStyle::color ( const AlignObj  obj)
static

Definition at line 54 of file TkAlStyle.cc.

References cuy::col, Coll0TAlign, CRAFTAlign, CRUZETAlign, IDEALAlign, getGTfromDQMFile::obj, and RUN1Align.

54  {
55  int col = 1;
56  if (obj == IDEALAlign)
57  col = kGray + 1;
58  else if (obj == RUN1Align)
59  col = kBlack;
60  else if (obj == CRUZETAlign)
61  col = kGreen + 2;
62  else if (obj == CRAFTAlign)
63  col = kBlue;
64  else if (obj == Coll0TAlign)
65  col = kRed;
66 
67  return col;
68 }
col
Definition: cuy.py:1009

◆ customRightTitle()

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

Definition at line 99 of file TkAlStyle.h.

References righttitle().

Referenced by set().

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

◆ customTitle()

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

Definition at line 98 of file TkAlStyle.h.

References title().

Referenced by set().

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

◆ drawStandardTitle() [1/2]

static void TkAlStyle::drawStandardTitle ( )
inlinestatic

Definition at line 75 of file TkAlStyle.h.

References standardRightTitle(), and standardTitle().

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

75  {
76  standardTitle()->Draw("same");
77  standardRightTitle()->Draw("same");
78  }
static TPaveText * standardRightTitle()
Definition: TkAlStyle.h:94
static TPaveText * standardTitle()
Definition: TkAlStyle.h:91

◆ drawStandardTitle() [2/2]

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

Definition at line 79 of file TkAlStyle.h.

References standardRightTitle(), and standardTitle().

79  {
80  standardTitle()->Draw("same");
81  standardRightTitle(era)->Draw("same");
82  }
static TPaveText * standardRightTitle()
Definition: TkAlStyle.h:94
static TPaveText * standardTitle()
Definition: TkAlStyle.h:91

◆ header()

TString TkAlStyle::header ( const PublicationStatus  status)
staticprivate

Definition at line 241 of file TkAlStyle.cc.

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

Referenced by standardTitle().

241  {
242  TString txt;
243  if (status == NO_STATUS) {
244  std::cout << "Status not set yet! Can't draw the title!" << std::endl;
245  } else if (status == INTERNAL_SIMULATION) {
246  txt = "#noCMS{Simulation}";
247  } else if (status == INTERNAL) {
248  txt = "#CMS{Internal}";
249  } else if (status == PRELIMINARY) {
250  txt = "#CMS{Preliminary}";
251  } else if (status == PUBLIC) {
252  txt = "#CMS";
253  } else if (status == SIMULATION) {
254  txt = "#CMS{Simulation}";
255  } else if (status == UNPUBLISHED) {
256  txt = "#CMS{(unpublished)}";
257  } else if (status == CUSTOM) {
258  txt = customTitle_;
259  }
260 
261  return txt;
262 }
static TString customTitle_
Definition: TkAlStyle.h:191
static PublicationStatus status()
Definition: TkAlStyle.h:56

◆ label() [1/3]

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

Definition at line 148 of file TkAlStyle.h.

References labelTR().

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

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

◆ label() [2/3]

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

Definition at line 150 of file TkAlStyle.h.

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

150  {
151  position.ToLower();
152  if (!(position.Contains("top") || position.Contains("bottom")))
153  position += "top";
154  if (!(position.Contains("left") || position.Contains("right")))
155  position += "right";
156  TPaveText* label = nullptr;
157  if (position.Contains("top") && position.Contains("right")) {
158  label = labelTR(nEntries, relWidth);
159  } else if (position.Contains("top") && position.Contains("left")) {
160  label = labelTL(nEntries, relWidth);
161  } else if (position.Contains("bottom") && position.Contains("right")) {
162  label = labelBR(nEntries, relWidth);
163  } else if (position.Contains("bottom") && position.Contains("left")) {
164  label = labelBL(nEntries, relWidth);
165  } else {
166  label = labelTR(nEntries, relWidth);
167  }
168 
169  return label;
170  }
static TPaveText * labelBR(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:182
static TPaveText * labelBL(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:179
static TPaveText * labelTR(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:176
static TPaveText * label(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:148
static int position[264][3]
Definition: ReadPGInfo.cc:289
static TPaveText * labelTL(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:173

◆ label() [3/3]

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

Definition at line 160 of file TkAlStyle.cc.

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

160  {
161  double x0 = 0.;
162  double x1 = 0.;
163  double y0 = 0.;
164  double y1 = 0.;
165  if (left)
166  setXCoordinatesL(relWidth, x0, x1);
167  else
168  setXCoordinatesR(relWidth, x0, x1);
169  if (top)
170  setYCoordinatesT(nEntries, y0, y1);
171  else
172  setYCoordinatesB(nEntries, y0, y1);
173 
174  TPaveText* label = new TPaveText(x0, y0, x1, y1, "NDC");
175  label->SetBorderSize(0);
176  label->SetFillColor(0);
177  label->SetFillStyle(0);
178  label->SetTextFont(42);
179  label->SetTextAlign(12); // left adjusted and vertically centered
180  label->SetTextSize(textSize);
181  label->SetMargin(0.);
182 
183  return label;
184 }
static void setYCoordinatesB(const int nEntries, double &y0, double &y1)
Definition: TkAlStyle.cc:126
static double textSize
Definition: TkAlStyle.h:103
static void setYCoordinatesT(const int nEntries, double &y0, double &y1)
Definition: TkAlStyle.cc:120
static void setXCoordinatesL(const double relWidth, double &x0, double &x1)
Definition: TkAlStyle.cc:107
static TPaveText * label(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:148
static void setXCoordinatesR(const double relWidth, double &x0, double &x1)
Definition: TkAlStyle.cc:113

◆ labelBL()

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

Definition at line 179 of file TkAlStyle.h.

References label().

Referenced by label().

179  {
180  return label(nEntries, relWidth, true, false);
181  }
static TPaveText * label(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:148

◆ labelBR()

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

Definition at line 182 of file TkAlStyle.h.

References label().

Referenced by label().

182  {
183  return label(nEntries, relWidth, false, false);
184  }
static TPaveText * label(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:148

◆ labelTL()

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

Definition at line 173 of file TkAlStyle.h.

References label().

Referenced by label().

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

◆ labelTR()

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

Definition at line 176 of file TkAlStyle.h.

References label().

Referenced by label().

176  {
177  return label(nEntries, relWidth, false, true);
178  }
static TPaveText * label(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:148

◆ legend() [1/3]

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

Definition at line 108 of file TkAlStyle.h.

References legendTR().

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

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

◆ legend() [2/3]

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

Definition at line 109 of file TkAlStyle.h.

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

109  {
110  position.ToLower();
111  if (!(position.Contains("top") || position.Contains("bottom")))
112  position += "top";
113  if (!(position.Contains("left") || position.Contains("right")))
114  position += "right";
115  TLegend* leg = nullptr;
116  if (position.Contains("top") && position.Contains("right")) {
117  leg = legendTR(nEntries, relWidth);
118  } else if (position.Contains("top") && position.Contains("left")) {
119  leg = legendTL(nEntries, relWidth);
120  } else if (position.Contains("bottom") && position.Contains("right")) {
121  leg = legendBR(nEntries, relWidth);
122  } else if (position.Contains("bottom") && position.Contains("left")) {
123  leg = legendBL(nEntries, relWidth);
124  } else {
125  leg = legendTR(nEntries, relWidth);
126  }
127 
128  return leg;
129  }
static TLegend * legendBR(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:140
static TLegend * legendBL(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:137
static TLegend * legendTR(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:134
static int position[264][3]
Definition: ReadPGInfo.cc:289
static TLegend * legendTL(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:131

◆ legend() [3/3]

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

Definition at line 132 of file TkAlStyle.cc.

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

132  {
133  double x0 = 0.;
134  double x1 = 0.;
135  double y0 = 0.;
136  double y1 = 0.;
137  bool hasheader = (TkAlStyle::legendheader != "");
138  if (left)
139  setXCoordinatesL(relWidth, x0, x1);
140  else
141  setXCoordinatesR(relWidth, x0, x1);
142  if (top)
143  setYCoordinatesT(nEntries + hasheader, y0, y1);
144  else
145  setYCoordinatesB(nEntries + hasheader, y0, y1);
146 
147  TLegend* leg = new TLegend(x0, y0, x1, y1);
148  leg->SetBorderSize(0);
149  leg->SetFillColor(0);
150  leg->SetFillStyle(0);
151  leg->SetTextFont(42);
152  leg->SetTextSize(textSize);
153  if (hasheader)
154  leg->SetHeader(TkAlStyle::legendheader);
155 
156  return leg;
157 }
static void setYCoordinatesB(const int nEntries, double &y0, double &y1)
Definition: TkAlStyle.cc:126
static double textSize
Definition: TkAlStyle.h:103
static void setYCoordinatesT(const int nEntries, double &y0, double &y1)
Definition: TkAlStyle.cc:120
static TString legendheader
Definition: TkAlStyle.h:101
static void setXCoordinatesL(const double relWidth, double &x0, double &x1)
Definition: TkAlStyle.cc:107
static void setXCoordinatesR(const double relWidth, double &x0, double &x1)
Definition: TkAlStyle.cc:113

◆ legendBL()

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

Definition at line 137 of file TkAlStyle.h.

References legend().

Referenced by legend().

137  {
138  return legend(nEntries, relWidth, true, false);
139  }
static TLegend * legend(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:108

◆ legendBR()

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

Definition at line 140 of file TkAlStyle.h.

References legend().

Referenced by legend().

140  {
141  return legend(nEntries, relWidth, false, false);
142  }
static TLegend * legend(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:108

◆ legendTL()

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

Definition at line 131 of file TkAlStyle.h.

References legend().

Referenced by legend().

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

◆ legendTR()

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

Definition at line 134 of file TkAlStyle.h.

References legend().

Referenced by legend().

134  {
135  return legend(nEntries, relWidth, false, true);
136  }
static TLegend * legend(const int nEntries, const double relWidth=0.5)
Definition: TkAlStyle.h:108

◆ lineHeight()

static double TkAlStyle::lineHeight ( )
inlinestatic

Definition at line 186 of file TkAlStyle.h.

References lineHeight_.

186 { return lineHeight_; }
static double lineHeight_
Definition: TkAlStyle.h:193

◆ rightheader()

TString TkAlStyle::rightheader ( const Era  era)
staticprivate

Definition at line 264 of file TkAlStyle.cc.

References customRightTitle_, NONE, and toTString().

Referenced by standardRightTitle().

264  {
265  TString txt = "";
266  if (era != NONE) {
267  txt = toTString(era);
268  } else {
269  txt = customRightTitle_;
270  }
271  return txt;
272 }
static TString customRightTitle_
Definition: TkAlStyle.h:192
static TString toTString(const PublicationStatus status)
Definition: TkAlStyle.cc:3
Definition: TkAlStyle.h:43

◆ righttitle()

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

Definition at line 221 of file TkAlStyle.cc.

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

Referenced by customRightTitle(), and standardRightTitle().

221  {
222  TString newtxt = applyCMS(txt);
223  double x0 = gStyle->GetPadLeftMargin();
224  double x1 = 1. - gStyle->GetPadRightMargin();
225  double y0 = 1. - gStyle->GetPadTopMargin();
226  double y1 = 1.;
227  TPaveText* theTitle = new TPaveText(x0, y0, x1, y1, "NDC");
228  theTitle->SetBorderSize(0);
229  theTitle->SetFillColor(10);
230  theTitle->SetFillStyle(0);
231  theTitle->SetTextFont(42);
232  theTitle->SetTextAlign(33); // right bottom adjusted
233  theTitle->SetTextSize(0.038);
234  theTitle->SetMargin(0.);
235  theTitle->AddText(newtxt);
236 
237  return theTitle;
238 }
static TString applyCMS(const TString &txt)
Definition: TkAlStyle.cc:191

◆ set() [1/2]

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

Definition at line 275 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().

278  {
279  // Store the PublicationStatus for later usage, e.g. in the title
283  era_ = era;
284  if (publicationStatus_ == CUSTOM && customTitle_ == "")
285  std::cout << "Error: you are trying to use a custom title, but you don't provide it" << std::endl;
286  if (publicationStatus_ != CUSTOM && customTitle_ != "")
287  std::cout
288  << "Error: you provide a custom title, but you don't indicate CUSTOM status. Your title will not be used."
289  << std::endl;
290 
291  // Suppress message when canvas has been saved
292  gErrorIgnoreLevel = 1001;
293 
294  // Zero horizontal error bars
295  gStyle->SetErrorX(0);
296 
297  // For the canvas
298  gStyle->SetCanvasBorderMode(0);
299  gStyle->SetCanvasColor(kWhite);
300  gStyle->SetCanvasDefH(800); //Height of canvas
301  gStyle->SetCanvasDefW(800); //Width of canvas
302  gStyle->SetCanvasDefX(0); //Position on screen
303  gStyle->SetCanvasDefY(0);
304 
305  // For the frame
306  gStyle->SetFrameBorderMode(0);
307  gStyle->SetFrameBorderSize(10);
308  gStyle->SetFrameFillColor(kBlack);
309  gStyle->SetFrameFillStyle(0);
310  gStyle->SetFrameLineColor(kBlack);
311  gStyle->SetFrameLineStyle(0);
312  gStyle->SetFrameLineWidth(2);
313  gStyle->SetLineWidth(3);
314 
315  // For the Pad
316  gStyle->SetPadBorderMode(0);
317  gStyle->SetPadColor(kWhite);
318  gStyle->SetPadGridX(false);
319  gStyle->SetPadGridY(false);
320  gStyle->SetGridColor(0);
321  gStyle->SetGridStyle(3);
322  gStyle->SetGridWidth(1);
323 
324  // Margins
325  gStyle->SetPadTopMargin(0.08);
326  gStyle->SetPadBottomMargin(0.13);
327  gStyle->SetPadLeftMargin(0.16);
328  gStyle->SetPadRightMargin(0.05);
329 
330  // For the histo:
331  gStyle->SetHistLineColor(kBlack);
332  gStyle->SetHistLineStyle(0);
333  gStyle->SetHistLineWidth(3);
334  gStyle->SetMarkerSize(0.8);
335  gStyle->SetEndErrorSize(4);
336  gStyle->SetHatchesLineWidth(1);
337 
338  // For the statistics box:
339  gStyle->SetOptStat(0);
340 
341  // For the axis
342  gStyle->SetAxisColor(1, "XYZ");
343  gStyle->SetTickLength(0.03, "XYZ");
344  gStyle->SetNdivisions(510, "XYZ");
345  gStyle->SetPadTickX(1);
346  gStyle->SetPadTickY(1);
347  gStyle->SetStripDecimals(kFALSE);
348 
349  // For the axis labels and titles
350  gStyle->SetTitleColor(1, "XYZ");
351  gStyle->SetLabelColor(1, "XYZ");
352  gStyle->SetLabelFont(42, "XYZ");
353  gStyle->SetLabelOffset(0.007, "XYZ");
354  gStyle->SetLabelSize(0.04, "XYZ");
355  gStyle->SetTitleFont(42, "XYZ");
356  gStyle->SetTitleSize(0.047, "XYZ");
357  gStyle->SetTitleXOffset(1.2);
358  gStyle->SetTitleYOffset(1.5);
359 
360  // For the legend
361  gStyle->SetLegendBorderSize(0);
362 }
static TString customTitle_
Definition: TkAlStyle.h:191
static TPaveText * customTitle(const TString &txt)
Definition: TkAlStyle.h:98
static PublicationStatus status()
Definition: TkAlStyle.h:56
static Era era_
Definition: TkAlStyle.h:190
static TString customRightTitle_
Definition: TkAlStyle.h:192
static PublicationStatus publicationStatus_
Definition: TkAlStyle.h:189
static TPaveText * customRightTitle(const TString &txt)
Definition: TkAlStyle.h:99
gErrorIgnoreLevel
Definition: utils.py:27

◆ set() [2/2]

void TkAlStyle::set ( const TString  customTitle)
static

Definition at line 364 of file TkAlStyle.cc.

References CUSTOM, customTitle(), and NONE.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

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

◆ setXCoordinatesL()

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

Definition at line 107 of file TkAlStyle.cc.

References margin_, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by label(), and legend().

107  {
108  x0 = gStyle->GetPadLeftMargin() + margin_;
109  x1 = x0 + relWidth * (1. - gStyle->GetPadLeftMargin() - gStyle->GetPadRightMargin() - 2. * margin_);
110 }
static double margin_
Definition: TkAlStyle.h:194

◆ setXCoordinatesR()

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

Definition at line 113 of file TkAlStyle.cc.

References margin_, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by label(), and legend().

113  {
114  x0 = 1. - gStyle->GetPadRightMargin() - margin_ -
115  relWidth * (1. - gStyle->GetPadLeftMargin() - gStyle->GetPadRightMargin() - 2. * margin_);
116  x1 = 1. - gStyle->GetPadRightMargin() - margin_;
117 }
static double margin_
Definition: TkAlStyle.h:194

◆ setYCoordinatesB()

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

Definition at line 126 of file TkAlStyle.cc.

References lineHeight_, margin_, and testProducerWithPsetDescEmpty_cfi::y1.

Referenced by label(), and legend().

126  {
127  y1 = gStyle->GetPadBottomMargin() + margin_;
128  y0 = y1 + nEntries * lineHeight_;
129 }
static double lineHeight_
Definition: TkAlStyle.h:193
static double margin_
Definition: TkAlStyle.h:194

◆ setYCoordinatesT()

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

Definition at line 120 of file TkAlStyle.cc.

References lineHeight_, margin_, and testProducerWithPsetDescEmpty_cfi::y1.

Referenced by label(), and legend().

120  {
121  y1 = 1. - gStyle->GetPadTopMargin() - margin_;
122  y0 = y1 - nEntries * lineHeight_;
123 }
static double lineHeight_
Definition: TkAlStyle.h:193
static double margin_
Definition: TkAlStyle.h:194

◆ standardRightTitle() [1/2]

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

Definition at line 93 of file TkAlStyle.h.

References rightheader(), and righttitle().

93 { return righttitle(rightheader(era)); }
static TPaveText * righttitle(const TString &txt)
Definition: TkAlStyle.cc:221
static TString rightheader(const Era era)
Definition: TkAlStyle.cc:264

◆ standardRightTitle() [2/2]

static TPaveText* TkAlStyle::standardRightTitle ( )
inlinestatic

Definition at line 94 of file TkAlStyle.h.

References era_, and standardRightTitle().

Referenced by drawStandardTitle(), and standardRightTitle().

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

◆ standardTitle() [1/2]

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

Definition at line 90 of file TkAlStyle.h.

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

90 { return title(header(status)); }
static PublicationStatus status()
Definition: TkAlStyle.h:56
static TPaveText * title(const TString &txt)
Definition: TkAlStyle.cc:200
static TString header(const PublicationStatus status)
Definition: TkAlStyle.cc:241

◆ standardTitle() [2/2]

static TPaveText* TkAlStyle::standardTitle ( )
inlinestatic

Definition at line 91 of file TkAlStyle.h.

References publicationStatus_, and standardTitle().

Referenced by drawStandardTitle(), and standardTitle().

static PublicationStatus publicationStatus_
Definition: TkAlStyle.h:189
static TPaveText * standardTitle()
Definition: TkAlStyle.h:91

◆ status()

static PublicationStatus TkAlStyle::status ( )
inlinestatic

Definition at line 56 of file TkAlStyle.h.

References publicationStatus_.

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

56 { return publicationStatus_; }
static PublicationStatus publicationStatus_
Definition: TkAlStyle.h:189

◆ style()

int TkAlStyle::style ( const AlignObj  obj)
static

Definition at line 70 of file TkAlStyle.cc.

References getGTfromDQMFile::obj, and RUN1Align.

70 { return obj == RUN1Align ? kDashed : kSolid; }

◆ title()

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

Definition at line 200 of file TkAlStyle.cc.

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

Referenced by customTitle(), and standardTitle().

200  {
201  double x0 = gStyle->GetPadLeftMargin();
202  double x1 = 1. - gStyle->GetPadRightMargin();
203  double y0 = 1. - gStyle->GetPadTopMargin();
204  double y1 = 1.;
205  if (txt.Contains("#CMS"))
206  y0 += .02;
207  TPaveText* theTitle = new TPaveText(x0, y0, x1, y1, "NDC");
208  theTitle->SetBorderSize(0);
209  theTitle->SetFillColor(10);
210  theTitle->SetFillStyle(0);
211  theTitle->SetTextFont(42);
212  theTitle->SetTextAlign(13); // left bottom adjusted
213  theTitle->SetTextSize(0.038);
214  theTitle->SetMargin(0.);
215  theTitle->AddText(applyCMS(txt));
216 
217  return theTitle;
218 }
static TString applyCMS(const TString &txt)
Definition: TkAlStyle.cc:191

◆ toStatus()

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

Definition at line 83 of file TkAlStyle.cc.

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

Referenced by merge().

83  {
85  std::for_each(status.begin(), status.end(), [](char& c) { c = ::toupper(c); });
86  if (status == "NO_STATUS")
87  st = NO_STATUS;
88  else if (status == "INTERNAL")
89  st = INTERNAL;
90  else if (status == "SIMULATION (INTERNAL)")
92  else if (status == "PRELIMINARY")
93  st = PRELIMINARY;
94  else if (status == "PUBLIC")
95  st = PUBLIC;
96  else if (status == "SIMULATION")
97  st = SIMULATION;
98  else if (status == "UNPUBLISHED")
99  st = UNPUBLISHED;
100  else
101  st = CUSTOM;
102 
103  return st;
104 }
static PublicationStatus status()
Definition: TkAlStyle.h:56
PublicationStatus
Definition: TkAlStyle.h:31

◆ toTString() [1/3]

TString TkAlStyle::toTString ( const PublicationStatus  status)
static

Definition at line 3 of file TkAlStyle.cc.

References CUSTOM, INTERNAL, INTERNAL_SIMULATION, NO_STATUS, PRELIMINARY, PUBLIC, SIMULATION, status(), str, and UNPUBLISHED.

Referenced by rightheader().

3  {
4  TString str = "";
5  if (status == NO_STATUS)
6  str = "Status not set yet!";
7  else if (status == INTERNAL)
8  str = "internal";
9  else if (status == INTERNAL_SIMULATION)
10  str = "simulation (internal)";
11  else if (status == PRELIMINARY)
12  str = "preliminary";
13  else if (status == PUBLIC)
14  str = "public";
15  else if (status == SIMULATION)
16  str = "simulation (public)";
17  else if (status == UNPUBLISHED)
18  str = "unpublished";
19  else if (status == CUSTOM)
20  str = "custom title set";
21 
22  return str;
23 }
static PublicationStatus status()
Definition: TkAlStyle.h:56
#define str(s)

◆ toTString() [2/3]

TString TkAlStyle::toTString ( const Era  era)
static

Definition at line 25 of file TkAlStyle.cc.

References COLL0T15, CRAFT15, CRUZET15, and str.

25  {
26  TString str = "";
27  if (era == CRUZET15)
28  str = "0T cosmic ray data 2015";
29  else if (era == CRAFT15)
30  str = "3.8T cosmic ray data 2015";
31  else if (era == COLL0T15)
32  str = "0T collision data 2015";
33 
34  return str;
35 }
#define str(s)

◆ toTString() [3/3]

TString TkAlStyle::toTString ( const AlignObj  obj)
static

Definition at line 37 of file TkAlStyle.cc.

References Coll0TAlign, CRAFTAlign, CRUZETAlign, IDEALAlign, getGTfromDQMFile::obj, RUN1Align, and str.

37  {
38  TString str = "";
39  if (obj == IDEALAlign)
40  str = "MC (no mis-alignment)";
41  else if (obj == RUN1Align)
42  str = "No Run-2 alignment (Run-1 geometry)";
43  else if (obj == CRUZETAlign)
44  str = "Aligned (0T cosmic rays)";
45  else if (obj == CRAFTAlign)
46  str = "Aligned (cosmic rays)";
47  else if (obj == Coll0TAlign)
48  str = "Aligned (0T collisions + cosmic rays)";
49 
50  return str;
51 }
#define str(s)

Member Data Documentation

◆ customRightTitle_

TString TkAlStyle::customRightTitle_ = ""
staticprivate

Definition at line 192 of file TkAlStyle.h.

Referenced by rightheader(), and set().

◆ customTitle_

TString TkAlStyle::customTitle_ = ""
staticprivate

Definition at line 191 of file TkAlStyle.h.

Referenced by header(), and set().

◆ era_

Era TkAlStyle::era_ = NONE
staticprivate

Definition at line 190 of file TkAlStyle.h.

Referenced by set(), and standardRightTitle().

◆ legendheader

TString TkAlStyle::legendheader = ""
static

◆ legendoptions

TString TkAlStyle::legendoptions = "all"
static

Definition at line 102 of file TkAlStyle.h.

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

◆ lineHeight_

double TkAlStyle::lineHeight_ = 0.042
staticprivate

Definition at line 193 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 189 of file TkAlStyle.h.

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

◆ textSize

double TkAlStyle::textSize = 0.035
static