Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix miniAOD validation for MET : 75X #10019

Merged
merged 1 commit into from
Jul 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Configuration/StandardSequences/python/Validation_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand All @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>("@module_label"))
{

pflow_ = consumes<edm::View<reco::Candidate> >(cfg.getParameter< edm::InputTag >("srcPFlow") );
vertices_ = consumes<edm::View<reco::Vertex> >( cfg.getParameter< edm::InputTag >("vertexCollection") );

cfgCorrParameters_ = cfg.getParameter<std::vector<edm::ParameterSet> >("parameters");
etaMin_.clear();
etaMax_.clear();
Expand Down Expand Up @@ -68,7 +69,7 @@ void MultShiftMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSet
//get primary vertices
edm::Handle<edm::View<reco::Vertex> > hpv;
try {
evt.getByLabel( vertices_, hpv );
evt.getByToken( vertices_, hpv );
} catch ( cms::Exception & e ) {
std::cout <<"[MultShiftMETcorrInputProducer] error: " << e.what() << std::endl;
}
Expand All @@ -85,7 +86,7 @@ void MultShiftMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSet
for (unsigned i=0;i<sumPt_.size();i++) sumPt_[i]=0.;

edm::Handle<edm::View<reco::Candidate> > 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<type_.size(); j++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class MultShiftMETcorrInputProducer : public edm::stream::EDProducer<>
static int translateTypeToAbsPdgId( reco::PFCandidate::ParticleType type );


edm::InputTag pflow_;
edm::InputTag vertices_;
edm::EDGetTokenT<edm::View<reco::Candidate> > pflow_;
edm::EDGetTokenT<edm::View<reco::Vertex>> vertices_;
std::string moduleLabel_;

std::vector<edm::ParameterSet> cfgCorrParameters_;
Expand Down
8 changes: 8 additions & 0 deletions JetMETCorrections/Type1MET/python/pfMETCorrectionType0_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
* pfCandidateToVertexAssociation
)


type0PFMEtCorrectionPFCandToVertexAssociationForValidationMiniAOD = cms.Sequence(
selectedVerticesForPFMEtCorrType0
* selectedPrimaryVertexHighestPtTrackSumForPFMEtCorrType0
* particleFlowDisplacedVertex
* pfCandidateToVertexAssociation
)

type0PFMEtCorrection = cms.Sequence(
type0PFMEtCorrectionPFCandToVertexAssociation
* pfMETcorrType0
Expand Down