CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Tau.cc
Go to the documentation of this file.
1 //
2 //
3 
6 #include <algorithm>
7 #include <boost/bind.hpp>
8 
9 using namespace pat;
10 
11 
14  Lepton<reco::BaseTau>()
15  ,embeddedIsolationTracks_(false)
16  ,embeddedLeadTrack_(false)
17  ,embeddedSignalTracks_(false)
18  ,embeddedLeadPFCand_(false)
19  ,embeddedLeadPFChargedHadrCand_(false)
20  ,embeddedLeadPFNeutralCand_(false)
21  ,embeddedSignalPFCands_(false)
22  ,embeddedSignalPFChargedHadrCands_(false)
23  ,embeddedSignalPFNeutralHadrCands_(false)
24  ,embeddedSignalPFGammaCands_(false)
25  ,embeddedIsolationPFCands_(false)
26  ,embeddedIsolationPFChargedHadrCands_(false)
27  ,embeddedIsolationPFNeutralHadrCands_(false)
28  ,embeddedIsolationPFGammaCands_(false)
29 {
30 }
31 
33 Tau::Tau(const reco::BaseTau & aTau) :
34  Lepton<reco::BaseTau>(aTau)
35  ,embeddedIsolationTracks_(false)
36  ,embeddedLeadTrack_(false)
37  ,embeddedSignalTracks_(false)
38  ,embeddedLeadPFCand_(false)
39  ,embeddedLeadPFChargedHadrCand_(false)
40  ,embeddedLeadPFNeutralCand_(false)
41  ,embeddedSignalPFCands_(false)
42  ,embeddedSignalPFChargedHadrCands_(false)
43  ,embeddedSignalPFNeutralHadrCands_(false)
44  ,embeddedSignalPFGammaCands_(false)
45  ,embeddedIsolationPFCands_(false)
46  ,embeddedIsolationPFChargedHadrCands_(false)
47  ,embeddedIsolationPFNeutralHadrCands_(false)
48  ,embeddedIsolationPFGammaCands_(false)
49 {
50  const reco::PFTau * pfTau = dynamic_cast<const reco::PFTau *>(&aTau);
51  if (pfTau != 0){
52  pfSpecific_.push_back(pat::tau::TauPFSpecific(*pfTau));
53  pfEssential_.push_back(pat::tau::TauPFEssential(*pfTau));
54  }
55  const reco::CaloTau * caloTau = dynamic_cast<const reco::CaloTau *>(&aTau);
56  if (caloTau != 0) caloSpecific_.push_back(pat::tau::TauCaloSpecific(*caloTau));
57 }
58 
61  Lepton<reco::BaseTau>(aTauRef)
62  ,embeddedIsolationTracks_(false)
63  ,embeddedLeadTrack_(false)
64  ,embeddedSignalTracks_(false)
65  ,embeddedLeadPFCand_(false)
66  ,embeddedLeadPFChargedHadrCand_(false)
67  ,embeddedLeadPFNeutralCand_(false)
68  ,embeddedSignalPFCands_(false)
69  ,embeddedSignalPFChargedHadrCands_(false)
70  ,embeddedSignalPFNeutralHadrCands_(false)
71  ,embeddedSignalPFGammaCands_(false)
72  ,embeddedIsolationPFCands_(false)
73  ,embeddedIsolationPFChargedHadrCands_(false)
74  ,embeddedIsolationPFNeutralHadrCands_(false)
75  ,embeddedIsolationPFGammaCands_(false)
76 {
77  const reco::PFTau * pfTau = dynamic_cast<const reco::PFTau *>(aTauRef.get());
78  if (pfTau != 0){
79  pfSpecific_.push_back(pat::tau::TauPFSpecific(*pfTau));
80  pfEssential_.push_back(pat::tau::TauPFEssential(*pfTau));
81  }
82  const reco::CaloTau * caloTau = dynamic_cast<const reco::CaloTau *>(aTauRef.get());
83  if (caloTau != 0) caloSpecific_.push_back(pat::tau::TauCaloSpecific(*caloTau));
84 }
85 
88  Lepton<reco::BaseTau>(aTauRef)
89  ,embeddedIsolationTracks_(false)
90  ,embeddedLeadTrack_(false)
91  ,embeddedSignalTracks_(false)
92  ,embeddedLeadPFCand_(false)
93  ,embeddedLeadPFChargedHadrCand_(false)
94  ,embeddedLeadPFNeutralCand_(false)
95  ,embeddedSignalPFCands_(false)
96  ,embeddedSignalPFChargedHadrCands_(false)
97  ,embeddedSignalPFNeutralHadrCands_(false)
98  ,embeddedSignalPFGammaCands_(false)
99  ,embeddedIsolationPFCands_(false)
100  ,embeddedIsolationPFChargedHadrCands_(false)
101  ,embeddedIsolationPFNeutralHadrCands_(false)
102  ,embeddedIsolationPFGammaCands_(false)
103 {
104  const reco::PFTau * pfTau = dynamic_cast<const reco::PFTau *>(aTauRef.get());
105  if (pfTau != 0){
106  pfSpecific_.push_back(pat::tau::TauPFSpecific(*pfTau));
107  pfEssential_.push_back(pat::tau::TauPFEssential(*pfTau));
108  }
109  const reco::CaloTau * caloTau = dynamic_cast<const reco::CaloTau *>(aTauRef.get());
110  if (caloTau != 0) caloSpecific_.push_back(pat::tau::TauCaloSpecific(*caloTau));
111 }
112 
115 }
116 
117 std::ostream&
118 reco::operator<<(std::ostream& out, const pat::Tau& obj)
119 {
120  if(!out) return out;
121 
122  out << "\tpat::Tau: ";
123  out << std::setiosflags(std::ios::right);
124  out << std::setiosflags(std::ios::fixed);
125  out << std::setprecision(3);
126  out << " E/pT/eta/phi "
127  << obj.energy()<<"/"
128  << obj.pt()<<"/"
129  << obj.eta()<<"/"
130  << obj.phi();
131  return out;
132 }
133 
138  std::unique_ptr<reco::TrackRefVector> trackRefVec{ new reco::TrackRefVector{}};
139  trackRefVec->reserve(isolationTracks_.size());
140  for (unsigned int i = 0; i < isolationTracks_.size(); i++) {
141  trackRefVec->push_back(reco::TrackRef(&isolationTracks_, i));
142  }
143  isolationTracksTransientRefVector_.set(std::move(trackRefVec));
144  }
146  } else {
148  }
149 }
150 
151 
154  if (embeddedLeadTrack_) {
155  return reco::TrackRef(&leadTrack_, 0);
156  } else {
157  return reco::BaseTau::leadTrack();
158  }
159 }
160 
161 
164  if (embeddedSignalTracks_) {
166  std::unique_ptr<reco::TrackRefVector> trackRefVec{ new reco::TrackRefVector{} };
167  trackRefVec->reserve(signalTracks_.size());
168  for (unsigned int i = 0; i < signalTracks_.size(); i++) {
169  trackRefVec->push_back(reco::TrackRef(&signalTracks_, i));
170  }
171  signalTracksTransientRefVector_.set(std::move(trackRefVec));
172  }
174  } else {
176  }
177 }
178 
179 
182  isolationTracks_.clear();
184  for (unsigned int i = 0; i < trackRefVec.size(); i++) {
185  isolationTracks_.push_back(*trackRefVec.at(i));
186  }
188 }
189 
190 
193  leadTrack_.clear();
194  if (reco::BaseTau::leadTrack().isNonnull()) {
195  leadTrack_.push_back(*reco::BaseTau::leadTrack());
196  embeddedLeadTrack_ = true;
197  }
198 }
199 
200 
203  signalTracks_.clear();
205  for (unsigned int i = 0; i < trackRefVec.size(); i++) {
206  signalTracks_.push_back(*trackRefVec.at(i));
207  }
208  embeddedSignalTracks_ = true;
209 }
210 
211 
214  genJet_.clear();
215  genJet_.push_back(*gj);
216 }
217 
219 const reco::GenJet * Tau::genJet() const {
220  return (genJet_.size() > 0 ? &genJet_.front() : 0);
221 }
222 
223 
224 // method to retrieve a tau ID (or throw)
225 float Tau::tauID(const std::string & name) const {
226  for (std::vector<IdPair>::const_iterator it = tauIDs_.begin(), ed = tauIDs_.end(); it != ed; ++it) {
227  if (it->first == name) return it->second;
228  }
229  cms::Exception ex("Key not found");
230  ex << "pat::Tau: the ID " << name << " can't be found in this pat::Tau.\n";
231  ex << "The available IDs are: ";
232  for (std::vector<IdPair>::const_iterator it = tauIDs_.begin(), ed = tauIDs_.end(); it != ed; ++it) {
233  ex << "'" << it->first << "' ";
234  }
235  ex << ".\n";
236  throw ex;
237 }
238 // check if an ID is there
240  for (std::vector<IdPair>::const_iterator it = tauIDs_.begin(), ed = tauIDs_.end(); it != ed; ++it) {
241  if (it->first == name) return true;
242  }
243  return false;
244 }
245 
246 
248  if (!isPFTau()) throw cms::Exception("Type Error") << "Requesting a PFTau-specific information from a pat::Tau which wasn't made from a PFTau.\n";
249  return pfSpecific_[0];
250 }
251 
253  if (pfEssential_.empty()) throw cms::Exception("Type Error") << "Requesting a PFTau-specific information from a pat::Tau which wasn't made from a PFTau.\n";
254  return pfEssential_[0];
255 }
256 
257 
259  if (!isCaloTau()) throw cms::Exception("Type Error") << "Requesting a CaloTau-specific information from a pat::Tau which wasn't made from a CaloTau.\n";
260  return caloSpecific_[0];
261 }
262 
264 {
265  if ( isCaloTau() ) return caloSpecific().p4Jet_;
266  if ( isPFTau() ) return pfEssential().p4Jet_;
267  throw cms::Exception("Type Error") << "Requesting a CaloTau/PFTau-specific information from a pat::Tau which wasn't made from either a CaloTau or a PFTau.\n";
268 }
269 
270 double Tau::dxy_Sig() const
271 {
272  if ( pfEssential().dxy_error_ != 0 ) return (pfEssential().dxy_/pfEssential().dxy_error_);
273  else return 0.;
274 }
275 
277 {
281  for ( int i = 0; i < dimension; ++i ) {
282  for ( int j = 0; j < dimension; ++j ) {
283  cov(i,j) = sv(i,j) + pv(i,j);
284  }
285  }
286  return cov;
287 }
288 
289 float Tau::etaetaMoment() const
290 {
291  if ( isCaloTau() ) return caloSpecific().etaetaMoment_;
292  if ( isPFTau() ) return pfSpecific().etaetaMoment_;
293  throw cms::Exception("Type Error") << "Requesting a CaloTau/PFTau-specific information from a pat::Tau which wasn't made from either a CaloTau or a PFTau.\n";
294 }
295 
296 float Tau::phiphiMoment() const
297 {
298  if ( isCaloTau() ) return caloSpecific().phiphiMoment_;
299  if ( isPFTau() ) return pfSpecific().phiphiMoment_;
300  throw cms::Exception("Type Error") << "Requesting a CaloTau/PFTau-specific information from a pat::Tau which wasn't made from either a CaloTau or a PFTau.\n";
301 }
302 
303 float Tau::etaphiMoment() const
304 {
305  if ( isCaloTau() ) return caloSpecific().etaphiMoment_;
306  if ( isPFTau() ) return pfSpecific().etaphiMoment_;
307  throw cms::Exception("Type Error") << "Requesting a CaloTau/PFTau-specific information from a pat::Tau which wasn't made from either a CaloTau or a PFTau.\n";
308 }
309 
310 void Tau::setDecayMode(int decayMode)
311 {
312  if (!isPFTau()) throw cms::Exception("Type Error") << "Requesting a PFTau-specific information from a pat::Tau which wasn't made from a PFTau.\n";
313  pfEssential_[0].decayMode_ = decayMode;
314 }
315 
318  if (!isPFTau() ) {//additional check with warning in pat::tau producer
319  return;
320  }
321  leadPFCand_.clear();
322  if (pfSpecific_[0].leadPFCand_.isNonnull() ) {
323  leadPFCand_.push_back(*pfSpecific_[0].leadPFCand_); //already set in C-tor
324  embeddedLeadPFCand_ = true;
325  }
326 }
329  if (!isPFTau() ) {//additional check with warning in pat::tau producer
330  return;
331  }
332  leadPFChargedHadrCand_.clear();
333  if (pfSpecific_[0].leadPFChargedHadrCand_.isNonnull() ) {
334  leadPFChargedHadrCand_.push_back(*pfSpecific_[0].leadPFChargedHadrCand_); //already set in C-tor
336  }
337 }
340  if (!isPFTau() ) {//additional check with warning in pat::tau producer
341  return;
342  }
343  leadPFNeutralCand_.clear();
344  if (pfSpecific_[0].leadPFNeutralCand_.isNonnull() ) {
345  leadPFNeutralCand_.push_back(*pfSpecific_[0].leadPFNeutralCand_); //already set in C-tor
347  }
348 }
349 
351  if (!isPFTau() ) {//additional check with warning in pat::tau producer
352  return;
353  }
354  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedSignalPFCands_;
355  for (unsigned int i = 0; i < candPtrs.size(); i++) {
356  signalPFCands_.push_back(*candPtrs.at(i));
357  }
358  embeddedSignalPFCands_ = true;
359 }
361  if (!isPFTau() ) {//additional check with warning in pat::tau producer
362  return;
363  }
364  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedSignalPFChargedHadrCands_;
365  for (unsigned int i = 0; i < candPtrs.size(); i++) {
366  signalPFChargedHadrCands_.push_back(*candPtrs.at(i));
367  }
369 }
371  if (!isPFTau() ) {//additional check with warning in pat::tau producer
372  return;
373  }
374  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedSignalPFNeutrHadrCands_;
375  for (unsigned int i = 0; i < candPtrs.size(); i++) {
376  signalPFNeutralHadrCands_.push_back(*candPtrs.at(i));
377  }
379 }
381  if (!isPFTau() ) {//additional check with warning in pat::tau producer
382  return;
383  }
384  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedSignalPFGammaCands_;
385  for (unsigned int i = 0; i < candPtrs.size(); i++) {
386  signalPFGammaCands_.push_back(*candPtrs.at(i));
387  }
389 }
390 
392  if (!isPFTau() ) {//additional check with warning in pat::tau producer
393  return;
394  }
395  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedIsolationPFCands_;
396  for (unsigned int i = 0; i < candPtrs.size(); i++) {
397  isolationPFCands_.push_back(*candPtrs.at(i));
398  }
400 }
401 
403  if (!isPFTau() ) {//additional check with warning in pat::tau producer
404  return;
405  }
406  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedIsolationPFChargedHadrCands_;
407  for (unsigned int i = 0; i < candPtrs.size(); i++) {
408  isolationPFChargedHadrCands_.push_back(*candPtrs.at(i));
409  }
411 }
413  if (!isPFTau() ) {//additional check with warning in pat::tau producer
414  return;
415  }
416  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedIsolationPFNeutrHadrCands_;
417  for (unsigned int i = 0; i < candPtrs.size(); i++) {
418  isolationPFNeutralHadrCands_.push_back(*candPtrs.at(i));
419  }
421 }
423  if (!isPFTau() ) {//additional check with warning in pat::tau producer
424  return;
425  }
426  std::vector<reco::PFCandidatePtr> candPtrs = pfSpecific_[0].selectedIsolationPFGammaCands_;
427  for (unsigned int i = 0; i < candPtrs.size(); i++) {
428  isolationPFGammaCands_.push_back(*candPtrs.at(i));
429  }
431 }
432 
434  if(!isPFTau() ) throw cms::Exception("Type Error") << "Requesting content that is not stored in miniAOD.\n";
435  if ( pfSpecific().signalTauChargedHadronCandidates_.size() > 0 ) {
436  return reco::PFRecoTauChargedHadronRef(&pfSpecific().signalTauChargedHadronCandidates_,0);
437  } else {
439  }
440 }
441 
444  if(pfSpecific_.empty()) return reco::PFCandidatePtr();
445  else return pfSpecific().leadPFChargedHadrCand_;
446  }else
448 }
449 
452  if(pfSpecific_.empty()) return reco::PFCandidatePtr();
453  else return pfSpecific().leadPFNeutralCand_;
454  }else
456 }
457 
459  if(!embeddedLeadPFCand_){
460  if(pfSpecific_.empty()) return reco::PFCandidatePtr();
461  return pfSpecific().leadPFCand_;
462  }else
464 }
465 
466 const std::vector<reco::PFCandidatePtr>& Tau::signalPFCands() const {
469  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
470  aPtrs->reserve(signalPFCands_.size());
471  for (unsigned int i = 0; i < signalPFCands_.size(); i++) {
472  aPtrs->push_back(reco::PFCandidatePtr(&signalPFCands_, i) );
473  }
474  signalPFCandsTransientPtrs_.set(std::move(aPtrs));
475  }
477  } else {
478  if(pfSpecific_.empty() || pfSpecific().selectedSignalPFCands_.empty() || !pfSpecific().selectedSignalPFCands_.front().isAvailable()){
479  // this part of code is called when reading from patTuple or miniAOD
480  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
481  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
482  signalPFCandsTransientPtrs_.set(std::move(aPtrs));
484  } else return pfSpecific().selectedSignalPFCands_;
485  }
486 }
487 
488 const std::vector<reco::PFCandidatePtr>& Tau::signalPFChargedHadrCands() const {
491  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{ new std::vector<reco::PFCandidatePtr>{}};
492  aPtrs->reserve(signalPFChargedHadrCands_.size());
493  for (unsigned int i = 0; i < signalPFChargedHadrCands_.size(); i++) {
494  aPtrs->push_back(reco::PFCandidatePtr(&signalPFChargedHadrCands_, i) );
495  }
497  }
499  } else {
500  if(pfSpecific_.empty() || pfSpecific().selectedSignalPFChargedHadrCands_.empty() || !pfSpecific().selectedSignalPFChargedHadrCands_.front().isAvailable()){
501  // this part of code is called when reading from patTuple or miniAOD
502  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
503  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
507  }
508 }
509 
510 const std::vector<reco::PFCandidatePtr>& Tau::signalPFNeutrHadrCands() const {
513  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
514  aPtrs->reserve(signalPFNeutralHadrCands_.size());
515  for (unsigned int i = 0; i < signalPFNeutralHadrCands_.size(); i++) {
516  aPtrs->push_back(reco::PFCandidatePtr(&signalPFNeutralHadrCands_, i) );
517  }
519  }
521  } else {
522  if(pfSpecific_.empty() || pfSpecific().selectedSignalPFNeutrHadrCands_.empty() || !pfSpecific().selectedSignalPFNeutrHadrCands_.front().isAvailable()){
523  // this part of code is called when reading from patTuple or miniAOD
524  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
525  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
529  }
530 }
531 
532 const std::vector<reco::PFCandidatePtr>& Tau::signalPFGammaCands() const {
535  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{ new std::vector<reco::PFCandidatePtr>{}};
536  aPtrs->reserve(signalPFGammaCands_.size());
537  for (unsigned int i = 0; i < signalPFGammaCands_.size(); i++) {
538  aPtrs->push_back(reco::PFCandidatePtr(&signalPFGammaCands_, i) );
539  }
540  signalPFGammaCandsTransientPtrs_.set(std::move(aPtrs));
541  }
543  } else {
544  if(pfSpecific_.empty() || pfSpecific().selectedSignalPFGammaCands_.empty() || !pfSpecific().selectedSignalPFGammaCands_.front().isAvailable()){
545  // this part of code is called when reading from patTuple or miniAOD
546  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
547  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
548  signalPFGammaCandsTransientPtrs_.set(std::move(aPtrs));
550  } else return pfSpecific().selectedSignalPFGammaCands_;
551  }
552 }
553 
554 const std::vector<reco::PFRecoTauChargedHadron> & Tau::signalTauChargedHadronCandidates() const {
555  if(pfSpecific_.empty()) throw cms::Exception("Type Error") << "Requesting content that is not stored in miniAOD.\n";
557 }
558 
559 const std::vector<reco::RecoTauPiZero> & Tau::signalPiZeroCandidates() const {
560  if(pfSpecific_.empty()) throw cms::Exception("Type Error") << "Requesting content that is not stored in miniAOD.\n";
562 }
563 
564 const std::vector<reco::PFCandidatePtr>& Tau::isolationPFCands() const {
567  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{ new std::vector<reco::PFCandidatePtr>{}};
568  aPtrs->reserve(isolationPFCands_.size());
569  for (unsigned int i = 0; i < isolationPFCands_.size(); i++) {
570  aPtrs->push_back(reco::PFCandidatePtr(&isolationPFCands_, i) );
571  }
572  isolationPFCandsTransientPtrs_.set(std::move(aPtrs));
573  }
575  } else {
576  if(pfSpecific_.empty() || pfSpecific().selectedIsolationPFCands_.empty() || !pfSpecific().selectedIsolationPFCands_.front().isAvailable()){
577  // this part of code is called when reading from patTuple or miniAOD
578  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
579  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
580  isolationPFCandsTransientPtrs_.set(std::move(aPtrs));
582  } else return pfSpecific().selectedIsolationPFCands_;
583  }
584 }
585 
586 const std::vector<reco::PFCandidatePtr>& Tau::isolationPFChargedHadrCands() const {
589  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{ new std::vector<reco::PFCandidatePtr>{}};
590  aPtrs->reserve(isolationPFChargedHadrCands_.size());
591  for (unsigned int i = 0; i < isolationPFChargedHadrCands_.size(); i++) {
593  }
595  }
597  } else {
599  // this part of code is called when reading from patTuple or miniAOD
600  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
601  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
605  }
606 }
607 
608 const std::vector<reco::PFCandidatePtr>& Tau::isolationPFNeutrHadrCands() const {
611  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{ new std::vector<reco::PFCandidatePtr>{}};
612  aPtrs->reserve(isolationPFNeutralHadrCands_.size());
613  for (unsigned int i = 0; i < isolationPFNeutralHadrCands_.size(); i++) {
615  }
617  }
619  } else {
621  // this part of code is called when reading from patTuple or miniAOD
622  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
623  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
627  }
628 }
629 
630 const std::vector<reco::PFCandidatePtr>& Tau::isolationPFGammaCands() const {
633  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
634  aPtrs->reserve(isolationPFGammaCands_.size());
635  for (unsigned int i = 0; i < isolationPFGammaCands_.size(); i++) {
636  aPtrs->push_back(reco::PFCandidatePtr(&isolationPFGammaCands_, i) );
637  }
638  isolationPFGammaCandsTransientPtrs_.set(std::move(aPtrs));
639  }
641  } else {
642  if(pfSpecific_.empty() || pfSpecific().selectedIsolationPFGammaCands_.empty() || !pfSpecific().selectedIsolationPFGammaCands_.front().isAvailable()){
643  // this part of code is called when reading from patTuple or miniAOD
644  // it returns empty collection in correct format so it can be substituted by reco::Candidates if available
645  std::unique_ptr<std::vector<reco::PFCandidatePtr> > aPtrs{new std::vector<reco::PFCandidatePtr>{}};
646  isolationPFGammaCandsTransientPtrs_.set(std::move(aPtrs));
649  }
650 }
651 
652 const std::vector<reco::PFRecoTauChargedHadron> & Tau::isolationTauChargedHadronCandidates() const {
653  if(pfSpecific_.empty()) throw cms::Exception("Type Error") << "Requesting content that is not stored in miniAOD.\n";
655 }
656 
657 const std::vector<reco::RecoTauPiZero> & Tau::isolationPiZeroCandidates() const {
658  if(pfSpecific_.empty()) throw cms::Exception("Type Error") << "Requesting content that is not stored in miniAOD.\n";
660 }
661 
664 
665 // initialize the jet to a given JEC level during creation starting from Uncorrected
666 void Tau::initializeJEC(unsigned int level, unsigned int set)
667 {
668  currentJECSet(set);
669  currentJECLevel(level);
670  setP4(jec_[set].correction(level)*p4());
671 }
672 
674 int Tau::jecSet(const std::string& set) const
675 {
676  for ( std::vector<pat::TauJetCorrFactors>::const_iterator corrFactor = jec_.begin();
677  corrFactor != jec_.end(); ++corrFactor ) {
678  if ( corrFactor->jecSet() == set ) return corrFactor-jec_.begin();
679  }
680  return -1;
681 }
682 
684 const std::vector<std::string> Tau::availableJECSets() const
685 {
686  std::vector<std::string> sets;
687  for ( std::vector<pat::TauJetCorrFactors>::const_iterator corrFactor = jec_.begin();
688  corrFactor != jec_.end(); ++corrFactor ) {
689  sets.push_back(corrFactor->jecSet());
690  }
691  return sets;
692 }
693 
694 const std::vector<std::string> Tau::availableJECLevels(const int& set) const
695 {
696  return set>=0 ? jec_.at(set).correctionLabels() : std::vector<std::string>();
697 }
698 
701 float Tau::jecFactor(const std::string& level, const std::string& set) const
702 {
703  for ( unsigned int idx = 0; idx < jec_.size(); ++idx ) {
704  if ( set.empty() || jec_.at(idx).jecSet() == set ){
705  if ( jec_[idx].jecLevel(level) >= 0 )
706  return jecFactor(jec_[idx].jecLevel(level), idx);
707  else
708  throw cms::Exception("InvalidRequest")
709  << "This JEC level " << level << " does not exist. \n";
710  }
711  }
712  throw cms::Exception("InvalidRequest")
713  << "This jet does not carry any jet energy correction factor information \n"
714  << "for a jet energy correction set with label " << set << "\n";
715 }
716 
719 float Tau::jecFactor(const unsigned int& level, const unsigned int& set) const
720 {
721  if ( !jecSetsAvailable() )
722  throw cms::Exception("InvalidRequest")
723  << "This jet does not carry any jet energy correction factor information \n";
724  if ( !jecSetAvailable(set) )
725  throw cms::Exception("InvalidRequest")
726  << "This jet does not carry any jet energy correction factor information \n"
727  << "for a jet energy correction set with index " << set << "\n";
728  return jec_.at(set).correction(level)/jec_.at(currentJECSet_).correction(currentJECLevel_);
729 }
730 
734 {
735  // rescale p4 of the jet; the update of current values is
736  // done within the called jecFactor function
737  for ( unsigned int idx = 0; idx < jec_.size(); ++idx ) {
738  if ( set.empty() || jec_.at(idx).jecSet() == set ) {
739  if ( jec_[idx].jecLevel(level) >= 0 )
740  return correctedTauJet(jec_[idx].jecLevel(level), idx);
741  else
742  throw cms::Exception("InvalidRequest")
743  << "This JEC level " << level << " does not exist. \n";
744  }
745  }
746  throw cms::Exception("InvalidRequest")
747  << "This JEC set " << set << " does not exist. \n";
748 }
749 
752 Tau Tau::correctedTauJet(const unsigned int& level, const unsigned int& set) const
753 {
754  Tau correctedTauJet(*this);
755  //rescale p4 of the jet
756  correctedTauJet.setP4(jecFactor(level, set)*p4());
757  // update current level and set
758  correctedTauJet.currentJECSet(set);
759  correctedTauJet.currentJECLevel(level);
760  return correctedTauJet;
761 }
762 
763 
764 
767 // return the leading candidate from signal(PF)ChargedHadrCandPtrs_ collection
770  if (leadPF.isAvailable() || signalChargedHadrCandPtrs_.isNull()) return leadPF;
773  if (ret.isNull() || (p->pt() > ret->pt())) ret = p;
774  }
775  return ret;
776 
777 }
778 
781  const reco::PFCandidatePtr leadPF = leadPFNeutralCand();
782  if (leadPF.isAvailable() || signalNeutralHadrCandPtrs_.isNull()) return leadPF;
785  if (ret.isNull() || (p->pt() > ret->pt())) ret = p;
786  }
787  return ret;
788 
789 }
790 
793  const reco::PFCandidatePtr leadPF = leadPFCand();
794  if (leadPF.isAvailable() || !Tau::ExistSignalCands()) return leadPF;
795  else return Tau::signalCands()[0];
796 }
797 
799 
800 bool Tau::ExistSignalCands() const {
802 }
803 
806 }
807 
810 
812  std::vector<reco::PFCandidatePtr> r0 = signalPFCands();
814  if(!Tau::ExistSignalCands() || (!r0.empty() && r0.front().isAvailable())) {
815  for (const auto & p : r0) ret.push_back(p);
816  return ret;
817  } else {
820  std::vector<std::pair<float,size_t> > pt_index;
821  size_t index=0;
822  for (const auto & p : signalChargedHadrCandPtrs_){ ret2.push_back(p); pt_index.push_back(std::make_pair(p->pt(),index)); index++;}
823  for (const auto & p : signalNeutralHadrCandPtrs_){ ret2.push_back(p); pt_index.push_back(std::make_pair(p->pt(),index)); index++;}
824  for (const auto & p : signalGammaCandPtrs_){ ret2.push_back(p); pt_index.push_back(std::make_pair(p->pt(),index)); index++;}
825  std::sort(pt_index.begin(),pt_index.end(),
826  boost::bind(&std::pair<float,size_t>::first,_1) >
827  boost::bind(&std::pair<float,size_t>::first,_2));
828  for( const auto & p : pt_index){
829  ret.push_back(ret2[p.second]);
830  }
831  return ret;
832  }
833 }
834 
838  std::vector<reco::PFCandidatePtr> r0 = signalPFChargedHadrCands();
839  if(signalChargedHadrCandPtrs_.isNull() || (!r0.empty() && r0.front().isAvailable())) {
841  for (const auto & p : r0) ret.push_back(p);
842  return ret;
843  } else {
845  }
846 }
847 
848 
852  std::vector<reco::PFCandidatePtr> r0 = signalPFNeutrHadrCands();
853  if(signalNeutralHadrCandPtrs_.isNull() || (!r0.empty() && r0.front().isAvailable())) {
855  for (const auto & p : r0) ret.push_back(p);
856  return ret;
857  } else {
859  }
860 }
861 
865  std::vector<reco::PFCandidatePtr> r0 = signalPFGammaCands();
866  if(signalGammaCandPtrs_.isNull() || (!r0.empty() && r0.front().isAvailable())) {
868  for (const auto & p : r0) ret.push_back(p);
869  return ret;
870  } else {
871  return signalGammaCandPtrs_;
872  }
873 }
874 
878  std::vector<reco::PFCandidatePtr> r0 = isolationPFCands();
880  if(!Tau::ExistIsolationCands() || (!r0.empty() && r0.front().isAvailable())) {
881  for (const auto & p : r0) ret.push_back(p);
882  return ret;
883  } else {
886  std::vector<std::pair<float,size_t> > pt_index;
887  size_t index=0;
888  for (const auto & p : isolationChargedHadrCandPtrs_){ ret2.push_back(p); pt_index.push_back(std::make_pair(p->pt(),index)); index++;}
889  for (const auto & p : isolationNeutralHadrCandPtrs_){ ret2.push_back(p); pt_index.push_back(std::make_pair(p->pt(),index)); index++;}
890  for (const auto & p : isolationGammaCandPtrs_){ ret2.push_back(p); pt_index.push_back(std::make_pair(p->pt(),index)); index++;}
891  std::sort(pt_index.begin(),pt_index.end(),
892  boost::bind(&std::pair<float,size_t>::first,_1) >
893  boost::bind(&std::pair<float,size_t>::first,_2));
894  for( const auto & p : pt_index){
895  ret.push_back(ret2[p.second]);
896  }
897  return ret;
898  }
899 }
900 
904  std::vector<reco::PFCandidatePtr> r0 = isolationPFChargedHadrCands();
905  if(isolationChargedHadrCandPtrs_.isNull() || (!r0.empty() && r0.front().isAvailable())) {
907  for (const auto & p : r0) ret.push_back(p);
908  return ret;
909  } else {
911  }
912 }
913 
918  std::vector<reco::PFCandidatePtr> r0 = isolationPFNeutrHadrCands();
919  if(isolationNeutralHadrCandPtrs_.isNull() || (!r0.empty() && r0.front().isAvailable())) {
921  for (const auto & p : r0) ret.push_back(p);
922  return ret;
923  } else {
925  }
926 }
927 
931  std::vector<reco::PFCandidatePtr> r0 = isolationPFGammaCands();
932  if(isolationGammaCandPtrs_.isNull() || (!r0.empty() && r0.front().isAvailable())) {
934  for (const auto & p : r0) ret.push_back(p);
935  return ret;
936  } else {
938  }
939 }
940 
941 
942 
946  if (Tau::ExistSignalCands()) return Tau::signalCands().size();
947  else if(pfSpecific_.empty()) return 0;
948  else return pfSpecific().selectedSignalPFCands_.size();
949 }
952  if (Tau::ExistSignalCands()) return Tau::signalCands()[i];
953  else if(pfSpecific_.empty()) return reco::CandidatePtr();
954  else return pfSpecific().selectedSignalPFCands_[i];
955 }
956 
957 
958 
959 
const std::vector< reco::RecoTauPiZero > & signalPiZeroCandidates() const
Definition: Tau.cc:559
bool embeddedLeadPFNeutralCand_
Definition: Tau.h:442
virtual reco::TrackRef leadTrack() const
Definition: BaseTau.cc:26
int i
Definition: DBlmapReader.cc:9
virtual double p() const
magnitude of momentum vector
edm::AtomicPtrCache< reco::TrackRefVector > signalTracksTransientRefVector_
Definition: Tau.h:435
reco::CandidatePtrVector isolationGammaCandPtrs_
Definition: Tau.h:501
size_type size() const
Size of the RefVector.
Definition: PtrVectorBase.h:73
reco::PFTauTransverseImpactParameter::CovMatrix flightLengthCov() const
Definition: Tau.cc:276
virtual float pt() const
transverse momentum
size_t size_type
Definition: Candidate.h:34
bool embeddedSignalPFChargedHadrCands_
Definition: Tau.h:448
std::vector< reco::PFCandidatePtr > selectedIsolationPFChargedHadrCands_
Definition: TauPFSpecific.h:39
std::vector< reco::PFCandidate > leadPFNeutralCand_
Definition: Tau.h:441
bool isNull() const
Checks for null.
Definition: PtrVectorBase.h:46
reco::PFCandidatePtr leadPFCand_
Definition: TauPFSpecific.h:31
edm::AtomicPtrCache< std::vector< reco::PFCandidatePtr > > isolationPFChargedHadrCandsTransientPtrs_
Definition: Tau.h:461
virtual const reco::TrackRefVector & isolationTracks() const
Definition: BaseTau.cc:30
std::vector< reco::PFCandidate > signalPFNeutralHadrCands_
Definition: Tau.h:450
reco::CandidatePtrVector signalNeutrHadrCands() const
Definition: Tau.cc:851
const pat::tau::TauCaloSpecific & caloSpecific() const
return CaloTau info or throw exception &#39;not CaloTau&#39;
Definition: Tau.cc:258
std::vector< reco::PFCandidate > signalPFCands_
Definition: Tau.h:444
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:138
virtual float phi() const
momentum azimuthal angle
edm::AtomicPtrCache< std::vector< reco::PFCandidatePtr > > signalPFNeutralHadrCandsTransientPtrs_
Definition: Tau.h:452
bool embeddedIsolationPFChargedHadrCands_
Definition: Tau.h:460
bool jecSetAvailable(const std::string &set) const
Definition: Tau.h:373
bool embeddedIsolationPFCands_
Definition: Tau.h:457
void embedLeadPFChargedHadrCand()
method to store the leading charged hadron candidate internally
Definition: Tau.cc:328
reco::PFCandidatePtr leadPFChargedHadrCand_
Definition: TauPFSpecific.h:28
std::vector< reco::PFCandidate > isolationPFGammaCands_
Definition: Tau.h:465
std::vector< reco::PFCandidate > isolationPFNeutralHadrCands_
Definition: Tau.h:462
edm::AtomicPtrCache< std::vector< reco::PFCandidatePtr > > isolationPFGammaCandsTransientPtrs_
Definition: Tau.h:467
const reco::PFCandidatePtr leadPFCand() const
Definition: Tau.cc:458
virtual void setP4(const LorentzVector &p4)
set 4-momentum
void embedSignalPFGammaCands()
method to store the signal gamma candidates internally
Definition: Tau.cc:380
std::vector< reco::GenJet > genJet_
Definition: Tau.h:470
reco::CandidatePtrVector signalCands() const
Definition: Tau.cc:811
void embedIsolationPFCands()
method to store the isolation candidates internally
Definition: Tau.cc:391
void embedIsolationPFGammaCands()
method to store the isolation gamma candidates internally
Definition: Tau.cc:422
const reco::GenJet * genJet() const
return matched GenJet, built from the visible particles of a generated tau
Definition: Tau.cc:219
const reco::Candidate::LorentzVector & p4Jet() const
Definition: Tau.cc:263
const std::vector< std::string > availableJECSets() const
all available label-names of all sets of jet energy corrections
Definition: Tau.cc:684
edm::AtomicPtrCache< std::vector< reco::PFCandidatePtr > > signalPFCandsTransientPtrs_
Definition: Tau.h:446
reco::TrackRef leadTrack() const
override the reco::BaseTau::leadTrack method, to access the internal storage of the leading track ...
Definition: Tau.cc:153
bool embeddedIsolationPFNeutralHadrCands_
Definition: Tau.h:463
void embedSignalTracks()
method to store the signal tracks internally
Definition: Tau.cc:202
bool embeddedLeadTrack_
Definition: Tau.h:431
edm::AtomicPtrCache< std::vector< reco::PFCandidatePtr > > signalPFGammaCandsTransientPtrs_
Definition: Tau.h:455
const reco::CandidatePtr leadCand() const
return the PFCandidate if available (reference or embedded), or the PackedPFCandidate on miniAOD ...
Definition: Tau.cc:792
const std::vector< reco::PFCandidatePtr > & isolationPFChargedHadrCands() const
Definition: Tau.cc:586
const pat::tau::TauPFSpecific & pfSpecific() const
return PFTau info or throw exception &#39;not PFTau&#39;
Definition: Tau.cc:247
reco::CandidatePtrVector signalGammaCands() const
Definition: Tau.cc:864
float phiphiMoment() const
Definition: Tau.cc:296
std::vector< reco::PFCandidate > leadPFCand_
Definition: Tau.h:437
bool isSet() const
std::vector< reco::PFCandidatePtr > selectedIsolationPFNeutrHadrCands_
Definition: TauPFSpecific.h:40
bool embeddedSignalPFGammaCands_
Definition: Tau.h:454
float etaetaMoment() const
Definition: Tau.cc:289
int jecSet(const std::string &label) const
return true if this jet carries the jet correction factors of a different set, for systematic studies...
Definition: Tau.cc:674
std::vector< reco::PFRecoTauChargedHadron > isolationTauChargedHadronCandidates_
Definition: TauPFSpecific.h:42
void initializeJEC(unsigned int level, const unsigned int set=0)
initialize the jet to a given JEC level during creation starting from Uncorrected ...
Definition: Tau.cc:666
reco::CandidatePtr sourceCandidatePtr(size_type i) const
get the source candidate pointer with index i
Definition: Tau.cc:951
Tau correctedTauJet(const std::string &level, const std::string &set="") const
Definition: Tau.cc:733
unsigned int currentJECLevel_
Definition: Tau.h:492
edm::AtomicPtrCache< reco::TrackRefVector > isolationTracksTransientRefVector_
Definition: Tau.h:430
void embedSignalPFChargedHadrCands()
method to store the signal charged hadrons candidates internally
Definition: Tau.cc:360
reco::Candidate::LorentzVector p4Jet_
const reco::CandidatePtr leadChargedHadrCand() const
Definition: Tau.cc:768
std::vector< reco::PFRecoTauChargedHadron > signalTauChargedHadronCandidates_
Definition: TauPFSpecific.h:36
virtual double energy() const
energy
void embedSignalPFCands()
method to store the signal candidates internally
Definition: Tau.cc:350
reco::CandidatePtrVector isolationChargedHadrCandPtrs_
Definition: Tau.h:499
std::vector< reco::RecoTauPiZero > isolationPiZeroCandidates_
Definition: TauPFSpecific.h:43
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:71
std::vector< reco::Track > signalTracks_
Definition: Tau.h:434
std::vector< IdPair > tauIDs_
Definition: Tau.h:473
double dxy_Sig() const
Definition: Tau.cc:270
const std::vector< reco::PFRecoTauChargedHadron > & isolationTauChargedHadronCandidates() const
Definition: Tau.cc:652
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:143
edm::AtomicPtrCache< std::vector< reco::PFCandidatePtr > > signalPFChargedHadrCandsTransientPtrs_
Definition: Tau.h:449
std::vector< reco::RecoTauPiZero > signalPiZeroCandidates_
Definition: TauPFSpecific.h:37
bool embeddedIsolationPFGammaCands_
Definition: Tau.h:466
std::vector< reco::PFCandidate > signalPFChargedHadrCands_
Definition: Tau.h:447
bool ExistIsolationCands() const
Definition: Tau.cc:804
virtual float eta() const
momentum pseudorapidity
Tau()
default constructor
Definition: Tau.cc:13
const reco::PFTauTransverseImpactParameter::CovMatrix & secondaryVertexCov() const
Definition: Tau.h:327
void embedLeadTrack()
method to store the leading track internally
Definition: Tau.cc:192
Analysis-level lepton class.
Definition: Lepton.h:30
reco::CandidatePtrVector isolationChargedHadrCands() const
Definition: Tau.cc:903
const std::vector< reco::RecoTauPiZero > & isolationPiZeroCandidates() const
Definition: Tau.cc:657
const std::vector< reco::PFCandidatePtr > & isolationPFNeutrHadrCands() const
Definition: Tau.cc:608
const reco::PFTauTransverseImpactParameter::CovMatrix & primaryVertexCov() const
Definition: Tau.h:320
int j
Definition: DBlmapReader.cc:9
reco::CandidatePtrVector isolationNeutralHadrCandPtrs_
Definition: Tau.h:500
Jets made from MC generator particles.
Definition: GenJet.h:24
bool embeddedSignalTracks_
Definition: Tau.h:433
bool embeddedLeadPFCand_
Definition: Tau.h:438
std::vector< reco::PFCandidatePtr > selectedSignalPFChargedHadrCands_
Definition: TauPFSpecific.h:33
virtual const reco::TrackRefVector & signalTracks() const
Definition: BaseTau.cc:28
std::vector< pat::tau::TauPFEssential > pfEssential_
Definition: Tau.h:505
std::vector< reco::PFCandidatePtr > selectedSignalPFCands_
Definition: TauPFSpecific.h:32
unsigned int index
Definition: LeafCandidate.h:36
void reserve(size_type n)
Reserve space for RefVector.
Definition: RefVector.h:95
bool first
Definition: L1TdeRCT.cc:75
std::string currentJECLevel() const
return the name of the current step of jet energy corrections
Definition: Tau.h:382
Analysis-level tau class.
Definition: Tau.h:56
bool embeddedLeadPFChargedHadrCand_
Definition: Tau.h:440
void embedIsolationPFNeutralHadrCands()
method to store the isolation neutral hadrons candidates internally
Definition: Tau.cc:412
const std::vector< reco::PFCandidatePtr > & signalPFChargedHadrCands() const
Definition: Tau.cc:488
bool embeddedSignalPFNeutralHadrCands_
Definition: Tau.h:451
std::vector< reco::PFCandidate > isolationPFCands_
Definition: Tau.h:456
std::vector< reco::Track > isolationTracks_
Definition: Tau.h:429
bool isTauIDAvailable(const std::string &name) const
Returns true if a specific ID is available in this pat::Tau.
Definition: Tau.cc:239
tuple out
Definition: dbtoconf.py:99
void embedLeadPFNeutralCand()
method to store the leading neutral candidate internally
Definition: Tau.cc:339
std::vector< pat::tau::TauCaloSpecific > caloSpecific_
holder for CaloTau info, or empty vector if PFTau
Definition: Tau.h:481
unsigned int index
index type
Definition: Candidate.h:55
std::vector< reco::PFCandidatePtr > selectedIsolationPFGammaCands_
Definition: TauPFSpecific.h:41
bool isCaloTau() const
Returns true if this pat::Tau was made from a reco::CaloTau.
Definition: Tau.h:125
const pat::tau::TauPFEssential & pfEssential() const
Definition: Tau.cc:252
std::vector< reco::PFCandidatePtr > selectedIsolationPFCands_
Definition: TauPFSpecific.h:38
reco::PFCandidatePtr leadPFNeutralCand_
Definition: TauPFSpecific.h:30
bool ExistSignalCands() const
check that there is at least one non-zero collection of candidate ptrs
Definition: Tau.cc:800
reco::CandidatePtrVector signalGammaCandPtrs_
Definition: Tau.h:497
int decayMode() const
reconstructed tau decay mode (specific to PFTau)
Definition: Tau.h:337
bool set(std::unique_ptr< T > iNewValue) const
const std::vector< reco::PFCandidatePtr > & isolationPFGammaCands() const
Definition: Tau.cc:630
std::vector< reco::PFCandidatePtr > selectedSignalPFGammaCands_
Definition: TauPFSpecific.h:35
const std::vector< reco::PFRecoTauChargedHadron > & signalTauChargedHadronCandidates() const
Definition: Tau.cc:554
std::vector< pat::TauJetCorrFactors > jec_
Definition: Tau.h:487
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:14
edm::AtomicPtrCache< std::vector< reco::PFCandidatePtr > > isolationPFNeutralHadrCandsTransientPtrs_
Definition: Tau.h:464
std::vector< reco::PFCandidate > signalPFGammaCands_
Definition: Tau.h:453
void embedSignalPFNeutralHadrCands()
method to store the signal neutral hadrons candidates internally
Definition: Tau.cc:370
std::vector< reco::Track > leadTrack_
Definition: Tau.h:432
edm::Ref< PFRecoTauChargedHadronCollection > PFRecoTauChargedHadronRef
presistent reference to a PFRecoTauChargedHadron
reco::CandidatePtrVector signalChargedHadrCands() const
Definition: Tau.cc:837
std::vector< reco::PFCandidate > isolationPFChargedHadrCands_
Definition: Tau.h:459
size_t numberOfSourceCandidatePtrs() const
Definition: Tau.cc:945
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
float jecFactor(const std::string &level, const std::string &set="") const
Definition: Tau.cc:701
bool jecSetsAvailable() const
Definition: Tau.h:370
void setDecayMode(int)
set decay mode
Definition: Tau.cc:310
float etaphiMoment() const
Definition: Tau.cc:303
std::vector< reco::PFCandidatePtr > selectedSignalPFNeutrHadrCands_
Definition: TauPFSpecific.h:34
reco::PFRecoTauChargedHadronRef leadTauChargedHadronCandidate() const
Definition: Tau.cc:433
reco::CandidatePtrVector signalNeutralHadrCandPtrs_
Definition: Tau.h:496
void embedIsolationPFChargedHadrCands()
method to store the isolation charged hadrons candidates internally
Definition: Tau.cc:402
bool isNull() const
Checks for null.
Definition: Ptr.h:148
value_type const at(size_type idx) const
Retrieve an element of the RefVector.
Definition: RefVector.h:76
bool embeddedSignalPFCands_
Definition: Tau.h:445
const reco::PFCandidatePtr leadPFChargedHadrCand() const
Definition: Tau.cc:442
const std::vector< reco::PFCandidatePtr > & signalPFCands() const
Definition: Tau.cc:466
const std::vector< std::string > availableJECLevels(const int &set=0) const
Definition: Tau.cc:694
const std::vector< reco::PFCandidatePtr > & signalPFGammaCands() const
Definition: Tau.cc:532
reco::CandidatePtrVector isolationCands() const
Definition: Tau.cc:877
const std::vector< reco::PFCandidatePtr > & signalPFNeutrHadrCands() const
Definition: Tau.cc:510
size_type size() const
Size of the RefVector.
Definition: RefVector.h:89
bool isPFTau() const
Returns true if this pat::Tau was made from a reco::PFTau.
Definition: Tau.h:158
bool isAvailable() const
Definition: Ptr.h:158
float tauID(const std::string &name) const
Definition: Tau.cc:225
void setGenJet(const reco::GenJetRef &ref)
set the matched GenJet
Definition: Tau.cc:213
bool embeddedIsolationTracks_
Definition: Tau.h:428
const reco::PFCandidatePtr leadPFNeutralCand() const
Definition: Tau.cc:450
reco::CandidatePtrVector isolationGammaCands() const
Definition: Tau.cc:930
tuple level
Definition: testEve_cfg.py:34
void embedIsolationTracks()
method to store the isolation tracks internally
Definition: Tau.cc:181
volatile std::atomic< bool > shutdown_flag false
edm::AtomicPtrCache< std::vector< reco::PFCandidatePtr > > isolationPFCandsTransientPtrs_
Definition: Tau.h:458
const reco::TrackRefVector & signalTracks() const
override the reco::BaseTau::signalTracks method, to access the internal storage of the signal tracks ...
Definition: Tau.cc:163
std::vector< reco::PFCandidate > leadPFChargedHadrCand_
Definition: Tau.h:439
std::string currentJECSet() const
returns the label of the current set of jet energy corrections
Definition: Tau.h:378
virtual ~Tau()
destructor
Definition: Tau.cc:114
edm::Ptr< PFCandidate > PFCandidatePtr
persistent Ptr to a PFCandidate
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
reco::CandidatePtrVector isolationNeutrHadrCands() const
Definition: Tau.cc:916
void embedLeadPFCand()
method to store the leading candidate internally
Definition: Tau.cc:317
value_type const * get() const
Definition: RefToBase.h:212
const reco::CandidatePtr leadNeutralCand() const
return the PFCandidate if available (reference or embedded), or the PackedPFCandidate on miniAOD ...
Definition: Tau.cc:780
const std::vector< reco::PFCandidatePtr > & isolationPFCands() const
Definition: Tau.cc:564
std::vector< pat::tau::TauPFSpecific > pfSpecific_
holder for PFTau info, or empty vector if CaloTau
Definition: Tau.h:477
const reco::TrackRefVector & isolationTracks() const
override the reco::BaseTau::isolationTracks method, to access the internal storage of the isolation t...
Definition: Tau.cc:135
reco::Candidate::LorentzVector p4Jet_
reco::CandidatePtrVector signalChargedHadrCandPtrs_
Definition: Tau.h:495
unsigned int currentJECSet_
Definition: Tau.h:490