18 : _simHitSrc(cfg.getParameter<std::vector<edm::
InputTag> >(
"simHitSrc")),
19 _trackingParticleSrc(cfg.getParameter<edm::
InputTag>(
"trackingParticleSrc"))
21 produces<SimHitTPAssociationList>();
40 for (
auto itrk = trackingParticle->g4Track_begin(); itrk != trackingParticle->g4Track_end(); ++itrk) {
41 std::pair<uint32_t, EncodedEventId> trkid(itrk->trackId(), eid);
42 mapping.insert(std::make_pair(trkid, trackingParticle));
50 for (
unsigned int psimHit = 0;psimHit != PSimHitCollectionH->size();++psimHit) {
52 std::pair<uint32_t, EncodedEventId> simTkIds(pSimHitRef->trackId(),pSimHitRef->eventId());
53 auto ipos = mapping.find(simTkIds);
54 if (ipos != mapping.end()) {
55 simHitTPList->push_back(std::make_pair(ipos->second,pSimHitRef));
61 iEvent.
put(simHitTPList);
SimHitTPAssociationProducer(const edm::ParameterSet &)
static bool simHitTPAssociationListGreater(SimHitTPPair i, SimHitTPPair j)
#define DEFINE_FWK_MODULE(type)
std::vector< edm::InputTag > _simHitSrc
virtual void produce(edm::Event &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * product() const
std::vector< SimHitTPPair > SimHitTPAssociationList
edm::InputTag _trackingParticleSrc
~SimHitTPAssociationProducer()