43 : genJetsToken_(consumes<edm::
View<
reco::GenJet> >(iConfig.getParameter<edm::
InputTag>(
"genJets"))),
44 slimmedGenJetsToken_(consumes<edm::
View<
reco::
Jet> >(iConfig.getParameter<edm::
InputTag>(
"slimmedGenJets"))),
45 genJetFlavourInfosToken_(
46 consumes<
reco::JetFlavourInfoMatchingCollection>(iConfig.getParameter<edm::
InputTag>(
"genJetFlavourInfos"))),
47 slimmedGenJetAssociationToken_(consumes<edm::Association<std::
vector<
reco::GenJet> > >(
48 iConfig.getParameter<edm::
InputTag>(
"slimmedGenJetAssociation"))) {
49 produces<reco::JetFlavourInfoMatchingCollection>();
63 iEvent.
getByToken(genJetFlavourInfosToken_, genJetFlavourInfos);
66 iEvent.
getByToken(slimmedGenJetAssociationToken_, slimmedGenJetAssociation);
69 assert(genJets->size() == genJetFlavourInfos->size());
73 for (
unsigned int i = 0;
i < genJets->size(); ++
i) {
74 slimmedGenJetRef = (*slimmedGenJetAssociation)[genJets->refAt(
i)];
75 if (!slimmedGenJetRef)
77 (*jetFlavourInfos)[
reco::JetBaseRef(slimmedGenJetRef)] = (*genJetFlavourInfos)[
i].second;
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< edm::View< reco::Jet > > slimmedGenJetsToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Transfers the JetFlavourInfos from the original GenJets to the slimmedGenJets in MiniAOD.
~GenJetFlavourInfoPreserver() override
edm::RefToBaseProd< reco::Jet > JetRefBaseProd
GenJetFlavourInfoPreserver(const edm::ParameterSet &iConfig)
edm::RefToBase< Jet > JetBaseRef
const edm::EDGetTokenT< reco::JetFlavourInfoMatchingCollection > genJetFlavourInfosToken_
const edm::EDGetTokenT< edm::View< reco::GenJet > > genJetsToken_
Analysis-level calorimeter jet class.
const edm::EDGetTokenT< edm::Association< std::vector< reco::GenJet > > > slimmedGenJetAssociationToken_