CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
VirtualJetProducer Class Referenceabstract

#include <VirtualJetProducer.h>

Inheritance diagram for VirtualJetProducer:
edm::stream::EDProducer<> cms::CompoundJetProducer cms::CSJetProducer cms::SubEventGenJetProducer CMSInsideOutJetProducer FastjetJetProducer SubjetFilterJetProducer cms::SubJetProducer cms::CATopJetProducer cms::HTTTopJetProducer

Classes

struct  JetType
 

Public Types

typedef std::shared_ptr< fastjet::GhostedAreaSpec > ActiveAreaSpecPtr
 
typedef std::shared_ptr< fastjet::AreaDefinition > AreaDefinitionPtr
 
typedef std::shared_ptr< fastjet::ClusterSequence > ClusterSequencePtr
 
typedef std::shared_ptr< fastjet::JetDefinition > JetDefPtr
 
typedef std::shared_ptr< fastjet::JetDefinition::Plugin > PluginPtr
 
typedef std::shared_ptr< fastjet::Selector > SelectorPtr
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Public Member Functions

std::string jetType () const
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 VirtualJetProducer (const edm::ParameterSet &iConfig)
 
 ~VirtualJetProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fillDescriptionsFromVirtualJetProducer (edm::ParameterSetDescription &desc)
 

Protected Member Functions

virtual void addHTTTopJetTagInfoCollection (edm::Event &iEvent, const edm::EventSetup &iSetup, edm::OrphanHandle< reco::BasicJetCollection > &oh)
 
virtual void copyConstituents (const std::vector< fastjet::PseudoJet > &fjConstituents, reco::Jet *jet)
 
virtual std::vector< reco::CandidatePtrgetConstituents (const std::vector< fastjet::PseudoJet > &fjConstituents)
 
virtual void inputTowers ()
 
virtual bool isAnomalousTower (reco::CandidatePtr input)
 
bool makeBasicJet (const JetType::Type &fTag)
 
bool makeCaloJet (const JetType::Type &fTag)
 
bool makeGenJet (const JetType::Type &fTag)
 
bool makePFClusterJet (const JetType::Type &fTag)
 
bool makePFJet (const JetType::Type &fTag)
 
virtual void makeProduces (std::string s, std::string tag="")
 
bool makeTrackJet (const JetType::Type &fTag)
 
void offsetCorrectJets (std::vector< fastjet::PseudoJet > &orphanInput)
 
virtual void output (edm::Event &iEvent, edm::EventSetup const &iSetup)
 
virtual void runAlgorithm (edm::Event &iEvent, const edm::EventSetup &iSetup)=0
 
template<typename T >
void writeCompoundJets (edm::Event &iEvent, edm::EventSetup const &iSetup)
 function template to write out the outputs More...
 
template<typename T >
void writeJets (edm::Event &iEvent, edm::EventSetup const &iSetup)
 
template<typename T >
void writeJetsWithConstituents (edm::Event &iEvent, edm::EventSetup const &iSetup)
 function template to write out the outputs More...
 

Protected Attributes

int activeAreaRepeats_
 
bool applyWeight_
 
bool doAreaDiskApprox_
 
bool doAreaFastjet_
 
bool doFastJetNonUniform_
 
bool doPUOffsetCorr_
 
bool doPVCorrection_
 
bool doRhoFastjet_
 
ActiveAreaSpecPtr fjActiveArea_
 
AreaDefinitionPtr fjAreaDefinition_
 
ClusterSequencePtr fjClusterSeq_
 
std::vector< fastjet::PseudoJet > fjInputs_
 
JetDefPtr fjJetDefinition_
 
std::vector< fastjet::PseudoJet > fjJets_
 
PluginPtr fjPlugin_
 
SelectorPtr fjSelector_
 
bool fromHTTTopJetProducer_ = false
 
double ghostArea_
 
double ghostEtaMax_
 
edm::EDGetTokenT< reco::VertexCollectioninput_vertex_token_
 
edm::EDGetTokenT< edm::ValueMap< float > > input_weights_token_
 
double inputEMin_
 
double inputEtMin_
 
std::vector< edm::Ptr< reco::Candidate > > inputs_
 
std::string jetAlgorithm_
 
std::string jetCollInstanceName_
 
double jetPtMin_
 
std::string jetType_
 
JetType::Type jetTypeE
 
unsigned int maxInputs_
 
unsigned int minSeed_
 
std::string moduleLabel_
 
unsigned int nExclude_
 
std::vector< double > puCenters_
 
std::string puSubtractorName_
 
double puWidth_
 
bool restrictInputs_
 
double rhoEtaMax_
 
double rParam_
 
edm::InputTag src_
 
edm::InputTag srcPVs_
 
std::shared_ptr< PileUpSubtractorsubtractor_
 
bool useDeterministicSeed_
 
bool useExplicitGhosts_
 
int verbosity_
 
reco::Particle::Point vertex_
 
double voronoiRfact_
 
edm::ValueMap< float > weights_
 
bool writeCompound_
 
bool writeJetsWithConst_
 

Private Attributes

std::unique_ptr< AnomalousToweranomalousTowerDef_
 
edm::EDGetTokenT< std::vector< edm::FwdPtr< reco::PFCandidate > > > input_candidatefwdptr_token_
 
edm::EDGetTokenT< reco::CandidateViewinput_candidateview_token_
 
edm::EDGetTokenT< std::vector< edm::FwdPtr< reco::GenParticle > > > input_gencandidatefwdptr_token_
 
edm::EDGetTokenT< std::vector< edm::FwdPtr< pat::PackedCandidate > > > input_packedcandidatefwdptr_token_
 
edm::EDGetTokenT< std::vector< edm::FwdPtr< pat::PackedGenParticle > > > input_packedgencandidatefwdptr_token_
 

Detailed Description

Definition at line 35 of file VirtualJetProducer.h.

Member Typedef Documentation

◆ ActiveAreaSpecPtr

typedef std::shared_ptr<fastjet::GhostedAreaSpec> VirtualJetProducer::ActiveAreaSpecPtr

Definition at line 76 of file VirtualJetProducer.h.

◆ AreaDefinitionPtr

typedef std::shared_ptr<fastjet::AreaDefinition> VirtualJetProducer::AreaDefinitionPtr

Definition at line 77 of file VirtualJetProducer.h.

◆ ClusterSequencePtr

typedef std::shared_ptr<fastjet::ClusterSequence> VirtualJetProducer::ClusterSequencePtr

Definition at line 73 of file VirtualJetProducer.h.

◆ JetDefPtr

typedef std::shared_ptr<fastjet::JetDefinition> VirtualJetProducer::JetDefPtr

Definition at line 75 of file VirtualJetProducer.h.

◆ PluginPtr

typedef std::shared_ptr<fastjet::JetDefinition::Plugin> VirtualJetProducer::PluginPtr

Definition at line 74 of file VirtualJetProducer.h.

◆ SelectorPtr

typedef std::shared_ptr<fastjet::Selector> VirtualJetProducer::SelectorPtr

Definition at line 78 of file VirtualJetProducer.h.

Constructor & Destructor Documentation

◆ VirtualJetProducer()

VirtualJetProducer::VirtualJetProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 113 of file VirtualJetProducer.cc.

