19 file_extensions_({
"pdf"}),
51 const string &config_name):
61 const string &config_name){
62 ifstream file(file_name);
64 string current_config =
"";
66 while(getline(file, line)){
70 auto start = line.find(
'[');
71 auto end = line.find(
']');
72 if(start==string::npos && end!=string::npos){
73 ERROR(
"Could not find opening brace in line "+to_string(line_num));
75 if(start!=string::npos && end==string::npos){
76 ERROR(
"Could not find closing brace in line "+to_string(line_num));
78 if(start<end && start != string::npos && end != string::npos){
79 current_config = line.substr(start+1, end-start-1);
80 }
else if(current_config == config_name
83 auto pos = line.find(
"=");
84 if(pos == string::npos)
continue;
85 string prop_name = line.substr(0,pos);
86 string value = line.substr(pos+1);
444 return (right-left)/min(num_entries, static_cast<size_t>(
legend_columns_));
451 case StackType::signal_overlay:
452 case StackType::signal_on_top:
453 case StackType::data_norm:
455 case StackType::lumi_shapes:
456 case StackType::shapes:
470 default:
DBG(
"Bad stack type: " << static_cast<int>(
stack_type_));
471 case StackType::signal_overlay: out +=
"lumi_nonorm";
break;
472 case StackType::signal_on_top: out +=
"sigontop";
break;
473 case StackType::data_norm: out +=
"lumi";
break;
474 case StackType::lumi_shapes: out +=
"lumi_shapes";
break;
475 case StackType::shapes: out +=
"shapes";
break;
482 case YAxisType::linear: out +=
"lin";
break;
483 case YAxisType::log: out +=
"log";
break;
492 DBG(
"Don't know how to show total MC uncertainty with unstacked MC. Turning off MC uncertainty band.");
499 const string &value){
500 if(property ==
"BottomType"){
501 Bottom(static_cast<BottomType>(stoi(value)));
502 }
else if(property ==
"YAxisType"){
503 YAxis(static_cast<YAxisType>(stoi(value)));
504 }
else if(property ==
"TitleType"){
505 Title(static_cast<TitleType>(stoi(value)));
506 }
else if(property ==
"StackType"){
507 Stack(static_cast<StackType>(stoi(value)));
508 }
else if(property ==
"OverflowType"){
509 Overflow(static_cast<OverflowType>(stoi(value)));
510 }
else if(property ==
"FileExtensions"){
514 }
else if(property ==
"TitleSize"){
516 }
else if(property ==
"LabelSize"){
518 }
else if(property ==
"xTitleOffset" || property ==
"XTitleOffset"){
520 }
else if(property ==
"yTitleOffset" || property ==
"YTitleOffset"){
522 }
else if(property ==
"zTitleOffset" || property ==
"ZTitleOffset"){
524 }
else if(property ==
"AutoYAxis"){
525 AutoYAxis(static_cast<bool>(stoi(value)));
526 }
else if(property ==
"CanvasWidth" || property ==
"CanvasW"){
528 }
else if(property ==
"CanvasHeight" || property ==
"CanvasH"){
530 }
else if(property ==
"PadLeftMargin"){
532 }
else if(property ==
"PadRightMargin"){
534 }
else if(property ==
"PadBottomMargin"){
536 }
else if(property ==
"PadTopMargin"){
538 }
else if(property ==
"LegendColumns"){
540 }
else if(property ==
"LegendEntrySize" || property ==
"LegendSize"){
542 }
else if(property ==
"LegendMaxSize"){
544 }
else if(property ==
"LegendMarkerWidth"){
546 }
else if(property ==
"LegendPad"){
548 }
else if(property ==
"LegendDensity"){
550 }
else if(property ==
"BottomPlotHeight"){
552 }
else if(property ==
"LogMinimum"){
554 }
else if(property ==
"RatioMinimum"){
556 }
else if(property ==
"RatioMaximum"){
558 }
else if(property ==
"nDivisions" || property ==
"NDivisions"){
560 }
else if(property ==
"nDivisionsBottom" || property ==
"NDivisionsBottom"){
562 }
else if(property ==
"Font"){
564 }
else if(property ==
"ShowBackgroundError"){
566 }
else if(property ==
"UseCMYK"){
568 }
else if(property ==
"PrintVals"){
571 DBG(
"Did not understand property name "<<property);
PlotOptTypes::OverflowType Overflow() const
double legend_max_height_
double RightMargin() const
double LogMinimum() const
PlotOpt & LoadOptions(const std::string &file_name, const std::string &config_name)
PlotOptTypes::BottomType bottom_type_
PlotOptTypes::BottomType Bottom() const
bool DisplayLumiEntry() const
int NDivisionsBottom() const
double LeftMargin() const
double BottomToGlobalYNDC(double bottom_y) const
const std::set< std::string > & FileExtensions() const
double legend_entry_height_
void ReplaceAll(std::string &str, const std::string &orig, const std::string &rep)
PlotOptTypes::TitleType Title() const
double LegendMaxHeight() const
double RatioMinimum() const
PlotOptTypes::StackType stack_type_
double legend_marker_width_
PlotOptTypes::StackType Stack() const
double TopToGlobalYNDC(double top_y) const
double TrueLegendWidth(std::size_t num_entries) const
double BottomMargin() const
PlotOpt & CanvasSize(int width, int height)
bool BackgroundsStacked() const
std::string TypeString() const
PlotOpt operator()() const
std::set< std::string > file_extensions_
double TrueLegendEntryHeight(std::size_t num_entries) const
double XTitleOffset() const
double GlobalToBottomYNDC(double global_y) const
double YTitleOffset() const
double RatioMaximum() const
PlotOptTypes::YAxisType y_axis_type_
double LegendMarkerWidth() const
double LegendDensity() const
PlotOpt & Margin(double left, double right, double bottom, double top)
double TrueLegendHeight(std::size_t num_entries) const
PlotOptTypes::YAxisType YAxis() const
double LegendEntryHeight() const
PlotOptTypes::OverflowType overflow_type_
void SetProperty(const std::string &property_name, const std::string &value_string)
int LegendColumns() const
double GlobalToTopYNDC(double global_y) const
bool show_background_error_
bool ShowBackgroundError() const
PlotOptTypes::TitleType title_type_
double ZTitleOffset() const
double BottomHeight() const