#include <PhysicsTools/PatUtils/interface/PATDiObjectProxy.h>
Public Member Functions | |
const reco::Candidate & | cand1 () const |
Gets the first Candidate. | |
const reco::Candidate & | cand2 () const |
Gets the second Candidate. | |
double | deltaPhi () const |
Get the phi separation. | |
double | deltaR () const |
Get the angular separation. | |
DiObjectProxy (const reco::Candidate &c1, const reco::Candidate &c2) | |
Constructor of the pair from two Candidates Note: the Proxy MUST NOT outlive the Candidates, otherwise you get dangling pointers. | |
DiObjectProxy () | |
Default constructor, requested by ROOT. NEVER use a default constructed item! | |
const Electron & | ele () const |
Get the PAT Electron, if the pair contains one and only one PAT Electron (throw exception otherwise). | |
const Electron & | ele1 () const |
Get the first item, if it's a PAT Electron (throw exception otherwise). | |
const Electron & | ele2 () const |
Get the second item, if it's a PAT Electron (throw exception otherwise). | |
const Photon & | gam () const |
Get the PAT Photon, if the pair contains one and only one PAT Photon (throw exception otherwise). | |
const Photon & | gam1 () const |
Get the first item, if it's a PAT Photon (throw exception otherwise). | |
const Photon & | gam2 () const |
Get the second item, if it's a PAT Photon (throw exception otherwise). | |
const Jet & | jet () const |
Get the PAT Jet, if the pair contains one and only one PAT Jet (throw exception otherwise). | |
const Jet & | jet1 () const |
Get the first item, if it's a PAT Jet (throw exception otherwise). | |
const Jet & | jet2 () const |
Get the second item, if it's a PAT Jet (throw exception otherwise). | |
const MET & | met () const |
Get the PAT MET, if the pair contains one and only one PAT MET (throw exception otherwise). | |
const MET & | met1 () const |
Get the first item, if it's a PAT MET (throw exception otherwise). | |
const MET & | met2 () const |
Get the second item, if it's a PAT MET (throw exception otherwise). | |
const Muon & | mu () const |
Get the PAT Muon, if the pair contains one and only one PAT Muon (throw exception otherwise). | |
const Muon & | mu1 () const |
Get the first item, if it's a PAT Muon (throw exception otherwise). | |
const Muon & | mu2 () const |
Get the second item, if it's a PAT Muon (throw exception otherwise). | |
const GenericParticle & | part () const |
Get the PAT GenericParticle, if the pair contains one and only one PAT GenericParticle (throw exception otherwise). | |
const GenericParticle & | part1 () const |
Get the first item, if it's a PAT GenericParticle (throw exception otherwise). | |
const GenericParticle & | part2 () const |
Get the second item, if it's a PAT GenericParticle (throw exception otherwise). | |
const PFParticle & | pf () const |
Get the PAT PFParticle, if the pair contains one and only one PAT PFParticle (throw exception otherwise). | |
const PFParticle & | pf1 () const |
Get the first item, if it's a PAT PFParticle (throw exception otherwise). | |
const PFParticle & | pf2 () const |
Get the second item, if it's a PAT PFParticle (throw exception otherwise). | |
const Tau & | tau () const |
Get the PAT Tau, if the pair contains one and only one PAT Tau (throw exception otherwise). | |
const Tau & | tau1 () const |
Get the first item, if it's a PAT Tau (throw exception otherwise). | |
const Tau & | tau2 () const |
Get the second item, if it's a PAT Tau (throw exception otherwise). | |
const reco::Candidate::LorentzVector & | totalP4 () const |
Get the total four momentum. | |
Private Member Functions | |
template<typename T> | |
const T & | tryGet_ (const reco::Candidate *ptr, const std::type_info *type) const |
template<typename T> | |
const T & | tryGetOne_ () const |
Private Attributes | |
const reco::Candidate * | cand1_ |
const reco::Candidate * | cand2_ |
reco::Candidate::LorentzVector | totalP4_ |
edm::BoolCache | totalP4ok_ |
const std::type_info * | type1_ |
const std::type_info * | type2_ |
Definition at line 20 of file PATDiObjectProxy.h.
pat::DiObjectProxy::DiObjectProxy | ( | ) | [inline] |
pat::DiObjectProxy::DiObjectProxy | ( | const reco::Candidate & | c1, | |
const reco::Candidate & | c2 | |||
) | [inline] |
const reco::Candidate& pat::DiObjectProxy::cand1 | ( | ) | const [inline] |
Gets the first Candidate.
Definition at line 31 of file PATDiObjectProxy.h.
References cand1_.
00031 { return *cand1_; }
const reco::Candidate& pat::DiObjectProxy::cand2 | ( | ) | const [inline] |
Gets the second Candidate.
Definition at line 33 of file PATDiObjectProxy.h.
References cand2_.
00033 { return *cand2_; }
double pat::DiObjectProxy::deltaPhi | ( | ) | const [inline] |
Get the phi separation.
Definition at line 38 of file PATDiObjectProxy.h.
References cand1_, cand2_, deltaPhi(), and reco::Particle::phi().
00038 { return ::deltaPhi(cand1_->phi(), cand2_->phi()); }
double pat::DiObjectProxy::deltaR | ( | ) | const [inline] |
Get the angular separation.
Definition at line 36 of file PATDiObjectProxy.h.
References cand1_, cand2_, and deltaR().
00036 { return ::deltaR(*cand1_, *cand2_); }
const Electron& pat::DiObjectProxy::ele | ( | ) | const [inline] |
Get the PAT Electron, if the pair contains one and only one PAT Electron (throw exception otherwise).
Definition at line 52 of file PATDiObjectProxy.h.
const Electron& pat::DiObjectProxy::ele1 | ( | ) | const [inline] |
const Electron& pat::DiObjectProxy::ele2 | ( | ) | const [inline] |
const Photon& pat::DiObjectProxy::gam | ( | ) | const [inline] |
Get the PAT Photon, if the pair contains one and only one PAT Photon (throw exception otherwise).
Definition at line 58 of file PATDiObjectProxy.h.
const Photon& pat::DiObjectProxy::gam1 | ( | ) | const [inline] |
const Photon& pat::DiObjectProxy::gam2 | ( | ) | const [inline] |
Get the PAT Jet, if the pair contains one and only one PAT Jet (throw exception otherwise).
Definition at line 60 of file PATDiObjectProxy.h.
const Jet& pat::DiObjectProxy::jet1 | ( | ) | const [inline] |
const Jet& pat::DiObjectProxy::jet2 | ( | ) | const [inline] |
const MET& pat::DiObjectProxy::met | ( | ) | const [inline] |
Get the PAT MET, if the pair contains one and only one PAT MET (throw exception otherwise).
Definition at line 62 of file PATDiObjectProxy.h.
const MET& pat::DiObjectProxy::met1 | ( | ) | const [inline] |
const MET& pat::DiObjectProxy::met2 | ( | ) | const [inline] |
const Muon& pat::DiObjectProxy::mu | ( | ) | const [inline] |
Get the PAT Muon, if the pair contains one and only one PAT Muon (throw exception otherwise).
Definition at line 54 of file PATDiObjectProxy.h.
const Muon& pat::DiObjectProxy::mu1 | ( | ) | const [inline] |
const Muon& pat::DiObjectProxy::mu2 | ( | ) | const [inline] |
const GenericParticle& pat::DiObjectProxy::part | ( | ) | const [inline] |
Get the PAT GenericParticle, if the pair contains one and only one PAT GenericParticle (throw exception otherwise).
Definition at line 64 of file PATDiObjectProxy.h.
const GenericParticle& pat::DiObjectProxy::part1 | ( | ) | const [inline] |
Get the first item, if it's a PAT GenericParticle (throw exception otherwise).
Definition at line 81 of file PATDiObjectProxy.h.
References cand1_, and type1_.
const GenericParticle& pat::DiObjectProxy::part2 | ( | ) | const [inline] |
Get the second item, if it's a PAT GenericParticle (throw exception otherwise).
Definition at line 98 of file PATDiObjectProxy.h.
References cand2_, and type2_.
const PFParticle& pat::DiObjectProxy::pf | ( | ) | const [inline] |
Get the PAT PFParticle, if the pair contains one and only one PAT PFParticle (throw exception otherwise).
Definition at line 66 of file PATDiObjectProxy.h.
const PFParticle& pat::DiObjectProxy::pf1 | ( | ) | const [inline] |
Get the first item, if it's a PAT PFParticle (throw exception otherwise).
Definition at line 83 of file PATDiObjectProxy.h.
References cand1_, and type1_.
const PFParticle& pat::DiObjectProxy::pf2 | ( | ) | const [inline] |
Get the second item, if it's a PAT PFParticle (throw exception otherwise).
Definition at line 100 of file PATDiObjectProxy.h.
References cand2_, and type2_.
const Tau& pat::DiObjectProxy::tau | ( | ) | const [inline] |
Get the PAT Tau, if the pair contains one and only one PAT Tau (throw exception otherwise).
Definition at line 56 of file PATDiObjectProxy.h.
const Tau& pat::DiObjectProxy::tau1 | ( | ) | const [inline] |
const Tau& pat::DiObjectProxy::tau2 | ( | ) | const [inline] |
const reco::Candidate::LorentzVector& pat::DiObjectProxy::totalP4 | ( | ) | const [inline] |
Get the total four momentum.
Definition at line 43 of file PATDiObjectProxy.h.
References cand1_, cand2_, reco::Particle::p4(), totalP4_, and totalP4ok_.
00043 { 00044 if (!totalP4ok_) { 00045 totalP4_ = cand1_->p4() + cand2_->p4(); 00046 totalP4ok_ = true; 00047 } 00048 return totalP4_; 00049 }
const T& pat::DiObjectProxy::tryGet_ | ( | const reco::Candidate * | ptr, | |
const std::type_info * | type | |||
) | const [inline, private] |
Definition at line 105 of file PATDiObjectProxy.h.
References cand1_, className(), and Exception.
00105 { 00106 if (typeid(T) != *type) { 00107 throw cms::Exception("Type Error") << "pat::DiObjectProxy: the object of the pair is not of the type you request.\n" 00108 << " Item Index in pair: " << (ptr == cand1_ ? "first" : "second") << "\n" 00109 << " Requested TypeID : " << ClassName<T>::name() << "\n" 00110 << " Found TypeID : " << className(*ptr) << "\n"; 00111 } 00112 return static_cast<const T &>(*ptr); 00113 }
const T& pat::DiObjectProxy::tryGetOne_ | ( | ) | const [inline, private] |
Definition at line 116 of file PATDiObjectProxy.h.
References cand1_, cand2_, className(), Exception, ClassName< T >::name(), type1_, and type2_.
00116 { 00117 if (typeid(T) == *type1_) { 00118 if (typeid(T) == *type2_) { 00119 throw cms::Exception("Type Error") << "pat::DiObjectProxy: " << 00120 "you can't get use methods that get a particle by type if the two are of the same type!\n" << 00121 " Requested Type:" << ClassName<T>::name() << "\n"; 00122 } 00123 return static_cast<const T &>(*cand1_); 00124 } else { 00125 if (typeid(T) != *type2_) { 00126 throw cms::Exception("Type Error") << "pat::DiObjectProxy: " << 00127 "you can't get use methods that get a particle by type if neither of the two is of that type!\n" << 00128 " Requested Type:" << ClassName<T>::name() << "\n" << 00129 " Type of first :" << className(*cand1_) << "\n" << 00130 " Type of second:" << className(*cand2_) << "\n"; 00131 } 00132 return static_cast<const T &>(*cand2_); 00133 } 00134 }
const reco::Candidate* pat::DiObjectProxy::cand1_ [private] |
const reco::Candidate * pat::DiObjectProxy::cand2_ [private] |
Definition at line 136 of file PATDiObjectProxy.h.
Referenced by cand2(), deltaPhi(), deltaR(), ele2(), gam2(), jet2(), met2(), mu2(), part2(), pf2(), tau2(), totalP4(), and tryGetOne_().
reco::Candidate::LorentzVector pat::DiObjectProxy::totalP4_ [mutable, private] |
edm::BoolCache pat::DiObjectProxy::totalP4ok_ [mutable, private] |
const std::type_info* pat::DiObjectProxy::type1_ [private] |
const std::type_info * pat::DiObjectProxy::type2_ [private] |