#include <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) | |
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_.
{ return *cand1_; }
const reco::Candidate& pat::DiObjectProxy::cand2 | ( | ) | const [inline] |
Gets the second Candidate.
Definition at line 33 of file PATDiObjectProxy.h.
References cand2_.
{ return *cand2_; }
double pat::DiObjectProxy::deltaPhi | ( | ) | const [inline] |
Get the phi separation.
Definition at line 38 of file PATDiObjectProxy.h.
References cand1_, cand2_, and reco::Candidate::phi().
{ 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_, and cand2_.
{ 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.
{ return tryGetOne_<Electron>(); }
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.
{ return tryGetOne_<Photon>(); }
const Photon& pat::DiObjectProxy::gam1 | ( | ) | const [inline] |
const Photon& pat::DiObjectProxy::gam2 | ( | ) | const [inline] |
const Jet& pat::DiObjectProxy::jet | ( | void | ) | 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.
{ return tryGetOne_<Jet>(); }
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.
{ return tryGetOne_<MET>(); }
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.
{ return tryGetOne_<Muon>(); }
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.
{ return tryGetOne_<GenericParticle>(); }
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.
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.
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.
{ return tryGetOne_<PFParticle>(); }
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.
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.
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.
{ return tryGetOne_<Tau>(); }
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::Candidate::p4(), totalP4_, and totalP4ok_.
{ if (!totalP4ok_) { totalP4_ = cand1_->p4() + cand2_->p4(); totalP4ok_ = true; } return totalP4_; }
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.
{ if (typeid(T) != *type) { throw cms::Exception("Type Error") << "pat::DiObjectProxy: the object of the pair is not of the type you request.\n" << " Item Index in pair: " << (ptr == cand1_ ? "first" : "second") << "\n" << " Requested TypeID : " << ClassName<T>::name() << "\n" << " Found TypeID : " << className(*ptr) << "\n"; } return static_cast<const T &>(*ptr); }
const T& pat::DiObjectProxy::tryGetOne_ | ( | ) | const [inline, private] |
Definition at line 116 of file PATDiObjectProxy.h.
References cand1_, cand2_, className(), Exception, AlCaRecoCosmics_cfg::name, type1_, and type2_.
{ if (typeid(T) == *type1_) { if (typeid(T) == *type2_) { throw cms::Exception("Type Error") << "pat::DiObjectProxy: " << "you can't get use methods that get a particle by type if the two are of the same type!\n" << " Requested Type:" << ClassName<T>::name() << "\n"; } return static_cast<const T &>(*cand1_); } else { if (typeid(T) != *type2_) { throw cms::Exception("Type Error") << "pat::DiObjectProxy: " << "you can't get use methods that get a particle by type if neither of the two is of that type!\n" << " Requested Type:" << ClassName<T>::name() << "\n" << " Type of first :" << className(*cand1_) << "\n" << " Type of second:" << className(*cand2_) << "\n"; } return static_cast<const T &>(*cand2_); } }
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] |
Definition at line 140 of file PATDiObjectProxy.h.
Referenced by totalP4().
edm::BoolCache pat::DiObjectProxy::totalP4ok_ [mutable, private] |
Definition at line 139 of file PATDiObjectProxy.h.
Referenced by totalP4().
const std::type_info* pat::DiObjectProxy::type1_ [private] |
const std::type_info * pat::DiObjectProxy::type2_ [private] |