CMS 3D CMS Logo

PATJetProducer.cc
Go to the documentation of this file.
1 //
2 
4 
7 
11 
19 
21 
24 
26 
28 
31 
33 
34 #include <vector>
35 #include <memory>
36 #include <algorithm>
37 
38 using namespace pat;
39 
41  : useUserData_(iConfig.exists("userData")), printWarning_(true) {
42  // initialize configurables
43  jetsToken_ = consumes<edm::View<reco::Jet>>(iConfig.getParameter<edm::InputTag>("jetSource"));
44  embedCaloTowers_ = false; // parameter is optional
45  if (iConfig.exists("embedCaloTowers")) {
46  embedCaloTowers_ = iConfig.getParameter<bool>("embedCaloTowers");
47  }
48  embedPFCandidates_ = iConfig.getParameter<bool>("embedPFCandidates");
49  getJetMCFlavour_ = iConfig.getParameter<bool>("getJetMCFlavour");
50  useLegacyJetMCFlavour_ = iConfig.getParameter<bool>("useLegacyJetMCFlavour");
51  addJetFlavourInfo_ = (useLegacyJetMCFlavour_ ? false : iConfig.getParameter<bool>("addJetFlavourInfo"));
54  consumes<reco::JetFlavourMatchingCollection>(iConfig.getParameter<edm::InputTag>("JetPartonMapSource"));
57  consumes<reco::JetFlavourInfoMatchingCollection>(iConfig.getParameter<edm::InputTag>("JetFlavourInfoSource"));
58  addGenPartonMatch_ = iConfig.getParameter<bool>("addGenPartonMatch");
59  embedGenPartonMatch_ = iConfig.getParameter<bool>("embedGenPartonMatch");
62  consumes<edm::Association<reco::GenParticleCollection>>(iConfig.getParameter<edm::InputTag>("genPartonMatch"));
63  addGenJetMatch_ = iConfig.getParameter<bool>("addGenJetMatch");
64  embedGenJetMatch_ = iConfig.getParameter<bool>("embedGenJetMatch");
65  if (addGenJetMatch_)
66  genJetToken_ =
67  consumes<edm::Association<reco::GenJetCollection>>(iConfig.getParameter<edm::InputTag>("genJetMatch"));
68  addPartonJetMatch_ = iConfig.getParameter<bool>("addPartonJetMatch");
69  // partonJetToken_ = mayConsume<reco::SomePartonJetType>(iConfig.getParameter<edm::InputTag>( "partonJetSource" ));
70  addJetCorrFactors_ = iConfig.getParameter<bool>("addJetCorrFactors");
71  if (addJetCorrFactors_) {
73  iConfig.getParameter<std::vector<edm::InputTag>>("jetCorrFactorsSource"),
74  [this](edm::InputTag const &tag) { return consumes<edm::ValueMap<JetCorrFactors>>(tag); });
75  }
76  addBTagInfo_ = iConfig.getParameter<bool>("addBTagInfo");
77  addDiscriminators_ = iConfig.getParameter<bool>("addDiscriminators");
78  discriminatorTags_ = iConfig.getParameter<std::vector<edm::InputTag>>("discriminatorSources");
80  return mayConsume<reco::JetFloatAssociation::Container>(tag);
81  });
82  addTagInfos_ = iConfig.getParameter<bool>("addTagInfos");
83  tagInfoTags_ = iConfig.getParameter<std::vector<edm::InputTag>>("tagInfoSources");
85  tagInfoTags_, [this](edm::InputTag const &tag) { return mayConsume<edm::View<reco::BaseTagInfo>>(tag); });
86  addAssociatedTracks_ = iConfig.getParameter<bool>("addAssociatedTracks");
89  consumes<reco::JetTracksAssociation::Container>(iConfig.getParameter<edm::InputTag>("trackAssociationSource"));
90  addJetCharge_ = iConfig.getParameter<bool>("addJetCharge");
91  if (addJetCharge_)
93  consumes<reco::JetFloatAssociation::Container>(iConfig.getParameter<edm::InputTag>("jetChargeSource"));
94  addJetID_ = iConfig.getParameter<bool>("addJetID");
95  if (addJetID_)
96  jetIDMapToken_ = consumes<reco::JetIDValueMap>(iConfig.getParameter<edm::InputTag>("jetIDMap"));
97  // Efficiency configurables
98  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
99  if (addEfficiencies_) {
101  pat::helper::EfficiencyLoader(iConfig.getParameter<edm::ParameterSet>("efficiencies"), consumesCollector());
102  }
103  // Resolution configurables
104  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
105  if (addResolutions_) {
107  }
108  if (discriminatorTags_.empty()) {
109  addDiscriminators_ = false;
110  } else {
111  for (std::vector<edm::InputTag>::const_iterator it = discriminatorTags_.begin(), ed = discriminatorTags_.end();
112  it != ed;
113  ++it) {
114  std::string label = it->label();
115  std::string::size_type pos = label.find("JetTags");
116  if ((pos != std::string::npos) && (pos != label.length() - 7)) {
117  label.erase(pos + 7); // trim a tail after "JetTags"
118  }
119  if (!it->instance().empty()) {
120  label = (label + std::string(":") + it->instance());
121  }
122  discriminatorLabels_.push_back(label);
123  }
124  }
125  if (tagInfoTags_.empty()) {
126  addTagInfos_ = false;
127  } else {
128  for (std::vector<edm::InputTag>::const_iterator it = tagInfoTags_.begin(), ed = tagInfoTags_.end(); it != ed;
129  ++it) {
130  std::string label = it->label();
131  std::string::size_type pos = label.find("TagInfos");
132  if ((pos != std::string::npos) && (pos != label.length() - 8)) {
133  label.erase(pos + 8); // trim a tail after "TagInfos"
134  }
135  tagInfoLabels_.push_back(label);
136  }
137  }
138  if (!addBTagInfo_) {
139  addDiscriminators_ = false;
140  addTagInfos_ = false;
141  }
142  // Check to see if the user wants to add user data
143  if (useUserData_) {
144  userDataHelper_ = PATUserDataHelper<Jet>(iConfig.getParameter<edm::ParameterSet>("userData"), consumesCollector());
145  }
146  // produces vector of jets
147  produces<std::vector<Jet>>();
148  produces<reco::GenJetCollection>("genJets");
149  produces<std::vector<CaloTower>>("caloTowers");
150  produces<reco::PFCandidateCollection>("pfCandidates");
151  produces<edm::OwnVector<reco::BaseTagInfo>>("tagInfos");
152 }
153 
155 
157  // check whether dealing with MC or real data
158  if (iEvent.isRealData()) {
159  getJetMCFlavour_ = false;
160  useLegacyJetMCFlavour_ = false;
161  addJetFlavourInfo_ = false;
162  addGenPartonMatch_ = false;
163  addGenJetMatch_ = false;
164  addPartonJetMatch_ = false;
165  }
166 
167  // Get the vector of jets
169  iEvent.getByToken(jetsToken_, jets);
170 
175 
176  // for jet flavour
180  iEvent.getByToken(jetPartonMapToken_, jetFlavMatch);
182  iEvent.getByToken(jetFlavourInfoToken_, jetFlavInfoMatch);
183 
184  // Get the vector of generated particles from the event if needed
186  if (addGenPartonMatch_)
187  iEvent.getByToken(genPartonToken_, partonMatch);
188  // Get the vector of GenJets from the event if needed
190  if (addGenJetMatch_)
191  iEvent.getByToken(genJetToken_, genJetMatch);
192  /* TO BE IMPLEMENTED FOR >= 1_5_X
193  // Get the vector of PartonJets from the event if needed
194  edm::Handle<edm::View<reco::SomePartonJetType> > partonJets;
195  if (addPartonJetMatch_) iEvent.getByToken(partonJetToken_, partonJets);
196 */
197 
198  // read in the jet correction factors ValueMap
199  std::vector<edm::ValueMap<JetCorrFactors>> jetCorrs;
200  if (addJetCorrFactors_) {
201  for (size_t i = 0; i < jetCorrFactorsTokens_.size(); ++i) {
203  iEvent.getByToken(jetCorrFactorsTokens_[i], jetCorr);
204  jetCorrs.push_back(*jetCorr);
205  }
206  }
207 
208  // Get the vector of jet tags with b-tagging info
209  std::vector<edm::Handle<reco::JetFloatAssociation::Container>> jetDiscriminators;
211  jetDiscriminators.resize(discriminatorTokens_.size());
212  for (size_t i = 0; i < discriminatorTokens_.size(); ++i) {
213  iEvent.getByToken(discriminatorTokens_[i], jetDiscriminators[i]);
214  }
215  }
216  std::vector<edm::Handle<edm::View<reco::BaseTagInfo>>> jetTagInfos;
217  if (addBTagInfo_ && addTagInfos_) {
218  jetTagInfos.resize(tagInfoTokens_.size());
219  for (size_t i = 0; i < tagInfoTokens_.size(); ++i) {
220  iEvent.getByToken(tagInfoTokens_[i], jetTagInfos[i]);
221  }
222  }
223 
224  // tracks Jet Track Association
227  iEvent.getByToken(trackAssociationToken_, hTrackAss);
229  if (addJetCharge_)
230  iEvent.getByToken(jetChargeToken_, hJetChargeAss);
231 
232  // jet ID handle
234  if (addJetID_)
235  iEvent.getByToken(jetIDMapToken_, hJetIDMap);
236 
237  // loop over jets
238  auto patJets = std::make_unique<std::vector<Jet>>();
239 
240  auto genJetsOut = std::make_unique<reco::GenJetCollection>();
241  auto caloTowersOut = std::make_unique<std::vector<CaloTower>>();
242  auto pfCandidatesOut = std::make_unique<reco::PFCandidateCollection>();
243  auto tagInfosOut = std::make_unique<edm::OwnVector<reco::BaseTagInfo>>();
244 
245  edm::RefProd<reco::GenJetCollection> h_genJetsOut = iEvent.getRefBeforePut<reco::GenJetCollection>("genJets");
246  edm::RefProd<std::vector<CaloTower>> h_caloTowersOut = iEvent.getRefBeforePut<std::vector<CaloTower>>("caloTowers");
248  iEvent.getRefBeforePut<reco::PFCandidateCollection>("pfCandidates");
250  iEvent.getRefBeforePut<edm::OwnVector<reco::BaseTagInfo>>("tagInfos");
251 
252  for (edm::View<reco::Jet>::const_iterator itJet = jets->begin(); itJet != jets->end(); itJet++) {
253  // construct the Jet from the ref -> save ref to original object
254  unsigned int idx = itJet - jets->begin();
255  edm::RefToBase<reco::Jet> jetRef = jets->refAt(idx);
256  edm::Ptr<reco::Jet> jetPtr = jets->ptrAt(idx);
257  Jet ajet(jetRef);
258 
259  // add the FwdPtrs to the CaloTowers
260  if ((ajet.isCaloJet() || ajet.isJPTJet()) && embedCaloTowers_) {
261  const reco::CaloJet *cj = nullptr;
262  const reco::JPTJet *jptj = nullptr;
263  if (ajet.isCaloJet())
264  cj = dynamic_cast<const reco::CaloJet *>(jetRef.get());
265  else {
266  jptj = dynamic_cast<const reco::JPTJet *>(jetRef.get());
267  cj = dynamic_cast<const reco::CaloJet *>(jptj->getCaloJetRef().get());
268  }
270  std::vector<CaloTowerPtr> itowers = cj->getCaloConstituents();
271  for (std::vector<CaloTowerPtr>::const_iterator towBegin = itowers.begin(),
272  towEnd = itowers.end(),
273  itow = towBegin;
274  itow != towEnd;
275  ++itow) {
276  if (itow->isAvailable() && itow->isNonnull()) {
277  caloTowersOut->push_back(**itow);
278  // set the "forward" ref to the thinned collection
279  edm::Ref<std::vector<CaloTower>> caloTowerRef(h_caloTowersOut, caloTowersOut->size() - 1);
280  edm::Ptr<CaloTower> caloForwardRef(h_caloTowersOut.id(), caloTowerRef.key(), h_caloTowersOut.productGetter());
281  // set the "backward" ref to the original collection for association
282  edm::Ptr<CaloTower> caloBackRef(*itow);
283  // add to the list of FwdPtr's
284  itowersRef.push_back(pat::CaloTowerFwdPtrCollection::value_type(caloForwardRef, caloBackRef));
285  }
286  }
287  ajet.setCaloTowers(itowersRef);
288  }
289 
290  // add the FwdPtrs to the PFCandidates
291  if (ajet.isPFJet() && embedPFCandidates_) {
292  const reco::PFJet *cj = dynamic_cast<const reco::PFJet *>(jetRef.get());
293  pat::PFCandidateFwdPtrCollection iparticlesRef;
294  std::vector<reco::PFCandidatePtr> iparticles = cj->getPFConstituents();
295  for (std::vector<reco::PFCandidatePtr>::const_iterator partBegin = iparticles.begin(),
296  partEnd = iparticles.end(),
297  ipart = partBegin;
298  ipart != partEnd;
299  ++ipart) {
300  pfCandidatesOut->push_back(**ipart);
301  // set the "forward" ref to the thinned collection
302  edm::Ref<reco::PFCandidateCollection> pfCollectionRef(h_pfCandidatesOut, pfCandidatesOut->size() - 1);
303  edm::Ptr<reco::PFCandidate> pfForwardRef(
304  h_pfCandidatesOut.id(), pfCollectionRef.key(), h_pfCandidatesOut.productGetter());
305  // set the "backward" ref to the original collection for association
306  edm::Ptr<reco::PFCandidate> pfBackRef(*ipart);
307  // add to the list of FwdPtr's
308  iparticlesRef.push_back(pat::PFCandidateFwdPtrCollection::value_type(pfForwardRef, pfBackRef));
309  }
310  ajet.setPFCandidates(iparticlesRef);
311  }
312 
313  if (addJetCorrFactors_) {
314  // add additional JetCorrs to the jet
315  for (unsigned int i = 0; i < jetCorrFactorsTokens_.size(); ++i) {
316  const JetCorrFactors &jcf = jetCorrs[i][jetRef];
317  // uncomment for debugging
318  // jcf.print();
319  ajet.addJECFactors(jcf);
320  }
321  std::vector<std::string> levels = jetCorrs[0][jetRef].correctionLabels();
322  if (std::find(levels.begin(), levels.end(), "L2L3Residual") != levels.end()) {
323  ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel("L2L3Residual"));
324  } else if (std::find(levels.begin(), levels.end(), "L3Absolute") != levels.end()) {
325  ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel("L3Absolute"));
326  } else {
327  ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel("Uncorrected"));
328  if (printWarning_) {
329  edm::LogWarning("L3Absolute not found")
330  << "L2L3Residual and L3Absolute are not part of the jetCorrFactors\n"
331  << "of module " << jetCorrs[0][jetRef].jecSet() << ". Jets will remain"
332  << " uncorrected.";
333  printWarning_ = false;
334  }
335  }
336  }
337 
338  // get the MC flavour information for this jet
340  ajet.setPartonFlavour((*jetFlavMatch)[edm::RefToBase<reco::Jet>(jetRef)].getFlavour());
341  } else if (getJetMCFlavour_ && !useLegacyJetMCFlavour_) {
342  if (addJetFlavourInfo_)
343  ajet.setJetFlavourInfo((*jetFlavInfoMatch)[edm::RefToBase<reco::Jet>(jetRef)]);
344  else {
345  ajet.setPartonFlavour((*jetFlavInfoMatch)[edm::RefToBase<reco::Jet>(jetRef)].getPartonFlavour());
346  ajet.setHadronFlavour((*jetFlavInfoMatch)[edm::RefToBase<reco::Jet>(jetRef)].getHadronFlavour());
347  }
348  }
349  // store the match to the generated partons
350  if (addGenPartonMatch_) {
351  reco::GenParticleRef parton = (*partonMatch)[jetRef];
352  if (parton.isNonnull() && parton.isAvailable()) {
353  ajet.setGenParton(parton, embedGenPartonMatch_);
354  } // leave empty if no match found
355  }
356  // store the match to the GenJets
357  if (addGenJetMatch_) {
358  reco::GenJetRef genjet = (*genJetMatch)[jetRef];
359  if (genjet.isNonnull() && genjet.isAvailable()) {
360  genJetsOut->push_back(*genjet);
361  // set the "forward" ref to the thinned collection
362  edm::Ref<reco::GenJetCollection> genForwardRef(h_genJetsOut, genJetsOut->size() - 1);
363  // set the "backward" ref to the original collection
364  const edm::Ref<reco::GenJetCollection> &genBackRef(genjet);
365  // make the FwdPtr
366  edm::FwdRef<reco::GenJetCollection> genjetFwdRef(genForwardRef, genBackRef);
367  ajet.setGenJetRef(genjetFwdRef);
368  } // leave empty if no match found
369  }
370 
371  if (efficiencyLoader_.enabled()) {
372  efficiencyLoader_.setEfficiencies(ajet, jetRef);
373  }
374 
375  // IMPORTANT: DO THIS AFTER JES CORRECTIONS
376  if (resolutionLoader_.enabled()) {
378  }
379 
380  // TO BE IMPLEMENTED FOR >=1_5_X: do the PartonJet matching
381  if (addPartonJetMatch_) {
382  }
383 
384  // add b-tag info if available & required
385  if (addBTagInfo_) {
386  if (addDiscriminators_) {
387  for (size_t k = 0; k < jetDiscriminators.size(); ++k) {
388  float value = (*jetDiscriminators[k])[jetRef];
389  ajet.addBDiscriminatorPair(std::make_pair(discriminatorLabels_[k], value));
390  }
391  }
392  if (addTagInfos_) {
393  for (size_t k = 0; k < jetTagInfos.size(); ++k) {
394  const edm::View<reco::BaseTagInfo> &taginfos = *jetTagInfos[k];
395  // This is not associative, so we have to search the jet
397  // Try first by 'same index'
398  if ((idx < taginfos.size()) && (taginfos[idx].jet() == jetRef)) {
399  match = taginfos.ptrAt(idx);
400  } else {
401  // otherwise fail back to a simple search
402  for (edm::View<reco::BaseTagInfo>::const_iterator itTI = taginfos.begin(), edTI = taginfos.end();
403  itTI != edTI;
404  ++itTI) {
405  if (itTI->jet() == jetRef) {
406  match = taginfos.ptrAt(itTI - taginfos.begin());
407  break;
408  }
409  }
410  }
411  if (match.isNonnull()) {
412  tagInfosOut->push_back(match->clone());
413  // set the "forward" ptr to the thinned collection
414  edm::Ptr<reco::BaseTagInfo> tagInfoForwardPtr(
415  h_tagInfosOut.id(), &tagInfosOut->back(), tagInfosOut->size() - 1);
416  // set the "backward" ptr to the original collection for association
417  const edm::Ptr<reco::BaseTagInfo> &tagInfoBackPtr(match);
418  // make FwdPtr
419  TagInfoFwdPtrCollection::value_type tagInfoFwdPtr(tagInfoForwardPtr, tagInfoBackPtr);
420  ajet.addTagInfo(tagInfoLabels_[k], tagInfoFwdPtr);
421  }
422  }
423  }
424  }
425 
427  ajet.setAssociatedTracks((*hTrackAss)[jetRef]);
428 
429  if (addJetCharge_)
430  ajet.setJetCharge((*hJetChargeAss)[jetRef]);
431 
432  // add jet ID for calo jets
433  if (addJetID_ && ajet.isCaloJet()) {
434  reco::JetID jetId = (*hJetIDMap)[jetRef];
435  ajet.setJetID(jetId);
436  }
437  // add jet ID jpt jets
438  else if (addJetID_ && ajet.isJPTJet()) {
439  const reco::JPTJet *jptj = dynamic_cast<const reco::JPTJet *>(jetRef.get());
440  reco::JetID jetId = (*hJetIDMap)[jptj->getCaloJetRef()];
441  ajet.setJetID(jetId);
442  }
443  if (useUserData_) {
444  userDataHelper_.add(ajet, iEvent, iSetup);
445  }
446  patJets->push_back(ajet);
447  }
448 
449  // sort jets in pt
450  std::sort(patJets->begin(), patJets->end(), pTComparator_);
451 
452  // put genEvt in Event
453  iEvent.put(std::move(patJets));
454 
455  iEvent.put(std::move(genJetsOut), "genJets");
456  iEvent.put(std::move(caloTowersOut), "caloTowers");
457  iEvent.put(std::move(pfCandidatesOut), "pfCandidates");
458  iEvent.put(std::move(tagInfosOut), "tagInfos");
459 }
460 
461 // ParameterSet description for module
464  iDesc.setComment("PAT jet producer module");
465 
466  // input source
467  iDesc.add<edm::InputTag>("jetSource", edm::InputTag("no default"))->setComment("input collection");
468 
469  // embedding
470  iDesc.addOptional<bool>("embedCaloTowers", false)
471  ->setComment("embed external CaloTowers (not to be used on AOD input)");
472  iDesc.add<bool>("embedPFCandidates", true)->setComment("embed external PFCandidates");
473 
474  // MC matching configurables
475  iDesc.add<bool>("addGenPartonMatch", true)->setComment("add MC matching");
476  iDesc.add<bool>("embedGenPartonMatch", false)->setComment("embed MC matched MC information");
477  iDesc.add<edm::InputTag>("genPartonMatch", edm::InputTag())->setComment("input with MC match information");
478 
479  iDesc.add<bool>("addGenJetMatch", true)->setComment("add MC matching");
480  iDesc.add<bool>("embedGenJetMatch", false)->setComment("embed MC matched MC information");
481  iDesc.add<edm::InputTag>("genJetMatch", edm::InputTag())->setComment("input with MC match information");
482 
483  iDesc.add<bool>("addJetCharge", true);
484  iDesc.add<edm::InputTag>("jetChargeSource", edm::InputTag("patJetCharge"));
485 
486  // jet id
487  iDesc.add<bool>("addJetID", true)->setComment("Add jet ID information");
488  iDesc.add<edm::InputTag>("jetIDMap", edm::InputTag())->setComment("jet id map");
489 
490  iDesc.add<bool>("addPartonJetMatch", false);
491  iDesc.add<edm::InputTag>("partonJetSource", edm::InputTag("NOT IMPLEMENTED"));
492 
493  // track association
494  iDesc.add<bool>("addAssociatedTracks", true);
495  iDesc.add<edm::InputTag>("trackAssociationSource", edm::InputTag("ak4JTA"));
496 
497  // tag info
498  iDesc.add<bool>("addTagInfos", true);
499  std::vector<edm::InputTag> emptyVInputTags;
500  iDesc.add<std::vector<edm::InputTag>>("tagInfoSources", emptyVInputTags);
501 
502  // jet energy corrections
503  iDesc.add<bool>("addJetCorrFactors", true);
504  iDesc.add<std::vector<edm::InputTag>>("jetCorrFactorsSource", emptyVInputTags);
505 
506  // btag discriminator tags
507  iDesc.add<bool>("addBTagInfo", true);
508  iDesc.add<bool>("addDiscriminators", true);
509  iDesc.add<std::vector<edm::InputTag>>("discriminatorSources", emptyVInputTags);
510 
511  // jet flavour idetification configurables
512  iDesc.add<bool>("getJetMCFlavour", true);
513  iDesc.add<bool>("useLegacyJetMCFlavour", false);
514  iDesc.add<bool>("addJetFlavourInfo", false);
515  iDesc.add<edm::InputTag>("JetPartonMapSource", edm::InputTag("jetFlavourAssociationLegacy"));
516  iDesc.add<edm::InputTag>("JetFlavourInfoSource", edm::InputTag("jetFlavourAssociation"));
517 
519 
520  // Efficiency configurables
521  edm::ParameterSetDescription efficienciesPSet;
522  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
523  iDesc.add("efficiencies", efficienciesPSet);
524  iDesc.add<bool>("addEfficiencies", false);
525 
526  // Check to see if the user wants to add user data
527  edm::ParameterSetDescription userDataPSet;
529  iDesc.addOptional("userData", userDataPSet);
530 
531  descriptions.add("PATJetProducer", iDesc);
532 }
533 
535 
ConfigurationDescriptions.h
edm::RefProd
Definition: EDProductfwd.h:25
pat::PATJetProducer::discriminatorTags_
std::vector< edm::InputTag > discriminatorTags_
Definition: PATJetProducer.h:75
reco::JPTJet
Jets made from CaloJets corrected for ZSP and tracks.
Definition: JPTJet.h:28
pat::PATJetProducer::printWarning_
bool printWarning_
Definition: PATJetProducer.h:101
pat::PFCandidateFwdPtrCollection
std::vector< edm::FwdPtr< reco::PFCandidate > > PFCandidateFwdPtrCollection
Definition: Jet.h:73
JetTracksAssociation.h
pat::Jet::addBDiscriminatorPair
void addBDiscriminatorPair(const std::pair< std::string, float > &thePair)
method to add a algolabel-discriminator pair
reco::JetID
Jet ID object.
Definition: JetID.h:16
reco::CaloJet
Jets made from CaloTowers.
Definition: CaloJet.h:27
edm::View::begin
const_iterator begin() const
JetTag.h
pat::PATJetProducer::addGenJetMatch_
bool addGenJetMatch_
Definition: PATJetProducer.h:65
pat::PATUserDataHelper
Assists in assimilating all pat::UserData into pat objects.
Definition: PATUserDataHelper.h:49
mps_fire.i
i
Definition: mps_fire.py:428
pat::Jet::initializeJEC
void initializeJEC(unsigned int level, const JetCorrFactors::Flavor &flavor=JetCorrFactors::NONE, unsigned int set=0)
initialize the jet to a given JEC level during creation starting from Uncorrected
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
MessageLogger.h
funct::false
false
Definition: Factorize.h:29
pat::PATJetProducer::addJetFlavourInfo_
bool addJetFlavourInfo_
Definition: PATJetProducer.h:59
pat::PATJetProducer::genPartonToken_
edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > genPartonToken_
Definition: PATJetProducer.h:64
edm::FwdRef< reco::GenJetCollection >
pat::PATJetProducer::jetIDMapToken_
edm::EDGetTokenT< reco::JetIDValueMap > jetIDMapToken_
Definition: PATJetProducer.h:87
reco::PFJet::getPFConstituents
virtual std::vector< reco::PFCandidatePtr > getPFConstituents() const
get all constituents
Definition: PFJet.cc:41
SoftLeptonTagInfo.h
pat::PATJetProducer::PATJetProducer
PATJetProducer(const edm::ParameterSet &iConfig)
Definition: PATJetProducer.cc:40
pat::PATJetProducer::addBTagInfo_
bool addBTagInfo_
Definition: PATJetProducer.h:73
reco::GenJetCollection
std::vector< GenJet > GenJetCollection
collection of GenJet objects
Definition: GenJetCollection.h:14
pat::helper::EfficiencyLoader
Definition: EfficiencyLoader.h:16
edm::Ref::isAvailable
bool isAvailable() const
Definition: Ref.h:537
pat::Jet::setHadronFlavour
void setHadronFlavour(int hadronFl)
method to set the hadron-based flavour of the jet
pat::Jet::setJetID
void setJetID(reco::JetID const &id)
methods for jet ID
Definition: Jet.h:266
pat::PATUserDataHelper::fillDescription
static void fillDescription(edm::ParameterSetDescription &iDesc)
Definition: PATUserDataHelper.h:135
pos
Definition: PixelAliasList.h:18
pat::PATJetProducer::addEfficiencies_
bool addEfficiencies_
Definition: PATJetProducer.h:92
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
pat::PATJetProducer::addResolutions_
bool addResolutions_
Definition: PATJetProducer.h:95
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
pat::Jet::setPFCandidates
void setPFCandidates(const PFCandidateFwdPtrCollection &pfCandidates)
method to store the PFCandidate constituents internally
pat::helper::EfficiencyLoader::enabled
bool enabled() const
'true' if this there is at least one efficiency configured
Definition: EfficiencyLoader.h:25
pat::PATJetProducer::discriminatorTokens_
std::vector< edm::EDGetTokenT< reco::JetFloatAssociation::Container > > discriminatorTokens_
Definition: PATJetProducer.h:76
pat::CaloTowerFwdPtrCollection
std::vector< edm::FwdPtr< CaloTower > > CaloTowerFwdPtrCollection
Definition: Jet.h:74
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
pat::PATJetProducer::embedPFCandidates_
bool embedPFCandidates_
Definition: PATJetProducer.h:56
Association.h
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::Handle
Definition: AssociativeIterator.h:50
edm::ParameterSetDescription::addOptional
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:105
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
pat::PATJetProducer::efficiencyLoader_
pat::helper::EfficiencyLoader efficiencyLoader_
Definition: PATJetProducer.h:93
pat::Jet::setGenParton
void setGenParton(const reco::GenParticleRef &gp, bool embed=false)
method to set the matched parton
Definition: Jet.h:255
pat::helper::KinResolutionsLoader::enabled
bool enabled() const
'true' if this there is at least one efficiency configured
Definition: KinResolutionsLoader.h:27
pat::Jet::setPartonFlavour
void setPartonFlavour(int partonFl)
method to set the parton-based flavour of the jet
CandMatchMap.h
edm::Ref
Definition: AssociativeIterator.h:58
FileInPath.h
pat::PATJetProducer::embedGenPartonMatch_
bool embedGenPartonMatch_
Definition: PATJetProducer.h:63
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
GenParticle.h
pat::PATJetProducer::embedGenJetMatch_
bool embedGenJetMatch_
Definition: PATJetProducer.h:66
pat::JetCorrFactors
Class for the storage of jet correction factors.
Definition: JetCorrFactors.h:37
pat::PATJetProducer::discriminatorLabels_
std::vector< std::string > discriminatorLabels_
Definition: PATJetProducer.h:77
MakerMacros.h
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
pat::PATJetProducer::jetPartonMapToken_
edm::EDGetTokenT< reco::JetFlavourMatchingCollection > jetPartonMapToken_
Definition: PATJetProducer.h:60
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Jet
Definition: Jet.py:1
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
pat::PATJetProducer::addJetCorrFactors_
bool addJetCorrFactors_
Definition: PATJetProducer.h:70
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
pat::PATJetProducer::userDataHelper_
pat::PATUserDataHelper< pat::Jet > userDataHelper_
Definition: PATJetProducer.h:99
pat::PATUserDataHelper::add
void add(ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup)
Definition: PATUserDataHelper.h:114
SecondaryVertexTagInfo.h
pat::helper::EfficiencyLoader::newEvent
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
Definition: EfficiencyLoader.cc:21
reco::JPTJet::getCaloJetRef
const edm::RefToBase< reco::Jet > & getCaloJetRef() const
Definition: JPTJet.h:133
pat::PATJetProducer::~PATJetProducer
~PATJetProducer() override
Definition: PATJetProducer.cc:154
TrackIPTagInfo.h
GenParticleFwd.h
pat::PATJetProducer::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Definition: PATJetProducer.cc:156
pat::Jet::addJECFactors
void addJECFactors(const JetCorrFactors &jec)
add more sets of energy correction factors
Definition: Jet.h:191
pat::helper::KinResolutionsLoader
Definition: KinResolutionsLoader.h:18
pat::PATJetProducer::addDiscriminators_
bool addDiscriminators_
Definition: PATJetProducer.h:74
pat::PATJetProducer::addPartonJetMatch_
bool addPartonJetMatch_
Definition: PATJetProducer.h:68
pat::PATJetProducer::tagInfoTags_
std::vector< edm::InputTag > tagInfoTags_
Definition: PATJetProducer.h:79
pat::Jet::setCaloTowers
void setCaloTowers(const CaloTowerFwdPtrCollection &caloTowers)
method to store the CaloJet constituents internally
dqmdumpme.k
k
Definition: dqmdumpme.py:60
ParameterSetDescription.h
edm::RefToBase::get
value_type const * get() const
Definition: RefToBase.h:209
pat::PATJetProducer
Produces pat::Jet's.
Definition: PATJetProducer.h:43
pat::PATJetProducer::useUserData_
bool useUserData_
Definition: PATJetProducer.h:98
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::vector_transform
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
edm::View::size
size_type size() const
pat::Jet::isJPTJet
bool isJPTJet() const
check to see if the jet is a reco::JPTJet
Definition: Jet.h:273
pat::helper::KinResolutionsLoader::setResolutions
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
Definition: KinResolutionsLoader.h:49
TrackProbabilityTagInfo.h
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
pat::PATJetProducer::tagInfoTokens_
std::vector< edm::EDGetTokenT< edm::View< reco::BaseTagInfo > > > tagInfoTokens_
Definition: PATJetProducer.h:80
edm::View
Definition: CaloClusterFwd.h:14
funct::true
true
Definition: Factorize.h:173
pat::PATJetProducer::addJetID_
bool addJetID_
Definition: PATJetProducer.h:86
edm::ParameterSet
Definition: ParameterSet.h:47
edm::ParameterSetDescription::setComment
void setComment(std::string const &value)
Definition: ParameterSetDescription.cc:33
jetProducer_cfi.genJetMatch
genJetMatch
switch on/off embedding of matched genJet's
Definition: jetProducer_cfi.py:85
CandAssociation.h
pat::PATJetProducer::tagInfoLabels_
std::vector< std::string > tagInfoLabels_
Definition: PATJetProducer.h:81
pat::PATJetProducer::jetFlavourInfoToken_
edm::EDGetTokenT< reco::JetFlavourInfoMatchingCollection > jetFlavourInfoToken_
Definition: PATJetProducer.h:61
deltaR.h
pat::helper::KinResolutionsLoader::fillDescription
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
Definition: KinResolutionsLoader.cc:34
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
pat::PATJetProducer::addGenPartonMatch_
bool addGenPartonMatch_
Definition: PATJetProducer.h:62
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
pat::Jet::setGenJetRef
void setGenJetRef(const edm::FwdRef< reco::GenJetCollection > &gj)
method to set the matched generated jet reference, embedding if requested
iEvent
int iEvent
Definition: GenABIO.cc:224
pat::PATJetProducer::genJetToken_
edm::EDGetTokenT< edm::Association< reco::GenJetCollection > > genJetToken_
Definition: PATJetProducer.h:67
reco::CaloJet::getCaloConstituents
virtual std::vector< CaloTowerPtr > getCaloConstituents() const
get all constituents
Definition: CaloJet.cc:78
value
Definition: value.py:1
pat::PATJetProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: PATJetProducer.cc:462
pat::Jet::isCaloJet
bool isCaloJet() const
check to see if the jet is a reco::CaloJet
Definition: Jet.h:271
edm::EventSetup
Definition: EventSetup.h:58
pat
Definition: HeavyIon.h:7
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
edm::ParameterSetDescription::setAllowAnything
void setAllowAnything()
allow any parameter label/value pairs
Definition: ParameterSetDescription.cc:37
hemisphereProducer_cfi.patJets
patJets
Definition: hemisphereProducer_cfi.py:5
pat::helper::KinResolutionsLoader::newEvent
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
Definition: KinResolutionsLoader.cc:27
pat::PATJetProducer::jetChargeToken_
edm::EDGetTokenT< reco::JetFloatAssociation::Container > jetChargeToken_
Definition: PATJetProducer.h:85
edm::Ptr< reco::Jet >
pat::Jet::isPFJet
bool isPFJet() const
check to see if the jet is a reco::PFJet
Definition: Jet.h:275
PATJetProducer.h
ValueMap.h
pat::PATJetProducer::getJetMCFlavour_
bool getJetMCFlavour_
Definition: PATJetProducer.h:57
eostools.move
def move(src, dest)
Definition: eostools.py:511
pat::PATJetProducer::addTagInfos_
bool addTagInfos_
Definition: PATJetProducer.h:78
pat::helper::EfficiencyLoader::setEfficiencies
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
Definition: EfficiencyLoader.h:41
TrackCountingTagInfo.h
pat::PATJetProducer::pTComparator_
GreaterByPt< Jet > pTComparator_
Definition: PATJetProducer.h:89
metsig::jet
Definition: SignAlgoResolutions.h:47
transform.h
pat::PATJetProducer::jetsToken_
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken_
Definition: PATJetProducer.h:54
reco::PFCandidateCollection
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Definition: PFCandidateFwd.h:12
pat::PATJetProducer::useLegacyJetMCFlavour_
bool useLegacyJetMCFlavour_
Definition: PATJetProducer.h:58
pat::PATJetProducer::addAssociatedTracks_
bool addAssociatedTracks_
Definition: PATJetProducer.h:82
reco::PFJet
Jets made from PFObjects.
Definition: PFJet.h:20
pat::Jet::addTagInfo
void addTagInfo(const std::string &label, const TagInfoFwdPtrCollection::value_type &info)
pat::PATJetProducer::resolutionLoader_
pat::helper::KinResolutionsLoader resolutionLoader_
Definition: PATJetProducer.h:96
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::RefToBase< reco::Jet >
pat::Jet::setJetCharge
void setJetCharge(float jetCharge)
method to set the jet charge
pat::PATJetProducer::addJetCharge_
bool addJetCharge_
Definition: PATJetProducer.h:84
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
pat::PATJetProducer::jetCorrFactorsTokens_
std::vector< edm::EDGetTokenT< edm::ValueMap< JetCorrFactors > > > jetCorrFactorsTokens_
Definition: PATJetProducer.h:71
JetCorrFactors.h
edm::View::end
const_iterator end() const
PhotonMonitor_cff.jetId
jetId
Definition: PhotonMonitor_cff.py:70
pat::Jet::setJetFlavourInfo
void setJetFlavourInfo(const reco::JetFlavourInfo &jetFlavourInfo)
method to set the JetFlavourInfo of the jet
edm::Event
Definition: Event.h:73
pat::PATJetProducer::embedCaloTowers_
bool embedCaloTowers_
Definition: PATJetProducer.h:55
edm::View::ptrAt
Ptr< value_type > ptrAt(size_type i) const
pat::Jet::setAssociatedTracks
void setAssociatedTracks(const reco::TrackRefVector &tracks)
method to set the vector of refs to the tracks associated to this jet
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
pat::PATJetProducer::trackAssociationToken_
edm::EDGetTokenT< reco::JetTracksAssociation::Container > trackAssociationToken_
Definition: PATJetProducer.h:83
jets_cff.levels
levels
Definition: jets_cff.py:21
edm::OwnVector< reco::BaseTagInfo >