51 : src_(iConfig.getParameter<
edm::
InputTag>(
"jetSource")),
52 nExcl_(iConfig.getParameter<
int>(
"nExcl")),
53 etaMaxExcl_(iConfig.getParameter<double>(
"etaMaxExcl")),
54 ptMinExcl_(iConfig.getParameter<double>(
"ptMinExcl")),
55 nExcl2_(iConfig.getParameter<
int>(
"nExcl2")),
56 etaMaxExcl2_(iConfig.getParameter<double>(
"etaMaxExcl2")),
57 ptMinExcl2_(iConfig.getParameter<double>(
"ptMinExcl2")),
59 usingPackedCand(
false) {
63 produces<std::vector<double>>(
"mapEtaEdges");
64 produces<std::vector<double>>(
"mapToRho");
65 produces<std::vector<double>>(
"mapToRhoM");
66 produces<std::vector<double>>(
"ptJets");
67 produces<std::vector<double>>(
"areaJets");
68 produces<std::vector<double>>(
"etaJets");
84 auto mapEtaRangesOut = std::make_unique<std::vector<double>>(
neta, -999.);
89 auto mapToRhoOut = std::make_unique<std::vector<double>>(
neta - 1, 1
e-6);
90 auto mapToRhoMOut = std::make_unique<std::vector<double>>(
neta - 1, 1
e-6);
94 auto ptJetsOut = std::make_unique<std::vector<double>>(
njets, 1
e-6);
95 auto areaJetsOut = std::make_unique<std::vector<double>>(
njets, 1
e-6);
96 auto etaJetsOut = std::make_unique<std::vector<double>>(
njets, 1
e-6);
104 unsigned int njetsEx = 0;
105 unsigned int njetsEx2 = 0;
116 float pt =
jet->pt();
120 if (eta < mapEtaRangesOut->at(0) ||
eta > mapEtaRangesOut->at(
neta - 1))
126 ptJetsOut->at(nacc) =
pt;
127 areaJetsOut->at(nacc) =
area;
128 etaJetsOut->at(nacc) =
eta;
133 ptJetsOut->resize(nacc);
134 areaJetsOut->resize(nacc);
135 etaJetsOut->resize(nacc);
139 std::vector<double> rhoVecCur;
140 std::vector<double> rhomVecCur;
146 for (
int i = 0;
i < nacc;
i++) {
148 rhoVecCur.push_back(rhoVec[
i]);
149 rhomVecCur.push_back(rhomVec[
i]);
157 mapToRhoOut->at(
ieta) = rhoCur;
158 mapToRhoMOut->at(
ieta) = rhomCur;
186 for (
auto daughter :
jet->getJetConstituentsQuick()) {
206 throw cms::Exception(
"WrongJetCollection",
"Jet constituents are not particle flow candidates");
215 desc.add<
int>(
"nExcl", 2);
216 desc.add<
double>(
"etaMaxExcl", 2.);
217 desc.add<
double>(
"ptMinExcl", 20.);
218 desc.add<
int>(
"nExcl2", 2);
219 desc.add<
double>(
"etaMaxExcl2", 2.);
220 desc.add<
double>(
"ptMinExcl2", 20.);
221 desc.add<std::vector<double>>(
"etaRanges", {});
222 descriptions.
add(
"hiFJRhoProducer",
desc);
232 auto n =
v.size() / 2;
233 std::nth_element(
v.begin(),
v.begin() +
n,
v.end());
235 if (!(
v.size() & 1)) {
236 auto max_it = std::max_element(
v.begin(),
v.begin() +
n);
237 med = (*max_it + med) / 2.0;
HiFJRhoProducer(const edm::ParameterSet &)
T getParameter(std::string const &) const
double calcMedian(std::vector< double > &v)
Base class for all types of Jets.
std::vector< double > etaRanges
void beginStream(edm::StreamID) override
bool isPackedCandidate(const reco::Candidate *candidate)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
~HiFJRhoProducer() override
void produce(edm::Event &, const edm::EventSetup &) override
double calcMd(const reco::Jet *jet)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken_
Particle reconstructed by the particle flow algorithm.
void endStream() override