113  {
114  moduleLabel_ = iConfig.getParameter<string>("@module_label");
115  src_ = iConfig.getParameter<edm::InputTag>("src");
116  srcPVs_ = iConfig.getParameter<edm::InputTag>("srcPVs");
117  jetType_ = iConfig.getParameter<string>("jetType");
118  jetAlgorithm_ = iConfig.getParameter<string>("jetAlgorithm");
119  rParam_ = iConfig.getParameter<double>("rParam");
120  inputEtMin_ = iConfig.getParameter<double>("inputEtMin");
121  inputEMin_ = iConfig.getParameter<double>("inputEMin");
122  jetPtMin_ = iConfig.getParameter<double>("jetPtMin");
123  doPVCorrection_ = iConfig.getParameter<bool>("doPVCorrection");
124  doAreaFastjet_ = iConfig.getParameter<bool>("doAreaFastjet");
125  doRhoFastjet_ = iConfig.getParameter<bool>("doRhoFastjet");
126  jetCollInstanceName_ = iConfig.getParameter<string>("jetCollInstanceName");
127  doPUOffsetCorr_ = iConfig.getParameter<bool>("doPUOffsetCorr");
128  puSubtractorName_ = iConfig.getParameter<string>("subtractorName");
130  iConfig.getParameter<bool>("useExplicitGhosts"); // use explicit ghosts in the fastjet clustering sequence?
131  doAreaDiskApprox_ = iConfig.getParameter<bool>("doAreaDiskApprox");
132  voronoiRfact_ = iConfig.getParameter<double>(
133  "voronoiRfact"); // Voronoi-based area calculation allows for an empirical scale factor
134  rhoEtaMax_ = iConfig.getParameter<double>(
135  "Rho_EtaMax"); // do fasjet area / rho calcluation? => accept corresponding parameters
136  ghostEtaMax_ = iConfig.getParameter<double>("Ghost_EtaMax");
137  activeAreaRepeats_ = iConfig.getParameter<int>("Active_Area_Repeats");
138  ghostArea_ = iConfig.getParameter<double>("GhostArea");
139  restrictInputs_ = iConfig.getParameter<bool>("restrictInputs"); // restrict inputs to first "maxInputs" towers?
140  maxInputs_ = iConfig.getParameter<unsigned int>("maxInputs");
141  writeCompound_ = iConfig.getParameter<bool>(
142  "writeCompound"); // Check to see if we are writing compound jets for substructure and jet grooming
143  writeJetsWithConst_ = iConfig.getParameter<bool>("writeJetsWithConst"); //write subtracted jet constituents
144  doFastJetNonUniform_ = iConfig.getParameter<bool>("doFastJetNonUniform");
145  puCenters_ = iConfig.getParameter<vector<double>>("puCenters");
146  puWidth_ = iConfig.getParameter<double>("puWidth");
147  nExclude_ = iConfig.getParameter<unsigned int>("nExclude");
148  useDeterministicSeed_ = iConfig.getParameter<bool>("useDeterministicSeed");
149  minSeed_ = iConfig.getParameter<unsigned int>("minSeed");
150  verbosity_ = iConfig.getParameter<int>("verbosity");
151  applyWeight_ = iConfig.getParameter<bool>("applyWeight");
152  if (applyWeight_) {
153  edm::InputTag srcWeights = iConfig.getParameter<edm::InputTag>("srcWeights");
154  if (srcWeights.label() == src_.label())
155  LogWarning("VirtualJetProducer")
156  << "Particle and weights collection have the same label. You may be applying the same weights twice.\n";
157  if (!srcWeights.label().empty())
159  }
160 
161  anomalousTowerDef_ = unique_ptr<AnomalousTower>(new AnomalousTower(iConfig));
162 
163  input_vertex_token_ = consumes<reco::VertexCollection>(srcPVs_);
164  input_candidateview_token_ = consumes<reco::CandidateView>(src_);
166  consumes<vector<edm::FwdPtr<reco::PFCandidate>>>(iConfig.getParameter<edm::InputTag>("src"));
168  consumes<vector<edm::FwdPtr<pat::PackedCandidate>>>(iConfig.getParameter<edm::InputTag>("src"));
170  consumes<vector<edm::FwdPtr<reco::GenParticle>>>(iConfig.getParameter<edm::InputTag>("src"));
172  consumes<vector<edm::FwdPtr<pat::PackedGenParticle>>>(iConfig.getParameter<edm::InputTag>("src"));
173 
174  //
175  // additional parameters to think about:
176  // - overlap threshold (set to 0.75 for the time being)
177  // - p parameter for generalized kT (set to -2 for the time being)
178  // - fastjet PU subtraction parameters (not yet considered)
179  //
180  if (jetAlgorithm_ == "Kt")
181  fjJetDefinition_ = std::make_shared<fastjet::JetDefinition>(fastjet::kt_algorithm, rParam_);
182 
183  else if (jetAlgorithm_ == "CambridgeAachen")
184  fjJetDefinition_ = std::make_shared<fastjet::JetDefinition>(fastjet::cambridge_algorithm, rParam_);
185 
186  else if (jetAlgorithm_ == "AntiKt")
187  fjJetDefinition_ = std::make_shared<fastjet::JetDefinition>(fastjet::antikt_algorithm, rParam_);
188 
189  else if (jetAlgorithm_ == "GeneralizedKt")
190  fjJetDefinition_ = std::make_shared<fastjet::JetDefinition>(fastjet::genkt_algorithm, rParam_, -2);
191 
192  else if (jetAlgorithm_ == "SISCone") {
193  fjPlugin_ = PluginPtr(new fastjet::SISConePlugin(rParam_, 0.75, 0, 0.0, false, fastjet::SISConePlugin::SM_pttilde));
194  fjJetDefinition_ = std::make_shared<fastjet::JetDefinition>(&*fjPlugin_);
195 
196  } else if (jetAlgorithm_ == "IterativeCone") {
197  fjPlugin_ = PluginPtr(new fastjet::CMSIterativeConePlugin(rParam_, 1.0));
198  fjJetDefinition_ = std::make_shared<fastjet::JetDefinition>(&*fjPlugin_);
199 
200  } else if (jetAlgorithm_ == "CDFMidPoint") {
201  fjPlugin_ = PluginPtr(new fastjet::CDFMidPointPlugin(rParam_, 0.75));
202  fjJetDefinition_ = std::make_shared<fastjet::JetDefinition>(&*fjPlugin_);
203 
204  } else if (jetAlgorithm_ == "ATLASCone") {
205  fjPlugin_ = PluginPtr(new fastjet::ATLASConePlugin(rParam_));
206  fjJetDefinition_ = std::make_shared<fastjet::JetDefinition>(&*fjPlugin_);
207 
208  } else {
209  throw cms::Exception("Invalid jetAlgorithm") << "Jet algorithm for VirtualJetProducer is invalid, Abort!\n";
210  }
211 
213 
214  if (doPUOffsetCorr_) {
215  if (puSubtractorName_.empty()) {
216  LogWarning("VirtualJetProducer")
217  << "Pile Up correction on; however, pile up type is not specified. Using default... \n";
218  subtractor_ = std::make_shared<PileUpSubtractor>(iConfig, consumesCollector());
219  } else
220  subtractor_ = std::shared_ptr<PileUpSubtractor>(
221  PileUpSubtractorFactory::get()->create(puSubtractorName_, iConfig, consumesCollector()));
222  }
223 
224  // do approximate disk-based area calculation => warn if conflicting request
226  throw cms::Exception("Conflicting area calculations")
227  << "Both the calculation of jet area via fastjet and via an analytical disk approximation have been requested. "
228  "Please decide on one.\n";
229 
230  if (doAreaFastjet_ || doRhoFastjet_) {
231  if (voronoiRfact_ <= 0) {
232  fjActiveArea_ = std::make_shared<fastjet::GhostedAreaSpec>(ghostEtaMax_, activeAreaRepeats_, ghostArea_);
233 
234  if (!useExplicitGhosts_) {
235  fjAreaDefinition_ = std::make_shared<fastjet::AreaDefinition>(fastjet::active_area, *fjActiveArea_);
236  } else {
238  std::make_shared<fastjet::AreaDefinition>(fastjet::active_area_explicit_ghosts, *fjActiveArea_);
239  }
240  }
241  fjSelector_ = std::make_shared<fastjet::Selector>(fastjet::SelectorAbsRapMax(rhoEtaMax_));
242  }
243 
244  if ((doFastJetNonUniform_) && (puCenters_.empty()))
245  throw cms::Exception("doFastJetNonUniform")
246  << "Parameter puCenters for doFastJetNonUniform is not defined." << std::endl;
247 
248  // make the "produces" statements
250  produces<vector<double>>("rhos");
251  produces<vector<double>>("sigmas");
252  produces<double>("rho");
253  produces<double>("sigma");
254 }

References diMuonSkim_cfi::byName, beamerCreator::create(), Exception, get, edm::ParameterSet::getParameter(), and HLT_2018_cff::srcWeights.

◆ ~VirtualJetProducer()

VirtualJetProducer::~VirtualJetProducer ( )
override

Definition at line 257 of file VirtualJetProducer.cc.

257 {}

Member Function Documentation

◆ addHTTTopJetTagInfoCollection()

virtual void VirtualJetProducer::addHTTTopJetTagInfoCollection ( edm::Event iEvent,
const edm::EventSetup iSetup,
edm::OrphanHandle< reco::BasicJetCollection > &  oh 
)
inlineprotectedvirtual

Reimplemented in cms::HTTTopJetProducer.

Definition at line 113 of file VirtualJetProducer.h.

115  {};

◆ copyConstituents()

void VirtualJetProducer::copyConstituents ( const std::vector< fastjet::PseudoJet > &  fjConstituents,
reco::Jet jet 
)
protectedvirtual

Definition at line 513 of file VirtualJetProducer.cc.

513  {
514  for (unsigned int i = 0; i < fjConstituents.size(); ++i) {
515  int index = fjConstituents[i].user_index();
516  if (index >= 0 && static_cast<unsigned int>(index) < inputs_.size())
517  jet->addDaughter(inputs_[index]);
518  }
519 }

References mps_fire::i, and metsig::jet.

◆ fillDescriptions()

void VirtualJetProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 1004 of file VirtualJetProducer.cc.

1004  {
1007  desc.add<string>("jetCollInstanceName", "");
1008 
1009  // addDefault must be used here instead of add unless
1010  // all the classes that inherit from this class redefine
1011  // the fillDescriptions function. Otherwise, the autogenerated
1012  // cfi filenames are the same and conflict.
1013  descriptions.addDefault(desc);
1014 }

References edm::ParameterSetDescription::add(), and edm::ConfigurationDescriptions::addDefault().

◆ fillDescriptionsFromVirtualJetProducer()

void VirtualJetProducer::fillDescriptionsFromVirtualJetProducer ( edm::ParameterSetDescription desc)
static

Definition at line 1016 of file VirtualJetProducer.cc.

1016  {
1017  desc.add<edm::InputTag>("src", edm::InputTag("particleFlow"));
1018  desc.add<edm::InputTag>("srcPVs", edm::InputTag(""));
1019  desc.add<string>("jetType", "PFJet");
1020  desc.add<string>("jetAlgorithm", "AntiKt");
1021  desc.add<double>("rParam", 0.4);
1022  desc.add<double>("inputEtMin", 0.0);
1023  desc.add<double>("inputEMin", 0.0);
1024  desc.add<double>("jetPtMin", 5.);
1025  desc.add<bool>("doPVCorrection", false);
1026  desc.add<bool>("doAreaFastjet", false);
1027  desc.add<bool>("doRhoFastjet", false);
1028  desc.add<bool>("doPUOffsetCorr", false);
1029  desc.add<double>("puPtMin", 10.);
1030  desc.add<double>("nSigmaPU", 1.0);
1031  desc.add<double>("radiusPU", 0.5);
1032  desc.add<string>("subtractorName", "");
1033  desc.add<bool>("useExplicitGhosts", false);
1034  desc.add<bool>("doAreaDiskApprox", false);
1035  desc.add<double>("voronoiRfact", -0.9);
1036  desc.add<double>("Rho_EtaMax", 4.4);
1037  desc.add<double>("Ghost_EtaMax", 5.);
1038  desc.add<int>("Active_Area_Repeats", 1);
1039  desc.add<double>("GhostArea", 0.01);
1040  desc.add<bool>("restrictInputs", false);
1041  desc.add<unsigned int>("maxInputs", 1);
1042  desc.add<bool>("writeCompound", false);
1043  desc.add<bool>("writeJetsWithConst", false);
1044  desc.add<bool>("doFastJetNonUniform", false);
1045  desc.add<bool>("useDeterministicSeed", false);
1046  desc.add<unsigned int>("minSeed", 14327);
1047  desc.add<int>("verbosity", 0);
1048  desc.add<double>("puWidth", 0.);
1049  desc.add<unsigned int>("nExclude", 0);
1050  desc.add<unsigned int>("maxBadEcalCells", 9999999);
1051  desc.add<unsigned int>("maxBadHcalCells", 9999999);
1052  desc.add<unsigned int>("maxProblematicEcalCells", 9999999);
1053  desc.add<unsigned int>("maxProblematicHcalCells", 9999999);
1054  desc.add<unsigned int>("maxRecoveredEcalCells", 9999999);
1055  desc.add<unsigned int>("maxRecoveredHcalCells", 9999999);
1056  vector<double> puCentersDefault;
1057  desc.add<vector<double>>("puCenters", puCentersDefault);
1058  desc.add<bool>("applyWeight", false);
1059  desc.add<edm::InputTag>("srcWeights", edm::InputTag(""));
1060 }

