Analysis-level MET class. More...
#include <DataFormats/PatCandidates/interface/MET.h>
Classes | |
struct | UncorInfo |
Public Types | |
enum | UncorrectionType { uncorrNONE = -1, uncorrALL = 0, uncorrJES, uncorrMUON, uncorrTAU, uncorrMAXN } |
Public Member Functions | |
double | CaloMETInmHF () const |
Returns the event MET in HF-. | |
double | CaloMETInpHF () const |
Returns the event MET in HF+. | |
double | CaloMETPhiInmHF () const |
Returns the event MET-phi in HF-. | |
double | CaloMETPhiInpHF () const |
Returns the event MET-phi in HF+. | |
double | CaloSETInmHF () const |
Returns the event SET in HF-. | |
double | CaloSETInpHF () const |
Returns the event SET in HF+. | |
const SpecificCaloMETData & | caloSpecific () const |
accessor for the CaloMET-specific structure | |
double | ChargedEMEtFraction () const |
double | ChargedHadEtFraction () const |
virtual MET * | clone () const |
required reimplementation of the Candidate's clone method | |
float | corEx (UncorrectionType ix=uncorrALL) const |
float | corEy (UncorrectionType ix=uncorrALL) const |
float | corSumEt (UncorrectionType ix=uncorrALL) const |
double | emEtFraction () const |
Returns the event electromagnetic energy fraction. | |
double | emEtInEB () const |
Returns the event electromagnetic energy in EB. | |
double | emEtInEE () const |
Returns the event electromagnetic energy in EE. | |
double | emEtInHF () const |
Returns the event electromagnetic energy extracted from HF. | |
double | etFractionHadronic () const |
Returns the event hadronic energy fraction. | |
const reco::GenMET * | genMET () const |
return the associated GenMET | |
double | hadEtInHB () const |
Returns the event hadronic energy in HB. | |
double | hadEtInHE () const |
Returns the event hadronic energy in HE. | |
double | hadEtInHF () const |
Returns the event hadronic energy in HF. | |
double | hadEtInHO () const |
Returns the event hadronic energy in HO. | |
bool | isCaloMET () const |
True if this pat::MET was made from a reco::CaloMET. | |
bool | isPFMET () const |
True if this pat::MET was made from a reco::pfMET. | |
bool | isRecoMET () const |
True if this pat::MET was NOT made from a reco::CaloMET nor a reco::pfMET. | |
double | maxEtInEmTowers () const |
Returns the maximum energy deposited in ECAL towers. | |
double | maxEtInHadTowers () const |
Returns the maximum energy deposited in HCAL towers. | |
MET (const edm::Ptr< reco::MET > &aMETRef) | |
constructor from a Ptr to a reco::MET | |
MET (const reco::MET &aMET) | |
constructor from reco::MET | |
MET (const edm::RefToBase< reco::MET > &aMETRef) | |
constructor from a RefToBase to reco::MET (to be superseded by Ptr counterpart) | |
MET () | |
default constructor | |
double | metSignificance () const |
Returns the event MET Significance. | |
double | MuonEtFraction () const |
unsigned int | nCorrections () const |
return uncorrrection related stuff | |
double | NeutralEMFraction () const |
double | NeutralHadEtFraction () const |
const SpecificPFMETData & | pfSpecific () const |
accessor for the pfMET-specific structure | |
void | setGenMET (const reco::GenMET &gm) |
set the associated GenMET | |
double | Type6EtFraction () const |
double | Type7EtFraction () const |
float | uncorrectedPhi (UncorrectionType ix=uncorrALL) const |
float | uncorrectedPt (UncorrectionType ix=uncorrALL) const |
virtual | ~MET () |
destructor | |
Protected Member Functions | |
void | checkUncor_ () const |
check and set transients | |
void | setPtPhi_ (UncorInfo &uci) const |
Protected Attributes | |
std::vector< SpecificCaloMETData > | caloMET_ |
std::vector< reco::GenMET > | genMET_ |
unsigned int | nCorrections_ |
float | oldPt_ |
std::vector< SpecificPFMETData > | pfMET_ |
std::vector< UncorInfo > | uncorInfo_ |
Analysis-level MET class.
pat::MET implements an analysis-level missing energy class as a 4-vector within the 'pat' namespace.
Please post comments and questions to the Physics Tools hypernews: https://hypernews.cern.ch/HyperNews/CMS/get/physTools.html
uncorrNONE | |
uncorrALL |
do nothing |
uncorrJES |
uncorrect to bare bones |
uncorrMUON |
uncorrect for JES only |
uncorrTAU |
uncorrect for MUON only |
uncorrMAXN |
uncorrect for TAU only |
Definition at line 75 of file MET.h.
{ uncorrNONE = -1, uncorrALL = 0, uncorrJES, uncorrMUON, uncorrTAU, uncorrMAXN };
MET::MET | ( | ) |
default constructor
Reimplemented from reco::MET.
Definition at line 12 of file MET.cc.
Referenced by clone().
: uncorInfo_(0) { }
MET::MET | ( | const reco::MET & | aMET | ) |
constructor from reco::MET
Definition at line 17 of file MET.cc.
References caloMET_, reco::PFMET::getSpecific(), reco::CaloMET::getSpecific(), and pfMET_.
: PATObject<reco::MET>(aMET), uncorInfo_(0) { const reco::CaloMET * calo = dynamic_cast<const reco::CaloMET *>(&aMET); if (calo != 0) caloMET_.push_back(calo->getSpecific()); const reco::PFMET * pf = dynamic_cast<const reco::PFMET *>(&aMET); if (pf != 0) pfMET_.push_back(pf->getSpecific()); }
MET::MET | ( | const edm::RefToBase< reco::MET > & | aMETRef | ) |
constructor from a RefToBase to reco::MET (to be superseded by Ptr counterpart)
constructor from ref to reco::MET
Definition at line 26 of file MET.cc.
References caloMET_, edm::RefToBase< T >::get(), reco::PFMET::getSpecific(), reco::CaloMET::getSpecific(), and pfMET_.
: PATObject<reco::MET>(aMETRef), uncorInfo_(0) { const reco::CaloMET * calo = dynamic_cast<const reco::CaloMET *>(aMETRef.get()); if (calo != 0) caloMET_.push_back(calo->getSpecific()); const reco::PFMET * pf = dynamic_cast<const reco::PFMET *>(aMETRef.get()); if (pf != 0) pfMET_.push_back(pf->getSpecific()); }
constructor from a Ptr to a reco::MET
constructor from ref to reco::MET
Definition at line 34 of file MET.cc.
References caloMET_, edm::Ptr< T >::get(), reco::PFMET::getSpecific(), reco::CaloMET::getSpecific(), and pfMET_.
: PATObject<reco::MET>(aMETRef), uncorInfo_(0) { const reco::CaloMET * calo = dynamic_cast<const reco::CaloMET *>(aMETRef.get()); if (calo != 0) caloMET_.push_back(calo->getSpecific()); const reco::PFMET * pf = dynamic_cast<const reco::PFMET *>(aMETRef.get()); if (pf != 0) pfMET_.push_back(pf->getSpecific()); }
double pat::MET::CaloMETInmHF | ( | ) | const [inline] |
Returns the event MET in HF-.
Definition at line 129 of file MET.h.
References SpecificCaloMETData::CaloMETInmHF, and caloSpecific().
{return caloSpecific().CaloMETInmHF;}
double pat::MET::CaloMETInpHF | ( | ) | const [inline] |
Returns the event MET in HF+.
Definition at line 127 of file MET.h.
References SpecificCaloMETData::CaloMETInpHF, and caloSpecific().
{return caloSpecific().CaloMETInpHF;}
double pat::MET::CaloMETPhiInmHF | ( | ) | const [inline] |
Returns the event MET-phi in HF-.
Definition at line 133 of file MET.h.
References SpecificCaloMETData::CaloMETPhiInmHF, and caloSpecific().
{return caloSpecific().CaloMETPhiInmHF;}
double pat::MET::CaloMETPhiInpHF | ( | ) | const [inline] |
Returns the event MET-phi in HF+.
Definition at line 131 of file MET.h.
References SpecificCaloMETData::CaloMETPhiInpHF, and caloSpecific().
{return caloSpecific().CaloMETPhiInpHF;}
double pat::MET::CaloSETInmHF | ( | ) | const [inline] |
Returns the event SET in HF-.
Definition at line 125 of file MET.h.
References SpecificCaloMETData::CaloSETInmHF, and caloSpecific().
{return caloSpecific().CaloSETInmHF;}
double pat::MET::CaloSETInpHF | ( | ) | const [inline] |
Returns the event SET in HF+.
Definition at line 123 of file MET.h.
References SpecificCaloMETData::CaloSETInpHF, and caloSpecific().
{return caloSpecific().CaloSETInpHF;}
const SpecificCaloMETData& pat::MET::caloSpecific | ( | ) | const [inline] |
accessor for the CaloMET-specific structure
Definition at line 135 of file MET.h.
References caloMET_, Exception, and isCaloMET().
Referenced by CaloMETInmHF(), CaloMETInpHF(), CaloMETPhiInmHF(), CaloMETPhiInpHF(), CaloSETInmHF(), CaloSETInpHF(), emEtFraction(), emEtInEB(), emEtInEE(), emEtInHF(), etFractionHadronic(), hadEtInHB(), hadEtInHE(), hadEtInHF(), hadEtInHO(), maxEtInEmTowers(), maxEtInHadTowers(), and metSignificance().
{ if (!isCaloMET()) throw cms::Exception("pat::MET") << "This pat::MET has not been made from a reco::CaloMET\n"; return caloMET_[0]; }
double pat::MET::ChargedEMEtFraction | ( | ) | const [inline] |
Definition at line 143 of file MET.h.
References SpecificPFMETData::ChargedEMFraction, and pfSpecific().
{ return pfSpecific().ChargedEMFraction; }
double pat::MET::ChargedHadEtFraction | ( | ) | const [inline] |
Definition at line 144 of file MET.h.
References SpecificPFMETData::ChargedHadFraction, and pfSpecific().
{ return pfSpecific().ChargedHadFraction; }
void MET::checkUncor_ | ( | ) | const [protected] |
check and set transients
ugly ALL
JES
MUON
TAU
Definition at line 84 of file MET.cc.
References reco::MET::mEtCorr(), nCorrections_, oldPt_, reco::LeafCandidate::pt(), setPtPhi_(), uncorInfo_, uncorrALL, uncorrJES, uncorrMAXN, uncorrMUON, and uncorrTAU.
Referenced by corEx(), corEy(), corSumEt(), nCorrections(), uncorrectedPhi(), and uncorrectedPt().
{ if (uncorInfo_.size() == uncorrMAXN && oldPt_ == pt() ) return; oldPt_ = pt(); std::vector<CorrMETData> corrs(mEtCorr()); nCorrections_ = corrs.size(); uncorInfo_.resize(uncorrMAXN); UncorrectionType ix; ix = uncorrALL; uncorInfo_[ix] = UncorInfo(); for (unsigned int iC=0; iC < nCorrections_; ++iC){ uncorInfo_[ix].corEx += corrs[iC].mex; uncorInfo_[ix].corEy += corrs[iC].mey; uncorInfo_[ix].corSumEt += corrs[iC].sumet; } setPtPhi_(uncorInfo_[ix]); ix = uncorrJES; uncorInfo_[ix] = UncorInfo(); if (nCorrections_ >=1 ){ unsigned int iC = 0; uncorInfo_[ix].corEx += corrs[iC].mex; uncorInfo_[ix].corEy += corrs[iC].mey; uncorInfo_[ix].corSumEt += corrs[iC].sumet; } setPtPhi_(uncorInfo_[ix]); ix = uncorrMUON; uncorInfo_[ix] = UncorInfo(); if (nCorrections_ >=2 ){ unsigned int iC = 1; uncorInfo_[ix].corEx += corrs[iC].mex; uncorInfo_[ix].corEy += corrs[iC].mey; uncorInfo_[ix].corSumEt += corrs[iC].sumet; } setPtPhi_(uncorInfo_[ix]); ix = uncorrTAU; uncorInfo_[ix] = UncorInfo(); if (nCorrections_ >=3 ){ unsigned int iC = 2; uncorInfo_[ix].corEx += corrs[iC].mex; uncorInfo_[ix].corEy += corrs[iC].mey; uncorInfo_[ix].corSumEt += corrs[iC].sumet; } setPtPhi_(uncorInfo_[ix]); }
virtual MET* pat::MET::clone | ( | void | ) | const [inline, virtual] |
float MET::corEx | ( | UncorrectionType | ix = uncorrALL | ) | const |
Definition at line 61 of file MET.cc.
References checkUncor_(), uncorInfo_, and uncorrNONE.
{ if (ix == uncorrNONE) return 0; checkUncor_(); return uncorInfo_[ix].corEx; }
float MET::corEy | ( | UncorrectionType | ix = uncorrALL | ) | const |
Definition at line 65 of file MET.cc.
References checkUncor_(), uncorInfo_, and uncorrNONE.
{ if (ix == uncorrNONE) return 0; checkUncor_(); return uncorInfo_[ix].corEy; }
float MET::corSumEt | ( | UncorrectionType | ix = uncorrALL | ) | const |
Definition at line 69 of file MET.cc.
References checkUncor_(), uncorInfo_, and uncorrNONE.
{ if (ix == uncorrNONE) return 0; checkUncor_(); return uncorInfo_[ix].corSumEt; }
double pat::MET::emEtFraction | ( | ) | const [inline] |
Returns the event electromagnetic energy fraction.
Definition at line 105 of file MET.h.
References caloSpecific(), and SpecificCaloMETData::EtFractionEm.
{return caloSpecific().EtFractionEm;}
double pat::MET::emEtInEB | ( | ) | const [inline] |
Returns the event electromagnetic energy in EB.
Definition at line 115 of file MET.h.
References caloSpecific(), and SpecificCaloMETData::EmEtInEB.
{return caloSpecific().EmEtInEB;}
double pat::MET::emEtInEE | ( | ) | const [inline] |
Returns the event electromagnetic energy in EE.
Definition at line 117 of file MET.h.
References caloSpecific(), and SpecificCaloMETData::EmEtInEE.
{return caloSpecific().EmEtInEE;}
double pat::MET::emEtInHF | ( | ) | const [inline] |
Returns the event electromagnetic energy extracted from HF.
Definition at line 119 of file MET.h.
References caloSpecific(), and SpecificCaloMETData::EmEtInHF.
{return caloSpecific().EmEtInHF;}
double pat::MET::etFractionHadronic | ( | ) | const [inline] |
Returns the event hadronic energy fraction.
Definition at line 103 of file MET.h.
References caloSpecific(), and SpecificCaloMETData::EtFractionHadronic.
{return caloSpecific().EtFractionHadronic;}
const reco::GenMET * MET::genMET | ( | ) | const |
double pat::MET::hadEtInHB | ( | ) | const [inline] |
Returns the event hadronic energy in HB.
Definition at line 107 of file MET.h.
References caloSpecific(), and SpecificCaloMETData::HadEtInHB.
{return caloSpecific().HadEtInHB;}
double pat::MET::hadEtInHE | ( | ) | const [inline] |
Returns the event hadronic energy in HE.
Definition at line 111 of file MET.h.
References caloSpecific(), and SpecificCaloMETData::HadEtInHE.
{return caloSpecific().HadEtInHE;}
double pat::MET::hadEtInHF | ( | ) | const [inline] |
Returns the event hadronic energy in HF.
Definition at line 113 of file MET.h.
References caloSpecific(), and SpecificCaloMETData::HadEtInHF.
{return caloSpecific().HadEtInHF;}
double pat::MET::hadEtInHO | ( | ) | const [inline] |
Returns the event hadronic energy in HO.
Definition at line 109 of file MET.h.
References caloSpecific(), and SpecificCaloMETData::HadEtInHO.
{return caloSpecific().HadEtInHO;}
bool pat::MET::isCaloMET | ( | ) | const [inline] |
True if this pat::MET was made from a reco::CaloMET.
Definition at line 91 of file MET.h.
References caloMET_.
Referenced by caloSpecific().
{ return !caloMET_.empty(); }
bool pat::MET::isPFMET | ( | ) | const [inline] |
bool pat::MET::isRecoMET | ( | ) | const [inline] |
double pat::MET::maxEtInEmTowers | ( | ) | const [inline] |
Returns the maximum energy deposited in ECAL towers.
Definition at line 99 of file MET.h.
References caloSpecific(), and SpecificCaloMETData::MaxEtInEmTowers.
{return caloSpecific().MaxEtInEmTowers;}
double pat::MET::maxEtInHadTowers | ( | ) | const [inline] |
Returns the maximum energy deposited in HCAL towers.
Definition at line 101 of file MET.h.
References caloSpecific(), and SpecificCaloMETData::MaxEtInHadTowers.
{return caloSpecific().MaxEtInHadTowers;}
double pat::MET::metSignificance | ( | ) | const [inline] |
Returns the event MET Significance.
Definition at line 121 of file MET.h.
References caloSpecific(), and SpecificCaloMETData::METSignificance.
{return caloSpecific().METSignificance;}
double pat::MET::MuonEtFraction | ( | ) | const [inline] |
Definition at line 145 of file MET.h.
References SpecificPFMETData::MuonFraction, and pfSpecific().
{ return pfSpecific().MuonFraction; }
unsigned int MET::nCorrections | ( | ) | const |
return uncorrrection related stuff
uses internal info from mEtCorr except for full uncorrection, how do you know which is which? you don't, present ordering: 1: jet escale Type1 correction 2: muon Type1 (?) correction 3: tau Type1 (?) correction
Definition at line 59 of file MET.cc.
References checkUncor_(), and nCorrections_.
{ checkUncor_(); return nCorrections_; }
double pat::MET::NeutralEMFraction | ( | ) | const [inline] |
Definition at line 141 of file MET.h.
References SpecificPFMETData::NeutralEMFraction, and pfSpecific().
{ return pfSpecific().NeutralEMFraction; }
double pat::MET::NeutralHadEtFraction | ( | ) | const [inline] |
Definition at line 142 of file MET.h.
References SpecificPFMETData::NeutralHadFraction, and pfSpecific().
{ return pfSpecific().NeutralHadFraction; }
const SpecificPFMETData& pat::MET::pfSpecific | ( | ) | const [inline] |
accessor for the pfMET-specific structure
Definition at line 149 of file MET.h.
References Exception, isPFMET(), and pfMET_.
Referenced by ChargedEMEtFraction(), ChargedHadEtFraction(), MuonEtFraction(), NeutralEMFraction(), NeutralHadEtFraction(), Type6EtFraction(), and Type7EtFraction().
{ if (!isPFMET()) throw cms::Exception("pat::MET") << "This pat::MET has not been made from a reco::PFMET\n"; return pfMET_[0]; }
void MET::setGenMET | ( | const reco::GenMET & | gm | ) |
void MET::setPtPhi_ | ( | UncorInfo & | uci | ) | const [protected] |
Definition at line 140 of file MET.cc.
References pat::MET::UncorInfo::corEx, pat::MET::UncorInfo::corEy, pat::MET::UncorInfo::phi, pat::MET::UncorInfo::pt, reco::LeafCandidate::px(), reco::LeafCandidate::py(), and mathSSE::sqrt().
Referenced by checkUncor_().
double pat::MET::Type6EtFraction | ( | ) | const [inline] |
Definition at line 146 of file MET.h.
References pfSpecific(), and SpecificPFMETData::Type6Fraction.
{ return pfSpecific().Type6Fraction; }
double pat::MET::Type7EtFraction | ( | ) | const [inline] |
Definition at line 147 of file MET.h.
References pfSpecific(), and SpecificPFMETData::Type7Fraction.
{ return pfSpecific().Type7Fraction; }
float MET::uncorrectedPhi | ( | UncorrectionType | ix = uncorrALL | ) | const |
Definition at line 77 of file MET.cc.
References checkUncor_(), reco::LeafCandidate::phi(), uncorInfo_, and uncorrNONE.
{ if (ix == uncorrNONE) return phi(); checkUncor_(); return uncorInfo_[ix].phi; }
float MET::uncorrectedPt | ( | UncorrectionType | ix = uncorrALL | ) | const |
Definition at line 73 of file MET.cc.
References checkUncor_(), reco::LeafCandidate::pt(), uncorInfo_, and uncorrNONE.
{ if (ix == uncorrNONE) return pt(); checkUncor_(); return uncorInfo_[ix].pt; }
std::vector<SpecificCaloMETData> pat::MET::caloMET_ [protected] |
Definition at line 159 of file MET.h.
Referenced by caloSpecific(), isCaloMET(), isRecoMET(), and MET().
std::vector<reco::GenMET> pat::MET::genMET_ [protected] |
Definition at line 157 of file MET.h.
Referenced by genMET(), and setGenMET().
unsigned int pat::MET::nCorrections_ [mutable, protected] |
Definition at line 174 of file MET.h.
Referenced by checkUncor_(), and nCorrections().
float pat::MET::oldPt_ [mutable, protected] |
Definition at line 175 of file MET.h.
Referenced by checkUncor_().
std::vector<SpecificPFMETData> pat::MET::pfMET_ [protected] |
Definition at line 161 of file MET.h.
Referenced by isPFMET(), isRecoMET(), MET(), and pfSpecific().
std::vector<UncorInfo> pat::MET::uncorInfo_ [mutable, protected] |
Definition at line 173 of file MET.h.
Referenced by checkUncor_(), corEx(), corEy(), corSumEt(), uncorrectedPhi(), and uncorrectedPt().