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()) {
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);
edm::EDGetTokenT< std::vector< double > > mapRhoToken_
~HiFJGridEmptyAreaCalculator() override
edm::EDGetTokenT< int > centralityBinToken_
std::vector< double > rhoVsEta_
T getParameter(std::string const &) const
int numJetGridCells(std::vector< std::pair< int, int >> &indices)
number of grid cells that overlap with jet constituents filling in the in between area ...
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
double ymin_
internal parameters for grid
double pt() const final
transverse momentum
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken_
input tokens
int tileIndexEta(const reco::PFCandidate *pfCand)
edm::EDGetTokenT< reco::PFCandidateCollection > pfCandsToken_
Base class for all types of Jets.
std::vector< double > etaMinGrid_
std::vector< double > meanRhoVsEta_
T const * product() const
void endStream() override
void setupGrid(double eta_min, double eta_max)
configure the grid
edm::EDGetTokenT< std::vector< double > > mapRhoMToken_
int tileIndexEtaJet(const reco::PFCandidate *pfCand)
void setupGridJet(const reco::Jet *jet)
edm::EDGetTokenT< std::vector< double > > mapEtaToken_
int tileIndexPhi(const reco::PFCandidate *pfCand)
std::vector< double > etaMaxGrid_
void calculateAreaFractionOfJets(const edm::Event &iEvent, const edm::EventSetup &iSetup)
const double twopi_
information about the grid
#define DEFINE_FWK_MODULE(type)
void beginStream(edm::StreamID) override
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
void calculateGridRho(const edm::Event &iEvent, const edm::EventSetup &iSetup)
HiFJGridEmptyAreaCalculator(const edm::ParameterSet &)
void produce(edm::Event &, const edm::EventSetup &) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Particle reconstructed by the particle flow algorithm.
double gridWidth_
input parameters
double phi() const final
momentum azimuthal angle
double eta() const final
momentum pseudorapidity