References edm::ParameterSetDescription::add(), and HLT_2018_cff::InputTag.

Referenced by cms::CSJetProducer::fillDescriptions(), FastjetJetProducer::fillDescriptions(), cms::CATopJetProducer::fillDescriptions(), and cms::HTTTopJetProducer::fillDescriptions().

◆ getConstituents()

vector< reco::CandidatePtr > VirtualJetProducer::getConstituents ( const std::vector< fastjet::PseudoJet > &  fjConstituents)
protectedvirtual

Definition at line 522 of file VirtualJetProducer.cc.

522  {
523  vector<reco::CandidatePtr> result;
524  result.reserve(fjConstituents.size() / 2);
525  for (unsigned int i = 0; i < fjConstituents.size(); i++) {
526  auto index = fjConstituents[i].user_index();
527  if (index >= 0 && static_cast<unsigned int>(index) < inputs_.size()) {
528  result.emplace_back(inputs_[index]);
529  }
530  }
531  return result;
532 }

References mps_fire::i, and mps_fire::result.

Referenced by FastjetJetProducer::produceTrackJets(), and cms::SubEventGenJetProducer::runAlgorithm().

◆ inputTowers()

void VirtualJetProducer::inputTowers ( )
protectedvirtual

Reimplemented in cms::CompoundJetProducer, SubjetFilterJetProducer, and cms::SubEventGenJetProducer.

Definition at line 442 of file VirtualJetProducer.cc.

442  {
443  auto inBegin = inputs_.begin(), inEnd = inputs_.end(), i = inBegin;
444  for (; i != inEnd; ++i) {
445  auto const& input = **i;
446  // std::cout << "CaloTowerVI jets " << input->pt() << " " << input->et() << ' '<< input->energy() << ' ' << (isAnomalousTower(input) ? " bad" : " ok") << std::endl;
447  if (edm::isNotFinite(input.pt()))
448  continue;
449  if (input.et() < inputEtMin_)
450  continue;
451  if (input.energy() < inputEMin_)
452  continue;
453  if (isAnomalousTower(*i))
454  continue;
455  // Change by SRR : this is no longer an error nor warning, this can happen with PU mitigation algos.
456  // Also switch to something more numerically safe. (VI: 10^-42GeV????)
457  if (input.pt() < 100 * std::numeric_limits<double>::epsilon()) {
458  continue;
459  }
461  const CaloTower& tower = dynamic_cast<const CaloTower&>(input);
462  auto const& ct = tower.p4(vertex_); // very expensive as computed in eta/phi
463  fjInputs_.emplace_back(ct.px(), ct.py(), ct.pz(), ct.energy());
464  fjInputs_.back().set_user_index(i - inBegin);
465  //std::cout << "tower:" << *tower << '\n';
466  } else {
467  /*
468  if(makePFJet(jetTypeE)) {
469  reco::PFCandidate& pfc = (reco::PFCandidate&)input;
470  std::cout << "PF cand:" << pfc << '\n';
471  }
472  */
473  if (!applyWeight_) {
474  fjInputs_.emplace_back(input.px(), input.py(), input.pz(), input.energy());
475  fjInputs_.back().set_user_index(i - inBegin);
476  } else {
478  throw cms::Exception("InvalidInput")
479  << "applyWeight set to True, but no weights given in VirtualJetProducer\n";
480  float w = weights_[*i];
481  if (w > 0) {
482  fjInputs_.emplace_back(input.px() * w, input.py() * w, input.pz() * w, input.energy() * w);
483  fjInputs_.back().set_user_index(i - inBegin);
484  }
485  }
486  }
487  }
488 
489  if (restrictInputs_ && fjInputs_.size() > maxInputs_) {
491  std::sort(fjInputs_.begin(), fjInputs_.end(), pTComparator);
492  fjInputs_.resize(maxInputs_);
493  edm::LogWarning("JetRecoTooManyEntries")
494  << "Too many inputs in the event, limiting to first " << maxInputs_ << ". Output is suspect.";
495  }
496 }

References geometryDiff::epsilon, mps_fire::i, input, edm::isNotFinite(), hgcalTowerProducer_cfi::tower, and w.

Referenced by SubjetFilterJetProducer::inputTowers(), cms::CompoundJetProducer::inputTowers(), and FastjetJetProducer::produceTrackJets().

◆ isAnomalousTower()

bool VirtualJetProducer::isAnomalousTower ( reco::CandidatePtr  input)
protectedvirtual

Definition at line 499 of file VirtualJetProducer.cc.

499  {
500  if (!makeCaloJet(jetTypeE))
501  return false;
502  else
503  return (*anomalousTowerDef_)(*input);
504 }

Referenced by cms::SubEventGenJetProducer::inputTowers().

◆ jetType()

std::string VirtualJetProducer::jetType ( ) const
inline

Definition at line 85 of file VirtualJetProducer.h.

85 { return jetType_; }

◆ makeBasicJet()

bool VirtualJetProducer::makeBasicJet ( const JetType::Type fTag)
inlineprotected

Definition at line 61 of file VirtualJetProducer.h.

61 { return fTag == JetType::BasicJet; }

◆ makeCaloJet()

bool VirtualJetProducer::makeCaloJet ( const JetType::Type fTag)
inlineprotected

Definition at line 56 of file VirtualJetProducer.h.

56 { return fTag == JetType::CaloJet; }

References btagElecInJet_cfi::CaloJet.

◆ makeGenJet()

bool VirtualJetProducer::makeGenJet ( const JetType::Type fTag)
inlineprotected

Definition at line 58 of file VirtualJetProducer.h.

58 { return fTag == JetType::GenJet; }

References nanoDQM_cfi::GenJet.

◆ makePFClusterJet()

bool VirtualJetProducer::makePFClusterJet ( const JetType::Type fTag)
inlineprotected

Definition at line 60 of file VirtualJetProducer.h.

60 { return fTag == JetType::PFClusterJet; }

◆ makePFJet()

bool VirtualJetProducer::makePFJet ( const JetType::Type fTag)
inlineprotected

Definition at line 57 of file VirtualJetProducer.h.

57 { return fTag == JetType::PFJet; }

◆ makeProduces()

void VirtualJetProducer::makeProduces ( std::string  s,
std::string  tag = "" 
)
protectedvirtual

Definition at line 83 of file VirtualJetProducer.cc.

83  {
84  if (writeCompound_) {
85  produces<reco::BasicJetCollection>();
86  }
87 
88  if (writeJetsWithConst_) {
89  produces<reco::PFCandidateCollection>(tag).setBranchAlias(alias);
90  produces<reco::PFJetCollection>();
91  } else {
92  if (makeCaloJet(jetTypeE)) {
93  produces<reco::CaloJetCollection>(tag).setBranchAlias(alias);
94  } else if (makePFJet(jetTypeE)) {
95  produces<reco::PFJetCollection>(tag).setBranchAlias(alias);
96  } else if (makeGenJet(jetTypeE)) {
97  produces<reco::GenJetCollection>(tag).setBranchAlias(alias);
98  } else if (makeTrackJet(jetTypeE)) {
99  produces<reco::TrackJetCollection>(tag).setBranchAlias(alias);
100  } else if (makePFClusterJet(jetTypeE)) {
101  produces<reco::PFClusterJetCollection>(tag).setBranchAlias(alias);
102  } else if (makeBasicJet(jetTypeE)) {
103  produces<reco::BasicJetCollection>(tag).setBranchAlias(alias);
104  }
105  }
106 }

References SiStripOfflineCRack_cfg::alias, and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by SubjetFilterJetProducer::SubjetFilterJetProducer().

◆ makeTrackJet()

bool VirtualJetProducer::makeTrackJet ( const JetType::Type fTag)
inlineprotected

Definition at line 59 of file VirtualJetProducer.h.

59 { return fTag == JetType::TrackJet; }

Referenced by FastjetJetProducer::produce().

◆ offsetCorrectJets()

void VirtualJetProducer::offsetCorrectJets ( std::vector< fastjet::PseudoJet > &  orphanInput)
protected

◆ output()

void VirtualJetProducer::output ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
protectedvirtual

Reimplemented in cms::CompoundJetProducer, and SubjetFilterJetProducer.

Definition at line 536 of file VirtualJetProducer.cc.

536  {
537  // Write jets and constitutents. Will use fjJets_, inputs_
538  // and fjClusterSeq_
539 
540  if (writeCompound_) {
541  // Write jets and subjets
542  switch (jetTypeE) {
543  case JetType::CaloJet:
544  writeCompoundJets<reco::CaloJet>(iEvent, iSetup);
545  break;
546  case JetType::PFJet:
547  writeCompoundJets<reco::PFJet>(iEvent, iSetup);
548  break;
549  case JetType::GenJet:
550  writeCompoundJets<reco::GenJet>(iEvent, iSetup);
551  break;
552  case JetType::BasicJet:
553  writeCompoundJets<reco::BasicJet>(iEvent, iSetup);
554  break;
555  default:
556  throw cms::Exception("InvalidInput") << "invalid jet type in CompoundJetProducer\n";
557  break;
558  };
559  } else if (writeJetsWithConst_) {
560  // Write jets and new constituents.
561  writeJetsWithConstituents<reco::PFJet>(iEvent, iSetup);
562  } else {
563  switch (jetTypeE) {
564  case JetType::CaloJet:
565  writeJets<reco::CaloJet>(iEvent, iSetup);
566  break;
567  case JetType::PFJet:
568  writeJets<reco::PFJet>(iEvent, iSetup);
569  break;
570  case JetType::GenJet:
571  writeJets<reco::GenJet>(iEvent, iSetup);
572  break;
573  case JetType::TrackJet:
574  writeJets<reco::TrackJet>(iEvent, iSetup);
575  break;
577  writeJets<reco::PFClusterJet>(iEvent, iSetup);
578  break;
579  case JetType::BasicJet:
580  writeJets<reco::BasicJet>(iEvent, iSetup);
581  break;
582  default:
583  throw cms::Exception("InvalidInput") << "invalid jet type in VirtualJetProducer\n";
584  break;
585  };
586  }
587 }

References btagElecInJet_cfi::CaloJet, Exception, nanoDQM_cfi::GenJet, and iEvent.

◆ produce()

void VirtualJetProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 264 of file VirtualJetProducer.cc.

