25 const std::type_info &hit_type =
typeid(newHit);
60 throw cms::Exception(
"UnknownHitType") <<
"helper::ClusterStorer::addCluster: " 61 <<
"Unknown hit type " << hit_type.name() <<
".\n";
78 this->processClusters<SiPixelRecHit, SiPixelCluster>(
pixelClusterRecords_, pixelDsvToFill, refPixelClusters);
86 this->processClusters<SiStripRecHit2D, SiStripCluster>(
stripClusterRecords_, stripDsvToFill, refStripClusters);
91 template <
typename HitType,
typename ClusterType>
95 std::sort(clusterRecords.begin(), clusterRecords.end());
96 typedef typename std::vector<ClusterHitRecord<typename HitType::ClusterRef> >::const_iterator RIT;
97 RIT it = clusterRecords.begin(),
end = clusterRecords.end();
101 uint32_t detid = it->detid();
104 while ((it2 !=
end) && (it2->detid() == detid)) {
111 typename HitType::ClusterRef lastRef, newRef;
112 for (; it != it2; ++it) {
114 if (it->clusterRef() != lastRef) {
115 lastRef = it->clusterRef();
119 newRef =
typename HitType::ClusterRef(refprod, clusters++);
121 it->template rekey<HitType>(newRef);
132 template <
typename ClusterRefType>
133 template <
typename RecHitType>
138 hit =
dynamic_cast<RecHitType *
>(&genericHit);
140 assert(hit !=
nullptr);
141 assert(hit->cluster() == ref_);
142 hit->setClusterRef(newRef);
149 template <
typename RecHitType>
154 const std::type_info &hit_type =
typeid(genericHit);
168 assert(cluRef !=
nullptr);
169 assert(cluRef->
key() == ref_.key());
A struct for clusters associated to hits.
void push_back(data_type const &d)
ClusterHitRecord< SiStripRecHit2D::ClusterRef > StripClusterHitRecord
Assuming that the ClusterRef is the same for all SiStripRecHit*:
OmniClusterRef const & stereoClusterRef() const
constexpr uint32_t rawId() const
get the raw id
void rekey(const ClusterRefType &newRef) const
void addCluster(TrackingRecHitCollection &hits, size_t index)
add cluster of newHit to list (throws if hit is of unknown type)
ClusterHitRecord< Phase2TrackerRecHit1D::CluRef > Phase2OTClusterHitRecord
OmniClusterRef const & omniCluster() const
std::vector< Phase2OTClusterHitRecord > phase2OTClusterRecords_
ClusterHitRecord< SiPixelRecHit::ClusterRef > PixelClusterHitRecord
OmniClusterRef const & monoClusterRef() const
std::vector< PixelClusterHitRecord > pixelClusterRecords_
SiStripRecHit2D originalHit() const
Detector identifier class for the strip tracker.
SiStripRecHit2D stereoHit() const
void clear()
clear records
SiStripRecHit2D monoHit() const
void processClusters(std::vector< ClusterHitRecord< typename HitType::ClusterRef > > &clusterRecords, edmNew::DetSetVector< ClusterType > &dsvToFill, edm::RefProd< edmNew::DetSetVector< ClusterType > > &refprod)
void processAllClusters(edmNew::DetSetVector< SiPixelCluster > &pixelDsvToFill, edm::RefProd< edmNew::DetSetVector< SiPixelCluster > > refPixelClusters, edmNew::DetSetVector< SiStripCluster > &stripDsvToFill, edm::RefProd< edmNew::DetSetVector< SiStripCluster > > refStripClusters)
DetId geographicalId() const
std::vector< StripClusterHitRecord > stripClusterRecords_