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

GenJetFlavourInfos: fix compiler warning, use prunedGenParticles in associations to correctly match pat jet flavour info #20281

Merged
merged 5 commits into from Sep 1, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions PhysicsTools/PatAlgos/plugins/GenJetFlavourInfoPreserver.cc
Expand Up @@ -27,9 +27,9 @@ namespace pat {
class GenJetFlavourInfoPreserver : public edm::stream::EDProducer<> {
public:
explicit GenJetFlavourInfoPreserver(const edm::ParameterSet & iConfig);
virtual ~GenJetFlavourInfoPreserver() { }
~GenJetFlavourInfoPreserver() override { }

virtual void produce(edm::Event & iEvent, const edm::EventSetup & iSetup) override;
void produce(edm::Event & iEvent, const edm::EventSetup & iSetup) override;

private:
const edm::EDGetTokenT<edm::View<reco::GenJet> > genJetsToken_;
Expand Down Expand Up @@ -72,12 +72,13 @@ pat::GenJetFlavourInfoPreserver::produce(edm::Event & iEvent, const edm::EventSe

edm::Ref<std::vector<reco::GenJet> > slimmedGenJetRef;

int i = -1;
for (auto const& genJet : *genJets){
i++;

for (uint i=0; i<genJets->size();++i){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @Andrej-CMS - please change uint to unsigned int


slimmedGenJetRef = (*slimmedGenJetAssociation)[genJets->refAt(i)];
if(!slimmedGenJetRef) continue;
(*jetFlavourInfos)[reco::JetBaseRef(slimmedGenJetRef)] = (*genJetFlavourInfos)[i].second;

}

iEvent.put(std::move(jetFlavourInfos));
Expand Down