47 uint32_t channel)
const;
60 : sipixelSimLinksToken_(
62 sistripSimLinksToken_(
64 siphase2OTSimLinksToken_(
72 trackingParticleToken_(
74 throwOnMissingCollections_(
cfg.getParameter<
bool>(
"throwOnMissingCollections")) {
75 produces<ClusterTPAssociation>();
90 desc.add<
bool>(
"throwOnMissingCollections",
true);
91 descriptions.
add(
"tpClusterProducerDefault",
desc);
112 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
121 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
130 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
139 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
144 auto clusterTPList = std::make_unique<ClusterTPAssociation>(TPCollectionH);
154 for (std::vector<SimTrack>::const_iterator itrk = trackingParticle->g4Track_begin();
155 itrk != trackingParticle->g4Track_end();
157 std::pair<uint32_t, EncodedEventId> trkid(itrk->trackId(),
eid);
159 mapping.insert(std::make_pair(trkid, trackingParticle));
163 if (foundPixelClusters) {
169 uint32_t detid = iter->id();
176 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
180 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(
181 getSimTrackId<PixelDigiSimLink>(sipixelSimLinks, detId, channel));
184 simTkIds.insert(trkid.begin(), trkid.end());
187 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
188 iset != simTkIds.end();
190 auto ipos =
mapping.find(*iset);
200 if (foundStripClusters) {
207 if (!(*iter).isValid())
209 uint32_t detid = iter->id();
216 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
220 for (
int istr =
first; istr <
last; ++istr) {
221 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(
222 getSimTrackId<StripDigiSimLink>(sistripSimLinks, detId, istr));
225 simTkIds.insert(trkid.begin(), trkid.end());
227 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
228 iset != simTkIds.end();
230 auto ipos =
mapping.find(*iset);
240 if (foundPhase2OTClusters) {
248 if (!(*iter).isValid())
250 uint32_t detid = iter->id();
259 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
261 for (
unsigned int istr(0); istr < cluster.
size(); ++istr) {
263 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(
264 getSimTrackId<PixelDigiSimLink>(siphase2OTSimLinks, detId, channel));
267 simTkIds.insert(trkid.begin(), trkid.end());
270 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
271 iset != simTkIds.end();
273 auto ipos =
mapping.find(*iset);
282 clusterTPList->sortAndUnique();
286 template <
typename T>
287 std::vector<std::pair<uint32_t, EncodedEventId> >
291 uint32_t channel)
const {
293 std::vector<std::pair<uint32_t, EncodedEventId> > simTrkId;
294 auto isearch = simLinks->find(detId);
295 if (isearch != simLinks->end()) {
299 if (channel == it->channel()) {
300 simTrkId.
push_back(std::make_pair(it->SimTrackId(), it->eventId()));