CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
ContainerIterator
Range
 
typedef std::vector< DetRegistryRegistry
 
typedef Registry::const_iterator RegistryIterator
 

Public Member Functions

data decode (const unsigned int &value) const
 
unsigned int encode (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 ()
 
 SiStripBadStrip (const SiStripBadStrip &orig)
 
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

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

Definition at line 51 of file SiStripBadStrip.h.

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

Definition at line 52 of file SiStripBadStrip.h.

Definition at line 56 of file SiStripBadStrip.h.

Definition at line 53 of file SiStripBadStrip.h.

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

Definition at line 54 of file SiStripBadStrip.h.

typedef Registry::const_iterator SiStripBadStrip::RegistryIterator

Definition at line 55 of file SiStripBadStrip.h.

Constructor & Destructor Documentation

SiStripBadStrip::SiStripBadStrip ( )
inline

Definition at line 58 of file SiStripBadStrip.h.

58 {};
SiStripBadStrip::SiStripBadStrip ( const SiStripBadStrip orig)
inline

Definition at line 59 of file SiStripBadStrip.h.

References indexes, and v_badstrips.

59  {
60  v_badstrips = orig.v_badstrips;
61  indexes = orig.indexes;
62  }
Container v_badstrips
virtual SiStripBadStrip::~SiStripBadStrip ( )
inlinevirtual

Definition at line 63 of file SiStripBadStrip.h.

63 {};

Member Function Documentation

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

Definition at line 78 of file SiStripBadStrip.h.

References a, sistrip::FirstBadStripMask_, sistrip::FirstBadStripShift_, SiStripBadStrip::data::firstStrip, SiStripBadStrip::data::flag, sistrip::FlagBadStripMask_, sistrip::FlagBadStripShift_, SiStripBadStrip::data::range, sistrip::RangeBadStripMask_, and sistrip::RangeBadStripShift_.

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

78  {
79  data a;
83  return a;
84  }
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_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
double a
Definition: hdecay.h:119
static const uint32_t FlagBadStripMask_
unsigned int SiStripBadStrip::encode ( const unsigned short &  first,
const unsigned short &  NconsecutiveBadStrips,
const unsigned short &  flag = 0 
)
inline

Definition at line 86 of file SiStripBadStrip.h.

References sistrip::FirstBadStripMask_, sistrip::FirstBadStripShift_, 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().

88  {
90  ((NconsecutiveBadStrips & sistrip::RangeBadStripMask_) << sistrip::RangeBadStripShift_) |
92  }
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_
ContainerIterator SiStripBadStrip::getDataVectorBegin ( ) const
inline
ContainerIterator SiStripBadStrip::getDataVectorEnd ( ) const
inline

Definition at line 74 of file SiStripBadStrip.h.

References v_badstrips.

74 { return v_badstrips.end(); }
Container v_badstrips
void SiStripBadStrip::getDetIds ( std::vector< uint32_t > &  DetIds_) const

Definition at line 51 of file SiStripBadStrip.cc.

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

51  {
52  // returns vector of DetIds in map
55  for (SiStripBadStrip::RegistryIterator p = begin; p != end; ++p) {
56  DetIds_.push_back(p->detid);
57  }
58 }
Registry::const_iterator RegistryIterator
string end
Definition: dataset.py:937
const SiStripBadStrip::Range SiStripBadStrip::getRange ( const uint32_t  detID) const

Definition at line 27 of file SiStripBadStrip.cc.

References indexes, cuda_std::lower_bound(), AlCaHLTBitMon_ParallelJobs::p, and v_badstrips.

Referenced by SiStripAPVRestorer::abnormalBaselineInspect(), SiStripQuality::add(), SiStripMonitorCluster::analyze(), SiStripMonitorTrack::clusterInfos(), SiStripQuality::difference(), PreMixingSiStripWorker::DMinitializeDetUnit(), MeasurementTrackerImpl::initializeStripStatus(), SiStripQuality::IsStripBad(), SiStripAPVRestorer::nullInspect(), printDebug(), 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
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
std::pair< ContainerIterator, ContainerIterator > Range
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
RegistryIterator SiStripBadStrip::getRegistryVectorBegin ( ) const
inline
RegistryIterator SiStripBadStrip::getRegistryVectorEnd ( ) const
inline
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, SiStripBadStrip::data::range, and sistrip::SpyUtilities::range().

Referenced by SiStripQuality::setPrintDebugOutput().

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 uint16_t range(const Frame &aFrame)
unsigned short firstStrip
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
data decode(const unsigned int &value) const
void SiStripBadStrip::printSummary ( std::stringstream &  ss,
const TrackerTopology trackerTopo 
) const

Definition at line 60 of file SiStripBadStrip.cc.

References indexes.

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 }
bool SiStripBadStrip::put ( const uint32_t &  detID,
const InputVector vect 
)
inline
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, cuda_std::lower_bound(), AlCaHLTBitMon_ParallelJobs::p, sd, 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. Skippig 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:47
Definition: DetId.h:17
Container v_badstrips
double sd
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
template<class Archive >
void SiStripBadStrip::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 98 of file SiStripBadStrip.h.

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

Definition at line 98 of file SiStripBadStrip.h.

Member Data Documentation

Registry SiStripBadStrip::indexes
protected
Container SiStripBadStrip::v_badstrips
protected