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>
146 hit->setClusterRef(newRef);
153 template <
typename RecHitType>
158 const std::type_info &hit_type =
typeid(genericHit);
172 assert(cluRef !=
nullptr);
A struct for clusters associated to hits.
ClusterHitRecord< SiStripRecHit2D::ClusterRef > StripClusterHitRecord
Assuming that the ClusterRef is the same for all SiStripRecHit*:
SiStripRecHit2D stereoHit() const
OmniClusterRef const & stereoClusterRef() const
void addCluster(TrackingRecHitCollection &hits, size_t index)
add cluster of newHit to list (throws if hit is of unknown type)
OmniClusterRef const & monoClusterRef() const
ClusterHitRecord< Phase2TrackerRecHit1D::CluRef > Phase2OTClusterHitRecord
std::vector< Phase2OTClusterHitRecord > phase2OTClusterRecords_
ClusterHitRecord< SiPixelRecHit::ClusterRef > PixelClusterHitRecord
std::vector< PixelClusterHitRecord > pixelClusterRecords_
Detector identifier class for the strip tracker.
DetId geographicalId() const
constexpr uint32_t rawId() const
get the raw id
void clear()
clear records
void processClusters(std::vector< ClusterHitRecord< typename HitType::ClusterRef > > &clusterRecords, edmNew::DetSetVector< ClusterType > &dsvToFill, edm::RefProd< edmNew::DetSetVector< ClusterType > > &refprod)
SiStripRecHit2D originalHit() const
void processAllClusters(edmNew::DetSetVector< SiPixelCluster > &pixelDsvToFill, edm::RefProd< edmNew::DetSetVector< SiPixelCluster > > refPixelClusters, edmNew::DetSetVector< SiStripCluster > &stripDsvToFill, edm::RefProd< edmNew::DetSetVector< SiStripCluster > > refStripClusters)
SiStripRecHit2D monoHit() const
void rekey(const ClusterRefType &newRef) const
OmniClusterRef const & omniCluster() const
std::vector< StripClusterHitRecord > stripClusterRecords_