File indexing completed on 2024-04-06 12:31:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #include "TopQuarkAnalysis/TopHitFit/interface/METTranslatorBase.h"
0019 #include "DataFormats/PatCandidates/interface/MET.h"
0020
0021 #include <cmath>
0022
0023 namespace hitfit {
0024
0025 template <>
0026 METTranslatorBase<pat::MET>::METTranslatorBase() {
0027 resolution_ = Resolution(std::string("0,0,12"));
0028 }
0029
0030 template <>
0031 METTranslatorBase<pat::MET>::METTranslatorBase(const std::string& ifile) {
0032 const Defaults_Text defs(ifile);
0033 std::string resolution_string(defs.get_string("met_resolution"));
0034 resolution_ = Resolution(resolution_string);
0035
0036 }
0037
0038 template <>
0039 METTranslatorBase<pat::MET>::~METTranslatorBase() {}
0040
0041 template <>
0042 Fourvec METTranslatorBase<pat::MET>::operator()(const pat::MET& m, bool useObjEmbRes ) {
0043 double px = m.px();
0044 double py = m.py();
0045
0046 return Fourvec(px, py, 0.0, sqrt(px * px + py * py));
0047
0048 }
0049
0050 template <>
0051 Resolution METTranslatorBase<pat::MET>::KtResolution(const pat::MET& m, bool useObjEmbRes ) const {
0052 return resolution_;
0053 }
0054
0055 template <>
0056 Resolution METTranslatorBase<pat::MET>::METResolution(const pat::MET& m, bool useObjEmbRes ) const {
0057 return KtResolution(m, useObjEmbRes);
0058 }
0059
0060 }