-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38870 from abaty/SaturatedFlag_July272022
Addition of saturated flag in SiStrip Approximate Clusters
- Loading branch information
Showing
5 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 21 additions & 1 deletion
22
DataFormats/SiStripCluster/src/SiStripApproximateCluster.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
#include "DataFormats/SiStripCluster/interface/SiStripApproximateCluster.h" | ||
|
||
SiStripApproximateCluster::SiStripApproximateCluster(const SiStripCluster& cluster) { | ||
SiStripApproximateCluster::SiStripApproximateCluster(const SiStripCluster& cluster, unsigned int maxNSat) { | ||
barycenter_ = cluster.barycenter(); | ||
width_ = cluster.size(); | ||
avgCharge_ = cluster.charge() / cluster.size(); | ||
isSaturated_ = false; | ||
|
||
//mimicing the algorithm used in StripSubClusterShapeTrajectoryFilter... | ||
//Looks for 3 adjacent saturated strips (ADC>=254) | ||
const auto& ampls = cluster.amplitudes(); | ||
unsigned int thisSat = (ampls[0] >= 254), maxSat = thisSat; | ||
for (unsigned int i = 1, n = ampls.size(); i < n; ++i) { | ||
if (ampls[i] >= 254) { | ||
thisSat++; | ||
} else if (thisSat > 0) { | ||
maxSat = std::max<int>(maxSat, thisSat); | ||
thisSat = 0; | ||
} | ||
} | ||
if (thisSat > 0) { | ||
maxSat = std::max<int>(maxSat, thisSat); | ||
} | ||
if (maxSat >= maxNSat) { | ||
isSaturated_ = true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters