29 produces<SimHitTPAssociationList>();
30 std::vector<edm::InputTag>
tags =
cfg.getParameter<std::vector<edm::InputTag>>(
"simHitSrc");
33 _simHitSrc.emplace_back(consumes<edm::PSimHitContainer>(
tag));
47 std::unordered_map<UniqueSimTrackId, TrackingParticleRef, UniqueSimTrackIdHash>
mapping;
48 auto const &tpColl = *TPCollectionH.
product();
50 auto const &trackingParticle = tpColl[itp];
54 for (
auto const &trk : trackingParticle.g4Tracks()) {
56 mapping.insert(std::make_pair(trkid, trackingParticleRef));
63 iEvent.getByToken(psit, PSimHitCollectionH);
64 auto const &pSimHitCollection = *PSimHitCollectionH;
65 for (
unsigned int psimHitI = 0,
size = pSimHitCollection.size(); psimHitI <
size; ++psimHitI) {
67 auto const &pSimHit = pSimHitCollection[psimHitI];
69 auto ipos =
mapping.find(simTkIds);
71 simHitTPList->emplace_back(ipos->second, pSimHitRef);