CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Attributes | Static Private Attributes | Friends
StMeasurementConditionSet Class Reference

#include <TkMeasurementDetSet.h>

Classes

struct  BadStripBlock
 
struct  BadStripCuts
 

Public Types

enum  QualityFlags {
  BadModules = 1, BadAPVFibers = 2, BadStrips = 4, MaskBad128StripBlocks = 8,
  BadROCs = 2
}
 

Public Member Functions

bool bad128Strip (int index, int strip) const
 
bool bad128Strip (int offset) const
 note: index is 6*detector index + offset! More...
 
std::vector< BadStripBlock > const & badStripBlocks (int i) const
 
const BadStripCutsbadStripCuts (int i) const
 
int find (unsigned int jd, int i=0) const
 
std::vector< BadStripBlock > & getBadStripBlocks (int i)
 
bool hasAny128StripBad (int i) const
 
unsigned int id (int i) const
 
void init (int size)
 
bool isActiveThisPeriod (int i) const
 
bool isMasked (int i, const SiStripCluster &cluster) const
 
bool maskBad128StripBlocks () const
 
const SiStripRecHitMatchermatcher () const
 
int nDet () const
 
void set128StripStatus (int i, bool good, int idx=-1)
 
void setActive (int i, bool active)
 Turn on/off the module for reconstruction, for the full run or lumi (using info from DB, usually) More...
 
void setMaskBad128StripBlocks (bool maskThem)
 
 StMeasurementConditionSet (const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe)
 
const StripClusterParameterEstimatorstripCPE () const
 
unsigned char subId (int i) const
 
int totalStrips (int i) const
 

Private Attributes

std::vector< bool > activeThisPeriod_
 
std::vector< bool > bad128Strip_
 
std::vector< std::vector< BadStripBlock > > badStripBlocks_
 
BadStripCuts badStripCuts_ [4]
 
std::vector< bool > hasAny128StripBad_
 
std::vector< unsigned int > id_
 
bool maskBad128StripBlocks_
 
std::vector< unsigned char > subId_
 
const StripClusterParameterEstimatortheCPE
 
const SiStripRecHitMatchertheMatcher
 
std::vector< int > totalStrips_
 

Static Private Attributes

static const int nbad128 = 6
 

Friends

class MeasurementTrackerImpl
 

Detailed Description

Definition at line 38 of file TkMeasurementDetSet.h.

Member Enumeration Documentation

◆ QualityFlags

Enumerator
BadModules 
BadAPVFibers 
BadStrips 
MaskBad128StripBlocks 
BadROCs 

Definition at line 40 of file TkMeasurementDetSet.h.

40  {
41  BadModules = 1, // for everybody
42  /* Strips: */ BadAPVFibers = 2,
43  BadStrips = 4,
45  /* Pixels: */ BadROCs = 2
46  };

Constructor & Destructor Documentation

◆ StMeasurementConditionSet()

StMeasurementConditionSet::StMeasurementConditionSet ( const SiStripRecHitMatcher matcher,
const StripClusterParameterEstimator cpe 
)
inline

Definition at line 61 of file TkMeasurementDetSet.h.

62  : theMatcher(matcher), theCPE(cpe) {}

Member Function Documentation

◆ bad128Strip() [1/2]

bool StMeasurementConditionSet::bad128Strip ( int  index,
int  strip 
) const
inline

Definition at line 90 of file TkMeasurementDetSet.h.

90 { return bad128Strip_[nbad128 * index + (strip >> 7)]; }

References bad128Strip_, nbad128, and digitizers_cfi::strip.

◆ bad128Strip() [2/2]

bool StMeasurementConditionSet::bad128Strip ( int  offset) const
inline

note: index is 6*detector index + offset!

Definition at line 89 of file TkMeasurementDetSet.h.

89 { return bad128Strip_[offset]; }

References bad128Strip_, and hltrates_dqm_sourceclient-live_cfg::offset.

◆ badStripBlocks()

std::vector<BadStripBlock> const& StMeasurementConditionSet::badStripBlocks ( int  i) const
inline

Definition at line 93 of file TkMeasurementDetSet.h.

93 { return badStripBlocks_[i]; }

References badStripBlocks_, and mps_fire::i.

◆ badStripCuts()

