CMS 3D CMS Logo

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

#include <SiStripCluster.h>

Public Types

typedef std::vector< SiStripDigi >::const_iterator SiStripDigiIter
 
typedef std::pair< SiStripDigiIter, SiStripDigiIterSiStripDigiRange
 

Public Member Functions

const std::vector< uint8_t > & amplitudes () const
 
float barycenter () const
 
int charge () const
 
uint16_t firstStrip () const
 
float getSplitClusterError () const
 
bool isMerged () const
 
void setMerged (bool mergedState)
 
void setSplitClusterError (float errx)
 
 SiStripCluster ()
 
 SiStripCluster (const SiStripDigiRange &range)
 
template<typename Iter >
 SiStripCluster (const uint16_t &firstStrip, Iter begin, Iter end)
 
template<typename Iter >
 SiStripCluster (const uint16_t &firstStrip, Iter begin, Iter end, bool merged)
 

Static Public Attributes

static const uint16_t mergedValueMask = 0x8000
 
static const uint16_t stripIndexMask = 0x7FFF
 

Private Attributes

std::vector< uint8_t > amplitudes_
 
float error_x = -99999.9
 
uint16_t firstStrip_ = 0
 

Detailed Description

Definition at line 9 of file SiStripCluster.h.

Member Typedef Documentation

◆ SiStripDigiIter

typedef std::vector<SiStripDigi>::const_iterator SiStripCluster::SiStripDigiIter

Definition at line 11 of file SiStripCluster.h.

◆ SiStripDigiRange

Definition at line 12 of file SiStripCluster.h.

Constructor & Destructor Documentation

◆ SiStripCluster() [1/4]

SiStripCluster::SiStripCluster ( )
inline

Construct from a range of digis that form a cluster and from a DetID. The range is assumed to be non-empty.

Definition at line 21 of file SiStripCluster.h.

21 {}

◆ SiStripCluster() [2/4]

SiStripCluster::SiStripCluster ( const SiStripDigiRange range)
explicit

check if digis consecutive

Definition at line 4 of file SiStripCluster.cc.

4  : firstStrip_(range.first->strip()), error_x(-99999.9) {
5  amplitudes_.reserve(range.second - range.first);
6 
7  uint16_t lastStrip = 0;
8  bool firstInloop = true;
9  for (SiStripDigiIter i = range.first; i != range.second; i++) {
11  if (!firstInloop && i->strip() != lastStrip + 1) {
12  for (int j = 0; j < i->strip() - (lastStrip + 1); j++) {
13  amplitudes_.push_back(0);
14  }
15  }
16  lastStrip = i->strip();
17  firstInloop = false;
18 
19  amplitudes_.push_back(i->adc());
20  }
21 }

References amplitudes_, mps_fire::i, dqmiolumiharvest::j, and FastTimerService_cff::range.

◆ SiStripCluster() [3/4]

template<typename Iter >
SiStripCluster::SiStripCluster ( const uint16_t &  firstStrip,
Iter  begin,
Iter  end 
)
inline

Definition at line 26 of file SiStripCluster.h.

◆ SiStripCluster() [4/4]

template<typename Iter >
SiStripCluster::SiStripCluster ( const uint16_t &  firstStrip,
Iter  begin,
Iter  end,
bool  merged 
)
inline

Definition at line 29 of file SiStripCluster.h.

31  if (merged)
32  firstStrip_ |= mergedValueMask; // if this is a candidate merged cluster
33  }

References firstStrip_, and mergedValueMask.

Member Function Documentation

◆ amplitudes()

const std::vector<uint8_t>& SiStripCluster::amplitudes ( ) const
inline

The amplitudes of the strips forming the cluster. The amplitudes are on consecutive strips; if a strip is missing the amplitude is set to zero. A strip may be missing in the middle of a cluster because of a clusterizer that accepts holes. A strip may also be missing anywhere in the cluster, including the edge, to record a dead/noisy channel.

You can find the special meanings of values { 0, 254, 255} in section 3.4.1 of http://www.te.rl.ac.uk/esdg/cms-fed/firmware/Documents/FE_FPGA_Technical_Description.pdf

Definition at line 51 of file SiStripCluster.h.

51 { return amplitudes_; }

References amplitudes_.

Referenced by TrackerHitAssociator::associateSimpleRecHitCluster(), charge(), SimpleCosmicBONSeeder::checkCharge(), ClusterVariables::clusterSize(), SiStripGainFromData::ComputeChargeOverPath(), DeDxTools::getCharge(), ClusterShapeHitFilter::getSizes(), SiStripRecHitConverterAlgorithm::isMasked(), StMeasurementConditionSet::isMasked(), CalibrationTrackSelector::isOkCharge(), StripCPEfromTrackAngle::localParameters(), PrintRecoObjects::print(), ClusterTPAssociationProducer::produce(), ShallowGainCalibration::produce(), DeDxTools::shapeSelection(), ClusterVariables::stripCharges(), SiStripClusterInfo::stripCharges(), StripSubClusterShapeFilterBase::testLastHit(), reco::InverseCrosstalkMatrix::unfold(), and SiStripClusterInfo::width().

