CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
SiStripApproximateCluster Class Reference

#include <SiStripApproximateCluster.h>

Public Member Functions

cms_uint8_t avgCharge () const
 
cms_uint16_t barycenter () const
 
bool filter () const
 
bool isSaturated () const
 
bool peakFilter () const
 
 SiStripApproximateCluster ()
 
 SiStripApproximateCluster (cms_uint16_t barycenter, cms_uint8_t width, cms_uint8_t avgCharge, bool filter, bool isSaturated, bool peakFilter=false)
 
 SiStripApproximateCluster (const SiStripCluster &cluster, unsigned int maxNSat, float hitPredPos, bool peakFilter)
 
cms_uint8_t width () const
 

Private Attributes

cms_uint8_t avgCharge_ = 0
 
cms_uint16_t barycenter_ = 0
 
bool filter_ = false
 
bool isSaturated_ = false
 
bool peakFilter_ = false
 
cms_uint8_t width_ = 0
 

Static Private Attributes

static constexpr double maxTrimmedSizeDiffNeg_ = .7
 
static constexpr double maxTrimmedSizeDiffPos_ = 1.
 
static constexpr double trimMaxADC_ = 30.
 
static constexpr double trimMaxFracNeigh_ = .25
 
static constexpr double trimMaxFracTotal_ = .15
 

Detailed Description

Definition at line 7 of file SiStripApproximateCluster.h.

Constructor & Destructor Documentation

◆ SiStripApproximateCluster() [1/3]

SiStripApproximateCluster::SiStripApproximateCluster ( )
inline

Definition at line 9 of file SiStripApproximateCluster.h.

9 {}

◆ SiStripApproximateCluster() [2/3]

SiStripApproximateCluster::SiStripApproximateCluster ( cms_uint16_t  barycenter,
cms_uint8_t  width,
cms_uint8_t  avgCharge,
bool  filter,
bool  isSaturated,
bool  peakFilter = false 
)
inlineexplicit

◆ SiStripApproximateCluster() [3/3]

SiStripApproximateCluster::SiStripApproximateCluster ( const SiStripCluster cluster,
unsigned int  maxNSat,
float  hitPredPos,
bool  peakFilter 
)
explicit

Definition at line 6 of file SiStripApproximateCluster.cc.

References funct::abs(), SiStripCluster::amplitudes(), avgCharge_, SiStripCluster::barycenter(), barycenter_, reco::ceil(), SiStripCluster::charge(), filter_, mps_fire::i, isSaturated_, dqmdumpme::last, HLT_2024v13_cff::maxNSat, maxTrimmedSizeDiffNeg_, maxTrimmedSizeDiffPos_, dqmiodumpmetadata::n, peakFilter(), peakFilter_, SiStripCluster::size(), trimMaxADC_, trimMaxFracNeigh_, trimMaxFracTotal_, and width_.

9  {
10  barycenter_ = std::round(cluster.barycenter() * 10);
11  width_ = cluster.size();
12  avgCharge_ = cluster.charge() / cluster.size();
13  filter_ = false;
14  isSaturated_ = false;
16 
17  //mimicing the algorithm used in StripSubClusterShapeTrajectoryFilter...
18  //Looks for 3 adjacent saturated strips (ADC>=254)
19  const auto& ampls = cluster.amplitudes();
20  unsigned int thisSat = (ampls[0] >= 254), maxSat = thisSat;
21  for (unsigned int i = 1, n = ampls.size(); i < n; ++i) {
22  if (ampls[i] >= 254) {
23  thisSat++;
24  } else if (thisSat > 0) {
25  maxSat = std::max<int>(maxSat, thisSat);
26  thisSat = 0;
27  }
28  }
29  if (thisSat > 0) {
30  maxSat = std::max<int>(maxSat, thisSat);
31  }
32  if (maxSat >= maxNSat) {
33  filter_ = true;
34  isSaturated_ = true;
35  }
36 
37  unsigned int hitStripsTrim = ampls.size();
38  int sum = std::accumulate(ampls.begin(), ampls.end(), 0);
39  uint8_t trimCut = std::min<uint8_t>(trimMaxADC_, std::floor(trimMaxFracTotal_ * sum));
40  auto begin = ampls.begin();
41  auto last = ampls.end() - 1;
42  while (hitStripsTrim > 1 && (*begin < std::max<uint8_t>(trimCut, trimMaxFracNeigh_ * (*(begin + 1))))) {
43  hitStripsTrim--;
44  ++begin;
45  }
46  while (hitStripsTrim > 1 && (*last < std::max<uint8_t>(trimCut, trimMaxFracNeigh_ * (*(last - 1))))) {
47  hitStripsTrim--;
48  --last;
49  }
50  if (hitStripsTrim < std::floor(std::abs(hitPredPos) - maxTrimmedSizeDiffNeg_)) {
51  filter_ = false;
52  } else if (hitStripsTrim <= std::ceil(std::abs(hitPredPos) + maxTrimmedSizeDiffPos_)) {
53  filter_ = true;
54  } else {
56  }
57 }
constexpr int32_t ceil(float num)
int charge() const
static constexpr double maxTrimmedSizeDiffNeg_
static constexpr double trimMaxFracTotal_
SiStripCluster const & amplitudes() const
auto size() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr double maxTrimmedSizeDiffPos_
float barycenter() const
static constexpr double trimMaxFracNeigh_
static constexpr double trimMaxADC_

