41 const uint32_t _nbins,
84 std::unique_ptr<TH1F> _base_hist,
139 for (
auto&
pset : response_plots) {
141 const auto ptbin_low =
pset.getParameter<
double>(
"ptBinLow");
142 const auto ptbin_high =
pset.getParameter<
double>(
"ptBinHigh");
143 const auto etabin_low =
pset.getParameter<
double>(
"etaBinLow");
144 const auto etabin_high =
pset.getParameter<
double>(
"etaBinHigh");
146 const auto response_nbins =
pset.getParameter<uint32_t>(
"responseNbins");
147 const auto response_low =
pset.getParameter<
double>(
"responseLow");
148 const auto response_high =
pset.getParameter<
double>(
"responseHigh");
154 auto rawTitle =
title;
155 rawTitle = rawTitle.replace(rawTitle.begin(), rawTitle.begin(),
"Raw ");
158 name,
title, response_nbins, response_low, response_high, ptbin_low, ptbin_high, etabin_low, etabin_high));
161 name, rawTitle, response_nbins, response_low, response_high, ptbin_low, ptbin_high, etabin_low, etabin_high));
164 throw std::runtime_error(
"Requested too many jet response plots, aborting as this seems unusual.");
169 for (
auto&
pset : genjet_plots_pset) {
174 const auto ptbins_d =
pset.getParameter<std::vector<double>>(
"ptBins");
175 std::vector<float>
ptbins(ptbins_d.begin(), ptbins_d.end());
177 const auto etabin_low =
pset.getParameter<
double>(
"etaBinLow");
178 const auto etabin_high =
pset.getParameter<
double>(
"etaBinHigh");
183 std::make_unique<TH1F>(
name.c_str(),
title.c_str(), static_cast<int>(
ptbins.size()) - 1,
ptbins.data()),
205 const auto& response_plots = iConfig.
getParameter<std::vector<edm::ParameterSet>>(
"responsePlots");
208 const auto& genjet_plots = iConfig.
getParameter<std::vector<edm::ParameterSet>>(
"genJetPlots");
217 std::vector<int> matchIndices;
222 const auto pt_gen = genJet.pt();
223 const auto eta_gen =
abs(genJet.eta());
224 const int iMatch = matchIndices[
i];
229 if (
plot.isInEtaBin(eta_gen)) {
238 auto pt_reco = recoJet.pt();
240 const auto response = pt_reco / pt_gen;
241 const auto response_raw = pt_reco * recoJet.jecFactor(
"Uncorrected") / pt_gen;
247 if (
plot.isInPtEtaBin(pt_gen, eta_gen)) {
253 if (
plot.isInPtEtaBin(pt_gen, eta_gen)) {
254 plot.fill(response_raw);