29 produces<SimHitTPAssociationList>();
30 std::vector<edm::InputTag>
tags = cfg.
getParameter<std::vector<edm::InputTag>>(
"simHitSrc");
32 for (
auto const &
tag : tags) {
33 _simHitSrc.emplace_back(consumes<edm::PSimHitContainer>(
tag));
47 std::unordered_map<UniqueSimTrackId, TrackingParticleRef, UniqueSimTrackIdHash> mapping;
48 auto const &tpColl = *TPCollectionH.
product();
50 auto const &trackingParticle = tpColl[itp];
54 for (
auto const &trk : trackingParticle.g4Tracks()) {
56 mapping.insert(std::make_pair(trkid, trackingParticleRef));
64 auto const &pSimHitCollection = *PSimHitCollectionH;
65 for (
unsigned int psimHitI = 0, size = pSimHitCollection.size(); psimHitI <
size; ++psimHitI) {
67 auto const &pSimHit = pSimHitCollection[psimHitI];
69 auto ipos = mapping.find(simTkIds);
70 if (ipos != mapping.end()) {
71 simHitTPList->emplace_back(ipos->second, pSimHitRef);
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > _simHitSrc
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
SimHitTPAssociationProducer(const edm::ParameterSet &)
std::pair< uint32_t, EncodedEventId > UniqueSimTrackId
static bool simHitTPAssociationListGreater(SimHitTPPair i, SimHitTPPair j)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< SimHitTPPair > SimHitTPAssociationList
edm::EDGetTokenT< TrackingParticleCollection > _trackingParticleSrc
~SimHitTPAssociationProducer() override
T const * product() const
T getParameter(std::string const &) const
std::vector< TrackingParticle > TrackingParticleCollection
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
tuple size
Write out results.