CMS 3D CMS Logo

SiStripApproximateCluster.cc
Go to the documentation of this file.
3 #include <algorithm>
4 #include <cmath>
5 
7  barycenter_ = std::round(cluster.barycenter() * 10);
8  width_ = cluster.size();
9  avgCharge_ = cluster.charge() / cluster.size();
10  isSaturated_ = false;
11 
12  //mimicing the algorithm used in StripSubClusterShapeTrajectoryFilter...
13  //Looks for 3 adjacent saturated strips (ADC>=254)
14  const auto& ampls = cluster.amplitudes();
15  unsigned int thisSat = (ampls[0] >= 254), maxSat = thisSat;
16  for (unsigned int i = 1, n = ampls.size(); i < n; ++i) {
17  if (ampls[i] >= 254) {
18  thisSat++;
19  } else if (thisSat > 0) {
20  maxSat = std::max<int>(maxSat, thisSat);
21  thisSat = 0;
22  }
23  }
24  if (thisSat > 0) {
25  maxSat = std::max<int>(maxSat, thisSat);
26  }
27  if (maxSat >= maxNSat) {
28  isSaturated_ = true;
29  }
30 }
int charge() const
SiStripCluster const & amplitudes() const
auto size() const
float barycenter() const