Skip to content

Commit 6a7da0e

Browse files
authored
Merge pull request #48684 from mmasciov/followupCMSHLT3534-151X
Update of strip overlap check for different product ID
2 parents e6d1c14 + c205e4b commit 6a7da0e

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

DataFormats/TrackerRecHit2D/interface/OmniClusterRef.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,14 @@ class OmniClusterRef {
7070
return false;
7171
const auto& tc = stripCluster();
7272
const uint16_t tf = tc.firstStrip();
73-
const uint16_t tl = tf + tc.amplitudes().size();
73+
const uint16_t tl = tf + tc.amplitudes().size() - 1;
7474
const auto& oc = lh.stripCluster();
7575
const uint16_t of = oc.firstStrip();
76-
const uint16_t ol = of + oc.amplitudes().size();
76+
const uint16_t ol = of + oc.amplitudes().size() - 1;
7777
// By default, include edge overlaps
78+
// For single-strip clusters with non-matching edges, edge overlaps are excluded
79+
if (((tl - tf) <= 1 || (ol - of) <= 1) && (tf != of || tl != ol))
80+
includeEdges = false;
7881
const auto e = includeEdges ? 1 : 0;
7982
// Check that last strip of "other" cluster is within first and last strip of "this", or viceversa
8083
// Edge strips are considered for determining overlap (e=1) if includeEdges = true (default)

DataFormats/TrackerRecHit2D/interface/TrackerSingleRecHit.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ class TrackerSingleRecHit : public BaseTrackerRecHit {
6969
bool sharesInput(const TrackingRecHit* other, SharedInputType what) const final;
7070

7171
bool sharesInput(TrackerSingleRecHit const& other) const {
72-
//auto const& otherClus = reinterpret_cast<const BaseTrackerRecHit*>(other)->firstClusterRef();
7372
if (cluster_.id() == other.cluster_.id())
7473
return (cluster_ == other.cluster_);
7574
else {

DataFormats/TrackerRecHit2D/src/SiStripMatchedRecHit2D.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ bool SiStripMatchedRecHit2D::sharesInput(const TrackingRecHit* other, SharedInpu
2222
if (monoClusterRef().id() == otherClus.id() || stereoClusterRef().id() == otherClus.id())
2323
return (otherClus == stereoClusterRef()) || (otherClus == monoClusterRef());
2424
else {
25-
const bool sameDetId = (geographicalId() == other->geographicalId());
26-
bool stereoOverlap = (sameDetId) ? otherClus.stripOverlap(stereoClusterRef()) : false;
27-
bool monoOverlap = (sameDetId) ? otherClus.stripOverlap(monoClusterRef()) : false;
25+
bool stereoOverlap = otherClus.stripOverlap(stereoClusterRef());
26+
bool monoOverlap = otherClus.stripOverlap(monoClusterRef());
2827
return (stereoOverlap || monoOverlap);
2928
}
3029
}
@@ -34,7 +33,7 @@ bool SiStripMatchedRecHit2D::sharesInput(TrackerSingleRecHit const& other) const
3433
if (monoClusterRef().id() == otherClus.id() || stereoClusterRef().id() == otherClus.id())
3534
return (otherClus == stereoClusterRef()) || (otherClus == monoClusterRef());
3635
else {
37-
const bool sameDetId = (geographicalId() == other.geographicalId());
36+
const bool sameDetId = sameDetModule(other);
3837
bool stereoOverlap = (sameDetId) ? otherClus.stripOverlap(stereoClusterRef()) : false;
3938
bool monoOverlap = (sameDetId) ? otherClus.stripOverlap(monoClusterRef()) : false;
4039
return (stereoOverlap || monoOverlap);

DataFormats/TrackerRecHit2D/src/VectorHit.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,8 @@ bool VectorHit::sharesInput(const TrackingRecHit* other, SharedInputType what) c
7676
if (lowerClusterRef().id() == otherClus.id() || upperClusterRef().id() == otherClus.id())
7777
return (otherClus == lowerClusterRef()) || (otherClus == upperClusterRef());
7878
else {
79-
bool lowerOverlap = false;
80-
bool upperOverlap = false;
81-
if (geographicalId() == other->geographicalId()) {
82-
lowerOverlap = otherClus.stripOverlap(lowerClusterRef());
83-
upperOverlap = otherClus.stripOverlap(upperClusterRef());
84-
}
79+
bool lowerOverlap = otherClus.stripOverlap(lowerClusterRef());
80+
bool upperOverlap = otherClus.stripOverlap(upperClusterRef());
8581
return (lowerOverlap || upperOverlap);
8682
}
8783
}
@@ -93,7 +89,7 @@ bool VectorHit::sharesClusters(VectorHit const& other, SharedInputType what) con
9389
const bool upperIdentity = this->upperClusterRef() == other.upperClusterRef();
9490
return (what == TrackingRecHit::all) ? (lowerIdentity && upperIdentity) : (lowerIdentity || upperIdentity);
9591
} else {
96-
const bool sameDetId = (geographicalId() == other.geographicalId());
92+
const bool sameDetId = sameDetModule(other);
9793
bool lowerOverlap = (sameDetId) ? other.lowerClusterRef().stripOverlap(this->lowerClusterRef()) : false;
9894
bool upperOverlap = (sameDetId) ? other.upperClusterRef().stripOverlap(this->upperClusterRef()) : false;
9995
return (what == TrackingRecHit::all) ? (lowerOverlap && upperOverlap) : (lowerOverlap || upperOverlap);

0 commit comments

Comments
 (0)