CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
pat::MET Class Reference

Analysis-level MET class. More...

#include "DataFormats/PatCandidates/interface/MET.h"

Inheritance diagram for pat::MET:
pat::PATObject< reco::MET > reco::MET reco::RecoCandidate reco::LeafCandidate reco::Candidate

Classes

class  PackedMETUncertainty
 this below should be private but Reflex doesn't like it More...
 
struct  Vector2
 

Public Types

enum  METCorrectionLevel {
  Raw =0, Type1 =1, Type01 =2, TypeXY =3,
  Type1XY =4, Type01XY =5, Type1Smear =6, Type01Smear =7,
  Type1SmearXY =8, Type01SmearXY =9, RawCalo =10, METCorrectionLevelSize =11
}
 
enum  METCorrectionType {
  None =0, T1 =1, T0 =2, TXY =3,
  TXYForRaw =4, TXYForT01 =5, TXYForT1Smear =6, TXYForT01Smear =7,
  Smear =8, Calo =9, METCorrectionTypeSize =10
}
 
enum  METUncertainty {
  JetResUp =0, JetResDown =1, JetEnUp =2, JetEnDown =3,
  MuonEnUp =4, MuonEnDown =5, ElectronEnUp =6, ElectronEnDown =7,
  TauEnUp =8, TauEnDown =9, UnclusteredEnUp =10, UnclusteredEnDown =11,
  PhotonEnUp =12, PhotonEnDown =13, NoShift =14, METUncertaintySize =15,
  JetResUpSmear =16, JetResDownSmear =17, METFullUncertaintySize =18
}
 
- Public Types inherited from pat::PATObject< reco::MET >
typedef reco::MET base_type
 
- Public Types inherited from reco::RecoCandidate
enum  TrackType { noTrackType, recoTrackType, gsfTrackType }
 track type More...
 
- Public Types inherited from reco::LeafCandidate
typedef int Charge
 electric charge type More...
 
typedef CandidateCollection daughters
 collection of daughter candidates More...
 
typedef unsigned int index
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef math::PtEtaPhiMLorentzVector PolarLorentzVector
 Lorentz vector. More...
 
typedef math::XYZVector Vector
 point in the space More...
 
- Public Types inherited from reco::Candidate
enum  { dimension = 3 }
 
enum  { size = dimension * (dimension + 1)/2 }
 matix size More...
 
typedef int Charge
 electric charge type More...
 
typedef candidate::const_iterator const_iterator
 
typedef math::Error< dimension >::type CovarianceMatrix
 covariance error matrix (3x3) More...
 
typedef unsigned int index
 index type More...
 
typedef candidate::iterator iterator
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef math::PtEtaPhiMLorentzVector PolarLorentzVector
 Lorentz vector. More...
 
typedef size_t size_type
 
typedef math::XYZVector Vector
 point in the space More...
 

Public Member Functions

double CaloMETInmHF () const
 Returns the event MET in HF-. More...
 
double CaloMETInpHF () const
 Returns the event MET in HF+. More...
 
Vector2 caloMETP2 () const
 
double caloMETPhi () const
 
double CaloMETPhiInmHF () const
 Returns the event MET-phi in HF-. More...
 
double CaloMETPhiInpHF () const
 Returns the event MET-phi in HF+. More...
 
double caloMETPt () const
 
double caloMetSignificance () const
 Returns the event MET Significance. More...
 
double caloMETSumEt () const
 
double CaloSETInmHF () const
 Returns the event SET in HF-. More...
 
double CaloSETInpHF () const
 Returns the event SET in HF+. More...
 
const SpecificCaloMETDatacaloSpecific () const
 accessor for the CaloMET-specific structure More...
 
double ChargedEMEtFraction () const
 
double ChargedHadEtFraction () const
 
virtual METclone () const
 required reimplementation of the Candidate's clone method More...
 
Vector2 corP2 (METCorrectionLevel level=Type1) const
 
Vector corP3 (METCorrectionLevel level=Type1) const
 
LorentzVector corP4 (METCorrectionLevel level=Type1) const
 
double corPhi (METCorrectionLevel level=Type1) const
 
double corPt (METCorrectionLevel level=Type1) const
 
double corPx (METCorrectionLevel level=Type1) const
 
double corPy (METCorrectionLevel level=Type1) const
 
double corSumEt (METCorrectionLevel level=Type1) const
 
double emEtFraction () const
 Returns the event electromagnetic energy fraction. More...
 
double emEtInEB () const
 Returns the event electromagnetic energy in EB. More...
 
double emEtInEE () const
 Returns the event electromagnetic energy in EE. More...
 
double emEtInHF () const
 Returns the event electromagnetic energy extracted from HF. More...
 
double etFractionHadronic () const
 Returns the event hadronic energy fraction. More...
 
const reco::GenMETgenMET () const
 return the associated GenMET More...
 
double hadEtInHB () const
 Returns the event hadronic energy in HB. More...
 
double hadEtInHE () const
 Returns the event hadronic energy in HE. More...
 
double hadEtInHF () const
 Returns the event hadronic energy in HF. More...
 
double hadEtInHO () const
 Returns the event hadronic energy in HO. More...
 
bool isCaloMET () const
 True if this pat::MET was made from a reco::CaloMET. More...
 
bool isPFMET () const
 True if this pat::MET was made from a reco::pfMET. More...
 
bool isRecoMET () const
 True if this pat::MET was NOT made from a reco::CaloMET nor a reco::pfMET. More...
 
double maxEtInEmTowers () const
 Returns the maximum energy deposited in ECAL towers. More...
 
double maxEtInHadTowers () const
 Returns the maximum energy deposited in HCAL towers. More...
 
 MET ()
 default constructor More...
 
 MET (const reco::MET &aMET)
 constructor from reco::MET More...
 
 MET (const edm::RefToBase< reco::MET > &aMETRef)
 constructor from a RefToBase to reco::MET (to be superseded by Ptr counterpart) More...
 
 MET (const edm::Ptr< reco::MET > &aMETRef)
 constructor from a Ptr to a reco::MET More...
 
 MET (MET const &)
 copy constructor More...
 
 MET (const reco::MET &corMET, const MET &srcMET)
 constructor for corrected METs (keeping specific informations from src MET) More...
 
double metSignificance () const
 
double MuonEtFraction () const
 
double NeutralEMFraction () const
 
double NeutralHadEtFraction () const
 
METoperator= (MET const &)
 
const SpecificPFMETDatapfSpecific () const
 accessor for the pfMET-specific structure More...
 
void setCorShift (double px, double py, double sumEt, METCorrectionType level)
 
void setGenMET (const reco::GenMET &gm)
 set the associated GenMET More...
 
void setMETSignificance (const double &metSig)
 
void setUncShift (double px, double py, double sumEt, METUncertainty shift, bool isSmeared=false)
 
Vector2 shiftedP2 (METUncertainty shift, METCorrectionLevel level=Type1) const
 
Vector2 shiftedP2_74x (METUncertainty shift, METCorrectionLevel level) const
 
Vector shiftedP3 (METUncertainty shift, METCorrectionLevel level=Type1) const
 
Vector shiftedP3_74x (METUncertainty shift, METCorrectionLevel level) const
 
LorentzVector shiftedP4 (METUncertainty shift, METCorrectionLevel level=Type1) const
 
LorentzVector shiftedP4_74x (METUncertainty shift, METCorrectionLevel level) const
 
double shiftedPhi (METUncertainty shift, METCorrectionLevel level=Type1) const
 
double shiftedPt (METUncertainty shift, METCorrectionLevel level=Type1) const
 
double shiftedPx (METUncertainty shift, METCorrectionLevel level=Type1) const
 
double shiftedPy (METUncertainty shift, METCorrectionLevel level=Type1) const
 
double shiftedSumEt (METUncertainty shift, METCorrectionLevel level=Type1) const
 
double shiftedSumEt_74x (METUncertainty shift, METCorrectionLevel level) const
 
double Type6EtFraction () const
 
double Type7EtFraction () const
 
Vector2 uncorP2 () const
 
Vector uncorP3 () const
 
LorentzVector uncorP4 () const
 
double uncorPhi () const
 
double uncorPt () const
 
double uncorPx () const
 
double uncorPy () const
 
double uncorSumEt () const
 
virtual ~MET ()
 destructor More...
 
- Public Member Functions inherited from pat::PATObject< reco::MET >
void addGenParticleRef (const reco::GenParticleRef &ref)
 
void addTriggerObjectMatch (const TriggerObjectStandAlone &trigObj)
 add a trigger match More...
 
void addUserCand (const std::string &label, const reco::CandidatePtr &data, const bool overwrite=false)
 Set user-defined int. More...
 
void addUserData (const std::string &label, const T &data, bool transientOnly=false, bool overwrite=false)
 
void addUserDataFromPtr (const std::string &label, const edm::Ptr< pat::UserData > &data, bool overwrite=false)
 
void addUserFloat (const std::string &label, float data, const bool overwrite=false)
 Set user-defined float. More...
 
void addUserInt (const std::string &label, int32_t data, const bool overwrite=false)
 Set user-defined int. More...
 
std::vector< std::pair< std::string, pat::LookupTableRecord > > efficiencies () const
 Returns the efficiencies as <name,value> pairs (by value) More...
 
const pat::LookupTableRecordefficiency (const std::string &name) const
 Returns an efficiency given its name. More...
 
const std::vector< std::string > & efficiencyNames () const
 Returns the list of the names of the stored efficiencies. More...
 
const std::vector< pat::LookupTableRecord > & efficiencyValues () const
 Returns the list of the values of the stored efficiencies (the ordering is the same as in efficiencyNames()) More...
 
void embedGenParticle ()
 
const reco::GenParticlegenParticle (size_t idx=0) const
 
reco::GenParticleRef genParticleById (int pdgId, int status, uint8_t autoCharge=0) const
 
reco::GenParticleRef genParticleRef (size_t idx=0) const
 
std::vector< reco::GenParticleRefgenParticleRefs () const
 
size_t genParticlesSize () const
 Number of generator level particles stored as ref or embedded. More...
 
const pat::CandKinResolutiongetKinResolution (const std::string &label="") const
 
bool hasKinResolution (const std::string &label="") const
 Check if the kinematic resolutions are stored into this object (possibly specifying a label for them) More...
 
bool hasOverlaps (const std::string &label) const
 Returns true if there was at least one overlap for this test label. More...
 
bool hasUserCand (const std::string &key) const
 Return true if there is a user-defined int with a given name. More...
 
bool hasUserData (const std::string &key) const
 Check if user data with a specific type is present. More...
 
