29 produces<SimHitTPAssociationList>();
30 produces<SimTrackToTPMap>(
"simTrackToTP");
31 std::vector<edm::InputTag>
tags =
cfg.getParameter<std::vector<edm::InputTag>>(
"simHitSrc");
34 _simHitSrc.emplace_back(consumes<edm::PSimHitContainer>(
tag));
48 auto simTrackToTPMap = std::make_unique<SimTrackToTPMap>();
49 auto const &tpColl = *TPCollectionH.
product();
51 auto const &trackingParticle = tpColl[itp];
55 for (
auto const &trk : trackingParticle.g4Tracks()) {
57 simTrackToTPMap->mapping.insert(std::make_pair(trkid, trackingParticleRef));
64 iEvent.getByToken(psit, PSimHitCollectionH);
65 auto const &pSimHitCollection = *PSimHitCollectionH;
66 for (
unsigned int psimHitI = 0,
size = pSimHitCollection.size(); psimHitI <
size; ++psimHitI) {
68 auto const &pSimHit = pSimHitCollection[psimHitI];
70 auto ipos = simTrackToTPMap->mapping.find(simTkIds);
71 if (ipos != simTrackToTPMap->mapping.end()) {
72 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)
T const * product() const
std::vector< SimHitTPPair > SimHitTPAssociationList
edm::EDGetTokenT< TrackingParticleCollection > _trackingParticleSrc
#define DEFINE_FWK_MODULE(type)
~SimHitTPAssociationProducer() override
std::vector< TrackingParticle > TrackingParticleCollection
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override