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
 
auto const * begin () const
 
int charge () const
 
bool empty () const
 
auto const * end () const
 
uint16_t endStrip () const
 
template<typename Iter >
void extend (Iter begin, Iter end)
 
bool filter () const
 
uint16_t firstStrip () const
 
bool full () const
 
float getSplitClusterError () const
 
bool isFromApprox () const
 
bool isMerged () const
 
auto operator[] (int i) const
 
void setMerged (bool mergedState)
 
void setSplitClusterError (float errx)
 
 SiStripCluster ()
 
 SiStripCluster (const SiStripDigiRange &range)
 
 SiStripCluster (uint16_t firstStrip, std::vector< uint8_t > &&data)
 
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 (const SiStripApproximateCluster cluster, const uint16_t maxStrips)
 
auto 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 barycenter_ = 0
 
int charge_ = 0
 
float error_x = -99999.9
 
bool filter_ = false
 
uint16_t firstStrip_ = 0
 

Detailed Description

Definition at line 12 of file SiStripCluster.h.

Member Typedef Documentation

◆ SiStripDigiIter

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

Definition at line 14 of file SiStripCluster.h.

◆ SiStripDigiRange

Definition at line 15 of file SiStripCluster.h.

Constructor & Destructor Documentation

◆ SiStripCluster() [1/6]

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

24 {}

◆ SiStripCluster() [2/6]

SiStripCluster::SiStripCluster ( const SiStripDigiRange range)
explicit

check if digis consecutive

Definition at line 4 of file SiStripCluster.cc.

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

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 }
std::vector< SiStripDigi >::const_iterator SiStripDigiIter
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_

◆ SiStripCluster() [3/6]

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

Definition at line 28 of file SiStripCluster.h.

uint16_t firstStrip() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_
def move(src, dest)
Definition: eostools.py:511

◆ SiStripCluster() [4/6]

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

Definition at line 32 of file SiStripCluster.h.

uint16_t firstStrip() const
auto const * begin() const
auto const * end() const
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_

◆ SiStripCluster() [5/6]

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

Definition at line 35 of file SiStripCluster.h.

References firstStrip_, and mergedValueMask.

37  if (merged)
38  firstStrip_ |= mergedValueMask; // if this is a candidate merged cluster
39  }
uint16_t firstStrip() const
auto const * begin() const
auto const * end() const
static const uint16_t mergedValueMask
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_

◆ SiStripCluster() [6/6]

SiStripCluster::SiStripCluster ( const SiStripApproximateCluster  cluster,
const uint16_t  maxStrips 
)

Definition at line 25 of file SiStripCluster.cc.

References amplitudes_, SiStripApproximateCluster::avgCharge(), SiStripApproximateCluster::barycenter(), barycenter_, charge_, f, SiStripApproximateCluster::filter(), filter_, firstStrip_, nano_mu_digi_cff::float, SiStripPI::max, UNLIKELY, and SiStripApproximateCluster::width().

25  : error_x(-99999.9) {
26  barycenter_ = cluster.barycenter() / 10.0;
27  charge_ = cluster.width() * cluster.avgCharge();
28  amplitudes_.resize(cluster.width(), cluster.avgCharge());
29  filter_ = cluster.filter();
30 
31  float halfwidth_ = 0.5f * float(cluster.width());
32 
33  //initialize firstStrip_
34  firstStrip_ = std::max(barycenter_ - halfwidth_, 0.f);
35 
36  if UNLIKELY (firstStrip_ + cluster.width() > maxStrips) {
37  firstStrip_ = maxStrips - cluster.width();
38  }
39 }
double f[11][100]
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_
#define UNLIKELY(x)
Definition: Likely.h:21

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

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

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

47  {
48  if (barycenter_ > 0)
49  return barycenter_;
50 
51  int sumx = 0;
52  int suma = 0;
53  auto asize = size();
54  for (auto i = 0U; i < asize; ++i) {
55  sumx += i * amplitudes_[i];
56  suma += amplitudes_[i];
57  }
58 
59  // strip centers are offcet by half pitch w.r.t. strip numbers,
60  // so one has to add 0.5 to get the correct barycenter position.
61  // Need to mask off the high bit of firstStrip_, which contains the merged status.
62  return float((firstStrip_ & stripIndexMask)) + float(sumx) / float(suma) + 0.5f;
63 }
auto size() const
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_
static const uint16_t stripIndexMask

◆ begin()

auto const* SiStripCluster::begin ( void  ) const
inline

Definition at line 61 of file SiStripCluster.h.

References amplitudes_.

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

61 { return amplitudes_.data(); }
std::vector< uint8_t > amplitudes_

◆ charge()

int SiStripCluster::charge ( ) const

total charge

Definition at line 41 of file SiStripCluster.cc.

References barycenter_, begin(), charge_, and end().

Referenced by SiStripApproximateCluster::SiStripApproximateCluster().

41  {
42  if (barycenter_ > 0)
43  return charge_;
44  return std::accumulate(begin(), end(), int(0));
45 }
auto const * begin() const
auto const * end() const

◆ empty()

bool SiStripCluster::empty ( ) const
inline

Definition at line 64 of file SiStripCluster.h.

