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 offset) const
 note: index is 6*detector index + offset! More...
 
bool bad128Strip (int index, int strip) const
 
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

Enumerator
BadModules 
BadAPVFibers 
BadStrips 
MaskBad128StripBlocks 
BadROCs 

Definition at line 40 of file TkMeasurementDetSet.h.

Constructor & Destructor Documentation

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

Definition at line 59 of file TkMeasurementDetSet.h.

References init(), and findQualityFiles::size.

60  :
61  theMatcher(matcher), theCPE(cpe){}
const StripClusterParameterEstimator * theCPE
const SiStripRecHitMatcher * theMatcher

Member Function Documentation

bool StMeasurementConditionSet::bad128Strip ( int  offset) const
inline

note: index is 6*detector index + offset!

Definition at line 93 of file TkMeasurementDetSet.h.

References bad128Strip_, and PFRecoTauDiscriminationByIsolation_cfi::offset.

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

Definition at line 94 of file TkMeasurementDetSet.h.

References bad128Strip_, and nbad128.

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

Definition at line 97 of file TkMeasurementDetSet.h.

References badStripBlocks_, and mps_fire::i.

Referenced by TkStripMeasurementDet::badStripBlocks().

97 {return badStripBlocks_[i]; }
std::vector< std::vector< BadStripBlock > > badStripBlocks_
const BadStripCuts& StMeasurementConditionSet::badStripCuts ( int  i) const
inline

Definition at line 87 of file TkMeasurementDetSet.h.

References badStripCuts_, mps_fire::i, and subId_.

Referenced by TkStripMeasurementDet::badStripCuts().

87 { return badStripCuts_[subId_[i]];}
std::vector< unsigned char > subId_
int StMeasurementConditionSet::find ( unsigned int  jd,
int  i = 0 
) const
inline

Definition at line 74 of file TkMeasurementDetSet.h.

References mps_fire::i, and id_.

74  {
75  return std::lower_bound(id_.begin()+i,id_.end(),jd)-id_.begin();
76  }
std::vector< unsigned int > id_
std::vector<BadStripBlock>& StMeasurementConditionSet::getBadStripBlocks ( int  i)
inline

Definition at line 96 of file TkMeasurementDetSet.h.

References badStripBlocks_, and mps_fire::i.

Referenced by TkStripMeasurementDet::getBadStripBlocks(), and MeasurementTrackerImpl::initializeStripStatus().

96 { return badStripBlocks_[i]; }
std::vector< std::vector< BadStripBlock > > badStripBlocks_
bool StMeasurementConditionSet::hasAny128StripBad ( int  i) const
inline

Definition at line 90 of file TkMeasurementDetSet.h.

References hasAny128StripBad_, and mps_fire::i.

Referenced by TkStripMeasurementDet::hasAny128StripBad().

90 { return hasAny128StripBad_[i];}
std::vector< bool > hasAny128StripBad_
unsigned int StMeasurementConditionSet::id ( int  i) const
inline
void StMeasurementConditionSet::init ( int  size)

Definition at line 3 of file TkMeasurementDetSet.cc.

References activeThisPeriod_, bad128Strip_, badStripBlocks_, hasAny128StripBad_, id_, subId_, and totalStrips_.

Referenced by MeasurementTrackerImpl::initStMeasurementConditionSet(), Phase2OTMeasurementConditionSet::Phase2OTMeasurementConditionSet(), PxMeasurementConditionSet::PxMeasurementConditionSet(), and StMeasurementConditionSet().

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 }
size
Write out results.
std::vector< std::vector< BadStripBlock > > badStripBlocks_
std::vector< unsigned char > subId_
std::vector< int > totalStrips_
std::vector< bool > hasAny128StripBad_
std::vector< bool > activeThisPeriod_
std::vector< unsigned int > id_
std::vector< bool > bad128Strip_
bool StMeasurementConditionSet::isActiveThisPeriod ( int  i) const
inline

Definition at line 78 of file TkMeasurementDetSet.h.

References activeThisPeriod_, and mps_fire::i.

78 { return activeThisPeriod_[i]; }
std::vector< bool > activeThisPeriod_
bool StMeasurementConditionSet::isMasked ( int  i,
const SiStripCluster cluster 
) const
inline

Definition at line 99 of file TkMeasurementDetSet.h.

References SiStripCluster::amplitudes(), bad128Strip_, SiStripCluster::barycenter(), SiStripCluster::firstStrip(), mps_fire::i, training_settings::idx, nbad128, PFRecoTauDiscriminationByIsolation_cfi::offset, and set128StripStatus().

Referenced by TkStripMeasurementDet::isMasked().

