58 iConfig.getParameter<
edm::InputTag>(
"trackToGenAssoc"))),
60 iConfig.getParameter<
edm::InputTag>(
"trackToPackedCandidatesAssoc"))),
62 iConfig.getParameter<
edm::InputTag>(
"genToPrunedAssoc"))),
64 iConfig.getParameter<
edm::InputTag>(
"genToPrunedAssocWithStatusOne"))),
66 produces<edm::Association<reco::GenParticleCollection>>();
78 auto prunedCollection = genToPrunedAssoc.ref();
83 const auto&
tracks = *trackHandle;
85 auto out = std::make_unique<edm::Association<reco::GenParticleCollection>>(prunedCollection);
88 if (not trackToGenAssocHandle.isValid()
or not trackToGenAssocHandle->contains(trackHandle.id())) {
100 std::vector<int> indices(pcCollection->size(), -1);
102 for (
size_t i = 0;
i <
tracks.size();
i++) {
115 auto newGenWSO = genToPrunedAssocWSO[
gen];
116 if (newGenWSO.isNull()) {
120 auto newGen = genToPrunedAssoc[newGenWSO];
121 if (newGen.isNull()) {
125 indices[pc.index()] = newGen.index();
127 filler.
insert(pcCollection, indices.begin(), indices.end());
140 descriptions.
add(
"packedCandidatesGenAssociationDefault", desc);
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > trackToPcToken_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
PackedCandidateGenAssociationProducer(const edm::ParameterSet &)
trackToPackedCandidatesAssoc
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > trackToGenToken_
std::vector< pat::PackedCandidate > PackedCandidateCollection
void insert(const H &h, I begin, I end)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > genToPrunedWSOToken_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
bool get(ProductID const &oid, Handle< PROD > &result) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
def gen(fragment, howMuch)
Production test section ####.
edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > genToPrunedToken_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< edm::View< reco::Track > > tracksToken_