CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

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
StripClusterParameterEstimator
stripCPE () 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
StripClusterParameterEstimator
theCPE
 
const SiStripRecHitMatchertheMatcher
 
std::vector< int > totalStrips_
 

Static Private Attributes

static const int nbad128 = 6
 

Friends

class MeasurementTrackerImpl
 

Detailed Description

Definition at line 35 of file TkMeasurementDetSet.h.

Member Enumeration Documentation

Enumerator
BadModules 
BadAPVFibers 
BadStrips 
MaskBad128StripBlocks 
BadROCs 

Definition at line 37 of file TkMeasurementDetSet.h.

Constructor & Destructor Documentation

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

Definition at line 56 of file TkMeasurementDetSet.h.

57  :
58  theMatcher(matcher), theCPE(cpe){}
const StripClusterParameterEstimator * theCPE
const SiStripRecHitMatcher * theMatcher

Member Function Documentation

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

Definition at line 90 of file TkMeasurementDetSet.h.

References badStripBlocks_, and i.

Referenced by TkStripMeasurementDet::badStripBlocks().

90 {return badStripBlocks_[i]; }
int i
Definition: DBlmapReader.cc:9
std::vector< std::vector< BadStripBlock > > badStripBlocks_
const BadStripCuts& StMeasurementConditionSet::badStripCuts ( int  i) const
inline

Definition at line 84 of file TkMeasurementDetSet.h.

References badStripCuts_, i, and subId_.

Referenced by TkStripMeasurementDet::badStripCuts().

84 { return badStripCuts_[subId_[i]];}
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned char > subId_
int StMeasurementConditionSet::find ( unsigned int  jd,
int  i = 0 
) const
inline

Definition at line 71 of file TkMeasurementDetSet.h.

References i, and id_.

Referenced by StMeasurementDetSet::find().

71  {
72  return std::lower_bound(id_.begin()+i,id_.end(),jd)-id_.begin();
73  }
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned int > id_
std::vector<BadStripBlock>& StMeasurementConditionSet::getBadStripBlocks ( int  i)
inline

Definition at line 89 of file TkMeasurementDetSet.h.

References badStripBlocks_, and i.

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

89 { return badStripBlocks_[i]; }
int i
Definition: DBlmapReader.cc:9
std::vector< std::vector< BadStripBlock > > badStripBlocks_
bool StMeasurementConditionSet::hasAny128StripBad ( int  i) const
inline

Definition at line 87 of file TkMeasurementDetSet.h.

References hasAny128StripBad_, and i.

Referenced by TkStripMeasurementDet::hasAny128StripBad().

