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);
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > _simHitSrc
SimHitTPAssociationProducer(const edm::ParameterSet &)
std::pair< uint32_t, EncodedEventId > UniqueSimTrackId
static bool simHitTPAssociationListGreater(SimHitTPPair i, SimHitTPPair j)
#define DEFINE_FWK_MODULE(type)
T const * product() const
std::vector< SimHitTPPair > SimHitTPAssociationList
edm::EDGetTokenT< TrackingParticleCollection > _trackingParticleSrc
~SimHitTPAssociationProducer() override
std::vector< TrackingParticle > TrackingParticleCollection
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override