42 bool isSmeared_ =
false);
57 bool readFromMiniAOD =
false);
69 onMiniAOD_(iConfig.existsAs<
bool>(
"runningOnMiniAOD") ? iConfig.getParameter<
bool>(
"runningOnMiniAOD") :
false) {
84 produces<std::vector<pat::MET>>();
90 bool readFromMiniAOD) {
92 throw cms::Exception(
"Unsupported",
"Reading PSets not supported, for now just use input tag");
153 t0FromMiniAOD(t0FromMiniAOD_),
156 isSmeared(isSmeared) {
161 snprintf(buff, 1023, baseTagStr.c_str(),
"");
164 snprintf(buff, 1023, baseTagStr.c_str(),
"JetEnUp");
167 snprintf(buff, 1023, baseTagStr.c_str(),
"JetEnDown");
170 snprintf(buff, 1023, baseTagStr.c_str(),
"JetResUp");
173 snprintf(buff, 1023, baseTagStr.c_str(),
"JetResDown");
176 snprintf(buff, 1023, baseTagStr.c_str(),
"MuonEnUp");
179 snprintf(buff, 1023, baseTagStr.c_str(),
"MuonEnDown");
182 snprintf(buff, 1023, baseTagStr.c_str(),
"ElectronEnUp");
185 snprintf(buff, 1023, baseTagStr.c_str(),
"ElectronEnDown");
188 snprintf(buff, 1023, baseTagStr.c_str(),
"PhotonEnUp");
191 snprintf(buff, 1023, baseTagStr.c_str(),
"PhotonEnDown");
194 snprintf(buff, 1023, baseTagStr.c_str(),
"TauEnUp");
197 snprintf(buff, 1023, baseTagStr.c_str(),
"TauEnDown");
200 snprintf(buff, 1023, baseTagStr.c_str(),
"UnclusteredEnUp");
203 snprintf(buff, 1023, baseTagStr.c_str(),
"UnclusteredEnDown");
206 throw cms::Exception(
"LogicError",
"OneMETShift constructor called with bogus shift");
217 if (src->size() != 1)
218 throw cms::Exception(
"CorruptData",
"More than one MET in the collection");
220 auto out = std::make_unique<std::vector<pat::MET>>(1, src->front());
224 shift.readAndSet(iEvent, met);
236 if (src->size() != 1)
237 throw cms::Exception(
"CorruptData",
"More than one MET in the shifted collection");
238 const pat::MET &met2 = src->front();
Analysis-level MET class.
T getParameter(std::string const &) const
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
~PATMETSlimmer() override
std::vector< MET > METCollection
double px() const final
x coordinate of momentum vector
void setUncShift(double px, double py, double sumEt, METUncertainty shift, bool isSmeared=false)
double corPy(METCorrectionLevel level=Type1) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
double corSumEt(METCorrectionLevel level=Type1) const
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
#define DEFINE_FWK_MODULE(type)
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
const pat::MET::METUncertainty shift
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
const edm::EDGetTokenT< pat::METCollection > src_
double shiftedSumEt(METUncertainty shift, METCorrectionLevel level=Type1) const
double corPx(METCorrectionLevel level=Type1) const
double py() const final
y coordinate of momentum vector
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