const BadStripCuts& StMeasurementConditionSet::badStripCuts ( int  i) const
inline

Definition at line 83 of file TkMeasurementDetSet.h.

83 { return badStripCuts_[subId_[i]]; }

References badStripCuts_, mps_fire::i, and subId_.

◆ find()

int StMeasurementConditionSet::find ( unsigned int  jd,
int  i = 0 
) const
inline

Definition at line 73 of file TkMeasurementDetSet.h.

73 { return std::lower_bound(id_.begin() + i, id_.end(), jd) - id_.begin(); }

References mps_fire::i, id_, and pfDeepBoostedJetPreprocessParams_cfi::lower_bound.

Referenced by StMeasurementDetSet::find().

◆ getBadStripBlocks()

std::vector<BadStripBlock>& StMeasurementConditionSet::getBadStripBlocks ( int  i)
inline

Definition at line 92 of file TkMeasurementDetSet.h.

92 { return badStripBlocks_[i]; }

References badStripBlocks_, and mps_fire::i.

Referenced by MeasurementTrackerImpl::initializeStripStatus().

◆ hasAny128StripBad()

bool StMeasurementConditionSet::hasAny128StripBad ( int  i) const
inline

Definition at line 86 of file TkMeasurementDetSet.h.

86 { return hasAny128StripBad_[i]; }

References hasAny128StripBad_, and mps_fire::i.

◆ id()

unsigned int StMeasurementConditionSet::id ( int  i) const
inline

◆ init()

void StMeasurementConditionSet::init ( int  size)

Definition at line 3 of file TkMeasurementDetSet.cc.

3  {
4  activeThisPeriod_.resize(size, true);
5  id_.resize(size);
6  subId_.resize(size);
7  totalStrips_.resize(size);
8 
9  bad128Strip_.resize(size * 6);
10  hasAny128StripBad_.resize(size);
11  badStripBlocks_.resize(size);
12 }

References activeThisPeriod_, bad128Strip_, badStripBlocks_, hasAny128StripBad_, id_, findQualityFiles::size, subId_, and totalStrips_.

Referenced by MeasurementTrackerImpl::initStMeasurementConditionSet().

◆ isActiveThisPeriod()

bool StMeasurementConditionSet::isActiveThisPeriod ( int  i) const
inline

Definition at line 75 of file TkMeasurementDetSet.h.

75 { return activeThisPeriod_[i]; }

References activeThisPeriod_, and mps_fire::i.

Referenced by StMeasurementDetSet::isActive().

◆ isMasked()

bool StMeasurementConditionSet::isMasked ( int  i,
const SiStripCluster cluster 
) const
inline

Definition at line 95 of file TkMeasurementDetSet.h.

95  {
96  int offset = nbad128 * i;
97  if (bad128Strip_[offset + (cluster.firstStrip() >> 7)]) {
98  if (bad128Strip_[offset + ((cluster.firstStrip() + cluster.amplitudes().size()) >> 7)] ||
99  bad128Strip_[offset + (static_cast<int32_t>(cluster.barycenter() - 0.499999) >> 7)]) {
100  return true;
101  }
102  } else {
103  if (bad128Strip_[offset + ((cluster.firstStrip() + cluster.amplitudes().size()) >> 7)] &&
104  bad128Strip_[offset + (static_cast<int32_t>(cluster.barycenter() - 0.499999) >> 7)]) {
105  return true;
106  }
107  }
108  return false;
109  }

References SiStripCluster::amplitudes(), bad128Strip_, SiStripCluster::barycenter(), SiStripCluster::firstStrip(), mps_fire::i, nbad128, hltrates_dqm_sourceclient-live_cfg::offset, and SiStripCluster::size().

◆ maskBad128StripBlocks()

bool StMeasurementConditionSet::maskBad128StripBlocks ( ) const
inline

Definition at line 85 of file TkMeasurementDetSet.h.

85 { return maskBad128StripBlocks_; }

References maskBad128StripBlocks_.

◆ matcher()

const SiStripRecHitMatcher* StMeasurementConditionSet::matcher ( ) const
inline

Definition at line 66 of file TkMeasurementDetSet.h.

66 { return theMatcher; }

References theMatcher.

Referenced by MeasurementTrackerImpl::addGluedDet().

◆ nDet()

