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));
176 const auto& pfCandidateColl = pfCands.
product();
177 for (
const auto& pfCandidate : *pfCandidateColl) {
179 if (pfCandidate.eta() <
ymin_ || pfCandidate.eta() >
ymax_)
183 scalarPt[
jeta][jphi] += pfCandidate.pt();
191 vector<double> rhoVsPhi;
194 for (
int jphi = 0; jphi <
nphi_; jphi++) {
195 double binpt = scalarPt[
jeta][jphi];
199 rhoVsPhi.push_back(binpt);
207 sort(rhoVsPhi.begin(), rhoVsPhi.end());
209 int nFull =
nphi_ - nEmpty;
214 if (nFull % 2 == 0) {
233 for (
const auto&
jet : *
jets) {
237 double areaKt =
jet.jetArea();
239 std::vector<std::pair<int, int>> pfIndicesJet;
240 std::vector<std::pair<int, int>> pfIndicesJetInbound;
242 int nConstitJetInbound = 0;
243 for (
const auto& daughter :
jet.getJetConstituentsQuick()) {
248 pfIndicesJet.push_back(std::make_pair(jphi,
jeta));
252 pfIndicesJetInbound.push_back(std::make_pair(jphi,
jeta));
253 nConstitJetInbound++;
257 if (nConstitJet == nConstitJetInbound) {
268 int nthisInbound = 0;
269 if (nConstitJetInbound > 0)
272 double fractionArea = ((double)nthisInbound) / ((double)nthis);
302 ny_ =
int(nyDouble + 0.5);
359 if (iy < 0 || iy >=
ny_)
362 assert(iy < ny_ && iy >= 0);
407 if (iyjet < 0 || iyjet >=
nyJet_)
410 assert(iyjet < nyJet_ && iyjet >= 0);
419 int lowestJPhi =
indices[0].first;
420 int lowestJEta =
indices[0].second;
421 int highestJEta = lowestJEta;
425 int jphi =
index.first;
427 if (jphi == lowestJPhi) {
428 if (
jeta < lowestJEta)
430 if (
jeta > highestJEta)
434 ngrid += highestJEta - lowestJEta + 1;
439 ngrid += highestJEta - lowestJEta + 1;
455 desc.add<
double>(
"gridWidth", 0.05);
456 desc.add<
double>(
"bandWidth", 0.2);
457 desc.add<
bool>(
"doCentrality",
true);
458 desc.add<
int>(
"hiBinCut", 100);
459 desc.add<
bool>(
"keepGridInfo",
false);
460 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
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken_
input tokens
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_
void setupGridJet(const reco::Jet *jet)
edm::EDGetTokenT< std::vector< double > > mapEtaToken_
int tileIndexPhi(const reco::Candidate *pfCand)
std::vector< double > etaMaxGrid_
void calculateAreaFractionOfJets(const edm::Event &iEvent, const edm::EventSetup &iSetup)
int tileIndexEta(const reco::Candidate *pfCand)
const double twopi_
information about the grid
int tileIndexEtaJet(const reco::Candidate *pfCand)
#define DEFINE_FWK_MODULE(type)
void beginStream(edm::StreamID) override
edm::EDGetTokenT< reco::CandidateView > pfCandsToken_
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.
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
double gridWidth_
input parameters
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity