Maps the JetMET veto maps onto maps containing weights.
35 cout << __func__ <<
" start" << endl;
37 if (!fs::exists(
input))
38 BOOST_THROW_EXCEPTION( fs::filesystem_error(
"Jet veta map file does not exists.",
39 input, make_error_code(errc::no_such_file_or_directory)) );
40 auto fIn = make_unique<TFile>(
input.c_str(),
"READ");
41 auto histname =
config.get<
string>(
"corrections.jetvetomap.histname");
42 auto h = fIn->Get<TH2>(histname.c_str());
44 BOOST_THROW_EXCEPTION(
DE::BadInput(
"Can't find the efficiency map", fIn) );
48 auto fOut = make_unique<TFile>(output.c_str(),
"RECREATE");
50 for (
int x = 1; x <= h->GetNbinsX(); ++x)
51 for (
int y = 1; y <= h->GetNbinsY(); ++y) {
52 auto content = h->GetBinContent(x,y);
53 static const auto deps = numeric_limits<float>::epsilon();
54 content = (content <
deps);
55 h->SetBinContent(x,y,content);
57 h->GetXaxis()->SetTitle(
"#eta");
58 h->GetYaxis()->SetTitle(
"#phi");
59 h->GetZaxis()->SetRangeUser(0,1);
61 h->SetDirectory(fOut.get());
64 cout << __func__ <<
" end" << endl;