Skip to content

Commit

Permalink
SiStripClusters2ApproxClusters: run peakFilter only if cluster is usable
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Aug 9, 2023
1 parent 006129c commit 99b82cd
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 99b82cd

Please sign in to comment.