9 #include "fastjet/contrib/ConstituentSubtractor.hh"
48 std::vector<fastjet::PseudoJet> tempJets = fastjet::sorted_by_pt(
fjClusterSeq_->inclusive_jets(
jetPtMin_));
60 unsigned int bkgVecSize =
etaRanges->size();
62 throw cms::Exception(
"WrongBkgInput") <<
"Producer needs vector with background estimates\n";
64 if (bkgVecSize != (rhoRanges->size() + 1) || bkgVecSize != (rhomRanges->size() + 1)) {
66 <<
"Size of etaRanges (" << bkgVecSize <<
") and rhoRanges (" << rhoRanges->size() <<
") and/or rhomRanges ("
67 << rhomRanges->size() <<
") vectors inconsistent\n";
72 for (fastjet::PseudoJet& ijet : tempJets) {
75 std::vector<fastjet::PseudoJet>
particles, ghosts;
76 fastjet::SelectorIsPureGhost().sift(ijet.constituents(), ghosts,
particles);
77 unsigned long nParticles =
particles.size();
84 for (fastjet::PseudoJet& ighost : ghosts) {
85 if (ighost.eta() <=
etaRanges->at(0) || bkgVecSize == 1) {
86 rho = rhoRanges->at(0);
87 rhom = rhomRanges->at(0);
88 }
else if (ighost.eta() >=
etaRanges->at(bkgVecSize - 1)) {
89 rho = rhoRanges->at(bkgVecSize - 2);
90 rhom = rhomRanges->at(bkgVecSize - 2);
92 for (
unsigned int ie = 0; ie < (bkgVecSize - 1); ie++) {
94 rho = rhoRanges->at(ie);
95 rhom = rhomRanges->at(ie);
100 double pt = rho * ighost.area();
103 if (mass_squared > 0)
105 ighost.reset_momentum_PtYPhiM(
pt, ighost.rap(), ighost.phi(),
mass);
111 fastjet::contrib::ConstituentSubtractor subtractor;
113 subtractor.set_max_distance(
115 subtractor.set_alpha(
117 subtractor.set_do_mass_subtraction(
true);
118 subtractor.set_remove_all_zero_pt_particles(
true);
120 std::vector<fastjet::PseudoJet> subtracted_particles = subtractor.do_subtraction(
particles, ghosts);
123 fastjet::PseudoJet subtracted_jet =
join(subtracted_particles);
124 if (subtracted_jet.perp() > 0.)
125 fjJets_.push_back(subtracted_jet);
135 descCSJetProducer.
add<
string>(
"jetCollInstanceName",
"");
137 descCSJetProducer.
add<
bool>(
"sumRecHits",
false);
140 descriptions.
add(
"CSJetProducer", descCSJetProducer);
144 desc.
add<
double>(
"csRParam", -1.);
145 desc.
add<
double>(
"csAlpha", 2.);