24 const std::type_info &hit_type =
typeid(newHit);
56 throw cms::Exception(
"UnknownHitType") <<
"helper::ClusterStorer::addCluster: "
57 <<
"Unknown hit type " << hit_type.name()
79 this->processClusters<SiPixelRecHit, SiPixelCluster>
88 this->processClusters<SiStripRecHit2D, SiStripCluster>
94 template<
typename HitType,
typename ClusterType>
100 std::sort(clusterRecords.begin(), clusterRecords.end());
102 typename std::vector<ClusterHitRecord<typename HitType::ClusterRef> >::const_iterator
104 RIT it = clusterRecords.begin(),
end = clusterRecords.end();
108 uint32_t
detid = it->detid();
111 while ( (it2 !=
end) && (it2->detid() ==
detid)) { ++it2; }
116 typename HitType::ClusterRef lastRef, newRef;
117 for ( ; it != it2; ++it) {
119 if (it->clusterRef() != lastRef) {
120 lastRef = it->clusterRef();
124 newRef =
typename HitType::ClusterRef( refprod, clusters++ );
126 it->template rekey<HitType>(newRef);
136 template<
typename ClusterRefType>
137 template<
typename RecHitType>
139 rekey(
const ClusterRefType &newRef)
const
144 hit =
dynamic_cast<RecHitType *
>(&genericHit);
147 assert (hit->cluster() == ref_);
148 hit->setClusterRef(newRef);
155 template<
typename RecHitType>
161 const std::type_info &hit_type =
typeid(genericHit);
166 assert(hit->
cluster() == ref_);
181 assert(hit->
cluster() == ref_);
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*:
virtual uint32_t stereo() const
const SiStripRecHit2D * stereoHit() 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)
void setClusterRef(ClusterRef const &ref)
void setClusterRef(ClusterRef const &ref)
uint32_t rawId() const
get the raw id
ClusterHitRecord< SiPixelRecHit::ClusterRef > PixelClusterHitRecord
std::vector< PixelClusterHitRecord > pixelClusterRecords_
Detector identifier class for the strip tracker.
ClusterRef const & cluster() const
void clear()
clear records
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)
ClusterRef const & cluster() const
DetId geographicalId() const
const SiStripRecHit2D * monoHit() const
const SiStripRecHit2D & originalHit() const
std::vector< StripClusterHitRecord > stripClusterRecords_