CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripClusterInfo Class Reference

#include <SiStripClusterInfo.h>

Public Member Functions

float baryStrip () const
 
uint16_t charge () const
 
std::pair< uint16_t, uint16_t > chargeLR () const
 
const SiStripClustercluster () const
 
uint32_t detId () const
 
uint16_t firstStrip () const
 
void initEvent (const edm::EventSetup &iSetup)
 
bool IsAnythingBad () const
 
bool IsApvBad () const
 
bool IsFiberBad () const
 
bool IsModuleBad () const
 
bool IsModuleUsable () const
 
uint8_t maxCharge () const
 
uint16_t maxIndex () const
 
uint16_t maxStrip () const
 
float noise () const
 
float noiseRescaledByGain () const
 
void setCluster (const SiStripCluster &cluster, int detId)
 
float signalOverNoise () const
 
 SiStripClusterInfo (edm::ConsumesCollector &&, const std::string &qualityLabel="")
 
const SiStripGainsiStripGain () const
 
const SiStripQualitysiStripQuality () const
 
auto stripCharges () const -> decltype(cluster() ->amplitudes())
 
std::vector< float > stripGains () const
 
std::vector< float > stripNoises () const
 
std::vector< float > stripNoisesRescaledByGain () const
 
std::vector< bool > stripQualitiesBad () const
 
float variance () const
 
uint16_t width () const
 

Private Member Functions

float calculate_noise (const std::vector< float > &) const
 

Private Attributes

const SiStripClustercluster_ptr = nullptr
 
uint32_t detId_ = 0
 
const SiStripGainsiStripGain_ = nullptr
 
edm::ESGetToken< SiStripGain,
SiStripGainRcd
siStripGainToken_
 
const SiStripNoisessiStripNoises_ = nullptr
 
edm::ESGetToken< SiStripNoises,
SiStripNoisesRcd
siStripNoisesToken_
 
const SiStripQualitysiStripQuality_ = nullptr
 
edm::ESGetToken
< SiStripQuality,
SiStripQualityRcd
siStripQualityToken_
 

Detailed Description

Definition at line 21 of file SiStripClusterInfo.h.

Constructor & Destructor Documentation

SiStripClusterInfo::SiStripClusterInfo ( edm::ConsumesCollector &&  iC,
const std::string &  qualityLabel = "" 
)

Member Function Documentation

float SiStripClusterInfo::baryStrip ( ) const
inline

Definition at line 33 of file SiStripClusterInfo.h.

References SiStripCluster::barycenter(), and cluster().

Referenced by TrackerDpgAnalysis::analyze(), SiStripMonitorTrack::clusterInfos(), and ApeEstimator::fillHitVariables().

33 { return cluster()->barycenter(); }
const SiStripCluster * cluster() const
float barycenter() const
float SiStripClusterInfo::calculate_noise ( const std::vector< float > &  noise) const
private

Definition at line 82 of file SiStripClusterInfo.cc.

References mps_fire::i, mathSSE::sqrt(), stripCharges(), and width().

Referenced by noise(), and noiseRescaledByGain().

82  {
83  float noiseSumInQuadrature = 0;
84  int numberStripsOverThreshold = 0;
85  for (int i = 0; i < width(); i++) {
86  if (stripCharges()[i] != 0) {
87  noiseSumInQuadrature += noise.at(i) * noise.at(i);
88  numberStripsOverThreshold++;
89  }
90  }
91  return std::sqrt(noiseSumInQuadrature / numberStripsOverThreshold);
92 }
float noise() const
auto stripCharges() const -> decltype(cluster() ->amplitudes())
T sqrt(T t)
Definition: SSEVec.h:19
uint16_t width() const
uint16_t SiStripClusterInfo::charge ( void  ) const
inline
std::pair< uint16_t, uint16_t > SiStripClusterInfo::chargeLR ( ) const

Definition at line 21 of file SiStripClusterInfo.cc.

References SplitLinear::begin, dataset::end, SiStripPI::max, and stripCharges().

Referenced by ApeEstimator::fillHitVariables().