bool hasUserFloat (const std::string &key) const
 Return true if there is a user-defined float with a given name. More...
 
bool hasUserFloat (const char *key) const
 a CINT-friendly interface More...
 
bool hasUserInt (const std::string &key) const
 Return true if there is a user-defined int with a given name. More...
 
const reco::CandidateoriginalObject () const
 access to the original object; returns zero for null Ref and throws for unavailable collection More...
 
const edm::Ptr< reco::Candidate > & originalObjectRef () const
 reference to original object. Returns a null reference if not available More...
 
const std::vector< std::string > & overlapLabels () const
 Returns the labels of the overlap tests that found at least one overlap. More...
 
const reco::CandidatePtrVectoroverlaps (const std::string &label) const
 
 PATObject ()
 default constructor More...
 
 PATObject (const reco::MET &obj)
 constructor from a base object (leaves invalid reference to original object!) More...
 
 PATObject (const edm::RefToBase< reco::MET > &ref)
 constructor from reference More...
 
 PATObject (const edm::Ptr< reco::MET > &ref)
 constructor from reference More...
 
double resolE (const std::string &label="") const
 Resolution on energy, possibly with a label to specify which resolution to use. More...
 
double resolEt (const std::string &label="") const
 Resolution on et, possibly with a label to specify which resolution to use. More...
 
double resolEta (const std::string &label="") const
 Resolution on eta, possibly with a label to specify which resolution to use. More...
 
double resolM (const std::string &label="") const
 
double resolP (const std::string &label="") const
 Resolution on p, possibly with a label to specify which resolution to use. More...
 
double resolPhi (const std::string &label="") const
 Resolution on phi, possibly with a label to specify which resolution to use. More...
 
double resolPInv (const std::string &label="") const
 Resolution on 1/p, possibly with a label to specify which resolution to use. More...
 
double resolPt (const std::string &label="") const
 Resolution on pt, possibly with a label to specify which resolution to use. More...
 
double resolPx (const std::string &label="") const
 Resolution on px, possibly with a label to specify which resolution to use. More...
 
double resolPy (const std::string &label="") const
 Resolution on py, possibly with a label to specify which resolution to use. More...
 
double resolPz (const std::string &label="") const
 Resolution on pz, possibly with a label to specify which resolution to use. More...
 
double resolTheta (const std::string &label="") const
 Resolution on theta, possibly with a label to specify which resolution to use. More...
 
void setEfficiency (const std::string &name, const pat::LookupTableRecord &value)
 
void setGenParticle (const reco::GenParticle &particle)
 Set the generator level particle from a particle not in the Event (embedding it, of course) More...
 
void setGenParticleRef (const reco::GenParticleRef &ref, bool embed=false)
 Set the generator level particle reference. More...
 
void setKinResolution (const pat::CandKinResolution &resol, const std::string &label="")
 Add a kinematic resolution to this object (possibly with a label) More...
 
void setOverlaps (const std::string &label, const reco::CandidatePtrVector &overlaps)
 
