31 #include "fastjet/SISConePlugin.hh"
32 #include "fastjet/CMSIterativeConePlugin.hh"
33 #include "fastjet/ATLASConePlugin.hh"
34 #include "fastjet/CDFMidPointPlugin.hh"
35 #include "fastjet/tools/Filter.hh"
36 #include "fastjet/tools/Pruner.hh"
37 #include "fastjet/tools/MassDropTagger.hh"
38 #include "fastjet/contrib/SoftDrop.hh"
39 #include "fastjet/tools/JetMedianBackgroundEstimator.hh"
40 #include "fastjet/tools/GridMedianBackgroundEstimator.hh"
41 #include "fastjet/tools/Subtractor.hh"
42 #include "fastjet/contrib/ConstituentSubtractor.hh"
123 <<
"Parameters muCut and/or yCut for Mass Drop are not defined." << std::endl;
126 throw cms::Exception(
"useFiltering") <<
"Parameters rFilt and/or nFilt for Filtering are not defined." << std::endl;
129 <<
"Parameters rFiltFactor for DynamicFiltering is not defined." << std::endl;
133 throw cms::Exception(
"useTrimming") <<
"Parameters rFilt and/or trimPtFracMin for Trimming are not defined."
137 throw cms::Exception(
"usePruning") <<
"Parameters zCut and/or RcutFactor and/or nFilt for Pruning are not defined."
144 <<
"Parameters subjetPtMin, muMin, muMax, yMin, yMax, dRmin, dRmax, maxDepth for CMSBoostedTauSeedingAlgorithm "
150 <<
"Logic error. The area definition must be set if you use constituent subtraction." << std::endl;
154 <<
"Parameters csRho_EtaMax and/or csRParam for ConstituentSubtraction are not defined." << std::endl;
158 <<
"Logic error. Soft drop is a generalized pruning, do not run them together." << std::endl;
161 throw cms::Exception(
"useSoftDrop") <<
"Parameters zCut and/or beta and/or R0 for SoftDrop are not defined."
166 <<
"Parameters gridMaxRapidity and/or gridSpacing for SoftDrop are not defined." << std::endl;
200 std::vector<edm::Ptr<reco::RecoChargedRefCandidate>> allInputs;
201 std::vector<edm::Ptr<reco::Candidate>> origInputs;
202 for (
size_t i = 0;
i < inputsHandle->size(); ++
i) {
203 allInputs.push_back(inputsHandle->ptrAt(
i));
204 origInputs.push_back(inputsHandle->ptrAt(
i));
211 auto jets = std::make_unique<std::vector<reco::TrackJet>>();
231 itIn != allInputs.end();
236 if ((*itIn)->track() == trref) {
241 allInputs.erase(itIn);
249 <<
"Ignoring a track at vertex which is not in input track collection!";
255 itIn != allInputs.end();
258 float dz = (*itIn)->track()->dz(itVtx->position());
259 float dxy = (*itIn)->track()->dxy(itVtx->position());
264 bool closervtx =
false;
271 if (!
useOnlyOnePV_ && itVtx != itVtx2 && fabs((*itIn)->track()->dz(itVtx2->position())) < fabs(
dz)) {
282 allInputs.erase(itIn);
291 LogDebug(
"FastjetTrackJetProducer") <<
"Inputted towers\n";
295 LogDebug(
"FastjetTrackJetProducer") <<
"Ran algorithm\n";
298 for (
unsigned int ijet = 0; ijet <
fjJets_.size(); ++ijet) {
300 std::vector<fastjet::PseudoJet> fjConstituents = sorted_by_pt(
fjClusterSeq_->constituents(
fjJets_[ijet]));
302 std::vector<reco::CandidatePtr> constituents =
getConstituents(fjConstituents);
315 jet.setVertex(itVtx->position());
324 LogDebug(
"FastjetTrackJetProducer") <<
"Put " <<
jets->size() <<
" jets in the event.\n";
375 std::vector<fastjet::PseudoJet> tempJets = fastjet::sorted_by_pt(
fjClusterSeq_->inclusive_jets(
jetPtMin_));
377 unique_ptr<fastjet::JetMedianBackgroundEstimator> bge_rho;
380 bge_rho = unique_ptr<fastjet::JetMedianBackgroundEstimator>(
new fastjet::JetMedianBackgroundEstimator(
383 fastjet::contrib::ConstituentSubtractor* constituentSubtractor =
384 new fastjet::contrib::ConstituentSubtractor(bge_rho.get());
389 fastjet::MassDropTagger* md_tagger =
new fastjet::MassDropTagger(
muCut_,
yCut_);
393 fastjet::contrib::CMSBoostedTauSeedingAlgorithm* tau_tagger =
new fastjet::contrib::CMSBoostedTauSeedingAlgorithm(
404 fastjet::SelectorNHardest(
nFilt_));
409 fastjet::Pruner* pruner =
new fastjet::Pruner(fastjet::cambridge_algorithm,
zCut_,
RcutFactor_);
420 fastjet::Pruner* pruner =
new fastjet::Pruner(fastjet::kt_algorithm,
zCut_,
RcutFactor_);
425 fastjet::contrib::SoftDrop*
sd =
new fastjet::contrib::SoftDrop(
beta_,
zCut_,
R0_);
429 unique_ptr<fastjet::Subtractor> subtractor;
430 unique_ptr<fastjet::GridMedianBackgroundEstimator> bge_rho_grid;
432 bge_rho_grid = unique_ptr<fastjet::GridMedianBackgroundEstimator>(
435 subtractor = unique_ptr<fastjet::Subtractor>(
new fastjet::Subtractor(bge_rho_grid.get()));
436 subtractor->set_use_rho_m();
440 for (std::vector<fastjet::PseudoJet>::const_iterator ijet = tempJets.begin(), ijetEnd = tempJets.end();
443 fastjet::PseudoJet transformedJet = *ijet;
445 for (transformer_coll::const_iterator itransf = transformers.begin(), itransfEnd = transformers.end();
446 itransf != itransfEnd;
448 if (transformedJet != 0) {
449 transformedJet = (**itransf)(transformedJet);
456 transformedJet = (*subtractor)(transformedJet);
460 fjJets_.push_back(transformedJet);
474 descFastjetJetProducer.
add<
string>(
"jetCollInstanceName",
"");
475 descFastjetJetProducer.
add<
bool>(
"sumRecHits",
false);
478 descriptions.
add(
"FastjetJetProducer", descFastjetJetProducer);
482 desc.
add<
bool>(
"useMassDropTagger",
false);
483 desc.
add<
bool>(
"useFiltering",
false);
484 desc.
add<
bool>(
"useDynamicFiltering",
false);
485 desc.
add<
bool>(
"useTrimming",
false);
486 desc.
add<
bool>(
"usePruning",
false);
487 desc.
add<
bool>(
"useCMSBoostedTauSeedingAlgorithm",
false);
488 desc.
add<
bool>(
"useKtPruning",
false);
489 desc.
add<
bool>(
"useConstituentSubtraction",
false);
490 desc.
add<
bool>(
"useSoftDrop",
false);
491 desc.
add<
bool>(
"correctShape",
false);
492 desc.
add<
bool>(
"UseOnlyVertexTracks",
false);
493 desc.
add<
bool>(
"UseOnlyOnePV",
false);
494 desc.
add<
double>(
"muCut", -1.0);
495 desc.
add<
double>(
"yCut", -1.0);
496 desc.
add<
double>(
"rFilt", -1.0);
497 desc.
add<
double>(
"rFiltFactor", -1.0);
498 desc.
add<
double>(
"trimPtFracMin", -1.0);
499 desc.
add<
double>(
"zcut", -1.0);
500 desc.
add<
double>(
"rcut_factor", -1.0);
501 desc.
add<
double>(
"csRho_EtaMax", -1.0);
502 desc.
add<
double>(
"csRParam", -1.0);
503 desc.
add<
double>(
"beta", -1.0);
504 desc.
add<
double>(
"R0", -1.0);
505 desc.
add<
double>(
"gridMaxRapidity", -1.0);
506 desc.
add<
double>(
"gridSpacing", -1.0);
507 desc.
add<
double>(
"DzTrVtxMax", 999999.);
508 desc.
add<
double>(
"DxyTrVtxMax", 999999.);
509 desc.
add<
double>(
"MaxVtxZ", 15.0);
510 desc.
add<
double>(
"subjetPtMin", -1.0);
511 desc.
add<
double>(
"muMin", -1.0);
512 desc.
add<
double>(
"muMax", -1.0);
513 desc.
add<
double>(
"yMin", -1.0);
514 desc.
add<
double>(
"yMax", -1.0);
515 desc.
add<
double>(
"dRMin", -1.0);
516 desc.
add<
double>(
"dRMax", -1.0);
517 desc.
add<
int>(
"maxDepth", -1);
518 desc.
add<
int>(
"nFilt", -1);
519 desc.
add<
int>(
"MinVtxNdof", 5);