diff --git a/Configuration/StandardSequences/python/Validation_cff.py b/Configuration/StandardSequences/python/Validation_cff.py index 1a8371b078175..7afebef962c89 100644 --- a/Configuration/StandardSequences/python/Validation_cff.py +++ b/Configuration/StandardSequences/python/Validation_cff.py @@ -18,6 +18,7 @@ from Validation.RecoMET.METRelValForDQM_cff import * from Validation.RecoJets.JetValidation_cff import * +from JetMETCorrections.Type1MET.pfMETCorrectionType0_cfi import * from Validation.TrackingMCTruth.trackingTruthValidation_cfi import * from Validation.RecoTrack.TrackValidation_cff import * from Validation.RecoMuon.muonValidation_cff import * @@ -31,7 +32,7 @@ prevalidation = cms.Sequence( globalPrevalidation * hltassociation * metPreValidSeq * jetPreValidSeq ) prevalidationLiteTracking = cms.Sequence( prevalidation ) prevalidationLiteTracking.replace(globalPrevalidation,globalPrevalidationLiteTracking) -prevalidationMiniAOD = cms.Sequence( genParticles1 * miniAODValidationSequence * JetValidationMiniAOD ) +prevalidationMiniAOD = cms.Sequence( genParticles1 * miniAODValidationSequence * JetValidationMiniAOD * type0PFMEtCorrectionPFCandToVertexAssociationForValidationMiniAOD ) validation = cms.Sequence(cms.SequencePlaceholder("mix") diff --git a/JetMETCorrections/Type1MET/plugins/MultShiftMETcorrInputProducer.cc b/JetMETCorrections/Type1MET/plugins/MultShiftMETcorrInputProducer.cc index 8177fe33892d0..a5eec010af7b1 100644 --- a/JetMETCorrections/Type1MET/plugins/MultShiftMETcorrInputProducer.cc +++ b/JetMETCorrections/Type1MET/plugins/MultShiftMETcorrInputProducer.cc @@ -25,11 +25,12 @@ int MultShiftMETcorrInputProducer::translateTypeToAbsPdgId( reco::PFCandidate::P MultShiftMETcorrInputProducer::MultShiftMETcorrInputProducer(const edm::ParameterSet& cfg): - pflow_ ( cfg.getParameter< edm::InputTag >("srcPFlow") ), - vertices_ ( cfg.getParameter< edm::InputTag >("vertexCollection") ), moduleLabel_(cfg.getParameter("@module_label")) { + pflow_ = consumes >(cfg.getParameter< edm::InputTag >("srcPFlow") ); + vertices_ = consumes >( cfg.getParameter< edm::InputTag >("vertexCollection") ); + cfgCorrParameters_ = cfg.getParameter >("parameters"); etaMin_.clear(); etaMax_.clear(); @@ -68,7 +69,7 @@ void MultShiftMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSet //get primary vertices edm::Handle > hpv; try { - evt.getByLabel( vertices_, hpv ); + evt.getByToken( vertices_, hpv ); } catch ( cms::Exception & e ) { std::cout <<"[MultShiftMETcorrInputProducer] error: " << e.what() << std::endl; } @@ -85,7 +86,7 @@ void MultShiftMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSet for (unsigned i=0;i > particleFlow; - evt.getByLabel(pflow_, particleFlow); + evt.getByToken(pflow_, particleFlow); for (unsigned i = 0; i < particleFlow->size(); ++i) { const reco::Candidate& c = particleFlow->at(i); for (unsigned j=0; j static int translateTypeToAbsPdgId( reco::PFCandidate::ParticleType type ); - edm::InputTag pflow_; - edm::InputTag vertices_; + edm::EDGetTokenT > pflow_; + edm::EDGetTokenT> vertices_; std::string moduleLabel_; std::vector cfgCorrParameters_; diff --git a/JetMETCorrections/Type1MET/python/pfMETCorrectionType0_cfi.py b/JetMETCorrections/Type1MET/python/pfMETCorrectionType0_cfi.py index 53e4959335c27..fd62d96081279 100644 --- a/JetMETCorrections/Type1MET/python/pfMETCorrectionType0_cfi.py +++ b/JetMETCorrections/Type1MET/python/pfMETCorrectionType0_cfi.py @@ -61,6 +61,14 @@ * pfCandidateToVertexAssociation ) + +type0PFMEtCorrectionPFCandToVertexAssociationForValidationMiniAOD = cms.Sequence( + selectedVerticesForPFMEtCorrType0 + * selectedPrimaryVertexHighestPtTrackSumForPFMEtCorrType0 + * particleFlowDisplacedVertex + * pfCandidateToVertexAssociation +) + type0PFMEtCorrection = cms.Sequence( type0PFMEtCorrectionPFCandToVertexAssociation * pfMETcorrType0