diff --git a/CommonTools/RecoAlgos/src/ClusterStorer.cc b/CommonTools/RecoAlgos/src/ClusterStorer.cc index 271822db84589..3b86ea8c8575b 100644 --- a/CommonTools/RecoAlgos/src/ClusterStorer.cc +++ b/CommonTools/RecoAlgos/src/ClusterStorer.cc @@ -181,22 +181,22 @@ namespace helper { } // ------------------------------------------------------------- - // Specific rekey for class template ClusterRefType = VectorHit::ClusterRef, - // RecHitType is not used. + // Specific rekey for class template ClusterRefType = Phase2TrackerRecHit1D::ClusterRef template <> - template // or template<> to specialise also here? - void ClusterStorer::ClusterHitRecord::rekey(const VectorHit::ClusterRef &newRef) { + template + void ClusterStorer::ClusterHitRecord::rekey( + const Phase2TrackerRecHit1D::ClusterRef &newRef) { TrackingRecHit &genericHit = (*hits_)[index_]; const std::type_info &hit_type = typeid(genericHit); OmniClusterRef *cluRef = nullptr; - if (typeid(VectorHit) == hit_type) { + if (typeid(Phase2TrackerRecHit1D) == hit_type) { + cluRef = &static_cast(genericHit).omniCluster(); + } else if (typeid(VectorHit) == hit_type) { VectorHit &vHit = static_cast(genericHit); // FIXME: this essentially uses a hack // https://github.com/cms-sw/cmssw/blob/master/DataFormats/TrackerCommon/interface/TrackerTopology.h#L291 cluRef = (SiStripDetId(detid_).stereo() ? &vHit.upperClusterRef() : &vHit.lowerClusterRef()); - } else { - return; } assert(cluRef != nullptr); // to catch missing RecHit types