1 #include "../interface/Met.hh"
5 #include "../interface/city.h"
6 #include "boost/format.hpp"
23 std::cout <<
"--corrected METs--" << std::endl;
24 UBMmap::const_iterator uf_it;
25 for (uf_it = correctedmets_.begin(); uf_it != correctedmets_.end(); ++uf_it) {
26 std::cout << boost::format(
"%-30s %-30s\n") %
27 UnHashMetCor(uf_it->first) % uf_it->second;
40 UBMmap::const_iterator iter = correctedmets_.find(
CityHash64(name));
41 if (iter != correctedmets_.end()) {
44 std::cerr <<
"Warning in <Met::GetCorrectedMet>: MET \"" << name
45 <<
"\" not found" << std::endl;
55 UBMmap::const_iterator iter = shiftedmets_.find(
CityHash64(name));
56 if (iter != shiftedmets_.end()) {
59 std::cerr <<
"Warning in <Met::GetShiftedMet>: MET \"" << name
60 <<
"\" not found" << std::endl;
69 std::string Met::UnHashMetCor(std::size_t cor)
const {
71 static bool is_set =
false;
80 dict[
CityHash64(
"Type01Smear")] =
"Type01Smear";
81 dict[
CityHash64(
"Type1SmearXY")] =
"Type1SmearXY";
82 dict[
CityHash64(
"Type01SmearXY")] =
"Type01SmearXY";
86 TSmap::const_iterator it = dict.find(cor);
87 if (it != dict.end()) {
90 std::cerr <<
"Warning in <Met>: Unable to unhash \"" << cor
91 <<
"\", returning empty string" << std::endl;
96 std::string Met::UnHashMetUnc(std::size_t unc)
const {
98 static bool is_set =
false;
101 dict[
CityHash64(
"JetResDown")] =
"JetResDown";
105 dict[
CityHash64(
"MuonEnDown")] =
"MuonEnDown";
106 dict[
CityHash64(
"ElectronEnUp")] =
"ElectronEnUp";
107 dict[
CityHash64(
"ElectronEnDown")] =
"ElectronEnDown";
110 dict[
CityHash64(
"UnclusteredEnUp")] =
"UnclusteredEnUp";
111 dict[
CityHash64(
"UnclusteredEnDown")] =
"UnclusteredEnDown";
112 dict[
CityHash64(
"PhotonEnUp")] =
"PhotonEnUp";
113 dict[
CityHash64(
"PhotonEnDown")] =
"PhotonEnDown";
117 TSmap::const_iterator it = dict.find(unc);
118 if (it != dict.end()) {
121 std::cerr <<
"Warning in <Met>: Unable to unhash \"" << unc
122 <<
"\", returning empty string" << std::endl;
129 return os <<
" pt=" << met.
pt() <<
" phi=" << met.
phi() <<
" sumet=" << met.
sumet << std::endl;
virtual void Print() const
ic::Met::BasicMet GetCorrectedMet(std::string const &name) const
Returns a specific correction factor if name is defined, otherwise returns zero.
uint64 CityHash64(const char *buf, size_t len)
Stores a four-momentum, charge and identifier, and is the base class for most other physics objects...
ic::Met::BasicMet GetShiftedMet(std::string const &name) const
Returns a specific correction factor if name is defined, otherwise returns zero.
void SetCorrectedMet(std::string const &name, ic::Met::BasicMet const &value)
Store a corrected met, overwriting any existing value with label name
void SetShiftedMet(std::string const &name, ic::Met::BasicMet const &value)
Store a shifted met, overwriting any existing value with label name
std::ostream & operator<<(std::ostream &os, const ic::Met::BasicMet &met)
virtual void Print() const