21 produces<SimHitTPAssociationList>();
22 std::vector<edm::InputTag>
tags = cfg.
getParameter<std::vector<edm::InputTag> >(
"simHitSrc");
24 for(
auto const&
tag : tags) {
25 _simHitSrc.emplace_back(consumes<edm::PSimHitContainer>(
tag));
45 for (
auto itrk = trackingParticle->g4Track_begin(); itrk != trackingParticle->g4Track_end(); ++itrk) {
46 std::pair<uint32_t, EncodedEventId> trkid(itrk->trackId(), eid);
47 mapping.insert(std::make_pair(trkid, trackingParticle));
55 for (
unsigned int psimHit = 0;psimHit != PSimHitCollectionH->size();++psimHit) {
57 std::pair<uint32_t, EncodedEventId> simTkIds(pSimHitRef->trackId(),pSimHitRef->eventId());
58 auto ipos = mapping.find(simTkIds);
59 if (ipos != mapping.end()) {
60 simHitTPList->push_back(std::make_pair(ipos->second,pSimHitRef));
66 iEvent.
put(simHitTPList);
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > _simHitSrc
T getParameter(std::string const &) const
SimHitTPAssociationProducer(const edm::ParameterSet &)
std::vector< TrackingParticle > TrackingParticleCollection
static bool simHitTPAssociationListGreater(SimHitTPPair i, SimHitTPPair j)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
virtual void produce(edm::Event &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< TrackingParticleCollection > _trackingParticleSrc
T const * product() const
std::vector< SimHitTPPair > SimHitTPAssociationList
~SimHitTPAssociationProducer()