16 inputUncorMetLabel = iConfig.
getParameter<std::string>(
"inputUncorMetLabel");
18 correctorLabel = iConfig.
getParameter<std::string>(
"corrector");
19 jetPTthreshold = iConfig.
getParameter<
double>(
"jetPTthreshold");
20 jetEMfracLimit = iConfig.
getParameter<
double>(
"jetEMfracLimit");
21 jetMufracLimit = iConfig.
getParameter<
double>(
"jetMufracLimit");
22 produces<METCollection>();
34 iEvent.
getByLabel( inputUncorJetsTag, inputUncorJets );
37 iEvent.
getByLabel( inputUncorMetLabel, inputUncorMet );
39 run( *(inputUncorMet.product()), *corrector, *(inputUncorJets.product()),
40 jetPTthreshold, jetEMfracLimit, jetMufracLimit,
48 double jetPTthreshold,
49 double jetEMfracLimit,
50 double jetMufracLimit,
54 std::cerr <<
"Type1METAlgo_run-> undefined output MET collection. Stop. " << std::endl;
60 double DeltaSumET = 0.0;
64 for( PFJetCollection::const_iterator
jet = uncorJet.begin();
jet != uncorJet.end(); ++
jet) {
65 if(
jet->pt() > jetPTthreshold ) {
67 jet->chargedEmEnergyFraction() +
jet->neutralEmEnergyFraction();
68 double muEFrac =
jet->chargedMuEnergyFraction();
69 if( emEFrac < jetEMfracLimit
70 && muEFrac < jetMufracLimit ) {
80 delta.
mex = - DeltaPx;
81 delta.
mey = - DeltaPy;
82 delta.
sumet = DeltaSumET;
84 const MET* u = &(uncorMET.front());
85 double corrMetPx = u->
px()+delta.
mex;
86 double corrMetPy = u->
py()+delta.
mey;
88 sqrt (corrMetPx*corrMetPx + corrMetPy*corrMetPy)
91 std::vector<CorrMETData> corrections = u->
mEtCorr();
92 corrections.push_back( delta );
98 corMET->push_back(result);
T getParameter(std::string const &) const
virtual const Point & vertex() const
vertex position
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
std::vector< reco::MET > METCollection
collection of MET objects
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< CorrMETData > mEtCorr() const
virtual double px() const
x coordinate of momentum vector
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
std::vector< PFJet > PFJetCollection
collection of PFJet objects
virtual void produce(edm::Event &, const edm::EventSetup &)
void run(const reco::METCollection &uncorMET, const JetCorrector &corrector, const reco::PFJetCollection &uncorJet, double jetPTthreshold, double jetEMfracLimit, double jetMufracLimit, reco::METCollection *corMET)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual double py() const
y coordinate of momentum vector