Go to the documentation of this file.00001 #ifndef RECOMET_METALGORITHMS_SIGNALGORESOLUTIONS_H
00002 #define RECOMET_METALGORITHMS_SIGNALGORESOLUTIONS_H
00003
00004
00005
00006
00007
00008
00016
00017
00018
00019
00020
00021
00022
00023 #include "DataFormats/Math/interface/LorentzVector.h"
00024 #include "FWCore/Framework/interface/Event.h"
00025 #include "DataFormats/Common/interface/Handle.h"
00026 #include "FWCore/Framework/interface/EventSetup.h"
00027 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00028 #include "RecoMET/METAlgorithms/interface/SigInputObj.h"
00029 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
00030 #include "DataFormats/Candidate/interface/Candidate.h"
00031 #include "DataFormats/JetReco/interface/PFJet.h"
00032 #include "CondFormats/JetMETObjects/interface/JetResolution.h"
00033
00034 #include <map>
00035 #include <iostream>
00036 #include <vector>
00037
00038 namespace metsig {
00039
00040 enum resolutionType { caloEE, caloEB, caloHE, caloHO, caloHF, caloHB, jet, electron, tau, muon,PFtype1,PFtype2, PFtype3, PFtype4, PFtype5, PFtype6, PFtype7 };
00041 enum resolutionFunc { ET, PHI,TRACKP,CONSTPHI };
00042
00043 class SignAlgoResolutions{
00044
00045 public:
00046 SignAlgoResolutions():functionmap_(){;}
00047 SignAlgoResolutions(const edm::ParameterSet &iConfig);
00048
00049 void addResolutions(const edm::ParameterSet &iConfig);
00050 double eval(const resolutionType & type, const resolutionFunc & func, const double & et, const double & phi, const double & eta, const double &p) const;
00051 double eval(const resolutionType & type, const resolutionFunc & func, const double & et, const double & phi, const double & eta) const;
00052 metsig::SigInputObj evalPF(const reco::PFCandidate* candidate) const;
00053 metsig::SigInputObj evalPFJet(const reco::PFJet *jet) const;
00054 bool isFilled() const {return functionmap_.size()>0;}
00055
00056 private:
00057 double getfunc(const resolutionType & type,const resolutionFunc & func, std::vector<double> & x) const;
00058 void addfunction(const resolutionType type, const resolutionFunc func, std::vector<double> parameters);
00059 void initializeJetResolutions( const edm::ParameterSet &iConfig );
00060
00061 typedef std::pair<metsig::resolutionType, metsig::resolutionFunc> functionCombo;
00062 typedef std::vector<double> functionPars;
00063 std::map<functionCombo,functionPars> functionmap_;
00064
00065 double EtFunction( const functionPars &x, const functionPars & par) const;
00066 double PhiFunction( const functionPars &x, const functionPars & par) const;
00067 double PFunction( const functionPars &x, const functionPars &par) const;
00068 double PhiConstFunction(const functionPars &x, const functionPars &par) const;
00069
00070 double ptResolThreshold_;
00071
00072
00073
00074 std::vector<double> jdpt[10];
00075 std::vector<double> jdphi[10];
00076
00077 JetResolution *ptResol_;
00078 JetResolution *phiResol_;
00079
00080 };
00081 }
00082 #endif