26 const std::type_info &hit_type =
typeid(newHit);
50 }
else if (hit_type ==
typeid(
VectorHit)) {
64 throw cms::Exception(
"UnknownHitType") <<
"helper::ClusterStorer::addCluster: "
65 <<
"Unknown hit type " << hit_type.name() <<
".\n";
82 this->processClusters<SiPixelRecHit, SiPixelCluster>(
pixelClusterRecords_, pixelDsvToFill, refPixelClusters);
90 this->processClusters<SiStripRecHit2D, SiStripCluster>(
stripClusterRecords_, stripDsvToFill, refStripClusters);
95 template <
typename HitType,
typename ClusterType>
99 std::sort(clusterRecords.begin(), clusterRecords.end());
100 typedef typename std::vector<ClusterHitRecord<typename HitType::ClusterRef> >::const_iterator RIT;
101 RIT it = clusterRecords.begin(),
end = clusterRecords.end();
105 uint32_t detid = it->detid();
108 while ((it2 !=
end) && (it2->detid() == detid)) {
115 typename HitType::ClusterRef lastRef, newRef;
116 for (; it != it2; ++it) {
118 if (it->clusterRef() != lastRef) {
119 lastRef = it->clusterRef();
121 filler.push_back(*lastRef);
123 newRef =
typename HitType::ClusterRef(refprod,
clusters++);
125 it->template rekey<HitType>(newRef);
136 template <
typename ClusterRefType>
137 template <
typename RecHitType>
142 hit = dynamic_cast<RecHitType *>(&genericHit);
146 hit->setClusterRef(newRef);
153 template <
typename RecHitType>
158 const std::type_info &hit_type =
typeid(genericHit);
162 cluRef = &static_cast<SiStripRecHit1D &>(genericHit).omniCluster();
164 cluRef = &static_cast<SiStripRecHit2D &>(genericHit).omniCluster();
169 cluRef = &static_cast<ProjectedSiStripRecHit2D &>(genericHit).originalHit().omniCluster();
172 assert(cluRef !=
nullptr);