1 #ifndef RecoMET_METPUSubtraction_PFMEtSignInterfaceBase_h 2 #define RecoMET_METPUSubtraction_PFMEtSignInterfaceBase_h 46 double pt = particle->pt();
47 double eta = particle->eta();
48 double phi = particle->phi();
50 if (dynamic_cast<const reco::GsfElectron*>(particle) !=
nullptr ||
51 dynamic_cast<const pat::Electron*>(particle) !=
nullptr) {
59 }
else if (dynamic_cast<const reco::Photon*>(particle) !=
nullptr ||
60 dynamic_cast<const pat::Photon*>(particle) !=
nullptr) {
69 }
else if (dynamic_cast<const reco::Muon*>(particle) !=
nullptr ||
70 dynamic_cast<const pat::Muon*>(particle) !=
nullptr) {
74 if (dynamic_cast<const pat::Muon*>(particle) !=
nullptr) {
78 }
else if (dynamic_cast<const reco::Muon*>(particle) !=
nullptr) {
95 }
else if (dynamic_cast<const reco::PFTau*>(particle) !=
nullptr ||
96 dynamic_cast<const pat::Tau*>(particle) !=
nullptr) {
99 if (dynamic_cast<const pat::Tau*>(particle) !=
nullptr) {
102 }
else if (dynamic_cast<const reco::PFTau*>(particle) !=
nullptr) {
107 }
else if (dynamic_cast<const reco::PFJet*>(particle) !=
nullptr ||
108 dynamic_cast<const pat::Jet*>(particle) !=
nullptr) {
110 if (dynamic_cast<const reco::PFJet*>(particle) !=
nullptr) {
113 }
else if (dynamic_cast<const pat::Jet*>(particle) !=
nullptr) {
119 throw cms::Exception(
"addPFMEtSignObjects") <<
"PAT jet not of PF-type !!\n";
126 if (
lut_ && pt > 10.) {
129 if (x >
lut_->GetXaxis()->GetXmin() && x <
lut_->GetXaxis()->GetXmax() && y >
lut_->GetYaxis()->GetXmin() &&
130 y <
lut_->GetYaxis()->GetXmax()) {
131 int binIndex =
lut_->FindBin(x, y);
132 double addJERcorrFactor =
lut_->GetBinContent(binIndex);
141 return pfJetResolution;
142 }
else if (dynamic_cast<const reco::PFCandidate*>(particle) !=
nullptr) {
148 <<
"Invalid type of particle:" 149 <<
" valid types = { reco::GsfElectron/pat::Electron, reco::Photon/pat::Photon, reco::Muon/pat::Muon, " 150 "reco::PFTau/pat::Tau," 151 <<
" reco::PFJet/pat::Jet, reco::PFCandidate } !!\n";
154 template <
typename T>
156 LogDebug(
"compResolution") <<
" particles: entries = " << particles.size() << std::endl;
158 std::vector<metsig::SigInputObj> pfMEtSignObjects;
161 return pfMEtSignObjects;
166 template <
typename T>
168 std::vector<metsig::SigInputObj> pfMEtSignObjects =
compResolution(particles);
173 template <
typename T>
175 for (
typename std::list<T*>::const_iterator particle = particles.begin(); particle != particles.end(); ++particle) {
value_type const * get() const
const reco::JetBaseRef & pfJetRef() const
metsig::SignAlgoResolutions * pfMEtResolution_
TrackRef track() const override
reference to a Track
bool isNonnull() const
Checks for non-null.
PFMEtSignInterfaceBase(const edm::ParameterSet &)
const PFSpecific & pfSpecific() const
retrieve the pf specific part of the jet
ROOT::Math::SMatrix< double, 2 > METCovMatrix
metsig::SigInputObj evalPF(const reco::PFCandidate *candidate) const
void addPFMEtSignObjects(std::vector< metsig::SigInputObj > &metSignObjects, const std::list< T * > &particles) const
virtual Constituents getJetConstituents() const
list of constituents
reco::TrackRef track() const override
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
double eval(const resolutionType &type, const resolutionFunc &func, const double &et, const double &phi, const double &eta, const double &p) const
Jets made from PFObjects.
metsig::SigInputObj evalPFJet(const reco::Jet *jet) const
std::vector< metsig::SigInputObj > compResolution(const std::list< T * > &particles) const
const JetBaseRef & jetRef() const
const Point & vertex() const override
vertex position (overwritten by PF...)
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
double phiError() const
error on phi
Abs< T >::type abs(const T &t)
const LorentzVector & p4() const final
four-momentum Lorentz vector
T const * get() const
Returns C++ pointer to the item.
~PFMEtSignInterfaceBase()
Analysis-level tau class.
bool isPFJet() const
check to see if the jet is a reco::PFJet
Analysis-level calorimeter jet class.
reco::METCovMatrix operator()(const std::list< T * > &particles) const
Particle reconstructed by the particle flow algorithm.
reco::METCovMatrix operator()(const std::vector< metsig::SigInputObj > &) const
metsig::SigInputObj compResolution(const T *particle) const
Analysis-level muon class.