int StMeasurementConditionSet::nDet ( ) const
inline

Definition at line 69 of file TkMeasurementDetSet.h.

69 { return id_.size(); }

References id_.

Referenced by MeasurementTrackerImpl::initializeStripStatus(), and StMeasurementDetSet::size().

◆ set128StripStatus()

void StMeasurementConditionSet::set128StripStatus ( int  i,
bool  good,
int  idx = -1 
)

Definition at line 14 of file TkMeasurementDetSet.cc.

14  {
15  int offset = nbad128 * i;
16  if (idx == -1) {
17  std::fill(bad128Strip_.begin() + offset, bad128Strip_.begin() + offset + 6, !good);
18  hasAny128StripBad_[i] = !good;
19  } else {
20  bad128Strip_[offset + idx] = !good;
21  if (good == false) {
22  hasAny128StripBad_[i] = false;
23  } else { // this should not happen, as usually you turn on all fibers
24  // and then turn off the bad ones, and not vice-versa,
25  // so I don't care if it's not optimized
26  hasAny128StripBad_[i] = true;
27  for (int j = 0; i < (totalStrips_[j] >> 7); j++) {
28  if (bad128Strip_[j + offset] == false) {
29  hasAny128StripBad_[i] = false;
30  break;
31  }
32  }
33  }
34  }
35 }

References bad128Strip_, ntuplemaker::fill, hasAny128StripBad_, mps_fire::i, heavyIonCSV_trainingSettings::idx, dqmiolumiharvest::j, nbad128, hltrates_dqm_sourceclient-live_cfg::offset, and totalStrips_.

Referenced by MeasurementTrackerImpl::initializeStripStatus().

◆ setActive()

void StMeasurementConditionSet::setActive ( int  i,
bool  active 
)
inline

Turn on/off the module for reconstruction, for the full run or lumi (using info from DB, usually)

Definition at line 78 of file TkMeasurementDetSet.h.

78 { activeThisPeriod_[i] = active; }

References activeThisPeriod_, and mps_fire::i.

Referenced by MeasurementTrackerImpl::initializeStripStatus().

◆ setMaskBad128StripBlocks()

void StMeasurementConditionSet::setMaskBad128StripBlocks ( bool  maskThem)
inline

Definition at line 82 of file TkMeasurementDetSet.h.

82 { maskBad128StripBlocks_ = maskThem; }

References maskBad128StripBlocks_.

Referenced by MeasurementTrackerImpl::initializeStripStatus().

◆ stripCPE()

const StripClusterParameterEstimator* StMeasurementConditionSet::stripCPE ( ) const
inline

Definition at line 67 of file TkMeasurementDetSet.h.

67 { return theCPE; }

References theCPE.

Referenced by MeasurementTrackerImpl::addGluedDet().

◆ subId()

unsigned char StMeasurementConditionSet::subId ( int  i) const
inline

Definition at line 71 of file TkMeasurementDetSet.h.

71 { return subId_[i]; }

References mps_fire::i, and subId_.

◆ totalStrips()

int StMeasurementConditionSet::totalStrips ( int  i) const
inline

Definition at line 80 of file TkMeasurementDetSet.h.

80 { return totalStrips_[i]; }

References mps_fire::i, and totalStrips_.

Friends And Related Function Documentation

◆ MeasurementTrackerImpl

friend class MeasurementTrackerImpl
friend

Definition at line 114 of file TkMeasurementDetSet.h.

Member Data Documentation

◆ activeThisPeriod_

std::vector<bool> StMeasurementConditionSet::activeThisPeriod_
private

Definition at line 135 of file TkMeasurementDetSet.h.

Referenced by init(), isActiveThisPeriod(), and setActive().

◆ bad128Strip_

std::vector<bool> StMeasurementConditionSet::bad128Strip_
private

Definition at line 130 of file TkMeasurementDetSet.h.

Referenced by bad128Strip(), init(), isMasked(), and set128StripStatus().

◆ badStripBlocks_

std::vector<std::vector<BadStripBlock> > StMeasurementConditionSet::badStripBlocks_
private

Definition at line 133 of file TkMeasurementDetSet.h.

Referenced by badStripBlocks(), getBadStripBlocks(), and init().

◆ badStripCuts_

BadStripCuts StMeasurementConditionSet::badStripCuts_[4]
private

