23 : TH2D(
name,
name, nbinseta, mineta, maxeta, nbinse, mine, maxe) {
24 GetXaxis()->SetTitle(
"#eta");
25 GetYaxis()->SetTitle(
"E");
28 for (
int ie = 1; ie <= GetNbinsY(); ie++) {
40 GetXaxis()->SetTitle(
"#eta");
41 GetYaxis()->SetTitle(
"E");
43 string err =
"PFResolutionMap::PFResolutionMap : cannot read file ";
45 throw invalid_argument(
err);
54 std::ofstream outf(mapfile);
56 edm::LogWarning(
"PFResolutionMap::Write") <<
" : cannot open file " << mapfile;
60 outf << (*this) << endl;
62 edm::LogError(
"PFResolutionMap::Write") <<
" : corrupted file " << mapfile;
73 std::ifstream
inf(mapfile);
97 SetBins(nbinseta, mineta, maxeta, nbinse, mine, maxe);
114 istringstream lin(
s);
120 SetBinContent(
j,
i, dataw);
122 }
while (lin.good());
124 }
while (
inf.good());
139 constexpr
double fMinEta = -2.95;
140 constexpr
double fMaxEta = 2.95;
141 constexpr
double fMinE = 0;
142 constexpr
double fMaxE = 100;
145 eta = fMinEta + 0.001;
147 eta = fMaxEta - 0.001;
156 double res = GetBinContent(
bin);
169 if (
e >= GetYaxis()->GetXmax())
170 e = GetYaxis()->GetXmax() - 0.001;
172 return TH2D::FindBin(
eta,
e);
180 outf <<
rm.GetNbinsX() << endl;
181 outf <<
rm.GetXaxis()->GetXmin() << endl;
182 outf <<
rm.GetXaxis()->GetXmax() << endl;
184 outf <<
rm.GetNbinsY() << endl;
185 outf <<
rm.GetYaxis()->GetXmin() << endl;
186 outf <<
rm.GetYaxis()->GetXmax() << endl;
188 for (
int ie = 1; ie <=
rm.GetNbinsY(); ie++) {
190 outf <<
rm.GetBinContent(
ieta, ie) <<
"\t";
212 #define M_PI 3.14159265358979323846
217 constexpr
double pi =
M_PI;
218 constexpr
double twopi = 2. *
pi;
219 constexpr
double twopiO18 =
pi / 9;
222 constexpr
double c0 = 2.97025;
223 constexpr std::array<double, 18> cPhi{{
c0,
240 c0 - 17 * twopiO18}};
243 constexpr
double delta_cPhi = 0.00638;
255 if (
phi < cPhi[17] ||
phi >= cPhi[0]) {