CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
SiStripDigiIter
SiStripDigiRange
 

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)
 
uint16_t firstStrip () const
 
bool full () const
 
float getSplitClusterError () 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)
 
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 error_x = -99999.9
 
uint16_t firstStrip_ = 0
 

Detailed Description

Definition at line 8 of file SiStripCluster.h.

Member Typedef Documentation

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

Definition at line 10 of file SiStripCluster.h.

Definition at line 11 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 20 of file SiStripCluster.h.

20 {}
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, 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 }
const uint16_t range(const Frame &aFrame)
std::vector< SiStripDigi >::const_iterator SiStripDigiIter
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_
SiStripCluster::SiStripCluster ( uint16_t  firstStrip,
std::vector< uint8_t > &&  data 
)
inline

Definition at line 24 of file SiStripCluster.h.

uint16_t firstStrip() const
def move
Definition: eostools.py:511
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
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.

uint16_t firstStrip() const
auto const * begin() const
auto const * end() const
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 31 of file SiStripCluster.h.

References firstStrip_, and mergedValueMask.

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

Member Function Documentation

SiStripCluster const& SiStripCluster::amplitudes ( ) const
inline
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.

References amplitudes_, firstStrip_, mps_fire::i, size(), and stripIndexMask.

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

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 }
auto size() const
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_
static const uint16_t stripIndexMask
auto const* SiStripCluster::begin ( void  ) const
inline

Definition at line 55 of file SiStripCluster.h.

References amplitudes_.

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

55 { return amplitudes_.data(); }
std::vector< uint8_t > amplitudes_
int SiStripCluster::charge ( ) const
inline

total charge

Definition at line 77 of file SiStripCluster.h.

References begin(), and end().

Referenced by SiStripApproximateCluster::SiStripApproximateCluster().

77 { return std::accumulate(begin(), end(), int(0)); }
auto const * begin() const
auto const * end() const
bool SiStripCluster::empty ( ) const
inline

Definition at line 58 of file SiStripCluster.h.

References amplitudes_.

58 { return amplitudes_.empty(); }
std::vector< uint8_t > amplitudes_
auto const* SiStripCluster::end ( void  ) const
inline
uint16_t SiStripCluster::endStrip ( ) const
inline

Definition at line 67 of file SiStripCluster.h.

References firstStrip(), and size().

67 { return firstStrip() + size(); }
uint16_t firstStrip() const
auto size() const
template<typename Iter >
void SiStripCluster::extend ( Iter  begin,
Iter  end 
)
inline

Definition at line 39 of file SiStripCluster.h.

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

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

39  {
40  amplitudes_.insert(amplitudes_.end(), begin, end);
41  }
auto const * begin() const
auto const * end() const
std::vector< uint8_t > amplitudes_
uint16_t SiStripCluster::firstStrip ( ) const
inline
bool SiStripCluster::full ( ) const
inline

Definition at line 59 of file SiStripCluster.h.

59 { return false; }
float SiStripCluster::getSplitClusterError ( ) const
inline

Definition at line 85 of file SiStripCluster.h.

References error_x.

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

Test (set) the merged status of the cluster

Definition at line 82 of file SiStripCluster.h.

References firstStrip_, and mergedValueMask.

Referenced by StripCPEfromTrackAngle::localParameters().

82 { return (firstStrip_ & mergedValueMask) != 0; }
static const uint16_t mergedValueMask
uint16_t firstStrip_
auto SiStripCluster::operator[] ( int  i) const
inline

Definition at line 57 of file SiStripCluster.h.

References begin(), and mps_fire::i.

57 { return *(begin() + i); }
auto const * begin() const
void SiStripCluster::setMerged ( bool  mergedState)
inline

Definition at line 83 of file SiStripCluster.h.

References firstStrip_, mergedValueMask, and stripIndexMask.

83 { mergedState ? firstStrip_ |= mergedValueMask : firstStrip_ &= stripIndexMask; }
static const uint16_t mergedValueMask
uint16_t firstStrip_
static const uint16_t stripIndexMask
void SiStripCluster::setSplitClusterError ( float  errx)
inline

Definition at line 86 of file SiStripCluster.h.

References error_x.

86 { error_x = errx; }
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 54 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().

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

Member Data Documentation

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

Definition at line 89 of file SiStripCluster.h.

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

float SiStripCluster::error_x = -99999.9
private

Definition at line 101 of file SiStripCluster.h.

Referenced by getSplitClusterError(), and setSplitClusterError().

uint16_t SiStripCluster::firstStrip_ = 0
private

Definition at line 91 of file SiStripCluster.h.

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

const uint16_t SiStripCluster::mergedValueMask = 0x8000
static

Definition at line 14 of file SiStripCluster.h.

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

const uint16_t SiStripCluster::stripIndexMask = 0x7FFF
static

Definition at line 13 of file SiStripCluster.h.

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