References amplitudes_.

64 { return amplitudes_.empty(); }
std::vector< uint8_t > amplitudes_

◆ end()

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

◆ endStrip()

uint16_t SiStripCluster::endStrip ( ) const
inline

Definition at line 73 of file SiStripCluster.h.

References firstStrip(), and size().

73 { return firstStrip() + size(); }
uint16_t firstStrip() const
auto size() const

◆ extend()

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

Definition at line 45 of file SiStripCluster.h.

References amplitudes_, begin(), and end().

Referenced by MatrixUtil.WF::__init__(), Config.Process::extend(), Config.Process::load(), and Mixins._ValidatingParameterListBase::setValue().

45  {
46  amplitudes_.insert(amplitudes_.end(), begin, end);
47  }
auto const * begin() const
auto const * end() const
std::vector< uint8_t > amplitudes_

◆ filter()

bool SiStripCluster::filter ( ) const

Definition at line 64 of file SiStripCluster.cc.

References barycenter_, and filter_.

Referenced by StripSubClusterShapeFilterBase::testLastHit().

64  {
65  if (barycenter_ > 0)
66  return filter_;
67  return false;
68 }

◆ firstStrip()

uint16_t SiStripCluster::firstStrip ( ) const
inline

◆ full()

bool SiStripCluster::full ( ) const
inline

Definition at line 65 of file SiStripCluster.h.

65 { return false; }

◆ getSplitClusterError()

float SiStripCluster::getSplitClusterError ( ) const
inline

Definition at line 95 of file SiStripCluster.h.

References error_x.

95 { return error_x; }

◆ isFromApprox()

bool SiStripCluster::isFromApprox ( ) const

Definition at line 70 of file SiStripCluster.cc.

References barycenter_.

Referenced by StripSubClusterShapeFilterBase::testLastHit().

70 { return (barycenter_ > 0); }

◆ isMerged()

bool SiStripCluster::isMerged ( ) const
inline

Test (set) the merged status of the cluster

Definition at line 92 of file SiStripCluster.h.

References firstStrip_, and mergedValueMask.

Referenced by StripCPEfromTrackAngle::localParameters().

92 { return (firstStrip_ & mergedValueMask) != 0; }
static const uint16_t mergedValueMask
uint16_t firstStrip_

◆ operator[]()

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

Definition at line 63 of file SiStripCluster.h.

References begin(), and mps_fire::i.

63 { return *(begin() + i); }
auto const * begin() const

◆ setMerged()

void SiStripCluster::setMerged ( bool  mergedState)
inline

Definition at line 93 of file SiStripCluster.h.

References firstStrip_, mergedValueMask, and stripIndexMask.

93 { mergedState ? firstStrip_ |= mergedValueMask : firstStrip_ &= stripIndexMask; }
static const uint16_t mergedValueMask
uint16_t firstStrip_
static const uint16_t stripIndexMask

◆ setSplitClusterError()

void SiStripCluster::setSplitClusterError ( float  errx)
inline

Definition at line 96 of file SiStripCluster.h.

References error_x.

96 { error_x = errx; }

◆ size()

auto SiStripCluster::size ( 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 60 of file SiStripCluster.h.

References amplitudes_.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), SiStripMonitorCluster::analyze(), TrackerHitAssociator::associateSimpleRecHitCluster(), barycenter(), ClusterVariables::clusterSize(), end(), endStrip(), ClusterShapeHitFilter::getSizes(), SiStripRecHitConverterAlgorithm::isMasked(), StMeasurementConditionSet::isMasked(), StripCPEfromTrackAngle::localParameters(), PrintRecoObjects::print(), ClusterTPAssociationProducer::produce(), SiStripApproximateCluster::SiStripApproximateCluster(), and SiStripClusterInfo::width().

60 { return amplitudes_.size(); }
std::vector< uint8_t > amplitudes_

Member Data Documentation

◆ amplitudes_

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

Definition at line 99 of file SiStripCluster.h.

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

◆ barycenter_

float SiStripCluster::barycenter_ = 0
private

Definition at line 104 of file SiStripCluster.h.

Referenced by barycenter(), charge(), filter(), isFromApprox(), and SiStripCluster().

◆ charge_

int SiStripCluster::charge_ = 0
private

Definition at line 105 of file SiStripCluster.h.

Referenced by charge(), and SiStripCluster().

◆ error_x

float SiStripCluster::error_x = -99999.9
private

Definition at line 116 of file SiStripCluster.h.

Referenced by getSplitClusterError(), and setSplitClusterError().

◆ filter_

bool SiStripCluster::filter_ = false
private

Definition at line 106 of file SiStripCluster.h.

Referenced by filter(), and SiStripCluster().

◆ firstStrip_

uint16_t SiStripCluster::firstStrip_ = 0
private

Definition at line 101 of file SiStripCluster.h.

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

◆ mergedValueMask

const uint16_t SiStripCluster::mergedValueMask = 0x8000
static

Definition at line 18 of file SiStripCluster.h.

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

◆ stripIndexMask

const uint16_t SiStripCluster::stripIndexMask = 0x7FFF
static

Definition at line 17 of file SiStripCluster.h.

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