25 const std::type_info &hit_type =
typeid(newHit);
57 throw cms::Exception(
"UnknownHitType") <<
"helper::ClusterStorer::addCluster: "
58 <<
"Unknown hit type " << hit_type.name()
80 this->processClusters<SiPixelRecHit, SiPixelCluster>
89 this->processClusters<SiStripRecHit2D, SiStripCluster>
95 template<
typename HitType,
typename ClusterType>
101 std::sort(clusterRecords.begin(), clusterRecords.end());
103 typename std::vector<ClusterHitRecord<typename HitType::ClusterRef> >::const_iterator
105 RIT it = clusterRecords.begin(),
end = clusterRecords.end();
109 uint32_t
detid = it->detid();
112 while ( (it2 !=
end) && (it2->detid() ==
detid)) { ++it2; }
117 typename HitType::ClusterRef lastRef, newRef;
118 for ( ; it != it2; ++it) {
120 if (it->clusterRef() != lastRef) {
121 lastRef = it->clusterRef();
125 newRef =
typename HitType::ClusterRef( refprod, clusters++ );
127 it->template rekey<HitType>(newRef);
138 template<
typename ClusterRefType>
139 template<
typename RecHitType>
141 rekey(
const ClusterRefType &newRef)
const
146 hit =
dynamic_cast<RecHitType *
>(&genericHit);
149 assert (hit->cluster() == ref_);
150 hit->setClusterRef(newRef);
157 template<
typename RecHitType>
163 const std::type_info &hit_type =
typeid(genericHit);
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
OmniClusterRef const & omniCluster() const
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_