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 | Protected Attributes
SiStripBadStrip Class Reference

#include <SiStripBadStrip.h>

Inheritance diagram for SiStripBadStrip:
GCC11_FINAL< T, TOPO >

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
 
void printSummary (std::stringstream &ss) 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

 COND_SERIALIZABLE
 
Registry indexes
 
Container v_badstrips
 

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 29 of file SiStripBadStrip.h.

Member Typedef Documentation

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

Definition at line 52 of file SiStripBadStrip.h.

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

Definition at line 53 of file SiStripBadStrip.h.

Definition at line 57 of file SiStripBadStrip.h.

Definition at line 54 of file SiStripBadStrip.h.

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

Definition at line 55 of file SiStripBadStrip.h.

typedef Registry::const_iterator SiStripBadStrip::RegistryIterator

Definition at line 56 of file SiStripBadStrip.h.

Constructor & Destructor Documentation

SiStripBadStrip::SiStripBadStrip ( )
inline

Definition at line 59 of file SiStripBadStrip.h.

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

Definition at line 60 of file SiStripBadStrip.h.

References indexes, and v_badstrips.

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

Definition at line 64 of file SiStripBadStrip.h.

64 {};

Member Function Documentation

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

Definition at line 80 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 SiStripFEDErrorsDQM::addErrors(), and printDebug().

80  {
81  data a;
85  return a;
86  }
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:82
double a
Definition: hdecay.h:121
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 88 of file SiStripBadStrip.h.

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

Referenced by SiStripFEDErrorsDQM::addBadStrips(), SiStripFEDErrorsDQM::addErrors(), SiStripBadFiberBuilder::algoAnalyze(), SiStripBadChannelBuilder::algoAnalyze(), SiStripBadStripFromASCIIFile::getNewObject(), SiStripBadModuleByHandBuilder::getNewObject(), and SiStripBadComponentsDQMService::readBadComponents().

88  {
90  }
static const uint32_t FirstBadStripShift_
static const uint32_t RangeBadStripShift_
static const uint32_t FirstBadStripMask_
bool first
Definition: L1TdeRCT.cc:75
static const uint32_t RangeBadStripMask_
static const uint32_t FlagBadStripShift_
static const uint32_t FlagBadStripMask_
ContainerIterator SiStripBadStrip::getDataVectorBegin ( ) const
inline

Definition at line 74 of file SiStripBadStrip.h.

References v_badstrips.

74 {return v_badstrips.begin();}
Container v_badstrips
ContainerIterator SiStripBadStrip::getDataVectorEnd ( ) const
inline

Definition at line 75 of file SiStripBadStrip.h.

References v_badstrips.

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

Definition at line 50 of file SiStripBadStrip.cc.

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

50  {
51  // returns vector of DetIds in map
54  for (SiStripBadStrip::RegistryIterator p=begin; p != end; ++p) {
55  DetIds_.push_back(p->detid);
56  }
57 }
Registry::const_iterator RegistryIterator
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
const SiStripBadStrip::Range SiStripBadStrip::getRange ( const uint32_t  detID) const

Definition at line 26 of file SiStripBadStrip.cc.

References indexes, AlCaHLTBitMon_ParallelJobs::p, and v_badstrips.

Referenced by printDebug().

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

Definition at line 40 of file SiStripBadStrip.cc.

References indexes, AlCaHLTBitMon_ParallelJobs::p, and v_badstrips.

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

Definition at line 76 of file SiStripBadStrip.h.

References indexes.

76 {return indexes.begin();}
RegistryIterator SiStripBadStrip::getRegistryVectorEnd ( ) const
inline

Definition at line 77 of file SiStripBadStrip.h.

References indexes.

77 {return indexes.end();}
void SiStripBadStrip::printDebug ( std::stringstream &  ss) const

Definition at line 75 of file SiStripBadStrip.cc.

References decode(), SiStripBadStrip::data::firstStrip, SiStripBadStrip::data::flag, getRange(), indexes, and SiStripBadStrip::data::range.

75  {
76  ss << "Printing all bad strips for all DetIds" << std::endl;
77  // Loop on the vector<DetRegistry> and take the bad modules and bad strips
78  Registry::const_iterator it = indexes.begin();
79  for( ; it!=indexes.end(); ++it ) {
80 // ss << "For DetId = " << it->detid << std::endl;
81  SiStripBadStrip::Range range(getRange(it->detid));
82  for( std::vector<unsigned int>::const_iterator badStrip = range.first;
83  badStrip != range.second; ++badStrip ) {
84  ss << "DetId="<<it->detid << " Strip=" << decode(*badStrip).firstStrip <<":"<<decode(*badStrip).range << " flag="<< decode(*badStrip).flag << std::endl;
85  }
86  }
87 }
unsigned short range
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

Definition at line 59 of file SiStripBadStrip.cc.

References SiStripDetSummary::add(), indexes, and SiStripDetSummary::print().

Referenced by SiStripBadComponentsDQMService::getMetaDataString().

59  {
60  SiStripDetSummary summaryBadModules;
61  SiStripDetSummary summaryBadStrips;
62 
63  // Loop on the vector<DetRegistry> and take the bad modules and bad strips
64  Registry::const_iterator it = indexes.begin();
65  for( ; it!=indexes.end(); ++it ) {
66  summaryBadModules.add(it->detid);
67  summaryBadStrips.add(it->iend - it->ibegin);
68  }
69  ss << "Summary of bad modules in detector:" << std::endl;
70  summaryBadModules.print(ss, false);
71  ss << "Summary of bad strip in detectors:" << std::endl;
72  summaryBadStrips.print(ss, false);
73 }
void print(std::stringstream &ss, const bool mean=true) const
void add(const DetId &detid, const float &value)
Used to compute the mean value of the value variable divided by subdetector, layer and mono/stereo...
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, 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 << " is already stored. Skippig this put" << std::endl;
12  return false;
13  }
14 
15  size_t sd= input.second-input.first;
16  DetRegistry detregistry;
17  detregistry.detid=DetId;
18  detregistry.ibegin=v_badstrips.size();
19  detregistry.iend=v_badstrips.size()+sd;
20  indexes.insert(p,detregistry);
21 
22  v_badstrips.insert(v_badstrips.end(),input.first,input.second);
23  return true;
24 }
static std::string const input
Definition: EdmProvDump.cc:44
Definition: DetId.h:18
Container v_badstrips
double sd

Member Data Documentation

SiStripBadStrip::COND_SERIALIZABLE
protected

Definition at line 96 of file SiStripBadStrip.h.

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