CMS 3D CMS Logo

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

#include <SiStripApproximateCluster.h>

Public Member Functions

cms_uint8_t avgCharge () const
 
cms_uint16_t barycenter () const
 
bool isSaturated () const
 
 SiStripApproximateCluster ()
 
 SiStripApproximateCluster (cms_uint16_t barycenter, cms_uint8_t width, cms_uint8_t avgCharge, bool isSaturated)
 
 SiStripApproximateCluster (const SiStripCluster &cluster, unsigned int maxNSat)
 
cms_uint8_t width () const
 

Private Attributes

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

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  isSaturated 
)
inlineexplicit

◆ SiStripApproximateCluster() [3/3]

SiStripApproximateCluster::SiStripApproximateCluster ( const SiStripCluster cluster,
unsigned int  maxNSat 
)
explicit

Definition at line 6 of file SiStripApproximateCluster.cc.

References SiStripCluster::amplitudes(), avgCharge_, SiStripCluster::barycenter(), barycenter_, SiStripCluster::charge(), mps_fire::i, isSaturated_, HLT_2023v12_cff::maxNSat, dqmiodumpmetadata::n, SiStripCluster::size(), and width_.

6  {
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

Member Function Documentation

◆ avgCharge()

cms_uint8_t SiStripApproximateCluster::avgCharge ( ) const
inline

◆ barycenter()

cms_uint16_t SiStripApproximateCluster::barycenter ( ) const
inline

◆ isSaturated()

bool SiStripApproximateCluster::isSaturated ( ) const
inline

◆ width()

cms_uint8_t SiStripApproximateCluster::width ( ) const
inline

Member Data Documentation

◆ avgCharge_

cms_uint8_t SiStripApproximateCluster::avgCharge_ = 0
private

Definition at line 31 of file SiStripApproximateCluster.h.

Referenced by avgCharge(), and SiStripApproximateCluster().

◆ barycenter_

cms_uint16_t SiStripApproximateCluster::barycenter_ = 0
private

Definition at line 29 of file SiStripApproximateCluster.h.

Referenced by barycenter(), and SiStripApproximateCluster().

◆ isSaturated_

bool SiStripApproximateCluster::isSaturated_ = false
private

Definition at line 32 of file SiStripApproximateCluster.h.

Referenced by isSaturated(), and SiStripApproximateCluster().

◆ width_

cms_uint8_t SiStripApproximateCluster::width_ = 0
private

Definition at line 30 of file SiStripApproximateCluster.h.

Referenced by SiStripApproximateCluster(), and width().