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");
Analysis-level MET class.
T getParameter(std::string const &) const
void readAndSet(const edm::Event &ev, pat::MET &met) const
const pat::MET::METCorrectionType level
uint32_t cc[maxCellsPerHit]
~PATMETSlimmer() override
std::vector< MET > METCollection
double shiftedPy(METUncertainty shift, METCorrectionLevel level=Type1) const
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
void maybeReadShifts(const edm::ParameterSet &basePSet, const std::string &name, pat::MET::METCorrectionType level, bool readFromMiniAOD=false)
edm::EDGetTokenT< pat::METCollection > token
double corPx(METCorrectionLevel level=Type1) const
double px() const final
x coordinate of momentum vector
double corPy(METCorrectionLevel level=Type1) const
const pat::MET::METUncertainty shift
const edm::EDGetTokenT< pat::METCollection > src_
#define DEFINE_FWK_MODULE(type)
double py() const final
y coordinate of momentum vector
double shiftedSumEt(METUncertainty shift, METCorrectionLevel level=Type1) const
PATMETSlimmer(const edm::ParameterSet &iConfig)
static unsigned int const shift
std::vector< OneMETShift > shifts_
double shiftedPx(METUncertainty shift, METCorrectionLevel level=Type1) const
double corSumEt(METCorrectionLevel level=Type1) const