21  {
22  std::vector<uint8_t>::const_iterator begin(stripCharges().begin()), end(stripCharges().end()), max;
23  max = max_element(begin, end);
24  return std::make_pair(accumulate(begin, max, uint16_t(0)), accumulate(max + 1, end, uint16_t(0)));
25 }
auto stripCharges() const -> decltype(cluster() ->amplitudes())
string end
Definition: dataset.py:937
const SiStripCluster* SiStripClusterInfo::cluster ( ) const
inline

Definition at line 28 of file SiStripClusterInfo.h.

References cluster_ptr.

Referenced by baryStrip(), firstStrip(), setCluster(), stripCharges(), and width().

28 { return cluster_ptr; }
const SiStripCluster * cluster_ptr
uint32_t SiStripClusterInfo::detId ( ) const
inline
uint16_t SiStripClusterInfo::firstStrip ( ) const
inline
void SiStripClusterInfo::initEvent ( const edm::EventSetup iSetup)

Definition at line 10 of file SiStripClusterInfo.cc.

References edm::EventSetup::getData(), siStripGain_, siStripGainToken_, siStripNoises_, siStripNoisesToken_, siStripQuality_, and siStripQualityToken_.

Referenced by StandaloneTrackMonitor::analyze(), HitEff::analyze(), SiStripMonitorTrack::analyze(), TrackerDpgAnalysis::analyze(), ApeEstimator::analyze(), ShallowClustersProducer::produce(), and reco::modules::TrackerTrackHitFilter::produce().

10  {
14 }
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > siStripQualityToken_
bool getData(T &iHolder) const
Definition: EventSetup.h:122
const SiStripNoises * siStripNoises_
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > siStripNoisesToken_
const SiStripGain * siStripGain_
const SiStripQuality * siStripQuality_
edm::ESGetToken< SiStripGain, SiStripGainRcd > siStripGainToken_
bool SiStripClusterInfo::IsAnythingBad ( ) const

Definition at line 94 of file SiStripClusterInfo.cc.

References IsApvBad(), IsFiberBad(), IsModuleBad(), and stripQualitiesBad().

Referenced by ShallowClustersProducer::produce().

94  {
95  std::vector<bool> stripBad = stripQualitiesBad();
96  return IsApvBad() || IsFiberBad() || IsModuleBad() ||
97  accumulate(stripBad.begin(), stripBad.end(), false, std::logical_or<bool>());
98 }
std::vector< bool > stripQualitiesBad() const
bool SiStripClusterInfo::IsApvBad ( ) const

Definition at line 100 of file SiStripClusterInfo.cc.

References detId_, firstStrip(), SiStripQuality::IsApvBad(), siStripQuality_, and width().

Referenced by IsAnythingBad().

100  {
101  return siStripQuality_->IsApvBad(detId_, firstStrip() / 128) ||
103 }
bool IsApvBad(const uint32_t &detid, const short &apvNb) const
uint16_t firstStrip() const
uint16_t width() const
const SiStripQuality * siStripQuality_
bool SiStripClusterInfo::IsFiberBad ( ) const

Definition at line 105 of file SiStripClusterInfo.cc.

References detId_, firstStrip(), SiStripQuality::IsFiberBad(), siStripQuality_, and width().

Referenced by IsAnythingBad().

105  {
106  return siStripQuality_->IsFiberBad(detId_, firstStrip() / 256) ||
108 }
bool IsFiberBad(const uint32_t &detid, const short &fiberNb) const
uint16_t firstStrip() const
uint16_t width() const
const SiStripQuality * siStripQuality_
bool SiStripClusterInfo::IsModuleBad ( ) const

Definition at line 110 of file SiStripClusterInfo.cc.

References detId_, SiStripQuality::IsModuleBad(), and siStripQuality_.

Referenced by IsAnythingBad().

110 { return siStripQuality_->IsModuleBad(detId_); }
bool IsModuleBad(const uint32_t &detid) const
const SiStripQuality * siStripQuality_
bool SiStripClusterInfo::IsModuleUsable ( ) const

Definition at line 112 of file SiStripClusterInfo.cc.

References detId_, SiStripQuality::IsModuleUsable(), and siStripQuality_.

Referenced by ApeEstimator::fillHitVariables().

bool IsModuleUsable(const uint32_t &detid) const
const SiStripQuality * siStripQuality_
uint8_t SiStripClusterInfo::maxCharge ( ) const
inline
uint16_t SiStripClusterInfo::maxIndex ( ) const
inline