◆ barycenter()

float SiStripCluster::barycenter ( ) const

The barycenter of the cluster, not corrected for Lorentz shift; should not be used as position estimate for tracking.

Definition at line 23 of file SiStripCluster.cc.

23  {
24  int sumx = 0;
25  int suma = 0;
26  auto asize = amplitudes_.size();
27  for (auto i = 0U; i < asize; ++i) {
28  sumx += i * amplitudes_[i];
29  suma += amplitudes_[i];
30  }
31 
32  // strip centers are offcet by half pitch w.r.t. strip numbers,
33  // so one has to add 0.5 to get the correct barycenter position.
34  // Need to mask off the high bit of firstStrip_, which contains the merged status.
35  return float((firstStrip_ & stripIndexMask)) + float(sumx) / float(suma) + 0.5f;
36 }

References amplitudes_, firstStrip_, dqmMemoryStats::float, mps_fire::i, stripIndexMask, and mitigatedMETSequence_cff::U.

Referenced by SiStripClusterInfo::baryStrip(), SiStripFineDelayHit::closestCluster(), SiStripRecHitConverterAlgorithm::isMasked(), StMeasurementConditionSet::isMasked(), StripCPE::localParameters(), StripCPEfromTrackAngle::localParameters(), and PrintRecoObjects::print().

◆ charge()

int SiStripCluster::charge ( ) const
inline

total charge

Definition at line 61 of file SiStripCluster.h.

61 { return std::accumulate(amplitudes().begin(), amplitudes().end(), int(0)); }

References amplitudes(), begin, and end.

◆ firstStrip()

uint16_t SiStripCluster::firstStrip ( ) const
inline

◆ getSplitClusterError()

float SiStripCluster::getSplitClusterError ( ) const
inline

Definition at line 69 of file SiStripCluster.h.

69 { return error_x; }

References error_x.

◆ isMerged()

bool SiStripCluster::isMerged ( ) const
inline

Test (set) the merged status of the cluster

Definition at line 66 of file SiStripCluster.h.

66 { return (firstStrip_ & mergedValueMask) != 0; }

References firstStrip_, and mergedValueMask.

Referenced by StripCPEfromTrackAngle::localParameters().

◆ setMerged()

void SiStripCluster::setMerged ( bool  mergedState)
inline

Definition at line 67 of file SiStripCluster.h.

67 { mergedState ? firstStrip_ |= mergedValueMask : firstStrip_ &= stripIndexMask; }

References firstStrip_, mergedValueMask, and stripIndexMask.

◆ setSplitClusterError()

void SiStripCluster::setSplitClusterError ( float  errx)
inline

Definition at line 70 of file SiStripCluster.h.

70 { error_x = errx; }

References error_x.

Member Data Documentation

◆ amplitudes_

std::vector<uint8_t> SiStripCluster::amplitudes_
private

Definition at line 73 of file SiStripCluster.h.

Referenced by amplitudes(), barycenter(), and SiStripCluster().

◆ error_x

float SiStripCluster::error_x = -99999.9
private

Definition at line 85 of file SiStripCluster.h.

Referenced by getSplitClusterError(), and setSplitClusterError().

◆ firstStrip_

uint16_t SiStripCluster::firstStrip_ = 0
private

Definition at line 75 of file SiStripCluster.h.

Referenced by barycenter(), firstStrip(), isMerged(), setMerged(), and SiStripCluster().

◆ mergedValueMask

const uint16_t SiStripCluster::mergedValueMask = 0x8000
static

Definition at line 15 of file SiStripCluster.h.

Referenced by isMerged(), setMerged(), and SiStripCluster().

◆ stripIndexMask

const uint16_t SiStripCluster::stripIndexMask = 0x7FFF
static

Definition at line 14 of file SiStripCluster.h.

Referenced by barycenter(), firstStrip(), and setMerged().

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
mps_fire.i
i
Definition: mps_fire.py:355
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
SiStripCluster::error_x
float error_x
Definition: SiStripCluster.h:85
SiStripCluster::stripIndexMask
static const uint16_t stripIndexMask
Definition: SiStripCluster.h:14
end
#define end
Definition: vmac.h:39
SiStripCluster::firstStrip
uint16_t firstStrip() const
Definition: SiStripCluster.h:38
SiStripCluster::amplitudes_
std::vector< uint8_t > amplitudes_
Definition: SiStripCluster.h:73
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
SiStripCluster::SiStripDigiIter
std::vector< SiStripDigi >::const_iterator SiStripDigiIter
Definition: SiStripCluster.h:11
SiStripCluster::amplitudes
const std::vector< uint8_t > & amplitudes() const
Definition: SiStripCluster.h:51
SiStripCluster::mergedValueMask
static const uint16_t mergedValueMask
Definition: SiStripCluster.h:15
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
begin
#define begin
Definition: vmac.h:32
SiStripCluster::firstStrip_
uint16_t firstStrip_
Definition: SiStripCluster.h:75