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

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

Definition at line 12 of file SiStripCluster.h.

Definition at line 13 of file SiStripCluster.h.

Constructor & Destructor Documentation

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 23 of file SiStripCluster.h.

23 {}
SiStripCluster::SiStripCluster ( const SiStripDigiRange range)
explicit

check if digis consecutive

Definition at line 4 of file SiStripCluster.cc.

References amplitudes_, and mps_fire::i.

4  :
5  firstStrip_(range.first->strip()),
6  error_x(-99999.9)
7 {
8 
9  amplitudes_.reserve( range.second - range.first);
10 
11  uint16_t lastStrip=0;
12  bool firstInloop = true;
13  for (SiStripDigiIter i=range.first; i!=range.second; i++) {
14 
16  if (!firstInloop && i->strip() != lastStrip + 1) {
17  for (int j=0; j < i->strip()-(lastStrip+1); j++) {
18  amplitudes_.push_back( 0);
19  }
20  }
21  lastStrip = i->strip();
22  firstInloop = false;
23 
24  amplitudes_.push_back(i->adc());
25  }
26 }
std::vector< SiStripDigi >::const_iterator SiStripDigiIter
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_
template<typename Iter >
SiStripCluster::SiStripCluster ( const uint16_t &  firstStrip,
Iter  begin,
Iter  end 
)
inline

Definition at line 28 of file SiStripCluster.h.

29  :
uint16_t firstStrip() const
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_
template<typename Iter >
SiStripCluster::SiStripCluster ( const uint16_t &  firstStrip,
Iter  begin,
Iter  end,
bool  merged 
)
inline

Definition at line 33 of file SiStripCluster.h.

References firstStrip_, and mergedValueMask.

33  :
35  if (merged) firstStrip_ |= mergedValueMask; // if this is a candidate merged cluster
36  }
uint16_t firstStrip() const
static const uint16_t mergedValueMask
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_

Member Function Documentation

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 54 of file SiStripCluster.h.

References amplitudes_, and barycenter().

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

54 {return amplitudes_;}
std::vector< uint8_t > amplitudes_
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 29 of file SiStripCluster.cc.

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

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

29  {
30  int sumx = 0;
31  int suma = 0;
32  auto asize = amplitudes_.size();
33  for (auto i=0U;i<asize;++i) {
34  sumx += i*amplitudes_[i];
35  suma += amplitudes_[i];
36  }
37 
38  // strip centers are offcet by half pitch w.r.t. strip numbers,
39  // so one has to add 0.5 to get the correct barycenter position.
40  // Need to mask off the high bit of firstStrip_, which contains the merged status.
41  return float((firstStrip_ & stripIndexMask)) + float(sumx) / float(suma) + 0.5f;
42 }
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_
static const uint16_t stripIndexMask
int SiStripCluster::charge ( ) const
inline

total charge

Definition at line 64 of file SiStripCluster.h.

References amplitudes(), begin, and end.

64 { return std::accumulate(amplitudes().begin(), amplitudes().end(), int(0)); }
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
const std::vector< uint8_t > & amplitudes() const
uint16_t SiStripCluster::firstStrip ( ) const
inline
float SiStripCluster::getSplitClusterError ( ) const
inline

Definition at line 72 of file SiStripCluster.h.

References error_x.

Referenced by StripCPEfromTemplate::localParameters().

72 { return error_x; }
bool SiStripCluster::isMerged ( ) const
inline

Test (set) the merged status of the cluster

Definition at line 69 of file SiStripCluster.h.

References firstStrip_.

Referenced by StripCPEfromTrackAngle::localParameters().

69 {return (firstStrip_ & mergedValueMask) != 0;}
static const uint16_t mergedValueMask
uint16_t firstStrip_
void SiStripCluster::setMerged ( bool  mergedState)
inline

Definition at line 70 of file SiStripCluster.h.

References firstStrip_, and stripIndexMask.

static const uint16_t mergedValueMask
uint16_t firstStrip_
static const uint16_t stripIndexMask
void SiStripCluster::setSplitClusterError ( float  errx)
inline

Definition at line 73 of file SiStripCluster.h.

References error_x.

Referenced by TrackClusterSplitter::splitCluster().

73 { error_x = errx; }

Member Data Documentation

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

Definition at line 78 of file SiStripCluster.h.

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

float SiStripCluster::error_x = -99999.9
private

Definition at line 90 of file SiStripCluster.h.

Referenced by getSplitClusterError(), and setSplitClusterError().

uint16_t SiStripCluster::firstStrip_ = 0
private

Definition at line 80 of file SiStripCluster.h.

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

const uint16_t SiStripCluster::mergedValueMask = 0x8000
static

Definition at line 16 of file SiStripCluster.h.

Referenced by SiStripCluster().

const uint16_t SiStripCluster::stripIndexMask = 0x7FFF
static

Definition at line 15 of file SiStripCluster.h.

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