Definition at line 45 of file SiStripClusterInfo.h.

References SplitLinear::begin, dataset::end, and stripCharges().

Referenced by SiStripMonitorTrack::clusterInfos(), ApeEstimator::fillHitVariables(), maxStrip(), ShallowClustersProducer::NearDigis::NearDigis(), and ShallowClustersProducer::produce().

45  {
46  return std::max_element(stripCharges().begin(), stripCharges().end()) - stripCharges().begin();
47  }
auto stripCharges() const -> decltype(cluster() ->amplitudes())
string end
Definition: dataset.py:937
uint16_t SiStripClusterInfo::maxStrip ( ) const
inline
float SiStripClusterInfo::noise ( ) const
inline

Definition at line 50 of file SiStripClusterInfo.h.

References calculate_noise(), and stripNoises().

Referenced by TrackerDpgAnalysis::analyze().

50 { return calculate_noise(stripNoises()); }
float calculate_noise(const std::vector< float > &) const
std::vector< float > stripNoises() const
float SiStripClusterInfo::noiseRescaledByGain ( ) const
inline

Definition at line 51 of file SiStripClusterInfo.h.

References calculate_noise(), and stripNoisesRescaledByGain().

Referenced by TrackerDpgAnalysis::analyze(), SiStripMonitorTrack::clusterInfos(), ShallowClustersProducer::produce(), and signalOverNoise().

float calculate_noise(const std::vector< float > &) const
std::vector< float > stripNoisesRescaledByGain() const
void SiStripClusterInfo::setCluster ( const SiStripCluster cluster,
int  detId 
)
float SiStripClusterInfo::signalOverNoise ( ) const
inline
const SiStripGain* SiStripClusterInfo::siStripGain ( ) const
inline

Definition at line 61 of file SiStripClusterInfo.h.

References siStripGain_.

Referenced by SiStripMonitorTrack::AllClusters(), and SiStripMonitorTrack::RecHitInfo().

61 { return siStripGain_; }
const SiStripGain * siStripGain_
const SiStripQuality* SiStripClusterInfo::siStripQuality ( ) const
inline

Definition at line 62 of file SiStripClusterInfo.h.

References siStripQuality_.

Referenced by SiStripMonitorTrack::AllClusters(), and SiStripMonitorTrack::RecHitInfo().

62 { return siStripQuality_; }
const SiStripQuality * siStripQuality_
auto SiStripClusterInfo::stripCharges ( ) const -> decltype(cluster()->amplitudes())
inline
std::vector< float > SiStripClusterInfo::stripGains ( ) const

Definition at line 62 of file SiStripClusterInfo.cc.

References detId_, firstStrip(), SiStripGain::getRange(), SiStripGain::getStripGain(), mps_fire::i, siStripGain_, and width().

Referenced by ShallowClustersProducer::produce().

62  {
64 
65  std::vector<float> gains;
66  gains.reserve(width());
67  for (size_t i = 0; i < width(); i++) {
68  gains.push_back(siStripGain_->getStripGain(firstStrip() + i, detGainRange));
69  }
70  return gains;
71 }
uint16_t firstStrip() const
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
Definition: SiStripGain.h:77
uint16_t width() const
std::pair< ContainerIterator, ContainerIterator > Range
const SiStripGain * siStripGain_
const SiStripApvGain::Range getRange(uint32_t detID) const
Definition: SiStripGain.h:75
std::vector< float > SiStripClusterInfo::stripNoises ( ) const

Definition at line 51 of file SiStripClusterInfo.cc.

References detId_, firstStrip(), SiStripNoises::getNoise(), SiStripNoises::getRange(), mps_fire::i, siStripNoises_, and width().

Referenced by noise().

51  {
53 
54  std::vector<float> noises;
55  noises.reserve(width());
56  for (size_t i = 0; i < width(); i++) {
57  noises.push_back(siStripNoises_->getNoise(firstStrip() + i, detNoiseRange));
58  }
59  return noises;
60 }
uint16_t firstStrip() const
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:73
uint16_t width() const
const SiStripNoises * siStripNoises_
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47
std::vector< float > SiStripClusterInfo::stripNoisesRescaledByGain ( ) const

Definition at line 38 of file SiStripClusterInfo.cc.