264  {
265  // If requested, set the fastjet random seed to a deterministic function
266  // of the run/lumi/event.
267  // NOTE!!! The fastjet random number sequence is a global singleton.
268  // Thus, we have to create an object and get access to the global singleton
269  // in order to change it.
270  if (useDeterministicSeed_) {
271  fastjet::GhostedAreaSpec gas;
272  std::vector<int> seeds(2);
273  unsigned int runNum_uint = static_cast<unsigned int>(iEvent.id().run());
274  unsigned int evNum_uint = static_cast<unsigned int>(iEvent.id().event());
275  seeds[0] = std::max(runNum_uint, minSeed_ + 3) + 3 * evNum_uint;
276  seeds[1] = std::max(runNum_uint, minSeed_ + 5) + 5 * evNum_uint;
277  gas.set_random_status(seeds);
278  }
279 
280  LogDebug("VirtualJetProducer") << "Entered produce\n";
281  //determine signal vertex2
282  vertex_ = reco::Jet::Point(0, 0, 0);
284  LogDebug("VirtualJetProducer") << "Adding PV info\n";
287  if (!pvCollection->empty())
288  vertex_ = pvCollection->begin()->position();
289  }
290 
291  // Get Weights Collection
294 
295  // For Pileup subtraction using offset correction:
296  // set up geometry map
297  if (doPUOffsetCorr_) {
298  subtractor_->setupGeometryMap(iEvent, iSetup);
299  }
300 
301  // clear data
302  LogDebug("VirtualJetProducer") << "Clear data\n";
303  fjInputs_.clear();
304  fjJets_.clear();
305  inputs_.clear();
306 
307  // get inputs and convert them to the fastjet format (fastjet::PeudoJet)
309 
313  edm::Handle<std::vector<edm::FwdPtr<pat::PackedGenParticle>>> packedgeninputsHandleAsFwdPtr;
314 
315  bool isView = iEvent.getByToken(input_candidateview_token_, inputsHandle);
316  if (isView) {
317  if (inputsHandle->empty()) {
318  output(iEvent, iSetup);
319  return;
320  }
321  for (size_t i = 0; i < inputsHandle->size(); ++i) {
322  inputs_.push_back(inputsHandle->ptrAt(i));
323  }
324  } else {
325  bool isPF = iEvent.getByToken(input_candidatefwdptr_token_, pfinputsHandleAsFwdPtr);
326  bool isPFFwdPtr = iEvent.getByToken(input_packedcandidatefwdptr_token_, packedinputsHandleAsFwdPtr);
327  bool isGen = iEvent.getByToken(input_gencandidatefwdptr_token_, geninputsHandleAsFwdPtr);
328  bool isGenFwdPtr = iEvent.getByToken(input_packedgencandidatefwdptr_token_, packedgeninputsHandleAsFwdPtr);
329 
330  if (isPF) {
331  if (pfinputsHandleAsFwdPtr->empty()) {
332  output(iEvent, iSetup);
333  return;
334  }
335  for (size_t i = 0; i < pfinputsHandleAsFwdPtr->size(); ++i) {
336  if ((*pfinputsHandleAsFwdPtr)[i].ptr().isAvailable()) {
337  inputs_.push_back((*pfinputsHandleAsFwdPtr)[i].ptr());
338  } else if ((*pfinputsHandleAsFwdPtr)[i].backPtr().isAvailable()) {
339  inputs_.push_back((*pfinputsHandleAsFwdPtr)[i].backPtr());
340  }
341  }
342  } else if (isPFFwdPtr) {
343  if (packedinputsHandleAsFwdPtr->empty()) {
344  output(iEvent, iSetup);
345  return;
346  }
347  for (size_t i = 0; i < packedinputsHandleAsFwdPtr->size(); ++i) {
348  if ((*packedinputsHandleAsFwdPtr)[i].ptr().isAvailable()) {
349  inputs_.push_back((*packedinputsHandleAsFwdPtr)[i].ptr());
350  } else if ((*packedinputsHandleAsFwdPtr)[i].backPtr().isAvailable()) {
351  inputs_.push_back((*packedinputsHandleAsFwdPtr)[i].backPtr());
352  }
353  }
354  } else if (isGen) {
355  if (geninputsHandleAsFwdPtr->empty()) {
356  output(iEvent, iSetup);
357  return;
358  }
359  for (size_t i = 0; i < geninputsHandleAsFwdPtr->size(); ++i) {
360  if ((*geninputsHandleAsFwdPtr)[i].ptr().isAvailable()) {
361  inputs_.push_back((*geninputsHandleAsFwdPtr)[i].ptr());
362  } else if ((*geninputsHandleAsFwdPtr)[i].backPtr().isAvailable()) {
363  inputs_.push_back((*geninputsHandleAsFwdPtr)[i].backPtr());
364  }
365  }
366  } else if (isGenFwdPtr) {
367  if (geninputsHandleAsFwdPtr->empty()) {
368  output(iEvent, iSetup);
369  return;
370  }
371  for (size_t i = 0; i < packedgeninputsHandleAsFwdPtr->size(); ++i) {
372  if ((*packedgeninputsHandleAsFwdPtr)[i].ptr().isAvailable()) {
373  inputs_.push_back((*packedgeninputsHandleAsFwdPtr)[i].ptr());
374  } else if ((*packedgeninputsHandleAsFwdPtr)[i].backPtr().isAvailable()) {
375  inputs_.push_back((*packedgeninputsHandleAsFwdPtr)[i].backPtr());
376  }
377  }
378  } else {
379  throw cms::Exception("Invalid Jet Inputs")
380  << "Did not specify appropriate inputs for VirtualJetProducer, Abort!\n";
381  }
382  }
383  LogDebug("VirtualJetProducer") << "Got inputs\n";
384 
385  // Convert candidates to fastjet::PseudoJets.
386  // Also correct to Primary Vertex. Will modify fjInputs_
387  // and use inputs_
388  fjInputs_.reserve(inputs_.size());
389  inputTowers();
390  LogDebug("VirtualJetProducer") << "Inputted towers\n";
391 
392  // For Pileup subtraction using offset correction:
393  // Subtract pedestal.
394  if (doPUOffsetCorr_) {
395  subtractor_->setDefinition(fjJetDefinition_);
397  subtractor_->calculatePedestal(fjInputs_);
398  subtractor_->subtractPedestal(fjInputs_);
399  LogDebug("VirtualJetProducer") << "Subtracted pedestal\n";
400  }
401  // Run algorithm. Will modify fjJets_ and allocate fjClusterSeq_.
402  // This will use fjInputs_
403  runAlgorithm(iEvent, iSetup);
404 
405  // if ( doPUOffsetCorr_ ) {
406  // subtractor_->setAlgorithm(fjClusterSeq_);
407  // }
408 
409  LogDebug("VirtualJetProducer") << "Ran algorithm\n";
410  // For Pileup subtraction using offset correction:
411  // Now we find jets and need to recalculate their energy,
412  // mark towers participated in jet,
413  // remove occupied towers from the list and recalculate mean and sigma
414  // put the initial towers collection to the jet,
415  // and subtract from initial towers in jet recalculated mean and sigma of towers
416  if (doPUOffsetCorr_) {
417  LogDebug("VirtualJetProducer") << "Do PUOffsetCorr\n";
418  vector<fastjet::PseudoJet> orphanInput;
419  subtractor_->calculateOrphanInput(orphanInput);
420  subtractor_->calculatePedestal(orphanInput);
421  subtractor_->offsetCorrectJets();
422  }
423  // Write the output jets.
424  // This will (by default) call the member function template
425  // "writeJets", but can be overridden.
426  // this will use inputs_
427  output(iEvent, iSetup);
428  LogDebug("VirtualJetProducer") << "Wrote jets\n";
429 
430  // Clear the work vectors so that memory is free for other modules.
431  // Use the trick of swapping with an empty vector so that the memory
432  // is actually given back rather than silently kept.
433  decltype(fjInputs_)().swap(fjInputs_);
434  decltype(fjJets_)().swap(fjJets_);
435  decltype(inputs_)().swap(inputs_);
436 
437  return;
438 }

References edm::View< T >::empty(), Exception, mps_fire::i, iEvent, LogDebug, SiStripPI::max, convertSQLitetoXML_cfg::output, edm::View< T >::ptrAt(), anotherprimaryvertexanalyzer_cfi::pvCollection, InitialStep_cff::seeds, edm::View< T >::size(), and std::swap().

Referenced by cms::SubJetProducer::produce(), CMSInsideOutJetProducer::produce(), cms::CSJetProducer::produce(), SubjetFilterJetProducer::produce(), and FastjetJetProducer::produce().

◆ runAlgorithm()

virtual void VirtualJetProducer::runAlgorithm ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
protectedpure virtual

◆ writeCompoundJets()

template<class T >
void VirtualJetProducer::writeCompoundJets ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
protected

function template to write out the outputs

Definition at line 767 of file VirtualJetProducer.cc.