◆ hasAny128StripBad_

std::vector<bool> StMeasurementConditionSet::hasAny128StripBad_
private

Definition at line 131 of file TkMeasurementDetSet.h.

Referenced by hasAny128StripBad(), init(), and set128StripStatus().

◆ id_

std::vector<unsigned int> StMeasurementConditionSet::id_
private

◆ maskBad128StripBlocks_

bool StMeasurementConditionSet::maskBad128StripBlocks_
private

Definition at line 120 of file TkMeasurementDetSet.h.

Referenced by maskBad128StripBlocks(), and setMaskBad128StripBlocks().

◆ nbad128

const int StMeasurementConditionSet::nbad128 = 6
staticprivate

Definition at line 129 of file TkMeasurementDetSet.h.

Referenced by bad128Strip(), isMasked(), and set128StripStatus().

◆ subId_

std::vector<unsigned char> StMeasurementConditionSet::subId_
private

◆ theCPE

const StripClusterParameterEstimator* StMeasurementConditionSet::theCPE
private

Definition at line 118 of file TkMeasurementDetSet.h.

Referenced by stripCPE().

◆ theMatcher

const SiStripRecHitMatcher* StMeasurementConditionSet::theMatcher
private

Definition at line 117 of file TkMeasurementDetSet.h.

Referenced by matcher().

◆ totalStrips_

std::vector<int> StMeasurementConditionSet::totalStrips_
private
mps_fire.i
i
Definition: mps_fire.py:428
SiStripCluster::barycenter
float barycenter() const
Definition: SiStripCluster.cc:25
StMeasurementConditionSet::MaskBad128StripBlocks
Definition: TkMeasurementDetSet.h:44
StMeasurementConditionSet::BadModules
Definition: TkMeasurementDetSet.h:41
StMeasurementConditionSet::hasAny128StripBad_
std::vector< bool > hasAny128StripBad_
Definition: TkMeasurementDetSet.h:131
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
StMeasurementConditionSet::badStripBlocks_
std::vector< std::vector< BadStripBlock > > badStripBlocks_
Definition: TkMeasurementDetSet.h:133
StMeasurementConditionSet::totalStrips_
std::vector< int > totalStrips_
Definition: TkMeasurementDetSet.h:127
StMeasurementConditionSet::theMatcher
const SiStripRecHitMatcher * theMatcher
Definition: TkMeasurementDetSet.h:117
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
SiStripCluster::firstStrip
uint16_t firstStrip() const
Definition: SiStripCluster.h:47
StMeasurementConditionSet::badStripCuts_
BadStripCuts badStripCuts_[4]
Definition: TkMeasurementDetSet.h:121
StMeasurementConditionSet::matcher
const SiStripRecHitMatcher * matcher() const
Definition: TkMeasurementDetSet.h:66
StMeasurementConditionSet::bad128Strip_
std::vector< bool > bad128Strip_
Definition: TkMeasurementDetSet.h:130
StMeasurementConditionSet::theCPE
const StripClusterParameterEstimator * theCPE
Definition: TkMeasurementDetSet.h:118
StMeasurementConditionSet::BadAPVFibers
Definition: TkMeasurementDetSet.h:42
StMeasurementConditionSet::BadStrips
Definition: TkMeasurementDetSet.h:43
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
StMeasurementConditionSet::subId_
std::vector< unsigned char > subId_
Definition: TkMeasurementDetSet.h:125
StMeasurementConditionSet::activeThisPeriod_
std::vector< bool > activeThisPeriod_
Definition: TkMeasurementDetSet.h:135
SiStripCluster::size
uint8_t size() const
Definition: SiStripCluster.h:64
StMeasurementConditionSet::BadROCs
Definition: TkMeasurementDetSet.h:45
SiStripCluster::amplitudes
SiStripCluster const & amplitudes() const
Definition: SiStripCluster.h:69
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
StMeasurementConditionSet::id_
std::vector< unsigned int > id_
Definition: TkMeasurementDetSet.h:124
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
StMeasurementConditionSet::nbad128
static const int nbad128
Definition: TkMeasurementDetSet.h:129
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
StMeasurementConditionSet::maskBad128StripBlocks_
bool maskBad128StripBlocks_
Definition: TkMeasurementDetSet.h:120