HighLAND
Enumerations | Functions | Variables
drawUtils Namespace Reference

This namespace contains a set of general utilities for drawing. More...

Enumerations

enum  OptionEnum { kNOERROR =0, kAREA }
 

Functions

std::string ToUpper (const std::string &str)
 
std::string GetString (int code)
 convert integer to string
 
std::string GetString (double code)
 convert double to string
 
bool TreeHasVar (TTree *tree, const std::string &var)
 Check wether the tree has a given variable.
 
int GetVarFromTree (TTree *tree, const std::string &var)
 Get the Value of an integer variable from the tree.
 
int GetNWeights (TTree *tree)
 get the number of weights in the tree
 
int GetNToys (TTree *tree)
 get the number of weights in the tree
 
int GetRefToy (TTree *tree)
 get the reference toy in the tree
 
int GetVarFromExperiment (const std::string &var, Experiment &exp, const std::string &groupName="all", const std::string &mcSampleName="all")
 Get the Value of an integer variable from the experiment.
 
void NormalizeVariableBinning (TH1 *h, int mode, const std::string &opt, Double_t &minwidth)
 Normalize bin contents by bin width. return the with of the bin with minimum width.
 
void NormalizeVariableBinning (TH1 *h, int mode, const std::string &opt)
 Normalize bin contents by bin width.
 
bool CheckOption (const std::string &uopt, const std::string &this_opt)
 Check if specific option exists, and if so if it appears in option field.
 
bool CheckOption (const std::string &uopt, OptionEnum this_opt)
 Same as previous using enum instead of string.
 
