31 bool t0FromMiniAOD_,
bool corShift_,
bool uncShift_,
bool isSmeared_=
false) ;
71 produces<std::vector<pat::MET> >();
77 throw cms::Exception(
"Unsupported",
"Reading PSets not supported, for now just use input tag");
113 shift(shift_),
level(level_), t0FromMiniAOD(t0FromMiniAOD_), corShift(corShift_), uncShift(uncShift_), isSmeared(isSmeared)
120 case pat::MET::JetEnUp : snprintf(buff, 1023, baseTagStr.c_str(),
"JetEnUp");
break;
122 case pat::MET::JetResUp : snprintf(buff, 1023, baseTagStr.c_str(),
"JetResUp");
break;
124 case pat::MET::MuonEnUp : snprintf(buff, 1023, baseTagStr.c_str(),
"MuonEnUp");
break;
130 case pat::MET::TauEnUp : snprintf(buff, 1023, baseTagStr.c_str(),
"TauEnUp");
break;
134 default:
throw cms::Exception(
"LogicError",
"OneMETShift constructor called with bogus shift");
147 if (src->size() != 1)
throw cms::Exception(
"CorruptData",
"More than one MET in the collection");
149 auto out = std::make_unique<std::vector<pat::MET>>(1, src->front());
153 shift.readAndSet(iEvent, met);
166 if (src->size() != 1)
throw cms::Exception(
"CorruptData",
"More than one MET in the shifted collection");
167 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
#define DEFINE_FWK_MODULE(type)
~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
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