767  {
768  if (verbosity_ >= 1) {
769  std::cout << "<VirtualJetProducer::writeCompoundJets (moduleLabel = " << moduleLabel_ << ")>:" << std::endl;
770  }
771 
772  // get a list of output jets
773  auto jetCollection = std::make_unique<reco::BasicJetCollection>();
774  // get a list of output subjets
775  auto subjetCollection = std::make_unique<std::vector<T>>();
776 
777  // This will store the handle for the subjets after we write them
778  edm::OrphanHandle<std::vector<T>> subjetHandleAfterPut;
779  // this is the mapping of subjet to hard jet
780  std::vector<std::vector<int>> indices;
781  // this is the list of hardjet 4-momenta
782  std::vector<math::XYZTLorentzVector> p4_hardJets;
783  // this is the hardjet areas
784  std::vector<double> area_hardJets;
785 
786  // Loop over the hard jets
787  std::vector<fastjet::PseudoJet>::const_iterator it = fjJets_.begin(), iEnd = fjJets_.end(), iBegin = fjJets_.begin();
788  indices.resize(fjJets_.size());
789  for (; it != iEnd; ++it) {
790  fastjet::PseudoJet const& localJet = *it;
791  unsigned int jetIndex = it - iBegin;
792  // Get the 4-vector for the hard jet
793  p4_hardJets.push_back(math::XYZTLorentzVector(localJet.px(), localJet.py(), localJet.pz(), localJet.e()));
794  double localJetArea = 0.0;
795  if (doAreaFastjet_ && localJet.has_area()) {
796  localJetArea = localJet.area();
797  }
798  area_hardJets.push_back(localJetArea);
799 
800  // create the subjet list
801  std::vector<fastjet::PseudoJet> constituents;
802  if (it->has_pieces()) {
803  constituents = it->pieces();
804  } else if (it->has_constituents()) {
805  constituents = it->constituents();
806  }
807 
808  std::vector<fastjet::PseudoJet>::const_iterator itSubJetBegin = constituents.begin(), itSubJet = itSubJetBegin,
809  itSubJetEnd = constituents.end();
810  for (; itSubJet != itSubJetEnd; ++itSubJet) {
811  fastjet::PseudoJet const& subjet = *itSubJet;
812  if (verbosity_ >= 1) {
813  std::cout << "subjet #" << (itSubJet - itSubJetBegin) << ": Pt = " << subjet.pt() << ", eta = " << subjet.eta()
814  << ", phi = " << subjet.phi() << ", mass = " << subjet.m()
815  << " (#constituents = " << subjet.constituents().size() << ")" << std::endl;
816  std::vector<fastjet::PseudoJet> subjet_constituents = subjet.constituents();
817  int idx_constituent = 0;
818  for (std::vector<fastjet::PseudoJet>::const_iterator constituent = subjet_constituents.begin();
819  constituent != subjet_constituents.end();
820  ++constituent) {
821  if (constituent->pt() < 1.e-3)
822  continue; // CV: skip ghosts
823  std::cout << " constituent #" << idx_constituent << ": Pt = " << constituent->pt()
824  << ", eta = " << constituent->eta() << ", phi = " << constituent->phi() << ","
825  << " mass = " << constituent->m() << std::endl;
826  ++idx_constituent;
827  }
828  }
829 
830  if (verbosity_ >= 1) {
831  std::cout << "subjet #" << (itSubJet - itSubJetBegin) << ": Pt = " << subjet.pt() << ", eta = " << subjet.eta()
832  << ", phi = " << subjet.phi() << ", mass = " << subjet.m()
833  << " (#constituents = " << subjet.constituents().size() << ")" << std::endl;
834  std::vector<fastjet::PseudoJet> subjet_constituents = subjet.constituents();
835  int idx_constituent = 0;
836  for (std::vector<fastjet::PseudoJet>::const_iterator constituent = subjet_constituents.begin();
837  constituent != subjet_constituents.end();
838  ++constituent) {
839  if (constituent->pt() < 1.e-3)
840  continue; // CV: skip ghosts
841  std::cout << " constituent #" << idx_constituent << ": Pt = " << constituent->pt()
842  << ", eta = " << constituent->eta() << ", phi = " << constituent->phi() << ","
843  << " mass = " << constituent->m() << std::endl;
844  ++idx_constituent;
845  }
846  }
847 
848  math::XYZTLorentzVector p4Subjet(subjet.px(), subjet.py(), subjet.pz(), subjet.e());
849  reco::Particle::Point point(0, 0, 0);
850 
851  // This will hold ptr's to the subjets
852  std::vector<reco::CandidatePtr> subjetConstituents;
853 
854  // Get the transient subjet constituents from fastjet
855  std::vector<fastjet::PseudoJet> subjetFastjetConstituents = subjet.constituents();
856  std::vector<reco::CandidatePtr> constituents = getConstituents(subjetFastjetConstituents);
857 
858  indices[jetIndex].push_back(subjetCollection->size());
859 
860  // Add the concrete subjet type to the subjet list to write to event record
861  subjetCollection->push_back(*std::make_unique<T>());
862  auto& jet = subjetCollection->back();
863  if ((applyWeight_) && (makePFJet(jetTypeE)))
864  reco::writeSpecific(dynamic_cast<reco::PFJet&>(jet), p4Subjet, point, constituents, iSetup, &weights_);
865  else
866  reco::writeSpecific(jet, p4Subjet, point, constituents, iSetup);
867  jet.setIsWeighted(applyWeight_);
868  double subjetArea = 0.0;
869  if (doAreaFastjet_ && itSubJet->has_area()) {
870  subjetArea = itSubJet->area();
871  }
872  jet.setJetArea(subjetArea);
873  }
874  }
875 
876  // put subjets into event record
877  subjetHandleAfterPut = iEvent.put(std::move(subjetCollection), jetCollInstanceName_);
878 
879  // Now create the hard jets with ptr's to the subjets as constituents
880  std::vector<math::XYZTLorentzVector>::const_iterator ip4 = p4_hardJets.begin(), ip4Begin = p4_hardJets.begin(),
881  ip4End = p4_hardJets.end();
882 
883  for (; ip4 != ip4End; ++ip4) {
884  int p4_index = ip4 - ip4Begin;
885  std::vector<int>& ind = indices[p4_index];
886  std::vector<reco::CandidatePtr> i_hardJetConstituents;
887  // Add the subjets to the hard jet
888  for (std::vector<int>::const_iterator isub = ind.begin(); isub != ind.end(); ++isub) {
889  reco::CandidatePtr candPtr(subjetHandleAfterPut, *isub, false);
890  i_hardJetConstituents.push_back(candPtr);
891  }
892  reco::Particle::Point point(0, 0, 0);
893  reco::BasicJet toput(*ip4, point, i_hardJetConstituents);
894  toput.setJetArea(area_hardJets[ip4 - ip4Begin]);
895  jetCollection->push_back(toput);
896  }
897 
898  // put hard jets into event record
899  // Store the Orphan handle for adding HTT information
901 
904  }
905 }

References gather_cfg::cout, iEvent, bTagCombinedSVVariables_cff::indices, metsig::jet, jetfilter_cfi::jetCollection, eostools::move(), point, reco::Jet::setJetArea(), and reco::writeSpecific().

◆ writeJets()

template<typename T >
void VirtualJetProducer::writeJets ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
protected

Definition at line 602 of file VirtualJetProducer.cc.

602  {
603  // std::cout << "writeJets " << typeid(T).name()
604  // << (doRhoFastjet_ ? " doRhoFastjet " : "")
605  // << (doAreaFastjet_ ? " doAreaFastjet " : "")
606  // << (doAreaDiskApprox_ ? " doAreaDiskApprox " : "")
607  // << std::endl;
608 
609  if (doRhoFastjet_) {
610  // declare jet collection without the two jets,
611  // for unbiased background estimation.
612  std::vector<fastjet::PseudoJet> fjexcluded_jets;
613  fjexcluded_jets = fjJets_;
614 
615  if (fjexcluded_jets.size() > 2)
616  fjexcluded_jets.resize(nExclude_);
617 
618  if (doFastJetNonUniform_) {
619  auto rhos = std::make_unique<std::vector<double>>();
620  auto sigmas = std::make_unique<std::vector<double>>();
621  int nEta = puCenters_.size();
622  rhos->reserve(nEta);
623  sigmas->reserve(nEta);
624  fastjet::ClusterSequenceAreaBase const* clusterSequenceWithArea =
625  dynamic_cast<fastjet::ClusterSequenceAreaBase const*>(fjClusterSeq_.get());
626 
627  if (clusterSequenceWithArea == nullptr) {
628  if (!fjJets_.empty()) {
629  throw cms::Exception("LogicError") << "fjClusterSeq is not initialized while inputs are present\n ";
630  }
631  } else {
632  for (int ie = 0; ie < nEta; ++ie) {
633  double eta = puCenters_[ie];
634  double etamin = eta - puWidth_;
635  double etamax = eta + puWidth_;
636  fastjet::RangeDefinition range_rho(etamin, etamax);
637  fastjet::BackgroundEstimator bkgestim(*clusterSequenceWithArea, range_rho);
638  bkgestim.set_excluded_jets(fjexcluded_jets);
639  rhos->push_back(bkgestim.rho());
640  sigmas->push_back(bkgestim.sigma());
641  }
642  }
643  iEvent.put(std::move(rhos), "rhos");
644  iEvent.put(std::move(sigmas), "sigmas");
645  } else {
646  auto rho = std::make_unique<double>(0.0);
647  auto sigma = std::make_unique<double>(0.0);
648  double mean_area = 0;
649 
650  fastjet::ClusterSequenceAreaBase const* clusterSequenceWithArea =
651  dynamic_cast<fastjet::ClusterSequenceAreaBase const*>(fjClusterSeq_.get());
652  if (clusterSequenceWithArea == nullptr) {
653  if (!fjJets_.empty()) {
654  throw cms::Exception("LogicError") << "fjClusterSeq is not initialized while inputs are present\n ";
655  }
656  } else {
657  clusterSequenceWithArea->get_median_rho_and_sigma(*fjSelector_, false, *rho, *sigma, mean_area);
658  if ((*rho < 0) || (edm::isNotFinite(*rho))) {
659  edm::LogError("BadRho") << "rho value is " << *rho << " area:" << mean_area
660  << " and n_empty_jets: " << clusterSequenceWithArea->n_empty_jets(*fjSelector_)
661  << " with range " << fjSelector_->description() << ". Setting rho to rezo.";
662  *rho = 0;
663  }
664  }
665  iEvent.put(std::move(rho), "rho");
666  iEvent.put(std::move(sigma), "sigma");
667  }
668  } // doRhoFastjet_
669 
670  // produce output jet collection
671 
672  using namespace reco;
673 
674  // allocate fjJets_.size() Ts in vector
675  auto jets = std::make_unique<std::vector<T>>(fjJets_.size());
676 
677  if (!fjJets_.empty()) {
678  // Distance between jet centers and overlap area -- for disk-based area calculation
679  using RIJ = std::pair<double, double>;
680  std::vector<RIJ> rijStorage(fjJets_.size() * (fjJets_.size() / 2));
681  RIJ* rij[fjJets_.size()];
682  unsigned int k = 0;
683  for (unsigned int ijet = 0; ijet < fjJets_.size(); ++ijet) {
684  rij[ijet] = &rijStorage[k];
685  k += ijet;
686  }
687 
688  float etaJ[fjJets_.size()], phiJ[fjJets_.size()];
689 
690  auto orParam_ = 1. / rParam_;
691  // fill jets
692  for (unsigned int ijet = 0; ijet < fjJets_.size(); ++ijet) {
693  auto& jet = (*jets)[ijet];
694 
695  // get the fastjet jet
696  const fastjet::PseudoJet& fjJet = fjJets_[ijet];
697  // get the constituents from fastjet
698  std::vector<fastjet::PseudoJet> const& fjConstituents = fastjet::sorted_by_pt(fjJet.constituents());
699  // convert them to CandidatePtr vector
700  std::vector<CandidatePtr> const& constituents = getConstituents(fjConstituents);
701 
702  // write the specifics to the jet (simultaneously sets 4-vector, vertex).
703  // These are overridden functions that will call the appropriate
704  // specific allocator.
705  if ((applyWeight_) && (makePFJet(jetTypeE)))
706  writeSpecific(dynamic_cast<reco::PFJet&>(jet),
707  Particle::LorentzVector(fjJet.px(), fjJet.py(), fjJet.pz(), fjJet.E()),
708  vertex_,
709  constituents,
710  iSetup,
711  &weights_);
712  else
714  jet, Particle::LorentzVector(fjJet.px(), fjJet.py(), fjJet.pz(), fjJet.E()), vertex_, constituents, iSetup);
715  phiJ[ijet] = jet.phi();
716  etaJ[ijet] = jet.eta();
717  jet.setIsWeighted(applyWeight_);
718  }
719 
720  // calcuate the jet area
721  for (unsigned int ijet = 0; ijet < fjJets_.size(); ++ijet) {
722  // calcuate the jet area
723  double jetArea = 0.0;
724  // get the fastjet jet
725  const auto& fjJet = fjJets_[ijet];
726  if (doAreaFastjet_ && fjJet.has_area()) {
727  jetArea = fjJet.area();
728  } else if (doAreaDiskApprox_) {
729  // Here it is assumed that fjJets_ is in decreasing order of pT,
730  // which should happen in FastjetJetProducer::runAlgorithm()
731  jetArea = M_PI;
732  RIJ* distance = rij[ijet];
733  for (unsigned jJet = 0; jJet < ijet; ++jJet) {
734  distance[jJet].first = std::sqrt(reco::deltaR2(etaJ[ijet], phiJ[ijet], etaJ[jJet], phiJ[jJet])) * orParam_;
736  jetArea -= distance[jJet].second;
737  for (unsigned kJet = 0; kJet < jJet; ++kJet) {
739  distance[kJet].first,
740  rij[jJet][kJet].first,
741  distance[jJet].second,
742  distance[kJet].second,
743  rij[jJet][kJet].second);
744  } // end loop over harder jets
745  } // end loop over harder jets
746  jetArea *= (rParam_ * rParam_);
747  }
748  auto& jet = (*jets)[ijet];
749  jet.setJetArea(jetArea);
750 
751  if (doPUOffsetCorr_) {
752  jet.setPileup(subtractor_->getPileUpEnergy(ijet));
753  } else {
754  jet.setPileup(0.0);
755  }
756 
757  // std::cout << "area " << ijet << " " << jetArea << " " << Area<T>::get(jet) << std::endl;
758  // std::cout << "JetVI " << ijet << ' '<< jet.pt() << " " << jet.et() << ' '<< jet.energy() << ' '<< jet.mass() << std::endl;
759  }
760  }
761  // put the jets in the collection
763 }

