1 #ifndef RecoMET_METPUSubtraction_PFMEtSignInterfaceBase_h
2 #define RecoMET_METPUSubtraction_PFMEtSignInterfaceBase_h
47 double pt = particle->pt();
48 double eta = particle->eta();
49 double phi = particle->phi();
51 if (dynamic_cast<const reco::GsfElectron*>(particle) !=
nullptr ||
52 dynamic_cast<const pat::Electron*>(particle) !=
nullptr) {
60 }
else if (dynamic_cast<const reco::Photon*>(particle) !=
nullptr ||
61 dynamic_cast<const pat::Photon*>(particle) !=
nullptr) {
70 }
else if (dynamic_cast<const reco::Muon*>(particle) !=
nullptr ||
71 dynamic_cast<const pat::Muon*>(particle) !=
nullptr) {
75 if (dynamic_cast<const pat::Muon*>(particle) !=
nullptr) {
79 }
else if (dynamic_cast<const reco::Muon*>(particle) !=
nullptr) {
96 }
else if (dynamic_cast<const reco::PFTau*>(particle) !=
nullptr ||
97 dynamic_cast<const pat::Tau*>(particle) !=
nullptr) {
100 if (dynamic_cast<const pat::Tau*>(particle) !=
nullptr) {
103 }
else if (dynamic_cast<const reco::PFTau*>(particle) !=
nullptr) {
108 }
else if (dynamic_cast<const reco::PFJet*>(particle) !=
nullptr ||
109 dynamic_cast<const pat::Jet*>(particle) !=
nullptr) {
111 if (dynamic_cast<const reco::PFJet*>(particle) !=
nullptr) {
114 }
else if (dynamic_cast<const pat::Jet*>(particle) !=
nullptr) {
120 throw cms::Exception(
"addPFMEtSignObjects") <<
"PAT jet not of PF-type !!\n";
127 if (
lut_ && pt > 10.) {
130 if (x >
lut_->GetXaxis()->GetXmin() && x <
lut_->GetXaxis()->GetXmax() && y >
lut_->GetYaxis()->GetXmin() &&
131 y <
lut_->GetYaxis()->GetXmax()) {
132 int binIndex =
lut_->FindBin(x, y);
133 double addJERcorrFactor =
lut_->GetBinContent(binIndex);
142 return pfJetResolution;
143 }
else if (dynamic_cast<const reco::PFCandidate*>(particle) !=
nullptr) {
149 <<
"Invalid type of particle:"
150 <<
" valid types = { reco::GsfElectron/pat::Electron, reco::Photon/pat::Photon, reco::Muon/pat::Muon, "
151 "reco::PFTau/pat::Tau,"
152 <<
" reco::PFJet/pat::Jet, reco::PFCandidate } !!\n";
155 template <
typename T>
156 std::vector<metsig::SigInputObj>
compResolution(
const std::list<T*>& particles)
const {
157 LogDebug(
"compResolution") <<
" particles: entries = " << particles.size() << std::endl;
159 std::vector<metsig::SigInputObj> pfMEtSignObjects;
162 return pfMEtSignObjects;
167 template <
typename T>
169 std::vector<metsig::SigInputObj> pfMEtSignObjects =
compResolution(particles);
174 template <
typename T>
175 void addPFMEtSignObjects(std::vector<metsig::SigInputObj>& metSignObjects,
const std::list<T*>& particles)
const {
176 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_
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
const Point & vertex() const override
vertex position (overwritten by PF...)
virtual Constituents getJetConstituents() const
list of constituents
TrackRef track() const override
reference to a Track
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.
const LorentzVector & p4() const final
four-momentum Lorentz vector
metsig::SigInputObj evalPFJet(const reco::Jet *jet) const
std::vector< metsig::SigInputObj > compResolution(const std::list< T * > &particles) const
const JetBaseRef & jetRef() const
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)
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
reco::TrackRef track() const override
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
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.