CMS 3D CMS Logo

Tau.cc
Go to the documentation of this file.
1 //
2 //
3 
7 #include <algorithm>
8 #include <functional>
9 
10 using namespace pat;
11 using namespace std::placeholders;
12 
14 Tau::Tau()
15  : Lepton<reco::BaseTau>(),
16  embeddedIsolationTracks_(false),
17  embeddedLeadTrack_(false),
18  embeddedSignalTracks_(false),
19  embeddedLeadPFCand_(false),
20  embeddedLeadPFChargedHadrCand_(false),
21  embeddedLeadPFNeutralCand_(false),
22  embeddedSignalPFCands_(false),
23  embeddedSignalPFChargedHadrCands_(false),
24  embeddedSignalPFNeutralHadrCands_(false),
25  embeddedSignalPFGammaCands_(false),
26  embeddedIsolationPFCands_(false),
27  embeddedIsolationPFChargedHadrCands_(false),
28  embeddedIsolationPFNeutralHadrCands_(false),
29  embeddedIsolationPFGammaCands_(false) {}
30 
32 Tau::Tau(const reco::BaseTau& aTau)
33  : Lepton<reco::BaseTau>(aTau),
34  embeddedIsolationTracks_(false),
35  embeddedLeadTrack_(false),
36  embeddedSignalTracks_(false),
37  embeddedLeadPFCand_(false),
38  embeddedLeadPFChargedHadrCand_(false),
39  embeddedLeadPFNeutralCand_(false),
40  embeddedSignalPFCands_(false),
41  embeddedSignalPFChargedHadrCands_(false),
42  embeddedSignalPFNeutralHadrCands_(false),
43  embeddedSignalPFGammaCands_(false),
44  embeddedIsolationPFCands_(false),
45  embeddedIsolationPFChargedHadrCands_(false),
46  embeddedIsolationPFNeutralHadrCands_(false),
47  embeddedIsolationPFGammaCands_(false) {
48  initFromBaseTau(aTau);
49 }
50 
53  : Lepton<reco::BaseTau>(aTauRef),
54  embeddedIsolationTracks_(false),
55  embeddedLeadTrack_(false),
56  embeddedSignalTracks_(false),
57  embeddedLeadPFCand_(false),
58  embeddedLeadPFChargedHadrCand_(false),
59  embeddedLeadPFNeutralCand_(false),
60  embeddedSignalPFCands_(false),
61  embeddedSignalPFChargedHadrCands_(false),
62  embeddedSignalPFNeutralHadrCands_(false),
63  embeddedSignalPFGammaCands_(false),
64  embeddedIsolationPFCands_(false),
65  embeddedIsolationPFChargedHadrCands_(false),
66  embeddedIsolationPFNeutralHadrCands_(false),
67  embeddedIsolationPFGammaCands_(false) {
68  initFromBaseTau(*aTauRef);
69 }
70 
72 Tau::Tau(const edm::Ptr<reco::BaseTau>& aTauRef)
73  : Lepton<reco::BaseTau>(aTauRef),
74  embeddedIsolationTracks_(false),
75  embeddedLeadTrack_(false),
76  embeddedSignalTracks_(false),
77  embeddedLeadPFCand_(false),
78  embeddedLeadPFChargedHadrCand_(false),
79  embeddedLeadPFNeutralCand_(false),
80  embeddedSignalPFCands_(false),
81  embeddedSignalPFChargedHadrCands_(false),
82  embeddedSignalPFNeutralHadrCands_(false),
83  embeddedSignalPFGammaCands_(false),
84  embeddedIsolationPFCands_(false),
85  embeddedIsolationPFChargedHadrCands_(false),
86  embeddedIsolationPFNeutralHadrCands_(false),
87  embeddedIsolationPFGammaCands_(false) {
88  initFromBaseTau(*aTauRef);
89 }
90 
91 void Tau::initFromBaseTau(const reco::BaseTau& aTau) {
92  const reco::PFTau* pfTau = dynamic_cast<const reco::PFTau*>(&aTau);
93  if (pfTau != nullptr) {
94  // If PFTau is made from PackedCandidates, directly fill slimmed version
95  // without PFSpecific
96  const pat::PackedCandidate* pc = dynamic_cast<const pat::PackedCandidate*>(pfTau->leadChargedHadrCand().get());
97  if (pc != nullptr) {
98  for (const auto& ptr : pfTau->signalChargedHadrCands())
99  signalChargedHadrCandPtrs_.push_back(ptr);
100 
101  for (const auto& ptr : pfTau->signalNeutrHadrCands())
102  signalNeutralHadrCandPtrs_.push_back(ptr);
103 
104  for (const auto& ptr : pfTau->signalGammaCands())
105  signalGammaCandPtrs_.push_back(ptr);
106 
107  for (const auto& ptr : pfTau->isolationChargedHadrCands())
108  isolationChargedHadrCandPtrs_.push_back(ptr);
109 
110  for (const auto& ptr : pfTau->isolationNeutrHadrCands())
111  isolationNeutralHadrCandPtrs_.push_back(ptr);
112 
113  for (const auto& ptr : pfTau->isolationGammaCands())
114  isolationGammaCandPtrs_.push_back(ptr);
115  } else {
116  pfSpecific_.push_back(pat::tau::TauPFSpecific(*pfTau));
117  }
118  pfEssential_.push_back(pat::tau::TauPFEssential(*pfTau));
119  }
120 }
121 
123 Tau::~Tau() {}
124 
125 std::ostream& reco::operator<<(std::ostream& out, const pat::Tau& obj) {
126  if (!out)
127  return out;
128 
129  out << "\tpat::Tau: ";
130  out << std::setiosflags(std::ios::right);
131  out << std::setiosflags(std::ios::fixed);
132  out << std::setprecision(3);
133  out << " E/pT/eta/phi " << obj.energy() << "/" << obj.pt() << "/" << obj.eta() << "/" << obj.phi();
134  return out;
135 }
136 
138 const reco::TrackRefVector& Tau::isolationTracks() const {
139  if (embeddedIsolationTracks_) {
140  if (!isolationTracksTransientRefVector_.isSet()) {
141  std::unique_ptr<reco::TrackRefVector> trackRefVec{new reco::TrackRefVector{}};
142  trackRefVec->reserve(isolationTracks_.size());
143  for (unsigned int i = 0; i < isolationTracks_.size(); i++) {
144  trackRefVec->push_back(reco::TrackRef(&isolationTracks_, i));
145  }
146  isolationTracksTransientRefVector_.set(std::move(trackRefVec));
147  }
148  return *isolationTracksTransientRefVector_;
149  } else {
151  }
152 }
153 
156  if (embeddedLeadTrack_) {
157  return reco::TrackRef(&leadTrack_, 0);
158  } else {
159  return reco::BaseTau::leadTrack();
160  }
161 }
162 
165  if (embeddedSignalTracks_) {
166  if (!signalTracksTransientRefVector_.isSet()) {
167  std::unique_ptr<reco::TrackRefVector> trackRefVec{new reco::TrackRefVector{}};
168  trackRefVec->reserve(signalTracks_.size());
169  for (unsigned int i = 0; i < signalTracks_.size(); i++) {
170  trackRefVec->push_back(reco::TrackRef(&signalTracks_, i));
171  }
172  signalTracksTransientRefVector_.set(std::move(trackRefVec));
173  }
174  return *signalTracksTransientRefVector_;
175  } else {
177  }
178 }
179 
182  isolationTracks_.clear();
184  for (unsigned int i = 0; i < trackRefVec.size(); i++) {
185  isolationTracks_.push_back(*trackRefVec.at(i));
186  }
187  embeddedIsolationTracks_ = true;
188 }
189 
191 void Tau::embedLeadTrack() {
192  leadTrack_.clear();
193  if (reco::BaseTau::leadTrack().isNonnull()) {
194  leadTrack_.push_back(*reco::BaseTau::leadTrack());
195  embeddedLeadTrack_ = true;
196  }
197 }
198 
200 void Tau::embedSignalTracks() {
201  signalTracks_.clear();
203  for (unsigned int i = 0; i < trackRefVec.size(); i++) {
204  signalTracks_.push_back(*trackRefVec.at(i));
205  }
206  embeddedSignalTracks_ = true;
207 }
208 
210 void Tau::setGenJet(const reco::GenJetRef& gj) {
211  genJet_.clear();
212  genJet_.push_back(*gj);
213 }
214 
216 const reco::GenJet* Tau::genJet() const { return (!genJet_.empty() ? &genJet_.front() : nullptr); }
217 
218 // method to retrieve a tau ID (or throw)
219 float Tau::tauID(const std::string& name) const {
220  for (std::vector<IdPair>::const_iterator it = tauIDs_.begin(), ed = tauIDs_.end(); it != ed; ++it) {
221  if (it->first == name)
222  return it->second;
223  }
224  cms::Exception ex("Key not found");
225  ex << "pat::Tau: the ID " << name << " can't be found in this pat::Tau.\n";
226  ex << "The available IDs are: ";
227  for (std::vector<IdPair>::const_iterator it = tauIDs_.begin(), ed = tauIDs_.end(); it != ed; ++it) {
228  ex << "'" << it->first << "' ";
229  }
230  ex << ".\n";
231  throw ex;
232 }
233 // check if an ID is there
234 bool Tau::isTauIDAvailable(const std::string& name) const {
235  for (std::vector<IdPair>::const_iterator it = tauIDs_.begin(), ed = tauIDs_.end(); it != ed; ++it) {
236  if (it->first == name)
237  return true;
238  }
239  return false;
240 }
241 
242 const pat::tau::TauPFSpecific& Tau::pfSpecific() const {
243  if (!isPFTau())
244  throw cms::Exception("Type Error")
245  << "Requesting a PFTau-specific information from a pat::Tau which wasn't made from a PFTau.\n";
246  return pfSpecific_[0];
247 }
248 
249 const pat::tau::TauPFEssential& Tau::pfEssential() const {
250  if (pfEssential_.empty())
251  throw cms::Exception("Type Error")
252  << "Requesting a PFTau-specific information from a pat::Tau which wasn't made from a PFTau.\n";
253  return pfEssential_[0];
254 }
255 
256 reco::Candidate::LorentzVector Tau::p4Jet() const {
257  if (isPFTau())
258  return reco::Candidate::LorentzVector(pfEssential().p4Jet_);
259  throw cms::Exception("Type Error") << "Requesting a PFTau-specific information from a pat::Tau which wasn't "
260  "made from a PFTau.\n";
261 }
262 
263 float Tau::dxy_Sig() const {
264  if (pfEssential().dxy_error_ != 0)
265  return (pfEssential().dxy_ / pfEssential().dxy_error_);
266  else
267  return 0.;
268 }
269 
270 pat::tau::TauPFEssential::CovMatrix Tau::flightLengthCov() const {
272  const pat::tau::TauPFEssential::CovMatrix& sv = secondaryVertexCov();
273  const pat::tau::TauPFEssential::CovMatrix& pv = primaryVertexCov();
274  for (int i = 0; i < dimension; ++i) {
275  for (int j = 0; j < dimension; ++j) {
276  cov(i, j) = sv(i, j) + pv(i, j);
277  }
278  }
279  return cov;
280 }
281 
282 float Tau::ip3d_Sig() const {
283  if (pfEssential().ip3d_error_ != 0)
284  return (pfEssential().ip3d_ / pfEssential().ip3d_error_);
285  else
286  return 0.;
287 }
288 
289 float Tau::etaetaMoment() const {
290  if (isPFTau())
291  return pfSpecific().etaetaMoment_;
292  throw cms::Exception("Type Error") << "Requesting a PFTau-specific information from a pat::Tau which wasn't "
293  "made from a PFTau.\n";
294 }
295 
296 float Tau::phiphiMoment() const {
297  if (isPFTau())
298  return pfSpecific().phiphiMoment_;
299  throw cms::Exception("Type Error") << "Requesting a PFTau-specific information from a pat::Tau which wasn't "
300  "made from a PFTau.\n";
301 }
302 
303 float Tau::etaphiMoment() const {
304  if (isPFTau())
305  return pfSpecific().etaphiMoment_;
306  throw cms::Exception("Type Error") << "Requesting a PFTau-specific information from a pat::Tau which wasn't "
307  "made from a PFTau.\n";
308 }
309 
310 void Tau::setDecayMode(int decayMode) {
311  if (!isPFTau())
312  throw cms::Exception("Type Error")
313  << "Requesting a PFTau-specific information from a pat::Tau which wasn't made from a PFTau.\n";
314  pfEssential_[0].decayMode_ = decayMode;
315 }
316 
318 void Tau::embedLeadPFCand() {
319  if (!isPFTau()) { //additional check with warning in pat::tau producer
320  return;
321  }
322  leadPFCand_.clear();
323  if (pfSpecific_[0].leadPFCand_.isNonnull()) {
324  leadPFCand_.push_back(*static_cast<const reco::PFCandidate*>(&*pfSpecific_[0].leadPFCand_)); //already set in C-tor
325  embeddedLeadPFCand_ = true;
326  }
327 }
330  if (!isPFTau()) { //additional check with warning in pat::tau producer
331  return;
332  }
333  leadPFChargedHadrCand_.clear();
334  if (pfSpecific_[0].leadPFChargedHadrCand_.isNonnull()) {
335  leadPFChargedHadrCand_.push_back(
336  *static_cast<const reco::PFCandidate*>(&*pfSpecific_[0].leadPFChargedHadrCand_)); //already set in C-tor
337  embeddedLeadPFChargedHadrCand_ = true;
338  }
339 }
342  if (!isPFTau()) { //additional check with warning in pat::tau producer
343  return;
344  }
345  leadPFNeutralCand_.clear();
346  if (pfSpecific_[0].leadPFNeutralCand_.isNonnull()) {
347  leadPFNeutralCand_.push_back(
348  *static_cast<const reco::PFCandidate*>(&*pfSpecific_[0].leadPFNeutralCand_)); //already set in C-tor
349  embeddedLeadPFNeutralCand_ = true;
350  }
351 }
352 
354  if (!isPFTau()) { //additional check with warning in pat::tau producer
355  return;
356  }
357  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedSignalPFCands_;
358  for (unsigned int i = 0; i < candPtrs.size(); i++) {
359  signalPFCands_.push_back(candPtrs.at(i));
360  }
361  embeddedSignalPFCands_ = true;
362 }
364  if (!isPFTau()) { //additional check with warning in pat::tau producer
365  return;
366  }
367  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedSignalPFChargedHadrCands_;
368  for (unsigned int i = 0; i < candPtrs.size(); i++) {
369  signalPFChargedHadrCands_.push_back(candPtrs.at(i));
370  }
371  embeddedSignalPFChargedHadrCands_ = true;
372 }
374  if (!isPFTau()) { //additional check with warning in pat::tau producer
375  return;
376  }
377  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedSignalPFNeutrHadrCands_;
378  for (unsigned int i = 0; i < candPtrs.size(); i++) {
379  signalPFNeutralHadrCands_.push_back(candPtrs.at(i));
380  }
381  embeddedSignalPFNeutralHadrCands_ = true;
382 }
384  if (!isPFTau()) { //additional check with warning in pat::tau producer
385  return;
386  }
387  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedSignalPFGammaCands_;
388  for (unsigned int i = 0; i < candPtrs.size(); i++) {
389  signalPFGammaCands_.push_back(candPtrs.at(i));
390  }
391  embeddedSignalPFGammaCands_ = true;
392 }
393 
395  if (!isPFTau()) { //additional check with warning in pat::tau producer
396  return;
397  }
398  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedIsolationPFCands_;
399  for (unsigned int i = 0; i < candPtrs.size(); i++) {
400  isolationPFCands_.push_back(candPtrs.at(i));
401  }
402  embeddedIsolationPFCands_ = true;
403 }
404 
406  if (!isPFTau()) { //additional check with warning in pat::tau producer
407  return;
408  }
409  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedIsolationPFChargedHadrCands_;
410  for (unsigned int i = 0; i < candPtrs.size(); i++) {
411  isolationPFChargedHadrCands_.push_back(candPtrs.at(i));
412  }
413  embeddedIsolationPFChargedHadrCands_ = true;
414 }
416  if (!isPFTau()) { //additional check with warning in pat::tau producer
417  return;
418  }
419  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedIsolationPFNeutrHadrCands_;
420  for (unsigned int i = 0; i < candPtrs.size(); i++) {
421  isolationPFNeutralHadrCands_.push_back(candPtrs.at(i));
422  }
423  embeddedIsolationPFNeutralHadrCands_ = true;
424 }
426  if (!isPFTau()) { //additional check with warning in pat::tau producer
427  return;
428  }
429  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedIsolationPFGammaCands_;
430  for (unsigned int i = 0; i < candPtrs.size(); i++) {
431  isolationPFGammaCands_.push_back(candPtrs.at(i));
432  }
433  embeddedIsolationPFGammaCands_ = true;
434 }
435 
436 reco::PFRecoTauChargedHadronRef Tau::leadTauChargedHadronCandidate() const {
437  if (!isPFTau())
438  throw cms::Exception("Type Error") << "Requesting content that is not stored in miniAOD.\n";
439  if (!pfSpecific().signalTauChargedHadronCandidates_.empty()) {
440  return reco::PFRecoTauChargedHadronRef(&pfSpecific().signalTauChargedHadronCandidates_, 0);
441  } else {
443  }
444 }
445 
447  const reco::PFCandidate* pf_cand = dynamic_cast<const reco::PFCandidate*>(&*ptr);
448  if (pf_cand)
449  return edm::Ptr<reco::PFCandidate>(ptr);
450  return reco::PFCandidatePtr();
451 }
452 
453 const reco::PFCandidatePtr Tau::leadPFChargedHadrCand() const {
454  if (!embeddedLeadPFChargedHadrCand_) {
455  if (pfSpecific_.empty())
456  return reco::PFCandidatePtr();
457  else
458  return convertToPFCandidatePtr(pfSpecific().leadPFChargedHadrCand_);
459  } else
460  return reco::PFCandidatePtr(&leadPFChargedHadrCand_, 0);
461 }
462 
463 const reco::PFCandidatePtr Tau::leadPFNeutralCand() const {
464  if (!embeddedLeadPFNeutralCand_) {
465  if (pfSpecific_.empty())
466  return reco::PFCandidatePtr();
467  else
468  return convertToPFCandidatePtr(pfSpecific().leadPFNeutralCand_);
469  } else
470  return reco::PFCandidatePtr(&leadPFNeutralCand_, 0);
471 }
472 
473 const reco::PFCandidatePtr Tau::leadPFCand() const {
474  if (!embeddedLeadPFCand_) {
475  if (pfSpecific_.empty())
476  return reco::PFCandidatePtr();
477  return convertToPFCandidatePtr(pfSpecific().leadPFCand_);
478  } else
479  return reco::PFCandidatePtr(&leadPFCand_, 0);
480 }
481 
482 const std::vector<reco::PFCandidatePtr>& Tau::signalPFCands() const {
483  if (embeddedSignalPFCands_) {
484  if (!signalPFCandsTransientPtrs_.isSet()) {
485  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
486  aPtrs->reserve(signalPFCands_.size());
487  for (unsigned int i = 0; i < signalPFCands_.size(); i++) {
488  aPtrs->push_back(reco::PFCandidatePtr(&signalPFCands_, i));
489  }
490  signalPFCandsTransientPtrs_.set(std::move(aPtrs));
491  }
492  return *signalPFCandsTransientPtrs_;
493  } else {
494  if (pfSpecific_.empty() || pfSpecific().selectedSignalPFCands_.empty() ||
495  !pfSpecific().selectedSignalPFCands_.front().isAvailable()) {
496  // this part of code is called when reading from patTuple or miniAOD
497  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
498  if (!signalPFCandsTransientPtrs_.isSet()) {
499  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
500  signalPFCandsTransientPtrs_.set(std::move(aPtrs));
501  }
502  return *signalPFCandsTransientPtrs_;
503  } else
504  return pfSpecific().selectedSignalPFCands_;
505  }
506 }
507 
508 const std::vector<reco::PFCandidatePtr>& Tau::signalPFChargedHadrCands() const {
509  if (embeddedSignalPFChargedHadrCands_) {
510  if (!signalPFChargedHadrCandsTransientPtrs_.isSet()) {
511  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
512  aPtrs->reserve(signalPFChargedHadrCands_.size());
513  for (unsigned int i = 0; i < signalPFChargedHadrCands_.size(); i++) {
514  aPtrs->push_back(reco::PFCandidatePtr(&signalPFChargedHadrCands_, i));
515  }
516  signalPFChargedHadrCandsTransientPtrs_.set(std::move(aPtrs));
517  }
518  return *signalPFChargedHadrCandsTransientPtrs_;
519  } else {
520  if (pfSpecific_.empty() || pfSpecific().selectedSignalPFChargedHadrCands_.empty() ||
521  !pfSpecific().selectedSignalPFChargedHadrCands_.front().isAvailable()) {
522  // this part of code is called when reading from patTuple or miniAOD
523  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
524  if (!signalPFChargedHadrCandsTransientPtrs_.isSet()) {
525  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
526  signalPFChargedHadrCandsTransientPtrs_.set(std::move(aPtrs));
527  }
528  return *signalPFChargedHadrCandsTransientPtrs_;
529  } else
530  return pfSpecific().selectedSignalPFChargedHadrCands_;
531  }
532 }
533 
534 const std::vector<reco::PFCandidatePtr>& Tau::signalPFNeutrHadrCands() const {
535  if (embeddedSignalPFNeutralHadrCands_) {
536  if (!signalPFNeutralHadrCandsTransientPtrs_.isSet()) {
537  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
538  aPtrs->reserve(signalPFNeutralHadrCands_.size());
539  for (unsigned int i = 0; i < signalPFNeutralHadrCands_.size(); i++) {
540  aPtrs->push_back(reco::PFCandidatePtr(&signalPFNeutralHadrCands_, i));
541  }
542  signalPFNeutralHadrCandsTransientPtrs_.set(std::move(aPtrs));
543  }
544  return *signalPFNeutralHadrCandsTransientPtrs_;
545  } else {
546  if (pfSpecific_.empty() || pfSpecific().selectedSignalPFNeutrHadrCands_.empty() ||
547  !pfSpecific().selectedSignalPFNeutrHadrCands_.front().isAvailable()) {
548  // this part of code is called when reading from patTuple or miniAOD
549  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
550  if (!signalPFNeutralHadrCandsTransientPtrs_.isSet()) {
551  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
552  signalPFNeutralHadrCandsTransientPtrs_.set(std::move(aPtrs));
553  }
554  return *signalPFNeutralHadrCandsTransientPtrs_;
555  } else
556  return pfSpecific().selectedSignalPFNeutrHadrCands_;
557  }
558 }
559 
560 const std::vector<reco::PFCandidatePtr>& Tau::signalPFGammaCands() const {
561  if (embeddedSignalPFGammaCands_) {
562  if (!signalPFGammaCandsTransientPtrs_.isSet()) {
563  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
564  aPtrs->reserve(signalPFGammaCands_.size());
565  for (unsigned int i = 0; i < signalPFGammaCands_.size(); i++) {
566  aPtrs->push_back(reco::PFCandidatePtr(&signalPFGammaCands_, i));
567  }
568  signalPFGammaCandsTransientPtrs_.set(std::move(aPtrs));
569  }
570  return *signalPFGammaCandsTransientPtrs_;
571  } else {
572  if (pfSpecific_.empty() || pfSpecific().selectedSignalPFGammaCands_.empty() ||
573  !pfSpecific().selectedSignalPFGammaCands_.front().isAvailable()) {
574  // this part of code is called when reading from patTuple or miniAOD
575  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
576  if (!signalPFGammaCandsTransientPtrs_.isSet()) {
577  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
578  signalPFGammaCandsTransientPtrs_.set(std::move(aPtrs));
579  }
580  return *signalPFGammaCandsTransientPtrs_;
581  } else
582  return pfSpecific().selectedSignalPFGammaCands_;
583  }
584 }
585 
586 const std::vector<reco::PFRecoTauChargedHadron>& Tau::signalTauChargedHadronCandidates() const {
587  if (pfSpecific_.empty())
588  throw cms::Exception("Type Error") << "Requesting content that is not stored in miniAOD.\n";
589  return pfSpecific().signalTauChargedHadronCandidates_;
590 }
591 
592 const std::vector<reco::RecoTauPiZero>& Tau::signalPiZeroCandidates() const {
593  if (pfSpecific_.empty())
594  throw cms::Exception("Type Error") << "Requesting content that is not stored in miniAOD.\n";
595  return pfSpecific().signalPiZeroCandidates_;
596 }
597 
598 const std::vector<reco::PFCandidatePtr>& Tau::isolationPFCands() const {
599  if (embeddedIsolationPFCands_) {
600  if (!isolationPFCandsTransientPtrs_.isSet()) {
601  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
602  aPtrs->reserve(isolationPFCands_.size());
603  for (unsigned int i = 0; i < isolationPFCands_.size(); i++) {
604  aPtrs->push_back(reco::PFCandidatePtr(&isolationPFCands_, i));
605  }
606  isolationPFCandsTransientPtrs_.set(std::move(aPtrs));
607  }
608  return *isolationPFCandsTransientPtrs_;
609  } else {
610  if (pfSpecific_.empty() || pfSpecific().selectedIsolationPFCands_.empty() ||
611  !pfSpecific().selectedIsolationPFCands_.front().isAvailable()) {
612  // this part of code is called when reading from patTuple or miniAOD
613  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
614  if (!isolationPFCandsTransientPtrs_.isSet()) {
615  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
616  isolationPFCandsTransientPtrs_.set(std::move(aPtrs));
617  }
618  return *isolationPFCandsTransientPtrs_;
619  } else
620  return pfSpecific().selectedIsolationPFCands_;
621  }
622 }
623 
624 const std::vector<reco::PFCandidatePtr>& Tau::isolationPFChargedHadrCands() const {
625  if (embeddedIsolationPFChargedHadrCands_) {
626  if (!isolationPFChargedHadrCandsTransientPtrs_.isSet()) {
627  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
628  aPtrs->reserve(isolationPFChargedHadrCands_.size());
629  for (unsigned int i = 0; i < isolationPFChargedHadrCands_.size(); i++) {
630  aPtrs->push_back(reco::PFCandidatePtr(&isolationPFChargedHadrCands_, i));
631  }
632  isolationPFChargedHadrCandsTransientPtrs_.set(std::move(aPtrs));
633  }
634  return *isolationPFChargedHadrCandsTransientPtrs_;
635  } else {
636  if (pfSpecific_.empty() || pfSpecific().selectedIsolationPFChargedHadrCands_.empty() ||
637  !pfSpecific().selectedIsolationPFChargedHadrCands_.front().isAvailable()) {
638  // this part of code is called when reading from patTuple or miniAOD
639  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
640  if (!isolationPFChargedHadrCandsTransientPtrs_.isSet()) {
641  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
642  isolationPFChargedHadrCandsTransientPtrs_.set(std::move(aPtrs));
643  }
644  return *isolationPFChargedHadrCandsTransientPtrs_;
645  } else
646  return pfSpecific().selectedIsolationPFChargedHadrCands_;
647  }
648 }
649 
650 const std::vector<reco::PFCandidatePtr>& Tau::isolationPFNeutrHadrCands() const {
651  if (embeddedIsolationPFNeutralHadrCands_) {
652  if (!isolationPFNeutralHadrCandsTransientPtrs_.isSet()) {
653  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
654  aPtrs->reserve(isolationPFNeutralHadrCands_.size());
655  for (unsigned int i = 0; i < isolationPFNeutralHadrCands_.size(); i++) {
656  aPtrs->push_back(reco::PFCandidatePtr(&isolationPFNeutralHadrCands_, i));
657  }
658  isolationPFNeutralHadrCandsTransientPtrs_.set(std::move(aPtrs));
659  }
660  return *isolationPFNeutralHadrCandsTransientPtrs_;
661  } else {
662  if (pfSpecific_.empty() || pfSpecific().selectedIsolationPFNeutrHadrCands_.empty() ||
663  !pfSpecific().selectedIsolationPFNeutrHadrCands_.front().isAvailable()) {
664  // this part of code is called when reading from patTuple or miniAOD
665  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
666  if (!isolationPFNeutralHadrCandsTransientPtrs_.isSet()) {
667  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
668  isolationPFNeutralHadrCandsTransientPtrs_.set(std::move(aPtrs));
669  }
670  return *isolationPFNeutralHadrCandsTransientPtrs_;
671  } else
672  return pfSpecific().selectedIsolationPFNeutrHadrCands_;
673  }
674 }
675 
676 const std::vector<reco::PFCandidatePtr>& Tau::isolationPFGammaCands() const {
677  if (embeddedIsolationPFGammaCands_) {
678  if (!isolationPFGammaCandsTransientPtrs_.isSet()) {
679  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
680  aPtrs->reserve(isolationPFGammaCands_.size());
681  for (unsigned int i = 0; i < isolationPFGammaCands_.size(); i++) {
682  aPtrs->push_back(reco::PFCandidatePtr(&isolationPFGammaCands_, i));
683  }
684  isolationPFGammaCandsTransientPtrs_.set(std::move(aPtrs));
685  }
686  return *isolationPFGammaCandsTransientPtrs_;
687  } else {
688  if (pfSpecific_.empty() || pfSpecific().selectedIsolationPFGammaCands_.empty() ||
689  !pfSpecific().selectedIsolationPFGammaCands_.front().isAvailable()) {
690  // this part of code is called when reading from patTuple or miniAOD
691  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
692  if (!isolationPFGammaCandsTransientPtrs_.isSet()) {
693  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
694  isolationPFGammaCandsTransientPtrs_.set(std::move(aPtrs));
695  }
696  return *isolationPFGammaCandsTransientPtrs_;
697  } else
698  return pfSpecific().selectedIsolationPFGammaCands_;
699  }
700 }
701 
702 const std::vector<reco::PFRecoTauChargedHadron>& Tau::isolationTauChargedHadronCandidates() const {
703  if (pfSpecific_.empty())
704  throw cms::Exception("Type Error") << "Requesting content that is not stored in miniAOD.\n";
705  return pfSpecific().isolationTauChargedHadronCandidates_;
706 }
707 
708 const std::vector<reco::RecoTauPiZero>& Tau::isolationPiZeroCandidates() const {
709  if (pfSpecific_.empty())
710  throw cms::Exception("Type Error") << "Requesting content that is not stored in miniAOD.\n";
711  return pfSpecific().isolationPiZeroCandidates_;
712 }
713 
716 
717 // initialize the jet to a given JEC level during creation starting from Uncorrected
718 void Tau::initializeJEC(unsigned int level, unsigned int set) {
719  currentJECSet(set);
720  currentJECLevel(level);
721  setP4(jec_[set].correction(level) * p4());
722 }
723 
725 int Tau::jecSet(const std::string& set) const {
726  for (std::vector<pat::TauJetCorrFactors>::const_iterator corrFactor = jec_.begin(); corrFactor != jec_.end();
727  ++corrFactor) {
728  if (corrFactor->jecSet() == set)
729  return corrFactor - jec_.begin();
730  }
731  return -1;
732 }
733 
735 const std::vector<std::string> Tau::availableJECSets() const {
736  std::vector<std::string> sets;
737  for (std::vector<pat::TauJetCorrFactors>::const_iterator corrFactor = jec_.begin(); corrFactor != jec_.end();
738  ++corrFactor) {
739  sets.push_back(corrFactor->jecSet());
740  }
741  return sets;
742 }
743 
744 const std::vector<std::string> Tau::availableJECLevels(const int& set) const {
745  return set >= 0 ? jec_.at(set).correctionLabels() : std::vector<std::string>();
746 }
747 
750 float Tau::jecFactor(const std::string& level, const std::string& set) const {
751  for (unsigned int idx = 0; idx < jec_.size(); ++idx) {
752  if (set.empty() || jec_.at(idx).jecSet() == set) {
753  if (jec_[idx].jecLevel(level) >= 0)
754  return jecFactor(jec_[idx].jecLevel(level), idx);
755  else
756  throw cms::Exception("InvalidRequest") << "This JEC level " << level << " does not exist. \n";
757  }
758  }
759  throw cms::Exception("InvalidRequest") << "This jet does not carry any jet energy correction factor information \n"
760  << "for a jet energy correction set with label " << set << "\n";
761 }
762 
765 float Tau::jecFactor(const unsigned int& level, const unsigned int& set) const {
766  if (!jecSetsAvailable())
767  throw cms::Exception("InvalidRequest") << "This jet does not carry any jet energy correction factor information \n";
768  if (!jecSetAvailable(set))
769  throw cms::Exception("InvalidRequest") << "This jet does not carry any jet energy correction factor information \n"
770  << "for a jet energy correction set with index " << set << "\n";
771  return jec_.at(set).correction(level) / jec_.at(currentJECSet_).correction(currentJECLevel_);
772 }
773 
776 Tau Tau::correctedTauJet(const std::string& level, const std::string& set) const {
777  // rescale p4 of the jet; the update of current values is
778  // done within the called jecFactor function
779  for (unsigned int idx = 0; idx < jec_.size(); ++idx) {
780  if (set.empty() || jec_.at(idx).jecSet() == set) {
781  if (jec_[idx].jecLevel(level) >= 0)
782  return correctedTauJet(jec_[idx].jecLevel(level), idx);
783  else
784  throw cms::Exception("InvalidRequest") << "This JEC level " << level << " does not exist. \n";
785  }
786  }
787  throw cms::Exception("InvalidRequest") << "This JEC set " << set << " does not exist. \n";
788 }
789 
792 Tau Tau::correctedTauJet(const unsigned int& level, const unsigned int& set) const {
793  Tau correctedTauJet(*this);
794  //rescale p4 of the jet
795  correctedTauJet.setP4(jecFactor(level, set) * p4());
796  // update current level and set
797  correctedTauJet.currentJECSet(set);
798  correctedTauJet.currentJECLevel(level);
799  return correctedTauJet;
800 }
801 
804 // return the leading candidate from signal(PF)ChargedHadrCandPtrs_ collection
805 const reco::CandidatePtr Tau::leadChargedHadrCand() const {
806  const reco::PFCandidatePtr leadPF = leadPFChargedHadrCand();
807  if (leadPF.isAvailable() || signalChargedHadrCandPtrs_.isNull())
808  return leadPF;
810  for (const reco::CandidatePtr& p : signalChargedHadrCandPtrs_) {
811  if (ret.isNull() || (p->pt() > ret->pt()))
812  ret = p;
813  }
814  return ret;
815 }
816 
818 const reco::CandidatePtr Tau::leadNeutralCand() const {
819  const reco::PFCandidatePtr leadPF = leadPFNeutralCand();
820  if (leadPF.isAvailable() || signalNeutralHadrCandPtrs_.isNull())
821  return leadPF;
823  for (const reco::CandidatePtr& p : signalNeutralHadrCandPtrs_) {
824  if (ret.isNull() || (p->pt() > ret->pt()))
825  ret = p;
826  }
827  return ret;
828 }
829 
831 const reco::CandidatePtr Tau::leadCand() const {
832  const reco::PFCandidatePtr leadPF = leadPFCand();
833  if (leadPF.isAvailable() || !Tau::ExistSignalCands())
834  return leadPF;
835  else
836  return Tau::signalCands()[0];
837 }
838 
840 
841 bool Tau::ExistSignalCands() const {
842  return !(signalChargedHadrCandPtrs_.isNull() && signalNeutralHadrCandPtrs_.isNull() && signalGammaCandPtrs_.isNull());
843 }
844 
845 bool Tau::ExistIsolationCands() const {
846  return !(isolationChargedHadrCandPtrs_.isNull() && isolationNeutralHadrCandPtrs_.isNull() &&
847  isolationGammaCandPtrs_.isNull());
848 }
849 
852 
853 reco::CandidatePtrVector Tau::signalCands() const {
854  std::vector<reco::PFCandidatePtr> r0 = signalPFCands();
856  if (!Tau::ExistSignalCands() || (!r0.empty() && r0.front().isAvailable())) {
857  for (const auto& p : r0)
858  ret.push_back(p);
859  return ret;
860  } else {
863  std::vector<std::pair<float, size_t> > pt_index;
864  size_t index = 0;
865  ret2.reserve(signalChargedHadrCandPtrs_.size() + signalNeutralHadrCandPtrs_.size() + signalGammaCandPtrs_.size());
866  pt_index.reserve(signalChargedHadrCandPtrs_.size() + signalNeutralHadrCandPtrs_.size() +
867  signalGammaCandPtrs_.size());
868 
869  for (const auto& p : signalChargedHadrCandPtrs_) {
870  ret2.push_back(p);
871  pt_index.push_back(std::make_pair(p->pt(), index));
872  index++;
873  }
874  for (const auto& p : signalNeutralHadrCandPtrs_) {
875  ret2.push_back(p);
876  pt_index.push_back(std::make_pair(p->pt(), index));
877  index++;
878  }
879  for (const auto& p : signalGammaCandPtrs_) {
880  ret2.push_back(p);
881  pt_index.push_back(std::make_pair(p->pt(), index));
882  index++;
883  }
884  std::sort(pt_index.begin(), pt_index.end(), std::greater<>());
885  ret.reserve(pt_index.size());
886  for (const auto& p : pt_index) {
887  ret.push_back(ret2[p.second]);
888  }
889  return ret;
890  }
891 }
892 
895 reco::CandidatePtrVector Tau::signalChargedHadrCands() const {
896  std::vector<reco::PFCandidatePtr> r0 = signalPFChargedHadrCands();
897  if (signalChargedHadrCandPtrs_.isNull() || (!r0.empty() && r0.front().isAvailable())) {
899  for (const auto& p : r0)
900  ret.push_back(p);
901  return ret;
902  } else {
903  return signalChargedHadrCandPtrs_;
904  }
905 }
906 
909 reco::CandidatePtrVector Tau::signalNeutrHadrCands() const {
910  std::vector<reco::PFCandidatePtr> r0 = signalPFNeutrHadrCands();
911  if (signalNeutralHadrCandPtrs_.isNull() || (!r0.empty() && r0.front().isAvailable())) {
913  for (const auto& p : r0)
914  ret.push_back(p);
915  return ret;
916  } else {
917  return signalNeutralHadrCandPtrs_;
918  }
919 }
920 
923 reco::CandidatePtrVector Tau::signalGammaCands() const {
924  std::vector<reco::PFCandidatePtr> r0 = signalPFGammaCands();
925  if (signalGammaCandPtrs_.isNull() || (!r0.empty() && r0.front().isAvailable())) {
927  for (const auto& p : r0)
928  ret.push_back(p);
929  return ret;
930  } else {
931  return signalGammaCandPtrs_;
932  }
933 }
934 
937 reco::CandidatePtrVector Tau::isolationCands() const {
938  std::vector<reco::PFCandidatePtr> r0 = isolationPFCands();
940  if (!Tau::ExistIsolationCands() || (!r0.empty() && r0.front().isAvailable())) {
941  for (const auto& p : r0)
942  ret.push_back(p);
943  return ret;
944  } else {
947  std::vector<std::pair<float, size_t> > pt_index;
948  ret2.reserve(isolationChargedHadrCandPtrs_.size() + isolationNeutralHadrCandPtrs_.size() +
949  isolationGammaCandPtrs_.size());
950  pt_index.reserve(isolationChargedHadrCandPtrs_.size() + isolationNeutralHadrCandPtrs_.size() +
951  isolationGammaCandPtrs_.size());
952  size_t index = 0;
953  for (const auto& p : isolationChargedHadrCandPtrs_) {
954  ret2.push_back(p);
955  pt_index.push_back(std::make_pair(p->pt(), index));
956  index++;
957  }
958  for (const auto& p : isolationNeutralHadrCandPtrs_) {
959  ret2.push_back(p);
960  pt_index.push_back(std::make_pair(p->pt(), index));
961  index++;
962  }
963  for (const auto& p : isolationGammaCandPtrs_) {
964  ret2.push_back(p);
965  pt_index.push_back(std::make_pair(p->pt(), index));
966  index++;
967  }
968  std::sort(pt_index.begin(), pt_index.end(), std::greater<>());
969  ret.reserve(pt_index.size());
970  for (const auto& p : pt_index) {
971  ret.push_back(ret2[p.second]);
972  }
973  return ret;
974  }
975 }
976 
979 reco::CandidatePtrVector Tau::isolationChargedHadrCands() const {
980  std::vector<reco::PFCandidatePtr> r0 = isolationPFChargedHadrCands();
981  if (isolationChargedHadrCandPtrs_.isNull() || (!r0.empty() && r0.front().isAvailable())) {
983  for (const auto& p : r0)
984  ret.push_back(p);
985  return ret;
986  } else {
987  return isolationChargedHadrCandPtrs_;
988  }
989 }
990 
993 reco::CandidatePtrVector Tau::isolationNeutrHadrCands() const {
995  std::vector<reco::PFCandidatePtr> r0 = isolationPFNeutrHadrCands();
996  if (isolationNeutralHadrCandPtrs_.isNull() || (!r0.empty() && r0.front().isAvailable())) {
998  for (const auto& p : r0)
999  ret.push_back(p);
1000  return ret;
1001  } else {
1002  return isolationNeutralHadrCandPtrs_;
1003  }
1004 }
1005 
1008 reco::CandidatePtrVector Tau::isolationGammaCands() const {
1009  std::vector<reco::PFCandidatePtr> r0 = isolationPFGammaCands();
1010  if (isolationGammaCandPtrs_.isNull() || (!r0.empty() && r0.front().isAvailable())) {
1012  for (const auto& p : r0)
1013  ret.push_back(p);
1014  return ret;
1015  } else {
1016  return isolationGammaCandPtrs_;
1017  }
1018 }
1019 
1022 size_t Tau::numberOfSourceCandidatePtrs() const {
1023  if (Tau::ExistSignalCands())
1024  return Tau::signalCands().size();
1025  else if (pfSpecific_.empty())
1026  return 0;
1027  else
1028  return pfSpecific().selectedSignalPFCands_.size();
1029 }
1032  if (Tau::ExistSignalCands())
1033  return Tau::signalCands()[i];
1034  else if (pfSpecific_.empty())
1035  return reco::CandidatePtr();
1036  else
1037  return pfSpecific().selectedSignalPFCands_[i];
1038 }
personalPlayback.level
level
Definition: personalPlayback.py:22
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:543
tauProducer_cfi.embedIsolationPFChargedHadrCands
embedIsolationPFChargedHadrCands
embed in AOD externally stored isolation PFCandidates
Definition: tauProducer_cfi.py:48
tauProducer_cfi.embedLeadTrack
embedLeadTrack
Definition: tauProducer_cfi.py:36
pat::Tau::Tau
Tau()
default constructor
tauProducer_cfi.embedSignalPFCands
embedSignalPFCands
embed in AOD externally stored leading PFNeutral Candidate
Definition: tauProducer_cfi.py:43
edm::RefVector::reserve
void reserve(size_type n)
Reserve space for RefVector.
Definition: RefVector.h:108
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
mps_fire.i
i
Definition: mps_fire.py:428
tauProducer_cfi.embedSignalTracks
embedSignalTracks
embed in AOD externally stored leading track
Definition: tauProducer_cfi.py:37
reco::GenJet
Jets made from MC generator particles.
Definition: GenJet.h:23
tauProducer_cfi.embedLeadPFCand
embedLeadPFCand
embed in AOD externally stored isolation tracks embedding objects (for PFTaus only)
Definition: tauProducer_cfi.py:40
funct::false
false
Definition: Factorize.h:29
tauProducer_cfi.embedLeadPFChargedHadrCand
embedLeadPFChargedHadrCand
embed in AOD externally stored leading PFCandidate
Definition: tauProducer_cfi.py:41
reco::PFCandidatePtr
edm::Ptr< PFCandidate > PFCandidatePtr
persistent Ptr to a PFCandidate
Definition: PFCandidateFwd.h:27
reco::PFRecoTauChargedHadronRef
edm::Ref< PFRecoTauChargedHadronCollection > PFRecoTauChargedHadronRef
presistent reference to a PFRecoTauChargedHadron
Definition: PFRecoTauChargedHadronFwd.h:16
Lepton
Definition: Lepton.py:1
reco::BaseTau::leadTrack
virtual reco::TrackRef leadTrack() const
Definition: BaseTau.cc:24
reco::LeafCandidate::index
unsigned int index
Definition: LeafCandidate.h:31
reco::LeafCandidate::numberOfSourceCandidatePtrs
size_t numberOfSourceCandidatePtrs() const override
Definition: LeafCandidate.h:100
pat::Tau
Analysis-level tau class.
Definition: Tau.h:53
recoTrackAccumulator_cfi.signalTracks
signalTracks
Definition: recoTrackAccumulator_cfi.py:10
reco::PFTau::signalChargedHadrCands
const std::vector< reco::CandidatePtr > & signalChargedHadrCands() const
Charged hadrons in signal region.
Definition: PFTau.cc:76
reco::tau::leadCand
InputIterator leadCand(InputIterator begin, InputIterator end)
Definition: RecoTauCommonUtilities.h:138
reco::PFTau
Definition: PFTau.h:36
edm::Ptr::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:139
edm::RefVector< TrackCollection >
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
Tau
Definition: Tau.py:1
reco::BaseTau::signalTracks
virtual const reco::TrackRefVector & signalTracks() const
Definition: BaseTau.cc:26
Tau.h
edm::Ref< TrackCollection >
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
boostedTaus_cff.decayMode
decayMode
Definition: boostedTaus_cff.py:28
reco::Candidate::dimension
Definition: Candidate.h:44
singlePfTauSkim_cff.leadTrack
leadTrack
Definition: singlePfTauSkim_cff.py:22
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
convertToPFCandidatePtr
const reco::PFCandidatePtr convertToPFCandidatePtr(const reco::CandidatePtr &ptr)
Definition: Tau.cc:446
reco::BaseTau
Definition: BaseTau.h:18
edm::PtrVector< Candidate >
l1t::Tau::~Tau
~Tau() override
l1t::Tau::Tau
Tau()
Definition: Tau.h:22
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:352
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
reco::PFTau::leadChargedHadrCand
const CandidatePtr & leadChargedHadrCand() const
Definition: PFTau.cc:63
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
edm::PtrVector::push_back
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:149
tauProducer_cfi.embedSignalPFGammaCands
embedSignalPFGammaCands
embed in AOD externally stored signal PFNeutralHadronCandidates
Definition: tauProducer_cfi.py:46
pat::tau::TauPFEssential
Definition: TauPFEssential.h:22
tauProducer_cfi.embedSignalPFNeutralHadrCands
embedSignalPFNeutralHadrCands
embed in AOD externally stored signal PFChargedHadronCandidates
Definition: tauProducer_cfi.py:45
pfMETCorrectionType0_cfi.correction
correction
Definition: pfMETCorrectionType0_cfi.py:39
pat::PackedCandidate
Definition: PackedCandidate.h:22
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
PackedCandidate.h
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
tauProducer_cfi.embedIsolationTracks
embedIsolationTracks
embed in AOD externally stored signal tracks
Definition: tauProducer_cfi.py:38
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
reco::operator<<
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:66
tauProducer_cfi.embedIsolationPFCands
embedIsolationPFCands
embed in AOD externally stored signal PFGammaCandidates
Definition: tauProducer_cfi.py:47
pat
Definition: HeavyIon.h:7
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::Ptr
Definition: AssociationVector.h:31
TopDecayID::tauID
static const int tauID
Definition: TopGenEvent.h:20
reco::PFTau::signalNeutrHadrCands
const std::vector< reco::CandidatePtr > & signalNeutrHadrCands() const
Neutral hadrons in signal region.
Definition: PFTau.cc:80
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
eostools.move
def move(src, dest)
Definition: eostools.py:511
tauProducer_cfi.embedIsolationPFGammaCands
embedIsolationPFGammaCands
embed in AOD externally stored isolation PFNeutralHadronCandidates
Definition: tauProducer_cfi.py:50
tauProducer_cfi.embedLeadPFNeutralCand
embedLeadPFNeutralCand
embed in AOD externally stored leading PFChargedHadron candidate
Definition: tauProducer_cfi.py:42
Exception
Definition: hltDiff.cc:245
reco::LeafCandidate::p
double p() const final
magnitude of momentum vector
Definition: LeafCandidate.h:123
tauProducer_cfi.embedIsolationPFNeutralHadrCands
embedIsolationPFNeutralHadrCands
embed in AOD externally stored isolation PFChargedHadronCandidates
Definition: tauProducer_cfi.py:49
reco::PFTau::isolationNeutrHadrCands
const std::vector< reco::CandidatePtr > & isolationNeutrHadrCands() const
Definition: PFTau.cc:95
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::RefToBase
Definition: AssociativeIterator.h:54
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
pat::tau::TauPFSpecific
Definition: TauPFSpecific.h:22
edm::Ptr::isAvailable
bool isAvailable() const
Definition: Ptr.h:230
GenJet.h
cms::Exception
Definition: Exception.h:70
tauProducer_cfi.embedSignalPFChargedHadrCands
embedSignalPFChargedHadrCands
embed in AOD externally stored signal PFCandidates
Definition: tauProducer_cfi.py:44
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
edm::RefVector::at
const value_type at(size_type idx) const
Retrieve an element of the RefVector.
Definition: RefVector.h:83
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
reco::LeafCandidate::sourceCandidatePtr
CandidatePtr sourceCandidatePtr(size_type i) const override
Definition: LeafCandidate.h:103
edm::RefVector::size
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
reco::BaseTau::isolationTracks
virtual const reco::TrackRefVector & isolationTracks() const
Definition: BaseTau.cc:28
reco::PFTau::isolationChargedHadrCands
const std::vector< reco::CandidatePtr > & isolationChargedHadrCands() const
Charged candidates in isolation region.
Definition: PFTau.cc:89
reco::PFTau::isolationGammaCands
const std::vector< reco::CandidatePtr > & isolationGammaCands() const
Gamma candidates in isolation region.
Definition: PFTau.cc:99
pat::tau::TauPFEssential::CovMatrix
math::ErrorF< 3 >::type CovMatrix
Definition: TauPFEssential.h:27
edm::PtrVectorBase::reserve
void reserve(size_type n)
Reserve space for RefVector.
Definition: PtrVectorBase.h:93
reco::PFTau::signalGammaCands
const std::vector< reco::CandidatePtr > & signalGammaCands() const
Gamma candidates in signal region.
Definition: PFTau.cc:84