#include <MuonMETcorrInputProducer.h>
Public Member Functions | |
MuonMETcorrInputProducer (const edm::ParameterSet &) | |
~MuonMETcorrInputProducer () | |
Private Member Functions | |
void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
std::string | moduleLabel_ |
edm::InputTag | src_ |
edm::InputTag | srcMuonCorrections_ |
Sum CaloMET muon corrections, needed to compute Type 2 MET corrections in case muon corrected CaloMET is used as input to CorrectedCaloMETProducer
Definition at line 25 of file MuonMETcorrInputProducer.h.
MuonMETcorrInputProducer::MuonMETcorrInputProducer | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
Definition at line 10 of file MuonMETcorrInputProducer.cc.
References edm::ParameterSet::getParameter(), src_, and srcMuonCorrections_.
: moduleLabel_(cfg.getParameter<std::string>("@module_label")) { src_ = cfg.getParameter<edm::InputTag>("src"); srcMuonCorrections_ = cfg.getParameter<edm::InputTag>("srcMuonCorrections"); produces<CorrMETData>(); }
MuonMETcorrInputProducer::~MuonMETcorrInputProducer | ( | ) |
Definition at line 20 of file MuonMETcorrInputProducer.cc.
{
// nothing to be done yet...
}
void MuonMETcorrInputProducer::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 25 of file MuonMETcorrInputProducer.cc.
References edm::Event::getByLabel(), metsig::muon, patZpeak::muons, reco::MuonMETCorrectionData::NotUsed, patZpeak::numMuons, reco::LeafCandidate::pt(), edm::Event::put(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), src_, srcMuonCorrections_, and reco::MuonMETCorrectionData::type().
{ std::auto_ptr<CorrMETData> unclEnergySum(new CorrMETData()); edm::Handle<reco::MuonCollection> muons; evt.getByLabel(src_, muons); typedef edm::ValueMap<reco::MuonMETCorrectionData> MuonMETCorrectionMap; edm::Handle<MuonMETCorrectionMap> muonCorrections; evt.getByLabel(srcMuonCorrections_, muonCorrections); //--- sum muon corrections. // // NOTE: MET = -(jets + muon corrections + "unclustered energy"), // so "unclustered energy" = -(MET + jets + muons), // i.e. muon corrections enter the sum of "unclustered energy" with negative sign. // int numMuons = muons->size(); for ( int muonIndex = 0; muonIndex < numMuons; ++muonIndex ) { const reco::Muon& muon = muons->at(muonIndex); reco::MuonRef muonRef(muons, muonIndex); reco::MuonMETCorrectionData muonCorrection = (*muonCorrections)[muonRef]; if ( muonCorrection.type() != reco::MuonMETCorrectionData::NotUsed ) { unclEnergySum->mex -= muon.px(); unclEnergySum->mey -= muon.py(); unclEnergySum->sumet -= muon.pt(); } } //--- add sum of muon corrections to the event evt.put(unclEnergySum); }
std::string MuonMETcorrInputProducer::moduleLabel_ [private] |
Definition at line 36 of file MuonMETcorrInputProducer.h.
edm::InputTag MuonMETcorrInputProducer::src_ [private] |
Definition at line 38 of file MuonMETcorrInputProducer.h.
Referenced by MuonMETcorrInputProducer(), and produce().
Definition at line 40 of file MuonMETcorrInputProducer.h.
Referenced by MuonMETcorrInputProducer(), and produce().