42 bool isSmeared_ =
false);
57 bool readFromMiniAOD =
false);
69 onMiniAOD_(iConfig.existsAs<bool>(
"runningOnMiniAOD") ? iConfig.getParameter<bool>(
"runningOnMiniAOD") :
false) {
88 produces<std::vector<pat::MET>>();
94 bool readFromMiniAOD) {
96 throw cms::Exception(
"Unsupported",
"Reading PSets not supported, for now just use input tag");
157 t0FromMiniAOD(t0FromMiniAOD_),
160 isSmeared(isSmeared) {
165 snprintf(buff, 1023, baseTagStr.c_str(),
"");
168 snprintf(buff, 1023, baseTagStr.c_str(),
"JetEnUp");
171 snprintf(buff, 1023, baseTagStr.c_str(),
"JetEnDown");
174 snprintf(buff, 1023, baseTagStr.c_str(),
"JetResUp");
177 snprintf(buff, 1023, baseTagStr.c_str(),
"JetResDown");
180 snprintf(buff, 1023, baseTagStr.c_str(),
"MuonEnUp");
183 snprintf(buff, 1023, baseTagStr.c_str(),
"MuonEnDown");
186 snprintf(buff, 1023, baseTagStr.c_str(),
"ElectronEnUp");
189 snprintf(buff, 1023, baseTagStr.c_str(),
"ElectronEnDown");
192 snprintf(buff, 1023, baseTagStr.c_str(),
"PhotonEnUp");
195 snprintf(buff, 1023, baseTagStr.c_str(),
"PhotonEnDown");
198 snprintf(buff, 1023, baseTagStr.c_str(),
"TauEnUp");
201 snprintf(buff, 1023, baseTagStr.c_str(),
"TauEnDown");
204 snprintf(buff, 1023, baseTagStr.c_str(),
"UnclusteredEnUp");
207 snprintf(buff, 1023, baseTagStr.c_str(),
"UnclusteredEnDown");
210 throw cms::Exception(
"LogicError",
"OneMETShift constructor called with bogus shift");
221 if (
src->size() != 1)
222 throw cms::Exception(
"CorruptData",
"More than one MET in the collection");
224 auto out = std::make_unique<std::vector<pat::MET>>(1,
src->front());
240 if (src->size() != 1)
241 throw cms::Exception(
"CorruptData",
"More than one MET in the shifted collection");
242 const pat::MET &met2 = src->front();
Analysis-level MET class.
double shiftedPx(METUncertainty shift, METCorrectionLevel level=Type1) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const pat::MET::METCorrectionType level
#define DEFINE_FWK_MODULE(type)
~PATMETSlimmer() override
std::vector< MET > METCollection
void setUncShift(double px, double py, double sumEt, METUncertainty shift, bool isSmeared=false)
double corPy(METCorrectionLevel level=Type1) const
double corSumEt(METCorrectionLevel level=Type1) const
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
double shiftedPy(METUncertainty shift, METCorrectionLevel level=Type1) const
void maybeReadShifts(const edm::ParameterSet &basePSet, const std::string &name, pat::MET::METCorrectionType level, bool readFromMiniAOD=false)
edm::EDGetTokenT< pat::METCollection > token
double px() const final
x coordinate of momentum vector
const pat::MET::METUncertainty shift
const edm::EDGetTokenT< pat::METCollection > src_
double shiftedSumEt(METUncertainty shift, METCorrectionLevel level=Type1) const
double py() const final
y coordinate of momentum vector
double corPx(METCorrectionLevel level=Type1) const
T getParameter(std::string const &) const
PATMETSlimmer(const edm::ParameterSet &iConfig)
static unsigned int const shift
std::vector< OneMETShift > shifts_
void setCorShift(double px, double py, double sumEt, METCorrectionType level)
void readAndSet(const edm::Event &ev, pat::MET &met) const