|
DAS
3.0
Das Analysis System
|
Go to the documentation of this file.
12 #include "exceptions.h"
18 static const auto feps = std::numeric_limits<float>::epsilon();
35 std::unique_ptr<TH2>
h;
40 namespace fs = filesystem;
42 if (!fs::exists(jetveto_file))
43 BOOST_THROW_EXCEPTION( fs::filesystem_error(
"No such file.", jetveto_file,
44 make_error_code(errc::no_such_file_or_directory)) );
46 auto f = make_unique<TFile>(jetveto_file.c_str(),
"READ");
47 h = unique_ptr<TH2>(
f->Get<TH2>(
"h2hot2"));
48 if (!
h) BOOST_THROW_EXCEPTION(
DE::BadInput(
"Veto maps can't be found in input ROOT file.",
f) );
50 if (
h->Integral() <
feps)
53 for (
int x = 1; x <=
h->GetNbinsX(); ++x)
54 for (
int y = 1; y <=
h->GetNbinsY(); ++y) {
55 float eff =
h->GetBinContent(x,y);
56 if (0 <= eff && eff <= 1)
continue;
57 BOOST_THROW_EXCEPTION(
DE::BadInput(
"The content of the histogram does "
58 "not seem to correspond to efficiencies.",
h) );
64 int x =
h->GetXaxis()->FindBin(jet.
p4.Eta()),
65 y =
h->GetYaxis()->FindBin(jet.
p4.Phi());
66 float eff =
h->GetBinContent(x,y);
74 h->Write(
"jetvetomap");
Conservative(const std::filesystem::path &jetveto_file)
Definition: Conservative.h:37
FourVector p4
raw four-momentum directly after reconstruction
Definition: PhysicsObject.h:50
f
Definition: Ntupliser_cfg.py:256
std::unique_ptr< TH2 > h
jet veto map
Definition: Conservative.h:35
Handling of exceptions.
Definition: darwin.h:36
void operator()(DAS::RecJet &jet)
Definition: Conservative.h:62
Definition: applyConservativeVetoMap.cc:31
Weights weights
object weights
Definition: PhysicsObject.h:52
Definition: Conservative.h:33
static const auto feps
Definition: Conservative.h:18
void Write(TDirectory *dir)
Definition: Conservative.h:70