CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | 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

const std::vector< uint8_t > & amplitudes () const
 
float barycenter () const
 
uint16_t firstStrip () const
 
uint32_t geographicalId () const
 
 SiStripCluster ()
 
 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)
 

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.

18 : 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.

4  :
5  detId_(detid), firstStrip_(range.first->strip())
6 {
7 
8  amplitudes_.reserve( range.second - range.first);
9 
10  uint16_t lastStrip=0;
11  bool firstInloop = true;
12  for (SiStripDigiIter i=range.first; i!=range.second; i++) {
13 
15  if (!firstInloop && i->strip() != lastStrip + 1) {
16  for (int j=0; j < i->strip()-(lastStrip+1); j++) {
17  amplitudes_.push_back( 0);
18  }
19  }
20  lastStrip = i->strip();
21  firstInloop = false;
22 
23  amplitudes_.push_back(i->adc());
24  }
25 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
std::vector< SiStripDigi >::const_iterator SiStripDigiIter
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_
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.

30  :
31 
32  detId_(detid),
35 {}
uint16_t firstStrip() const
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_

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(), StripCPEfromTrackAngle::localParameters(), StripCPE::localParameters(), StripClusterAboveU::operator()(), and ShallowClustersProducer::produce().

37  {
38  int sumx = 0;
39  int suma = 0;
40  size_t asize = amplitudes_.size();
41  for (size_t i=0;i<asize;++i) {
42  sumx += (firstStrip_+i)*(amplitudes_[i]);
43  suma += amplitudes_[i];
44  }
45 
46  // strip centers are offcet by half pitch w.r.t. strip numbers,
47  // so one has to add 0.5 to get the correct barycenter position
48  return sumx / static_cast<float>(suma) + 0.5;
49 }
int i
Definition: DBlmapReader.cc:9
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_
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 56 of file SiStripCluster.h.

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

uint32_t SiStripCluster::detId_
private

Definition at line 54 of file SiStripCluster.h.

Referenced by geographicalId().

uint16_t SiStripCluster::firstStrip_
private

Definition at line 55 of file SiStripCluster.h.

Referenced by barycenter(), and firstStrip().