CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Friends
SiStripBadStrip Class Reference

#include <SiStripBadStrip.h>

Inheritance diagram for SiStripBadStrip:
SiStripQuality

Classes

struct  data
 
struct  DetRegistry
 
class  StrictWeakOrdering
 

Public Types

typedef std::vector< unsigned int > Container
 
typedef std::vector< unsigned int >::const_iterator ContainerIterator
 
typedef Container InputVector
 
typedef std::pair< ContainerIterator, ContainerIteratorRange
 
typedef std::vector< DetRegistryRegistry
 
typedef Registry::const_iterator RegistryIterator
 

Public Member Functions

data decode (const unsigned int &value) const
 
data decodePhase2 (const unsigned int &value) const
 
unsigned int encode (const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
 
unsigned int encodePhase2 (const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
 
ContainerIterator getDataVectorBegin () const
 
ContainerIterator getDataVectorEnd () const
 
void getDetIds (std::vector< uint32_t > &DetIds_) const
 
const Range getRange (const uint32_t detID) const
 
Range getRangeByPos (unsigned short pos) const
 
RegistryIterator getRegistryVectorBegin () const
 
RegistryIterator getRegistryVectorEnd () const
 
void printDebug (std::stringstream &ss, const TrackerTopology *trackerTopo) const
 
void printSummary (std::stringstream &ss, const TrackerTopology *trackerTopo) const
 
bool put (const uint32_t &detID, const InputVector &vect)
 
bool put (const uint32_t &detID, Range input)
 
 SiStripBadStrip ()
 
virtual ~SiStripBadStrip ()
 

Protected Attributes

Registry indexes
 
Container v_badstrips
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Holds the list of bad components.
The bad components can be filled with two put methods, that receive a DetId and either a range of bad strips or a vector of bad strips.
The information is stored in two vectors:

Definition at line 30 of file SiStripBadStrip.h.

Member Typedef Documentation

◆ Container

typedef std::vector<unsigned int> SiStripBadStrip::Container

Definition at line 51 of file SiStripBadStrip.h.

◆ ContainerIterator

typedef std::vector<unsigned int>::const_iterator SiStripBadStrip::ContainerIterator

Definition at line 52 of file SiStripBadStrip.h.

◆ InputVector

Definition at line 56 of file SiStripBadStrip.h.

◆ Range

Definition at line 53 of file SiStripBadStrip.h.

◆ Registry

typedef std::vector<DetRegistry> SiStripBadStrip::Registry

Definition at line 54 of file SiStripBadStrip.h.

◆ RegistryIterator

typedef Registry::const_iterator SiStripBadStrip::RegistryIterator

Definition at line 55 of file SiStripBadStrip.h.

Constructor & Destructor Documentation

◆ SiStripBadStrip()

SiStripBadStrip::SiStripBadStrip ( )
inline

Definition at line 58 of file SiStripBadStrip.h.

58 {}

◆ ~SiStripBadStrip()

virtual SiStripBadStrip::~SiStripBadStrip ( )
inlinevirtual

Definition at line 59 of file SiStripBadStrip.h.

59 {}

Member Function Documentation

◆ decode()

data SiStripBadStrip::decode ( const unsigned int &  value) const
inline

Definition at line 74 of file SiStripBadStrip.h.

References a, sistrip::FirstBadStripMask_, sistrip::FirstBadStripShift_, sistrip::FlagBadStripMask_, sistrip::FlagBadStripShift_, sistrip::RangeBadStripMask_, and sistrip::RangeBadStripShift_.

Referenced by SiStripQuality::add(), SiStripPopConFEDErrorsHandlerFromDQM::addErrors(), SiStripHitResolFromCalibTree::algoAnalyze(), SiStripHitEffFromCalibTree::algoAnalyze(), SiStripMonitorQuality::analyze(), SiStripQuality::compact(), SiStripQuality::difference(), PreMixingSiStripWorker::DMinitializeDetUnit(), SiStripBadComponentInfo::fillBadComponentMaps(), SiStripQuality::fillBadComponents(), SiStripPI::fillBCArrays(), SiStripQualityDQM::fillGrandSummaryMEs(), ztail.Decoder::follow(), ztail.Decoder::initial_synchronize(), SiStripDigitizerAlgorithm::initializeDetUnit(), SiStripQuality::IsStripBad(), SiStripCorrelateBadStripAndNoise::iterateOnBadStrips(), SiStripQuality::nBadStripsOnTheLeft(), SiStripQuality::nBadStripsOnTheRight(), printDebug(), SiStripQuality::ReduceGranularity(), DigiSimLinkAlgorithm::run(), SiStripQuality::subtraction(), and SiStripQualityStatistics::updateAndSave().

74  {
75  data a;
79  return a;
80  }
static const uint32_t FirstBadStripShift_
static const uint32_t RangeBadStripShift_
static const uint32_t FirstBadStripMask_
Definition: value.py:1
static const uint32_t RangeBadStripMask_
static const uint32_t FlagBadStripShift_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
double a
Definition: hdecay.h:121
static const uint32_t FlagBadStripMask_

◆ decodePhase2()

data SiStripBadStrip::decodePhase2 ( const unsigned int &  value) const
inline

Definition at line 91 of file SiStripBadStrip.h.

References a, siPhase2strip::FirstBadStripMask_, siPhase2strip::FirstBadStripShift_, siPhase2strip::FlagBadStripMask_, siPhase2strip::FlagBadStripShift_, siPhase2strip::RangeBadStripMask_, and siPhase2strip::RangeBadStripShift_.

Referenced by PSSDigitizerAlgorithm::module_killing_DB(), and SSDigitizerAlgorithm::module_killing_DB().

91  {
92  data a;
96  return a;
97  }
static const uint32_t FlagBadStripShift_
static const uint32_t RangeBadStripShift_
static const uint32_t RangeBadStripMask_
Definition: value.py:1
static const uint32_t FlagBadStripMask_
static const uint32_t FirstBadStripMask_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
double a
Definition: hdecay.h:121
static const uint32_t FirstBadStripShift_

◆ encode()

unsigned int SiStripBadStrip::encode ( const unsigned short &  first,
const unsigned short &  NconsecutiveBadStrips,
const unsigned short &  flag = 0 
)
inline

Definition at line 82 of file SiStripBadStrip.h.

References dqmdumpme::first, sistrip::FirstBadStripMask_, sistrip::FirstBadStripShift_, RemoveAddSevLevel::flag, sistrip::FlagBadStripMask_, sistrip::FlagBadStripShift_, sistrip::RangeBadStripMask_, and sistrip::RangeBadStripShift_.

Referenced by SiStripQuality::add(), SiStripPopConFEDErrorsHandlerFromDQM::addBadStrips(), SiStripPopConFEDErrorsHandlerFromDQM::addErrors(), SiStripQuality::addInvalidConnectionFromCabling(), SiStripQuality::addNotConnectedConnectionFromCabling(), SiStripBadAPVAlgorithmFromClusterOccupancy::AnalyzeOccupancy(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::AnalyzeOccupancy(), SiStripQuality::compact(), SiStripPopConBadComponentsHandlerFromDQM::dqmEndJob(), SiStripHotStripAlgorithmFromClusterOccupancy::iterativeSearch(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::iterativeSearch(), SiStripQuality::ReduceGranularity(), SiStripCondObjBuilderFromDb::setDefaultValuesCabling(), SiStripCondObjBuilderFromDb::setValuesCabling(), SiStripQuality::subtraction(), and SiStripQuality::turnOffFeds().

84  {
86  ((NconsecutiveBadStrips & sistrip::RangeBadStripMask_) << sistrip::RangeBadStripShift_) |
88  }
static const uint32_t FirstBadStripShift_
static const uint32_t RangeBadStripShift_
static const uint32_t FirstBadStripMask_
static const uint32_t RangeBadStripMask_
static const uint32_t FlagBadStripShift_
static const uint32_t FlagBadStripMask_

◆ encodePhase2()

unsigned int SiStripBadStrip::encodePhase2 ( const unsigned short &  first,
const unsigned short &  NconsecutiveBadStrips,
const unsigned short &  flag = 0 
)
inline

◆ getDataVectorBegin()

ContainerIterator SiStripBadStrip::getDataVectorBegin ( ) const
inline

◆ getDataVectorEnd()

ContainerIterator SiStripBadStrip::getDataVectorEnd ( ) const
inline

Definition at line 70 of file SiStripBadStrip.h.

References v_badstrips.

70 { return v_badstrips.end(); }
Container v_badstrips

◆ getDetIds()

void SiStripBadStrip::getDetIds ( std::vector< uint32_t > &  DetIds_) const

Definition at line 51 of file SiStripBadStrip.cc.

References SplitLinear::begin, mps_fire::end, indexes, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by SiStripQualityDQM::getActiveDetIds().

51  {
52  // returns vector of DetIds in map
56  DetIds_.push_back(p->detid);
57  }
58 }
Registry::const_iterator RegistryIterator

◆ getRange()

const SiStripBadStrip::Range SiStripBadStrip::getRange ( const uint32_t  detID) const

Definition at line 27 of file SiStripBadStrip.cc.

References indexes, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, AlCaHLTBitMon_ParallelJobs::p, and v_badstrips.

Referenced by SiStripAPVRestorer::abnormalBaselineInspect(), SiStripQuality::add(), SiStripMonitorCluster::analyze(), SiStripDB2Tree::analyze(), SiStripMonitorTrack::clusterInfos(), SiStripQuality::difference(), PreMixingSiStripWorker::DMinitializeDetUnit(), SiStripQualityDQM::fillMEsForDet(), SiStripQualityDQM::fillMEsForLayer(), SiStripDigitizerAlgorithm::initializeDetUnit(), SiStripQuality::IsStripBad(), PSSDigitizerAlgorithm::module_killing_DB(), SSDigitizerAlgorithm::module_killing_DB(), SiStripAPVRestorer::nullInspect(), printDebug(), DigiSimLinkAlgorithm::run(), TT6CMNSubtractor::subtract_(), and IteratedMedianCMNSubtractor::subtract_().

27  {
28  // get SiStripBadStrip Range of DetId
29 
31  if (p == indexes.end() || p->detid != DetId)
32  return SiStripBadStrip::Range(v_badstrips.end(), v_badstrips.end());
33  else {
34  __builtin_prefetch((&v_badstrips.front()) + p->ibegin);
35  __builtin_prefetch((&v_badstrips.front()) + p->ibegin + 24);
36  __builtin_prefetch((&v_badstrips.front()) + p->iend - 24);
37  return SiStripBadStrip::Range(v_badstrips.begin() + p->ibegin, v_badstrips.begin() + p->iend);
38  }
39 }
Registry::const_iterator RegistryIterator
Definition: DetId.h:17
Container v_badstrips
std::pair< ContainerIterator, ContainerIterator > Range

◆ getRangeByPos()

SiStripBadStrip::Range SiStripBadStrip::getRangeByPos ( unsigned short  pos) const

Definition at line 41 of file SiStripBadStrip.cc.

References indexes, AlCaHLTBitMon_ParallelJobs::p, and v_badstrips.

41  {
42  if (pos > indexes.size())
43  return Range(v_badstrips.end(), v_badstrips.end());
44  auto p = indexes.begin() + pos;
45  __builtin_prefetch((&v_badstrips.front()) + p->ibegin);
46  __builtin_prefetch((&v_badstrips.front()) + p->ibegin + 24);
47  __builtin_prefetch((&v_badstrips.front()) + p->iend - 24);
48  return Range(v_badstrips.begin() + p->ibegin, v_badstrips.begin() + p->iend);
49 }
Container v_badstrips
std::pair< ContainerIterator, ContainerIterator > Range

◆ getRegistryVectorBegin()

RegistryIterator SiStripBadStrip::getRegistryVectorBegin ( ) const
inline

◆ getRegistryVectorEnd()

RegistryIterator SiStripBadStrip::getRegistryVectorEnd ( ) const
inline

◆ printDebug()

void SiStripBadStrip::printDebug ( std::stringstream &  ss,
const TrackerTopology trackerTopo 
) const

Definition at line 76 of file SiStripBadStrip.cc.

References decode(), SiStripBadStrip::data::firstStrip, SiStripBadStrip::data::flag, getRange(), indexes, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, SiStripBadStrip::data::range, isotrackApplyRegressor::range, and contentValuesCheck::ss.

Referenced by SiStripQuality::printActiveFedsInfo(), SiStripQuality::setPrintDebugOutput(), and SiStripQuality::turnOffFeds().

76  {
77  ss << "Printing all bad strips for all DetIds" << std::endl;
78  // Loop on the vector<DetRegistry> and take the bad modules and bad strips
79  Registry::const_iterator it = indexes.begin();
80  for (; it != indexes.end(); ++it) {
81  // ss << "For DetId = " << it->detid << std::endl;
83  for (std::vector<unsigned int>::const_iterator badStrip = range.first; badStrip != range.second; ++badStrip) {
84  ss << "DetId=" << it->detid << " Strip=" << decode(*badStrip).firstStrip << ":" << decode(*badStrip).range
85  << " flag=" << decode(*badStrip).flag << std::endl;
86  }
87  }
88 }
unsigned short range
const Range getRange(const uint32_t detID) const
unsigned short firstStrip
std::pair< ContainerIterator, ContainerIterator > Range
data decode(const unsigned int &value) const

◆ printSummary()

void SiStripBadStrip::printSummary ( std::stringstream &  ss,
const TrackerTopology trackerTopo 
) const

Definition at line 60 of file SiStripBadStrip.cc.

References indexes, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and contentValuesCheck::ss.

Referenced by SiStripPopConBadComponentsHandlerFromDQM::getMetaDataString().

60  {
61  SiStripDetSummary summaryBadModules{trackerTopo};
62  SiStripDetSummary summaryBadStrips{trackerTopo};
63 
64  // Loop on the vector<DetRegistry> and take the bad modules and bad strips
65  Registry::const_iterator it = indexes.begin();
66  for (; it != indexes.end(); ++it) {
67  summaryBadModules.add(it->detid);
68  summaryBadStrips.add(it->iend - it->ibegin);
69  }
70  ss << "Summary of bad modules in detector:" << std::endl;
71  summaryBadModules.print(ss, false);
72  ss << "Summary of bad strip in detectors:" << std::endl;
73  summaryBadStrips.print(ss, false);
74 }

◆ put() [1/2]

bool SiStripBadStrip::put ( const uint32_t &  detID,
const InputVector vect 
)
inline

◆ put() [2/2]

bool SiStripBadStrip::put ( const uint32_t &  detID,
Range  input 
)

Definition at line 7 of file SiStripBadStrip.cc.

References SiStripBadStrip::DetRegistry::detid, SiStripBadStrip::DetRegistry::ibegin, SiStripBadStrip::DetRegistry::iend, indexes, input, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, AlCaHLTBitMon_ParallelJobs::p, and v_badstrips.

7  {
8  // put in SiStripBadStrip::v_badstrips of DetId
9  Registry::iterator p = std::lower_bound(indexes.begin(), indexes.end(), DetId, SiStripBadStrip::StrictWeakOrdering());
10  if (p != indexes.end() && p->detid == DetId) {
11  edm::LogError("SiStripBadStrip") << "[" << __PRETTY_FUNCTION__ << "] SiStripBadStrip for DetID " << DetId
12  << " is already stored. Skipping this put" << std::endl;
13  return false;
14  }
15 
16  size_t sd = input.second - input.first;
17  DetRegistry detregistry;
18  detregistry.detid = DetId;
19  detregistry.ibegin = v_badstrips.size();
20  detregistry.iend = v_badstrips.size() + sd;
21  indexes.insert(p, detregistry);
22 
23  v_badstrips.insert(v_badstrips.end(), input.first, input.second);
24  return true;
25 }
Log< level::Error, false > LogError
static std::string const input
Definition: EdmProvDump.cc:50
Definition: DetId.h:17
Container v_badstrips

◆ serialize()

template<class Archive >
void SiStripBadStrip::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 111 of file SiStripBadStrip.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 111 of file SiStripBadStrip.h.

Member Data Documentation

◆ indexes

Registry SiStripBadStrip::indexes
protected

◆ v_badstrips

Container SiStripBadStrip::v_badstrips
protected