Skip to content

Commit 2e956e4

Browse files
authored
Merge pull request cms-sw#42486 from mmusich/fixDBG_ASAS_RAWprime
`SiStripClusters2ApproxClusters`: run `peakFilter` only if cluster is usable
2 parents dc2b480 + 2bd7e5a commit 2e956e4

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

RecoLocalTracker/SiStripClusterizer/plugins/SiStripClusters2ApproxClusters.cc

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -126,22 +126,28 @@ void SiStripClusters2ApproxClusters::produce(edm::Event& event, edm::EventSetup
126126

127127
int hitStrips;
128128
float hitPredPos;
129-
theFilter->getSizes(detId, cluster, lp, ldir, hitStrips, hitPredPos);
130-
131-
bool peakFilter = false;
132-
SlidingPeakFinder pf(std::max<int>(2, std::ceil(std::abs(hitPredPos) + subclusterWindow_)));
133-
float mipnorm = mip / std::abs(ldir.z());
134-
PeakFinderTest test(mipnorm,
135-
detId,
136-
cluster.firstStrip(),
137-
theNoise_,
138-
seedCutMIPs_,
139-
seedCutSN_,
140-
subclusterCutMIPs_,
141-
subclusterCutSN_);
142-
peakFilter = pf.apply(cluster.amplitudes(), test);
143-
144-
ff.push_back(SiStripApproximateCluster(cluster, maxNSat, hitPredPos, peakFilter));
129+
bool usable = theFilter->getSizes(detId, cluster, lp, ldir, hitStrips, hitPredPos);
130+
// (almost) same logic as in StripSubClusterShapeTrajectoryFilter
131+
bool isTrivial = (std::abs(hitPredPos) < 2.f && hitStrips <= 2);
132+
133+
if (!usable || isTrivial) {
134+
ff.push_back(SiStripApproximateCluster(cluster, maxNSat, hitPredPos, true));
135+
} else {
136+
bool peakFilter = false;
137+
SlidingPeakFinder pf(std::max<int>(2, std::ceil(std::abs(hitPredPos) + subclusterWindow_)));
138+
float mipnorm = mip / std::abs(ldir.z());
139+
PeakFinderTest test(mipnorm,
140+
detId,
141+
cluster.firstStrip(),
142+
theNoise_,
143+
seedCutMIPs_,
144+
seedCutSN_,
145+
subclusterCutMIPs_,
146+
subclusterCutSN_);
147+
peakFilter = pf.apply(cluster.amplitudes(), test);
148+
149+
ff.push_back(SiStripApproximateCluster(cluster, maxNSat, hitPredPos, peakFilter));
150+
}
145151
}
146152
}
147153

0 commit comments

Comments
 (0)