References reco::deltaR2(), HLT_2018_cff::distance, PVValHelper::eta, muonTiming_cfi::etamax, muonTiming_cfi::etamin, Exception, dqmdumpme::first, iEvent, reco::helper::VirtualJetProducerHelper::intersection(), edm::isNotFinite(), metsig::jet, singleTopDQM_cfi::jets, dqmdumpme::k, M_PI, eostools::move(), HLT_2018_cff::nEta, fastjet::BackgroundEstimator::rho(), edm::second(), fastjet::BackgroundEstimator::set_excluded_jets(), fastjet::BackgroundEstimator::sigma(), mathSSE::sqrt(), and reco::writeSpecific().

◆ writeJetsWithConstituents()

template<class T >
void VirtualJetProducer::writeJetsWithConstituents ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
protected

function template to write out the outputs

Definition at line 909 of file VirtualJetProducer.cc.

909  {
910  if (verbosity_ >= 1) {
911  std::cout << "<VirtualJetProducer::writeJetsWithConstituents (moduleLabel = " << moduleLabel_ << ")>:" << std::endl;
912  }
913 
914  // get a list of output jets MV: make this compatible with template
915  auto jetCollection = std::make_unique<reco::PFJetCollection>();
916 
917  // this is the mapping of jet to constituents
918  std::vector<std::vector<int>> indices;
919  // this is the list of jet 4-momenta
920  std::vector<math::XYZTLorentzVector> p4_Jets;
921  // this is the jet areas
922  std::vector<double> area_Jets;
923 
924  // get a list of output constituents
925  auto constituentCollection = std::make_unique<reco::PFCandidateCollection>();
926 
927  // This will store the handle for the constituents after we write them
928  edm::OrphanHandle<reco::PFCandidateCollection> constituentHandleAfterPut;
929 
930  // Loop over the jets and extract constituents
931  std::vector<fastjet::PseudoJet> constituentsSub;
932  std::vector<fastjet::PseudoJet>::const_iterator it = fjJets_.begin(), iEnd = fjJets_.end(), iBegin = fjJets_.begin();
933  indices.resize(fjJets_.size());
934 
935  for (; it != iEnd; ++it) {
936  fastjet::PseudoJet const& localJet = *it;
937  unsigned int jetIndex = it - iBegin;
938  // Get the 4-vector for the hard jet
939  p4_Jets.push_back(math::XYZTLorentzVector(localJet.px(), localJet.py(), localJet.pz(), localJet.e()));
940  double localJetArea = 0.0;
941  if (doAreaFastjet_ && localJet.has_area()) {
942  localJetArea = localJet.area();
943  }
944  area_Jets.push_back(localJetArea);
945 
946  // create the constituent list
947  std::vector<fastjet::PseudoJet> constituents, ghosts;
948  if (it->has_pieces())
949  constituents = it->pieces();
950  else if (it->has_constituents())
951  fastjet::SelectorIsPureGhost().sift(it->constituents(), ghosts, constituents); //filter out ghosts
952 
953  //loop over constituents of jet (can be subjets or normal constituents)
954  indices[jetIndex].reserve(constituents.size());
955  constituentsSub.reserve(constituentsSub.size() + constituents.size());
956  for (fastjet::PseudoJet const& constit : constituents) {
957  indices[jetIndex].push_back(constituentsSub.size());
958  constituentsSub.push_back(constit);
959  }
960  }
961 
962  //Loop over constituents and store in the event
963  static const reco::PFCandidate dummySinceTranslateIsNotStatic;
964  for (fastjet::PseudoJet const& constit : constituentsSub) {
965  auto orig = inputs_[constit.user_index()];
966  auto id = dummySinceTranslateIsNotStatic.translatePdgIdToType(orig->pdgId());
967  reco::PFCandidate pCand(reco::PFCandidate(orig->charge(), orig->p4(), id));
969  pVec.SetPxPyPzE(constit.px(), constit.py(), constit.pz(), constit.e());
970  pCand.setP4(pVec);
971  pCand.setSourceCandidatePtr(orig->sourceCandidatePtr(0));
972  constituentCollection->push_back(pCand);
973  }
974  // put constituents into event record
975  constituentHandleAfterPut = iEvent.put(std::move(constituentCollection), jetCollInstanceName_);
976 
977  // Now create the jets with ptr's to the constituents
978  std::vector<math::XYZTLorentzVector>::const_iterator ip4 = p4_Jets.begin(), ip4Begin = p4_Jets.begin(),
979  ip4End = p4_Jets.end();
980 
981  for (; ip4 != ip4End; ++ip4) {
982  int p4_index = ip4 - ip4Begin;
983  std::vector<int>& ind = indices[p4_index];
984  std::vector<reco::CandidatePtr> i_jetConstituents;
985  // Add the constituents to the jet
986  for (std::vector<int>::const_iterator iconst = ind.begin(); iconst != ind.end(); ++iconst) {
987  reco::CandidatePtr candPtr(constituentHandleAfterPut, *iconst, false);
988  i_jetConstituents.push_back(candPtr);
989  }
990  if (!i_jetConstituents.empty()) { //only keep jets which have constituents after subtraction
991  reco::Particle::Point point(0, 0, 0);
993  reco::writeSpecific(jet, *ip4, point, i_jetConstituents, iSetup);
994  jet.setJetArea(area_Jets[ip4 - ip4Begin]);
995  jetCollection->emplace_back(jet);
996  }
997  }
998 
999  // put jets into event record
1001 }

References gather_cfg::cout, triggerObjects_cff::id, iEvent, bTagCombinedSVVariables_cff::indices, metsig::jet, jetfilter_cfi::jetCollection, eostools::move(), point, reco::LeafCandidate::setP4(), reco::PFCandidate::setSourceCandidatePtr(), reco::PFCandidate::translatePdgIdToType(), and reco::writeSpecific().

Member Data Documentation

◆ activeAreaRepeats_

int VirtualJetProducer::activeAreaRepeats_
protected

Definition at line 175 of file VirtualJetProducer.h.

◆ anomalousTowerDef_

std::unique_ptr<AnomalousTower> VirtualJetProducer::anomalousTowerDef_
private

Definition at line 213 of file VirtualJetProducer.h.

◆ applyWeight_

bool VirtualJetProducer::applyWeight_
protected

Definition at line 209 of file VirtualJetProducer.h.

◆ doAreaDiskApprox_

bool VirtualJetProducer::doAreaDiskApprox_
protected

Definition at line 165 of file VirtualJetProducer.h.

◆ doAreaFastjet_

bool VirtualJetProducer::doAreaFastjet_
protected

◆ doFastJetNonUniform_

bool VirtualJetProducer::doFastJetNonUniform_
protected

Definition at line 168 of file VirtualJetProducer.h.

◆ doPUOffsetCorr_

bool VirtualJetProducer::doPUOffsetCorr_
protected

Definition at line 179 of file VirtualJetProducer.h.

◆ doPVCorrection_

bool VirtualJetProducer::doPVCorrection_
protected

Definition at line 156 of file VirtualJetProducer.h.

◆ doRhoFastjet_

bool VirtualJetProducer::doRhoFastjet_
protected

◆ fjActiveArea_

ActiveAreaSpecPtr VirtualJetProducer::fjActiveArea_
protected

Definition at line 188 of file VirtualJetProducer.h.

◆ fjAreaDefinition_

AreaDefinitionPtr VirtualJetProducer::fjAreaDefinition_
protected

◆ fjClusterSeq_

ClusterSequencePtr VirtualJetProducer::fjClusterSeq_
protected

◆ fjInputs_

std::vector<fastjet::PseudoJet> VirtualJetProducer::fjInputs_
protected

◆ fjJetDefinition_

JetDefPtr VirtualJetProducer::fjJetDefinition_
protected

◆ fjJets_

