CMS 3D CMS Logo

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