87 { return hasAny128StripBad_[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< bool > hasAny128StripBad_
unsigned int StMeasurementConditionSet::id ( int  i) const
inline
void StMeasurementConditionSet::init ( int  size)

Definition at line 7 of file TkMeasurementDetSet.cc.

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

Referenced by MeasurementTrackerImpl::initStMeasurementConditionSet().

7  {
8  activeThisPeriod_.resize(size,true);
9  id_.resize(size);
10  subId_.resize(size);
11  totalStrips_.resize(size);
12 
13  bad128Strip_.resize(size*6);
14  hasAny128StripBad_.resize(size);
15  badStripBlocks_.resize(size);
16 }
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_
tuple size
Write out results.
bool StMeasurementConditionSet::isActiveThisPeriod ( int  i) const
inline

Definition at line 75 of file TkMeasurementDetSet.h.

References activeThisPeriod_, and i.

Referenced by StMeasurementDetSet::isActive().

75 { return activeThisPeriod_[i]; }
int i
Definition: DBlmapReader.cc:9
std::vector< bool > activeThisPeriod_
bool StMeasurementConditionSet::isMasked ( int  i,
const SiStripCluster cluster 
) const
inline

Definition at line 92 of file TkMeasurementDetSet.h.

References SiStripCluster::amplitudes(), bad128Strip_, SiStripCluster::barycenter(), SiStripCluster::firstStrip(), i, nbad128, and evf::evtn::offset().

Referenced by TkStripMeasurementDet::isMasked().

92  {
93  int offset = nbad128*i;
94  if ( bad128Strip_[offset+( cluster.firstStrip() >> 7)] ) {
95  if ( bad128Strip_[offset+( (cluster.firstStrip()+cluster.amplitudes().size()) >> 7)] ||
96  bad128Strip_[offset+( static_cast<int32_t>(cluster.barycenter()-0.499999) >> 7)] ) {
97  return true;
98  }
99  } else {
100  if ( bad128Strip_[offset+( (cluster.firstStrip()+cluster.amplitudes().size()) >> 7)] &&
101  bad128Strip_[offset+( static_cast<int32_t>(cluster.barycenter()-0.499999) >> 7)] ) {
102  return true;
103  }
104  }
105  return false;
106  }
int i
Definition: DBlmapReader.cc:9
uint16_t firstStrip() const
float barycenter() const
unsigned int offset(bool)
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 63 of file TkMeasurementDetSet.h.

References theMatcher.

Referenced by MeasurementTrackerImpl::addGluedDet().

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

Definition at line 67 of file TkMeasurementDetSet.h.

References id_.

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

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

Definition at line 19 of file TkMeasurementDetSet.cc.

References bad128Strip_, lumiContext::fill, hasAny128StripBad_, i, customizeTrackingMonitorSeedNumber::idx, j, nbad128, and evf::evtn::offset().

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

19  {
20  int offset = nbad128*i;
21  if (idx == -1) {
22  std::fill(bad128Strip_.begin()+offset, bad128Strip_.begin()+offset+6, !good);
23  hasAny128StripBad_[i] = !good;
24  } else {
25  bad128Strip_[offset+idx] = !good;
26  if (good == false) {
27  hasAny128StripBad_[i] = false;
28  } else { // this should not happen, as usually you turn on all fibers
29  // and then turn off the bad ones, and not vice-versa,
30  // so I don't care if it's not optimized
31  hasAny128StripBad_[i] = true;
32  for (int j = 0; i < (totalStrips_[j] >> 7); j++) {
33  if (bad128Strip_[j+offset] == false) hasAny128StripBad_[i] = false; break;
34  }
35  }
36  }
37  }
int i
Definition: DBlmapReader.cc:9
string fill
Definition: lumiContext.py:319
int j
Definition: DBlmapReader.cc:9
unsigned int offset(bool)
std::vector< bool > hasAny128StripBad_
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 79 of file TkMeasurementDetSet.h.

References activeThisPeriod_, and i.

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

79 { activeThisPeriod_[i] = active; }
int i
Definition: DBlmapReader.cc:9
std::vector< bool > activeThisPeriod_
void StMeasurementConditionSet::setMaskBad128StripBlocks ( bool  maskThem)
inline
const StripClusterParameterEstimator* StMeasurementConditionSet::stripCPE ( ) const
inline

Definition at line 64 of file TkMeasurementDetSet.h.

References theCPE.

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

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

Definition at line 69 of file TkMeasurementDetSet.h.

References i, and subId_.

Referenced by TkStripMeasurementDet::subId().

69 { return subId_[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned char > subId_
int StMeasurementConditionSet::totalStrips ( int  i) const
inline

Definition at line 81 of file TkMeasurementDetSet.h.

References i, and totalStrips_.

Referenced by TkStripMeasurementDet::totalStrips().

81 { return totalStrips_[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< int > totalStrips_

Friends And Related Function Documentation

friend class MeasurementTrackerImpl
friend

Definition at line 113 of file TkMeasurementDetSet.h.

Member Data Documentation

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

Definition at line 134 of file TkMeasurementDetSet.h.

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

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

Definition at line 129 of file TkMeasurementDetSet.h.

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

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

Definition at line 132 of file TkMeasurementDetSet.h.

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

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

Definition at line 130 of file TkMeasurementDetSet.h.

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

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

Definition at line 119 of file TkMeasurementDetSet.h.

Referenced by maskBad128StripBlocks(), and setMaskBad128StripBlocks().

const int StMeasurementConditionSet::nbad128 = 6
staticprivate

Definition at line 128 of file TkMeasurementDetSet.h.

Referenced by isMasked(), and set128StripStatus().

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

Definition at line 117 of file TkMeasurementDetSet.h.

Referenced by stripCPE().

const SiStripRecHitMatcher* StMeasurementConditionSet::theMatcher
private

Definition at line 116 of file TkMeasurementDetSet.h.

Referenced by matcher().

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