27 const std::type_info &hit_type =
typeid(newHit);
65 throw cms::Exception(
"UnknownHitType") <<
"helper::ClusterStorer::addCluster: " 66 <<
"Unknown hit type " << hit_type.name()
88 this->processClusters<SiPixelRecHit, SiPixelCluster>
97 this->processClusters<SiStripRecHit2D, SiStripCluster>
103 template<
typename HitType,
typename ClusterType>
109 std::sort(clusterRecords.begin(), clusterRecords.end());
111 typename std::vector<ClusterHitRecord<typename HitType::ClusterRef> >::const_iterator
113 RIT it = clusterRecords.begin(),
end = clusterRecords.end();
117 uint32_t detid = it->detid();
120 while ( (it2 !=
end) && (it2->detid() == detid)) { ++it2; }
125 typename HitType::ClusterRef lastRef, newRef;
126 for ( ; it != it2; ++it) {
128 if (it->clusterRef() != lastRef) {
129 lastRef = it->clusterRef();
133 newRef =
typename HitType::ClusterRef( refprod, clusters++ );
135 it->template rekey<HitType>(newRef);
146 template<
typename ClusterRefType>
147 template<
typename RecHitType>
149 rekey(
const ClusterRefType &newRef)
const 154 hit =
dynamic_cast<RecHitType *
>(&genericHit);
156 assert (hit !=
nullptr);
157 assert (hit->cluster() == ref_);
158 hit->setClusterRef(newRef);
165 template<
typename RecHitType>
171 const std::type_info &hit_type =
typeid(genericHit);
185 assert(cluRef !=
nullptr);
186 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
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)
uint32_t rawId() const
get the raw id
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_