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));
44 for (
auto itrk = trackingParticle->g4Track_begin(); itrk != trackingParticle->g4Track_end(); ++itrk) {
45 std::pair<uint32_t, EncodedEventId> trkid(itrk->trackId(),
eid);
46 mapping.insert(std::make_pair(trkid, trackingParticle));
54 for (
unsigned int psimHit = 0; psimHit != PSimHitCollectionH->size(); ++psimHit) {
56 std::pair<uint32_t, EncodedEventId> simTkIds(pSimHitRef->trackId(), pSimHitRef->eventId());
57 auto ipos = mapping.find(simTkIds);
58 if (ipos != mapping.end()) {
59 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
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< TrackingParticleCollection > _trackingParticleSrc
~SimHitTPAssociationProducer() override
T const * product() const
std::vector< SimHitTPPair > SimHitTPAssociationList