19 jetPTthreshold = iConfig.
getParameter<
double>(
"jetPTthreshold");
20 jetEMfracLimit = iConfig.
getParameter<
double>(
"jetEMfracLimit");
21 jetMufracLimit = iConfig.
getParameter<
double>(
"jetMufracLimit");
22 produces<METCollection>();
34 iEvent.
getByToken( tokenUncorJets, inputUncorJets );
36 iEvent.
getByToken( correctorToken, corrector );
38 iEvent.
getByToken( tokenUncorMet, inputUncorMet );
41 jetPTthreshold, jetEMfracLimit, jetMufracLimit,
49 double jetPTthreshold,
50 double jetEMfracLimit,
51 double jetMufracLimit,
55 std::cerr <<
"Type1METAlgo_run-> undefined output MET collection. Stop. " << std::endl;
61 double DeltaSumET = 0.0;
65 for( PFJetCollection::const_iterator
jet = uncorJet.begin();
jet != uncorJet.end(); ++
jet) {
66 if(
jet->pt() > jetPTthreshold ) {
68 jet->chargedEmEnergyFraction() +
jet->neutralEmEnergyFraction();
69 double muEFrac =
jet->chargedMuEnergyFraction();
70 if( emEFrac < jetEMfracLimit
71 && muEFrac < jetMufracLimit ) {
81 delta.
mex = - DeltaPx;
82 delta.
mey = - DeltaPy;
83 delta.
sumet = DeltaSumET;
85 const MET* u = &(uncorMET.front());
86 double corrMetPx = u->
px()+delta.
mex;
87 double corrMetPy = u->
py()+delta.
mey;
89 sqrt (corrMetPx*corrMetPx + corrMetPy*corrMetPy)
92 std::vector<CorrMETData> corrections = u->
mEtCorr();
93 corrections.push_back( delta );
99 corMET->push_back(result);
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double px() const final
x coordinate of momentum vector
double correction(const LorentzVector &fJet) const
get correction using Jet information only
std::vector< reco::MET > METCollection
collection of MET objects
void produce(edm::Event &, const edm::EventSetup &) override
void run(const reco::METCollection &uncorMET, const reco::JetCorrector &corrector, const reco::PFJetCollection &uncorJet, double jetPTthreshold, double jetEMfracLimit, double jetMufracLimit, reco::METCollection *corMET)
const Point & vertex() const override
vertex position (overwritten by PF...)
std::vector< CorrMETData > mEtCorr() const
T const * product() const
double py() const final
y coordinate of momentum vector
std::vector< PFJet > PFJetCollection
collection of PFJet objects
math::XYZTLorentzVector LorentzVector
Lorentz vector.