test
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 | 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

const std::vector< uint8_t > & amplitudes () const
 
float barycenter () const
 
int charge () const
 
uint16_t firstStrip () const
 
float getSplitClusterError () const
 
bool isMerged () 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)
 

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
 
uint16_t firstStrip_
 

Detailed Description

Definition at line 9 of file SiStripCluster.h.

Member Typedef Documentation

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

Definition at line 12 of file SiStripCluster.h.

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

22 : error_x( -99999.9 ) {}
SiStripCluster::SiStripCluster ( const SiStripDigiRange range)
explicit

check if digis consecutive

Definition at line 4 of file SiStripCluster.cc.

References amplitudes_, i, and j.

4  :
5  firstStrip_(range.first->strip()),
6  error_x(-99999.9)
7 {
8 
9  amplitudes_.reserve( range.second - range.first);
10 
11  uint16_t lastStrip=0;
12  bool firstInloop = true;
13  for (SiStripDigiIter i=range.first; i!=range.second; i++) {
14 
16  if (!firstInloop && i->strip() != lastStrip + 1) {
17  for (int j=0; j < i->strip()-(lastStrip+1); j++) {
18  amplitudes_.push_back( 0);
19  }
20  }
21  lastStrip = i->strip();
22  firstInloop = false;
23 
24  amplitudes_.push_back(i->adc());
25  }
26 }
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_
template<typename Iter >
SiStripCluster::SiStripCluster ( const uint16_t &  firstStrip,
Iter  begin,
Iter  end 
)
inline

Definition at line 27 of file SiStripCluster.h.

28  :
30  // ggiurgiu@fnal.gov, 01/05/12
31  // Initialize the split cluster errors to un-physical values.
32  // The CPE will check these errors and if they are not un-physical,
33  // it will recognize the clusters as split and assign these (increased)
34  // errors to the corresponding rechit.
35  error_x(-99999.9){}
uint16_t firstStrip() const
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
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 38 of file SiStripCluster.h.

References firstStrip_, and mergedValueMask.

38  :
40  if (merged) firstStrip_ |= mergedValueMask; // if this is a candidate merged cluster
41  }
uint16_t firstStrip() const
static const uint16_t mergedValueMask
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_

Member Function Documentation

const std::vector<uint8_t>& SiStripCluster::amplitudes ( ) 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 59 of file SiStripCluster.h.

References amplitudes_.

Referenced by TrackerHitAssociator::associateSimpleRecHitCluster(), charge(), SimpleCosmicBONSeeder::checkCharge(), ClusterVariables::clusterSize(), SiStripGainFromData::ComputeChargeOverPath(), DeDxTools::getCharge(), ClusterShapeHitFilter::getSizes(), SiStripRecHitConverterAlgorithm::isMasked(), StMeasurementConditionSet::isMasked(), CalibrationTrackSelector::isOkCharge(), StripCPEfromTemplate::localParameters(), StripCPEfromTrackAngle::localParameters(), PrintRecoObjects::print(), ClusterTPAssociationProducer::produce(), ShallowGainCalibration::produce(), DeDxTools::shapeSelection(), TrackClusterSplitter::splitCluster(), ClusterVariables::stripCharges(), SiStripClusterInfo::stripCharges(), StripSubClusterShapeFilterBase::testLastHit(), reco::InverseCrosstalkMatrix::unfold(), and SiStripClusterInfo::width().

59 {return amplitudes_;}
std::vector< uint8_t > amplitudes_
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 29 of file SiStripCluster.cc.

References amplitudes_, firstStrip_, i, and stripIndexMask.

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

29  {
30  int sumx = 0;
31  int suma = 0;
32  auto asize = amplitudes_.size();
33  for (auto i=0U;i<asize;++i) {
34  sumx += i*amplitudes_[i];
35  suma += amplitudes_[i];
36  }
37 
38  // strip centers are offcet by half pitch w.r.t. strip numbers,
39  // so one has to add 0.5 to get the correct barycenter position.
40  // Need to mask off the high bit of firstStrip_, which contains the merged status.
41  return float((firstStrip_ & stripIndexMask)) + float(sumx) / float(suma) + 0.5f;
42 }
int i
Definition: DBlmapReader.cc:9
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_
static const uint16_t stripIndexMask
int SiStripCluster::charge ( ) const
inline

total charge

Definition at line 69 of file SiStripCluster.h.

References amplitudes(), begin, and end.

69 { return std::accumulate(amplitudes().begin(), amplitudes().end(), int(0)); }
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
const std::vector< uint8_t > & amplitudes() const
uint16_t SiStripCluster::firstStrip ( ) const
inline
float SiStripCluster::getSplitClusterError ( ) const
inline

Definition at line 77 of file SiStripCluster.h.

References error_x.

Referenced by StripCPEfromTemplate::localParameters().

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

Test (set) the merged status of the cluster

Definition at line 74 of file SiStripCluster.h.

References firstStrip_, and mergedValueMask.

Referenced by StripCPEfromTrackAngle::localParameters().

74 {return (firstStrip_ & mergedValueMask) != 0;}
static const uint16_t mergedValueMask
uint16_t firstStrip_
void SiStripCluster::setMerged ( bool  mergedState)
inline

Definition at line 75 of file SiStripCluster.h.

References firstStrip_, mergedValueMask, and stripIndexMask.

static const uint16_t mergedValueMask
uint16_t firstStrip_
static const uint16_t stripIndexMask
void SiStripCluster::setSplitClusterError ( float  errx)
inline

Definition at line 78 of file SiStripCluster.h.

References error_x.

Referenced by TrackClusterSplitter::splitCluster().

78 { error_x = errx; }

Member Data Documentation

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

Definition at line 83 of file SiStripCluster.h.

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

float SiStripCluster::error_x
private

Definition at line 95 of file SiStripCluster.h.

Referenced by getSplitClusterError(), and setSplitClusterError().

uint16_t SiStripCluster::firstStrip_
private

Definition at line 85 of file SiStripCluster.h.

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

const uint16_t SiStripCluster::mergedValueMask = 0x8000
static

Definition at line 16 of file SiStripCluster.h.

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

const uint16_t SiStripCluster::stripIndexMask = 0x7FFF
static

Definition at line 15 of file SiStripCluster.h.

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