Skip to content

Commit

Permalink
make rekey non-const as per PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Dec 21, 2022
1 parent 06b919b commit 651c25a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CommonTools/RecoAlgos/interface/ClusterStorer.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace helper {
/// Set the reference of the hit of this record to 'newRef',
/// will not modify the ref stored in this object.
template <typename RecHitType>
void rekey(const ClusterRefType &newRef) const;
void rekey(const ClusterRefType &newRef);

private:
ClusterHitRecord() {} /// private => unusable
Expand Down
12 changes: 4 additions & 8 deletions CommonTools/RecoAlgos/src/ClusterStorer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace helper {
edmNew::DetSetVector<ClusterType> &dsvToFill,
edm::RefProd<edmNew::DetSetVector<ClusterType> > &refprod) {
std::sort(clusterRecords.begin(), clusterRecords.end()); // this sorts them by detid
typedef typename std::vector<ClusterHitRecord<typename HitType::ClusterRef> >::const_iterator RIT;
typedef typename std::vector<ClusterHitRecord<typename HitType::ClusterRef> >::iterator RIT;
RIT it = clusterRecords.begin(), end = clusterRecords.end();
size_t clusters = 0;
while (it != end) {
Expand Down Expand Up @@ -143,7 +143,7 @@ namespace helper {
// generic rekey (in practise for pixel only...)
template <typename ClusterRefType> // template for class
template <typename RecHitType> // template for member function
void ClusterStorer::ClusterHitRecord<ClusterRefType>::rekey(const ClusterRefType &newRef) const {
void ClusterStorer::ClusterHitRecord<ClusterRefType>::rekey(const ClusterRefType &newRef) {
TrackingRecHit &genericHit = (*hits_)[index_];
RecHitType *hit = nullptr;
if (genericHit.geographicalId().rawId() == detid_) { // a hit on this det, so it's simple
Expand All @@ -159,9 +159,7 @@ namespace helper {
// RecHitType is not used.
template <>
template <typename RecHitType> // or template<> to specialise also here?
void ClusterStorer::ClusterHitRecord<SiStripRecHit2D::ClusterRef>::
// rekey<SiStripRecHit2D>(const SiStripRecHit2D::ClusterRef &newRef) const
rekey(const SiStripRecHit2D::ClusterRef &newRef) const {
void ClusterStorer::ClusterHitRecord<SiStripRecHit2D::ClusterRef>::rekey(const SiStripRecHit2D::ClusterRef &newRef) {
TrackingRecHit &genericHit = (*hits_)[index_];
const std::type_info &hit_type = typeid(genericHit);

Expand All @@ -187,9 +185,7 @@ namespace helper {
// RecHitType is not used.
template <>
template <typename RecHitType> // or template<> to specialise also here?
void ClusterStorer::ClusterHitRecord<VectorHit::ClusterRef>::
// rekey<VectorHit>(const VectorHit::ClusterRef &newRef) const
rekey(const VectorHit::ClusterRef &newRef) const {
void ClusterStorer::ClusterHitRecord<VectorHit::ClusterRef>::rekey(const VectorHit::ClusterRef &newRef) {
TrackingRecHit &genericHit = (*hits_)[index_];
const std::type_info &hit_type = typeid(genericHit);

Expand Down

0 comments on commit 651c25a

Please sign in to comment.