17 : gridWidth_(iConfig.getParameter<double>(
"gridWidth")),
18 band_(iConfig.getParameter<double>(
"bandWidth")),
19 hiBinCut_(iConfig.getParameter<
int>(
"hiBinCut")),
20 doCentrality_(iConfig.getParameter<
bool>(
"doCentrality")),
21 keepGridInfo_(iConfig.getParameter<
bool>(
"keepGridInfo")) {
50 produces<std::vector<double>>(
"mapEmptyCorrFac");
51 produces<std::vector<double>>(
"mapToRhoCorr");
52 produces<std::vector<double>>(
"mapToRhoMCorr");
53 produces<std::vector<double>>(
"mapToRhoCorr1Bin");
54 produces<std::vector<double>>(
"mapToRhoMCorr1Bin");
57 produces<std::vector<double>>(
"mapRhoVsEtaGrid");
58 produces<std::vector<double>>(
"mapMeanRhoVsEtaGrid");
59 produces<std::vector<double>>(
"mapEtaMaxGrid");
60 produces<std::vector<double>>(
"mapEtaMinGrid");
84 bool doEmptyArea =
true;
95 int neta = (
int)mapEtaRanges->size();
97 auto mapToRhoCorrOut = std::make_unique<std::vector<double>>(
neta - 1, 1
e-6);
98 auto mapToRhoMCorrOut = std::make_unique<std::vector<double>>(
neta - 1, 1
e-6);
99 auto mapToRhoCorr1BinOut = std::make_unique<std::vector<double>>(
neta - 1, 1
e-6);
100 auto mapToRhoMCorr1BinOut = std::make_unique<std::vector<double>>(
neta - 1, 1
e-6);
105 double allAcceptanceCorr = 1;
117 double correctionKt = 1;
119 double rhoM = mapRhoM->at(
ieta);
132 mapToRhoCorrOut->at(
ieta) = correctionKt *
rho;
133 mapToRhoMCorrOut->at(
ieta) = correctionKt * rhoM;
135 mapToRhoCorr1BinOut->at(
ieta) = allAcceptanceCorr *
rho;
136 mapToRhoMCorr1BinOut->at(
ieta) = allAcceptanceCorr * rhoM;
146 auto mapRhoVsEtaGridOut = std::make_unique<std::vector<double>>(
ny_, 0.);
147 auto mapMeanRhoVsEtaGridOut = std::make_unique<std::vector<double>>(
ny_, 0.);
148 auto mapEtaMaxGridOut = std::make_unique<std::vector<double>>(
ny_, 0.);
149 auto mapEtaMinGridOut = std::make_unique<std::vector<double>>(
ny_, 0.);
172 vector<vector<double>> scalarPt(
ny_, vector<double>(
nphi_, 0.0));
177 for (
unsigned icand = 0; icand < pfCandidateColl->size(); icand++) {
184 scalarPt[
jeta][jphi] += pfCandidate.
pt();
192 vector<double> rhoVsPhi;
195 for (
int jphi = 0; jphi <
nphi_; jphi++) {
196 double binpt = scalarPt[
jeta][jphi];
200 rhoVsPhi.push_back(binpt);
208 sort(rhoVsPhi.begin(), rhoVsPhi.end());
210 int nFull =
nphi_ - nEmpty;
215 if (nFull % 2 == 0) {
238 double areaKt =
jet->jetArea();
240 std::vector<std::pair<int, int>> pfIndicesJet;
241 std::vector<std::pair<int, int>> pfIndicesJetInbound;
243 int nConstitJetInbound = 0;
244 for (
auto daughter :
jet->getJetConstituentsQuick()) {
245 auto pfCandidate = static_cast<const reco::PFCandidate*>(daughter);
249 pfIndicesJet.push_back(std::make_pair(jphi,
jeta));
253 pfIndicesJetInbound.push_back(std::make_pair(jphi,
jeta));
254 nConstitJetInbound++;
258 if (nConstitJet == nConstitJetInbound) {
269 int nthisInbound = 0;
270 if (nConstitJetInbound > 0)
273 double fractionArea = ((double)nthisInbound) / ((double)nthis);
303 ny_ =
int(nyDouble + 0.5);
360 if (iy < 0 || iy >=
ny_)
363 assert(iy < ny_ && iy >= 0);
408 if (iyjet < 0 || iyjet >=
nyJet_)
411 assert(iyjet < nyJet_ && iyjet >= 0);
420 int lowestJPhi =
indices[0].first;
421 int lowestJEta =
indices[0].second;
422 int highestJEta = lowestJEta;
425 for (
unsigned int iconst = 1; iconst <
indices.size(); iconst++) {
426 int jphi =
indices[iconst].first;
428 if (jphi == lowestJPhi) {
429 if (
jeta < lowestJEta)
431 if (
jeta > highestJEta)
435 ngrid += highestJEta - lowestJEta + 1;
440 ngrid += highestJEta - lowestJEta + 1;
456 desc.
add<
double>(
"gridWidth", 0.05);
457 desc.
add<
double>(
"bandWidth", 0.2);
458 desc.
add<
bool>(
"doCentrality",
true);
459 desc.
add<
int>(
"hiBinCut", 100);
460 desc.
add<
bool>(
"keepGridInfo",
false);
461 descriptions.
add(
"hiFJGridEmptyAreaCalculator", desc);