49 genMET_(iOther.genMET_),
50 caloMET_(iOther.caloMET_),
51 pfMET_(iOther.pfMET_),
52 uncertaintiesRaw_(iOther.uncertaintiesRaw_),
53 uncertaintiesType1_(iOther.uncertaintiesType1_),
54 uncertaintiesType1p2_(iOther.uncertaintiesType1p2_),
55 caloPackedMet_(iOther.caloPackedMet_) {
91 return shiftedPt(MET::METUncertainty::NoShift, MET::METUncertaintyLevel::Raw);
94 return shiftedPhi(MET::METUncertainty::NoShift, MET::METUncertaintyLevel::Raw);
97 return shiftedSumEt(MET::METUncertainty::NoShift, MET::METUncertaintyLevel::Raw);
102 if (level !=
Type1 && level !=
Type1p2 && level !=
Raw)
throw cms::Exception(
"Unsupported",
"MET uncertainties only supported for Raw, Type1 and Type1p2\n");
104 if (v.empty())
throw cms::Exception(
"Unsupported",
"MET uncertainties not available for the specified correction type");
106 if (shift != MET::METUncertainty::NoShift)
throw cms::Exception(
"Unsupported",
"MET uncertainties not available for the specified correction type (only central value available)");
107 return Vector2{ (
px() + v.front().dpx()), (
py() + v.front().dpy()) };
113 if (level !=
Type1 && level !=
Type1p2 && level !=
Raw)
throw cms::Exception(
"Unsupported",
"MET uncertainties only supported for Raw, Type1 and Type1p2\n");
115 if (v.empty())
throw cms::Exception(
"Unsupported",
"MET uncertainties not available for the specified correction type");
117 if (shift != MET::METUncertainty::NoShift)
throw cms::Exception(
"Unsupported",
"MET uncertainties not available for the specified correction type (only central value available)");
118 return Vector(
px() + v.front().dpx(),
py() + v.front().dpy(), 0);
120 return Vector(
px() + v[shift].dpx(),
py() + v[shift].dpy(), 0);
123 if (level !=
Type1 && level !=
Type1p2 && level !=
Raw)
throw cms::Exception(
"Unsupported",
"MET uncertainties only supported for Raw, Type1 and Type1p2\n");
125 if (v.empty())
throw cms::Exception(
"Unsupported",
"MET uncertainties not available for the specified correction type");
127 if (shift != MET::METUncertainty::NoShift)
throw cms::Exception(
"Unsupported",
"MET uncertainties not available for the specified correction type (only central value available)");
128 double x =
px() + v.front().dpx(),
y =
py() + v.front().dpy();
135 if (level !=
Type1 && level !=
Type1p2 && level !=
Raw)
throw cms::Exception(
"Unsupported",
"MET uncertainties only supported for Raw, Type1 and Type1p2\n");
137 if (v.empty())
throw cms::Exception(
"Unsupported",
"MET uncertainties not available for the specified correction type");
139 if (shift != MET::METUncertainty::NoShift)
throw cms::Exception(
"Unsupported",
"MET uncertainties not available for the specified correction type (only central value available)");
140 return sumEt() + v.front().dsumEt();
146 if( level !=
Calo ) {
147 if (level !=
Type1 && level !=
Type1p2 && level !=
Raw)
throw cms::Exception(
"Unsupported",
"MET uncertainties only supported for Raw, Type1 and Type1p2\n");
149 if (shift == MET::METUncertainty::NoShift) {
152 v.back().set(px - this->
px(), py - this->
py(), sumEt - this->
sumEt());
153 }
else if (v.size() == 1) {
154 v.back().set(px - this->
px(), py - this->
py(), sumEt - this->
sumEt());
155 }
else if (v.size() != MET::METUncertainty::METUncertaintySize) {
157 throw cms::Exception(
"Unsupported",
"setShift called after the set of uncertainties is not of a supported size (not 0, 1, or METUncertaintySize)\n");
160 v[
shift].set(px - this->
px(), py - this->
py(), sumEt - this->
sumEt());
165 }
else if (v.size() == 1) {
167 }
else if (v.size() != MET::METUncertainty::METUncertaintySize) {
168 throw cms::Exception(
"Unsupported",
"setShift called after the set of uncertainties is not of a supported size (not 0, 1, or METUncertaintySize)\n");
170 v[
shift].set(px - this->
px(), py - this->
py(), sumEt - this->
sumEt());
Analysis-level MET class.
value_type const * get() const
std::vector< PackedMETUncertainty > uncertaintiesRaw_
SpecificPFMETData getSpecific() const
math::XYZVector Vector
point in the space
Vector2 caloMETP2() const
std::vector< PackedMETUncertainty > uncertaintiesType1p2_
T const * get() const
Returns C++ pointer to the item.
float uncorrectedPhi() const
double shiftedSumEt(METUncertainty shift, METUncertaintyLevel level=Type1) const
virtual double y() const
rapidity
static float float16to32(uint16_t h)
double caloMETSumEt() const
SpecificCaloMETData getSpecific() const
void setShift(double px, double py, double sumEt, METUncertainty shift, METUncertaintyLevel level=Type1)
float uncorrectedPt() const
return uncorrrection related stuff
PackedMETUncertainty caloPackedMet_
static uint16_t float32to16(float x)
double caloMETPhi() const
std::vector< reco::GenMET > genMET_
MET & operator=(MET const &)
const reco::GenMET * genMET() const
return the associated GenMET
virtual double px() const
x coordinate of momentum vector
Vector2 shiftedP2(METUncertainty shift, METUncertaintyLevel level=Type1) const
std::vector< SpecificCaloMETData > caloMET_
double shiftedPhi(METUncertainty shift, METUncertaintyLevel level=Type1) const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::vector< PackedMETUncertainty > uncertaintiesType1_
Vector shiftedP3(METUncertainty shift, METUncertaintyLevel level=Type1) const
math::XYZVector Vector
point in the space
static unsigned int const shift
Templated PAT object container.
void setGenMET(const reco::GenMET &gm)
set the associated GenMET
std::vector< SpecificPFMETData > pfMET_
float uncorrectedSumEt() const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual double py() const
y coordinate of momentum vector
void set(float dpx, float dpy, float dsumEt)
double shiftedPt(METUncertainty shift, METUncertaintyLevel level=Type1) const
LorentzVector shiftedP4(METUncertainty shift, METUncertaintyLevel level=Type1) const