26 const std::type_info &hit_type =
typeid(newHit);
50 }
else if (hit_type ==
typeid(
VectorHit)) {
64 throw cms::Exception(
"UnknownHitType") <<
"helper::ClusterStorer::addCluster: " 65 <<
"Unknown hit type " << hit_type.name() <<
".\n";
86 this->processClusters<SiPixelRecHit, SiPixelCluster>(
pixelClusterRecords_, pixelDsvToFill, refPixelClusters);
94 this->processClusters<SiStripRecHit2D, SiStripCluster>(
stripClusterRecords_, stripDsvToFill, refStripClusters);
97 this->processClusters<Phase2TrackerRecHit1D, Phase2TrackerCluster1D>(
103 template <
typename HitType,
typename ClusterType>
107 std::sort(clusterRecords.begin(), clusterRecords.end());
108 typedef typename std::vector<ClusterHitRecord<typename HitType::ClusterRef> >::iterator RIT;
109 RIT
it = clusterRecords.begin(), end = clusterRecords.end();
116 while ((it2 != end) && (it2->detid() ==
detid)) {
123 typename HitType::ClusterRef lastRef, newRef;
124 for (;
it != it2; ++
it) {
126 if (
it->clusterRef() != lastRef) {
127 lastRef =
it->clusterRef();
129 filler.push_back(*lastRef);
131 newRef =
typename HitType::ClusterRef(refprod,
clusters++);
133 it->template rekey<HitType>(newRef);
144 template <
typename ClusterRefType>
145 template <
typename RecHitType>
154 hit->setClusterRef(newRef);
161 template <
typename RecHitType>
164 const std::type_info &hit_type =
typeid(genericHit);
178 assert(cluRef !=
nullptr);
186 template <
typename RecHitType>
190 const std::type_info &hit_type =
typeid(genericHit);
195 }
else if (
typeid(
VectorHit) == hit_type) {
202 assert(cluRef !=
nullptr);
A struct for clusters associated to hits.
ClusterHitRecord< SiStripRecHit2D::ClusterRef > StripClusterHitRecord
Assuming that the ClusterRef is the same for all SiStripRecHit*:
SiStripRecHit2D stereoHit() const
OmniClusterRef const upperClusterRef() const
OmniClusterRef const & stereoClusterRef() const
void addCluster(TrackingRecHitCollection &hits, size_t index)
add cluster of newHit to list (throws if hit is of unknown type)
OmniClusterRef const & monoClusterRef() const
std::vector< Phase2OTClusterHitRecord > phase2OTClusterRecords_
ClusterHitRecord< SiPixelRecHit::ClusterRef > PixelClusterHitRecord
void processAllClusters(edmNew::DetSetVector< SiPixelCluster > &pixelDsvToFill, edm::RefProd< edmNew::DetSetVector< SiPixelCluster > > refPixelClusters, edmNew::DetSetVector< SiStripCluster > &stripDsvToFill, edm::RefProd< edmNew::DetSetVector< SiStripCluster > > refStripClusters, edmNew::DetSetVector< Phase2TrackerCluster1D > &phase2OTDsvToFill, edm::RefProd< edmNew::DetSetVector< Phase2TrackerCluster1D > > refPhase2OTClusters)
std::vector< PixelClusterHitRecord > pixelClusterRecords_
Detector identifier class for the strip tracker.
ClusterHitRecord< Phase2TrackerRecHit1D::ClusterRef > Phase2OTClusterHitRecord
DetId geographicalId() const
OmniClusterRef const lowerClusterRef() const
constexpr uint32_t rawId() const
get the raw id
void clear()
clear records
void processClusters(std::vector< ClusterHitRecord< typename HitType::ClusterRef > > &clusterRecords, edmNew::DetSetVector< ClusterType > &dsvToFill, edm::RefProd< edmNew::DetSetVector< ClusterType > > &refprod)
void rekey(const ClusterRefType &newRef)
SiStripRecHit2D originalHit() const
SiStripRecHit2D monoHit() const
std::vector< StripClusterHitRecord > stripClusterRecords_