bool CheckInternalOption (const std::string &uopt, const std::string &this_opt)
 Check if specific option appears in option field (don't check if it exists: Added with AddOption)
 
std::string ConvertOption (OptionEnum this_opt)
 convert enum option to string
 
void ExplainOption (OptionEnum opt)
 Explain a given option given as enum.
 
void ExplainOption (const std::string &opt)
 Explain a given option.
 
bool IsValidOption (const std::string &opt)
 Check if the option is in the list of available options (added with AddOption)
 
bool ContainValidOptions (const std::string &uopt)
 Check if the input string contails only valid options.
 
void AddOption (const std::string &opt, const std::string &info)
 Add option as valid, provided name and exlaination.
 
void BuildOptions ()
 Build the map of valid options with AddOption. More...
 
void ListOptions ()
 List sll valid options and a description of each of them.
 
void AddLegendEntry (TLegend *leg, TObject *ht, const std::string &type, const std::string &opt)
 Add an entry to the Legend and resize it.
 

Variables

double legendEntryHeight =0.05
 

Detailed Description

This namespace contains a set of general utilities for drawing.

Function Documentation

§ BuildOptions()

void drawUtils::BuildOptions ( )

Build the map of valid options with AddOption.

[DrawingToolsOptions]

[DrawingToolsOptions]

Definition at line 286 of file DrawingUtils.cxx.

286  {
287 //*********************************************************
288 
289 //! [DrawingToolsOptions]
290  drawUtils::AddOption("SCALETODATA","Scale the MC covariance matrix to data POT when using Experiment");
291  drawUtils::AddOption("NOCHOP", "??");
292  drawUtils::AddOption("E0", "Error style option for second sample. Does the same as the root option e0");
293  drawUtils::AddOption("E1", "Error style option for second sample. Does the same as the root option e1");
294  drawUtils::AddOption("E2", "Error style option for second sample. Does the same as the root option e2");
295  drawUtils::AddOption("E3", "Error style option for second sample. Does the same as the root option e3");
296  drawUtils::AddOption("E4", "Error style option for second sample. Does the same as the root option e4");
297  drawUtils::AddOption("E5", "Error style option for second sample. Does the same as the root option e5");
298  drawUtils::AddOption("E6", "Error style option for second sample. Does the same as the root option e6");
299  drawUtils::AddOption("ETOT", "When drawing with color codes, draw also the total error for the stacked histogram");
300  drawUtils::AddOption("NOTOTERROR","Don't draw the total error (stat+syst) but only the statistical or systematic error");
301  drawUtils::AddOption("NOSTERROR", "Don't draw the statistical error but only the total error, and also the systematic error when SYSTERROR options is also used");
302  drawUtils::AddOption("SYSTERROR", "Don't draw the statistical error but only the systematic error, together with the total");
303  drawUtils::AddOption("DUMP", "Print on the secreen the histo or graph contents");
304  drawUtils::AddOption("NODRAW", "Don't draw anything. You should use the option DUMP to see the results");
305  drawUtils::AddOption("ST", "When using DrawErrors or DrawRelativeErrors only statistical errors are plotted. In combination with SYS, SSYS or WSYS adds statisticak and systematic errors in quadrature");
306  drawUtils::AddOption("SYS", "draw all systematics. Error bars correspond to the RMS of all toy experiments");
307  drawUtils::AddOption("SSYS", "Draw only standard systematics (reconstructed observable variations)");
308  drawUtils::AddOption("WSYS", "Draw only weight systematics");
309  drawUtils::AddOption("WSi", "Draw only the specified (ith) weight systematic(s) (\" WS0 WS3 ... \")");
310  drawUtils::AddOption("NWSi", "Exclude the specified (ith) weight systematic(s) (\"NWS0 NWS1 ... \")");
311  drawUtils::AddOption("WCi", "Draw only the specified (ith) weight correction(s) (\" WC0 WC3 ... \")");
312  drawUtils::AddOption("NWCi", "Exclude the specified (ith) weight correction(s) (\"NWC0 NWC1 ... \")");
313  drawUtils::AddOption("WCORR", "Apply Weight corrections only (not weight systematics)");
314  drawUtils::AddOption("RELATIVE", "When computing the covariance matrix divide by the average in each bin such that a relative covariance is computed");
315  drawUtils::AddOption("NOLEG", "No legend is drawn");
316  drawUtils::AddOption("PUR", "The purity is printed on the screen and on the legend");
317  drawUtils::AddOption("EFF", "The efficiency-like ratio plot (out of two histograms, pass and total) is drawn, internal option");
318  drawUtils::AddOption("NOST2", "The stat box for the second sample is not shown");
319  drawUtils::AddOption("NOSTAT", "No stat box is shown");
320  drawUtils::AddOption("NOMIN", "The minimum in Y is not used");
321  drawUtils::AddOption("NOVARBIN", "Plotting with variable binning, bin entries are normalized by bin width. This option disables this feature.");
322  drawUtils::AddOption("NOTOYW", "No toy weight is applied for toy experiments. All toys will have the same weight 1.");
323  drawUtils::AddOption("NOW", "None of the weights (flux and pileup) are applied to the event");
324  drawUtils::AddOption("NOFLUXW", "No flux weight is applied to the event");
325  drawUtils::AddOption("NOPILEUPW", "No pile up weight is applied to the event");
326  drawUtils::AddOption("NODATA", "The data is not shown in the plot");
327  drawUtils::AddOption("NOMC", "The MC is not shown in the plot");
328  drawUtils::AddOption("NODEFAULT", "By default the -999 default is plotted unless this option is used");
329  drawUtils::AddOption("UNDER", "Underflow entries are added to the first bin");
330  drawUtils::AddOption("OVER", "Overflow entries are added to the last bin");
331  drawUtils::AddOption("PROFX", "For 2D histos a Profile histogram in X is drawn");
332  drawUtils::AddOption("PROFY", "For 2D histos a Profile histogram in Y is drawn");
333  drawUtils::AddOption("AREA", "For 1D histos normalization to 1 (if there is only one sample) or to the area of the first sample. In this normalization procedure the whole range of the variable allowed by 'cut' parameter is taken into account");
334  drawUtils::AddOption("AREA1", "For 1D histos normalization to 1. In this normalization procedure the whole range of the variable allowed by 'cut' parameter is taken into account");
335  drawUtils::AddOption("AREA100", "For 1D histos normalization to 100. In this normalization procedure the whole range of the variable allowed by 'cut' parameter is taken into account");
336  drawUtils::AddOption("POTNORM", "Normalize the MC to the POT given as input normalization factor, regardless of the data POT (interprete valid norm factor as a POT value)");
337  drawUtils::AddOption("NOPOTNORM", "Disable POT normalization. Second sample is not scaled");
338  drawUtils::AddOption("IGNOREEMPTY", "Do not put categories without entries in the legend");
339  drawUtils::AddOption("DRAWALLMC", "Draw with black contour a histogram for all MC entries (works only while plotting histogram stack)");
340  drawUtils::AddOption("DRAWALLCUTS", "Draw all cuts even if they are below the MinAccumLevelToSave when doing plots VSCuts");
341  drawUtils::AddOption("NOINFO", "Dont dump on the screen histogram info when using the Draw methods");
342  drawUtils::AddOption("SHOWSAND", "Show the sand mu type even when it is empty");
343  drawUtils::AddOption("SHOWNOTRUTH", "Show the NO TRUTH type even when it is empty");
344  drawUtils::AddOption("RATIO", "Draw the Data/MC ratio underneath the stack plot");
345 //! [DrawingToolsOptions]
346 }
void AddOption(const std::string &opt, const std::string &info)
Add option as valid, provided name and exlaination.

§ ToUpper()

std::string drawUtils::ToUpper ( const std::string &  str)

Convert a string to upper-case, so we can do case-insensitive comparisons when parsing the "opt" parameter, for example.

Definition at line 9 of file DrawingUtils.cxx.

9  {
10 //*********************************************************
11  TString tstr(str);
12  tstr.ToUpper();
13  return tstr.Data();
14 }