956 std::vector<TH1D*> totalHists;
957 std::vector<TGraphErrors*> totalGraphs;
958 std::vector< std::vector<TGraphErrors*> > compGraphs;
972 IsBjet(*
jet) =
false;
982 size_t indexHelper = 0;
985 for (
size_t iProv = 0; iProv < providers.size(); ++iProv)
1011 std::cout <<
"Fixed LargeRJetTruthLabel" << std::endl;
1027 totalHists.push_back(
new TH1D(Form(
"Total_%zu_hist",iProv),
"",scanBins.size()-1,&scanBins[0]));
1028 TH1D* totalHist = totalHists.back();
1029 totalHist->SetFillColor(590);
1030 totalHist->SetLineWidth(0);
1033 totalGraphs.push_back(
new TGraphErrors());
1034 TGraphErrors* totalGraph = totalGraphs.back();
1035 totalGraph->SetName(Form(
"Total_%zu_graph",iProv));
1036 totalGraph->SetLineStyle(1);
1037 totalGraph->SetLineWidth(2);
1038 totalGraph->SetLineColor(kBlack);
1044 int PTindex =
static_cast<int>(allIndices.size());
1046 if (TString(provider->
getComponentName(iComp).c_str()).Contains(
"PunchThrough",TString::kIgnoreCase))
1053 std::vector<TGraphErrors*> provCompGraphs;
1056 for (
size_t iComp = 0; iComp < compSetIndices.at(iProv).size(); ++iComp)
1059 provCompGraphs.push_back(
new TGraphErrors());
1060 TGraphErrors* compGraph = provCompGraphs.back();
1061 compGraph->SetName(labelNames.at(iProv).at(iComp));
1062 compGraph->SetLineStyle(indexHelper+1);
1063 compGraph->SetLineColor(indexHelper+2 < 5 ? indexHelper+2 : indexHelper+3 < 13 ? indexHelper+3 : indexHelper+4);
1064 if (indexHelper+3 == 10) compGraph->SetLineColor(kYellow-9);
1065 compGraph->SetLineWidth(doComparison?3:4);
1072 for (
int iScan = 1; iScan < frame->GetNbinsX()+2; ++iScan)
1074 const double binValue = iScan == 1 ? frame->GetBinLowEdge(iScan)+1.e-3 : iScan == frame->GetNbinsX()+1 ? frame->GetBinLowEdge(iScan)-1.e-3 : frame->GetBinLowEdge(iScan);
1079 const double mass = mOverPtIsMass ? mOverPt*1.e3 : mOverPt*
pt;
1093 bool isZero =
false;
1095 if (
pt > 1.5e6) isZero =
true;
1107 for (
size_t iComp = 0; iComp < compSetIndices.at(iProv).
size(); ++iComp)
1111 TGraphErrors* compGraph = provCompGraphs.at(iComp);
1113 compGraph->SetPoint(iScan-1,binValue,compUnc);
1118 totalGraph->SetPoint(iScan-1,binValue,totalUnc);
1123 compGraphs.push_back(provCompGraphs);
1126 for (
int iScan = 1; iScan < frame->GetNbinsX()+1; ++iScan)
1128 const double binValue = frame->GetBinCenter(iScan);
1133 const double mass = mOverPtIsMass ? mOverPt*1.e3 : mOverPt*
pt;
1146 bool isZero =
false;
1148 if (
pt > 1.5e6) isZero =
true;
1165 for (
size_t iProv = 0; iProv < providers.size(); ++iProv)
1167 TH1D* totalHist = totalHists.at(iProv);
1170 TH1D* rebinnedTotal =
new TH1D(Form(
"Rebinned_%s",totalHist->GetName()),
"",rebinnedBins.size()-1,&rebinnedBins[0]);
1171 rebinnedTotal->SetFillColor(590);
1172 rebinnedTotal->SetLineWidth(0);
1173 for(
int iBin = 1; iBin < rebinnedTotal->GetNbinsX()+1; ++iBin)
1174 rebinnedTotal->SetBinContent(iBin,totalHist->Interpolate(rebinnedTotal->GetBinCenter(iBin)));
1175 delete totalHists[iProv];
1176 totalHists[iProv] = rebinnedTotal;
1184 else canvas->SetLogx(
false);
1190 frame->GetXaxis()->SetRangeUser(
xrange.first,
xrange.second);
1193 else if (fixedIsEta) frame->GetXaxis()->SetRangeUser(17,3.0
e3);
1194 else frame->GetXaxis()->SetRangeUser(-4.5,4.5);
1199 frame->GetYaxis()->SetRangeUser(0,
maxYuser);
1209 TH1D* comparisonHist = 0;
1210 TGraphErrors * comparisonGraph = 0;
1212 comparisonHist = totalHists.at(providers.size()-1);
1213 totalHists.pop_back();
1214 comparisonGraph = totalGraphs.at(providers.size()-1);
1215 totalGraphs.pop_back();
1221 if (doCompareOnly) {
1223 totalGraphs.at(
index)->SetLineColor(1000+
index);
1224 totalGraphs.at(
index)->SetLineStyle(1);
1225 totalGraphs.at(
index)->SetLineWidth(2);
1226 totalHists.at(
index)->SetLineColor(1000+
index);
1227 totalHists.at(
index)->SetLineStyle(1);
1228 totalHists.at(
index)->SetLineWidth(2);
1229 totalGraphs.at(
index)->Draw(
"l same");
1232 totalHists.at(0)->Draw(
"histF same");
1233 else if ((providers.size() == 2) && doComparison) {
1249 comparisonGraph->SetLineWidth(6);
1254 comparisonHist->SetLineColor(kGreen+3);
1255 comparisonHist->SetFillColor(kTeal+5);
1259 comparisonHist->SetLineColor(kTeal+5);
1260 comparisonHist->SetFillColor(kTeal-9);
1263 comparisonHist->Draw(
"histF same");
1264 totalHists.at(0)->Draw(
"histF same");
1268 if (!doCompareOnly) {
1269 for (
size_t iProv = 0; iProv < providers.size(); ++iProv)
1272 if (iProv == providers.size()-1)
continue;
1274 comparisonGraph->SetLineColor(comparisonHist->GetLineColor());
1275 comparisonGraph->Draw(
"l same");
1276 totalGraphs.at(0)->Draw(
"l same");
1278 for (
size_t iComp = 0; iComp < compGraphs.at(iProv).
size(); ++iComp)
1279 compGraphs.at(iProv).at(iComp)->Draw(
"l same");
1287 for (
size_t i=0;
i<providers.size();
i++) {
1288 const TString thisconfname = providers.at(
i)->getConfigFile().c_str();
1289 if (!(thisconfname.Contains(
"_2012/")))
sign =
false;
1291 bool sameRelease =
true;
1292 const TString release0 = providers.at(0)->getRelease();
1293 for (
size_t i=1;
i<providers.size(); ++
i)
1294 if (providers.at(
i)->getRelease() != release0)
1295 sameRelease =
false;
1299 if (providers.size() == 1 || (providers.size()==2 && doComparison) ||
sign || sameRelease)
1317 if (providers.size() == 1 || (providers.size()==2 && doComparison) ||
sign || sameRelease)
1320 DrawText(fixedIsEta?Form(
"#eta = %.1f, m = %.0f GeV",
fixedValue,mOverPt):Form(
"#it{p}_{T}^{jet} = %.0f GeV",
fixedValue),kBlack,TString(providers.at(0)->getJetDef().c_str()).Contains(
"Trimmed") ? 0.74 : 0.805);
1322 DrawText(fixedIsEta?Form(
"#eta = %.1f, m/p_{T} = %.2f",
fixedValue,mOverPt):Form(
"#it{p}_{T}^{jet} = %.0f GeV",
fixedValue),kBlack,TString(providers.at(0)->getJetDef().c_str()).Contains(
"Trimmed") ? 0.74 : 0.805);
1324 DrawText(fixedIsEta?Form(
"#eta = %.1f",
fixedValue):Form(
"#it{p}_{T}^{jet} = %.0f GeV",
fixedValue),kBlack,TString(providers.at(0)->getJetDef().c_str()).Contains(
"Trimmed") ? 0.74 : 0.805);
1330 double legx=0.41, legy=0.78,
dy = 0.045;
1333 else if (TString(providers.at(0)->getJetDef().c_str()).Contains(
"Trimmed"))
1336 if (doCompareOnly) {
1337 for (
size_t i=0;
i < totalGraphs.size();
i++) {
1338 const TString
title = labelNames.at(
i).at(0);
1342 if ((providers.size() == 1 || (providers.size() == 2 && doComparison)) &&
optHelper.
DrawTotal()) {
1347 const TString
title = labelNames.at(providers.size()-1).at(0);
1356 for (
size_t iProv = 0; iProv < providers.size(); ++iProv)
1357 for (
size_t iComp = 0; iComp < compGraphs.at(iProv).
size(); ++iComp)
1359 const TGraphErrors* compGraph = compGraphs.at(iProv).at(iComp);
1360 const TString
label = compGraph->GetName();
1361 if (
label.Contains(
"#splitline"))
1378 frame->Draw(
"axis same");
1394 for (
size_t iSet = 0; iSet < compGraphs.size(); ++iSet)
1396 for (
size_t iComp = 0 ; iComp < compGraphs.at(iSet).
size(); ++iComp)
1398 compGraphs.at(iSet).at(iComp)->Write();
1405 for (
size_t iProv = 0; iProv < providers.size(); ++iProv)
1407 if (doComparison && iProv == providers.size()-1)
continue;
1409 delete totalHists.at(iProv);
1410 delete totalGraphs.at(iProv);
1412 for (
size_t iComp = 0; iComp < compGraphs.at(iProv).
size(); ++iComp)
1413 delete compGraphs.at(iProv).at(iComp);
1415 delete comparisonHist;
1416 delete comparisonGraph;