1 #ifndef PhysicsTools_PatUtils_interface_PATDiObjectProxy_h 2 #define PhysicsTools_PatUtils_interface_PATDiObjectProxy_h 51 const Electron &
ele()
const {
return tryGetOne_<Electron>(); }
53 const Muon &
mu()
const {
return tryGetOne_<Muon>(); }
55 const Tau &
tau()
const {
return tryGetOne_<Tau>(); }
57 const Photon &
gam()
const {
return tryGetOne_<Photon>(); }
59 const Jet &
jet()
const {
return tryGetOne_<Jet>(); }
61 const MET &
met()
const {
return tryGetOne_<MET>(); }
105 if (
typeid(
T) != *type) {
106 throw cms::Exception(
"Type Error") <<
"pat::DiObjectProxy: the object of the pair is not of the type you request.\n" 107 <<
" Item Index in pair: " << (ptr ==
cand1_ ?
"first" :
"second") <<
"\n" 109 <<
" Found TypeID : " <<
className(*ptr) <<
"\n";
111 return static_cast<const T &
>(*ptr);
119 "you can't get use methods that get a particle by type if the two are of the same type!\n" <<
122 return static_cast<const T &
>(*cand1_);
126 "you can't get use methods that get a particle by type if neither of the two is of that type!\n" <<
131 return static_cast<const T &
>(*cand2_);
Analysis-level MET class.
double deltaR() const
Get the angular separation.
const GenericParticle & part1() const
Get the first item, if it's a PAT GenericParticle (throw exception otherwise)
const reco::Candidate & cand2() const
Gets the second Candidate.
const PFParticle & pf1() const
Get the first item, if it's a PAT PFParticle (throw exception otherwise)
const reco::Candidate & cand1() const
Gets the first Candidate.
const reco::Candidate * cand2_
const PFParticle & pf2() const
Get the second item, if it's a PAT PFParticle (throw exception otherwise)
const reco::Candidate * cand1_
const Electron & ele() const
Get the PAT Electron, if the pair contains one and only one PAT Electron (throw exception otherwise) ...
const GenericParticle & part2() const
Get the second item, if it's a PAT GenericParticle (throw exception otherwise)
const std::type_info * type1_
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 excepti...
const Photon & gam1() const
Get the first item, if it's a PAT Photon (throw exception otherwise)
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
const Electron & ele1() const
Get the first item, if it's a PAT Electron (throw exception otherwise)
const Tau & tau2() const
Get the second item, if it's a PAT Tau (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 T & tryGetOne_() const
static const std::string & name()
const Electron & ele2() const
Get the second item, if it's a PAT Electron (throw exception otherwise)
DiObjectProxy(const reco::Candidate &c1, const reco::Candidate &c2)
const MET & met2() const
Get the second item, if it's a PAT MET (throw exception otherwise)
const MET & met1() const
Get the first item, if it's a PAT MET (throw exception otherwise)
const Photon & gam2() const
Get the second item, if it's a PAT Photon (throw exception otherwise)
const Jet & jet2() const
Get the second item, if it's a PAT Jet (throw exception otherwise)
const std::type_info * type2_
const T & tryGet_(const reco::Candidate *ptr, const std::type_info *type) const
const Jet & jet1() const
Get the first item, if it's a PAT Jet (throw exception otherwise)
const reco::Candidate::LorentzVector & totalP4() const
Get the total four momentum.
const Jet & jet() const
Get the PAT Jet, if the pair contains one and only one 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) ...
reco::Candidate::LorentzVector totalP4_
const Tau & tau() const
Get the PAT Tau, if the pair contains one and only one PAT Tau (throw exception otherwise) ...
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Analysis-level class for reconstructed particles.
double deltaPhi() const
Get the phi separation.
const Photon & gam() const
Get the PAT Photon, if the pair contains one and only one PAT Photon (throw exception otherwise) ...
const Muon & mu1() const
Get the first item, if it's a PAT Muon (throw exception otherwise)
virtual double phi() const =0
momentum azimuthal angle
const Tau & tau1() const
Get the first item, if it's a PAT Tau (throw exception otherwise)
std::string className(const T &t)
DiObjectProxy()
Default constructor, requested by ROOT. NEVER use a default constructed item!
const PFParticle & pf() const
Get the PAT PFParticle, if the pair contains one and only one PAT PFParticle (throw exception otherwi...