std::vector<fastjet::PseudoJet> VirtualJetProducer::fjJets_
protected

◆ fjPlugin_

PluginPtr VirtualJetProducer::fjPlugin_
protected

Definition at line 187 of file VirtualJetProducer.h.

◆ fjSelector_

SelectorPtr VirtualJetProducer::fjSelector_
protected

Definition at line 190 of file VirtualJetProducer.h.

◆ fromHTTTopJetProducer_

bool VirtualJetProducer::fromHTTTopJetProducer_ = false
protected

Definition at line 208 of file VirtualJetProducer.h.

Referenced by cms::HTTTopJetProducer::HTTTopJetProducer().

◆ ghostArea_

double VirtualJetProducer::ghostArea_
protected

Definition at line 176 of file VirtualJetProducer.h.

◆ ghostEtaMax_

double VirtualJetProducer::ghostEtaMax_
protected

Definition at line 174 of file VirtualJetProducer.h.

◆ input_candidatefwdptr_token_

edm::EDGetTokenT<std::vector<edm::FwdPtr<reco::PFCandidate> > > VirtualJetProducer::input_candidatefwdptr_token_
private

Definition at line 217 of file VirtualJetProducer.h.

◆ input_candidateview_token_

edm::EDGetTokenT<reco::CandidateView> VirtualJetProducer::input_candidateview_token_
private

Definition at line 216 of file VirtualJetProducer.h.

◆ input_gencandidatefwdptr_token_

edm::EDGetTokenT<std::vector<edm::FwdPtr<reco::GenParticle> > > VirtualJetProducer::input_gencandidatefwdptr_token_
private

Definition at line 219 of file VirtualJetProducer.h.

◆ input_packedcandidatefwdptr_token_

edm::EDGetTokenT<std::vector<edm::FwdPtr<pat::PackedCandidate> > > VirtualJetProducer::input_packedcandidatefwdptr_token_
private

Definition at line 218 of file VirtualJetProducer.h.

◆ input_packedgencandidatefwdptr_token_

edm::EDGetTokenT<std::vector<edm::FwdPtr<pat::PackedGenParticle> > > VirtualJetProducer::input_packedgencandidatefwdptr_token_
private

Definition at line 220 of file VirtualJetProducer.h.

◆ input_vertex_token_

edm::EDGetTokenT<reco::VertexCollection> VirtualJetProducer::input_vertex_token_
protected

Definition at line 223 of file VirtualJetProducer.h.

Referenced by FastjetJetProducer::produceTrackJets().

◆ input_weights_token_

edm::EDGetTokenT<edm::ValueMap<float> > VirtualJetProducer::input_weights_token_
protected

Definition at line 224 of file VirtualJetProducer.h.

◆ inputEMin_

double VirtualJetProducer::inputEMin_
protected

Definition at line 154 of file VirtualJetProducer.h.

Referenced by cms::SubEventGenJetProducer::inputTowers().

◆ inputEtMin_

double VirtualJetProducer::inputEtMin_
protected

Definition at line 153 of file VirtualJetProducer.h.

Referenced by cms::SubEventGenJetProducer::inputTowers().

◆ inputs_

std::vector<edm::Ptr<reco::Candidate> > VirtualJetProducer::inputs_
protected

◆ jetAlgorithm_

std::string VirtualJetProducer::jetAlgorithm_
protected

Definition at line 151 of file VirtualJetProducer.h.

◆ jetCollInstanceName_

std::string VirtualJetProducer::jetCollInstanceName_
protected

Definition at line 199 of file VirtualJetProducer.h.

Referenced by cms::CompoundJetProducer::writeCompoundJets().

◆ jetPtMin_

double VirtualJetProducer::jetPtMin_
protected

◆ jetType_

std::string VirtualJetProducer::jetType_
protected

Definition at line 150 of file VirtualJetProducer.h.

◆ jetTypeE

JetType::Type VirtualJetProducer::jetTypeE
protected

◆ maxInputs_

unsigned int VirtualJetProducer::maxInputs_
protected

Definition at line 160 of file VirtualJetProducer.h.

◆ minSeed_

unsigned int VirtualJetProducer::minSeed_
protected

Definition at line 205 of file VirtualJetProducer.h.

◆ moduleLabel_

std::string VirtualJetProducer::moduleLabel_
protected

◆ nExclude_

unsigned int VirtualJetProducer::nExclude_
protected

Definition at line 197 of file VirtualJetProducer.h.

◆ puCenters_

std::vector<double> VirtualJetProducer::puCenters_
protected

Definition at line 195 of file VirtualJetProducer.h.

◆ puSubtractorName_

std::string VirtualJetProducer::puSubtractorName_
protected

Definition at line 180 of file VirtualJetProducer.h.

◆ puWidth_

double VirtualJetProducer::puWidth_
protected

Definition at line 196 of file VirtualJetProducer.h.

◆ restrictInputs_

bool VirtualJetProducer::restrictInputs_
protected

Definition at line 159 of file VirtualJetProducer.h.

◆ rhoEtaMax_

double VirtualJetProducer::rhoEtaMax_
protected

Definition at line 173 of file VirtualJetProducer.h.

◆ rParam_

double VirtualJetProducer::rParam_
protected

Definition at line 152 of file VirtualJetProducer.h.

◆ src_

edm::InputTag VirtualJetProducer::src_
protected

◆ srcPVs_

edm::InputTag VirtualJetProducer::srcPVs_
protected

Definition at line 149 of file VirtualJetProducer.h.

◆ subtractor_

std::shared_ptr<PileUpSubtractor> VirtualJetProducer::subtractor_
protected

Definition at line 202 of file VirtualJetProducer.h.

◆ useDeterministicSeed_

bool VirtualJetProducer::useDeterministicSeed_
protected

Definition at line 204 of file VirtualJetProducer.h.

◆ useExplicitGhosts_

bool VirtualJetProducer::useExplicitGhosts_
protected

Definition at line 164 of file VirtualJetProducer.h.

Referenced by FastjetJetProducer::FastjetJetProducer().

◆ verbosity_

int VirtualJetProducer::verbosity_
protected

Definition at line 207 of file VirtualJetProducer.h.

Referenced by FastjetJetProducer::runAlgorithm().

◆ vertex_

reco::Particle::Point VirtualJetProducer::vertex_
protected

◆ voronoiRfact_

double VirtualJetProducer::voronoiRfact_
protected

◆ weights_

edm::ValueMap<float> VirtualJetProducer::weights_
protected

Definition at line 210 of file VirtualJetProducer.h.

◆ writeCompound_

bool VirtualJetProducer::writeCompound_
protected

Definition at line 200 of file VirtualJetProducer.h.

◆ writeJetsWithConst_

bool VirtualJetProducer::writeJetsWithConst_
protected

Definition at line 201 of file VirtualJetProducer.h.

