CMS 3D CMS Logo

PATTauProducer.cc
Go to the documentation of this file.
1 
47 
48 #include <memory>
49 #include <string>
50 #include <vector>
51 
54 namespace pat {
55 
57  public:
58  explicit PATTauProducer(const edm::ParameterSet& iConfig);
59  ~PATTauProducer() override;
60 
61  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
62 
63  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
64 
65  private:
66  bool firstOccurence_; // used to print LogWarnings only at first occurnece in the event loop
67 
68  // configurables
87 
90  std::vector<edm::EDGetTokenT<edm::Association<reco::GenParticleCollection>>> genMatchTokens_;
91 
95 
97  std::vector<edm::EDGetTokenT<edm::ValueMap<TauJetCorrFactors>>> tauJetCorrFactorsTokens_;
98 
99  bool addTauID_;
100  typedef std::pair<std::string, edm::InputTag> NameTag;
101  typedef std::pair<std::string, std::string> WPCfg;
102  typedef std::pair<WPCfg, int> WPIdx;
103  typedef std::pair<std::string, WPIdx> NameWPIdx;
104  typedef std::pair<edm::InputTag, std::vector<NameWPIdx>>
105  IDContainerData; //to save input module tag and corresponding pairs <working point name for the output tree, WP index in the input ID container>
106  std::vector<NameTag> tauIDSrcs_;
107  std::vector<std::vector<NameWPIdx>> tauIDSrcContainers_;
108  std::vector<edm::EDGetTokenT<reco::PFTauDiscriminator>> pfTauIDTokens_;
109  std::vector<edm::EDGetTokenT<reco::TauDiscriminatorContainer>> pfTauIDContainerTokens_;
112  // tools
114 
116  pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_; // better here than recreate at each event
117  std::vector<std::pair<pat::IsolationKeys, edm::InputTag>> isoDepositLabels_;
118  std::vector<edm::EDGetTokenT<edm::ValueMap<IsoDeposit>>> isoDepositTokens_;
119 
122 
125 
128 
129  template <typename TauCollectionType, typename TauDiscrType>
132  size_t,
134  int);
135 
137  };
138 
139 } // namespace pat
140 
141 using namespace pat;
142 
144  : isolator_(iConfig.getParameter<edm::ParameterSet>("userIsolation"), consumesCollector(), false),
145  useUserData_(iConfig.exists("userData")),
146  posAtECalEntranceComputer_(consumesCollector()) {
147  firstOccurence_ = true;
148  // initialize the configurables
149  baseTauToken_ = consumes<edm::View<reco::BaseTau>>(iConfig.getParameter<edm::InputTag>("tauSource"));
150  tauTransverseImpactParameterSrc_ = iConfig.getParameter<edm::InputTag>("tauTransverseImpactParameterSource");
151  tauTransverseImpactParameterToken_ = consumes<PFTauTIPAssociationByRef>(tauTransverseImpactParameterSrc_);
152  pfTauToken_ = consumes<reco::PFTauCollection>(iConfig.getParameter<edm::InputTag>("tauSource"));
153  embedIsolationTracks_ = iConfig.getParameter<bool>("embedIsolationTracks");
154  embedLeadTrack_ = iConfig.getParameter<bool>("embedLeadTrack");
155  embedSignalTracks_ = iConfig.getParameter<bool>("embedSignalTracks");
156  embedLeadPFCand_ = iConfig.getParameter<bool>("embedLeadPFCand");
157  embedLeadPFChargedHadrCand_ = iConfig.getParameter<bool>("embedLeadPFChargedHadrCand");
158  embedLeadPFNeutralCand_ = iConfig.getParameter<bool>("embedLeadPFNeutralCand");
159  embedSignalPFCands_ = iConfig.getParameter<bool>("embedSignalPFCands");
160  embedSignalPFChargedHadrCands_ = iConfig.getParameter<bool>("embedSignalPFChargedHadrCands");
161  embedSignalPFNeutralHadrCands_ = iConfig.getParameter<bool>("embedSignalPFNeutralHadrCands");
162  embedSignalPFGammaCands_ = iConfig.getParameter<bool>("embedSignalPFGammaCands");
163  embedIsolationPFCands_ = iConfig.getParameter<bool>("embedIsolationPFCands");
164  embedIsolationPFChargedHadrCands_ = iConfig.getParameter<bool>("embedIsolationPFChargedHadrCands");
165  embedIsolationPFNeutralHadrCands_ = iConfig.getParameter<bool>("embedIsolationPFNeutralHadrCands");
166  embedIsolationPFGammaCands_ = iConfig.getParameter<bool>("embedIsolationPFGammaCands");
167  addGenMatch_ = iConfig.getParameter<bool>("addGenMatch");
168  if (addGenMatch_) {
169  embedGenMatch_ = iConfig.getParameter<bool>("embedGenMatch");
171  iConfig.getParameter<edm::InputTag>("genParticleMatch")));
172  }
173  addGenJetMatch_ = iConfig.getParameter<bool>("addGenJetMatch");
174  if (addGenJetMatch_) {
175  embedGenJetMatch_ = iConfig.getParameter<bool>("embedGenJetMatch");
177  consumes<edm::Association<reco::GenJetCollection>>(iConfig.getParameter<edm::InputTag>("genJetMatch"));
178  }
179  addTauJetCorrFactors_ = iConfig.getParameter<bool>("addTauJetCorrFactors");
181  iConfig.getParameter<std::vector<edm::InputTag>>("tauJetCorrFactorsSource"),
182  [this](edm::InputTag const& tag) { return mayConsume<edm::ValueMap<TauJetCorrFactors>>(tag); });
183  // tau ID configurables
184  addTauID_ = iConfig.getParameter<bool>("addTauID");
185  if (addTauID_) {
186  // read the different tau ID names
187  edm::ParameterSet idps = iConfig.getParameter<edm::ParameterSet>("tauIDSources");
188  std::vector<std::string> names = idps.getParameterNamesForType<edm::ParameterSet>();
189  std::map<std::string, IDContainerData> idContainerMap;
190  for (auto const& name : names) {
191  auto const& idp = idps.getParameter<edm::ParameterSet>(name);
192  std::string prov_cfg_label = idp.getParameter<std::string>("provenanceConfigLabel");
193  std::string prov_ID_label = idp.getParameter<std::string>("idLabel");
194  edm::InputTag tag = idp.getParameter<edm::InputTag>("inputTag");
195  if (prov_cfg_label.empty()) {
196  tauIDSrcs_.push_back(NameTag(name, tag));
197  } else {
198  if (prov_cfg_label != "rawValues" && prov_cfg_label != "workingPoints" && prov_cfg_label != "IDdefinitions" &&
199  prov_cfg_label != "IDWPdefinitions" && prov_cfg_label != "direct_rawValues" &&
200  prov_cfg_label != "direct_workingPoints")
201  throw cms::Exception("Configuration")
202  << "PATTauProducer: Parameter 'provenanceConfigLabel' does only accept 'rawValues', 'workingPoints', "
203  "'IDdefinitions', 'IDWPdefinitions', 'direct_rawValues', 'direct_workingPoints'\n";
204  std::map<std::string, IDContainerData>::iterator it;
205  it = idContainerMap.insert({tag.label() + tag.instance(), {tag, std::vector<NameWPIdx>()}}).first;
206  it->second.second.push_back(NameWPIdx(name, WPIdx(WPCfg(prov_cfg_label, prov_ID_label), -99)));
207  }
208  }
209  // but in any case at least once
210  if (tauIDSrcs_.empty() && idContainerMap.empty())
211  throw cms::Exception("Configuration") << "PATTauProducer: id addTauID is true, you must specify either:\n"
212  << "\tPSet tauIDSources = { \n"
213  << "\t\tInputTag <someName> = <someTag> // as many as you want \n "
214  << "\t}\n";
215 
216  for (auto const& mapEntry : idContainerMap) {
217  tauIDSrcContainers_.push_back(mapEntry.second.second);
218  pfTauIDContainerTokens_.push_back(mayConsume<reco::TauDiscriminatorContainer>(mapEntry.second.first));
219  }
220  }
222  tauIDSrcs_, [this](NameTag const& tag) { return mayConsume<reco::PFTauDiscriminator>(tag.second); });
223  skipMissingTauID_ = iConfig.getParameter<bool>("skipMissingTauID");
224  // IsoDeposit configurables
225  if (iConfig.exists("isoDeposits")) {
226  edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>("isoDeposits");
227  if (depconf.exists("tracker"))
228  isoDepositLabels_.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
229  if (depconf.exists("ecal"))
230  isoDepositLabels_.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
231  if (depconf.exists("hcal"))
232  isoDepositLabels_.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
233  if (depconf.exists("pfAllParticles"))
234  isoDepositLabels_.push_back(
235  std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
236  if (depconf.exists("pfChargedHadron"))
237  isoDepositLabels_.push_back(
238  std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadron")));
239  if (depconf.exists("pfNeutralHadron"))
240  isoDepositLabels_.push_back(
241  std::make_pair(pat::PfNeutralHadronIso, depconf.getParameter<edm::InputTag>("pfNeutralHadron")));
242  if (depconf.exists("pfGamma"))
243  isoDepositLabels_.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfGamma")));
244 
245  if (depconf.exists("user")) {
246  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag>>("user");
247  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
248  int key = UserBaseIso;
249  for (; it != ed; ++it, ++key) {
250  isoDepositLabels_.push_back(std::make_pair(IsolationKeys(key), *it));
251  }
252  }
253  }
255  edm::vector_transform(isoDepositLabels_, [this](std::pair<IsolationKeys, edm::InputTag> const& label) {
256  return consumes<edm::ValueMap<IsoDeposit>>(label.second);
257  });
258  // Efficiency configurables
259  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
260  if (addEfficiencies_) {
262  pat::helper::EfficiencyLoader(iConfig.getParameter<edm::ParameterSet>("efficiencies"), consumesCollector());
263  }
264  // Resolution configurables
265  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
266  if (addResolutions_) {
268  pat::helper::KinResolutionsLoader(iConfig.getParameter<edm::ParameterSet>("resolutions"), consumesCollector());
269  }
270  // Check to see if the user wants to add user data
271  if (useUserData_) {
272  userDataHelper_ = PATUserDataHelper<Tau>(iConfig.getParameter<edm::ParameterSet>("userData"), consumesCollector());
273  }
274  // produces vector of taus
275  produces<std::vector<Tau>>();
276 }
277 
279 
281  // switch off embedding (in unschedules mode)
282  if (iEvent.isRealData()) {
283  addGenMatch_ = false;
284  embedGenMatch_ = false;
285  addGenJetMatch_ = false;
286  }
287 
288  // Get the collection of taus from the event
290  try {
291  iEvent.getByToken(baseTauToken_, anyTaus);
292  } catch (const edm::Exception& e) {
293  edm::LogWarning("DataSource") << "WARNING! No Tau collection found. This missing input will not block the job. "
294  "Instead, an empty tau collection is being be produced.";
295  auto patTaus = std::make_unique<std::vector<Tau>>();
296  iEvent.put(std::move(patTaus));
297  return;
298  }
299 
301 
302  if (isolator_.enabled())
303  isolator_.beginEvent(iEvent, iSetup);
304 
309 
310  std::vector<edm::Handle<edm::ValueMap<IsoDeposit>>> deposits(isoDepositTokens_.size());
311  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
312  iEvent.getByToken(isoDepositTokens_[j], deposits[j]);
313  }
314 
315  // prepare the MC matching
316  std::vector<edm::Handle<edm::Association<reco::GenParticleCollection>>> genMatches(genMatchTokens_.size());
317  if (addGenMatch_) {
318  for (size_t j = 0, nd = genMatchTokens_.size(); j < nd; ++j) {
319  iEvent.getByToken(genMatchTokens_[j], genMatches[j]);
320  }
321  }
322 
324  if (addGenJetMatch_)
325  iEvent.getByToken(genJetMatchToken_, genJetMatch);
326 
327  // read in the jet correction factors ValueMap
328  std::vector<edm::ValueMap<TauJetCorrFactors>> tauJetCorrs;
329  if (addTauJetCorrFactors_) {
330  for (size_t i = 0; i < tauJetCorrFactorsTokens_.size(); ++i) {
332  iEvent.getByToken(tauJetCorrFactorsTokens_[i], tauJetCorr);
333  tauJetCorrs.push_back(*tauJetCorr);
334  }
335  }
336 
337  auto patTaus = std::make_unique<std::vector<Tau>>();
338 
339  bool first = true; // this is introduced to issue warnings only for the first tau-jet
340  for (size_t idx = 0, ntaus = anyTaus->size(); idx < ntaus; ++idx) {
341  edm::RefToBase<reco::BaseTau> tausRef = anyTaus->refAt(idx);
342  edm::Ptr<reco::BaseTau> tausPtr = anyTaus->ptrAt(idx);
343 
344  Tau aTau(tausRef);
345  if (embedLeadTrack_)
346  aTau.embedLeadTrack();
347  if (embedSignalTracks_)
348  aTau.embedSignalTracks();
350  aTau.embedIsolationTracks();
351  if (embedLeadPFCand_) {
352  if (aTau.isPFTau())
353  aTau.embedLeadPFCand();
354  else
355  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
356  "from a reco::PFTau is impossible.\n";
357  }
359  if (aTau.isPFTau())
361  else
362  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
363  "from a reco::PFTau is impossible.\n";
364  }
366  if (aTau.isPFTau())
367  aTau.embedLeadPFNeutralCand();
368  else
369  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
370  "from a reco::PFTau is impossible.\n";
371  }
372  if (embedSignalPFCands_) {
373  if (aTau.isPFTau())
374  aTau.embedSignalPFCands();
375  else
376  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
377  "from a reco::PFTau is impossible.\n";
378  }
380  if (aTau.isPFTau())
382  else
383  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
384  "from a reco::PFTau is impossible.\n";
385  }
387  if (aTau.isPFTau())
389  else
390  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
391  "from a reco::PFTau is impossible.\n";
392  }
394  if (aTau.isPFTau())
396  else
397  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
398  "from a reco::PFTau is impossible.\n";
399  }
401  if (aTau.isPFTau())
402  aTau.embedIsolationPFCands();
403  else
404  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
405  "from a reco::PFTau is impossible.\n";
406  }
408  if (aTau.isPFTau())
410  else
411  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
412  "from a reco::PFTau is impossible.\n";
413  }
415  if (aTau.isPFTau())
417  else
418  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
419  "from a reco::PFTau is impossible.\n";
420  }
422  if (aTau.isPFTau())
424  else
425  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
426  "from a reco::PFTau is impossible.\n";
427  }
428 
429  if (addTauJetCorrFactors_) {
430  // add additional JetCorrs to the jet
431  for (unsigned int i = 0; i < tauJetCorrs.size(); ++i) {
432  const TauJetCorrFactors& tauJetCorr = tauJetCorrs[i][tausRef];
433  // uncomment for debugging
434  // tauJetCorr.print();
435  aTau.addJECFactors(tauJetCorr);
436  }
437  std::vector<std::string> levels = tauJetCorrs[0][tausRef].correctionLabels();
438  if (std::find(levels.begin(), levels.end(), "L2L3Residual") != levels.end()) {
439  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("L2L3Residual"));
440  } else if (std::find(levels.begin(), levels.end(), "L3Absolute") != levels.end()) {
441  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("L3Absolute"));
442  } else {
443  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("Uncorrected"));
444  if (first) {
445  edm::LogWarning("L3Absolute not found")
446  << "L2L3Residual and L3Absolute are not part of the correction applied jetCorrFactors \n"
447  << "of module " << tauJetCorrs[0][tausRef].jecSet() << " jets will remain"
448  << " uncorrected.";
449  first = false;
450  }
451  }
452  }
453 
454  // store the match to the generated final state muons
455  if (addGenMatch_) {
456  for (size_t i = 0, n = genMatches.size(); i < n; ++i) {
457  reco::GenParticleRef genTau = (*genMatches[i])[tausRef];
458  aTau.addGenParticleRef(genTau);
459  }
460  if (embedGenMatch_)
461  aTau.embedGenParticle();
462  }
463 
464  // store the match to the visible part of the generated tau
465  if (addGenJetMatch_) {
466  reco::GenJetRef genJetTau = (*genJetMatch)[tausRef];
467  if (genJetTau.isNonnull() && genJetTau.isAvailable()) {
468  aTau.setGenJet(genJetTau);
469  } // leave empty if no match found
470  }
471 
472  // prepare ID extraction
473  if (addTauID_) {
474  size_t numberPlainTauIds = tauIDSrcs_.size();
475  size_t numberTauIds = numberPlainTauIds;
476  for (auto const& it : tauIDSrcContainers_) {
477  numberTauIds += it.size();
478  }
479  // if ID containers exist, product incices need to be retrieved from provenanceConfigLabel.
480  // This is done if config history changes, in particular for the first event.
481  if (numberPlainTauIds != numberTauIds && phID_ != iEvent.processHistoryID()) {
482  phID_ = iEvent.processHistoryID();
483  for (size_t idx = 0; idx < tauIDSrcContainers_.size(); ++idx) {
484  auto pfTauIdDiscr = iEvent.getHandle(pfTauIDContainerTokens_[idx]);
485  if (!pfTauIdDiscr.isValid())
486  continue; // missing IDs will be skipped lateron or crash there depending on skipMissingTauID_
487  const edm::Provenance* prov = pfTauIdDiscr.provenance();
488  for (NameWPIdx& idcfg : tauIDSrcContainers_[idx]) {
489  std::string prov_cfg_label = idcfg.second.first.first;
490  std::string prov_ID_label = idcfg.second.first.second;
491  bool found = false;
492  if (prov_cfg_label == "rawValues" || prov_cfg_label == "workingPoints") {
493  const std::vector<std::string> psetsFromProvenance =
494  edm::parameterSet(prov->stable(), iEvent.processHistory())
495  .getParameter<std::vector<std::string>>(prov_cfg_label);
496  for (size_t i = 0; i < psetsFromProvenance.size(); ++i) {
497  if (psetsFromProvenance[i] == prov_ID_label) {
498  // using negative indices for raw values
499  if (prov_cfg_label == "rawValues")
500  idcfg.second.second = -1 - i;
501  else
502  idcfg.second.second = i;
503  found = true;
504  }
505  }
506  } else if (prov_cfg_label == "IDdefinitions" || prov_cfg_label == "IDWPdefinitions") {
507  const std::vector<edm::ParameterSet> psetsFromProvenance =
508  edm::parameterSet(prov->stable(), iEvent.processHistory())
509  .getParameter<std::vector<edm::ParameterSet>>(prov_cfg_label);
510  for (size_t i = 0; i < psetsFromProvenance.size(); ++i) {
511  if (psetsFromProvenance[i].getParameter<std::string>("IDname") == prov_ID_label) {
512  // using negative indices for raw values
513  if (prov_cfg_label == "IDdefinitions")
514  idcfg.second.second = -1 - i;
515  else
516  idcfg.second.second = i;
517  found = true;
518  }
519  }
520  } else {
521  // checked prov_cfg_label before, so it must be a direct access via indices
522  try {
523  int i = std::stoi(prov_ID_label);
524  if (prov_cfg_label == "direct_rawValues")
525  idcfg.second.second = -1 - i;
526  else
527  idcfg.second.second = i;
528  found = true;
529  } catch (std::invalid_argument const& e) {
530  throw cms::Exception("Configuration") << "PATTauProducer: Direct access to ID container requested, so "
531  "argument of 'idLabel' must be convertable to int!\n";
532  }
533  }
534  if (!found) {
535  throw cms::Exception("Configuration") << "PATTauProducer: Requested working point '" << prov_ID_label
536  << "' for ID '" << idcfg.first << "' not found!\n";
537  }
538  }
539  }
540  }
541  std::string missingDiscriminators;
542  std::vector<pat::Tau::IdPair> ids(numberTauIds);
543  auto const& tausDeref = *tausRef;
544  if (typeid(tausDeref) == typeid(reco::PFTau)) {
545  edm::Handle<reco::PFTauCollection> pfTauCollection;
546  iEvent.getByToken(pfTauToken_, pfTauCollection);
547  for (size_t i = 0; i < numberPlainTauIds; ++i) {
548  //std::cout << "filling PFTauDiscriminator '" << tauIDSrcs_[i].first << "' into pat::Tau object..." << std::endl;
549 
550  auto pfTauIdDiscr = iEvent.getHandle(pfTauIDTokens_[i]);
551 
552  if (skipMissingTauID_ && !pfTauIdDiscr.isValid()) {
553  if (!missingDiscriminators.empty()) {
554  missingDiscriminators += ", ";
555  }
556  missingDiscriminators += tauIDSrcs_[i].first;
557  continue;
558  }
559  ids[i].first = tauIDSrcs_[i].first;
560  ids[i].second = getTauIdDiscriminator(pfTauCollection, idx, pfTauIdDiscr);
561  }
562  for (size_t i = 0; i < tauIDSrcContainers_.size(); ++i) {
563  auto pfTauIdDiscr = iEvent.getHandle(pfTauIDContainerTokens_[i]);
564  if (skipMissingTauID_ && !pfTauIdDiscr.isValid()) {
565  for (auto const& it : tauIDSrcContainers_[i]) {
566  if (!missingDiscriminators.empty()) {
567  missingDiscriminators += ", ";
568  }
569  missingDiscriminators += it.first;
570  }
571  continue;
572  }
573  for (size_t j = 0; j < tauIDSrcContainers_[i].size(); ++j) {
574  ids[numberPlainTauIds + j].first = tauIDSrcContainers_[i][j].first;
575  ids[numberPlainTauIds + j].second = getTauIdDiscriminatorFromContainer(
576  pfTauCollection, idx, pfTauIdDiscr, tauIDSrcContainers_[i][j].second.second);
577  }
578  numberPlainTauIds += tauIDSrcContainers_[i].size();
579  }
580  } else {
581  throw cms::Exception("Type Mismatch")
582  << "PATTauProducer: unsupported datatype '" << typeid(tausDeref).name() << "' for tauSource\n";
583  }
584  if (!missingDiscriminators.empty() && firstOccurence_) {
585  edm::LogWarning("DataSource") << "The following tau discriminators have not been found in the event:\n"
586  << missingDiscriminators << "\n"
587  << "They will not be embedded into the pat::Tau object.\n"
588  << "Note: this message will be printed only at first occurence.";
589  firstOccurence_ = false;
590  }
591  aTau.setTauIDs(ids);
592  }
593 
594  // extraction of reconstructed tau decay mode
595  // (only available for PFTaus)
596  if (aTau.isPFTau()) {
598  iEvent.getByToken(pfTauToken_, pfTaus);
599  reco::PFTauRef pfTauRef(pfTaus, idx);
600 
601  aTau.setDecayMode(pfTauRef->decayMode());
602  }
603 
604  // extraction of variables needed to rerun MVA isolation and anti-electron discriminator on MiniAOD
605  if (!aTau.pfEssential_.empty()) {
607  iEvent.getByToken(pfTauToken_, pfTaus);
608  reco::PFTauRef pfTauRef(pfTaus, idx);
609  pat::tau::TauPFEssential& aTauPFEssential = aTau.pfEssential_[0];
610  float ecalEnergy = 0;
611  float hcalEnergy = 0;
612  float sumPhiTimesEnergy = 0.;
613  float sumEtaTimesEnergy = 0.;
614  float sumEnergy = 0.;
615  float leadChargedCandPt = -99;
616  float leadChargedCandEtaAtEcalEntrance = -99;
617  const std::vector<reco::CandidatePtr>& signalCands = pfTauRef->signalCands();
618  for (const auto& it : signalCands) {
619  const reco::PFCandidate* ipfcand = dynamic_cast<const reco::PFCandidate*>(it.get());
620  if (ipfcand != nullptr) {
621  ecalEnergy += ipfcand->ecalEnergy();
622  hcalEnergy += ipfcand->hcalEnergy();
623  sumPhiTimesEnergy += ipfcand->positionAtECALEntrance().phi() * ipfcand->energy();
624  sumEtaTimesEnergy += ipfcand->positionAtECALEntrance().eta() * ipfcand->energy();
625  sumEnergy += ipfcand->energy();
626  const reco::Track* track = nullptr;
627  if (ipfcand->trackRef().isNonnull())
628  track = ipfcand->trackRef().get();
629  else if (ipfcand->muonRef().isNonnull() && ipfcand->muonRef()->innerTrack().isNonnull())
630  track = ipfcand->muonRef()->innerTrack().get();
631  else if (ipfcand->muonRef().isNonnull() && ipfcand->muonRef()->globalTrack().isNonnull())
632  track = ipfcand->muonRef()->globalTrack().get();
633  else if (ipfcand->muonRef().isNonnull() && ipfcand->muonRef()->outerTrack().isNonnull())
634  track = ipfcand->muonRef()->outerTrack().get();
635  else if (ipfcand->gsfTrackRef().isNonnull())
636  track = ipfcand->gsfTrackRef().get();
637  if (track) {
638  if (track->pt() > leadChargedCandPt) {
639  leadChargedCandEtaAtEcalEntrance = ipfcand->positionAtECALEntrance().eta();
640  leadChargedCandPt = track->pt();
641  }
642  }
643  } else {
644  // TauReco@MiniAOD: individual ECAL and HCAL energies recovered from fractions,
645  // and position at ECAL entrance computed on-the-fly
646  const pat::PackedCandidate* ipatcand = dynamic_cast<const pat::PackedCandidate*>(it.get());
647  if (ipatcand != nullptr) {
648  ecalEnergy += ipatcand->caloFraction() * ipatcand->energy() * (1. - ipatcand->hcalFraction());
649  hcalEnergy += ipatcand->caloFraction() * ipatcand->energy() * ipatcand->hcalFraction();
650  double posAtECal_phi = ipatcand->phi();
651  double posAtECal_eta = ipatcand->eta();
652  bool success = false;
653  reco::Candidate::Point posAtECalEntrance = posAtECalEntranceComputer_(ipatcand, success);
654  if (success) {
655  posAtECal_phi = posAtECalEntrance.phi();
656  posAtECal_eta = posAtECalEntrance.eta();
657  }
658  sumPhiTimesEnergy += posAtECal_phi * ipatcand->energy();
659  sumEtaTimesEnergy += posAtECal_eta * ipatcand->energy();
660  sumEnergy += ipatcand->energy();
661  const reco::Track* track = ipatcand->bestTrack();
662  if (track != nullptr) {
663  if (track->pt() > leadChargedCandPt) {
664  leadChargedCandEtaAtEcalEntrance = posAtECal_eta;
665  leadChargedCandPt = track->pt();
666  }
667  }
668  }
669  }
670  }
671  aTauPFEssential.ecalEnergy_ = ecalEnergy;
672  aTauPFEssential.hcalEnergy_ = hcalEnergy;
673  aTauPFEssential.ptLeadChargedCand_ = leadChargedCandPt;
674  aTauPFEssential.etaAtEcalEntranceLeadChargedCand_ = leadChargedCandEtaAtEcalEntrance;
675  if (sumEnergy != 0.) {
676  aTauPFEssential.phiAtEcalEntrance_ = sumPhiTimesEnergy / sumEnergy;
677  aTauPFEssential.etaAtEcalEntrance_ = sumEtaTimesEnergy / sumEnergy;
678  } else {
679  aTauPFEssential.phiAtEcalEntrance_ = -99.;
680  aTauPFEssential.etaAtEcalEntrance_ = -99.;
681  }
682  float leadingTrackNormChi2 = 0;
683  float ecalEnergyLeadChargedHadrCand = -99.;
684  float hcalEnergyLeadChargedHadrCand = -99.;
685  float emFraction = -1.;
686  float myHCALenergy = 0.;
687  float myECALenergy = 0.;
688  const reco::CandidatePtr& leadingPFCharged = pfTauRef->leadChargedHadrCand();
689  if (leadingPFCharged.isNonnull()) {
690  const reco::PFCandidate* pfCandPtr = dynamic_cast<const reco::PFCandidate*>(leadingPFCharged.get());
691  if (pfCandPtr != nullptr) { // PFTau made from PFCandidates
692  ecalEnergyLeadChargedHadrCand = pfCandPtr->ecalEnergy();
693  hcalEnergyLeadChargedHadrCand = pfCandPtr->hcalEnergy();
694  reco::TrackRef trackRef = pfCandPtr->trackRef();
695  if (trackRef.isNonnull()) {
696  leadingTrackNormChi2 = trackRef->normalizedChi2();
697  for (const auto& isoPFCand : pfTauRef->isolationPFCands()) {
698  myHCALenergy += isoPFCand->hcalEnergy();
699  myECALenergy += isoPFCand->ecalEnergy();
700  }
701  for (const auto& signalPFCand : pfTauRef->signalPFCands()) {
702  myHCALenergy += signalPFCand->hcalEnergy();
703  myECALenergy += signalPFCand->ecalEnergy();
704  }
705  if (myHCALenergy + myECALenergy != 0.) {
706  emFraction = myECALenergy / (myHCALenergy + myECALenergy);
707  }
708  }
709  } else {
710  const pat::PackedCandidate* packedCandPtr = dynamic_cast<const pat::PackedCandidate*>(leadingPFCharged.get());
711  if (packedCandPtr != nullptr) {
712  // TauReco@MiniAOD: individual ECAL and HCAL energies recovered from fractions,
713  // and position at ECAL entrance computed on-the-fly
714  ecalEnergyLeadChargedHadrCand =
715  packedCandPtr->caloFraction() * packedCandPtr->energy() * (1. - packedCandPtr->hcalFraction());
716  hcalEnergyLeadChargedHadrCand =
717  packedCandPtr->caloFraction() * packedCandPtr->energy() * packedCandPtr->hcalFraction();
718  const reco::Track* track = packedCandPtr->bestTrack();
719  if (track != nullptr) {
720  leadingTrackNormChi2 = track->normalizedChi2();
721  for (const auto& isoCand : pfTauRef->isolationCands()) {
722  //can safely use static_cast as it is ensured that this PFTau is
723  //built with packedCands as its leadingCanidate
724  const pat::PackedCandidate* isoPackedCand = static_cast<const pat::PackedCandidate*>(isoCand.get());
725  myHCALenergy += isoPackedCand->caloFraction() * isoPackedCand->energy() * isoPackedCand->hcalFraction();
726  myECALenergy +=
727  isoPackedCand->caloFraction() * isoPackedCand->energy() * (1. - isoPackedCand->hcalFraction());
728  }
729  for (const auto& signalCand : pfTauRef->signalCands()) {
730  //can safely use static_cast as it is ensured that this PFTau is
731  //built with packedCands as its leadingCanidate
732  const pat::PackedCandidate* sigPackedCand = static_cast<const pat::PackedCandidate*>(signalCand.get());
733  myHCALenergy += sigPackedCand->caloFraction() * sigPackedCand->energy() * sigPackedCand->hcalFraction();
734  myECALenergy +=
735  sigPackedCand->caloFraction() * sigPackedCand->energy() * (1. - sigPackedCand->hcalFraction());
736  }
737  if (myHCALenergy + myECALenergy != 0.) {
738  emFraction = myECALenergy / (myHCALenergy + myECALenergy);
739  }
740  }
741  }
742  }
743  }
744 
745  aTauPFEssential.emFraction_ = emFraction;
746  aTauPFEssential.leadingTrackNormChi2_ = leadingTrackNormChi2;
747  aTauPFEssential.ecalEnergyLeadChargedHadrCand_ = ecalEnergyLeadChargedHadrCand;
748  aTauPFEssential.hcalEnergyLeadChargedHadrCand_ = hcalEnergyLeadChargedHadrCand;
749  // extraction of tau lifetime information
750  if (!tauTransverseImpactParameterSrc_.label().empty()) {
751  edm::Handle<PFTauTIPAssociationByRef> tauLifetimeInfos;
752  iEvent.getByToken(tauTransverseImpactParameterToken_, tauLifetimeInfos);
753  const reco::PFTauTransverseImpactParameter& tauLifetimeInfo = *(*tauLifetimeInfos)[pfTauRef];
754  pat::tau::TauPFEssential& aTauPFEssential = aTau.pfEssential_[0];
755  aTauPFEssential.dxy_PCA_ = tauLifetimeInfo.dxy_PCA();
756  aTauPFEssential.dxy_ = tauLifetimeInfo.dxy();
757  aTauPFEssential.dxy_error_ = tauLifetimeInfo.dxy_error();
758  aTauPFEssential.hasSV_ = tauLifetimeInfo.hasSecondaryVertex();
759  aTauPFEssential.flightLength_ = tauLifetimeInfo.flightLength();
760  aTauPFEssential.flightLengthSig_ = tauLifetimeInfo.flightLengthSig();
761  aTauPFEssential.ip3d_ = tauLifetimeInfo.ip3d();
762  aTauPFEssential.ip3d_error_ = tauLifetimeInfo.ip3d_error();
763  }
764  }
765 
766  // Isolation
767  if (isolator_.enabled()) {
769  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
770  // better to loop backwards, so the vector is resized less times
771  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(),
772  ed = isolatorTmpStorage_.rend();
773  it != ed;
774  ++it) {
775  aTau.setIsolation(it->first, it->second);
776  }
777  }
778 
779  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
780  aTau.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[tausRef]);
781  }
782 
783  if (efficiencyLoader_.enabled()) {
784  efficiencyLoader_.setEfficiencies(aTau, tausRef);
785  }
786 
787  if (resolutionLoader_.enabled()) {
789  }
790 
791  if (useUserData_) {
792  userDataHelper_.add(aTau, iEvent, iSetup);
793  }
794 
795  patTaus->push_back(aTau);
796  }
797 
798  // sort taus in pT
799  std::sort(patTaus->begin(), patTaus->end(), pTTauComparator_);
800 
801  // put genEvt object in Event
802  iEvent.put(std::move(patTaus));
803 
804  // clean up
805  if (isolator_.enabled())
807 }
808 
809 template <typename TauCollectionType, typename TauDiscrType>
811  size_t tauIdx,
812  const edm::Handle<TauDiscrType>& tauIdDiscr) {
814  return (*tauIdDiscr)[tauRef];
815 }
817  size_t tauIdx,
819  int wpIdx) {
821  if (wpIdx < 0) {
822  //Only 0th component filled with default value if prediscriminor in RecoTauDiscriminator failed.
823  if ((*tauIdDiscr)[tauRef].rawValues.size() == 1)
824  return (*tauIdDiscr)[tauRef].rawValues.at(0);
825  //uses negative indices to access rawValues. In most cases only one rawValue at wpIdx=-1 exists.
826  return (*tauIdDiscr)[tauRef].rawValues.at(-1 - wpIdx);
827  } else {
828  //WP vector not filled if prediscriminor in RecoTauDiscriminator failed. Set PAT output to false in this case
829  if ((*tauIdDiscr)[tauRef].workingPoints.empty())
830  return 0.0;
831  return (*tauIdDiscr)[tauRef].workingPoints.at(wpIdx);
832  }
833 }
834 
835 // ParameterSet description for module
838  iDesc.setComment("PAT tau producer module");
839 
840  // input source
841  iDesc.add<edm::InputTag>("tauSource", edm::InputTag())->setComment("input collection");
842 
843  // embedding
844  iDesc.add<bool>("embedIsolationTracks", false)->setComment("embed external isolation tracks");
845  iDesc.add<bool>("embedLeadTrack", false)->setComment("embed external leading track");
846  iDesc.add<bool>("embedLeadTracks", false)->setComment("embed external signal tracks");
847 
848  // MC matching configurables
849  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
850  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
851  std::vector<edm::InputTag> emptySourceVector;
852  iDesc
853  .addNode(edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
854  edm::ParameterDescription<std::vector<edm::InputTag>>("genParticleMatch", emptySourceVector, true))
855  ->setComment("input with MC match information");
856 
857  // MC jet matching variables
858  iDesc.add<bool>("addGenJetMatch", true)->setComment("add MC jet matching");
859  iDesc.add<bool>("embedGenJetMatch", false)->setComment("embed MC jet matched jet information");
860  iDesc.add<edm::InputTag>("genJetMatch", edm::InputTag("tauGenJetMatch"));
861 
863 
864  // tau ID configurables
865  iDesc.add<bool>("addTauID", true)->setComment("add tau ID variables");
866  edm::ParameterSetDescription tauIDSourcesPSet;
867  tauIDSourcesPSet.setAllowAnything();
868  iDesc
870  edm::ParameterDescription<edm::ParameterSetDescription>("tauIDSources", tauIDSourcesPSet, true))
871  ->setComment("input with tau ID variables");
872  // (Dis)allow to skip missing tauId sources
873  iDesc.add<bool>("skipMissingTauID", false)
874  ->setComment("allow to skip a tau ID variable when not present in the event");
875 
876  // IsoDeposit configurables
877  edm::ParameterSetDescription isoDepositsPSet;
878  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
879  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
880  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
881  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
882  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadron");
883  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadron");
884  isoDepositsPSet.addOptional<edm::InputTag>("pfGamma");
885  isoDepositsPSet.addOptional<std::vector<edm::InputTag>>("user");
886  iDesc.addOptional("isoDeposits", isoDepositsPSet);
887 
888  // Efficiency configurables
889  edm::ParameterSetDescription efficienciesPSet;
890  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
891  iDesc.add("efficiencies", efficienciesPSet);
892  iDesc.add<bool>("addEfficiencies", false);
893 
894  // Check to see if the user wants to add user data
895  edm::ParameterSetDescription userDataPSet;
897  iDesc.addOptional("userData", userDataPSet);
898 
899  edm::ParameterSetDescription isolationPSet;
900  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
901  iDesc.add("userIsolation", isolationPSet);
902 }
903 
905 
~PATTauProducer() override
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
void setComment(std::string const &value)
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:469
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::pair< std::string, edm::InputTag > NameTag
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:115
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
std::pair< edm::InputTag, std::vector< NameWPIdx > > IDContainerData
bool enabled() const
True if it has a non null configuration.
Definition: MultiIsolator.h:55
void embedIsolationPFCands()
method to store the isolation candidates internally
void beginEvent(const edm::EventSetup &)
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
void embedIsolationPFGammaCands()
method to store the isolation gamma candidates internally
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
void setAllowAnything()
allow any parameter label/value pairs
bool exists(std::string const &parameterName) const
checks if a parameter exists
pat::helper::EfficiencyLoader efficiencyLoader_
void embedLeadTrack()
method to store the leading track internally
void embedSignalPFChargedHadrCands()
method to store the signal charged hadrons candidates internally
pat::helper::KinResolutionsLoader resolutionLoader_
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
const math::XYZPointF & positionAtECALEntrance() const
Definition: PFCandidate.h:388
float getTauIdDiscriminator(const edm::Handle< TauCollectionType > &, size_t, const edm::Handle< TauDiscrType > &)
void setDecayMode(int)
set decay mode
void setTauIDs(const std::vector< IdPair > &ids)
Definition: Tau.h:352
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
std::string const & label() const
Definition: InputTag.h:36
float caloFraction() const
Set the fraction of ECAL+HCAL energy over candidate energy.
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
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
const std::string names[nVars_]
std::vector< edm::EDGetTokenT< reco::TauDiscriminatorContainer > > pfTauIDContainerTokens_
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
Definition: MultiIsolator.h:84
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
Definition: Lepton.h:191
bool embedIsolationPFChargedHadrCands_
Definition: HeavyIon.h:7
static void fillDescription(edm::ParameterSetDescription &iDesc)
U second(std::pair< T, U > const &p)
char const * label
void setComment(std::string const &value)
void embedSignalPFCands()
method to store the signal candidates internally
int iEvent
Definition: GenABIO.cc:224
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
edm::EDGetTokenT< PFTauTIPAssociationByRef > tauTransverseImpactParameterToken_
double eta() const override
momentum pseudorapidity
pat::helper::MultiIsolator isolator_
edm::AssociationVector< reco::PFTauRefProd, std::vector< reco::PFTauTransverseImpactParameterRef > > PFTauTIPAssociationByRef
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:233
void embedGenParticle()
Definition: PATObject.h:768
edm::EDGetTokenT< edm::View< reco::BaseTau > > baseTauToken_
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
bool embedIsolationPFNeutralHadrCands_
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool isAvailable() const
Definition: Ref.h:541
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:180
float getTauIdDiscriminatorFromContainer(const edm::Handle< reco::PFTauCollection > &, size_t, const edm::Handle< reco::TauDiscriminatorContainer > &, int)
pat::PATUserDataHelper< pat::Tau > userDataHelper_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
genJetMatch
switch on/off embedding of matched genJet&#39;s
std::vector< pat::tau::TauPFEssential > pfEssential_
Definition: Tau.h:498
void embedIsolationPFNeutralHadrCands()
method to store the isolation neutral hadrons candidates internally
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void embedLeadPFChargedHadrCand()
method to store the leading charged hadron candidate internally
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:221
reco::MuonRef muonRef() const
Definition: PFCandidate.cc:450
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:139
void add(ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup)
void embedIsolationPFChargedHadrCands()
method to store the isolation charged hadrons candidates internally
void setGenJet(const reco::GenJetRef &ref)
set the matched GenJet
const reco::Track * bestTrack() const override
return a pointer to the track if present. otherwise, return a null pointer
Definition: Tau.py:1
void embedLeadPFNeutralCand()
method to store the leading neutral candidate internally
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
Definition: MultiIsolator.h:17
void addGenParticleRef(const reco::GenParticleRef &ref)
Definition: PATObject.h:751
std::vector< edm::EDGetTokenT< edm::ValueMap< TauJetCorrFactors > > > tauJetCorrFactorsTokens_
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
edm::InputTag tauTransverseImpactParameterSrc_
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
std::pair< std::string, WPIdx > NameWPIdx
std::pair< std::string, std::string > WPCfg
std::vector< std::vector< NameWPIdx > > tauIDSrcContainers_
edm::EDGetTokenT< edm::Association< reco::GenJetCollection > > genJetMatchToken_
std::pair< WPCfg, int > WPIdx
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
void initializeJEC(unsigned int level, const unsigned int set=0)
initialize the jet to a given JEC level during creation starting from Uncorrected ...
void embedSignalPFNeutralHadrCands()
method to store the signal neutral hadrons candidates internally
std::vector< std::pair< pat::IsolationKeys, edm::InputTag > > isoDepositLabels_
float hcalFraction() const
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
void addJECFactors(const TauJetCorrFactors &jec)
add more sets of energy correction factors
Definition: Tau.h:417
PATTauProducer(const edm::ParameterSet &iConfig)
HLT enums.
double energy() const override
energy
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
void embedSignalTracks()
method to store the signal tracks internally
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:437
math::XYZPoint Point
point in the space
Definition: Candidate.h:40
void embedSignalPFGammaCands()
method to store the signal gamma candidates internally
Log< level::Warning, false > LogWarning
edm::ProcessHistoryID phID_
std::vector< edm::EDGetTokenT< reco::PFTauDiscriminator > > pfTauIDTokens_
void embedIsolationTracks()
method to store the isolation tracks internally
StableProvenance const & stable() const
Definition: Provenance.h:42
std::vector< NameTag > tauIDSrcs_
edm::EDGetTokenT< reco::PFTauCollection > pfTauToken_
bool isPFTau() const
Returns true if this pat::Tau was made from a reco::PFTau.
Definition: Tau.h:121
def move(src, dest)
Definition: eostools.py:511
double phi() const override
momentum azimuthal angle
GreaterByPt< Tau > pTTauComparator_
Produces pat::Tau&#39;s.
PositionAtECalEntranceComputer posAtECalEntranceComputer_
void embedLeadPFCand()
double energy() const final
energy