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) {
75 const pat::Muon*
muon = dynamic_cast<const pat::Muon*>(particle);
76 if (
muon->track().isNonnull() &&
muon->track().isAvailable())
77 muonTrack =
muon->track().get();
78 }
else if (dynamic_cast<const reco::Muon*>(particle) !=
nullptr) {
79 const reco::Muon*
muon = dynamic_cast<const reco::Muon*>(particle);
80 if (
muon->track().isNonnull() &&
muon->track().isAvailable())
81 muonTrack =
muon->track().get();
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) {
100 const pat::Tau* pfTau = dynamic_cast<const pat::Tau*>(particle);
102 }
else if (dynamic_cast<const reco::PFTau*>(particle) !=
nullptr) {
103 const reco::PFTau* pfTau = dynamic_cast<const reco::PFTau*>(particle);
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) {
111 const reco::PFJet* pfJet = dynamic_cast<const reco::PFJet*>(particle);
113 }
else if (dynamic_cast<const pat::Jet*>(particle) !=
nullptr) {
114 const pat::Jet*
jet = dynamic_cast<const pat::Jet*>(particle);
115 if (
jet->isPFJet()) {
119 throw cms::Exception(
"addPFMEtSignObjects") <<
"PAT jet not of PF-type !!\n";
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) {
143 const reco::PFCandidate* pfCandidate = dynamic_cast<const reco::PFCandidate*>(particle);
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>
173 template <
typename T>
175 for (
typename std::list<T*>::const_iterator particle =
particles.begin(); particle !=
particles.end(); ++particle) {