Skip to content

Commit

Permalink
Merge pull request #42486 from mmusich/fixDBG_ASAS_RAWprime
Browse files Browse the repository at this point in the history
`SiStripClusters2ApproxClusters`: run `peakFilter` only if cluster is usable
  • Loading branch information
cmsbuild authored Aug 8, 2023
2 parents dc2b480 + 2bd7e5a commit 2e956e4
Showing 1 changed file with 22 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,28 @@ void SiStripClusters2ApproxClusters::produce(edm::Event& event, edm::EventSetup

int hitStrips;
float hitPredPos;
theFilter->getSizes(detId, cluster, lp, ldir, hitStrips, hitPredPos);

bool peakFilter = false;
SlidingPeakFinder pf(std::max<int>(2, std::ceil(std::abs(hitPredPos) + subclusterWindow_)));
float mipnorm = mip / std::abs(ldir.z());
PeakFinderTest test(mipnorm,
detId,
cluster.firstStrip(),
theNoise_,
seedCutMIPs_,
seedCutSN_,
subclusterCutMIPs_,
subclusterCutSN_);
peakFilter = pf.apply(cluster.amplitudes(), test);

ff.push_back(SiStripApproximateCluster(cluster, maxNSat, hitPredPos, peakFilter));
bool usable = theFilter->getSizes(detId, cluster, lp, ldir, hitStrips, hitPredPos);
// (almost) same logic as in StripSubClusterShapeTrajectoryFilter
bool isTrivial = (std::abs(hitPredPos) < 2.f && hitStrips <= 2);

if (!usable || isTrivial) {
ff.push_back(SiStripApproximateCluster(cluster, maxNSat, hitPredPos, true));
} else {
bool peakFilter = false;
SlidingPeakFinder pf(std::max<int>(2, std::ceil(std::abs(hitPredPos) + subclusterWindow_)));
float mipnorm = mip / std::abs(ldir.z());
PeakFinderTest test(mipnorm,
detId,
cluster.firstStrip(),
theNoise_,
seedCutMIPs_,
seedCutSN_,
subclusterCutMIPs_,
subclusterCutSN_);
peakFilter = pf.apply(cluster.amplitudes(), test);

ff.push_back(SiStripApproximateCluster(cluster, maxNSat, hitPredPos, peakFilter));
}
}
}

Expand Down

0 comments on commit 2e956e4

Please sign in to comment.