99  {
100  int offset = nbad128*i;
101  if ( bad128Strip_[offset+( cluster.firstStrip() >> 7)] ) {
102  if ( bad128Strip_[offset+( (cluster.firstStrip()+cluster.amplitudes().size()) >> 7)] ||
103  bad128Strip_[offset+( static_cast<int32_t>(cluster.barycenter()-0.499999) >> 7)] ) {
104  return true;
105  }
106  } else {
107  if ( bad128Strip_[offset+( (cluster.firstStrip()+cluster.amplitudes().size()) >> 7)] &&
108  bad128Strip_[offset+( static_cast<int32_t>(cluster.barycenter()-0.499999) >> 7)] ) {
109  return true;
110  }
111  }
112  return false;
113  }
uint16_t firstStrip() const
float barycenter() const
std::vector< bool > bad128Strip_
const std::vector< uint8_t > & amplitudes() const
bool StMeasurementConditionSet::maskBad128StripBlocks ( ) const
inline
const SiStripRecHitMatcher* StMeasurementConditionSet::matcher ( ) const
inline

Definition at line 66 of file TkMeasurementDetSet.h.

References theMatcher.

Referenced by MeasurementTrackerImpl::addGluedDet().

66 { return theMatcher;}
const SiStripRecHitMatcher * theMatcher
int StMeasurementConditionSet::nDet ( ) const
inline

Definition at line 70 of file TkMeasurementDetSet.h.

References id_.

Referenced by MeasurementTrackerImpl::initializeStripStatus().

70 { return id_.size();}
std::vector< unsigned int > id_
void StMeasurementConditionSet::set128StripStatus ( int  i,
bool  good,
int  idx = -1 
)

Definition at line 15 of file TkMeasurementDetSet.cc.

References bad128Strip_, lumiContext::fill, hasAny128StripBad_, mps_fire::i, training_settings::idx, nbad128, and PFRecoTauDiscriminationByIsolation_cfi::offset.

Referenced by MeasurementTrackerImpl::initializeStripStatus(), isMasked(), and TkStripMeasurementDet::set128StripStatus().

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

References activeThisPeriod_, and mps_fire::i.

Referenced by MeasurementTrackerImpl::initializeStripStatus(), and TkStripMeasurementDet::setActiveThisPeriod().

82 { activeThisPeriod_[i] = active; }
std::vector< bool > activeThisPeriod_
void StMeasurementConditionSet::setMaskBad128StripBlocks ( bool  maskThem)
inline
const StripClusterParameterEstimator* StMeasurementConditionSet::stripCPE ( ) const
inline

Definition at line 67 of file TkMeasurementDetSet.h.

References theCPE.

Referenced by MeasurementTrackerImpl::addGluedDet(), and TkStripMeasurementDet::cpe().

67 { return theCPE;}
const StripClusterParameterEstimator * theCPE
unsigned char StMeasurementConditionSet::subId ( int  i) const
inline

Definition at line 72 of file TkMeasurementDetSet.h.

References mps_fire::i, and subId_.

Referenced by TkStripMeasurementDet::subId().

72 { return subId_[i];}
std::vector< unsigned char > subId_
int StMeasurementConditionSet::totalStrips ( int  i) const
inline

Definition at line 84 of file TkMeasurementDetSet.h.

References mps_fire::i, and totalStrips_.

Referenced by TkStripMeasurementDet::totalStrips().

84 { return totalStrips_[i];}
std::vector< int > totalStrips_

Friends And Related Function Documentation

friend class MeasurementTrackerImpl
friend

Definition at line 120 of file TkMeasurementDetSet.h.

Member Data Documentation

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

Definition at line 136 of file TkMeasurementDetSet.h.

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

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

Definition at line 139 of file TkMeasurementDetSet.h.

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

BadStripCuts StMeasurementConditionSet::badStripCuts_[4]
private
std::vector<bool> StMeasurementConditionSet::hasAny128StripBad_
private

Definition at line 137 of file TkMeasurementDetSet.h.

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

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

Definition at line 126 of file TkMeasurementDetSet.h.

Referenced by maskBad128StripBlocks(), and setMaskBad128StripBlocks().

const int StMeasurementConditionSet::nbad128 = 6
staticprivate

Definition at line 135 of file TkMeasurementDetSet.h.

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

std::vector<unsigned char> StMeasurementConditionSet::subId_
private
const StripClusterParameterEstimator* StMeasurementConditionSet::theCPE
private
const SiStripRecHitMatcher* StMeasurementConditionSet::theMatcher
private

Definition at line 123 of file TkMeasurementDetSet.h.

Referenced by matcher().

std::vector<int> StMeasurementConditionSet::totalStrips_
private