CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/TopQuarkAnalysis/TopHitFit/src/PatMETHitFitTranslator.cc

Go to the documentation of this file.
00001 //
00002 //     $Id: PatMETHitFitTranslator.cc,v 1.1 2011/05/26 09:47:00 mseidel Exp $
00003 //
00004 
00020 #include "TopQuarkAnalysis/TopHitFit/interface/METTranslatorBase.h"
00021 #include "DataFormats/PatCandidates/interface/MET.h"
00022 
00023 #include <cmath>
00024 
00025 namespace hitfit {
00026 
00027 
00028 template<>
00029 METTranslatorBase<pat::MET>::METTranslatorBase()
00030 {
00031     resolution_ = Resolution(std::string("0,0,12"));
00032 } // METTranslatorBase<pat::MET>::METTranslatorBase()
00033 
00034 
00035 template<>
00036 METTranslatorBase<pat::MET>::METTranslatorBase(const std::string& ifile)
00037 {
00038     const Defaults_Text defs(ifile);
00039     std::string resolution_string(defs.get_string("met_resolution"));
00040     resolution_ = Resolution(resolution_string);
00041 
00042 } // METTranslatorBase<pat::MET>::METTranslatorBase(const std::string& ifile)
00043 
00044 
00045 template<>
00046 METTranslatorBase<pat::MET>::~METTranslatorBase()
00047 {
00048 } // METTranslatorBase<pat::MET>::~METTranslatorBase()
00049 
00050 
00051 template<>
00052 Fourvec
00053 METTranslatorBase<pat::MET>::operator()(const pat::MET& m,
00054                                         bool useObjEmbRes /* = false */)
00055 {
00056     double px = m.px();
00057     double py = m.py();
00058 
00059     return Fourvec (px,py,0.0,sqrt(px*px + py*py));
00060 
00061 } // Fourvec METTranslatorBase<pat::MET>::operator()(const pat::MET& m)
00062 
00063 
00064 
00065 template<>
00066 Resolution
00067 METTranslatorBase<pat::MET>::KtResolution(const pat::MET& m,
00068                                           bool useObjEmbRes /* = false */) const
00069 {
00070     return resolution_;
00071 } // Resolution METTranslatorBase<pat::MET>::KtResolution(const pat::MET& m)
00072 
00073 
00074 
00075 template<>
00076 Resolution
00077 METTranslatorBase<pat::MET>::METResolution(const pat::MET& m,
00078                                            bool useObjEmbRes /* = false */) const
00079 {
00080     return KtResolution(m,useObjEmbRes);
00081 } // Resolution METTranslatorBase<pat::MET>::METResolution(const pat::MET& m)
00082 
00083 
00084 } // namespace hitfit