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

SiStripCluster const & amplitudes () const
 
float barycenter () const
 
uint8_t const * begin () const
 
int charge () const
 
bool empty () const
 
uint8_t const * end () const
 
uint16_t endStrip () const
 
template<typename Iter >
void extend (Iter begin, Iter end)
 
uint16_t firstStrip () const
 
bool full () const
 
float getSplitClusterError () const
 
bool isMerged () const
 
uint8_t operator[] (int i) 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)
 
 SiStripCluster (uint16_t firstStrip, std::vector< uint8_t > &&data)
 
uint8_t size () const
 

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/5]

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/5]

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  std::vector<uint8_t> v;
6  v.reserve(range.second - range.first);
7 
8  uint16_t lastStrip = 0;
9  bool firstInloop = true;
10  for (SiStripDigiIter i = range.first; i != range.second; i++) {
12  if (!firstInloop && i->strip() != lastStrip + 1) {
13  for (int j = 0; j < i->strip() - (lastStrip + 1); j++) {
14  v.push_back(0);
15  }
16  }
17  lastStrip = i->strip();
18  firstInloop = false;
19 
20  v.push_back(i->adc());
21  }
22  amplitudes_ = v;
23 }

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

◆ SiStripCluster() [3/5]

SiStripCluster::SiStripCluster ( uint16_t  firstStrip,
std::vector< uint8_t > &&  data 
)
inline

Definition at line 25 of file SiStripCluster.h.

◆ SiStripCluster() [4/5]

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

Definition at line 29 of file SiStripCluster.h.

◆ SiStripCluster() [5/5]

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

Definition at line 32 of file SiStripCluster.h.

34  if (merged)
35  firstStrip_ |= mergedValueMask; // if this is a candidate merged cluster
36  }

References firstStrip_, and mergedValueMask.

Member Function Documentation

◆ amplitudes()

SiStripCluster const& SiStripCluster::amplitudes ( ) const
inline

◆ 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 25 of file SiStripCluster.cc.

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

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

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

◆ begin()

uint8_t const* SiStripCluster::begin ( void  ) 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 62 of file SiStripCluster.h.

62 { return amplitudes_.data(); }

References amplitudes_.

Referenced by charge(), SimpleCosmicBONSeeder::checkCharge(), end(), extend(), CalibrationTrackSelector::isOkCharge(), and operator[]().

◆ charge()

int SiStripCluster::charge ( ) const
inline

total charge

Definition at line 79 of file SiStripCluster.h.

79 { return std::accumulate(begin(), end(), int(0)); }

References begin(), and end().

◆ empty()

bool SiStripCluster::empty ( ) const
inline

Definition at line 66 of file SiStripCluster.h.

66 { return 0 == size(); }

References size().

◆ end()

uint8_t const* SiStripCluster::end ( void  ) const
inline

◆ endStrip()

uint16_t SiStripCluster::endStrip ( ) const
inline

Definition at line 49 of file SiStripCluster.h.

49 { return firstStrip() + size(); }

References firstStrip(), and size().

◆ extend()

template<typename Iter >
void SiStripCluster::extend ( Iter  begin,
Iter  end 
)
inline

◆ firstStrip()

uint16_t SiStripCluster::firstStrip ( ) const
inline

◆ full()

bool SiStripCluster::full ( ) const
inline

Definition at line 67 of file SiStripCluster.h.

67 { return false; }

◆ getSplitClusterError()

float SiStripCluster::getSplitClusterError ( ) const
inline

Definition at line 87 of file SiStripCluster.h.

87 { return error_x; }

References error_x.

◆ isMerged()

bool SiStripCluster::isMerged ( ) const
inline

Test (set) the merged status of the cluster

Definition at line 84 of file SiStripCluster.h.

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

References firstStrip_, and mergedValueMask.

Referenced by StripCPEfromTrackAngle::localParameters().

◆ operator[]()

uint8_t SiStripCluster::operator[] ( int  i) const
inline

Definition at line 65 of file SiStripCluster.h.

65 { return *(begin() + i); }

References begin(), and mps_fire::i.

◆ setMerged()

void SiStripCluster::setMerged ( bool  mergedState)
inline

Definition at line 85 of file SiStripCluster.h.

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

References firstStrip_, mergedValueMask, and stripIndexMask.

◆ setSplitClusterError()

void SiStripCluster::setSplitClusterError ( float  errx)
inline

Definition at line 88 of file SiStripCluster.h.

88 { error_x = errx; }

References error_x.

◆ size()

uint8_t SiStripCluster::size ( void  ) const
inline

Member Data Documentation

◆ amplitudes_

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

Definition at line 91 of file SiStripCluster.h.

Referenced by barycenter(), begin(), extend(), SiStripCluster(), and size().

◆ error_x

float SiStripCluster::error_x = -99999.9
private

Definition at line 103 of file SiStripCluster.h.

Referenced by getSplitClusterError(), and setSplitClusterError().

◆ firstStrip_

uint16_t SiStripCluster::firstStrip_ = 0
private

Definition at line 93 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().

SiStripCluster::begin
uint8_t const * begin() const
Definition: SiStripCluster.h:62
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
mps_fire.i
i
Definition: mps_fire.py:428
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
SiStripCluster::error_x
float error_x
Definition: SiStripCluster.h:103
SiStripCluster::stripIndexMask
static const uint16_t stripIndexMask
Definition: SiStripCluster.h:14
findQualityFiles.v
v
Definition: findQualityFiles.py:179
SiStripCluster::firstStrip
uint16_t firstStrip() const
Definition: SiStripCluster.h:47
SiStripCluster::amplitudes_
std::vector< uint8_t > amplitudes_
Definition: SiStripCluster.h:91
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
SiStripCluster::SiStripDigiIter
std::vector< SiStripDigi >::const_iterator SiStripDigiIter
Definition: SiStripCluster.h:11
SiStripCluster::end
uint8_t const * end() const
Definition: SiStripCluster.h:63
SiStripCluster::size
uint8_t size() const
Definition: SiStripCluster.h:64
eostools.move
def move(src, dest)
Definition: eostools.py:511
SiStripCluster::mergedValueMask
static const uint16_t mergedValueMask
Definition: SiStripCluster.h:15
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SiStripCluster::firstStrip_
uint16_t firstStrip_
Definition: SiStripCluster.h:93