Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:54

0001 #include "JetHtPlotConfiguration.h"
0002 
0003 /*
0004  * Default constructor
0005  */
0006 JetHtPlotConfiguration::JetHtPlotConfiguration()
0007     : fDebugLevel(0),
0008       fDrawTrackQA(false),
0009       fDrawReferenceProfile(false),
0010       fDrawCentralEtaSummaryProfile(true),
0011       fProfileLegendShiftTotalX(0),
0012       fProfileLegendShiftTotalY(0),
0013       fProfileLegendTextSize(0.05),
0014       fProfileLegendTextFont(62),
0015       fTrendLegendShiftTotalX(0),
0016       fTrendLegendShiftTotalY(0),
0017       fTrendLegendTextSize(0.05),
0018       fTrendLegendTextFont(62),
0019       fDrawTrendTag(false),
0020       fTrendTagText(0),
0021       fTrendTagPositionX(0),
0022       fTrendTagPositionY(0),
0023       fTrendTagTextSize(0.05),
0024       fTrendTagTextFont(42),
0025       fTrendCanvasHeight(400),
0026       fTrendCanvasWidth(1000),
0027       fTrendMarginLeft(0.08),
0028       fTrendMarginRight(0.03),
0029       fTrendMarginTop(0.06),
0030       fTrendMarginBottom(0.15),
0031       fTrendTitleOffsetX(1.1),
0032       fTrendTitleOffsetY(0.55),
0033       fTrendTitleSizeX(0.06),
0034       fTrendTitleSizeY(0.06),
0035       fTrendLabelOffsetX(0.01),
0036       fTrendLabelOffsetY(0.007),
0037       fTrendLabelSizeX(0.05),
0038       fTrendLabelSizeY(0.05),
0039       fInputFileNames(0),
0040       fLegendComments(0),
0041       fMarkerColor(0),
0042       fMarkerStyle(0),
0043       fMarkerSize(0),
0044       fCopyErrorColor(0),
0045       fLegendTextForAllRuns("All"),
0046       fDrawPlotsForEachIOV(false),
0047       fNIovInOnePlot(1),
0048       fUseLuminosityForTrends(true),
0049       fSkipRunsWithNoData(false),
0050       fNormalizeQAplots(true),
0051       fSaveComment(""),
0052       fLumiPerIovFile("lumiPerRun_Run2.txt"),
0053       fIovListMode("run"),
0054       fDrawYearLines(false),
0055       fYearLineColor(kBlack),
0056       fYearLineWidth(1),
0057       fYearLineStyle(1),
0058       fRunsForLines(0),
0059       fWidePtBinBorders(0),
0060       fMakeIovListForSlides(false),
0061       fIovListForSlides("iovListForSlides.txt") {
0062   // Default zoom values
0063   double defaultProfileZoomLow[knProfileTypes] = {28, 45, 30, 7, 40, 20, 25, 20};
0064   double defaultProfileZoomHigh[knProfileTypes] = {60, 80, 95, 40, 70, 90, 90, 80};
0065   double defaultTrendZoomLow[knTrendTypes] = {20, 10};
0066   double defaultTrendZoomHigh[knTrendTypes] = {95, 90};
0067 
0068   // Initialize arrays
0069   for (int iHistogram = 0; iHistogram < knHistogramTypes; iHistogram++) {
0070     fDrawHistogram[iHistogram] = false;
0071   }
0072   for (int iProfile = 0; iProfile < knProfileTypes; iProfile++) {
0073     fDrawProfile[iProfile] = false;
0074     fProfileZoomLow[iProfile] = defaultProfileZoomLow[iProfile];
0075     fProfileZoomHigh[iProfile] = defaultProfileZoomHigh[iProfile];
0076   }
0077   for (int iTrend = 0; iTrend < knTrendTypes; iTrend++) {
0078     fDrawTrend[iTrend] = false;
0079     fTrendZoomLow[iTrend] = defaultTrendZoomLow[iTrend];
0080     fTrendZoomHigh[iTrend] = defaultTrendZoomHigh[iTrend];
0081   }
0082   for (int iColumn = 0; iColumn < kMaxLegendColumns; iColumn++) {
0083     fProfileLegendShiftColumnX[iColumn] = 0;
0084     fProfileLegendShiftColumnY[iColumn] = 0;
0085   }
0086 }
0087 
0088 /*
0089  * Copy constructor
0090  */
0091 JetHtPlotConfiguration::JetHtPlotConfiguration(const JetHtPlotConfiguration& in)
0092     : fDebugLevel(in.fDebugLevel),
0093       fDrawTrackQA(in.fDrawTrackQA),
0094       fDrawReferenceProfile(in.fDrawReferenceProfile),
0095       fDrawCentralEtaSummaryProfile(in.fDrawCentralEtaSummaryProfile),
0096       fProfileLegendShiftTotalX(in.fProfileLegendShiftTotalX),
0097       fProfileLegendShiftTotalY(in.fProfileLegendShiftTotalY),
0098       fProfileLegendTextSize(in.fProfileLegendTextSize),
0099       fProfileLegendTextFont(in.fProfileLegendTextFont),
0100       fTrendLegendShiftTotalX(in.fTrendLegendShiftTotalX),
0101       fTrendLegendShiftTotalY(in.fTrendLegendShiftTotalY),
0102       fTrendLegendTextSize(in.fTrendLegendTextSize),
0103       fTrendLegendTextFont(in.fTrendLegendTextFont),
0104       fDrawTrendTag(in.fDrawTrendTag),
0105       fTrendTagText(in.fTrendTagText),
0106       fTrendTagPositionX(in.fTrendTagPositionX),
0107       fTrendTagPositionY(in.fTrendTagPositionY),
0108       fTrendTagTextSize(in.fTrendTagTextSize),
0109       fTrendTagTextFont(in.fTrendTagTextFont),
0110       fTrendCanvasHeight(in.fTrendCanvasHeight),
0111       fTrendCanvasWidth(in.fTrendCanvasWidth),
0112       fTrendMarginLeft(in.fTrendMarginLeft),
0113       fTrendMarginRight(in.fTrendMarginRight),
0114       fTrendMarginTop(in.fTrendMarginTop),
0115       fTrendMarginBottom(in.fTrendMarginBottom),
0116       fTrendTitleOffsetX(in.fTrendTitleOffsetX),
0117       fTrendTitleOffsetY(in.fTrendTitleOffsetY),
0118       fTrendTitleSizeX(in.fTrendTitleSizeX),
0119       fTrendTitleSizeY(in.fTrendTitleSizeY),
0120       fTrendLabelOffsetX(in.fTrendLabelOffsetX),
0121       fTrendLabelOffsetY(in.fTrendLabelOffsetY),
0122       fTrendLabelSizeX(in.fTrendLabelSizeX),
0123       fTrendLabelSizeY(in.fTrendLabelSizeY),
0124       fInputFileNames(in.fInputFileNames),
0125       fLegendComments(in.fLegendComments),
0126       fMarkerColor(in.fMarkerColor),
0127       fMarkerStyle(in.fMarkerStyle),
0128       fMarkerSize(in.fMarkerSize),
0129       fCopyErrorColor(in.fCopyErrorColor),
0130       fLegendTextForAllRuns(in.fLegendTextForAllRuns),
0131       fDrawPlotsForEachIOV(in.fDrawPlotsForEachIOV),
0132       fNIovInOnePlot(in.fNIovInOnePlot),
0133       fUseLuminosityForTrends(in.fUseLuminosityForTrends),
0134       fSkipRunsWithNoData(in.fSkipRunsWithNoData),
0135       fNormalizeQAplots(in.fNormalizeQAplots),
0136       fSaveComment(in.fSaveComment),
0137       fLumiPerIovFile(in.fLumiPerIovFile),
0138       fIovListMode(in.fIovListMode),
0139       fDrawYearLines(in.fDrawYearLines),
0140       fYearLineColor(in.fYearLineColor),
0141       fYearLineWidth(in.fYearLineWidth),
0142       fYearLineStyle(in.fYearLineStyle),
0143       fRunsForLines(in.fRunsForLines),
0144       fWidePtBinBorders(in.fWidePtBinBorders),
0145       fMakeIovListForSlides(in.fMakeIovListForSlides),
0146       fIovListForSlides(in.fIovListForSlides) {
0147   // Copy arrays
0148   for (int iHistogram = 0; iHistogram < knHistogramTypes; iHistogram++) {
0149     fDrawHistogram[iHistogram] = in.fDrawHistogram[iHistogram];
0150   }
0151   for (int iProfile = 0; iProfile < knProfileTypes; iProfile++) {
0152     fDrawProfile[iProfile] = in.fDrawProfile[iProfile];
0153     fProfileZoomLow[iProfile] = in.fProfileZoomLow[iProfile];
0154     fProfileZoomHigh[iProfile] = in.fProfileZoomHigh[iProfile];
0155   }
0156   for (int iTrend = 0; iTrend < knTrendTypes; iTrend++) {
0157     fDrawTrend[iTrend] = in.fDrawTrend[iTrend];
0158     fTrendZoomLow[iTrend] = in.fTrendZoomLow[iTrend];
0159     fTrendZoomHigh[iTrend] = in.fTrendZoomHigh[iTrend];
0160   }
0161   for (int iColumn = 0; iColumn < kMaxLegendColumns; iColumn++) {
0162     fProfileLegendShiftColumnX[iColumn] = in.fProfileLegendShiftColumnX[iColumn];
0163     fProfileLegendShiftColumnY[iColumn] = in.fProfileLegendShiftColumnY[iColumn];
0164   }
0165 }
0166 
0167 /*
0168  * Assingment operator
0169  */
0170 JetHtPlotConfiguration& JetHtPlotConfiguration::operator=(const JetHtPlotConfiguration& in) {
0171   if (&in == this)
0172     return *this;
0173 
0174   fDebugLevel = in.fDebugLevel;
0175   fDrawTrackQA = in.fDrawTrackQA;
0176   fDrawReferenceProfile = in.fDrawReferenceProfile;
0177   fDrawCentralEtaSummaryProfile = in.fDrawCentralEtaSummaryProfile;
0178   fProfileLegendShiftTotalX = in.fProfileLegendShiftTotalX;
0179   fProfileLegendShiftTotalY = in.fProfileLegendShiftTotalY;
0180   fProfileLegendTextSize = in.fProfileLegendTextSize;
0181   fProfileLegendTextFont = in.fProfileLegendTextFont;
0182   fTrendLegendShiftTotalX = in.fTrendLegendShiftTotalX;
0183   fTrendLegendShiftTotalY = in.fTrendLegendShiftTotalY;
0184   fTrendLegendTextSize = in.fTrendLegendTextSize;
0185   fTrendLegendTextFont = in.fTrendLegendTextFont;
0186   fDrawTrendTag = in.fDrawTrendTag;
0187   fTrendTagText = in.fTrendTagText;
0188   fTrendTagPositionX = in.fTrendTagPositionX;
0189   fTrendTagPositionY = in.fTrendTagPositionY;
0190   fTrendTagTextSize = in.fTrendTagTextSize;
0191   fTrendTagTextFont = in.fTrendTagTextFont;
0192   fTrendCanvasHeight = in.fTrendCanvasHeight;
0193   fTrendCanvasWidth = in.fTrendCanvasWidth;
0194   fTrendMarginLeft = in.fTrendMarginLeft;
0195   fTrendMarginRight = in.fTrendMarginRight;
0196   fTrendMarginTop = in.fTrendMarginTop;
0197   fTrendMarginBottom = in.fTrendMarginBottom;
0198   fTrendTitleOffsetX = in.fTrendTitleOffsetX;
0199   fTrendTitleOffsetY = in.fTrendTitleOffsetY;
0200   fTrendTitleSizeX = in.fTrendTitleSizeX;
0201   fTrendTitleSizeY = in.fTrendTitleSizeY;
0202   fTrendLabelOffsetX = in.fTrendLabelOffsetX;
0203   fTrendLabelOffsetY = in.fTrendLabelOffsetY;
0204   fTrendLabelSizeX = in.fTrendLabelSizeX;
0205   fTrendLabelSizeY = in.fTrendLabelSizeY;
0206   fInputFileNames = in.fInputFileNames;
0207   fLegendComments = in.fLegendComments;
0208   fMarkerColor = in.fMarkerColor;
0209   fMarkerStyle = in.fMarkerStyle;
0210   fMarkerSize = in.fMarkerSize;
0211   fCopyErrorColor = in.fCopyErrorColor;
0212   fLegendTextForAllRuns = in.fLegendTextForAllRuns;
0213   fDrawPlotsForEachIOV = in.fDrawPlotsForEachIOV;
0214   fNIovInOnePlot = in.fNIovInOnePlot;
0215   fUseLuminosityForTrends = in.fUseLuminosityForTrends;
0216   fSkipRunsWithNoData = in.fSkipRunsWithNoData;
0217   fNormalizeQAplots = in.fNormalizeQAplots;
0218   fSaveComment = in.fSaveComment;
0219   fLumiPerIovFile = in.fLumiPerIovFile;
0220   fIovListMode = in.fIovListMode;
0221   fDrawYearLines = in.fDrawYearLines;
0222   fYearLineColor = in.fYearLineColor;
0223   fYearLineWidth = in.fYearLineWidth;
0224   fYearLineStyle = in.fYearLineStyle;
0225   fRunsForLines = in.fRunsForLines;
0226   fWidePtBinBorders = in.fWidePtBinBorders;
0227   fMakeIovListForSlides = in.fMakeIovListForSlides;
0228   fIovListForSlides = in.fIovListForSlides;
0229 
0230   // Copy arrays
0231   for (int iHistogram = 0; iHistogram < knHistogramTypes; iHistogram++) {
0232     fDrawHistogram[iHistogram] = in.fDrawHistogram[iHistogram];
0233   }
0234   for (int iProfile = 0; iProfile < knProfileTypes; iProfile++) {
0235     fDrawProfile[iProfile] = in.fDrawProfile[iProfile];
0236     fProfileZoomLow[iProfile] = in.fProfileZoomLow[iProfile];
0237     fProfileZoomHigh[iProfile] = in.fProfileZoomHigh[iProfile];
0238   }
0239   for (int iTrend = 0; iTrend < knTrendTypes; iTrend++) {
0240     fDrawTrend[iTrend] = in.fDrawTrend[iTrend];
0241     fTrendZoomLow[iTrend] = in.fTrendZoomLow[iTrend];
0242     fTrendZoomHigh[iTrend] = in.fTrendZoomHigh[iTrend];
0243   }
0244   for (int iColumn = 0; iColumn < kMaxLegendColumns; iColumn++) {
0245     fProfileLegendShiftColumnX[iColumn] = in.fProfileLegendShiftColumnX[iColumn];
0246     fProfileLegendShiftColumnY[iColumn] = in.fProfileLegendShiftColumnY[iColumn];
0247   }
0248 
0249   return *this;
0250 }
0251 
0252 /*
0253  * Destructor
0254  */
0255 JetHtPlotConfiguration::~JetHtPlotConfiguration() {}
0256 
0257 /*
0258  * Read the configuration from json file
0259  */
0260 void JetHtPlotConfiguration::readJsonFile(const std::string fileName) {
0261   // Read the file to property tree
0262   namespace pt = boost::property_tree;
0263   pt::ptree configuration;
0264   pt::read_json(fileName, configuration);
0265 
0266   // Read the alignments and styles for these
0267   int indexForDefault = 0;
0268   std::string alignmentName;
0269   std::string thisValue;
0270   int thisNumber;
0271   bool thisBool;
0272   for (pt::ptree::value_type& result : configuration.get_child("jethtplot.alignments")) {
0273     alignmentName = result.first;
0274 
0275     // Input file for the alignment
0276     try {
0277       thisValue = configuration.get_child(Form("jethtplot.alignments.%s.inputFile", alignmentName.c_str()))
0278                       .get_value<std::string>();
0279 
0280       // From the file name, expand possible environment variables
0281       autoExpandEnvironmentVariables(thisValue);
0282 
0283       // Expand CMSSW_BASE event without preceding $-sign
0284       boost::replace_all(thisValue, "CMSSW_BASE", getenv("CMSSW_BASE"));
0285 
0286       fInputFileNames.push_back(thisValue);
0287     } catch (const std::exception& e) {
0288       if (fDebugLevel > 0) {
0289         std::cout << "No input file given for alignment " << alignmentName
0290                   << "! All the configuration for this alignment is skipped." << std::endl;
0291       }
0292       continue;
0293     }
0294 
0295     // Legend text for the alignment
0296     try {
0297       thisValue = configuration.get_child(Form("jethtplot.alignments.%s.legendText", alignmentName.c_str()))
0298                       .get_value<std::string>();
0299       fLegendComments.push_back(thisValue);
0300     } catch (const std::exception& e) {
0301       if (fDebugLevel > 0) {
0302         std::cout << "No legend text given for alignment " << alignmentName << "! Using default value "
0303                   << Form("Alignment%d", indexForDefault) << "." << std::endl;
0304         fLegendComments.push_back(Form("Alignment%d", indexForDefault));
0305       }
0306     }
0307 
0308     // Marker color related to the alignment
0309     try {
0310       thisNumber =
0311           configuration.get_child(Form("jethtplot.alignments.%s.color", alignmentName.c_str())).get_value<int>();
0312       fMarkerColor.push_back(thisNumber);
0313     } catch (const std::exception& e) {
0314       if (fDebugLevel > 0) {
0315         std::cout << "No marker color given for alignment " << alignmentName << "! Using default value "
0316                   << fDefaultColors[indexForDefault] << "." << std::endl;
0317         fMarkerColor.push_back(fDefaultColors[indexForDefault]);
0318       }
0319     }
0320 
0321     // Marker style related to the alignment
0322     try {
0323       thisNumber =
0324           configuration.get_child(Form("jethtplot.alignments.%s.style", alignmentName.c_str())).get_value<int>();
0325       fMarkerStyle.push_back(thisNumber);
0326     } catch (const std::exception& e) {
0327       if (fDebugLevel > 0) {
0328         std::cout << "No marker style given for alignment " << alignmentName << "! Using default value "
0329                   << fDefaultStyle << "." << std::endl;
0330         fMarkerStyle.push_back(fDefaultStyle);
0331       }
0332     }
0333 
0334     // Marker size related to the alignment
0335     try {
0336       thisNumber =
0337           configuration.get_child(Form("jethtplot.alignments.%s.markerSize", alignmentName.c_str())).get_value<int>();
0338       fMarkerSize.push_back(thisNumber);
0339     } catch (const std::exception& e) {
0340       if (fDebugLevel > 0) {
0341         std::cout << "No marker size given for alignment " << alignmentName << "! Using default value "
0342                   << fDefaultMarkerSize << "." << std::endl;
0343         fMarkerSize.push_back(fDefaultMarkerSize);
0344       }
0345     }
0346 
0347     // Copy color for statistical error bar related to the alignment
0348     try {
0349       thisBool = configuration.get_child(Form("jethtplot.alignments.%s.copyErrorColor", alignmentName.c_str()))
0350                      .get_value<bool>();
0351       fCopyErrorColor.push_back(thisBool);
0352     } catch (const std::exception& e) {
0353       if (fDebugLevel > 0) {
0354         std::cout << "Not defined is marker color should be copied for statistical error bars for alignment "
0355                   << alignmentName << "! Using default value false." << std::endl;
0356         fCopyErrorColor.push_back(false);
0357       }
0358     }
0359 
0360     indexForDefault++;
0361   }
0362 
0363   // Read the drawing configuration for track QA
0364   try {
0365     fDrawTrackQA = configuration.get_child(Form("jethtplot.%s", fJsonTrackQAname.c_str())).get_value<bool>();
0366   } catch (const std::exception& e) {
0367     if (fDebugLevel > 0) {
0368       std::cout << "No value " << Form("jethtplot.%s", fJsonTrackQAname.c_str())
0369                 << " in configuration. Using default value " << fDrawTrackQA << "." << std::endl;
0370     }
0371   }
0372 
0373   // Read the drawing configuration for dz and dxy value and error histograms
0374   for (int iHistogram = 0; iHistogram < knHistogramTypes; iHistogram++) {
0375     try {
0376       fDrawHistogram[iHistogram] =
0377           configuration
0378               .get_child(
0379                   Form("jethtplot.%s.%s", fJsonCategoryNameHistogram.c_str(), fJsonNameHistogram[iHistogram].c_str()))
0380               .get_value<bool>();
0381     } catch (const std::exception& e) {
0382       if (fDebugLevel > 0) {
0383         std::cout << "No value "
0384                   << Form("jethtplot.%s.%s", fJsonCategoryNameHistogram.c_str(), fJsonNameHistogram[iHistogram].c_str())
0385                   << " in configuration. Using default value " << fDrawHistogram[iHistogram] << "." << std::endl;
0386       }
0387     }
0388   }
0389 
0390   // Read the drawing configuration for profile plots
0391   for (int iProfile = 0; iProfile < knProfileTypes; iProfile++) {
0392     try {
0393       fDrawProfile[iProfile] =
0394           configuration
0395               .get_child(Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameProfile[iProfile].c_str()))
0396               .get_value<bool>();
0397     } catch (const std::exception& e) {
0398       if (fDebugLevel > 0) {
0399         std::cout << "No value "
0400                   << Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameProfile[iProfile].c_str())
0401                   << " in configuration. Using default value " << fDrawProfile[iProfile] << "." << std::endl;
0402       }
0403     }
0404   }
0405 
0406   // Draw the drawing of reference profile
0407   try {
0408     fDrawReferenceProfile =
0409         configuration
0410             .get_child(Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameReferenceProfile.c_str()))
0411             .get_value<bool>();
0412   } catch (const std::exception& e) {
0413     if (fDebugLevel > 0) {
0414       std::cout << "No value "
0415                 << Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameReferenceProfile.c_str())
0416                 << " in configuration. Using default value " << fDrawReferenceProfile << "." << std::endl;
0417     }
0418   }
0419 
0420   // Draw the central eta summary profile to the all runs summary profile plots
0421   try {
0422     fDrawCentralEtaSummaryProfile =
0423         configuration
0424             .get_child(
0425                 Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameCentralEtaSummaryProfile.c_str()))
0426             .get_value<bool>();
0427   } catch (const std::exception& e) {
0428     if (fDebugLevel > 0) {
0429       std::cout << "No value "
0430                 << Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameCentralEtaSummaryProfile.c_str())
0431                 << " in configuration. Using default value " << fDrawCentralEtaSummaryProfile << "." << std::endl;
0432     }
0433   }
0434 
0435   // Read the total legend shift in x-direction for legends in profile plots
0436   try {
0437     fProfileLegendShiftTotalX =
0438         configuration
0439             .get_child(Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameLegendShiftTotalX.c_str()))
0440             .get_value<double>();
0441   } catch (const std::exception& e) {
0442     if (fDebugLevel > 0) {
0443       std::cout << "No value "
0444                 << Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameLegendShiftTotalX.c_str())
0445                 << " in configuration. Using default value " << fProfileLegendShiftTotalX << "." << std::endl;
0446     }
0447   }
0448 
0449   // Read the total legend shift in y-direction for legends in profile plots
0450   try {
0451     fProfileLegendShiftTotalY =
0452         configuration
0453             .get_child(Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameLegendShiftTotalY.c_str()))
0454             .get_value<double>();
0455   } catch (const std::exception& e) {
0456     if (fDebugLevel > 0) {
0457       std::cout << "No value "
0458                 << Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameLegendShiftTotalY.c_str())
0459                 << " in configuration. Using default value " << fProfileLegendShiftTotalY << "." << std::endl;
0460     }
0461   }
0462 
0463   // Read the columnwise legend shift in x-direction for legends in profile plots
0464   for (int iColumn = 0; iColumn < kMaxLegendColumns; iColumn++) {
0465     try {
0466       fProfileLegendShiftColumnX[iColumn] =
0467           configuration
0468               .get_child(Form(
0469                   "jethtplot.%s.%s%d", fJsonCategoryNameProfile.c_str(), fJsonNameLegendShiftColumnX.c_str(), iColumn))
0470               .get_value<double>();
0471     } catch (const std::exception& e) {
0472       if (fDebugLevel > 0) {
0473         std::cout
0474             << "No value "
0475             << Form("jethtplot.%s.%s%d", fJsonCategoryNameProfile.c_str(), fJsonNameLegendShiftColumnX.c_str(), iColumn)
0476             << " in configuration. Using default value " << fProfileLegendShiftColumnX[iColumn] << "." << std::endl;
0477       }
0478     }
0479   }
0480 
0481   // Read the columnwise legend shift in y-direction for legends in profile plots
0482   for (int iColumn = 0; iColumn < kMaxLegendColumns; iColumn++) {
0483     try {
0484       fProfileLegendShiftColumnY[iColumn] =
0485           configuration
0486               .get_child(Form(
0487                   "jethtplot.%s.%s%d", fJsonCategoryNameProfile.c_str(), fJsonNameLegendShiftColumnY.c_str(), iColumn))
0488               .get_value<double>();
0489     } catch (const std::exception& e) {
0490       if (fDebugLevel > 0) {
0491         std::cout
0492             << "No value "
0493             << Form("jethtplot.%s.%s%d", fJsonCategoryNameProfile.c_str(), fJsonNameLegendShiftColumnY.c_str(), iColumn)
0494             << " in configuration. Using default value " << fProfileLegendShiftColumnY[iColumn] << "." << std::endl;
0495       }
0496     }
0497   }
0498 
0499   // Read the legend text size for profile plots
0500   try {
0501     fProfileLegendTextSize =
0502         configuration
0503             .get_child(Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameLegendTextSize.c_str()))
0504             .get_value<double>();
0505   } catch (const std::exception& e) {
0506     if (fDebugLevel > 0) {
0507       std::cout << "No value "
0508                 << Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameLegendTextSize.c_str())
0509                 << " in configuration. Using default value " << fProfileLegendTextSize << "." << std::endl;
0510     }
0511   }
0512 
0513   // Read the legend text font for profile plots
0514   try {
0515     fProfileLegendTextFont =
0516         configuration
0517             .get_child(Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameLegendTextFont.c_str()))
0518             .get_value<int>();
0519   } catch (const std::exception& e) {
0520     if (fDebugLevel > 0) {
0521       std::cout << "No value "
0522                 << Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNameLegendTextFont.c_str())
0523                 << " in configuration. Using default value " << fProfileLegendTextFont << "." << std::endl;
0524     }
0525   }
0526 
0527   // Read the legend text referring to all runs
0528   try {
0529     fLegendTextForAllRuns =
0530         configuration.get_child(Form("jethtplot.%s", fJsonNameLegendTextForAllRuns.c_str())).get_value<std::string>();
0531   } catch (const std::exception& e) {
0532     if (fDebugLevel > 0) {
0533       std::cout << "No value " << Form("jethtplot.%s", fJsonNameLegendTextForAllRuns.c_str())
0534                 << " in configuration. Using default value " << fLegendTextForAllRuns << "." << std::endl;
0535     }
0536   }
0537 
0538   // Read the configuration for plotting individual IOV:s for dxy, dx and profile plots
0539   try {
0540     fDrawPlotsForEachIOV =
0541         configuration.get_child(Form("jethtplot.%s", fJsonDrawPlotsForEachIOV.c_str())).get_value<bool>();
0542   } catch (const std::exception& e) {
0543     if (fDebugLevel > 0) {
0544       std::cout << "No value " << Form("jethtplot.%s", fJsonDrawPlotsForEachIOV.c_str())
0545                 << " in configuration. Using default value " << fDrawPlotsForEachIOV << "." << std::endl;
0546     }
0547   }
0548 
0549   // Read the number of IOVs plotted in the same figure, if individual IOV are plotted for profiles
0550   try {
0551     fNIovInOnePlot =
0552         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNIovInOnePlot.c_str()))
0553             .get_value<int>();
0554   } catch (const std::exception& e) {
0555     if (fDebugLevel > 0) {
0556       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameProfile.c_str(), fJsonNIovInOnePlot.c_str())
0557                 << " in configuration. Using default value " << fNIovInOnePlot << "." << std::endl;
0558     }
0559   }
0560 
0561   // Read the axis zoom values for profile plots
0562   for (int iProfile = 0; iProfile < knProfileTypes; iProfile++) {
0563     try {
0564       fProfileZoomLow[iProfile] =
0565           configuration
0566               .get_child(Form(
0567                   "jethtplot.%s.min%s", fJsonCategoryNameProfileZoom.c_str(), fJsonNameProfileZoom[iProfile].c_str()))
0568               .get_value<double>();
0569     } catch (const std::exception& e) {
0570       if (fDebugLevel > 0) {
0571         std::cout << "No value "
0572                   << Form("jethtplot.%s.min%s",
0573                           fJsonCategoryNameProfileZoom.c_str(),
0574                           fJsonNameProfileZoom[iProfile].c_str())
0575                   << " in configuration. Using default value " << fProfileZoomLow[iProfile] << "." << std::endl;
0576       }
0577     }
0578 
0579     try {
0580       fProfileZoomHigh[iProfile] =
0581           configuration
0582               .get_child(Form(
0583                   "jethtplot.%s.max%s", fJsonCategoryNameProfileZoom.c_str(), fJsonNameProfileZoom[iProfile].c_str()))
0584               .get_value<double>();
0585     } catch (const std::exception& e) {
0586       if (fDebugLevel > 0) {
0587         std::cout << "No value "
0588                   << Form("jethtplot.%s.max%s",
0589                           fJsonCategoryNameProfileZoom.c_str(),
0590                           fJsonNameProfileZoom[iProfile].c_str())
0591                   << " in configuration. Using default value " << fProfileZoomHigh[iProfile] << "." << std::endl;
0592       }
0593     }
0594   }
0595 
0596   // Read the drawing configuration for trend plots
0597   for (int iTrend = 0; iTrend < knTrendTypes; iTrend++) {
0598     try {
0599       fDrawTrend[iTrend] =
0600           configuration
0601               .get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTrend[iTrend].c_str()))
0602               .get_value<bool>();
0603     } catch (const std::exception& e) {
0604       if (fDebugLevel > 0) {
0605         std::cout << "No value "
0606                   << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTrend[iTrend].c_str())
0607                   << " in configuration. Using default value " << fDrawTrend[iTrend] << "." << std::endl;
0608       }
0609     }
0610   }
0611 
0612   // Read the total legend shift in x-direction for legends in trend plots
0613   try {
0614     fTrendLegendShiftTotalX =
0615         configuration
0616             .get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLegendShiftTotalX.c_str()))
0617             .get_value<double>();
0618   } catch (const std::exception& e) {
0619     if (fDebugLevel > 0) {
0620       std::cout << "No value "
0621                 << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLegendShiftTotalX.c_str())
0622                 << " in configuration. Using default value " << fTrendLegendShiftTotalX << "." << std::endl;
0623     }
0624   }
0625 
0626   // Read the total legend shift in y-direction for legends in trend plots
0627   try {
0628     fTrendLegendShiftTotalY =
0629         configuration
0630             .get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLegendShiftTotalY.c_str()))
0631             .get_value<double>();
0632   } catch (const std::exception& e) {
0633     if (fDebugLevel > 0) {
0634       std::cout << "No value "
0635                 << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLegendShiftTotalY.c_str())
0636                 << " in configuration. Using default value " << fTrendLegendShiftTotalY << "." << std::endl;
0637     }
0638   }
0639 
0640   // Read the legend text size for trend plots
0641   try {
0642     fTrendLegendTextSize =
0643         configuration
0644             .get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLegendTextSize.c_str()))
0645             .get_value<double>();
0646   } catch (const std::exception& e) {
0647     if (fDebugLevel > 0) {
0648       std::cout << "No value "
0649                 << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLegendTextSize.c_str())
0650                 << " in configuration. Using default value " << fTrendLegendTextSize << "." << std::endl;
0651     }
0652   }
0653 
0654   // Read the legend text font for trend plots
0655   try {
0656     fTrendLegendTextFont =
0657         configuration
0658             .get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLegendTextFont.c_str()))
0659             .get_value<int>();
0660   } catch (const std::exception& e) {
0661     if (fDebugLevel > 0) {
0662       std::cout << "No value "
0663                 << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLegendTextFont.c_str())
0664                 << " in configuration. Using default value " << fTrendLegendTextFont << "." << std::endl;
0665     }
0666   }
0667 
0668   // Read the flag for drawing vertical lines to trend plots
0669   try {
0670     fDrawYearLines =
0671         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonDrawYearLines.c_str()))
0672             .get_value<bool>();
0673   } catch (const std::exception& e) {
0674     if (fDebugLevel > 0) {
0675       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonDrawYearLines.c_str())
0676                 << " in configuration. Using default value " << fDrawYearLines << "." << std::endl;
0677     }
0678   }
0679 
0680   // Read the line color for year lines in trend plots
0681   try {
0682     fYearLineColor =
0683         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonYearLineColor.c_str()))
0684             .get_value<int>();
0685   } catch (const std::exception& e) {
0686     if (fDebugLevel > 0) {
0687       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonYearLineColor.c_str())
0688                 << " in configuration. Using default value " << fYearLineColor << "." << std::endl;
0689     }
0690   }
0691 
0692   // Read the line witdh for year lines in trend plots
0693   try {
0694     fYearLineWidth =
0695         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonYearLineWidth.c_str()))
0696             .get_value<int>();
0697   } catch (const std::exception& e) {
0698     if (fDebugLevel > 0) {
0699       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonYearLineWidth.c_str())
0700                 << " in configuration. Using default value " << fYearLineWidth << "." << std::endl;
0701     }
0702   }
0703 
0704   // Read the line style for year lines in trend plots
0705   try {
0706     fYearLineStyle =
0707         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonYearLineStyle.c_str()))
0708             .get_value<int>();
0709   } catch (const std::exception& e) {
0710     if (fDebugLevel > 0) {
0711       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonYearLineStyle.c_str())
0712                 << " in configuration. Using default value " << fYearLineStyle << "." << std::endl;
0713     }
0714   }
0715 
0716   // Read run positions to which vertical lines are drawn in trend plots
0717   try {
0718     for (auto& item :
0719          configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonRunsForLines.c_str()))) {
0720       fRunsForLines.push_back(item.second.get_value<int>());
0721     }
0722   } catch (const std::exception& e) {
0723     if (fDebugLevel > 0) {
0724       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonRunsForLines.c_str())
0725                 << " in configuration. Using default values 290543 and 314881." << std::endl;
0726     }
0727     fRunsForLines.push_back(290543);
0728     fRunsForLines.push_back(314881);
0729   }
0730 
0731   // Read the flag for drawing manual tags to trend plots
0732   try {
0733     fDrawTrendTag =
0734         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameDrawTag.c_str()))
0735             .get_value<bool>();
0736   } catch (const std::exception& e) {
0737     if (fDebugLevel > 0) {
0738       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameDrawTag.c_str())
0739                 << " in configuration. Using default value " << fDrawTrendTag << "." << std::endl;
0740     }
0741   }
0742 
0743   // Read the configuration for tags in trend plots
0744   try {
0745     int itemIndex = 0;
0746     for (auto& configurationArray :
0747          configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTagInfo.c_str()))) {
0748       itemIndex = 0;
0749       for (auto& item : configurationArray.second) {
0750         if (itemIndex == 0) {
0751           fTrendTagText.push_back(item.second.get_value<std::string>());
0752         }
0753         if (itemIndex == 1) {
0754           fTrendTagPositionX.push_back(item.second.get_value<double>());
0755         }
0756         if (itemIndex == 2) {
0757           fTrendTagPositionY.push_back(item.second.get_value<double>());
0758         }
0759         itemIndex++;
0760       }
0761     }
0762   } catch (const std::exception& e) {
0763     if (fDebugLevel > 0) {
0764       std::cout << "There was either no value for "
0765                 << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTagInfo.c_str())
0766                 << " in configuration, or the input was in wrong format. Using default values 2016 at (0.105,0.855), "
0767                    "2017 at (0.305,0.855) and 2018 at (0.563,0.855)."
0768                 << std::endl;
0769     }
0770     fTrendTagText.clear();
0771     fTrendTagText.push_back("2016");
0772     fTrendTagText.push_back("2017");
0773     fTrendTagText.push_back("2018");
0774     fTrendTagPositionX.clear();
0775     fTrendTagPositionX.push_back(0.105);
0776     fTrendTagPositionX.push_back(0.305);
0777     fTrendTagPositionX.push_back(0.563);
0778     fTrendTagPositionY.clear();
0779     fTrendTagPositionY.push_back(0.855);
0780     fTrendTagPositionY.push_back(0.855);
0781     fTrendTagPositionY.push_back(0.855);
0782   }
0783 
0784   // Read the tag text size for trend plots
0785   try {
0786     fTrendTagTextSize =
0787         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTagTextSize.c_str()))
0788             .get_value<double>();
0789   } catch (const std::exception& e) {
0790     if (fDebugLevel > 0) {
0791       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTagTextSize.c_str())
0792                 << " in configuration. Using default value " << fTrendTagTextSize << "." << std::endl;
0793     }
0794   }
0795 
0796   // Read the tag text font for trend plots
0797   try {
0798     fTrendTagTextFont =
0799         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTagTextFont.c_str()))
0800             .get_value<int>();
0801   } catch (const std::exception& e) {
0802     if (fDebugLevel > 0) {
0803       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTagTextFont.c_str())
0804                 << " in configuration. Using default value " << fTrendTagTextFont << "." << std::endl;
0805     }
0806   }
0807 
0808   // Read the trend plot canvas height
0809   try {
0810     fTrendCanvasHeight =
0811         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameCanvasHeight.c_str()))
0812             .get_value<int>();
0813   } catch (const std::exception& e) {
0814     if (fDebugLevel > 0) {
0815       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameCanvasHeight.c_str())
0816                 << " in configuration. Using default value " << fTrendCanvasHeight << "." << std::endl;
0817     }
0818   }
0819 
0820   // Read the trend plot canvas width
0821   try {
0822     fTrendCanvasWidth =
0823         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameCanvasWidth.c_str()))
0824             .get_value<int>();
0825   } catch (const std::exception& e) {
0826     if (fDebugLevel > 0) {
0827       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameCanvasWidth.c_str())
0828                 << " in configuration. Using default value " << fTrendCanvasWidth << "." << std::endl;
0829     }
0830   }
0831 
0832   // Read the left margin for trend plots
0833   try {
0834     fTrendMarginLeft =
0835         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameMarginLeft.c_str()))
0836             .get_value<double>();
0837   } catch (const std::exception& e) {
0838     if (fDebugLevel > 0) {
0839       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameMarginLeft.c_str())
0840                 << " in configuration. Using default value " << fTrendMarginLeft << "." << std::endl;
0841     }
0842   }
0843 
0844   // Read the right margin for trend plots
0845   try {
0846     fTrendMarginRight =
0847         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameMarginRight.c_str()))
0848             .get_value<double>();
0849   } catch (const std::exception& e) {
0850     if (fDebugLevel > 0) {
0851       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameMarginRight.c_str())
0852                 << " in configuration. Using default value " << fTrendMarginRight << "." << std::endl;
0853     }
0854   }
0855 
0856   // Read the top margin for trend plots
0857   try {
0858     fTrendMarginTop =
0859         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameMarginTop.c_str()))
0860             .get_value<double>();
0861   } catch (const std::exception& e) {
0862     if (fDebugLevel > 0) {
0863       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameMarginTop.c_str())
0864                 << " in configuration. Using default value " << fTrendMarginTop << "." << std::endl;
0865     }
0866   }
0867 
0868   // Read the bottom margin for trend plots
0869   try {
0870     fTrendMarginBottom =
0871         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameMarginBottom.c_str()))
0872             .get_value<double>();
0873   } catch (const std::exception& e) {
0874     if (fDebugLevel > 0) {
0875       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameMarginBottom.c_str())
0876                 << " in configuration. Using default value " << fTrendMarginBottom << "." << std::endl;
0877     }
0878   }
0879 
0880   // Read the offset of the x-axis title in trend plots
0881   try {
0882     fTrendTitleOffsetX =
0883         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTitleOffsetX.c_str()))
0884             .get_value<double>();
0885   } catch (const std::exception& e) {
0886     if (fDebugLevel > 0) {
0887       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTitleOffsetX.c_str())
0888                 << " in configuration. Using default value " << fTrendTitleOffsetX << "." << std::endl;
0889     }
0890   }
0891 
0892   // Read the offset of the y-axis title in trend plots
0893   try {
0894     fTrendTitleOffsetY =
0895         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTitleOffsetY.c_str()))
0896             .get_value<double>();
0897   } catch (const std::exception& e) {
0898     if (fDebugLevel > 0) {
0899       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTitleOffsetY.c_str())
0900                 << " in configuration. Using default value " << fTrendTitleOffsetY << "." << std::endl;
0901     }
0902   }
0903 
0904   // Read the size of the x-axis title in trend plots
0905   try {
0906     fTrendTitleSizeX =
0907         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTitleSizeX.c_str()))
0908             .get_value<double>();
0909   } catch (const std::exception& e) {
0910     if (fDebugLevel > 0) {
0911       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTitleSizeX.c_str())
0912                 << " in configuration. Using default value " << fTrendTitleSizeX << "." << std::endl;
0913     }
0914   }
0915 
0916   // Read the size of the y-axis title in trend plots
0917   try {
0918     fTrendTitleSizeY =
0919         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTitleSizeY.c_str()))
0920             .get_value<double>();
0921   } catch (const std::exception& e) {
0922     if (fDebugLevel > 0) {
0923       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameTitleSizeY.c_str())
0924                 << " in configuration. Using default value " << fTrendTitleSizeY << "." << std::endl;
0925     }
0926   }
0927 
0928   // Read the offset of the x-axis label in trend plots
0929   try {
0930     fTrendLabelOffsetX =
0931         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLabelOffsetX.c_str()))
0932             .get_value<double>();
0933   } catch (const std::exception& e) {
0934     if (fDebugLevel > 0) {
0935       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLabelOffsetX.c_str())
0936                 << " in configuration. Using default value " << fTrendLabelOffsetX << "." << std::endl;
0937     }
0938   }
0939 
0940   // Read the offset of the y-axis label in trend plots
0941   try {
0942     fTrendLabelOffsetY =
0943         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLabelOffsetY.c_str()))
0944             .get_value<double>();
0945   } catch (const std::exception& e) {
0946     if (fDebugLevel > 0) {
0947       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLabelOffsetY.c_str())
0948                 << " in configuration. Using default value " << fTrendLabelOffsetY << "." << std::endl;
0949     }
0950   }
0951 
0952   // Read the size of the x-axis label in trend plots
0953   try {
0954     fTrendLabelSizeX =
0955         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLabelSizeX.c_str()))
0956             .get_value<double>();
0957   } catch (const std::exception& e) {
0958     if (fDebugLevel > 0) {
0959       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLabelSizeX.c_str())
0960                 << " in configuration. Using default value " << fTrendLabelSizeX << "." << std::endl;
0961     }
0962   }
0963 
0964   // Read the size of the y-axis label in trend plots
0965   try {
0966     fTrendLabelSizeY =
0967         configuration.get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLabelSizeY.c_str()))
0968             .get_value<double>();
0969   } catch (const std::exception& e) {
0970     if (fDebugLevel > 0) {
0971       std::cout << "No value " << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonNameLabelSizeY.c_str())
0972                 << " in configuration. Using default value " << fTrendLabelSizeY << "." << std::endl;
0973     }
0974   }
0975 
0976   // Read the configuration for plotting trends plots as a function of luminosity
0977   try {
0978     fUseLuminosityForTrends =
0979         configuration
0980             .get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonUseLuminosityForTrends.c_str()))
0981             .get_value<bool>();
0982   } catch (const std::exception& e) {
0983     if (fDebugLevel > 0) {
0984       std::cout << "No value "
0985                 << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonUseLuminosityForTrends.c_str())
0986                 << " in configuration. Using default value " << fUseLuminosityForTrends << "." << std::endl;
0987     }
0988   }
0989 
0990   // Read the configuration for skipping runs with no data in trend plots
0991   try {
0992     fSkipRunsWithNoData =
0993         configuration
0994             .get_child(Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonSkipRunsWithNoData.c_str()))
0995             .get_value<bool>();
0996   } catch (const std::exception& e) {
0997     if (fDebugLevel > 0) {
0998       std::cout << "No value "
0999                 << Form("jethtplot.%s.%s", fJsonCategoryNameTrend.c_str(), fJsonSkipRunsWithNoData.c_str())
1000                 << " in configuration. Using default value " << fSkipRunsWithNoData << "." << std::endl;
1001     }
1002   }
1003 
1004   // Read the axis zoom values for trend plots
1005   for (int iTrend = 0; iTrend < knTrendTypes; iTrend++) {
1006     try {
1007       fTrendZoomLow[iTrend] =
1008           configuration
1009               .get_child(
1010                   Form("jethtplot.%s.min%s", fJsonCategoryNameTrendZoom.c_str(), fJsonNameTrendZoom[iTrend].c_str()))
1011               .get_value<double>();
1012     } catch (const std::exception& e) {
1013       if (fDebugLevel > 0) {
1014         std::cout << "No value "
1015                   << Form("jethtplot.%s.min%s", fJsonCategoryNameTrendZoom.c_str(), fJsonNameTrendZoom[iTrend].c_str())
1016                   << " in configuration. Using default value " << fTrendZoomLow[iTrend] << "." << std::endl;
1017       }
1018     }
1019 
1020     try {
1021       fTrendZoomHigh[iTrend] =
1022           configuration
1023               .get_child(
1024                   Form("jethtplot.%s.max%s", fJsonCategoryNameTrendZoom.c_str(), fJsonNameTrendZoom[iTrend].c_str()))
1025               .get_value<double>();
1026     } catch (const std::exception& e) {
1027       if (fDebugLevel > 0) {
1028         std::cout << "No value "
1029                   << Form("jethtplot.%s.max%s", fJsonCategoryNameTrendZoom.c_str(), fJsonNameTrendZoom[iTrend].c_str())
1030                   << " in configuration. Using default value " << fTrendZoomHigh[iTrend] << "." << std::endl;
1031       }
1032     }
1033   }
1034 
1035   // Read the configuration for normalizing QA plots by their integral
1036   try {
1037     fNormalizeQAplots = configuration.get_child(Form("jethtplot.%s", fJsonNormalizeQAplots.c_str())).get_value<bool>();
1038   } catch (const std::exception& e) {
1039     if (fDebugLevel > 0) {
1040       std::cout << "No value " << Form("jethtplot.%s", fJsonNormalizeQAplots.c_str())
1041                 << " in configuration. Using default value " << fNormalizeQAplots << "." << std::endl;
1042     }
1043   }
1044 
1045   // Read comment given to saved figures
1046   try {
1047     fSaveComment = configuration.get_child(Form("jethtplot.%s", fJsonSaveComment.c_str())).get_value<std::string>();
1048   } catch (const std::exception& e) {
1049     if (fDebugLevel > 0) {
1050       std::cout << "No value " << Form("jethtplot.%s", fJsonSaveComment.c_str())
1051                 << " in configuration. Using default value (empty string)." << std::endl;
1052     }
1053   }
1054 
1055   // Read the file name for luminosity per IOV
1056   try {
1057     fLumiPerIovFile =
1058         configuration.get_child(Form("jethtplot.%s", fJsonLumiPerIovFile.c_str())).get_value<std::string>();
1059 
1060     // From the file name, expand environment variables
1061     autoExpandEnvironmentVariables(fLumiPerIovFile);
1062 
1063     // Expand CMSSW_BASE even without preceding $-sign
1064     boost::replace_all(fLumiPerIovFile, "CMSSW_BASE", getenv("CMSSW_BASE"));
1065 
1066     // If file doesn't exist search elsewhere
1067 
1068   } catch (const std::exception& e) {
1069     if (fDebugLevel > 0) {
1070       std::cout << "No value " << Form("jethtplot.%s", fJsonLumiPerIovFile.c_str())
1071                 << " in configuration. Using default value " << fLumiPerIovFile << "." << std::endl;
1072     }
1073   }
1074 
1075   // Read the IOV list mode. Either "run" or "IOV"
1076   try {
1077     fIovListMode = configuration.get_child(Form("jethtplot.%s", fJsonIovListMode.c_str())).get_value<std::string>();
1078   } catch (const std::exception& e) {
1079     if (fDebugLevel > 0) {
1080       std::cout << "No value " << Form("jethtplot.%s", fJsonIovListMode.c_str())
1081                 << " in configuration. Using default value " << fIovListMode << "." << std::endl;
1082     }
1083   }
1084 
1085   // Read the bin borders for the wide pT bims.
1086   try {
1087     for (auto& item : configuration.get_child(Form("jethtplot.%s", fJsonWidePtBinBorders.c_str()))) {
1088       fWidePtBinBorders.push_back(item.second.get_value<double>());
1089     }
1090   } catch (const std::exception& e) {
1091     if (fDebugLevel > 0) {
1092       std::cout << "No value " << Form("jethtplot.%s", fJsonWidePtBinBorders.c_str())
1093                 << " in configuration. Using default values 3, 5, 10, 20, 50 and 100." << std::endl;
1094     }
1095     fWidePtBinBorders.push_back(3.0);
1096     fWidePtBinBorders.push_back(5.0);
1097     fWidePtBinBorders.push_back(10.0);
1098     fWidePtBinBorders.push_back(20.0);
1099     fWidePtBinBorders.push_back(50.0);
1100     fWidePtBinBorders.push_back(100.0);
1101   }
1102 
1103   // Read the flag for creating an IOV list for the slides
1104   try {
1105     fMakeIovListForSlides =
1106         configuration.get_child(Form("jethtplot.%s", fJsonMakeIovListForSlides.c_str())).get_value<bool>();
1107   } catch (const std::exception& e) {
1108     if (fDebugLevel > 0) {
1109       std::cout << "No value " << Form("jethtplot.%s", fJsonMakeIovListForSlides.c_str())
1110                 << " in configuration. Using default value " << fMakeIovListForSlides << "." << std::endl;
1111     }
1112   }
1113 
1114   // Read the output file name for the IOV list for the slides
1115   try {
1116     fIovListForSlides =
1117         configuration.get_child(Form("jethtplot.%s", fJsonIovListForSlides.c_str())).get_value<std::string>();
1118 
1119     // From the file name, expand environment variables
1120     autoExpandEnvironmentVariables(fIovListForSlides);
1121 
1122     // Expand CMSSW_BASE event without preceding $-sign
1123     boost::replace_all(fIovListForSlides, "CMSSW_BASE", getenv("CMSSW_BASE"));
1124 
1125   } catch (const std::exception& e) {
1126     if (fDebugLevel > 0) {
1127       std::cout << "No value " << Form("jethtplot.%s", fJsonIovListForSlides.c_str())
1128                 << " in configuration. Using default value " << fIovListForSlides << "." << std::endl;
1129     }
1130   }
1131 }
1132 
1133 /*
1134  * Print the current configuration to console
1135  */
1136 void JetHtPlotConfiguration::printConfiguration() const {
1137   // Print all input files
1138   std::cout << "Input files: " << std::endl;
1139   for (const std::string& fileName : fInputFileNames) {
1140     std::cout << fileName << std::endl;
1141   }
1142 
1143   // Print legend text related to input files
1144   std::cout << "Legend text related to input files: " << std::endl;
1145   for (const std::string& legendText : fLegendComments) {
1146     std::cout << legendText << std::endl;
1147   }
1148 
1149   // Print all marker colors
1150   std::cout << "Marker colors: " << std::endl;
1151   for (int color : fMarkerColor) {
1152     std::cout << color << std::endl;
1153   }
1154 
1155   // Print all marker styles
1156   std::cout << "Marker styles: " << std::endl;
1157   for (int style : fMarkerStyle) {
1158     std::cout << style << std::endl;
1159   }
1160 
1161   // Print all marker sizes
1162   std::cout << "Marker sizes: " << std::endl;
1163   for (int size : fMarkerSize) {
1164     std::cout << size << std::endl;
1165   }
1166 
1167   // Print all error color copying information
1168   std::cout << "Copy error colors: " << std::endl;
1169   for (bool color : fCopyErrorColor) {
1170     std::cout << color << std::endl;
1171   }
1172 
1173   // Print the configuration for QA plot drawing
1174   std::cout << fJsonTrackQAname << " : " << fDrawTrackQA << std::endl;
1175 
1176   // Print the configuration for histogram drawing
1177   for (int iHistogram = 0; iHistogram < knHistogramTypes; iHistogram++) {
1178     std::cout << fJsonCategoryNameHistogram << " " << fJsonNameHistogram[iHistogram] << " : "
1179               << fDrawHistogram[iHistogram] << std::endl;
1180   }
1181 
1182   // Print the configuration for profile plot drawing
1183   for (int iProfile = 0; iProfile < knProfileTypes; iProfile++) {
1184     std::cout << fJsonCategoryNameProfile << " " << fJsonNameProfile[iProfile] << " : " << fDrawProfile[iProfile]
1185               << std::endl;
1186   }
1187 
1188   // Print the configuration for reference profile drawing
1189   std::cout << fJsonCategoryNameProfile << " " << fJsonNameReferenceProfile << " : " << fDrawReferenceProfile
1190             << std::endl;
1191   std::cout << fJsonCategoryNameProfile << " " << fJsonNameCentralEtaSummaryProfile << " : "
1192             << fDrawCentralEtaSummaryProfile << std::endl;
1193 
1194   // Print the configuration for positioning the legends in profile plots
1195   std::cout << fJsonCategoryNameProfile << " " << fJsonNameLegendShiftTotalX << " : " << fProfileLegendShiftTotalX
1196             << std::endl;
1197   std::cout << fJsonCategoryNameProfile << " " << fJsonNameLegendShiftTotalY << " : " << fProfileLegendShiftTotalY
1198             << std::endl;
1199   for (int iColumn = 0; iColumn < kMaxLegendColumns; iColumn++) {
1200     std::cout << fJsonCategoryNameProfile << " " << fJsonNameLegendShiftColumnX << iColumn << " : "
1201               << fProfileLegendShiftColumnX[iColumn] << std::endl;
1202     std::cout << fJsonCategoryNameProfile << " " << fJsonNameLegendShiftColumnY << iColumn << " : "
1203               << fProfileLegendShiftColumnY[iColumn] << std::endl;
1204   }
1205   std::cout << fJsonCategoryNameProfile << " " << fJsonNameLegendTextSize << " : " << fProfileLegendTextSize
1206             << std::endl;
1207   std::cout << fJsonCategoryNameProfile << " " << fJsonNameLegendTextFont << " : " << fProfileLegendTextFont
1208             << std::endl;
1209 
1210   // Print the configuration for profile plot zoom
1211   for (int iProfile = 0; iProfile < knProfileTypes; iProfile++) {
1212     std::cout << fJsonCategoryNameProfileZoom << " min" << fJsonNameProfileZoom[iProfile] << " : "
1213               << fProfileZoomLow[iProfile] << std::endl;
1214     std::cout << fJsonCategoryNameProfileZoom << " max" << fJsonNameProfileZoom[iProfile] << " : "
1215               << fProfileZoomHigh[iProfile] << std::endl;
1216   }
1217 
1218   // Print the configuration for trend plot drawing
1219   for (int iTrend = 0; iTrend < knTrendTypes; iTrend++) {
1220     std::cout << fJsonCategoryNameTrend << " " << fJsonNameTrend[iTrend] << " : " << fDrawTrend[iTrend] << std::endl;
1221   }
1222 
1223   // Print the canvas information for trend plots
1224   std::cout << fJsonCategoryNameTrend << " " << fJsonNameCanvasHeight << " : " << fTrendCanvasHeight << std::endl;
1225   std::cout << fJsonCategoryNameTrend << " " << fJsonNameCanvasWidth << " : " << fTrendCanvasWidth << std::endl;
1226   std::cout << fJsonCategoryNameTrend << " " << fJsonNameMarginLeft << " : " << fTrendMarginLeft << std::endl;
1227   std::cout << fJsonCategoryNameTrend << " " << fJsonNameMarginRight << " : " << fTrendMarginRight << std::endl;
1228   std::cout << fJsonCategoryNameTrend << " " << fJsonNameMarginTop << " : " << fTrendMarginTop << std::endl;
1229   std::cout << fJsonCategoryNameTrend << " " << fJsonNameMarginBottom << " : " << fTrendMarginBottom << std::endl;
1230   std::cout << fJsonCategoryNameTrend << " " << fJsonNameTitleOffsetX << " : " << fTrendTitleOffsetX << std::endl;
1231   std::cout << fJsonCategoryNameTrend << " " << fJsonNameTitleOffsetY << " : " << fTrendTitleOffsetY << std::endl;
1232   std::cout << fJsonCategoryNameTrend << " " << fJsonNameTitleSizeX << " : " << fTrendTitleSizeX << std::endl;
1233   std::cout << fJsonCategoryNameTrend << " " << fJsonNameTitleSizeY << " : " << fTrendTitleSizeY << std::endl;
1234   std::cout << fJsonCategoryNameTrend << " " << fJsonNameLabelOffsetX << " : " << fTrendLabelOffsetX << std::endl;
1235   std::cout << fJsonCategoryNameTrend << " " << fJsonNameLabelOffsetY << " : " << fTrendLabelOffsetY << std::endl;
1236   std::cout << fJsonCategoryNameTrend << " " << fJsonNameLabelSizeX << " : " << fTrendLabelSizeX << std::endl;
1237   std::cout << fJsonCategoryNameTrend << " " << fJsonNameLabelSizeY << " : " << fTrendLabelSizeY << std::endl;
1238 
1239   // Print the configuration for positioning the legends in trend plots
1240   std::cout << fJsonCategoryNameTrend << " " << fJsonNameLegendShiftTotalX << " : " << fTrendLegendShiftTotalX
1241             << std::endl;
1242   std::cout << fJsonCategoryNameTrend << " " << fJsonNameLegendShiftTotalY << " : " << fTrendLegendShiftTotalY
1243             << std::endl;
1244   std::cout << fJsonCategoryNameTrend << " " << fJsonNameLegendTextSize << " : " << fTrendLegendTextSize << std::endl;
1245   std::cout << fJsonCategoryNameTrend << " " << fJsonNameLegendTextFont << " : " << fTrendLegendTextFont << std::endl;
1246 
1247   // Print the remaining configuration for trend plots
1248   std::cout << fJsonCategoryNameTrend << " " << fJsonDrawYearLines << " : " << fDrawYearLines << std::endl;
1249   std::cout << "Runs for vertical lines: " << std::endl;
1250   for (int myRun : fRunsForLines) {
1251     std::cout << myRun << " ";
1252   }
1253   std::cout << std::endl;
1254   std::cout << fJsonCategoryNameTrend << " " << fJsonYearLineColor << " : " << fYearLineColor << std::endl;
1255   std::cout << fJsonCategoryNameTrend << " " << fJsonYearLineWidth << " : " << fYearLineWidth << std::endl;
1256   std::cout << fJsonCategoryNameTrend << " " << fJsonYearLineStyle << " : " << fYearLineStyle << std::endl;
1257   std::cout << fJsonCategoryNameTrend << " " << fJsonUseLuminosityForTrends << " : " << fUseLuminosityForTrends
1258             << std::endl;
1259   std::cout << fJsonCategoryNameTrend << " " << fJsonSkipRunsWithNoData << " : " << fSkipRunsWithNoData << std::endl;
1260 
1261   std::cout << fJsonCategoryNameTrend << " " << fJsonNameTagInfo << " : " << fDrawTrendTag << std::endl;
1262   for (std::vector<std::string>::size_type iTag = 0; iTag < fTrendTagText.size(); iTag++) {
1263     std::cout << "Tag" << iTag << ": " << fTrendTagText.at(iTag) << " x=" << fTrendTagPositionX.at(iTag)
1264               << " y=" << fTrendTagPositionY.at(iTag) << std::endl;
1265   }
1266   std::cout << fJsonCategoryNameTrend << " " << fJsonNameTagTextSize << " : " << fTrendTagTextSize << std::endl;
1267   std::cout << fJsonCategoryNameTrend << " " << fJsonNameTagTextFont << " : " << fTrendTagTextFont << std::endl;
1268 
1269   // Print the configuration for trend plot zoom
1270   for (int iTrend = 0; iTrend < knTrendTypes; iTrend++) {
1271     std::cout << fJsonCategoryNameTrendZoom << " min" << fJsonNameTrendZoom[iTrend] << " : " << fTrendZoomLow[iTrend]
1272               << std::endl;
1273     std::cout << fJsonCategoryNameTrendZoom << " max" << fJsonNameTrendZoom[iTrend] << " : " << fTrendZoomHigh[iTrend]
1274               << std::endl;
1275   }
1276 
1277   // Print plotting configuration values
1278   std::cout << fJsonLumiPerIovFile << " : " << fLumiPerIovFile << std::endl;
1279   std::cout << fJsonIovListMode << " : " << fIovListMode << std::endl;
1280   std::cout << fJsonNameLegendTextForAllRuns << " : " << fLegendTextForAllRuns << std::endl;
1281 
1282   std::cout << "Wide pT bin borders: " << std::endl;
1283   for (double myPt : fWidePtBinBorders) {
1284     std::cout << myPt << " ";
1285   }
1286   std::cout << std::endl;
1287 
1288   std::cout << fJsonDrawPlotsForEachIOV << " : " << fDrawPlotsForEachIOV << std::endl;
1289   std::cout << fJsonNIovInOnePlot << " : " << fNIovInOnePlot << std::endl;
1290   std::cout << fJsonNormalizeQAplots << " : " << fNormalizeQAplots << std::endl;
1291 
1292   std::cout << fJsonMakeIovListForSlides << " : " << fMakeIovListForSlides << std::endl;
1293   std::cout << fJsonIovListForSlides << " : " << fIovListForSlides << std::endl;
1294 
1295   // Print the save comment
1296   std::cout << "Saved files are given a comment: " << fSaveComment << std::endl;
1297 }
1298 
1299 // Getter for track QA histogram drawing flag
1300 bool JetHtPlotConfiguration::drawTrackQA() const { return fDrawTrackQA; }
1301 
1302 // Getter for dxy and dz histogram drawing flags
1303 bool JetHtPlotConfiguration::drawHistogram(const int iHistogram) const { return fDrawHistogram[iHistogram]; }
1304 
1305 // Getter for profile drawing flags
1306 bool JetHtPlotConfiguration::drawProfile(const int iProfile) const { return fDrawProfile[iProfile]; }
1307 
1308 // Getter for drawing reference profile
1309 bool JetHtPlotConfiguration::drawReferenceProfile() const { return fDrawReferenceProfile; }
1310 
1311 // Getter for drawing central eta histograms to the all runs summary plots
1312 bool JetHtPlotConfiguration::drawCentralEtaSummaryProfile() const { return fDrawCentralEtaSummaryProfile; }
1313 
1314 // Getter for total legend shift in x-direction for the profile plots
1315 double JetHtPlotConfiguration::profileLegendShiftTotalX() const { return fProfileLegendShiftTotalX; }
1316 
1317 // Getter for total legend shift in x-direction for the profile plots
1318 double JetHtPlotConfiguration::profileLegendShiftTotalY() const { return fProfileLegendShiftTotalY; }
1319 
1320 // Getter for columnwise legend shift in x-direction for iColumnth column in the profile plots
1321 double JetHtPlotConfiguration::profileLegendShiftColumnX(const int iColumn) const {
1322   if (iColumn < 0 || iColumn >= kMaxLegendColumns)
1323     return 0;
1324   return fProfileLegendShiftColumnX[iColumn];
1325 }
1326 
1327 // Getter for columnwise legend shift in x-direction for iColumnth column in the profile plots
1328 double JetHtPlotConfiguration::profileLegendShiftColumnY(const int iColumn) const {
1329   if (iColumn < 0 || iColumn >= kMaxLegendColumns)
1330     return 0;
1331   return fProfileLegendShiftColumnY[iColumn];
1332 }
1333 
1334 // Getter for text size in profile plots
1335 double JetHtPlotConfiguration::profileLegendTextSize() const { return fProfileLegendTextSize; }
1336 
1337 // Getter for text font in profile plots
1338 int JetHtPlotConfiguration::profileLegendTextFont() const { return fProfileLegendTextFont; }
1339 
1340 // Getter for text string used to describe all runs
1341 std::string JetHtPlotConfiguration::legendTextForAllRuns() const { return fLegendTextForAllRuns; }
1342 
1343 // Getter for low end of profile axis zooms
1344 double JetHtPlotConfiguration::profileZoomLow(const int iProfile) const { return fProfileZoomLow[iProfile]; }
1345 
1346 // Getter for high end of profile axis zooms
1347 double JetHtPlotConfiguration::profileZoomHigh(const int iProfile) const { return fProfileZoomHigh[iProfile]; }
1348 
1349 // Getter for trend drawing flags
1350 bool JetHtPlotConfiguration::drawTrend(const int iTrend) const { return fDrawTrend[iTrend]; }
1351 
1352 // Getter for total legend shift in x-direction for the trend plots
1353 double JetHtPlotConfiguration::trendLegendShiftTotalX() const { return fTrendLegendShiftTotalX; }
1354 
1355 // Getter for total legend shift in x-direction for the trend plots
1356 double JetHtPlotConfiguration::trendLegendShiftTotalY() const { return fTrendLegendShiftTotalY; }
1357 
1358 // Getter for text size in trend plots
1359 double JetHtPlotConfiguration::trendLegendTextSize() const { return fTrendLegendTextSize; }
1360 
1361 // Getter for text font in trend plots
1362 int JetHtPlotConfiguration::trendLegendTextFont() const { return fTrendLegendTextFont; }
1363 
1364 // Getter for drawing tags to the trend plots
1365 bool JetHtPlotConfiguration::drawTrendTag() const { return fDrawTrendTag; }
1366 
1367 // Getter for tag list for the trend plot
1368 std::vector<std::string> JetHtPlotConfiguration::trendTagText() const { return fTrendTagText; }
1369 
1370 // Getter for x-positions of the tags in the trend plots
1371 std::vector<double> JetHtPlotConfiguration::trendTagPositionX() const { return fTrendTagPositionX; }
1372 
1373 // Getter for y-positions of the tags in the trend plots
1374 std::vector<double> JetHtPlotConfiguration::trendTagPositionY() const { return fTrendTagPositionY; }
1375 
1376 // Getter for text size in tags of trend plots
1377 double JetHtPlotConfiguration::trendTagTextSize() const { return fTrendTagTextSize; }
1378 
1379 // Getter for text font in tags of trend plots
1380 int JetHtPlotConfiguration::trendTagTextFont() const { return fTrendTagTextFont; }
1381 
1382 // Getter for trend plot canvas height
1383 int JetHtPlotConfiguration::trendCanvasHeight() const { return fTrendCanvasHeight; }
1384 
1385 // Getter for trend plot canvas width
1386 int JetHtPlotConfiguration::trendCanvasWidth() const { return fTrendCanvasWidth; }
1387 
1388 // Getter for the left margin in trend plots
1389 double JetHtPlotConfiguration::trendMarginLeft() const { return fTrendMarginLeft; }
1390 
1391 // Getter for the right margin in trend plots
1392 double JetHtPlotConfiguration::trendMarginRight() const { return fTrendMarginRight; }
1393 
1394 // Getter for the top margin in trend plots
1395 double JetHtPlotConfiguration::trendMarginTop() const { return fTrendMarginTop; }
1396 
1397 // Getter for the bottom margin in trend plots
1398 double JetHtPlotConfiguration::trendMarginBottom() const { return fTrendMarginBottom; }
1399 
1400 // Getter for the offset of the x-axis title in trend plots
1401 double JetHtPlotConfiguration::trendTitleOffsetX() const { return fTrendTitleOffsetX; }
1402 
1403 // Getter for the offset of the y-axis title in trend plots
1404 double JetHtPlotConfiguration::trendTitleOffsetY() const { return fTrendTitleOffsetY; }
1405 
1406 // Getter for the size of the x-axis title in trend plots
1407 double JetHtPlotConfiguration::trendTitleSizeX() const { return fTrendTitleSizeX; }
1408 
1409 // Getter for the size of the y-axis title in trend plots
1410 double JetHtPlotConfiguration::trendTitleSizeY() const { return fTrendTitleSizeY; }
1411 
1412 // Getter for the offset of the x-axis label in trend plots
1413 double JetHtPlotConfiguration::trendLabelOffsetX() const { return fTrendLabelOffsetX; }
1414 
1415 // Getter for the offset of the y-axis label in trend plots
1416 double JetHtPlotConfiguration::trendLabelOffsetY() const { return fTrendLabelOffsetY; }
1417 
1418 // Getter for the size of the x-axis label in trend plots
1419 double JetHtPlotConfiguration::trendLabelSizeX() const { return fTrendLabelSizeX; }
1420 
1421 // Getter for the size of the y-axis label in trend plots
1422 double JetHtPlotConfiguration::trendLabelSizeY() const { return fTrendLabelSizeY; }
1423 
1424 // Getter for low end of trend axis zooms
1425 double JetHtPlotConfiguration::trendZoomLow(const int iTrend) const { return fTrendZoomLow[iTrend]; }
1426 
1427 // Getter for high end of trend axis zooms
1428 double JetHtPlotConfiguration::trendZoomHigh(const int iTrend) const { return fTrendZoomHigh[iTrend]; }
1429 
1430 // Getter for number of input files
1431 int JetHtPlotConfiguration::nInputFiles() const { return fInputFileNames.size(); }
1432 
1433 // Getter for input file of index iFile
1434 std::string JetHtPlotConfiguration::inputFile(const int iFile) const {
1435   const int inputFileCount = fInputFileNames.size();
1436   if (iFile < 0 || iFile >= inputFileCount)
1437     return "";
1438   return fInputFileNames.at(iFile);
1439 }
1440 
1441 // Getter for input file vector
1442 std::vector<std::string> JetHtPlotConfiguration::inputFiles() const { return fInputFileNames; }
1443 
1444 // Getter for a comment added to the legend
1445 std::string JetHtPlotConfiguration::legendComment(const int iComment) const {
1446   const int commentCount = fLegendComments.size();
1447   if (iComment < 0 || iComment >= commentCount)
1448     return "";
1449   return fLegendComments.at(iComment);
1450 }
1451 
1452 // Getter for the marker color related to an alignment
1453 int JetHtPlotConfiguration::markerColor(const int iFile) const {
1454   if (iFile < 0)
1455     return kBlack;
1456   if (iFile > 10)
1457     return kBlack;
1458   const int markerColorCount = fMarkerColor.size();
1459   if (iFile >= markerColorCount)
1460     return fDefaultColors[iFile];
1461   return fMarkerColor.at(iFile);
1462 }
1463 
1464 // Getter for the marker style related to an alignment
1465 int JetHtPlotConfiguration::markerStyle(const int iFile) const {
1466   const int markerStyleCount = fMarkerStyle.size();
1467   if (iFile < 0 || iFile >= markerStyleCount)
1468     return fDefaultStyle;
1469   return fMarkerStyle.at(iFile);
1470 }
1471 
1472 // Getter for the marker size related to an alignment
1473 int JetHtPlotConfiguration::markerSize(const int iFile) const {
1474   const int markerSizeCount = fMarkerSize.size();
1475   if (iFile < 0 || iFile >= markerSizeCount)
1476     return fDefaultMarkerSize;
1477   return fMarkerSize.at(iFile);
1478 }
1479 
1480 // Getter for flags to copy error bar colors related to an alignment
1481 bool JetHtPlotConfiguration::copyErrorColor(const int iFile) const {
1482   const int errorCopyCount = fCopyErrorColor.size();
1483   if (iFile < 0 || iFile >= errorCopyCount)
1484     return false;
1485   return fCopyErrorColor.at(iFile);
1486 }
1487 
1488 // Getter for the luminosity per IOV file
1489 const char* JetHtPlotConfiguration::lumiPerIovFile() const { return fLumiPerIovFile.c_str(); }
1490 
1491 // Getter for the IOV list mode
1492 const char* JetHtPlotConfiguration::iovListMode() const { return fIovListMode.c_str(); }
1493 
1494 // Getter for the flag for drawing vertical lines to trend plots
1495 bool JetHtPlotConfiguration::drawYearLines() const { return fDrawYearLines; }
1496 
1497 // Getter for color of the vertical lines drawn to trend plots
1498 int JetHtPlotConfiguration::yearLineColor() const { return fYearLineColor; }
1499 
1500 // Getter for color of the vertical lines drawn to trend plots
1501 int JetHtPlotConfiguration::yearLineWidth() const { return fYearLineWidth; }
1502 
1503 // Getter for color of the vertical lines drawn to trend plots
1504 int JetHtPlotConfiguration::yearLineStyle() const { return fYearLineStyle; }
1505 
1506 // Getter for the run positions to where vertical lines are drawn
1507 std::vector<int> JetHtPlotConfiguration::runsForLines() const { return fRunsForLines; }
1508 
1509 // Getter for bin borders used in the wide pT binned histogram
1510 std::vector<double> JetHtPlotConfiguration::widePtBinBorders() const { return fWidePtBinBorders; }
1511 
1512 // Getter for drawing plots for each IOV
1513 bool JetHtPlotConfiguration::drawPlotsForEachIOV() const { return fDrawPlotsForEachIOV; }
1514 
1515 // Getter for number of IOVs plotted in each figure
1516 int JetHtPlotConfiguration::nIovInOnePlot() const { return fNIovInOnePlot; }
1517 
1518 // Getter for drawing trends as a function of luminosity
1519 bool JetHtPlotConfiguration::useLuminosityForTrends() const { return fUseLuminosityForTrends; }
1520 
1521 // Getter for skipping runs with no data in trend plots
1522 bool JetHtPlotConfiguration::skipRunsWithNoData() const { return fSkipRunsWithNoData; }
1523 
1524 // Getter for normalizing QA plots
1525 bool JetHtPlotConfiguration::normalizeQAplots() const { return fNormalizeQAplots; }
1526 
1527 // Getter for comment given to saved figures
1528 const char* JetHtPlotConfiguration::saveComment() const { return fSaveComment.c_str(); }
1529 
1530 // Getter for flag to produce IOV list for slides
1531 bool JetHtPlotConfiguration::makeIovListForSlides() const { return fMakeIovListForSlides; }
1532 
1533 // Getter for the name given to the IOV list for slides
1534 const char* JetHtPlotConfiguration::iovListForSlides() const { return fIovListForSlides.c_str(); }
1535 
1536 // Expand environmental variables updating the input string
1537 void JetHtPlotConfiguration::autoExpandEnvironmentVariables(std::string& text) const {
1538   static std::regex env("\\$\\{?([^}\\/]+)\\}?\\/");
1539   std::smatch match;
1540   while (std::regex_search(text, match, env)) {
1541     const char* s = getenv(match[1].str().c_str());
1542     const std::string var(s == nullptr ? "" : Form("%s/", s));
1543     text.replace(match[0].first, match[0].second, var);
1544   }
1545 }
1546 
1547 // Expand environmental variables to a new string
1548 std::string JetHtPlotConfiguration::expandEnvironmentVariables(const std::string& input) const {
1549   std::string text = input;
1550   autoExpandEnvironmentVariables(text);
1551   return text;
1552 }