43 genMET_(iOther.genMET_),
44 caloMET_(iOther.caloMET_),
45 pfMET_(iOther.pfMET_),
52 uncorInfo_.store(
new std::vector<UncorInfo>{*
tmp},std::memory_order_release);
58 delete uncorInfo_.load(std::memory_order_acquire);
70 delete uncorInfo_.exchange(
new std::vector<UncorInfo>{*
tmp},std::memory_order_acq_rel);
73 delete uncorInfo_.exchange(
nullptr, std::memory_order_acq_rel);
118 const std::vector<CorrMETData>& corrs(
mEtCorr());
119 const auto nCorrectionsTmp = corrs.size();
121 std::unique_ptr<std::vector<UncorInfo>> uncorInfoTmpPtr{
new std::vector<UncorInfo>{
uncorrMAXN} };
122 auto& uncorInfoTmp = *uncorInfoTmpPtr;
130 for (
unsigned int iC=0; iC < nCorrectionsTmp; ++iC){
131 uncorInfoTmp[ix].corEx += corrs[iC].mex;
132 uncorInfoTmp[ix].corEy += corrs[iC].mey;
133 uncorInfoTmp[ix].corSumEt += corrs[iC].sumet;
140 if (nCorrectionsTmp >=1 ){
142 uncorInfoTmp[ix].corEx += corrs[iC].mex;
143 uncorInfoTmp[ix].corEy += corrs[iC].mey;
144 uncorInfoTmp[ix].corSumEt += corrs[iC].sumet;
151 if (nCorrectionsTmp >=2 ){
153 uncorInfoTmp[ix].corEx += corrs[iC].mex;
154 uncorInfoTmp[ix].corEy += corrs[iC].mey;
155 uncorInfoTmp[ix].corSumEt += corrs[iC].sumet;
162 if (nCorrectionsTmp >=3 ){
164 uncorInfoTmp[ix].corEx += corrs[iC].mex;
165 uncorInfoTmp[ix].corEy += corrs[iC].mey;
166 uncorInfoTmp[ix].corSumEt += corrs[iC].sumet;
174 std::vector<UncorInfo>* expected=
nullptr;
175 if(
uncorInfo_.compare_exchange_strong(expected,uncorInfoTmpPtr.get(),std::memory_order_acq_rel)) {
176 uncorInfoTmpPtr.release();
183 uci.
pt =
sqrt(lpx*lpx + lpy*lpy);
184 uci.
phi = atan2(lpy, lpx);
189 if (v.empty())
throw cms::Exception(
"Unsupported",
"MET uncertainties not available for the specified correction type");
195 if (v.empty())
throw cms::Exception(
"Unsupported",
"MET uncertainties not available for the specified correction type");
196 return Vector(
px() + v[shift].dpx(),
py() + v[shift].dpy(), 0);
200 if (v.empty())
throw cms::Exception(
"Unsupported",
"MET uncertainties not available for the specified correction type");
206 if (v.empty())
throw cms::Exception(
"Unsupported",
"MET uncertainties not available for the specified correction type");
212 v[
shift].set(px - this->
px(), py - this->
py(), sumEt - this->
sumEt());
Analysis-level MET class.
float uncorrectedPhi(UncorrectionType ix=uncorrALL) const
std::vector< PackedMETUncertainty > uncertaintiesRaw_
SpecificPFMETData getSpecific() const
math::XYZVector Vector
point in the space
virtual float pt() const
transverse momentum
std::vector< PackedMETUncertainty > uncertaintiesType1p2_
virtual float phi() const
momentum azimuthal angle
void checkUncor_() const
check and set transients
double shiftedSumEt(METUncertainty shift, METUncertaintyLevel level=Type1) const
virtual double y() const
rapidity
float corEx(UncorrectionType ix=uncorrALL) const
unsigned int nCorrections_
float corSumEt(UncorrectionType ix=uncorrALL) const
SpecificCaloMETData getSpecific() const
void setShift(double px, double py, double sumEt, METUncertainty shift, METUncertaintyLevel level=Type1)
std::atomic< std::vector< UncorInfo > * > uncorInfo_
T const * get() const
Returns C++ pointer to the item.
std::vector< reco::GenMET > genMET_
float uncorrectedPt(UncorrectionType ix=uncorrALL) const
std::vector< CorrMETData > mEtCorr() const
float corEy(UncorrectionType ix=uncorrALL) const
MET & operator=(MET const &)
const reco::GenMET * genMET() const
return the associated GenMET
void setPtPhi_(UncorInfo &uci) const
virtual double px() const
x coordinate of momentum vector
Vector2 shiftedP2(METUncertainty shift, METUncertaintyLevel level=Type1) const
std::vector< SpecificCaloMETData > caloMET_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::vector< std::vector< double > > tmp
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_
value_type const * get() const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual double py() const
y coordinate of momentum vector
unsigned int nCorrections() const
return uncorrrection related stuff
LorentzVector shiftedP4(METUncertainty shift, METUncertaintyLevel level=Type1) const