#include <ShiftedPFCandidateProducerForPFMEtMVA.h>
Classes | |
struct | objectEntryType |
Public Member Functions | |
ShiftedPFCandidateProducerForPFMEtMVA (const edm::ParameterSet &) | |
~ShiftedPFCandidateProducerForPFMEtMVA () | |
Private Member Functions | |
void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
double | dRmatch_Object_ |
double | dRmatch_PFCandidate_ |
std::string | moduleLabel_ |
std::vector< objectEntryType > | objects_ |
edm::InputTag | srcPFCandidates_ |
edm::InputTag | srcShiftedObjects_ |
edm::InputTag | srcUnshiftedObjects_ |
Vary energy of PFCandidates coinciding in eta-phi with selected electrons/muons/tau-jets/jets by electron/muon/tau-jet/jet energy uncertainty.
NOTE: Auxiliary class specific to estimating systematic uncertainty on PFMET reconstructed by MVA-based algorithm (implemented in RecoMET/METProducers/src/PFMETProducerMVA.cc)
Definition at line 32 of file ShiftedPFCandidateProducerForPFMEtMVA.h.
ShiftedPFCandidateProducerForPFMEtMVA::ShiftedPFCandidateProducerForPFMEtMVA | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
Definition at line 9 of file ShiftedPFCandidateProducerForPFMEtMVA.cc.
References dRmatch_Object_, dRmatch_PFCandidate_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), srcPFCandidates_, srcShiftedObjects_, and srcUnshiftedObjects_.
: moduleLabel_(cfg.getParameter<std::string>("@module_label")) { srcPFCandidates_ = cfg.getParameter<edm::InputTag>("srcPFCandidates"); srcUnshiftedObjects_ = cfg.getParameter<edm::InputTag>("srcUnshiftedObjects"); srcShiftedObjects_ = cfg.getParameter<edm::InputTag>("srcShiftedObjects"); dRmatch_PFCandidate_ = cfg.getParameter<double>("dRmatch_PFCandidate"); dRmatch_Object_ = cfg.exists("dRmatch_Object") ? cfg.getParameter<double>("dRmatch_Object") : 0.1; produces<reco::PFCandidateCollection>(); }
ShiftedPFCandidateProducerForPFMEtMVA::~ShiftedPFCandidateProducerForPFMEtMVA | ( | ) |
Definition at line 23 of file ShiftedPFCandidateProducerForPFMEtMVA.cc.
{
// nothing to be done yet...
}
void ShiftedPFCandidateProducerForPFMEtMVA::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 28 of file ShiftedPFCandidateProducerForPFMEtMVA.cc.
References deltaR(), dRmatch_Object_, dRmatch_PFCandidate_, edm::Event::getByLabel(), dbtoconf::object, objects_, edm::Event::put(), reco::LeafCandidate::setP4(), edm::shift, srcPFCandidates_, srcShiftedObjects_, and srcUnshiftedObjects_.
{ edm::Handle<reco::PFCandidateCollection> originalPFCandidates; evt.getByLabel(srcPFCandidates_, originalPFCandidates); typedef edm::View<reco::Candidate> CandidateView; edm::Handle<CandidateView> unshiftedObjects; evt.getByLabel(srcUnshiftedObjects_, unshiftedObjects); edm::Handle<CandidateView> shiftedObjects; evt.getByLabel(srcShiftedObjects_, shiftedObjects); objects_.clear(); for ( CandidateView::const_iterator unshiftedObject = unshiftedObjects->begin(); unshiftedObject != unshiftedObjects->end(); ++unshiftedObject ) { bool isMatched_Object = false; double dRbestMatch_Object = 1.e+3; reco::Candidate::LorentzVector shiftedObjectP4_matched; for ( CandidateView::const_iterator shiftedObject = shiftedObjects->begin(); shiftedObject != shiftedObjects->end(); ++shiftedObject ) { double dR = deltaR(unshiftedObject->p4(), shiftedObject->p4()); if ( dR < dRmatch_Object_ && dR < dRbestMatch_Object ) { shiftedObjectP4_matched = shiftedObject->p4(); isMatched_Object = true; dRbestMatch_Object = dR; } } if ( isMatched_Object ) { objects_.push_back(objectEntryType(shiftedObjectP4_matched, unshiftedObject->p4(), dRbestMatch_Object)); } } std::auto_ptr<reco::PFCandidateCollection> shiftedPFCandidates(new reco::PFCandidateCollection); for ( reco::PFCandidateCollection::const_iterator originalPFCandidate = originalPFCandidates->begin(); originalPFCandidate != originalPFCandidates->end(); ++originalPFCandidate ) { double shift = 0.; bool applyShift = false; double dRbestMatch_PFCandidate = 1.e+3; for ( std::vector<objectEntryType>::const_iterator object = objects_.begin(); object != objects_.end(); ++object ) { if ( !object->isValidMatch_ ) continue; double dR = deltaR(originalPFCandidate->p4(), object->unshiftedObjectP4_); if ( dR < dRmatch_PFCandidate_ && dR < dRbestMatch_PFCandidate ) { shift = object->shift_; applyShift = true; dRbestMatch_PFCandidate = dR; } } reco::Candidate::LorentzVector shiftedPFCandidateP4 = originalPFCandidate->p4(); if ( applyShift ) shiftedPFCandidateP4 *= (1. + shift); reco::PFCandidate shiftedPFCandidate(*originalPFCandidate); shiftedPFCandidate.setP4(shiftedPFCandidateP4); shiftedPFCandidates->push_back(shiftedPFCandidate); } evt.put(shiftedPFCandidates); }
double ShiftedPFCandidateProducerForPFMEtMVA::dRmatch_Object_ [private] |
Definition at line 50 of file ShiftedPFCandidateProducerForPFMEtMVA.h.
Referenced by produce(), and ShiftedPFCandidateProducerForPFMEtMVA().
double ShiftedPFCandidateProducerForPFMEtMVA::dRmatch_PFCandidate_ [private] |
Definition at line 49 of file ShiftedPFCandidateProducerForPFMEtMVA.h.
Referenced by produce(), and ShiftedPFCandidateProducerForPFMEtMVA().
std::string ShiftedPFCandidateProducerForPFMEtMVA::moduleLabel_ [private] |
Definition at line 43 of file ShiftedPFCandidateProducerForPFMEtMVA.h.
std::vector<objectEntryType> ShiftedPFCandidateProducerForPFMEtMVA::objects_ [private] |
Definition at line 74 of file ShiftedPFCandidateProducerForPFMEtMVA.h.
Referenced by produce().
Definition at line 45 of file ShiftedPFCandidateProducerForPFMEtMVA.h.
Referenced by produce(), and ShiftedPFCandidateProducerForPFMEtMVA().
Definition at line 47 of file ShiftedPFCandidateProducerForPFMEtMVA.h.
Referenced by produce(), and ShiftedPFCandidateProducerForPFMEtMVA().
Definition at line 46 of file ShiftedPFCandidateProducerForPFMEtMVA.h.
Referenced by produce(), and ShiftedPFCandidateProducerForPFMEtMVA().