CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

SiStripCluster Class Reference

#include <SiStripCluster.h>

List of all members.

Public Types

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

Public Member Functions

const std::vector< uint8_t > & amplitudes () const
float barycenter () const
uint16_t firstStrip () const
uint32_t geographicalId () const
 SiStripCluster (uint32_t detid, const SiStripDigiRange &range)
 SiStripCluster (const uint32_t &detid, const uint16_t &firstStrip, std::vector< uint16_t >::const_iterator begin, std::vector< uint16_t >::const_iterator end)
 SiStripCluster ()

Private Attributes

std::vector< uint8_t > amplitudes_
uint32_t detId_
uint16_t firstStrip_

Detailed Description

Definition at line 8 of file SiStripCluster.h.


Member Typedef Documentation

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

Definition at line 11 of file SiStripCluster.h.

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

: detId_(0) {}
SiStripCluster::SiStripCluster ( uint32_t  detid,
const SiStripDigiRange range 
)

check if digis consecutive

Definition at line 4 of file SiStripCluster.cc.

References amplitudes_, i, and j.

                                                                             :
  detId_(detid), firstStrip_(range.first->strip())
{

  amplitudes_.reserve( range.second - range.first);
  
  uint16_t lastStrip=0;
  bool firstInloop = true;
  for (SiStripDigiIter i=range.first; i!=range.second; i++) {
    
    if (!firstInloop && i->strip() != lastStrip + 1) {
      for (int j=0; j < i->strip()-(lastStrip+1); j++) {
        amplitudes_.push_back( 0);
      }
    }
    lastStrip = i->strip();
    firstInloop = false;
    
    amplitudes_.push_back(i->adc()); 
  }
}
SiStripCluster::SiStripCluster ( const uint32_t &  detid,
const uint16_t &  firstStrip,
std::vector< uint16_t >::const_iterator  begin,
std::vector< uint16_t >::const_iterator  end 
)

Definition at line 27 of file SiStripCluster.cc.


Member Function Documentation

const std::vector<uint8_t>& 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 37 of file SiStripCluster.cc.

References amplitudes_, firstStrip_, and i.

Referenced by SiStripClusterInfo::baryStrip(), SiStripFineDelayHit::closestCluster(), SiStripRecHitConverterAlgorithm::isMasked(), TkStripMeasurementDet::isMasked(), StripCPE::localParameters(), StripCPEfromTrackAngle::localParameters(), StripClusterAboveU::operator()(), and ShallowClustersProducer::produce().

                                      {
  int sumx = 0;
  int suma = 0;
  size_t asize = amplitudes_.size();
  for (size_t i=0;i<asize;++i) {
    sumx += (firstStrip_+i)*(amplitudes_[i]);
    suma += amplitudes_[i];
  }
  
  // strip centers are offcet by half pitch w.r.t. strip numbers,
  // so one has to add 0.5 to get the correct barycenter position
  return sumx / static_cast<float>(suma) + 0.5;
}
uint16_t SiStripCluster::firstStrip ( ) const [inline]
uint32_t SiStripCluster::geographicalId ( ) const [inline]

Member Data Documentation

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

Definition at line 59 of file SiStripCluster.h.

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

uint32_t SiStripCluster::detId_ [private]

Definition at line 57 of file SiStripCluster.h.

Referenced by geographicalId().

uint16_t SiStripCluster::firstStrip_ [private]

Definition at line 58 of file SiStripCluster.h.

Referenced by barycenter(), and firstStrip().