VirtualJetProducer::maxInputs_
unsigned int maxInputs_
Definition: VirtualJetProducer.h:160
VirtualJetProducer::JetType::PFClusterJet
Definition: VirtualJetProducer.h:47
bTagCombinedSVVariables_cff.indices
indices
Definition: bTagCombinedSVVariables_cff.py:67
VirtualJetProducer::output
virtual void output(edm::Event &iEvent, edm::EventSetup const &iSetup)
Definition: VirtualJetProducer.cc:536
VirtualJetProducer::minSeed_
unsigned int minSeed_
Definition: VirtualJetProducer.h:205
VirtualJetProducer::rParam_
double rParam_
Definition: VirtualJetProducer.h:152
reco::writeSpecific
void writeSpecific(reco::CaloJet &jet, reco::Particle::LorentzVector const &p4, reco::Particle::Point const &point, std::vector< reco::CandidatePtr > const &constituents, edm::EventSetup const &c)
Definition: JetSpecific.cc:34
VirtualJetProducer::anomalousTowerDef_
std::unique_ptr< AnomalousTower > anomalousTowerDef_
Definition: VirtualJetProducer.h:213
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
input
static const std::string input
Definition: EdmProvDump.cc:48
edm::View::empty
bool empty() const
VirtualJetProducer::puSubtractorName_
std::string puSubtractorName_
Definition: VirtualJetProducer.h:180
VirtualJetProducer::runAlgorithm
virtual void runAlgorithm(edm::Event &iEvent, const edm::EventSetup &iSetup)=0
reco::LeafCandidate::Point
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
VirtualJetProducer::makeCaloJet
bool makeCaloJet(const JetType::Type &fTag)
Definition: VirtualJetProducer.h:56
AnomalousTower
Definition: AnomalousTower.h:7
edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
VirtualJetProducer::doFastJetNonUniform_
bool doFastJetNonUniform_
Definition: VirtualJetProducer.h:168
VirtualJetProducer::makeProduces
virtual void makeProduces(std::string s, std::string tag="")
Definition: VirtualJetProducer.cc:83
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::swap
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:3
VirtualJetProducer::jetTypeE
JetType::Type jetTypeE
Definition: VirtualJetProducer.h:54
HLT_2018_cff.distance
distance
Definition: HLT_2018_cff.py:6417
VirtualJetProducer::JetType::PFJet
Definition: VirtualJetProducer.h:45
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
VirtualJetProducer::nExclude_
unsigned int nExclude_
Definition: VirtualJetProducer.h:197
VirtualJetProducer::addHTTTopJetTagInfoCollection
virtual void addHTTTopJetTagInfoCollection(edm::Event &iEvent, const edm::EventSetup &iSetup, edm::OrphanHandle< reco::BasicJetCollection > &oh)
Definition: VirtualJetProducer.h:113
VirtualJetProducer::subtractor_
std::shared_ptr< PileUpSubtractor > subtractor_
Definition: VirtualJetProducer.h:202
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
VirtualJetProducer::JetType::BasicJet
Definition: VirtualJetProducer.h:42
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
fastjet::BackgroundEstimator
Definition: BackgroundEstimator.h:41
edm::Handle< reco::VertexCollection >
VirtualJetProducer::voronoiRfact_
double voronoiRfact_
Definition: VirtualJetProducer.h:170
dqmdumpme.first
first
Definition: dqmdumpme.py:55
VirtualJetProducer::verbosity_
int verbosity_
Definition: VirtualJetProducer.h:207
VirtualJetProducer::vertex_
reco::Particle::Point vertex_
Definition: VirtualJetProducer.h:184
VirtualJetProducer::fjClusterSeq_
ClusterSequencePtr fjClusterSeq_
Definition: VirtualJetProducer.h:185
muonTiming_cfi.etamin
etamin
Definition: muonTiming_cfi.py:30
geometryDiff.epsilon
int epsilon
Definition: geometryDiff.py:26
VirtualJetProducer::JetType::CaloJet
Definition: VirtualJetProducer.h:44
VirtualJetProducer::inputEtMin_
double inputEtMin_
Definition: VirtualJetProducer.h:153
VirtualJetProducer::jetAlgorithm_
std::string jetAlgorithm_
Definition: VirtualJetProducer.h:151
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
VirtualJetProducer::doPVCorrection_
bool doPVCorrection_
Definition: VirtualJetProducer.h:156
reco::BasicJet
Jets made from CaloTowers.
Definition: BasicJet.h:19
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
PVValHelper::eta
Definition: PVValidationHelpers.h:69
w
const double w
Definition: UKUtility.cc:23
edm::EDGetTokenT::isUninitialized
bool isUninitialized() const
Definition: EDGetToken.h:70
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
VirtualJetProducer::fromHTTTopJetProducer_
bool fromHTTTopJetProducer_
Definition: VirtualJetProducer.h:208
anotherprimaryvertexanalyzer_cfi.pvCollection
pvCollection
Definition: anotherprimaryvertexanalyzer_cfi.py:4
dqmdumpme.k
k
Definition: dqmdumpme.py:60
VirtualJetProducer::doPUOffsetCorr_
bool doPUOffsetCorr_
Definition: VirtualJetProducer.h:179
jetfilter_cfi.jetCollection
jetCollection
Definition: jetfilter_cfi.py:4
HLT_2018_cff.srcWeights
srcWeights
Definition: HLT_2018_cff.py:7335
VirtualJetProducer::PluginPtr
std::shared_ptr< fastjet::JetDefinition::Plugin > PluginPtr
Definition: VirtualJetProducer.h:74
VirtualJetProducer::doRhoFastjet_
bool doRhoFastjet_
Definition: VirtualJetProducer.h:167
DDAxes::rho
VirtualJetProducer::inputs_
std::vector< edm::Ptr< reco::Candidate > > inputs_
Definition: VirtualJetProducer.h:183
edm::View::size
size_type size() const
VirtualJetProducer::puCenters_
std::vector< double > puCenters_
Definition: VirtualJetProducer.h:195
edm::LogWarning
Definition: MessageLogger.h:141
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:232
VirtualJetProducer::writeJetsWithConst_
bool writeJetsWithConst_
Definition: VirtualJetProducer.h:201
VirtualJetProducer::jetType_
std::string jetType_
Definition: VirtualJetProducer.h:150
VirtualJetProducer::input_candidatefwdptr_token_
edm::EDGetTokenT< std::vector< edm::FwdPtr< reco::PFCandidate > > > input_candidatefwdptr_token_
Definition: VirtualJetProducer.h:217
VirtualJetProducer::src_
edm::InputTag src_
Definition: VirtualJetProducer.h:148
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
VirtualJetProducer::isAnomalousTower
virtual bool isAnomalousTower(reco::CandidatePtr input)
Definition: VirtualJetProducer.cc:499
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
VirtualJetProducer::input_vertex_token_
edm::EDGetTokenT< reco::VertexCollection > input_vertex_token_
Definition: VirtualJetProducer.h:223
VirtualJetProducer::JetType::byName
static Type byName(const std::string &name)
Definition: VirtualJetProducer.cc:74
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
VirtualJetProducer::makeTrackJet
bool makeTrackJet(const JetType::Type &fTag)
Definition: VirtualJetProducer.h:59
VirtualJetProducer::activeAreaRepeats_
int activeAreaRepeats_
Definition: VirtualJetProducer.h:175
VirtualJetProducer::input_weights_token_
edm::EDGetTokenT< edm::ValueMap< float > > input_weights_token_
Definition: VirtualJetProducer.h:224
VirtualJetProducer::jetPtMin_
double jetPtMin_
Definition: VirtualJetProducer.h:155
VirtualJetProducer::moduleLabel_
std::string moduleLabel_
Definition: VirtualJetProducer.h:147
iEvent
int iEvent
Definition: GenABIO.cc:224
CaloTower
Definition: CaloTower.h:26
VirtualJetProducer::inputTowers
virtual void inputTowers()
Definition: VirtualJetProducer.cc:442
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
VirtualJetProducer::rhoEtaMax_
double rhoEtaMax_
Definition: VirtualJetProducer.h:173
VirtualJetProducer::jetCollInstanceName_
std::string jetCollInstanceName_
Definition: VirtualJetProducer.h:199
HLT_2018_cff.nEta
nEta
Definition: HLT_2018_cff.py:5271
VirtualJetProducer::JetType::TrackJet
Definition: VirtualJetProducer.h:46
VirtualJetProducer::fjAreaDefinition_
AreaDefinitionPtr fjAreaDefinition_
Definition: VirtualJetProducer.h:189
get
#define get
VirtualJetProducer::input_packedcandidatefwdptr_token_
edm::EDGetTokenT< std::vector< edm::FwdPtr< pat::PackedCandidate > > > input_packedcandidatefwdptr_token_
Definition: VirtualJetProducer.h:218
edm::Ptr< Candidate >
reco::JetExtendedAssociation::LorentzVector
math::PtEtaPhiELorentzVectorF LorentzVector
Definition: JetExtendedAssociation.h:25
VirtualJetProducer::fjPlugin_
PluginPtr fjPlugin_
Definition: VirtualJetProducer.h:187
VirtualJetProducer::puWidth_
double puWidth_
Definition: VirtualJetProducer.h:196
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
VirtualJetProducer::JetType::GenJet
Definition: VirtualJetProducer.h:43
VirtualJetProducer::makePFJet
bool makePFJet(const JetType::Type &fTag)
Definition: VirtualJetProducer.h:57
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
VirtualJetProducer::getConstituents
virtual std::vector< reco::CandidatePtr > getConstituents(const std::vector< fastjet::PseudoJet > &fjConstituents)
Definition: VirtualJetProducer.cc:522
VirtualJetProducer::makeGenJet
bool makeGenJet(const JetType::Type &fTag)
Definition: VirtualJetProducer.h:58
VirtualJetProducer::makePFClusterJet
bool makePFClusterJet(const JetType::Type &fTag)
Definition: VirtualJetProducer.h:60
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
VirtualJetProducer::doAreaDiskApprox_
bool doAreaDiskApprox_
Definition: VirtualJetProducer.h:165
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
VirtualJetProducer::doAreaFastjet_
bool doAreaFastjet_
Definition: VirtualJetProducer.h:163
metsig::jet
Definition: SignAlgoResolutions.h:47
edm::ValueMap< float >
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:129
Exception
Definition: hltDiff.cc:246
muonTiming_cfi.etamax
etamax
Definition: muonTiming_cfi.py:23
VirtualJetProducer::fjActiveArea_
ActiveAreaSpecPtr fjActiveArea_
Definition: VirtualJetProducer.h:188
VirtualJetProducer::fjJets_
std::vector< fastjet::PseudoJet > fjJets_
Definition: VirtualJetProducer.h:192
VirtualJetProducer::fjJetDefinition_
JetDefPtr fjJetDefinition_
Definition: VirtualJetProducer.h:186
reco::PFJet
Jets made from PFObjects.
Definition: PFJet.h:20
VirtualJetProducer::useDeterministicSeed_
bool useDeterministicSeed_
Definition: VirtualJetProducer.h:204
VirtualJetProducer::weights_
edm::ValueMap< float > weights_
Definition: VirtualJetProducer.h:210
reco::PFCandidate::translatePdgIdToType
ParticleType translatePdgIdToType(int pdgid) const
Definition: PFCandidate.cc:209
VirtualJetProducer::writeCompound_
bool writeCompound_
Definition: VirtualJetProducer.h:200
VirtualJetProducer::useExplicitGhosts_
bool useExplicitGhosts_
Definition: VirtualJetProducer.h:164
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
reco::Particle::Point
math::XYZPoint Point
point in the space
Definition: Particle.h:25
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
VirtualJetProducer::fjSelector_
SelectorPtr fjSelector_
Definition: VirtualJetProducer.h:190
VirtualJetProducer::applyWeight_
bool applyWeight_
Definition: VirtualJetProducer.h:209
mps_fire.result
result
Definition: mps_fire.py:303
cms::Exception
Definition: Exception.h:70
reco::helper::GreaterByPtPseudoJet
Definition: VirtualJetProducer.cc:60
VirtualJetProducer::restrictInputs_
bool restrictInputs_
Definition: VirtualJetProducer.h:159
VirtualJetProducer::ghostArea_
double ghostArea_
Definition: VirtualJetProducer.h:176
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
VirtualJetProducer::fjInputs_
std::vector< fastjet::PseudoJet > fjInputs_
Definition: VirtualJetProducer.h:191
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::View::ptrAt
Ptr< value_type > ptrAt(size_type i) const
VirtualJetProducer::makeBasicJet
bool makeBasicJet(const JetType::Type &fTag)
Definition: VirtualJetProducer.h:61
VirtualJetProducer::srcPVs_
edm::InputTag srcPVs_
Definition: VirtualJetProducer.h:149
VirtualJetProducer::input_candidateview_token_
edm::EDGetTokenT< reco::CandidateView > input_candidateview_token_
Definition: VirtualJetProducer.h:216
edm::InputTag
Definition: InputTag.h:15
VirtualJetProducer::input_packedgencandidatefwdptr_token_
edm::EDGetTokenT< std::vector< edm::FwdPtr< pat::PackedGenParticle > > > input_packedgencandidatefwdptr_token_
Definition: VirtualJetProducer.h:220
reco::helper::VirtualJetProducerHelper::intersection
double intersection(double r12)
Definition: VirtualJetProducerHelper.h:14
VirtualJetProducer::fillDescriptionsFromVirtualJetProducer
static void fillDescriptionsFromVirtualJetProducer(edm::ParameterSetDescription &desc)
Definition: VirtualJetProducer.cc:1016
VirtualJetProducer::inputEMin_
double inputEMin_
Definition: VirtualJetProducer.h:154
VirtualJetProducer::input_gencandidatefwdptr_token_
edm::EDGetTokenT< std::vector< edm::FwdPtr< reco::GenParticle > > > input_gencandidatefwdptr_token_
Definition: VirtualJetProducer.h:219
VirtualJetProducer::ghostEtaMax_
double ghostEtaMax_
Definition: VirtualJetProducer.h:174