References detId_, alignCSCRings::e, firstStrip(), SiStripNoises::getNoise(), SiStripNoises::getRange(), SiStripGain::getRange(), SiStripGain::getStripGain(), mps_fire::i, bookConverter::results, siStripGain_, siStripNoises_, and width().

Referenced by noiseRescaledByGain(), and ShallowClustersProducer::produce().

38  {
41 
42  std::vector<float> results;
43  results.reserve(width());
44  for (size_t i = 0, e = width(); i < e; i++) {
45  results.push_back(siStripNoises_->getNoise(firstStrip() + i, detNoiseRange) /
46  siStripGain_->getStripGain(firstStrip() + i, detGainRange));
47  }
48  return results;
49 }
uint16_t firstStrip() const
dictionary results
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:73
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
Definition: SiStripGain.h:77
uint16_t width() const
std::pair< ContainerIterator, ContainerIterator > Range
const SiStripNoises * siStripNoises_
const SiStripGain * siStripGain_
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47
const SiStripApvGain::Range getRange(uint32_t detID) const
Definition: SiStripGain.h:75
std::vector< bool > SiStripClusterInfo::stripQualitiesBad ( ) const

Definition at line 73 of file SiStripClusterInfo.cc.

References detId_, firstStrip(), mps_fire::i, SiStripQuality::IsStripBad(), siStripQuality_, and width().

Referenced by IsAnythingBad().

73  {
74  std::vector<bool> isBad;
75  isBad.reserve(width());
76  for (int i = 0; i < width(); i++) {
77  isBad.push_back(siStripQuality_->IsStripBad(detId_, firstStrip() + i));
78  }
79  return isBad;
80 }
uint16_t firstStrip() const
bool IsStripBad(const uint32_t &detid, const short &strip) const
uint16_t width() const
const SiStripQuality * siStripQuality_
float SiStripClusterInfo::variance ( ) const

Definition at line 27 of file SiStripClusterInfo.cc.

References SplitLinear::begin, dataset::end, mps_fire::i, submitPVResolutionJobs::q, and stripCharges().

Referenced by SiStripPositionCorrectionsTableProducer::fillTable(), and ShallowClustersProducer::produce().

27  {
28  float q(0), x1(0), x2(0);
29  for (auto begin(stripCharges().begin()), end(stripCharges().end()), it(begin); it != end; ++it) {
30  unsigned i = it - begin;
31  q += (*it);
32  x1 += (*it) * (i + 0.5);
33  x2 += (*it) * (i * i + i + 1. / 3);
34  }
35  return (x2 - x1 * x1 / q) / q;
36 }
auto stripCharges() const -> decltype(cluster() ->amplitudes())
string end
Definition: dataset.py:937
uint16_t SiStripClusterInfo::width ( ) const
inline

Member Data Documentation

const SiStripCluster* SiStripClusterInfo::cluster_ptr = nullptr
private

Definition at line 67 of file SiStripClusterInfo.h.

Referenced by cluster(), and setCluster().

uint32_t SiStripClusterInfo::detId_ = 0
private
const SiStripGain* SiStripClusterInfo::siStripGain_ = nullptr
private

Definition at line 74 of file SiStripClusterInfo.h.

Referenced by initEvent(), siStripGain(), stripGains(), and stripNoisesRescaledByGain().

edm::ESGetToken<SiStripGain, SiStripGainRcd> SiStripClusterInfo::siStripGainToken_
private

Definition at line 70 of file SiStripClusterInfo.h.

Referenced by initEvent(), and SiStripClusterInfo().

const SiStripNoises* SiStripClusterInfo::siStripNoises_ = nullptr
private

Definition at line 73 of file SiStripClusterInfo.h.

Referenced by initEvent(), stripNoises(), and stripNoisesRescaledByGain().

edm::ESGetToken<SiStripNoises, SiStripNoisesRcd> SiStripClusterInfo::siStripNoisesToken_
private

Definition at line 69 of file SiStripClusterInfo.h.

Referenced by initEvent().

const SiStripQuality* SiStripClusterInfo::siStripQuality_ = nullptr
private
edm::ESGetToken<SiStripQuality, SiStripQualityRcd> SiStripClusterInfo::siStripQualityToken_
private

Definition at line 71 of file SiStripClusterInfo.h.

Referenced by initEvent(), and SiStripClusterInfo().