|
|
Go to the documentation of this file. 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>(); }
102 template <
typename T>
104 if (
typeid(
T) != *
type) {
106 <<
"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);
114 template <
typename T>
119 <<
"pat::DiObjectProxy: "
120 <<
"you can't get use methods that get a particle by type if the two are of the same type!\n"
123 return static_cast<const T &>(*
cand1_);
127 <<
"pat::DiObjectProxy: "
128 <<
"you can't get use methods that get a particle by type if neither of the two is of that type!\n"
133 return static_cast<const T &>(*
cand2_);
const Electron & ele() const
Get the PAT Electron, if the pair contains one and only one PAT Electron (throw exception otherwise)
const MET & met2() const
Get the second item, if it's a PAT MET (throw exception otherwise)
const reco::Candidate & cand2() const
Gets the second Candidate.
const Photon & gam1() const
Get the first item, if it's a PAT Photon (throw exception otherwise)
const Muon & mu1() const
Get the first item, if it's a PAT Muon (throw exception otherwise)
const std::type_info * type1_
const reco::Candidate * cand1_
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 PFParticle & pf() const
Get the PAT PFParticle, if the pair contains one and only one PAT PFParticle (throw exception otherwi...
DiObjectProxy()
Default constructor, requested by ROOT. NEVER use a default constructed item!
const reco::Candidate & cand1() const
Gets the first Candidate.
const Muon & mu() const
Get the PAT Muon, if the pair contains one and only one PAT Muon (throw exception otherwise)
const MET & met() const
Get the PAT MET, if the pair contains one and only one PAT MET (throw exception otherwise)
double deltaR() const
Get the angular separation.
const Tau & tau() const
Get the PAT Tau, if the pair contains one and only one PAT Tau (throw exception otherwise)
Analysis-level class for reconstructed particles.
const PFParticle & pf1() const
Get the first item, if it's a PAT PFParticle (throw exception otherwise)
static const std::string & name()
const PFParticle & pf2() const
Get the second item, if it's a PAT PFParticle (throw exception otherwise)
const Photon & gam2() const
Get the second item, if it's a PAT Photon (throw exception otherwise)
const Electron & ele1() const
Get the first item, if it's a PAT Electron (throw exception otherwise)
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed)
const T & tryGet_(const reco::Candidate *ptr, const std::type_info *type) const
const Jet & jet() const
Get the PAT Jet, if the pair contains one and only one PAT Jet (throw exception otherwise)
const Tau & tau2() const
Get the second item, if it's a PAT Tau (throw exception otherwise)
const Photon & gam() const
Get the PAT Photon, if the pair contains one and only one PAT Photon (throw exception otherwise)
DiObjectProxy(const reco::Candidate &c1, const reco::Candidate &c2)
const GenericParticle & part1() const
Get the first item, if it's a PAT GenericParticle (throw exception otherwise)
Analysis-level MET class.
const Jet & jet1() const
Get the first item, if it's a PAT Jet (throw exception otherwise)
const GenericParticle & part2() const
Get the second item, if it's a PAT GenericParticle (throw exception otherwise)
const std::type_info * type2_
const reco::Candidate::LorentzVector & totalP4() const
Get the total four momentum.
const MET & met1() const
Get the first item, if it's a PAT MET (throw exception otherwise)
const Electron & ele2() const
Get the second item, if it's a PAT Electron (throw exception otherwise)
const T & tryGetOne_() const
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
reco::Candidate::LorentzVector totalP4_
std::string className(const T &t)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
const Tau & tau1() const
Get the first item, if it's a PAT Tau (throw exception otherwise)
const Jet & jet2() const
Get the second item, if it's a PAT Jet (throw exception otherwise)
virtual double phi() const =0
momentum azimuthal angle
const reco::Candidate * cand2_
double deltaPhi() const
Get the phi separation.