Member Function Documentation

◆ avgCharge()

cms_uint8_t SiStripApproximateCluster::avgCharge ( ) const
inline

◆ barycenter()

cms_uint16_t SiStripApproximateCluster::barycenter ( ) const
inline

◆ filter()

bool SiStripApproximateCluster::filter ( ) const
inline

◆ isSaturated()

bool SiStripApproximateCluster::isSaturated ( ) const
inline

◆ peakFilter()

bool SiStripApproximateCluster::peakFilter ( ) const
inline

◆ width()

cms_uint8_t SiStripApproximateCluster::width ( ) const
inline

Member Data Documentation

◆ avgCharge_

cms_uint8_t SiStripApproximateCluster::avgCharge_ = 0
private

Definition at line 39 of file SiStripApproximateCluster.h.

Referenced by avgCharge(), and SiStripApproximateCluster().

◆ barycenter_

cms_uint16_t SiStripApproximateCluster::barycenter_ = 0
private

Definition at line 37 of file SiStripApproximateCluster.h.

Referenced by barycenter(), and SiStripApproximateCluster().

◆ filter_

bool SiStripApproximateCluster::filter_ = false
private

Definition at line 40 of file SiStripApproximateCluster.h.

Referenced by filter(), and SiStripApproximateCluster().

◆ isSaturated_

bool SiStripApproximateCluster::isSaturated_ = false
private

Definition at line 41 of file SiStripApproximateCluster.h.

Referenced by isSaturated(), and SiStripApproximateCluster().

◆ maxTrimmedSizeDiffNeg_

constexpr double SiStripApproximateCluster::maxTrimmedSizeDiffNeg_ = .7
staticprivate

Definition at line 46 of file SiStripApproximateCluster.h.

Referenced by SiStripApproximateCluster().

◆ maxTrimmedSizeDiffPos_

constexpr double SiStripApproximateCluster::maxTrimmedSizeDiffPos_ = 1.
staticprivate

Definition at line 47 of file SiStripApproximateCluster.h.

Referenced by SiStripApproximateCluster().

◆ peakFilter_

bool SiStripApproximateCluster::peakFilter_ = false
private

Definition at line 42 of file SiStripApproximateCluster.h.

Referenced by peakFilter(), and SiStripApproximateCluster().

◆ trimMaxADC_

constexpr double SiStripApproximateCluster::trimMaxADC_ = 30.
staticprivate

Definition at line 43 of file SiStripApproximateCluster.h.

Referenced by SiStripApproximateCluster().

◆ trimMaxFracNeigh_

constexpr double SiStripApproximateCluster::trimMaxFracNeigh_ = .25
staticprivate

Definition at line 45 of file SiStripApproximateCluster.h.

Referenced by SiStripApproximateCluster().

◆ trimMaxFracTotal_

constexpr double SiStripApproximateCluster::trimMaxFracTotal_ = .15
staticprivate

Definition at line 44 of file SiStripApproximateCluster.h.

Referenced by SiStripApproximateCluster().

◆ width_

cms_uint8_t SiStripApproximateCluster::width_ = 0
private

Definition at line 38 of file SiStripApproximateCluster.h.

Referenced by SiStripApproximateCluster(), and width().