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) {
76 const pat::Muon*
muon = dynamic_cast<const pat::Muon*>(particle);
77 if (
muon->track().isNonnull() &&
muon->track().isAvailable())
78 muonTrack =
muon->track().get();
79 }
else if (dynamic_cast<const reco::Muon*>(particle) !=
nullptr) {
80 const reco::Muon*
muon = dynamic_cast<const reco::Muon*>(particle);
81 if (
muon->track().isNonnull() &&
muon->track().isAvailable())
82 muonTrack =
muon->track().get();
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) {
101 const pat::Tau* pfTau = dynamic_cast<const pat::Tau*>(particle);
103 }
else if (dynamic_cast<const reco::PFTau*>(particle) !=
nullptr) {
104 const reco::PFTau* pfTau = dynamic_cast<const reco::PFTau*>(particle);
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) {
112 const reco::PFJet* pfJet = dynamic_cast<const reco::PFJet*>(particle);
114 }
else if (dynamic_cast<const pat::Jet*>(particle) !=
nullptr) {
115 const pat::Jet*
jet = dynamic_cast<const pat::Jet*>(particle);
116 if (
jet->isPFJet()) {
120 throw cms::Exception(
"addPFMEtSignObjects") <<
"PAT jet not of PF-type !!\n";
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) {
144 const reco::PFCandidate* pfCandidate = dynamic_cast<const reco::PFCandidate*>(particle);
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>
157 LogDebug(
"compResolution") <<
" particles: entries = " <<
particles.size() << std::endl;
159 std::vector<metsig::SigInputObj> pfMEtSignObjects;
162 return pfMEtSignObjects;
167 template <
typename T>
174 template <
typename T>
176 for (
typename std::list<T*>::const_iterator particle =
particles.begin(); particle !=
particles.end(); ++particle) {