25 const std::type_info &hit_type =
typeid(newHit);
30 }
else if (hit_type ==
typeid(SiStripRecHit1D)) {
34 }
else if (hit_type ==
typeid(SiStripRecHit2D)) {
38 }
else if (hit_type ==
typeid(SiStripMatchedRecHit2D)) {
40 SiStripMatchedRecHit2D &mhit =
static_cast<SiStripMatchedRecHit2D&
>(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>
160 rekey(
const SiStripRecHit2D::ClusterRef &newRef)
const
163 const std::type_info &hit_type =
typeid(genericHit);
166 if (
typeid(SiStripRecHit1D) == hit_type) {
167 cluRef = &
static_cast<SiStripRecHit1D&
>(genericHit).omniCluster();
168 }
else if (
typeid(SiStripRecHit2D) == hit_type) {
169 cluRef = &
static_cast<SiStripRecHit2D&
>(genericHit).omniCluster();
170 }
else if (
typeid(SiStripMatchedRecHit2D) == hit_type) {
171 SiStripMatchedRecHit2D &mhit =
static_cast<SiStripMatchedRecHit2D&
>(genericHit);
172 cluRef = (
SiStripDetId(detid_).
stereo() ? &mhit.stereoClusterRef() : &mhit.monoClusterRef());
178 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*:
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< SiPixelRecHit::ClusterRef > PixelClusterHitRecord
std::vector< PixelClusterHitRecord > pixelClusterRecords_
Detector identifier class for the strip tracker.
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)
DetId geographicalId() const
const SiStripRecHit2D & originalHit() const
std::vector< StripClusterHitRecord > stripClusterRecords_