File indexing completed on 2024-04-06 12:26:40
0001 #ifndef RECOMET_METALGORITHMS_SIGNALGORESOLUTIONS_H
0002 #define RECOMET_METALGORITHMS_SIGNALGORESOLUTIONS_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "DataFormats/Math/interface/LorentzVector.h"
0023 #include "FWCore/Framework/interface/Event.h"
0024 #include "DataFormats/Common/interface/Handle.h"
0025 #include "FWCore/Framework/interface/EventSetup.h"
0026 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0027 #include "DataFormats/METReco/interface/SigInputObj.h"
0028 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0029 #include "DataFormats/Candidate/interface/Candidate.h"
0030 #include "DataFormats/JetReco/interface/PFJet.h"
0031 #include "CondFormats/JetMETObjects/interface/JetResolution.h"
0032 #include "RecoParticleFlow/PFClusterTools/interface/PFEnergyResolution.h"
0033
0034 #include <map>
0035 #include <iostream>
0036 #include <vector>
0037
0038 namespace metsig {
0039
0040 enum resolutionType {
0041 caloEE,
0042 caloEB,
0043 caloHE,
0044 caloHO,
0045 caloHF,
0046 caloHB,
0047 jet,
0048 electron,
0049 tau,
0050 muon,
0051 PFtype1,
0052 PFtype2,
0053 PFtype3,
0054 PFtype4,
0055 PFtype5,
0056 PFtype6,
0057 PFtype7
0058 };
0059 enum resolutionFunc { ET, PHI, TRACKP, CONSTPHI };
0060
0061 class SignAlgoResolutions {
0062 public:
0063 SignAlgoResolutions() : functionmap_() { ; }
0064 SignAlgoResolutions(const edm::ParameterSet &iConfig);
0065
0066 void addResolutions(const edm::ParameterSet &iConfig);
0067 double eval(const resolutionType &type,
0068 const resolutionFunc &func,
0069 const double &et,
0070 const double &phi,
0071 const double &eta,
0072 const double &p) const;
0073 double eval(const resolutionType &type,
0074 const resolutionFunc &func,
0075 const double &et,
0076 const double &phi,
0077 const double &eta) const;
0078 metsig::SigInputObj evalPF(const reco::PFCandidate *candidate) const;
0079 metsig::SigInputObj evalPFJet(const reco::Jet *jet) const;
0080 bool isFilled() const { return !functionmap_.empty(); }
0081
0082 private:
0083 double getfunc(const resolutionType &type, const resolutionFunc &func, std::vector<double> &x) const;
0084 void addfunction(const resolutionType type, const resolutionFunc func, const std::vector<double> ¶meters);
0085 void initializeJetResolutions(const edm::ParameterSet &iConfig);
0086
0087 typedef std::pair<metsig::resolutionType, metsig::resolutionFunc> functionCombo;
0088 typedef std::vector<double> functionPars;
0089 std::map<functionCombo, functionPars> functionmap_;
0090
0091 double EtFunction(const functionPars &x, const functionPars &par) const;
0092 double PhiFunction(const functionPars &x, const functionPars &par) const;
0093 double PFunction(const functionPars &x, const functionPars &par) const;
0094 double PhiConstFunction(const functionPars &x, const functionPars &par) const;
0095 double ElectronPtResolution(const reco::PFCandidate *c) const;
0096
0097 double ptResolThreshold_;
0098
0099
0100
0101 std::vector<double> jdpt[10];
0102 std::vector<double> jdphi[10];
0103
0104 JetResolution *ptResol_;
0105 JetResolution *phiResol_;
0106 PFEnergyResolution *pfresol_;
0107 };
0108 }
0109 #endif