26 const std::type_info &hit_type =
typeid(newHit);
59 throw cms::Exception(
"UnknownHitType") <<
"helper::ClusterStorer::addCluster: "
60 <<
"Unknown hit type " << hit_type.name()
82 this->processClusters<SiPixelRecHit, SiPixelCluster>
91 this->processClusters<SiStripRecHit2D, SiStripCluster>
97 template<
typename HitType,
typename ClusterType>
103 std::sort(clusterRecords.begin(), clusterRecords.end());
105 typename std::vector<ClusterHitRecord<typename HitType::ClusterRef> >::const_iterator
107 RIT it = clusterRecords.begin(),
end = clusterRecords.end();
111 uint32_t
detid = it->detid();
114 while ( (it2 !=
end) && (it2->detid() ==
detid)) { ++it2; }
119 typename HitType::ClusterRef lastRef, newRef;
120 for ( ; it != it2; ++it) {
122 if (it->clusterRef() != lastRef) {
123 lastRef = it->clusterRef();
127 newRef =
typename HitType::ClusterRef( refprod, clusters++ );
129 it->template rekey<HitType>(newRef);
140 template<
typename ClusterRefType>
141 template<
typename RecHitType>
143 rekey(
const ClusterRefType &newRef)
const
148 hit =
dynamic_cast<RecHitType *
>(&genericHit);
151 assert (hit->cluster() == ref_);
152 hit->setClusterRef(newRef);
159 template<
typename RecHitType>
165 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_