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) {
77 if (
muon->track().isNonnull() &&
muon->track().isAvailable())
78 muonTrack =
muon->track().get();
79 }
else if (dynamic_cast<const reco::Muon*>(particle) !=
nullptr) {
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) {
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) {
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) {
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) {
metsig::SignAlgoResolutions * pfMEtResolution_
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
metsig::SigInputObj evalPFJet(const reco::Jet *jet) const
PFMEtSignInterfaceBase(const edm::ParameterSet &)
reco::METCovMatrix operator()(const std::list< T *> &particles) const
const reco::JetBaseRef & pfJetRef() const
ROOT::Math::SMatrix< double, 2 > METCovMatrix
void addPFMEtSignObjects(std::vector< metsig::SigInputObj > &metSignObjects, const std::list< T *> &particles) const
Jets made from PFObjects.
metsig::SigInputObj evalPF(const reco::PFCandidate *candidate) const
Abs< T >::type abs(const T &t)
~PFMEtSignInterfaceBase()
reco::METCovMatrix operator()(const std::vector< metsig::SigInputObj > &) const
Analysis-level tau class.
std::vector< metsig::SigInputObj > compResolution(const std::list< T *> &particles) const
double eval(const resolutionType &type, const resolutionFunc &func, const double &et, const double &phi, const double &eta, const double &p) const
Analysis-level calorimeter jet class.
Particle reconstructed by the particle flow algorithm.
const JetBaseRef & jetRef() const
metsig::SigInputObj compResolution(const T *particle) const
double phiError() const
error on phi
value_type const * get() const
Analysis-level muon class.