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));
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > _simHitSrc
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
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)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
edm::EDGetTokenT< TrackingParticleCollection > _trackingParticleSrc
~SimHitTPAssociationProducer() override
T const * product() const
std::vector< SimHitTPPair > SimHitTPAssociationList