CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoMET/METAlgorithms/interface/SignAlgoResolutions.h

Go to the documentation of this file.
00001 #ifndef RECOMET_METALGORITHMS_SIGNALGORESOLUTIONS_H
00002 #define RECOMET_METALGORITHMS_SIGNALGORESOLUTIONS_H
00003 
00004 // -*- C++ -*-
00005 //
00006 // Package:    METAlgorithms
00007 // Class:      SignAlgoResolutions
00008 // 
00016 //
00017 // Original Author:  Kyle Story, Freya Blekman (Cornell University)
00018 //         Created:  Fri Apr 18 11:58:33 CEST 2008
00019 // $Id: SignAlgoResolutions.h,v 1.3 2010/11/29 10:12:50 akhukhun Exp $
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; // for example getvalue(caloHF,ET,et,phi,eta,p);
00051     double eval(const resolutionType & type, const resolutionFunc & func, const double & et, const double & phi, const double & eta) const; // for example getvalue(caloHF,ET,et,phi,eta,p);
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     //temporary fix for low pT jet resolutions
00072     //First index, eta bins, from 0 to 5;
00073     //Second index, pt bins, from 3 to 23 GeV;
00074     std::vector<double> jdpt[10];
00075     std::vector<double> jdphi[10];
00076      
00077     JetResolution *ptResol_;
00078     JetResolution *phiResol_;
00079 
00080   };
00081 }
00082 #endif