6 #include "fastjet/contrib/ConstituentSubtractor.hh" 45 std::vector<fastjet::PseudoJet> tempJets = fastjet::sorted_by_pt(
fjClusterSeq_->inclusive_jets(
jetPtMin_));
57 unsigned int bkgVecSize = etaRanges->size();
59 throw cms::Exception(
"WrongBkgInput") <<
"Producer needs vector with background estimates\n";
61 if (bkgVecSize != (rhoRanges->size() + 1) || bkgVecSize != (rhomRanges->size() + 1)) {
63 <<
"Size of etaRanges (" << bkgVecSize <<
") and rhoRanges (" << rhoRanges->size() <<
") and/or rhomRanges (" 64 << rhomRanges->size() <<
") vectors inconsistent\n";
69 for (fastjet::PseudoJet& ijet : tempJets) {
72 std::vector<fastjet::PseudoJet>
particles, ghosts;
73 fastjet::SelectorIsPureGhost().sift(ijet.constituents(), ghosts,
particles);
74 unsigned long nParticles = particles.size();
81 for (fastjet::PseudoJet& ighost : ghosts) {
82 if (ighost.eta() <= etaRanges->at(0) || bkgVecSize == 1) {
83 rho = rhoRanges->at(0);
84 rhom = rhomRanges->at(0);
85 }
else if (ighost.eta() >= etaRanges->at(bkgVecSize - 1)) {
86 rho = rhoRanges->at(bkgVecSize - 2);
87 rhom = rhomRanges->at(bkgVecSize - 2);
89 for (
unsigned int ie = 0; ie < (bkgVecSize - 1); ie++) {
90 if (ighost.eta() >= etaRanges->at(ie) && ighost.eta() < etaRanges->at(ie + 1)) {
91 rho = rhoRanges->at(ie);
92 rhom = rhomRanges->at(ie);
97 double pt = rho * ighost.area();
100 if (mass_squared > 0)
101 mass =
sqrt(mass_squared);
102 ighost.reset_momentum_PtYPhiM(pt, ighost.rap(), ighost.phi(),
mass);
108 fastjet::contrib::ConstituentSubtractor subtractor;
110 subtractor.set_max_distance(
112 subtractor.set_alpha(
114 subtractor.set_do_mass_subtraction(
true);
115 subtractor.set_remove_all_zero_pt_particles(
true);
117 std::vector<fastjet::PseudoJet> subtracted_particles = subtractor.do_subtraction(particles, ghosts);
120 fastjet::PseudoJet subtracted_jet =
join(subtracted_particles);
121 if (subtracted_jet.perp() > 0.)
122 fjJets_.push_back(subtracted_jet);
132 descCSJetProducer.
add<
string>(
"jetCollInstanceName",
"");
134 descCSJetProducer.
add<
bool>(
"sumRecHits",
false);
137 descriptions.
add(
"CSJetProducer", descCSJetProducer);
141 desc.
add<
double>(
"csRParam", -1.);
142 desc.
add<
double>(
"csAlpha", 2.);
T getParameter(std::string const &) const
std::vector< fastjet::PseudoJet > fjJets_
double csAlpha_
for constituent subtraction : R parameter
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::shared_ptr< fastjet::ClusterSequence > ClusterSequencePtr
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< std::vector< double > > rhoToken_
std::vector< fastjet::PseudoJet > fjInputs_
#define DEFINE_FWK_MODULE(type)
ClusterSequencePtr fjClusterSeq_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Namespace of DDCMS conversion namespace.
edm::EDGetTokenT< std::vector< double > > etaToken_
for HI constituent subtraction : alpha (power of pt in metric)
static std::string join(char **cmd)
void runAlgorithm(edm::Event &iEvent, const edm::EventSetup &iSetup) override
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< std::vector< double > > rhomToken_
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
AreaDefinitionPtr fjAreaDefinition_
static void fillDescriptionsFromVirtualJetProducer(edm::ParameterSetDescription &desc)
static void fillDescriptionsFromCSJetProducer(edm::ParameterSetDescription &desc)
Power< A, B >::type pow(const A &a, const B &b)
JetDefPtr fjJetDefinition_