36 void getSimTrackId(std::vector<UniqueSimTrackId>& simTrkId,
40 auto isearch = simLinks->find(detId);
41 if (isearch != simLinks->end()) {
45 if (channel == it->channel()) {
77 : sipixelSimLinksToken_(
79 sistripSimLinksToken_(
81 siphase2OTSimLinksToken_(
89 trackingParticleToken_(
91 throwOnMissingCollections_(
cfg.getParameter<
bool>(
"throwOnMissingCollections")) {
92 produces<ClusterTPAssociation>();
105 desc.add<
bool>(
"throwOnMissingCollections",
true);
106 descriptions.
add(
"tpClusterProducerDefault",
desc);
127 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
136 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
145 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
154 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
159 auto clusterTPList = std::make_unique<ClusterTPAssociation>(TPCollectionH);
162 std::unordered_map<UniqueSimTrackId, TrackingParticleRef, UniqueSimTrackIdHash>
mapping;
163 auto const& tpColl = *TPCollectionH.
product();
166 auto const& trackingParticle = tpColl[itp];
170 for (
auto const& trk : trackingParticle.g4Tracks()) {
173 mapping.insert(std::make_pair(trkid, trackingParticleRef));
177 std::unordered_set<UniqueSimTrackId, UniqueSimTrackIdHash> simTkIds;
178 std::vector<UniqueSimTrackId> trkid;
179 if (foundPixelClusters) {
185 uint32_t detid = iter->id();
197 getSimTrackId<PixelDigiSimLink>(trkid, sipixelSimLinks, detId, channel);
198 simTkIds.insert(trkid.begin(), trkid.end());
201 for (
auto iset = simTkIds.begin(); iset != simTkIds.end(); iset++) {
202 auto ipos =
mapping.find(*iset);
212 if (foundStripClusters) {
219 if (!(*iter).isValid())
221 uint32_t detid = iter->id();
232 for (
int istr =
first; istr <
last; ++istr) {
234 getSimTrackId<StripDigiSimLink>(trkid, sistripSimLinks, detId, istr);
235 simTkIds.insert(trkid.begin(), trkid.end());
237 for (
auto iset = simTkIds.begin(); iset != simTkIds.end(); iset++) {
238 auto ipos =
mapping.find(*iset);
248 if (foundPhase2OTClusters) {
256 if (!(*iter).isValid())
258 uint32_t detid = iter->id();
269 for (
unsigned int istr(0); istr < cluster.
size(); ++istr) {
272 getSimTrackId<PixelDigiSimLink>(trkid, siphase2OTSimLinks, detId, channel);
273 simTkIds.insert(trkid.begin(), trkid.end());
276 for (
auto iset = simTkIds.begin(); iset != simTkIds.end(); iset++) {
277 auto ipos =
mapping.find(*iset);
286 clusterTPList->sortAndUnique();