59 cut_(iConfig.getParameter<
std::
string>(
"cut")),
60 tauAncToken_(consumes<
edm::ValueMap<
bool>>(iConfig.getParameter<
edm::
InputTag>(
"hasTauAnc"))) {
61 produces<reco::GenJetCollection>(
"merged");
62 produces<edm::ValueMap<bool>>(
"hasTauAnc");
69 desc.add<
edm::InputTag>(
"srcJet")->setComment(
"reco::GenJetCollection input collection");
70 desc.add<
edm::InputTag>(
"srcPart")->setComment(
"reco::GenParticleCollection input collection");
71 desc.add<
std::string>(
"cut")->setComment(
"a selection to apply to GenJet");
72 desc.add<
edm::InputTag>(
"hasTauAnc")->setComment(
"value map defining GenJet tau origin");
82 auto merged = std::make_unique<reco::GenJetCollection>();
84 std::vector<bool> hasTauAncValues;
90 for (
unsigned int ijet = 0; ijet < jetHandle->size(); ++ijet) {
91 auto jet = jetHandle->at(ijet);
95 hasTauAncValues.push_back(tauAncProd[jetRef]);
99 for (
const auto&
part : partProd) {
104 merged->push_back(
jet);
105 hasTauAncValues.push_back(
false);
110 auto out = std::make_unique<edm::ValueMap<bool>>();
112 filler.insert(newmerged, hasTauAncValues.begin(), hasTauAncValues.end());
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void endStream() override
~GenJetGenPartMerger() override
std::vector< GenJet > GenJetCollection
collection of GenJet objects
void beginStream(edm::StreamID) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
GenJetGenPartMerger(const edm::ParameterSet &)
Jets made from MC generator particles.
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &, const edm::EventSetup &) override
const edm::EDGetTokenT< reco::GenJetCollection > jetToken_
const StringCutObjectSelector< reco::Candidate > cut_
const edm::EDGetTokenT< reco::GenParticleCollection > partToken_
const edm::EDGetTokenT< edm::ValueMap< bool > > tauAncToken_