const TriggerObjectStandAlonetriggerObjectMatch (const size_t idx=0) const
 get one matched trigger object by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const std::string &nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const char *nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const std::string &nameAlgorithm, const unsigned algoCondAccepted, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const char *nameAlgorithm, const unsigned algoCondAccepted, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByCollection (const std::string &coll, const size_t idx=0) const
 get one matched trigger object from a certain collection by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByCollection (const char *coll, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByCondition (const std::string &nameCondition, const size_t idx=0) const
 get one matched L1 object used in a succeeding object combination of a certain L1 condition by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByCondition (const char *nameCondition, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByFilter (const std::string &labelFilter, const size_t idx=0) const
 get one matched HLT object used in a certain HLT filter by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByFilter (const char *labelFilter, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByFilterID (const unsigned triggerObjectType, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByPath (const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByPath (const char *namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByPath (const std::string &namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByPath (const char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByType (const trigger::TriggerObjectType triggerObjectType, const size_t idx=0) const
 get one matched trigger object of a certain type by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByType (const unsigned triggerObjectType, const size_t idx=0) const
 
const TriggerObjectStandAloneCollectiontriggerObjectMatches () const
 get all matched trigger objects More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const std::string &nameAlgorithm, const bool algoCondAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const char *nameAlgorithm, const bool algoCondAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const std::string &nameAlgorithm, const unsigned algoCondAccepted) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const char *nameAlgorithm, const unsigned algoCondAccepted) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection (const std::string &coll) const
 get all matched trigger objects from a certain collection More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection (const char *coll) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCondition (const std::string &nameCondition) const
 get all matched L1 objects used in a succeeding object combination of a certain L1 condition More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCondition (const char *nameCondition) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter (const std::string &labelFilter) const
 get all matched HLT objects used in a certain HLT filter More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter (const char *labelFilter) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilterID (const unsigned triggerObjectType) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const char *namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const std::string &namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByType (const trigger::TriggerObjectType triggerObjectType) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByType (const unsigned triggerObjectType) const
 
void unpackTriggerObjectPathNames (const edm::TriggerNames &names)
 unpack path names of matched trigger objects (if they were packed before embedding, which is not normally the case) More...
 
reco::CandidatePtr userCand (const std::string &key) const
 
const std::vector< std::string > & userCandNames () const
 Get list of user-defined cand names. More...
 
const TuserData (const std::string &key) const
 Returns user-defined data. Returns NULL if the data is not present, or not of type T. More...
 
const void * userDataBare (const std::string &key) const
 
const std::vector< std::string > & userDataNames () const
 Get list of user data object names. More...
 
const std::string & userDataObjectType (const std::string &key) const
 Get human-readable type of user data object, for debugging. More...
 
float userFloat (const std::string &key) const
 
float userFloat (const char *key) const
 a CINT-friendly interface More...
 
const std::vector< std::string > & userFloatNames () const
 Get list of user-defined float names. More...
 
std::vector< float > userFloatRange (const std::string &key) const
 return a range of values corresponding to key More...
 
int32_t userInt (const std::string &key) const
 
const std::vector< std::string > & userIntNames () const
 Get list of user-defined int names. More...
 
std::vector< int > userIntRange (const std::string &key) const
 returns a range of values corresponding to key More...
 
virtual ~PATObject ()
 destructor More...
 
- Public Member Functions inherited from reco::MET
std::vector< double > dmEx () const
 
std::vector< double > dmEy () const
 
std::vector< double > dsumEt () const
 
double e_longitudinal () const
 
reco::METCovMatrix getSignificanceMatrix (void) const
 
 MET ()
 
 MET (const LorentzVector &p4_, const Point &vtx_)
 
 MET (double sumet_, const LorentzVector &p4_, const Point &vtx_)
 
 MET (double sumet_, const std::vector< CorrMETData > &corr_, const LorentzVector &p4_, const Point &vtx_)
 
std::vector< CorrMETDatamEtCorr () const
 
double mEtSig () const
 
void setSignificanceMatrix (const reco::METCovMatrix &matrix)
 
double significance () const
 
double sumEt () const
 
- Public Member Functions inherited from reco::RecoCandidate
virtual const TrackbestTrack () const
 best track pointer More...
 
virtual TrackBaseRef bestTrackRef () const
 best track RefToBase More...
 
virtual TrackType bestTrackType () const
 track type More...
 
virtual CaloTowerRef caloTower () const
 reference to a CaloTower More...
 
virtual reco::TrackRef combinedMuon () const
 reference to a stand-alone muon Track More...
 
virtual float dxyError () const
 uncertainty on dxy More...
 
virtual float dzError () const
 uncertainty on dz More...
 
virtual reco::GsfTrackRef gsfTrack () const
 reference to a GsfTrack More...
 
virtual size_t numberOfTracks () const
 number of multiple Tracks More...
 
 RecoCandidate ()
 default constructor More...
 
template<typename P4 >
 RecoCandidate (Charge q, const P4 &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0)
 constructor from values More...
 
virtual reco::TrackRef standAloneMuon () const
 reference to a stand-alone muon Track More...
 
virtual reco::SuperClusterRef superCluster () const
 reference to a SuperCluster More...
 
virtual reco::TrackRef track () const
 reference to a Track More...
 
virtual reco::TrackRef track (size_t) const
 reference to one of multiple Tracks More...
 
virtual ~RecoCandidate ()
 destructor More...
 
- Public Member Functions inherited from reco::LeafCandidate
virtual Vector boostToCM () const final
 
virtual int charge () const final
 electric charge More...
 
void construct (int qx3, float pt, float eta, float phi, float mass, const Point &vtx, int pdgId, int status)
 
virtual const Candidatedaughter (size_type) const
 return daughter at a given position (throws an exception) More...
 
virtual Candidatedaughter (size_type)
 return daughter at a given position (throws an exception) More...
 
virtual Candidatedaughter (const std::string &s)
 return daughter with a specified role name More...
 
virtual const Candidatedaughter (const std::string &s) const
 return daughter with a specified role name More...
 
virtual double energy () const final
 energy More...
 
virtual double et () const final
 transverse energy More...
 
virtual double et2 () const final
 transverse energy squared (use this for cut!) More...
 
virtual double eta () const final
 momentum pseudorapidity More...
 
virtual void fillVertexCovariance (CovarianceMatrix &v) const
 fill SMatrix More...
 
template<typename T >
T get () const
 get a component More...
 
template<typename T , typename Tag >
T get () const
 get a component More...
 
template<typename T >
T get (size_type i) const
 get a component More...
 
template<typename T , typename Tag >
T get (size_type i) const
 get a component More...
 
virtual bool hasMasterClone () const
 
virtual bool hasMasterClonePtr () const
 
virtual bool isCaloMuon () const
 
virtual bool isConvertedPhoton () const
 
virtual bool isElectron () const
 
virtual bool isGlobalMuon () const
 
virtual bool isJet () const
 
virtual bool isMuon () const
 
virtual bool isPhoton () const
 
virtual bool isStandAloneMuon () const
 
virtual bool isTrackerMuon () const
 
 LeafCandidate ()
 
 LeafCandidate (const Candidate &c)
 
template<typename... Args>
 LeafCandidate (Args &&...args)
 
 LeafCandidate (LeafCandidate &rh)
 
 LeafCandidate (LeafCandidate &&)=default
 
 LeafCandidate (LeafCandidate const &)=default
 
virtual bool longLived () const final
 is long lived? More...
 
virtual double mass () const final
 mass More...
 
virtual bool massConstraint () const final
 do mass constraint? More...
 
virtual double massSqr () const final
 mass squared More...
 
virtual const CandidateBaseRefmasterClone () const
 
virtual const CandidatePtrmasterClonePtr () const
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
virtual Vector momentum () const final
 spatial momentum vector More...
 
virtual const Candidatemother (size_type) const
 return mother at a given position (throws an exception) More...
 
virtual double mt () const final
 transverse mass More...
 
virtual double mtSqr () const final
 transverse mass squared More...
 
template<typename T >
size_type numberOf () const
 number of components More...
 
template<typename T , typename Tag >
size_type numberOf () const
 number of components More...
 
virtual size_t numberOfDaughters () const
 number of daughters More...
 
virtual size_t numberOfMothers () const
 number of mothers More...
 
virtual size_t numberOfSourceCandidatePtrs () const
 
LeafCandidateoperator= (LeafCandidate &&)=default
 
LeafCandidateoperator= (LeafCandidate const &)=default
 
virtual double p () const final
 magnitude of momentum vector More...
 
virtual const LorentzVectorp4 () const final
 four-momentum Lorentz vector More...
 
virtual int pdgId () const final
 PDG identifier. More...
 
virtual double phi () const final
 momentum azimuthal angle More...
 
virtual const PolarLorentzVectorpolarP4 () const final
 four-momentum Lorentz vector More...
 
virtual double pt () const final
 transverse momentum More...
 
virtual double px () const final
 x coordinate of momentum vector More...
 
virtual double py () const final
 y coordinate of momentum vector More...
 
virtual double pz () const final
 z coordinate of momentum vector More...
 
virtual double rapidity () const final
 rapidity More...
 
virtual void setCharge (Charge q) final
 set electric charge More...
 
virtual void setLongLived () final
 
virtual void setMass (double m) final
 set particle mass More...
 
virtual void setMassConstraint () final
 
virtual void setP4 (const LorentzVector &p4) final
 set 4-momentum More...
 
virtual void setP4 (const PolarLorentzVector &p4) final
 set 4-momentum More...
 
virtual void setPdgId (int pdgId) final
 
virtual void setPz (double pz) final
 
virtual void setStatus (int status) final
 set status word More...
 
virtual void setThreeCharge (Charge qx3) final
 set electric charge More...
 
virtual void setVertex (const Point &vertex)
 set vertex More...
 
virtual CandidatePtr sourceCandidatePtr (size_type i) const
 
virtual int status () const final
 status word More...
 
virtual double theta () const final
 momentum polar angle More...
 
virtual int threeCharge () const final
 electric charge More...
 
virtual const Pointvertex () const
 vertex position (overwritten by PF...) More...
 
virtual double vertexChi2 () const
 chi-squares More...
 
virtual double vertexCovariance (int i, int j) const
 (i, j)-th element of error matrix, i, j = 0, ... 2 More...
 
CovarianceMatrix vertexCovariance () const final
 return SMatrix More...
 
virtual double vertexNdof () const
 
virtual double vertexNormalizedChi2 () const
 chi-squared divided by n.d.o.f. More...
 
virtual double vx () const
 x coordinate of vertex position More...
 
virtual double vy () const
 y coordinate of vertex position More...
 
virtual double vz () const
 z coordinate of vertex position More...
 
virtual double y () const final
 rapidity More...
 
virtual ~LeafCandidate ()
 destructor More...
 
- Public Member Functions inherited from reco::Candidate
const_iterator begin () const
 first daughter const_iterator More...
 
iterator begin ()
 first daughter iterator More...
 
 Candidate ()
 default constructor More...
 
const_iterator end () const
 last daughter const_iterator More...
 
iterator end ()
 last daughter iterator More...
 
template<typename T >
T get () const
 get a component More...
 
template<typename T , typename Tag >
T get () const
 get a component More...
 
template<typename T >
T get (size_type i) const
 get a component More...
 
template<typename T , typename Tag >
T get (size_type i) const
 get a component More...
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
template<typename T >
size_type numberOf () const
 number of components More...
 
template<typename T , typename Tag >
size_type numberOf () const
 number of components More...
 
virtual void setSourceCandidatePtr (const CandidatePtr &ptr)
 Set the ptr to the source Candidate. More...
 
virtual ~Candidate ()
 destructor More...
 

Protected Attributes

PackedMETUncertainty caloPackedMet_
 
std::vector< PackedMETUncertaintycorrections_
 
std::vector< PackedMETUncertaintyuncertainties_
 
std::vector< PackedMETUncertaintyuncertaintiesRaw_
 
std::vector< PackedMETUncertaintyuncertaintiesType1_
 
std::vector< PackedMETUncertaintyuncertaintiesType1p2_
 
- Protected Attributes inherited from pat::PATObject< reco::MET >
std::vector< std::string > efficiencyNames_
 vector of the efficiencies (names) More...
 
std::vector< pat::LookupTableRecordefficiencyValues_
 vector of the efficiencies (values) More...
 
std::vector< reco::GenParticlegenParticleEmbedded_
 vector to hold an embedded generator level particle More...
 
std::vector< reco::GenParticleRefgenParticleRef_
 Reference to a generator level particle. More...
 
std::vector< std::string > kinResolutionLabels_
 
std::vector< pat::CandKinResolutionkinResolutions_
 Kinematic resolutions. More...
 
std::vector< reco::CandidatePtrVectoroverlapItems_
 Overlapping items (sorted by distance) More...
 
std::vector< std::string > overlapLabels_
 Overlapping test labels (only if there are any overlaps) More...
 
edm::Ptr< reco::CandidaterefToOrig_
 
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
 vector of trigger matches More...
 
std::vector< std::string > userCandLabels_
 
std::vector< reco::CandidatePtruserCands_
 
std::vector< std::string > userDataLabels_
 User data object. More...
 
pat::UserDataCollection userDataObjects_
 
std::vector< std::string > userFloatLabels_
 
std::vector< float > userFloats_
 
std::vector< std::string > userIntLabels_
 
std::vector< int32_t > userInts_
 

Private Member Functions

const PackedMETUncertainty findMETTotalShift (MET::METCorrectionLevel cor, MET::METUncertainty shift) const
 
void initCorMap ()
 

Private Attributes

std::vector< SpecificCaloMETDatacaloMET_
 
std::map< MET::METCorrectionLevel, std::vector< MET::METCorrectionType > > corMap_
 
std::vector< reco::GenMETgenMET_
 
double metSig_
 
std::vector< SpecificPFMETDatapfMET_
 

Additional Inherited Members

- Protected Member Functions inherited from pat::PATObject< reco::MET >
void addUserDataObject_ (const std::string &label, std::unique_ptr< pat::UserData > value, bool overwrite=false)
 
- Protected Member Functions inherited from reco::RecoCandidate
template<typename R >
bool checkOverlap (const R &r1, const R &r2) const
 check if two components overlap More...
 

Detailed Description

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

Author
Steven Lowette, Giovanni Petrucciani, Frederic Ronga, Slava Krutelyov

Definition at line 43 of file MET.h.

Member Enumeration Documentation

Enumerator
Raw 
Type1 
Type01 
TypeXY 
Type1XY 
Type01XY 
Type1Smear 
Type01Smear 
Type1SmearXY 
Type01SmearXY 
RawCalo 
METCorrectionLevelSize 

Definition at line 159 of file MET.h.

Enumerator
None 
T1 
T0 
TXY 
TXYForRaw 
TXYForT01 
TXYForT1Smear 
TXYForT01Smear 
Smear 
Calo 
METCorrectionTypeSize 

Definition at line 164 of file MET.h.

Enumerator
JetResUp 
JetResDown 
JetEnUp 
JetEnDown 
MuonEnUp 
MuonEnDown 
ElectronEnUp 
ElectronEnDown 
TauEnUp 
TauEnDown 
UnclusteredEnUp 
UnclusteredEnDown 
PhotonEnUp 
PhotonEnDown 
NoShift 
METUncertaintySize 
JetResUpSmear 
JetResDownSmear 
METFullUncertaintySize 

Definition at line 152 of file MET.h.

Constructor & Destructor Documentation

MET::MET ( )

default constructor

Definition at line 11 of file MET.cc.

References initCorMap().

Referenced by clone().

11  {
12  initCorMap();
13 }
void initCorMap()
Definition: MET.cc:132
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(), initCorMap(), metSig_, operator=(), packedPFCandidateRefMixer_cfi::pf, and pfMET_.

17  : PATObject<reco::MET>(aMET) {
18  const reco::CaloMET * calo = dynamic_cast<const reco::CaloMET *>(&aMET);
19  if (calo != 0) caloMET_.push_back(calo->getSpecific());
20  const reco::PFMET * pf = dynamic_cast<const reco::PFMET *>(&aMET);
21  if (pf != 0) pfMET_.push_back(pf->getSpecific());
22  const pat::MET * pm = dynamic_cast<const pat::MET *>(&aMET);
23  if (pm != 0) this->operator=(*pm);
24 
25  metSig_ =0.;
26  initCorMap();
27 }
Analysis-level MET class.
Definition: MET.h:43
SpecificPFMETData getSpecific() const
Definition: PFMET.h:72
double metSig_
Definition: MET.h:253
SpecificCaloMETData getSpecific() const
Definition: CaloMET.h:79
void initCorMap()
Definition: MET.cc:132
MET & operator=(MET const &)
Definition: MET.cc:93
std::vector< SpecificCaloMETData > caloMET_
Definition: MET.h:248
std::vector< SpecificPFMETData > pfMET_
Definition: MET.h:250
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 31 of file MET.cc.

References caloMET_, edm::RefToBase< T >::get(), reco::PFMET::getSpecific(), reco::CaloMET::getSpecific(), initCorMap(), metSig_, operator=(), packedPFCandidateRefMixer_cfi::pf, and pfMET_.

31  : PATObject<reco::MET>(aMETRef) {
32  const reco::CaloMET * calo = dynamic_cast<const reco::CaloMET *>(aMETRef.get());
33  if (calo != 0) caloMET_.push_back(calo->getSpecific());
34  const reco::PFMET * pf = dynamic_cast<const reco::PFMET *>(aMETRef.get());
35  if (pf != 0) pfMET_.push_back(pf->getSpecific());
36  const pat::MET * pm = dynamic_cast<const pat::MET *>(aMETRef.get());
37  if (pm != 0) this->operator=(*pm);
38 
39  metSig_ =0.;
40  initCorMap();
41 }
Analysis-level MET class.
Definition: MET.h:43
value_type const * get() const
Definition: RefToBase.h:234
SpecificPFMETData getSpecific() const
Definition: PFMET.h:72
double metSig_
Definition: MET.h:253
SpecificCaloMETData getSpecific() const
Definition: CaloMET.h:79
void initCorMap()
Definition: MET.cc:132
MET & operator=(MET const &)
Definition: MET.cc:93
std::vector< SpecificCaloMETData > caloMET_
Definition: MET.h:248
std::vector< SpecificPFMETData > pfMET_
Definition: MET.h:250
MET::MET ( const edm::Ptr< reco::MET > &  aMETRef)

constructor from a Ptr to a reco::MET

constructor from ref to reco::MET

Definition at line 44 of file MET.cc.

References caloMET_, edm::Ptr< T >::get(), reco::PFMET::getSpecific(), reco::CaloMET::getSpecific(), initCorMap(), metSig_, operator=(), packedPFCandidateRefMixer_cfi::pf, and pfMET_.

44  : PATObject<reco::MET>(aMETRef) {
45  const reco::CaloMET * calo = dynamic_cast<const reco::CaloMET *>(aMETRef.get());
46  if (calo != 0) caloMET_.push_back(calo->getSpecific());
47  const reco::PFMET * pf = dynamic_cast<const reco::PFMET *>(aMETRef.get());
48  if (pf != 0) pfMET_.push_back(pf->getSpecific());
49  const pat::MET * pm = dynamic_cast<const pat::MET *>(aMETRef.get());
50  if (pm != 0) this->operator=(*pm);
51 
52  metSig_ =0.;
53  initCorMap();
54 }
Analysis-level MET class.
Definition: MET.h:43
SpecificPFMETData getSpecific() const
Definition: PFMET.h:72
double metSig_
Definition: MET.h:253
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:160
SpecificCaloMETData getSpecific() const
Definition: CaloMET.h:79
void initCorMap()
Definition: MET.cc:132
MET & operator=(MET const &)
Definition: MET.cc:93
std::vector< SpecificCaloMETData > caloMET_
Definition: MET.h:248
std::vector< SpecificPFMETData > pfMET_
Definition: MET.h:250
MET::MET ( MET const &  iOther)

copy constructor

Definition at line 57 of file MET.cc.

References initCorMap().

57  :
58 PATObject<reco::MET>(iOther),
59 genMET_(iOther.genMET_),
60 caloMET_(iOther.caloMET_),
61 pfMET_(iOther.pfMET_),
62 metSig_(iOther.metSig_),
63 uncertaintiesRaw_(iOther.uncertaintiesRaw_), //74X reading compatibility
64 uncertaintiesType1_(iOther.uncertaintiesType1_), //74X compatibility
65 uncertaintiesType1p2_(iOther.uncertaintiesType1p2_), //74X compatibility
66 uncertainties_(iOther.uncertainties_),
67 corrections_(iOther.corrections_),
68 caloPackedMet_(iOther.caloPackedMet_) {
69 
70  initCorMap();
71 }
std::vector< PackedMETUncertainty > uncertaintiesRaw_
Definition: MET.h:266
double metSig_
Definition: MET.h:253
std::vector< PackedMETUncertainty > uncertaintiesType1p2_
Definition: MET.h:266
std::vector< PackedMETUncertainty > uncertainties_
Definition: MET.h:268
PackedMETUncertainty caloPackedMet_
Definition: MET.h:271
std::vector< reco::GenMET > genMET_
Definition: MET.h:246
void initCorMap()
Definition: MET.cc:132
std::vector< SpecificCaloMETData > caloMET_
Definition: MET.h:248
std::vector< PackedMETUncertainty > uncertaintiesType1_
Definition: MET.h:266
std::vector< PackedMETUncertainty > corrections_
Definition: MET.h:269
std::vector< SpecificPFMETData > pfMET_
Definition: MET.h:250
MET::MET ( const reco::MET corMET,
const MET srcMET 
)

constructor for corrected METs (keeping specific informations from src MET)

constructor for corrected mets, keeping track of srcMET informations,

Definition at line 75 of file MET.cc.

References reco::MET::getSignificanceMatrix(), initCorMap(), and reco::MET::setSignificanceMatrix().

75  :
76 PATObject<reco::MET>(corMET),
77 genMET_(srcMET.genMET_),
78 caloMET_(srcMET.caloMET_),
79 pfMET_(srcMET.pfMET_),
80 metSig_(srcMET.metSig_),
82 
84 
85  initCorMap();
86 }
double metSig_
Definition: MET.h:253
void setSignificanceMatrix(const reco::METCovMatrix &matrix)
Definition: MET.cc:157
PackedMETUncertainty caloPackedMet_
Definition: MET.h:271
std::vector< reco::GenMET > genMET_
Definition: MET.h:246
void initCorMap()
Definition: MET.cc:132
std::vector< SpecificCaloMETData > caloMET_
Definition: MET.h:248
std::vector< SpecificPFMETData > pfMET_
Definition: MET.h:250
reco::METCovMatrix getSignificanceMatrix(void) const
Definition: MET.cc:139
MET::~MET ( )
virtual

destructor

Definition at line 89 of file MET.cc.

89  {
90 
91 }

Member Function Documentation

double pat::MET::CaloMETInmHF ( ) const
inline

Returns the event MET in HF-.

Definition at line 126 of file MET.h.

References SpecificCaloMETData::CaloMETInmHF, and caloSpecific().

126 {return caloSpecific().CaloMETInmHF;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double pat::MET::CaloMETInpHF ( ) const
inline

Returns the event MET in HF+.

Definition at line 124 of file MET.h.

References SpecificCaloMETData::CaloMETInpHF, and caloSpecific().

124 {return caloSpecific().CaloMETInpHF;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
MET::Vector2 MET::caloMETP2 ( ) const

Definition at line 372 of file MET.cc.

References shiftedP2().

Referenced by caloMETPhi(), caloMETPt(), and uncorPhi().

372  {
373  return shiftedP2(MET::METUncertainty::NoShift, MET::METCorrectionLevel::RawCalo );
374 }
Vector2 shiftedP2(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:226
double MET::caloMETPhi ( ) const

Definition at line 380 of file MET.cc.

References caloMETP2(), and pat::MET::Vector2::phi().

Referenced by uncorPhi().

380  {
381  return caloMETP2().phi();
382 }
Vector2 caloMETP2() const
Definition: MET.cc:372
double phi() const
Definition: MET.h:173
double pat::MET::CaloMETPhiInmHF ( ) const
inline

Returns the event MET-phi in HF-.

Definition at line 130 of file MET.h.

References SpecificCaloMETData::CaloMETPhiInmHF, and caloSpecific().

130 {return caloSpecific().CaloMETPhiInmHF;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double pat::MET::CaloMETPhiInpHF ( ) const
inline

Returns the event MET-phi in HF+.

Definition at line 128 of file MET.h.

References SpecificCaloMETData::CaloMETPhiInpHF, and caloSpecific().

128 {return caloSpecific().CaloMETPhiInpHF;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double MET::caloMETPt ( ) const

Definition at line 376 of file MET.cc.

References caloMETP2(), and pat::MET::Vector2::pt().

Referenced by uncorPhi().

376  {
377  return caloMETP2().pt();
378 }
Vector2 caloMETP2() const
Definition: MET.cc:372
double pt() const
Definition: MET.h:172
double pat::MET::caloMetSignificance ( ) const
inline

Returns the event MET Significance.

Definition at line 118 of file MET.h.

References caloSpecific(), and SpecificCaloMETData::METSignificance.

118 {return caloSpecific().METSignificance;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double MET::caloMETSumEt ( ) const

Definition at line 384 of file MET.cc.

References NoShift, RawCalo, and shiftedSumEt().

Referenced by uncorPhi().

384  {
386 }
double shiftedSumEt(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:297
double pat::MET::CaloSETInmHF ( ) const
inline

Returns the event SET in HF-.

Definition at line 122 of file MET.h.

References SpecificCaloMETData::CaloSETInmHF, and caloSpecific().

122 {return caloSpecific().CaloSETInmHF;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double pat::MET::CaloSETInpHF ( ) const
inline

Returns the event SET in HF+.

Definition at line 120 of file MET.h.

References SpecificCaloMETData::CaloSETInpHF, and caloSpecific().

120 {return caloSpecific().CaloSETInpHF;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
const SpecificCaloMETData& pat::MET::caloSpecific ( ) const
inline

accessor for the CaloMET-specific structure

Definition at line 132 of file MET.h.

References caloMET_, Exception, and isCaloMET().

Referenced by CaloMETInmHF(), CaloMETInpHF(), CaloMETPhiInmHF(), CaloMETPhiInpHF(), caloMetSignificance(), CaloSETInmHF(), CaloSETInpHF(), emEtFraction(), emEtInEB(), emEtInEE(), emEtInHF(), etFractionHadronic(), hadEtInHB(), hadEtInHE(), hadEtInHF(), hadEtInHO(), maxEtInEmTowers(), and maxEtInHadTowers().

132  {
133  if (!isCaloMET()) throw cms::Exception("pat::MET") << "This pat::MET has not been made from a reco::CaloMET\n";
134  return caloMET_[0];
135  }
bool isCaloMET() const
True if this pat::MET was made from a reco::CaloMET.
Definition: MET.h:88
std::vector< SpecificCaloMETData > caloMET_
Definition: MET.h:248
double pat::MET::ChargedEMEtFraction ( ) const
inline

Definition at line 140 of file MET.h.

References SpecificPFMETData::ChargedEMFraction, and pfSpecific().

Referenced by METTester::analyze(), and METAnalyzer::fillMonitorElement().

140 { return pfSpecific().ChargedEMFraction; }
const SpecificPFMETData & pfSpecific() const
accessor for the pfMET-specific structure
Definition: MET.h:146
double pat::MET::ChargedHadEtFraction ( ) const
inline

Definition at line 141 of file MET.h.

References SpecificPFMETData::ChargedHadFraction, and pfSpecific().

Referenced by METTester::analyze(), and METAnalyzer::fillMonitorElement().

141 { return pfSpecific().ChargedHadFraction; }
const SpecificPFMETData & pfSpecific() const
accessor for the pfMET-specific structure
Definition: MET.h:146
virtual MET* pat::MET::clone ( void  ) const
inlinevirtual

required reimplementation of the Candidate's clone method

Reimplemented from reco::MET.

Definition at line 65 of file MET.h.

References genMET(), MET(), metSignificance(), setGenMET(), and setMETSignificance().

65 { return new MET(*this); }
MET()
default constructor
Definition: MET.cc:11
MET::Vector2 MET::corP2 ( MET::METCorrectionLevel  cor = Type1) const

Definition at line 319 of file MET.cc.

References NoShift, and shiftedP2().

Referenced by corPhi(), corPt(), corPx(), corPy(), and shiftedPhi().

319  {
320  return shiftedP2(MET::NoShift, cor );
321 }
Vector2 shiftedP2(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:226
MET::Vector MET::corP3 ( MET::METCorrectionLevel  cor = Type1) const

Definition at line 322 of file MET.cc.

References NoShift, and shiftedP3().

Referenced by shiftedPhi().

322  {
323  return shiftedP3(MET::NoShift, cor );
324 }
Vector shiftedP3(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:249
MET::LorentzVector MET::corP4 ( MET::METCorrectionLevel  cor = Type1) const

Definition at line 325 of file MET.cc.

References NoShift, and shiftedP4().

Referenced by shiftedPhi().

325  {
326  return shiftedP4(MET::NoShift, cor );
327 }
LorentzVector shiftedP4(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:272
double pat::MET::corPhi ( METCorrectionLevel  level = Type1) const
inline

Definition at line 191 of file MET.h.

References corP2(), corSumEt(), hcalDigis_cfi::level, pat::MET::Vector2::phi(), Type1, uncorP2(), uncorP3(), and uncorP4().

191 { return corP2(level).phi(); };
Vector2 corP2(METCorrectionLevel level=Type1) const
Definition: MET.cc:319
double phi() const
Definition: MET.h:173
double pat::MET::corPt ( METCorrectionLevel  level = Type1) const
inline

Definition at line 190 of file MET.h.

References corP2(), hcalDigis_cfi::level, and pat::MET::Vector2::pt().

190 { return corP2(level).pt(); };
Vector2 corP2(METCorrectionLevel level=Type1) const
Definition: MET.cc:319
double pt() const
Definition: MET.h:172
double pat::MET::corPx ( METCorrectionLevel  level = Type1) const
inline

Definition at line 188 of file MET.h.

References corP2(), hcalDigis_cfi::level, and pat::MET::Vector2::px.

Referenced by pat::PATMETSlimmer::OneMETShift::readAndSet().

188 { return corP2(level).px; };
double px
Definition: MET.h:171
Vector2 corP2(METCorrectionLevel level=Type1) const
Definition: MET.cc:319
double pat::MET::corPy ( METCorrectionLevel  level = Type1) const
inline

Definition at line 189 of file MET.h.

References corP2(), hcalDigis_cfi::level, and pat::MET::Vector2::py.

Referenced by pat::PATMETSlimmer::OneMETShift::readAndSet().

189 { return corP2(level).py; };
Vector2 corP2(METCorrectionLevel level=Type1) const
Definition: MET.cc:319
double py
Definition: MET.h:171
double MET::corSumEt ( MET::METCorrectionLevel  cor = Type1) const

Definition at line 328 of file MET.cc.

References NoShift, and shiftedSumEt().

Referenced by corPhi(), and pat::PATMETSlimmer::OneMETShift::readAndSet().

328  {
329  return shiftedSumEt(MET::NoShift, cor );
330 }
double shiftedSumEt(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:297
double pat::MET::emEtFraction ( ) const
inline

Returns the event electromagnetic energy fraction.

Definition at line 102 of file MET.h.

References caloSpecific(), and SpecificCaloMETData::EtFractionEm.

102 {return caloSpecific().EtFractionEm;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double pat::MET::emEtInEB ( ) const
inline

Returns the event electromagnetic energy in EB.

Definition at line 112 of file MET.h.

References caloSpecific(), and SpecificCaloMETData::EmEtInEB.

112 {return caloSpecific().EmEtInEB;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double pat::MET::emEtInEE ( ) const
inline

Returns the event electromagnetic energy in EE.

Definition at line 114 of file MET.h.

References caloSpecific(), and SpecificCaloMETData::EmEtInEE.

114 {return caloSpecific().EmEtInEE;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double pat::MET::emEtInHF ( ) const
inline

Returns the event electromagnetic energy extracted from HF.

Definition at line 116 of file MET.h.

References caloSpecific(), and SpecificCaloMETData::EmEtInHF.

116 {return caloSpecific().EmEtInHF;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double pat::MET::etFractionHadronic ( ) const
inline

Returns the event hadronic energy fraction.

Definition at line 100 of file MET.h.

References caloSpecific(), and SpecificCaloMETData::EtFractionHadronic.

const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
const MET::PackedMETUncertainty MET::findMETTotalShift ( MET::METCorrectionLevel  cor,
MET::METUncertainty  shift 
) const
private

Definition at line 190 of file MET.cc.

References pat::MET::PackedMETUncertainty::add(), corMap_, corrections_, reco::MET::dsumEt(), Exception, mps_fire::i, JetResDown, METUncertaintySize, Type1Smear, and uncertainties_.

Referenced by shiftedP2(), shiftedP3(), shiftedP4(), and shiftedSumEt().

190  {
191 
192  //find corrections shifts =============================
193  std::map<MET::METCorrectionLevel, std::vector<MET::METCorrectionType> >::const_iterator itCor_ = corMap_.find(cor);
194  if(itCor_==corMap_.end() ) throw cms::Exception("Unsupported", "Specified MET correction scheme does not exist");
195 
196  bool isSmeared=false;
197  MET::PackedMETUncertainty totShift;
198  unsigned int scor=itCor_->second.size();
199  for(unsigned int i=0; i<scor;i++) {
200  totShift.add( corrections_[ itCor_->second[i] ].dpx(),
201  corrections_[ itCor_->second[i] ].dpy(),
202  corrections_[ itCor_->second[i] ].dsumEt() );
203 
204  if(itCor_->first>=MET::Type1Smear)
205  isSmeared=true;
206  }
207 
208 
209 
210  //find uncertainty shift =============================
211 
212  if (uncertainties_.empty())
213  return totShift;
214 
215  if(shift>=MET::METUncertaintySize) throw cms::Exception("Unsupported", "MET uncertainty does not exist");
217 
218  totShift.add( uncertainties_[ shift ].dpx(),
219  uncertainties_[ shift ].dpy(),
220  uncertainties_[ shift ].dsumEt() );
221 
222  return totShift;
223 }
std::vector< double > dsumEt() const
Definition: MET.cc:126
candidate::const_iterator const_iterator
Definition: Candidate.h:31
std::vector< PackedMETUncertainty > uncertainties_
Definition: MET.h:268
METUncertainty
Definition: MET.h:152
std::map< MET::METCorrectionLevel, std::vector< MET::METCorrectionType > > corMap_
Definition: MET.h:257
std::vector< PackedMETUncertainty > corrections_
Definition: MET.h:269
static unsigned int const shift
const reco::GenMET * MET::genMET ( ) const

return the associated GenMET

return the generated MET from neutrinos

Definition at line 110 of file MET.cc.

References genMET_.

Referenced by clone().

110  {
111  return (genMET_.size() > 0 ? &genMET_.front() : 0 );
112 }
std::vector< reco::GenMET > genMET_
Definition: MET.h:246
double pat::MET::hadEtInHB ( ) const
inline

Returns the event hadronic energy in HB.

Definition at line 104 of file MET.h.

References caloSpecific(), and SpecificCaloMETData::HadEtInHB.

104 {return caloSpecific().HadEtInHB;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double pat::MET::hadEtInHE ( ) const
inline

Returns the event hadronic energy in HE.

Definition at line 108 of file MET.h.

References caloSpecific(), and SpecificCaloMETData::HadEtInHE.

108 {return caloSpecific().HadEtInHE;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double pat::MET::hadEtInHF ( ) const
inline

Returns the event hadronic energy in HF.

Definition at line 110 of file MET.h.

References caloSpecific(), and SpecificCaloMETData::HadEtInHF.

110 {return caloSpecific().HadEtInHF;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double pat::MET::hadEtInHO ( ) const
inline

Returns the event hadronic energy in HO.

Definition at line 106 of file MET.h.

References caloSpecific(), and SpecificCaloMETData::HadEtInHO.

106 {return caloSpecific().HadEtInHO;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
void MET::initCorMap ( )
private

Definition at line 132 of file MET.cc.

References Calo, corMap_, None, Raw, RawCalo, Smear, T0, T1, TXY, TXYForRaw, TXYForT01, TXYForT01Smear, TXYForT1Smear, Type01, Type01Smear, Type01SmearXY, Type01XY, Type1, Type1Smear, Type1SmearXY, Type1XY, and TypeXY.

Referenced by MET().

132  {
133 
134  std::vector<MET::METCorrectionType> tmpRaw;
135  std::vector<MET::METCorrectionType> tmpType1;
136  std::vector<MET::METCorrectionType> tmpType01;
137  std::vector<MET::METCorrectionType> tmpTypeXY;
138  std::vector<MET::METCorrectionType> tmpType1XY;
139  std::vector<MET::METCorrectionType> tmpType01XY;
140  std::vector<MET::METCorrectionType> tmpType1Smear;
141  std::vector<MET::METCorrectionType> tmpType01Smear;
142  std::vector<MET::METCorrectionType> tmpType1SmearXY;
143  std::vector<MET::METCorrectionType> tmpType01SmearXY;
144 
145  tmpRaw.push_back(MET::None);
146 
147  tmpType1.push_back(MET::T1);
148  tmpType01.push_back(MET::T1);
149  tmpType1XY.push_back(MET::T1);
150  tmpType01XY.push_back(MET::T1);
151  tmpType1Smear.push_back(MET::T1);
152  tmpType01Smear.push_back(MET::T1);
153  tmpType1SmearXY.push_back(MET::T1);
154  tmpType01SmearXY.push_back(MET::T1);
155 
156  tmpType01.push_back(MET::T0);
157  tmpType01XY.push_back(MET::T0);
158  tmpType01Smear.push_back(MET::T0);
159  tmpType01SmearXY.push_back(MET::T0);
160 
161  tmpType1Smear.push_back(MET::Smear);
162  tmpType01Smear.push_back(MET::Smear);
163  tmpType1SmearXY.push_back(MET::Smear);
164  tmpType01SmearXY.push_back(MET::Smear);
165 
166  tmpTypeXY.push_back(MET::TXYForRaw);
167  tmpType1XY.push_back(MET::TXY);
168  tmpType01XY.push_back(MET::TXYForT01);
169  tmpType1SmearXY.push_back(MET::TXYForT1Smear);
170  tmpType01SmearXY.push_back(MET::TXYForT01Smear);
171 
172  corMap_[MET::Raw] = tmpRaw;
173  corMap_[MET::Type1] = tmpType1;
174  corMap_[MET::Type01] = tmpType01;
175  corMap_[MET::TypeXY] = tmpTypeXY;
176  corMap_[MET::Type1XY] = tmpType1XY;
177  corMap_[MET::Type01XY] = tmpType01XY;
178  corMap_[MET::Type1Smear] = tmpType1Smear;
179  corMap_[MET::Type01Smear] = tmpType01Smear;
180  corMap_[MET::Type1SmearXY] = tmpType1SmearXY;
181  corMap_[MET::Type01SmearXY] = tmpType01SmearXY;
182 
183  //specific calo case
184  std::vector<MET::METCorrectionType> tmpRawCalo;
185  tmpRawCalo.push_back(MET::Calo);
186  corMap_[MET::RawCalo] = tmpRawCalo;
187 }
std::map< MET::METCorrectionLevel, std::vector< MET::METCorrectionType > > corMap_
Definition: MET.h:257
bool pat::MET::isCaloMET ( ) const
inline

True if this pat::MET was made from a reco::CaloMET.

Definition at line 88 of file MET.h.

References caloMET_.

Referenced by caloSpecific().

88 { return !caloMET_.empty(); }
std::vector< SpecificCaloMETData > caloMET_
Definition: MET.h:248
bool pat::MET::isPFMET ( ) const
inline

True if this pat::MET was made from a reco::pfMET.

Definition at line 90 of file MET.h.

References pfMET_.

Referenced by METTester::analyze(), and pfSpecific().

90 { return !pfMET_.empty(); }
std::vector< SpecificPFMETData > pfMET_
Definition: MET.h:250
bool pat::MET::isRecoMET ( ) const
inline

True if this pat::MET was NOT made from a reco::CaloMET nor a reco::pfMET.

Definition at line 92 of file MET.h.

References caloMET_, and pfMET_.

92 { return ( caloMET_.empty() && pfMET_.empty() ); }
std::vector< SpecificCaloMETData > caloMET_
Definition: MET.h:248
std::vector< SpecificPFMETData > pfMET_
Definition: MET.h:250
double pat::MET::maxEtInEmTowers ( ) const
inline

Returns the maximum energy deposited in ECAL towers.

Definition at line 96 of file MET.h.

References caloSpecific(), and SpecificCaloMETData::MaxEtInEmTowers.

96 {return caloSpecific().MaxEtInEmTowers;}
const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double pat::MET::maxEtInHadTowers ( ) const
inline

Returns the maximum energy deposited in HCAL towers.

Definition at line 98 of file MET.h.

References caloSpecific(), and SpecificCaloMETData::MaxEtInHadTowers.

const SpecificCaloMETData & caloSpecific() const
accessor for the CaloMET-specific structure
Definition: MET.h:132
double MET::metSignificance ( ) const

Definition at line 126 of file MET.cc.

References metSig_.

Referenced by clone().

126  {
127  return metSig_;
128 }
double metSig_
Definition: MET.h:253
double pat::MET::MuonEtFraction ( ) const
inline

Definition at line 142 of file MET.h.

References SpecificPFMETData::MuonFraction, and pfSpecific().

Referenced by METTester::analyze(), and METAnalyzer::fillMonitorElement().

142 { return pfSpecific().MuonFraction; }
const SpecificPFMETData & pfSpecific() const
accessor for the pfMET-specific structure
Definition: MET.h:146
double pat::MET::NeutralEMFraction ( ) const
inline

Definition at line 138 of file MET.h.

References SpecificPFMETData::NeutralEMFraction, and pfSpecific().

Referenced by METTester::analyze(), and METAnalyzer::fillMonitorElement().

138 { return pfSpecific().NeutralEMFraction; }
const SpecificPFMETData & pfSpecific() const
accessor for the pfMET-specific structure
Definition: MET.h:146
double pat::MET::NeutralHadEtFraction ( ) const
inline

Definition at line 139 of file MET.h.

References SpecificPFMETData::NeutralHadFraction, and pfSpecific().

Referenced by METTester::analyze(), and METAnalyzer::fillMonitorElement().

139 { return pfSpecific().NeutralHadFraction; }
const SpecificPFMETData & pfSpecific() const
accessor for the pfMET-specific structure
Definition: MET.h:146
MET & MET::operator= ( MET const &  iOther)

Definition at line 93 of file MET.cc.

References caloMET_, caloPackedMet_, corrections_, genMET_, metSig_, pfMET_, uncertainties_, uncertaintiesRaw_, uncertaintiesType1_, and uncertaintiesType1p2_.

Referenced by MET().

93  {
95  genMET_ = iOther.genMET_;
96  caloMET_ =iOther.caloMET_;
97  pfMET_ =iOther.pfMET_;
98  uncertaintiesRaw_ = iOther.uncertaintiesRaw_; //74X compatibility
99  uncertaintiesType1_ = iOther.uncertaintiesType1_;
100  uncertaintiesType1p2_ = iOther.uncertaintiesType1p2_;
101  uncertainties_ = iOther.uncertainties_;
102  corrections_ = iOther.corrections_;
103  metSig_ = iOther.metSig_;
104  caloPackedMet_ = iOther.caloPackedMet_;
105 
106  return *this;
107 }
std::vector< PackedMETUncertainty > uncertaintiesRaw_
Definition: MET.h:266
double metSig_
Definition: MET.h:253
std::vector< PackedMETUncertainty > uncertaintiesType1p2_
Definition: MET.h:266
std::vector< PackedMETUncertainty > uncertainties_
Definition: MET.h:268
PackedMETUncertainty caloPackedMet_
Definition: MET.h:271
std::vector< reco::GenMET > genMET_
Definition: MET.h:246
std::vector< SpecificCaloMETData > caloMET_
Definition: MET.h:248
std::vector< PackedMETUncertainty > uncertaintiesType1_
Definition: MET.h:266
std::vector< PackedMETUncertainty > corrections_
Definition: MET.h:269
Templated PAT object container.
Definition: PATObject.h:49
std::vector< SpecificPFMETData > pfMET_
Definition: MET.h:250
const SpecificPFMETData& pat::MET::pfSpecific ( ) const
inline

accessor for the pfMET-specific structure

Definition at line 146 of file MET.h.

References Exception, isPFMET(), and pfMET_.

Referenced by ChargedEMEtFraction(), ChargedHadEtFraction(), MuonEtFraction(), NeutralEMFraction(), NeutralHadEtFraction(), Type6EtFraction(), and Type7EtFraction().

146  {
147  if (!isPFMET()) throw cms::Exception("pat::MET") << "This pat::MET has not been made from a reco::PFMET\n";
148  return pfMET_[0];
149  }
bool isPFMET() const
True if this pat::MET was made from a reco::pfMET.
Definition: MET.h:90
std::vector< SpecificPFMETData > pfMET_
Definition: MET.h:250
void MET::setCorShift ( double  px,
double  py,
double  sumEt,
MET::METCorrectionType  level 
)

Definition at line 363 of file MET.cc.

References corrections_, hcalDigis_cfi::level, reco::LeafCandidate::px(), reco::LeafCandidate::py(), and reco::MET::sumEt().

Referenced by pat::PATMETSlimmer::OneMETShift::readAndSet(), and uncorPhi().

363  {
364  if (corrections_.empty()) {
365  corrections_.resize(MET::METCorrectionType::METCorrectionTypeSize);
366  }
367 
368  corrections_[level].set(px - this->px(), py - this->py(), sumEt - this->sumEt());
369 }
double sumEt() const
Definition: MET.h:56
virtual double px() const final
x coordinate of momentum vector
std::vector< PackedMETUncertainty > corrections_
Definition: MET.h:269
virtual double py() const final
y coordinate of momentum vector
void MET::setGenMET ( const reco::GenMET gm)

set the associated GenMET

method to set the generated MET

Definition at line 115 of file MET.cc.

References genMET_.

Referenced by clone(), and pat::PATMETProducer::produce().

115  {
116  genMET_.clear();
117  genMET_.push_back(gm);
118 }
std::vector< reco::GenMET > genMET_
Definition: MET.h:246
void MET::setMETSignificance ( const double &  metSig)

Definition at line 122 of file MET.cc.

References metSig_.

Referenced by clone(), pat::PATMETProducer::produce(), and CorrectedPATMETProducer::produce().

122  {
123  metSig_ = metSig;
124 }
double metSig_
Definition: MET.h:253
void MET::setUncShift ( double  px,
double  py,
double  sumEt,
METUncertainty  shift,
bool  isSmeared = false 
)

Definition at line 346 of file MET.cc.

References pat::MET::PackedMETUncertainty::dpx(), pat::MET::PackedMETUncertainty::dpy(), pat::MET::PackedMETUncertainty::dsumEt(), JetResDown, reco::LeafCandidate::px(), reco::LeafCandidate::py(), edm::shift, reco::MET::sumEt(), and uncertainties_.

Referenced by pat::PATMETSlimmer::OneMETShift::readAndSet(), and uncorPhi().

346  {
347  if (uncertainties_.empty()) {
348  uncertainties_.resize(METUncertainty::METFullUncertaintySize);
349  }
350 
351  if(isSmeared && shift<=MET::JetResDown) {
352  //changing reference to only get the uncertainty shift and not the smeared one
353  // which is performed independently
354  shift = (MET::METUncertainty)(METUncertainty::METUncertaintySize+shift+1);
355  const PackedMETUncertainty& ref = uncertainties_[METUncertainty::NoShift];
356  uncertainties_[shift].set(px + ref.dpx() - this->px(), py + ref.dpy() - this->py(), sumEt + ref.dsumEt() - this->sumEt() );
357  }
358  else
359  uncertainties_[shift].set(px - this->px(), py - this->py(), sumEt - this->sumEt());
360 
361 }
std::vector< PackedMETUncertainty > uncertainties_
Definition: MET.h:268
METUncertainty
Definition: MET.h:152
double sumEt() const
Definition: MET.h:56
virtual double px() const final
x coordinate of momentum vector
static unsigned int const shift
virtual double py() const final
y coordinate of momentum vector
MET::Vector2 MET::shiftedP2 ( MET::METUncertainty  shift,
MET::METCorrectionLevel  cor = Type1 
) const

Definition at line 226 of file MET.cc.

References caloPackedMet_, pat::MET::PackedMETUncertainty::dpx(), pat::MET::PackedMETUncertainty::dpy(), findMETTotalShift(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), shiftedP2_74x(), uncertaintiesRaw_, uncertaintiesType1_, and findQualityFiles::v.

Referenced by caloMETP2(), corP2(), pat::MET::Vector2::phi(), shiftedPhi(), shiftedPt(), shiftedPx(), shiftedPy(), and uncorP2().

226  {
227 
228  Vector2 vo;
229 
230  //backward compatibility with 74X samples -> the only one
231  // with uncertaintiesType1_/uncertaintiesRaw_ not empty
232  //will be removed once 74X is not used anymore
233  if(uncertaintiesType1_.size()!=0 || uncertaintiesRaw_.size()!=0) {
234  if(cor!=MET::METCorrectionLevel::RawCalo) {
235  vo = shiftedP2_74x(shift, cor);
236  } else {
237  Vector2 ret{ caloPackedMet_.dpx(), caloPackedMet_.dpy() };
238  vo = ret;
239  }
240  }
241  else {
242  const MET::PackedMETUncertainty& v = findMETTotalShift(cor,shift);
243  Vector2 ret{ (px() + v.dpx()), (py() + v.dpy()) };
244  //return ret;
245  vo = ret;
246  }
247  return vo;
248 }
std::vector< PackedMETUncertainty > uncertaintiesRaw_
Definition: MET.h:266
Vector2 shiftedP2_74x(METUncertainty shift, METCorrectionLevel level) const
Definition: MET.cc:389
const PackedMETUncertainty findMETTotalShift(MET::METCorrectionLevel cor, MET::METUncertainty shift) const
Definition: MET.cc:190
double dpy() const
Definition: MET.h:231
PackedMETUncertainty caloPackedMet_
Definition: MET.h:271
virtual double px() const final
x coordinate of momentum vector
double dpx() const
Definition: MET.h:230
std::vector< PackedMETUncertainty > uncertaintiesType1_
Definition: MET.h:266
static unsigned int const shift
virtual double py() const final
y coordinate of momentum vector
MET::Vector2 MET::shiftedP2_74x ( MET::METUncertainty  shift,
MET::METCorrectionLevel  level 
) const

Definition at line 389 of file MET.cc.

References Exception, reco::LeafCandidate::px(), reco::LeafCandidate::py(), Raw, edm::shift, Type1, uncertaintiesRaw_, uncertaintiesType1_, and findQualityFiles::v.

Referenced by shiftedP2(), and uncorPhi().

389  {
390  if (level != Type1 && level != Raw) throw cms::Exception("Unsupported", "MET uncertainties only supported for Raw and Type1 in 74X samples \n");
391  const std::vector<PackedMETUncertainty> &v = (level == Type1 ? uncertaintiesType1_ : uncertaintiesRaw_);
392  if (v.empty()) throw cms::Exception("Unsupported", "MET uncertainties not available for the specified correction type\n");
393  if (v.size() == 1) {
394  if (shift != MET::METUncertainty::NoShift) throw cms::Exception("Unsupported", "MET uncertainties not available for the specified correction type (only central value available)\n");
395  return Vector2{ (px() + v.front().dpx()), (py() + v.front().dpy()) };
396  }
397  Vector2 ret{ (px() + v[shift].dpx()), (py() + v[shift].dpy()) };
398  return ret;
399 }
std::vector< PackedMETUncertainty > uncertaintiesRaw_
Definition: MET.h:266
virtual double px() const final
x coordinate of momentum vector
std::vector< PackedMETUncertainty > uncertaintiesType1_
Definition: MET.h:266
static unsigned int const shift
virtual double py() const final
y coordinate of momentum vector
MET::Vector MET::shiftedP3 ( MET::METUncertainty  shift,
MET::METCorrectionLevel  cor = Type1 
) const

Definition at line 249 of file MET.cc.

References caloPackedMet_, pat::MET::PackedMETUncertainty::dpx(), pat::MET::PackedMETUncertainty::dpy(), findMETTotalShift(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), shiftedP3_74x(), tmp, uncertaintiesRaw_, uncertaintiesType1_, and findQualityFiles::v.

Referenced by corP3(), pat::MET::Vector2::phi(), and uncorP3().

249  {
250 
251  Vector vo;
252 
253  //backward compatibility with 74X samples -> the only one
254  // with uncertaintiesType1_/uncertaintiesRaw_ not empty
255  //will be removed once 74X is not used anymore
256  if(uncertaintiesType1_.size()!=0 || uncertaintiesRaw_.size()!=0) {
257  if(cor!=MET::METCorrectionLevel::RawCalo) {
258  vo = shiftedP3_74x(shift, cor);
259  } else {
261  vo = tmp;
262  }
263  }
264  else {
265  const MET::PackedMETUncertainty& v = findMETTotalShift(cor,shift);
266  //return Vector(px() + v.dpx(), py() + v.dpy(), 0);
267  Vector tmp(px() + v.dpx(), py() + v.dpy(), 0);
268  vo = tmp;
269  }
270  return vo;
271 }
std::vector< PackedMETUncertainty > uncertaintiesRaw_
Definition: MET.h:266
const PackedMETUncertainty findMETTotalShift(MET::METCorrectionLevel cor, MET::METUncertainty shift) const
Definition: MET.cc:190
double dpy() const
Definition: MET.h:231
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
PackedMETUncertainty caloPackedMet_
Definition: MET.h:271
virtual double px() const final
x coordinate of momentum vector
double dpx() const
Definition: MET.h:230
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::vector< PackedMETUncertainty > uncertaintiesType1_
Definition: MET.h:266
static unsigned int const shift
virtual double py() const final
y coordinate of momentum vector
Vector shiftedP3_74x(METUncertainty shift, METCorrectionLevel level) const
Definition: MET.cc:401
MET::Vector MET::shiftedP3_74x ( MET::METUncertainty  shift,
MET::METCorrectionLevel  level 
) const

Definition at line 401 of file MET.cc.

References Exception, reco::LeafCandidate::px(), reco::LeafCandidate::py(), Raw, Type1, uncertaintiesRaw_, uncertaintiesType1_, and findQualityFiles::v.

Referenced by shiftedP3(), and uncorPhi().

401  {
402  if (level != Type1 && level != Raw) throw cms::Exception("Unsupported", "MET uncertainties only supported for Raw and Type1 in 74X samples \n");
403  const std::vector<PackedMETUncertainty> &v = (level == Type1 ? uncertaintiesType1_ : uncertaintiesRaw_);
404  if (v.empty()) throw cms::Exception("Unsupported", "MET uncertainties not available for the specified correction type\n");
405  if (v.size() == 1) {
406  if (shift != MET::METUncertainty::NoShift) throw cms::Exception("Unsupported", "MET uncertainties not available for the specified correction type (only central value available)\n");
407  return Vector(px() + v.front().dpx(), py() + v.front().dpy(), 0);
408  }
409  return Vector(px() + v[shift].dpx(), py() + v[shift].dpy(), 0);
410 }
std::vector< PackedMETUncertainty > uncertaintiesRaw_
Definition: MET.h:266
virtual double px() const final
x coordinate of momentum vector
std::vector< PackedMETUncertainty > uncertaintiesType1_
Definition: MET.h:266
math::XYZVector Vector
point in the space
Definition: LeafCandidate.h:29
static unsigned int const shift
virtual double py() const final
y coordinate of momentum vector
MET::LorentzVector MET::shiftedP4 ( METUncertainty  shift,
MET::METCorrectionLevel  cor = Type1 
) const

Definition at line 272 of file MET.cc.

References caloPackedMet_, pat::MET::PackedMETUncertainty::dpx(), pat::MET::PackedMETUncertainty::dpy(), findMETTotalShift(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), shiftedP4_74x(), tmp, uncertaintiesRaw_, uncertaintiesType1_, findQualityFiles::v, x(), and reco::LeafCandidate::y().

Referenced by corP4(), pat::MET::Vector2::phi(), and uncorP4().

272  {
273 
274  LorentzVector vo;
275 
276  //backward compatibility with 74X samples -> the only one
277  // with uncertaintiesType1_/uncertaintiesRaw_ not empty
278  //will be removed once 74X is not used anymore
279  if(uncertaintiesType1_.size()!=0 || uncertaintiesRaw_.size()!=0) {
280  if(cor!=MET::METCorrectionLevel::RawCalo) {
281  vo = shiftedP4_74x(shift, cor);
282  } else {
283  double x = caloPackedMet_.dpx(), y = caloPackedMet_.dpy();
284  LorentzVector tmp(x, y, 0, std::hypot(x,y));
285  vo = tmp;
286  }
287  }
288  else {
289  const MET::PackedMETUncertainty& v = findMETTotalShift(cor,shift);
290  double x = px() + v.dpx(), y = py() + v.dpy();
291  //return LorentzVector(x, y, 0, std::hypot(x,y));
292  LorentzVector tmp(x, y, 0, std::hypot(x,y));
293  vo = tmp;
294  }
295  return vo;
296 }
std::vector< PackedMETUncertainty > uncertaintiesRaw_
Definition: MET.h:266
const PackedMETUncertainty findMETTotalShift(MET::METCorrectionLevel cor, MET::METUncertainty shift) const
Definition: MET.cc:190
double dpy() const
Definition: MET.h:231
math::XYZTLorentzVector LorentzVector
PackedMETUncertainty caloPackedMet_
Definition: MET.h:271
virtual double px() const final
x coordinate of momentum vector
double dpx() const
Definition: MET.h:230
LorentzVector shiftedP4_74x(METUncertainty shift, METCorrectionLevel level) const
Definition: MET.cc:412
virtual double y() const final
rapidity
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::vector< PackedMETUncertainty > uncertaintiesType1_
Definition: MET.h:266
static unsigned int const shift
virtual double py() const final
y coordinate of momentum vector
MET::LorentzVector MET::shiftedP4_74x ( METUncertainty  shift,
MET::METCorrectionLevel  level 
) const

Definition at line 412 of file MET.cc.

References Exception, reco::LeafCandidate::px(), reco::LeafCandidate::py(), Raw, edm::shift, Type1, uncertaintiesRaw_, uncertaintiesType1_, findQualityFiles::v, x(), and reco::LeafCandidate::y().

Referenced by shiftedP4(), and uncorPhi().

412  {
413  if (level != Type1 && level != Raw) throw cms::Exception("Unsupported", "MET uncertainties only supported for Raw and Type1 in 74X samples\n");
414  const std::vector<PackedMETUncertainty> &v = (level == Type1 ? uncertaintiesType1_ : uncertaintiesRaw_);
415  if (v.empty()) throw cms::Exception("Unsupported", "MET uncertainties not available for the specified correction type\n");
416  if (v.size() == 1) {
417  if (shift != MET::METUncertainty::NoShift) throw cms::Exception("Unsupported", "MET uncertainties not available for the specified correction type (only central value available)\n");
418  double x = px() + v.front().dpx(), y = py() + v.front().dpy();
419  return LorentzVector(x, y, 0, std::hypot(x,y));
420  }
421  double x = px() + v[shift].dpx(), y = py() + v[shift].dpy();
422  return LorentzVector(x, y, 0, std::hypot(x,y));
423 }
std::vector< PackedMETUncertainty > uncertaintiesRaw_
Definition: MET.h:266
virtual double px() const final
x coordinate of momentum vector
virtual double y() const final
rapidity
std::vector< PackedMETUncertainty > uncertaintiesType1_
Definition: MET.h:266
static unsigned int const shift
virtual double py() const final
y coordinate of momentum vector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: LeafCandidate.h:23
double pat::MET::shiftedPhi ( METUncertainty  shift,
METCorrectionLevel  level = Type1 
) const
inline

Definition at line 182 of file MET.h.

References corP2(), corP3(), corP4(), hcalDigis_cfi::level, pat::MET::Vector2::phi(), shiftedP2(), shiftedSumEt(), and Type1.

182 { return shiftedP2(shift,level).phi(); };
Vector2 shiftedP2(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:226
double phi() const
Definition: MET.h:173
static unsigned int const shift
double pat::MET::shiftedPt ( METUncertainty  shift,
METCorrectionLevel  level = Type1 
) const
inline

Definition at line 181 of file MET.h.

References hcalDigis_cfi::level, pat::MET::Vector2::pt(), and shiftedP2().

Referenced by METTester::analyze().

181 { return shiftedP2(shift,level).pt(); };
Vector2 shiftedP2(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:226
double pt() const
Definition: MET.h:172
static unsigned int const shift
double pat::MET::shiftedPx ( METUncertainty  shift,
METCorrectionLevel  level = Type1 
) const
inline

Definition at line 179 of file MET.h.

References hcalDigis_cfi::level, pat::MET::Vector2::px, and shiftedP2().

Referenced by pat::PATMETSlimmer::OneMETShift::readAndSet().

179 { return shiftedP2(shift,level).px; };
double px
Definition: MET.h:171
Vector2 shiftedP2(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:226
static unsigned int const shift
double pat::MET::shiftedPy ( METUncertainty  shift,
METCorrectionLevel  level = Type1 
) const
inline

Definition at line 180 of file MET.h.

References hcalDigis_cfi::level, pat::MET::Vector2::py, and shiftedP2().

Referenced by pat::PATMETSlimmer::OneMETShift::readAndSet().

180 { return shiftedP2(shift,level).py; };
Vector2 shiftedP2(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:226
double py
Definition: MET.h:171
static unsigned int const shift
double MET::shiftedSumEt ( MET::METUncertainty  shift,
MET::METCorrectionLevel  cor = Type1 
) const

Definition at line 297 of file MET.cc.

References caloPackedMet_, pat::MET::PackedMETUncertainty::dsumEt(), findMETTotalShift(), shiftedSumEt_74x(), reco::MET::sumEt(), uncertaintiesRaw_, uncertaintiesType1_, and findQualityFiles::v.

Referenced by caloMETSumEt(), corSumEt(), pat::PATMETSlimmer::OneMETShift::readAndSet(), shiftedPhi(), and uncorSumEt().

297  {
298 
299  double sumEto;
300 
301  //backward compatibility with 74X samples -> the only one
302  // with uncertaintiesType1_/uncertaintiesRaw_ not empty
303  //will be removed once 74X is not used anymore
304  if(uncertaintiesType1_.size()!=0 || uncertaintiesRaw_.size()!=0) {
305  if(cor!=MET::METCorrectionLevel::RawCalo) {
306  sumEto = shiftedSumEt_74x(shift, cor);
307  } else {
308  sumEto = caloPackedMet_.dsumEt();
309  }
310  }
311  else {
312  const MET::PackedMETUncertainty& v = findMETTotalShift(cor,shift);
313  //return sumEt() + v.dsumEt();
314  sumEto = sumEt() + v.dsumEt();
315  }
316  return sumEto;
317 }
std::vector< PackedMETUncertainty > uncertaintiesRaw_
Definition: MET.h:266
const PackedMETUncertainty findMETTotalShift(MET::METCorrectionLevel cor, MET::METUncertainty shift) const
Definition: MET.cc:190
double dsumEt() const
Definition: MET.h:232
double sumEt() const
Definition: MET.h:56
PackedMETUncertainty caloPackedMet_
Definition: MET.h:271
double shiftedSumEt_74x(METUncertainty shift, METCorrectionLevel level) const
Definition: MET.cc:425
std::vector< PackedMETUncertainty > uncertaintiesType1_
Definition: MET.h:266
static unsigned int const shift
double MET::shiftedSumEt_74x ( MET::METUncertainty  shift,
MET::METCorrectionLevel  level 
) const

Definition at line 425 of file MET.cc.

References Exception, Raw, edm::shift, reco::MET::sumEt(), Type1, uncertaintiesRaw_, uncertaintiesType1_, and findQualityFiles::v.

Referenced by shiftedSumEt(), and uncorPhi().

425  {
426  if (level != Type1 && level != Raw) throw cms::Exception("Unsupported", "MET uncertainties only supported for Raw and Type1 in 74X samples\n");
427  const std::vector<PackedMETUncertainty> &v = (level == Type1 ? uncertaintiesType1_ : uncertaintiesRaw_);
428  if (v.empty()) throw cms::Exception("Unsupported", "MET uncertainties not available for the specified correction type\n");
429  if (v.size() == 1) {
430  if (shift != MET::METUncertainty::NoShift) throw cms::Exception("Unsupported", "MET uncertainties not available for the specified correction type (only central value available)\n");
431  return sumEt() + v.front().dsumEt();
432  }
433  return sumEt() + v[shift].dsumEt();
434 }
std::vector< PackedMETUncertainty > uncertaintiesRaw_
Definition: MET.h:266
double sumEt() const
Definition: MET.h:56
std::vector< PackedMETUncertainty > uncertaintiesType1_
Definition: MET.h:266
static unsigned int const shift
double pat::MET::Type6EtFraction ( ) const
inline

Definition at line 143 of file MET.h.

References pfSpecific(), and SpecificPFMETData::Type6Fraction.

Referenced by METTester::analyze(), and METAnalyzer::fillMonitorElement().

143 { return pfSpecific().Type6Fraction; }
const SpecificPFMETData & pfSpecific() const
accessor for the pfMET-specific structure
Definition: MET.h:146
double pat::MET::Type7EtFraction ( ) const
inline

Definition at line 144 of file MET.h.

References pfSpecific(), and SpecificPFMETData::Type7Fraction.

Referenced by METTester::analyze(), and METAnalyzer::fillMonitorElement().

144 { return pfSpecific().Type7Fraction; }
const SpecificPFMETData & pfSpecific() const
accessor for the pfMET-specific structure
Definition: MET.h:146
MET::Vector2 MET::uncorP2 ( ) const

Definition at line 332 of file MET.cc.

References NoShift, Raw, and shiftedP2().

Referenced by corPhi(), uncorPhi(), uncorPt(), uncorPx(), and uncorPy().

332  {
333  return shiftedP2(MET::NoShift, MET::Raw );
334 }
Vector2 shiftedP2(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:226
MET::Vector MET::uncorP3 ( ) const

Definition at line 335 of file MET.cc.

References NoShift, Raw, and shiftedP3().

Referenced by corPhi().

335  {
336  return shiftedP3(MET::NoShift, MET::Raw );
337 }
Vector shiftedP3(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:249
MET::LorentzVector MET::uncorP4 ( ) const

Definition at line 338 of file MET.cc.

References NoShift, Raw, and shiftedP4().

Referenced by corPhi().

338  {
339  return shiftedP4(MET::NoShift, MET::Raw );
340 }
LorentzVector shiftedP4(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:272
double pat::MET::uncorPhi ( ) const
inline
double pat::MET::uncorPt ( ) const
inline

Definition at line 199 of file MET.h.

References pat::MET::Vector2::pt(), and uncorP2().

199 { return uncorP2().pt(); };
Vector2 uncorP2() const
Definition: MET.cc:332
double pt() const
Definition: MET.h:172
double pat::MET::uncorPx ( ) const
inline

Definition at line 197 of file MET.h.

References pat::MET::Vector2::px, and uncorP2().

197 { return uncorP2().px; };
double px
Definition: MET.h:171
Vector2 uncorP2() const
Definition: MET.cc:332
double pat::MET::uncorPy ( ) const
inline

Definition at line 198 of file MET.h.

References pat::MET::Vector2::py, and uncorP2().

198 { return uncorP2().py; };
Vector2 uncorP2() const
Definition: MET.cc:332
double py
Definition: MET.h:171
double MET::uncorSumEt ( ) const

Definition at line 341 of file MET.cc.

References NoShift, Raw, and shiftedSumEt().

Referenced by uncorPhi().

341  {
343 }
double shiftedSumEt(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.cc:297

Member Data Documentation

std::vector<SpecificCaloMETData> pat::MET::caloMET_
private

Definition at line 248 of file MET.h.

Referenced by caloSpecific(), isCaloMET(), isRecoMET(), MET(), and operator=().

PackedMETUncertainty pat::MET::caloPackedMet_
protected

Definition at line 271 of file MET.h.

Referenced by operator=(), shiftedP2(), shiftedP3(), shiftedP4(), and shiftedSumEt().

std::map<MET::METCorrectionLevel, std::vector<MET::METCorrectionType> > pat::MET::corMap_
private

Definition at line 257 of file MET.h.

Referenced by findMETTotalShift(), and initCorMap().

std::vector<PackedMETUncertainty> pat::MET::corrections_
protected

Definition at line 269 of file MET.h.

Referenced by findMETTotalShift(), operator=(), and setCorShift().

std::vector<reco::GenMET> pat::MET::genMET_
private

Definition at line 246 of file MET.h.

Referenced by genMET(), operator=(), and setGenMET().

double pat::MET::metSig_
private

Definition at line 253 of file MET.h.

Referenced by MET(), metSignificance(), operator=(), and setMETSignificance().

std::vector<SpecificPFMETData> pat::MET::pfMET_
private

Definition at line 250 of file MET.h.

Referenced by isPFMET(), isRecoMET(), MET(), operator=(), and pfSpecific().

std::vector<PackedMETUncertainty> pat::MET::uncertainties_
protected

Definition at line 268 of file MET.h.

Referenced by findMETTotalShift(), operator=(), and setUncShift().

std::vector<PackedMETUncertainty> pat::MET::uncertaintiesRaw_
protected
std::vector<PackedMETUncertainty> pat::MET::uncertaintiesType1_
protected
std::vector<PackedMETUncertainty> pat::MET::uncertaintiesType1p2_
protected

Definition at line 266 of file MET.h.

Referenced by operator=().